diff --git a/.clang-format b/.clang-format index 03ea4a3a..d4450a21 100644 --- a/.clang-format +++ b/.clang-format @@ -1,18 +1,23 @@ IndentWidth: 4 Language: Cpp -AlignAfterOpenBracket: Align -SortIncludes: false -ColumnLimit: 104 -PointerAlignment: Right -AllowShortFunctionsOnASingleLine: false -AllowShortIfStatementsOnASingleLine: false -BinPackArguments: true -BinPackParameters: true -SpaceAfterCStyleCast: true +UseTab: Never +ColumnLimit: 120 +PointerAlignment: Left BreakBeforeBraces: Attach -BreakBeforeTernaryOperators: true -BreakBeforeBinaryOperators: NonAssignment +SpaceAfterCStyleCast: false Cpp11BracedListStyle: false IndentCaseLabels: true +BinPackArguments: true +BinPackParameters: true +AlignAfterOpenBracket: Align +AlignOperands: true +BreakBeforeTernaryOperators: true +BreakBeforeBinaryOperators: None +AllowShortBlocksOnASingleLine: true +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: false +AlignEscapedNewlines: Left AlignTrailingComments: true -UseTab: Never +SortIncludes: false \ No newline at end of file diff --git a/run-clang-format.ps1 b/run-clang-format.ps1 new file mode 100644 index 00000000..2c1ffe9e --- /dev/null +++ b/run-clang-format.ps1 @@ -0,0 +1,49 @@ +Using Namespace System +$url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-14.0.6/LLVM-14.0.6-win64.exe" +$llvmInstallerPath = ".\LLVM-14.0.6-win64.exe" +$clangFormatFilePath = ".\clang-format.exe" +$requiredVersion = "clang-format version 14.0.6" +$currentVersion = "" + +function Test-7ZipInstalled { + $sevenZipPath = "C:\Program Files\7-Zip\7z.exe" + return Test-Path $sevenZipPath -PathType Leaf +} + +if (Test-Path $clangFormatFilePath) { + $currentVersion = & $clangFormatFilePath --version + if (-not ($currentVersion -eq $requiredVersion)) { + # Delete the existing file if the version is incorrect + Remove-Item $clangFormatFilePath -Force + } +} + +if (-not (Test-Path $clangFormatFilePath) -or ($currentVersion -ne $requiredVersion)) { + if (-not (Test-7ZipInstalled)) { + Write-Host "7-Zip is not installed. Please install 7-Zip and run the script again." + exit + } + + $wc = New-Object net.webclient + $wc.Downloadfile($url, $PSScriptRoot + $llvmInstallerPath) + + $sevenZipPath = "C:\Program Files\7-Zip\7z.exe" + $specificFileInArchive = "bin\clang-format.exe" + & "$sevenZipPath" e $llvmInstallerPath $specificFileInArchive + + Remove-Item $llvmInstallerPath -Force +} + +$basePath = (Resolve-Path .).Path +$files = Get-ChildItem -Path $basePath -Recurse -File ` + | Where-Object { ($_.Extension -eq '.c' -or $_.Extension -eq '.cpp' -or ` + (($_.Extension -eq '.h' -or $_.Extension -eq '.hpp') -and ` + (-not ($_.FullName -like "*\src\*" -or $_.FullName -like "*\include\*")))) -and ` + (-not ($_.FullName -like "*\assets\*" -or $_.FullName -like "*\build\*")) } + +for ($i = 0; $i -lt $files.Length; $i++) { + $file = $files[$i] + $relativePath = $file.FullName.Substring($basePath.Length + 1) + Write-Host "Formatting [$($i+1)/$($files.Length)] $relativePath" + .\clang-format.exe -i $file.FullName +} diff --git a/run-clang-format.sh b/run-clang-format.sh new file mode 100755 index 00000000..764ed777 --- /dev/null +++ b/run-clang-format.sh @@ -0,0 +1,36 @@ +# this line does quite a bit, so let's break it down +# +# find soh +# use "find" to look in the "soh" directory +# this ensures we don't try to format stuff in the submodules +# +# -type f +# only look for files +# +# -name "*.c" -o -name "*.cpp" +# find all .c and .cpp files +# +# ( -name "*.h" -o -name "*.hpp" ) ! -path "soh/src/**.h" ! -path "soh/include/**.h" +# find all .h and .hpp files that aren't in soh/src or soh/include +# this is because zret decomp only runs clang-format on c files +# https://github.com/zeldaret/mm/blob/b7e5468ca16315a7e322055eff3d97fe980bbc25/format.py#L182 +# +# ! -path "soh/assets/*" +# asset headers are autogenerated, don't fight them +# +# -print0 +# separate paths with NUL bytes, avoiding issues with spaces in paths +# +# | xargs -0 clang-format-14 -i -verbose +# use xargs to take each path we've found +# and pass it as an argument to clang-format +# verbose to print files being formatted and X out of Y status + +# Autodetect the command +if command -v clang-format-14 &> /dev/null; then + CLANG_FORMAT="clang-format-14" +else + CLANG_FORMAT="clang-format" +fi + +find src -type f \( -name "*.c" -o -name "*.cpp" -o \( \( -name "*.h" -o -name "*.hpp" \) ! -path "src/*" ! -path "include/*" \) \) ! -path "assets/*" -print0 | xargs -0 $CLANG_FORMAT -i --verbose diff --git a/src/audio/audio_session_presets_sh.c b/src/audio/audio_session_presets_sh.c index 958ec15a..9b9e8ef3 100644 --- a/src/audio/audio_session_presets_sh.c +++ b/src/audio/audio_session_presets_sh.c @@ -4,31 +4,31 @@ #ifdef VERSION_SH struct ReverbSettingsEU sReverbSettings[] = { - {0x01, 0x30, 0x2fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000}, - {0x01, 0x28, 0x47ff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000}, - {0x01, 0x40, 0x2fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000}, - {0x01, 0x38, 0x3fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000}, - {0x01, 0x30, 0x4fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000}, - {0x01, 0x28, 0x37ff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000}, + { 0x01, 0x30, 0x2fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000 }, + { 0x01, 0x28, 0x47ff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000 }, + { 0x01, 0x40, 0x2fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000 }, + { 0x01, 0x38, 0x3fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000 }, + { 0x01, 0x30, 0x4fff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000 }, + { 0x01, 0x28, 0x37ff, 0x0000, 0x0000, -1, 0x3000, 0x0000, 0x0000 }, }; struct AudioSessionSettingsEU gAudioSessionPresets[] = { - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, - 0x00000000, 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, - 0x00000000, 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[2], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, - 0x00000000, 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[3], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, - 0x00000000, 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[4], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, - 0x00000000, 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00004000, 0x00006e00, - 0x00000000, 0x00003f00, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00004100, 0x00006e00, - 0x00000000, 0x00004400, 0x00002a80, 0x00000000, 0x00000000, 0x00000000 }, - { 0x00007d00, 0x01, 0x14, 0x01, 0x00, &sReverbSettings[5], 0x7fff, 0x0000, 0x00003500, 0x00006280, - 0x00000000, 0x00004000, 0x00001b00, 0x00000000, 0x00000000, 0x00000000 } + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, 0x00000000, + 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, 0x00000000, + 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[2], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, 0x00000000, + 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[3], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, 0x00000000, + 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[4], 0x7fff, 0x0000, 0x00003a40, 0x00006d00, 0x00000000, + 0x00004400, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[0], 0x7fff, 0x0000, 0x00004000, 0x00006e00, 0x00000000, + 0x00003f00, 0x00002a00, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x10, 0x01, 0x00, &sReverbSettings[1], 0x7fff, 0x0000, 0x00004100, 0x00006e00, 0x00000000, + 0x00004400, 0x00002a80, 0x00000000, 0x00000000, 0x00000000 }, + { 0x00007d00, 0x01, 0x14, 0x01, 0x00, &sReverbSettings[5], 0x7fff, 0x0000, 0x00003500, 0x00006280, 0x00000000, + 0x00004000, 0x00001b00, 0x00000000, 0x00000000, 0x00000000 } }; s8 gUnusedCount80333EE8 = UNUSED_COUNT_80333EE8; diff --git a/src/audio/copt/seq_channel_layer_process_script_copt.inc.c b/src/audio/copt/seq_channel_layer_process_script_copt.inc.c index 3f51fdba..5fae93f8 100644 --- a/src/audio/copt/seq_channel_layer_process_script_copt.inc.c +++ b/src/audio/copt/seq_channel_layer_process_script_copt.inc.c @@ -19,23 +19,23 @@ #define PORTAMENTO_MODE_4 4 #define PORTAMENTO_MODE_5 5 -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; - struct AudioBankSound *sound; - struct Instrument *instrument; - struct Drum *drum; +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; + struct AudioBankSound* sound; + struct Instrument* instrument; + 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; @@ -50,7 +50,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { sameSound = TRUE; - if(layer == NULL) { + if (layer == NULL) { return; } @@ -80,10 +80,10 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { seqPlayer = (*seqChannel).seqPlayer; for (;;) { state = &layer->scriptState; -// M64_READ_U8(state, cmd); -// cmd = m64_read_u8(state); + // M64_READ_U8(state, cmd); + // cmd = m64_read_u8(state); { - u8 *_ptr_pc; + u8* _ptr_pc; _ptr_pc = (*state).pc++; cmd = *_ptr_pc; } @@ -133,7 +133,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { if (cmd == 0xc1) { layer->velocitySquare = (f32)(temp_a0_5 * temp_a0_5); } else { - layer->pan = (f32) temp_a0_5 / US_FLOAT(128.0); + layer->pan = (f32)temp_a0_5 / US_FLOAT(128.0); } break; @@ -150,7 +150,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { case 0xc4: // layer_somethingon case 0xc5: // layer_somethingoff //! copt needs a ternary: - //layer->continuousNotes = (cmd == 0xc4) ? TRUE : FALSE; + // layer->continuousNotes = (cmd == 0xc4) ? TRUE : FALSE; { u8 setting; if (cmd == 0xc4) { @@ -244,7 +244,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { layer->noteDuration = *((*state).pc++); goto l1090; } -l1090: + l1090: cmdSemitone = cmd - (cmd & 0xc0); layer->velocitySquare = vel * vel; } else { @@ -262,17 +262,15 @@ l1090: sp3A = layer->playPercentage; goto l1138; } -l1138: + l1138: cmdSemitone = cmd - (cmd & 0xc0); } layer->delay = sp3A; layer->duration = layer->noteDuration * sp3A / 256; - if ((seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_STOP_NOTES) != 0) - || seqChannel->stopSomething2 - || !seqChannel->hasInstrument - ) { + if ((seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_STOP_NOTES) != 0) || + seqChannel->stopSomething2 || !seqChannel->hasInstrument) { layer->stopSomething = TRUE; } else { if (seqChannel->instOrWave == 0) { // drum @@ -319,9 +317,9 @@ l1138: } if (instrument != NULL) { - sound = (u8) usedSemitone < instrument->normalRangeLo ? &instrument->lowNotesSound - : (u8) usedSemitone <= instrument->normalRangeHi ? - &instrument->normalNotesSound : &instrument->highNotesSound; + sound = (u8)usedSemitone < instrument->normalRangeLo ? &instrument->lowNotesSound + : (u8)usedSemitone <= instrument->normalRangeHi ? &instrument->normalNotesSound + : &instrument->highNotesSound; sameSound = (sound == (*layer).sound); layer->sound = sound; @@ -349,12 +347,12 @@ l1138: sp24 = temp_f12; goto l13cc; } -l13cc: + 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 - * FLOAT_CAST((*layer).portamentoTime)); + portamento->speed = US_FLOAT(32512.0) * FLOAT_CAST((*seqPlayer).tempo) / + ((f32)(*layer).delay * (f32)gTempoInternalToExternal * + FLOAT_CAST((*layer).portamentoTime)); } else { portamento->speed = US_FLOAT(127.0) / FLOAT_CAST((*layer).portamentoTime); } @@ -364,9 +362,9 @@ l13cc: layer->portamentoTargetNote = cmdSemitone; } } else if (instrument != NULL) { - sound = cmdSemitone < instrument->normalRangeLo ? - &instrument->lowNotesSound : cmdSemitone <= instrument->normalRangeHi ? - &instrument->normalNotesSound : &instrument->highNotesSound; + sound = cmdSemitone < instrument->normalRangeLo ? &instrument->lowNotesSound + : cmdSemitone <= instrument->normalRangeHi ? &instrument->normalNotesSound + : &instrument->highNotesSound; sameSound = (sound == (*layer).sound); layer->sound = sound; diff --git a/src/audio/data.c b/src/audio/data.c index c856da37..eb288c2e 100644 --- a/src/audio/data.c +++ b/src/audio/data.c @@ -9,31 +9,25 @@ extern struct OSMesgQueue OSMesgQueue2; 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 } -}; +struct ReverbSettingsEU sReverbSettings[] = { { 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 @@ -94,16 +88,14 @@ struct AudioSessionSettings gAudioSessionPresetsUS[] = { // gAudioCosineTable[k] = round((2**15 - 1) * cos(pi/2 * k / 127)). Unused. #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, + 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, }; #endif @@ -117,35 +109,32 @@ f32 gPitchBendFrequencyScale[256] = { #else f32 gPitchBendFrequencyScale[255] = { #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, - 0.608557f, 0.611888f, 0.615236f, 0.618603f, 0.621989f, 0.625393f, 0.628815f, 0.632257f, 0.635717f, - 0.639196f, 0.642694f, 0.646212f, 0.649748f, 0.653304f, 0.656880f, 0.660475f, 0.664089f, 0.667724f, - 0.671378f, 0.675052f, 0.678747f, 0.682461f, 0.686196f, 0.689952f, 0.693727f, 0.697524f, 0.701341f, - 0.705180f, 0.709039f, 0.712919f, 0.716821f, 0.720744f, 0.724689f, 0.728655f, 0.732642f, 0.736652f, - 0.740684f, 0.744737f, 0.748813f, 0.752911f, 0.757031f, 0.761175f, 0.765340f, 0.769529f, 0.773740f, - 0.777975f, 0.782232f, 0.786513f, 0.790818f, 0.795146f, 0.799497f, 0.803873f, 0.808272f, 0.812696f, - 0.817144f, 0.821616f, 0.826112f, 0.830633f, 0.835179f, 0.839750f, 0.844346f, 0.848966f, 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, 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, - 1.210489f, 1.217114f, 1.223775f, 1.230473f, 1.237207f, 1.243978f, 1.250786f, 1.257631f, 1.264514f, - 1.271434f, 1.278392f, 1.285389f, 1.292423f, 1.299497f, 1.306608f, 1.313759f, 1.320949f, 1.328178f, - 1.335447f, 1.342756f, 1.350104f, 1.357493f, 1.364922f, 1.372392f, 1.379903f, 1.387455f, 1.395048f, - 1.402683f, 1.410360f, 1.418078f, 1.425839f, 1.433642f, 1.441488f, 1.449377f, 1.457309f, 1.465285f, - 1.473304f, 1.481367f, 1.489474f, 1.497626f, 1.505822f, 1.514063f, 1.522349f, 1.530681f, 1.539058f, - 1.547481f, 1.555950f, 1.564465f, 1.573027f, 1.581636f, 1.590292f, 1.598995f, 1.607746f, 1.616545f, - 1.625392f, 1.634287f, 1.643231f, 1.652224f, 1.661266f, 1.670358f, 1.679500f, 1.688691f, 1.697933f, - 1.707225f, 1.716569f, 1.725963f, 1.735409f, 1.744906f, 1.754456f, 1.764058f, 1.773712f, 1.783419f, - 1.793179f, 1.802993f, 1.812860f, 1.822782f, 1.832757f, 1.842788f, 1.852873f, 1.863013f, 1.873209f, - 1.883461f, 1.893768f, 1.904132f, 1.914553f, 1.925031f, 1.935567f, 1.946159f, 1.956810f, 1.967520f, - 1.978287f, 1.989114f, 2.0f + 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, 0.608557f, 0.611888f, 0.615236f, 0.618603f, + 0.621989f, 0.625393f, 0.628815f, 0.632257f, 0.635717f, 0.639196f, 0.642694f, 0.646212f, 0.649748f, 0.653304f, + 0.656880f, 0.660475f, 0.664089f, 0.667724f, 0.671378f, 0.675052f, 0.678747f, 0.682461f, 0.686196f, 0.689952f, + 0.693727f, 0.697524f, 0.701341f, 0.705180f, 0.709039f, 0.712919f, 0.716821f, 0.720744f, 0.724689f, 0.728655f, + 0.732642f, 0.736652f, 0.740684f, 0.744737f, 0.748813f, 0.752911f, 0.757031f, 0.761175f, 0.765340f, 0.769529f, + 0.773740f, 0.777975f, 0.782232f, 0.786513f, 0.790818f, 0.795146f, 0.799497f, 0.803873f, 0.808272f, 0.812696f, + 0.817144f, 0.821616f, 0.826112f, 0.830633f, 0.835179f, 0.839750f, 0.844346f, 0.848966f, 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, 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, 1.210489f, 1.217114f, 1.223775f, 1.230473f, 1.237207f, 1.243978f, 1.250786f, 1.257631f, + 1.264514f, 1.271434f, 1.278392f, 1.285389f, 1.292423f, 1.299497f, 1.306608f, 1.313759f, 1.320949f, 1.328178f, + 1.335447f, 1.342756f, 1.350104f, 1.357493f, 1.364922f, 1.372392f, 1.379903f, 1.387455f, 1.395048f, 1.402683f, + 1.410360f, 1.418078f, 1.425839f, 1.433642f, 1.441488f, 1.449377f, 1.457309f, 1.465285f, 1.473304f, 1.481367f, + 1.489474f, 1.497626f, 1.505822f, 1.514063f, 1.522349f, 1.530681f, 1.539058f, 1.547481f, 1.555950f, 1.564465f, + 1.573027f, 1.581636f, 1.590292f, 1.598995f, 1.607746f, 1.616545f, 1.625392f, 1.634287f, 1.643231f, 1.652224f, + 1.661266f, 1.670358f, 1.679500f, 1.688691f, 1.697933f, 1.707225f, 1.716569f, 1.725963f, 1.735409f, 1.744906f, + 1.754456f, 1.764058f, 1.773712f, 1.783419f, 1.793179f, 1.802993f, 1.812860f, 1.822782f, 1.832757f, 1.842788f, + 1.852873f, 1.863013f, 1.873209f, 1.883461f, 1.893768f, 1.904132f, 1.914553f, 1.925031f, 1.935567f, 1.946159f, + 1.956810f, 1.967520f, 1.978287f, 1.989114f, 2.0f }; // Frequencies for notes using the standard twelve-tone equal temperament scale. @@ -198,266 +187,229 @@ struct NoteSubEu gDefaultNoteSub = { 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 #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, - -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, - 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, - 0x5fff, 0x67ff, 0x6fff, 0x77ff, 0x8001, 0x8801, 0x9001, 0x9801, 0xa001, 0xa801, 0xb001, - 0xb801, 0xc001, 0xc801, 0xd001, 0xd801, 0xe001, 0xe801, 0xf001, 0xf801, - 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, - 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, - 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, - 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, - 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, - 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, - 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, - 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001 + 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, 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, 0x5fff, 0x67ff, 0x6fff, 0x77ff, + 0x8001, 0x8801, 0x9001, 0x9801, 0xa001, 0xa801, 0xb001, 0xb801, 0xc001, 0xc801, 0xd001, 0xd801, 0xe001, 0xe801, + 0xf001, 0xf801, 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, 0x8001, 0x9001, 0xa001, 0xb001, + 0xc001, 0xd001, 0xe001, 0xf001, 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, 0x8001, 0x9001, + 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, + 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, + 0x5fff, 0x6fff, 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, 0x0000, 0x1fff, 0x3fff, 0x5fff, + 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, + 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, + 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, + 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, + 0x8001, 0xa001, 0xc001, 0xe001 }; s16 sTriangleWaves[256] = { - 0x0000, 0x07ff, 0x0fff, 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, 0x0fff, 0x07ff, 0x0000, 0xf801, 0xf001, 0xe801, - 0xe001, 0xd801, 0xd001, 0xc801, 0xc001, 0xb801, 0xb001, 0xa801, 0xa001, 0x9801, 0x9001, 0x8801, - 0x8001, 0x8801, 0x9001, 0x9801, 0xa001, 0xa801, 0xb001, 0xb801, 0xc001, 0xc801, 0xd001, 0xd801, - 0xe001, 0xe801, 0xf001, 0xf801, 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, - 0x7fff, 0x6fff, 0x5fff, 0x4fff, 0x3fff, 0x2fff, 0x1fff, 0x0fff, 0x0000, 0xf001, 0xe001, 0xd001, - 0xc001, 0xb001, 0xa001, 0x9001, 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, - 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, 0x7fff, 0x6fff, 0x5fff, 0x4fff, - 0x3fff, 0x2fff, 0x1fff, 0x0fff, 0x0000, 0xf001, 0xe001, 0xd001, 0xc001, 0xb001, 0xa001, 0x9001, - 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, 0x0000, 0x1fff, 0x3fff, 0x5fff, - 0x7fff, 0x5fff, 0x3fff, 0x1fff, 0x0000, 0xe001, 0xc001, 0xa001, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x7fff, 0x5fff, 0x3fff, 0x1fff, 0x0000, 0xe001, 0xc001, 0xa001, - 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x7fff, 0x5fff, 0x3fff, 0x1fff, - 0x0000, 0xe001, 0xc001, 0xa001, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, - 0x7fff, 0x5fff, 0x3fff, 0x1fff, 0x0000, 0xe001, 0xc001, 0xa001, 0x8001, 0xa001, 0xc001, 0xe001, - 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, - 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, - 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, - 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, - 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, + 0x0000, 0x07ff, 0x0fff, 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, 0x0fff, 0x07ff, 0x0000, 0xf801, 0xf001, 0xe801, 0xe001, 0xd801, 0xd001, 0xc801, 0xc001, 0xb801, + 0xb001, 0xa801, 0xa001, 0x9801, 0x9001, 0x8801, 0x8001, 0x8801, 0x9001, 0x9801, 0xa001, 0xa801, 0xb001, 0xb801, + 0xc001, 0xc801, 0xd001, 0xd801, 0xe001, 0xe801, 0xf001, 0xf801, 0x0000, 0x0fff, 0x1fff, 0x2fff, 0x3fff, 0x4fff, + 0x5fff, 0x6fff, 0x7fff, 0x6fff, 0x5fff, 0x4fff, 0x3fff, 0x2fff, 0x1fff, 0x0fff, 0x0000, 0xf001, 0xe001, 0xd001, + 0xc001, 0xb001, 0xa001, 0x9001, 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, 0xe001, 0xf001, 0x0000, 0x0fff, + 0x1fff, 0x2fff, 0x3fff, 0x4fff, 0x5fff, 0x6fff, 0x7fff, 0x6fff, 0x5fff, 0x4fff, 0x3fff, 0x2fff, 0x1fff, 0x0fff, + 0x0000, 0xf001, 0xe001, 0xd001, 0xc001, 0xb001, 0xa001, 0x9001, 0x8001, 0x9001, 0xa001, 0xb001, 0xc001, 0xd001, + 0xe001, 0xf001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x7fff, 0x5fff, 0x3fff, 0x1fff, 0x0000, 0xe001, 0xc001, 0xa001, + 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x7fff, 0x5fff, 0x3fff, 0x1fff, 0x0000, 0xe001, + 0xc001, 0xa001, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x7fff, 0x5fff, 0x3fff, 0x1fff, + 0x0000, 0xe001, 0xc001, 0xa001, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x1fff, 0x3fff, 0x5fff, 0x7fff, 0x5fff, + 0x3fff, 0x1fff, 0x0000, 0xe001, 0xc001, 0xa001, 0x8001, 0xa001, 0xc001, 0xe001, 0x0000, 0x3fff, 0x7fff, 0x3fff, + 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, + 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, + 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, + 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, 0x0000, 0x3fff, 0x7fff, 0x3fff, 0x0000, 0xc001, 0x8001, 0xc001, }; s16 sSineWaves[256] = { - 0x0000, 0x0c8b, 0x18f8, 0x2527, 0x30fb, 0x3c56, 0x471c, 0x5133, 0x5a81, 0x62f1, 0x6a6c, 0x70e1, - 0x7640, 0x7a7c, 0x7d89, 0x7f61, 0x7fff, 0x7f61, 0x7d89, 0x7a7c, 0x7640, 0x70e1, 0x6a6c, 0x62f1, - 0x5a81, 0x5133, 0x471c, 0x3c56, 0x30fb, 0x2527, 0x18f8, 0x0c8b, 0x0000, 0xf375, 0xe708, 0xdad9, - 0xcf05, 0xc3aa, 0xb8e4, 0xaecd, 0xa57f, 0x9d0f, 0x9594, 0x8f1f, 0x89c0, 0x8584, 0x8277, 0x809f, - 0x8001, 0x809f, 0x8277, 0x8584, 0x89c0, 0x8f1f, 0x9594, 0x9d0f, 0xa57f, 0xaecd, 0xb8e4, 0xc3aa, - 0xcf05, 0xdad9, 0xe708, 0xf375, 0x0000, 0x18f8, 0x30fb, 0x471c, 0x5a81, 0x6a6c, 0x7640, 0x7d89, - 0x7fff, 0x7d89, 0x7640, 0x6a6c, 0x5a81, 0x471c, 0x30fb, 0x18f8, 0x0000, 0xe708, 0xcf05, 0xb8e4, - 0xa57f, 0x9594, 0x89c0, 0x8277, 0x8001, 0x8277, 0x89c0, 0x9594, 0xa57f, 0xb8e4, 0xcf05, 0xe708, - 0x0000, 0x18f8, 0x30fb, 0x471c, 0x5a81, 0x6a6c, 0x7640, 0x7d89, 0x7fff, 0x7d89, 0x7640, 0x6a6c, - 0x5a81, 0x471c, 0x30fb, 0x18f8, 0x0000, 0xe708, 0xcf05, 0xb8e4, 0xa57f, 0x9594, 0x89c0, 0x8277, - 0x8001, 0x8277, 0x89c0, 0x9594, 0xa57f, 0xb8e4, 0xcf05, 0xe708, 0x0000, 0x30fb, 0x5a81, 0x7640, - 0x7fff, 0x7640, 0x5a81, 0x30fb, 0x0000, 0xcf05, 0xa57f, 0x89c0, 0x8001, 0x89c0, 0xa57f, 0xcf05, - 0x0000, 0x30fb, 0x5a81, 0x7640, 0x7fff, 0x7640, 0x5a81, 0x30fb, 0x0000, 0xcf05, 0xa57f, 0x89c0, - 0x8001, 0x89c0, 0xa57f, 0xcf05, 0x0000, 0x30fb, 0x5a81, 0x7640, 0x7fff, 0x7640, 0x5a81, 0x30fb, - 0x0000, 0xcf05, 0xa57f, 0x89c0, 0x8001, 0x89c0, 0xa57f, 0xcf05, 0x0000, 0x30fb, 0x5a81, 0x7640, - 0x7fff, 0x7640, 0x5a81, 0x30fb, 0x0000, 0xcf05, 0xa57f, 0x89c0, 0x8001, 0x89c0, 0xa57f, 0xcf05, - 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, - 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, - 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, - 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, - 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, + 0x0000, 0x0c8b, 0x18f8, 0x2527, 0x30fb, 0x3c56, 0x471c, 0x5133, 0x5a81, 0x62f1, 0x6a6c, 0x70e1, 0x7640, 0x7a7c, + 0x7d89, 0x7f61, 0x7fff, 0x7f61, 0x7d89, 0x7a7c, 0x7640, 0x70e1, 0x6a6c, 0x62f1, 0x5a81, 0x5133, 0x471c, 0x3c56, + 0x30fb, 0x2527, 0x18f8, 0x0c8b, 0x0000, 0xf375, 0xe708, 0xdad9, 0xcf05, 0xc3aa, 0xb8e4, 0xaecd, 0xa57f, 0x9d0f, + 0x9594, 0x8f1f, 0x89c0, 0x8584, 0x8277, 0x809f, 0x8001, 0x809f, 0x8277, 0x8584, 0x89c0, 0x8f1f, 0x9594, 0x9d0f, + 0xa57f, 0xaecd, 0xb8e4, 0xc3aa, 0xcf05, 0xdad9, 0xe708, 0xf375, 0x0000, 0x18f8, 0x30fb, 0x471c, 0x5a81, 0x6a6c, + 0x7640, 0x7d89, 0x7fff, 0x7d89, 0x7640, 0x6a6c, 0x5a81, 0x471c, 0x30fb, 0x18f8, 0x0000, 0xe708, 0xcf05, 0xb8e4, + 0xa57f, 0x9594, 0x89c0, 0x8277, 0x8001, 0x8277, 0x89c0, 0x9594, 0xa57f, 0xb8e4, 0xcf05, 0xe708, 0x0000, 0x18f8, + 0x30fb, 0x471c, 0x5a81, 0x6a6c, 0x7640, 0x7d89, 0x7fff, 0x7d89, 0x7640, 0x6a6c, 0x5a81, 0x471c, 0x30fb, 0x18f8, + 0x0000, 0xe708, 0xcf05, 0xb8e4, 0xa57f, 0x9594, 0x89c0, 0x8277, 0x8001, 0x8277, 0x89c0, 0x9594, 0xa57f, 0xb8e4, + 0xcf05, 0xe708, 0x0000, 0x30fb, 0x5a81, 0x7640, 0x7fff, 0x7640, 0x5a81, 0x30fb, 0x0000, 0xcf05, 0xa57f, 0x89c0, + 0x8001, 0x89c0, 0xa57f, 0xcf05, 0x0000, 0x30fb, 0x5a81, 0x7640, 0x7fff, 0x7640, 0x5a81, 0x30fb, 0x0000, 0xcf05, + 0xa57f, 0x89c0, 0x8001, 0x89c0, 0xa57f, 0xcf05, 0x0000, 0x30fb, 0x5a81, 0x7640, 0x7fff, 0x7640, 0x5a81, 0x30fb, + 0x0000, 0xcf05, 0xa57f, 0x89c0, 0x8001, 0x89c0, 0xa57f, 0xcf05, 0x0000, 0x30fb, 0x5a81, 0x7640, 0x7fff, 0x7640, + 0x5a81, 0x30fb, 0x0000, 0xcf05, 0xa57f, 0x89c0, 0x8001, 0x89c0, 0xa57f, 0xcf05, 0x0000, 0x5a81, 0x7fff, 0x5a81, + 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, + 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, + 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, + 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, 0x0000, 0x5a81, 0x7fff, 0x5a81, 0x0000, 0xa57f, 0x8001, 0xa57f, }; s16 sSquareWaves[256] = { - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, - 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, - 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, - 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, - 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, - 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, - 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, - 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, - 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, - 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, - 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, - 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, - 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, - 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, - 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, - 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, - 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, + 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, + 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x7fff, + 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, 0x8001, + 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, + 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, 0x0000, 0x0000, + 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x7fff, 0x7fff, + 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x0000, 0x0000, 0x7fff, 0x7fff, + 0x7fff, 0x7fff, 0x0000, 0x0000, 0x0000, 0x0000, 0x8001, 0x8001, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, + 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, + 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, + 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, + 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, 0x0000, 0x0000, 0x7fff, 0x7fff, 0x0000, 0x0000, 0x8001, 0x8001, }; s16 sEuUnknownWave6[256] = { - 0x0000, 0x9ba7, 0x9b41, 0x6c9b, 0x9450, 0xadda, 0x569e, 0x189a, 0x69bf, 0xb79d, 0x6fe9, 0x08ec, - 0x0d34, 0x1aea, 0xce76, 0xad86, 0x2710, 0xa038, 0x7e28, 0x2fd8, 0x3af8, 0x3bfa, 0xd10b, 0x84c7, - 0xcd7f, 0x18f4, 0xd4c8, 0x76f8, 0x8994, 0xaa11, 0x73fb, 0x6c01, 0x0000, 0x93ff, 0x8c05, 0x55ef, - 0x766c, 0x8907, 0x2b38, 0xe70d, 0x3281, 0x7b38, 0x2ef5, 0xc407, 0xc508, 0xd027, 0x81d8, 0x5fc9, - 0xd8f0, 0x5279, 0x318a, 0xe517, 0xf2cc, 0xf713, 0x9017, 0x4864, 0x9641, 0xe765, 0xa962, 0x5227, - 0x6bb0, 0x9364, 0x64bf, 0x645a, 0x0000, 0x9b41, 0x9450, 0x569e, 0x69bf, 0x6fe9, 0x0d34, 0xce76, - 0x2710, 0x7e28, 0x3af8, 0xd10b, 0xcd7f, 0xd4c8, 0x8994, 0x73fb, 0x0000, 0x8c05, 0x766c, 0x2b38, - 0x3281, 0x2ef5, 0xc508, 0x81d8, 0xd8f0, 0x318a, 0xf2cc, 0x9017, 0x9641, 0xa962, 0x6bb0, 0x64bf, - 0x0000, 0x9b41, 0x9450, 0x569e, 0x69bf, 0x6fe9, 0x0d34, 0xce76, 0x2710, 0x7e28, 0x3af8, 0xd10b, - 0xcd7f, 0xd4c8, 0x8994, 0x73fb, 0x0000, 0x8c05, 0x766c, 0x2b38, 0x3281, 0x2ef5, 0xc508, 0x81d8, - 0xd8f0, 0x318a, 0xf2cc, 0x9017, 0x9641, 0xa962, 0x6bb0, 0x64bf, 0x0000, 0x9450, 0x69bf, 0x0d34, - 0x2710, 0x3af8, 0xcd7f, 0x8994, 0x0000, 0x766c, 0x3281, 0xc508, 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, - 0x0000, 0x9450, 0x69bf, 0x0d34, 0x2710, 0x3af8, 0xcd7f, 0x8994, 0x0000, 0x766c, 0x3281, 0xc508, - 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, 0x0000, 0x9450, 0x69bf, 0x0d34, 0x2710, 0x3af8, 0xcd7f, 0x8994, - 0x0000, 0x766c, 0x3281, 0xc508, 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, 0x0000, 0x9450, 0x69bf, 0x0d34, - 0x2710, 0x3af8, 0xcd7f, 0x8994, 0x0000, 0x766c, 0x3281, 0xc508, 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, - 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, - 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, - 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, - 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, - 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, + 0x0000, 0x9ba7, 0x9b41, 0x6c9b, 0x9450, 0xadda, 0x569e, 0x189a, 0x69bf, 0xb79d, 0x6fe9, 0x08ec, 0x0d34, 0x1aea, + 0xce76, 0xad86, 0x2710, 0xa038, 0x7e28, 0x2fd8, 0x3af8, 0x3bfa, 0xd10b, 0x84c7, 0xcd7f, 0x18f4, 0xd4c8, 0x76f8, + 0x8994, 0xaa11, 0x73fb, 0x6c01, 0x0000, 0x93ff, 0x8c05, 0x55ef, 0x766c, 0x8907, 0x2b38, 0xe70d, 0x3281, 0x7b38, + 0x2ef5, 0xc407, 0xc508, 0xd027, 0x81d8, 0x5fc9, 0xd8f0, 0x5279, 0x318a, 0xe517, 0xf2cc, 0xf713, 0x9017, 0x4864, + 0x9641, 0xe765, 0xa962, 0x5227, 0x6bb0, 0x9364, 0x64bf, 0x645a, 0x0000, 0x9b41, 0x9450, 0x569e, 0x69bf, 0x6fe9, + 0x0d34, 0xce76, 0x2710, 0x7e28, 0x3af8, 0xd10b, 0xcd7f, 0xd4c8, 0x8994, 0x73fb, 0x0000, 0x8c05, 0x766c, 0x2b38, + 0x3281, 0x2ef5, 0xc508, 0x81d8, 0xd8f0, 0x318a, 0xf2cc, 0x9017, 0x9641, 0xa962, 0x6bb0, 0x64bf, 0x0000, 0x9b41, + 0x9450, 0x569e, 0x69bf, 0x6fe9, 0x0d34, 0xce76, 0x2710, 0x7e28, 0x3af8, 0xd10b, 0xcd7f, 0xd4c8, 0x8994, 0x73fb, + 0x0000, 0x8c05, 0x766c, 0x2b38, 0x3281, 0x2ef5, 0xc508, 0x81d8, 0xd8f0, 0x318a, 0xf2cc, 0x9017, 0x9641, 0xa962, + 0x6bb0, 0x64bf, 0x0000, 0x9450, 0x69bf, 0x0d34, 0x2710, 0x3af8, 0xcd7f, 0x8994, 0x0000, 0x766c, 0x3281, 0xc508, + 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, 0x0000, 0x9450, 0x69bf, 0x0d34, 0x2710, 0x3af8, 0xcd7f, 0x8994, 0x0000, 0x766c, + 0x3281, 0xc508, 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, 0x0000, 0x9450, 0x69bf, 0x0d34, 0x2710, 0x3af8, 0xcd7f, 0x8994, + 0x0000, 0x766c, 0x3281, 0xc508, 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, 0x0000, 0x9450, 0x69bf, 0x0d34, 0x2710, 0x3af8, + 0xcd7f, 0x8994, 0x0000, 0x766c, 0x3281, 0xc508, 0xd8f0, 0xf2cc, 0x9641, 0x6bb0, 0x0000, 0x69bf, 0x2710, 0xcd7f, + 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, + 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, + 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, + 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, 0x0000, 0x69bf, 0x2710, 0xcd7f, 0x0000, 0x3281, 0xd8f0, 0x9641, }; s16 gEuUnknownWave7[256] = { - 0x0000, 0x3fbc, 0x4eb4, 0x4f21, 0x6a49, 0x806f, 0x7250, 0x6a7b, 0x8d2e, 0xac0a, 0x98d6, 0x7832, - 0x7551, 0x71ca, 0x4eee, 0x3731, 0x4e20, 0x644d, 0x4a50, 0x23ba, 0x1b09, 0x119a, 0xe914, 0xccbe, - 0xe14e, 0xf8a3, 0xe47e, 0xc937, 0xd181, 0xde39, 0xcfc6, 0xcf94, 0x0000, 0x306c, 0x303a, 0x21c7, - 0x2e7f, 0x36c8, 0x1b82, 0x075e, 0x1eb2, 0x3341, 0x16ec, 0xee67, 0xe4f7, 0xdc45, 0xb5b0, 0x9bb4, - 0xb1e0, 0xc8ce, 0xb112, 0x8e37, 0x8aaf, 0x87cd, 0x672a, 0x53f7, 0x72d2, 0x9584, 0x8db0, 0x7f92, - 0x95b7, 0xb0de, 0xb14c, 0xc045, 0x0000, 0x4eb4, 0x6a49, 0x7250, 0x8d2e, 0x98d6, 0x7551, 0x4eee, - 0x4e20, 0x4a50, 0x1b09, 0xe914, 0xe14e, 0xe47e, 0xd181, 0xcfc6, 0x0000, 0x303a, 0x2e7f, 0x1b82, - 0x1eb2, 0x16ec, 0xe4f7, 0xb5b0, 0xb1e0, 0xb112, 0x8aaf, 0x672a, 0x72d2, 0x8db0, 0x95b7, 0xb14c, - 0x0000, 0x4eb4, 0x6a49, 0x7250, 0x8d2e, 0x98d6, 0x7551, 0x4eee, 0x4e20, 0x4a50, 0x1b09, 0xe914, - 0xe14e, 0xe47e, 0xd181, 0xcfc6, 0x0000, 0x303a, 0x2e7f, 0x1b82, 0x1eb2, 0x16ec, 0xe4f7, 0xb5b0, - 0xb1e0, 0xb112, 0x8aaf, 0x672a, 0x72d2, 0x8db0, 0x95b7, 0xb14c, 0x0000, 0x6a49, 0x8d2e, 0x7551, - 0x4e20, 0x1b09, 0xe14e, 0xd181, 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, - 0x0000, 0x6a49, 0x8d2e, 0x7551, 0x4e20, 0x1b09, 0xe14e, 0xd181, 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, - 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, 0x0000, 0x6a49, 0x8d2e, 0x7551, 0x4e20, 0x1b09, 0xe14e, 0xd181, - 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, 0x0000, 0x6a49, 0x8d2e, 0x7551, - 0x4e20, 0x1b09, 0xe14e, 0xd181, 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, - 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, - 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, - 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, - 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, - 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, + 0x0000, 0x3fbc, 0x4eb4, 0x4f21, 0x6a49, 0x806f, 0x7250, 0x6a7b, 0x8d2e, 0xac0a, 0x98d6, 0x7832, 0x7551, 0x71ca, + 0x4eee, 0x3731, 0x4e20, 0x644d, 0x4a50, 0x23ba, 0x1b09, 0x119a, 0xe914, 0xccbe, 0xe14e, 0xf8a3, 0xe47e, 0xc937, + 0xd181, 0xde39, 0xcfc6, 0xcf94, 0x0000, 0x306c, 0x303a, 0x21c7, 0x2e7f, 0x36c8, 0x1b82, 0x075e, 0x1eb2, 0x3341, + 0x16ec, 0xee67, 0xe4f7, 0xdc45, 0xb5b0, 0x9bb4, 0xb1e0, 0xc8ce, 0xb112, 0x8e37, 0x8aaf, 0x87cd, 0x672a, 0x53f7, + 0x72d2, 0x9584, 0x8db0, 0x7f92, 0x95b7, 0xb0de, 0xb14c, 0xc045, 0x0000, 0x4eb4, 0x6a49, 0x7250, 0x8d2e, 0x98d6, + 0x7551, 0x4eee, 0x4e20, 0x4a50, 0x1b09, 0xe914, 0xe14e, 0xe47e, 0xd181, 0xcfc6, 0x0000, 0x303a, 0x2e7f, 0x1b82, + 0x1eb2, 0x16ec, 0xe4f7, 0xb5b0, 0xb1e0, 0xb112, 0x8aaf, 0x672a, 0x72d2, 0x8db0, 0x95b7, 0xb14c, 0x0000, 0x4eb4, + 0x6a49, 0x7250, 0x8d2e, 0x98d6, 0x7551, 0x4eee, 0x4e20, 0x4a50, 0x1b09, 0xe914, 0xe14e, 0xe47e, 0xd181, 0xcfc6, + 0x0000, 0x303a, 0x2e7f, 0x1b82, 0x1eb2, 0x16ec, 0xe4f7, 0xb5b0, 0xb1e0, 0xb112, 0x8aaf, 0x672a, 0x72d2, 0x8db0, + 0x95b7, 0xb14c, 0x0000, 0x6a49, 0x8d2e, 0x7551, 0x4e20, 0x1b09, 0xe14e, 0xd181, 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, + 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, 0x0000, 0x6a49, 0x8d2e, 0x7551, 0x4e20, 0x1b09, 0xe14e, 0xd181, 0x0000, 0x2e7f, + 0x1eb2, 0xe4f7, 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, 0x0000, 0x6a49, 0x8d2e, 0x7551, 0x4e20, 0x1b09, 0xe14e, 0xd181, + 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, 0x0000, 0x6a49, 0x8d2e, 0x7551, 0x4e20, 0x1b09, + 0xe14e, 0xd181, 0x0000, 0x2e7f, 0x1eb2, 0xe4f7, 0xb1e0, 0x8aaf, 0x72d2, 0x95b7, 0x0000, 0x8d2e, 0x4e20, 0xe14e, + 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, + 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, + 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, 0xb1e0, 0x72d2, 0x0000, 0x8d2e, 0x4e20, 0xe14e, 0x0000, 0x1eb2, + 0xb1e0, 0x72d2, 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, - -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, 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, }; 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, - -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, 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, - -0x4FFF, -19455, -0x47FF, -17407, -0x3FFF, -15359, -0x37FF, -13311, -0x2FFF, -11263, -10239, - -9215, -8191, -7167, -6143, -5119, -4095, -3071, -2047, -1023, + 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, }; -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}; +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.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, 0.608557f, 0.611888f, 0.615236f, 0.618603f, 0.621989f, 0.625393f, 0.628815f, 0.632257f, - 0.635717f, 0.639196f, 0.642694f, 0.646212f, 0.649748f, 0.653304f, 0.656880f, 0.660475f, 0.664089f, - 0.667724f, 0.671378f, 0.675052f, 0.678747f, 0.682461f, 0.686196f, 0.689952f, 0.693727f, 0.697524f, - 0.701341f, 0.705180f, 0.709039f, 0.712919f, 0.716821f, 0.720744f, 0.724689f, 0.728655f, 0.732642f, - 0.736652f, 0.740684f, 0.744737f, 0.748813f, 0.752911f, 0.757031f, 0.761175f, 0.765340f, 0.769529f, - 0.773740f, 0.777975f, 0.782232f, 0.786513f, 0.790818f, 0.795146f, 0.799497f, 0.803873f, 0.808272f, - 0.812696f, 0.817144f, 0.821616f, 0.826112f, 0.830633f, 0.835179f, 0.839750f, 0.844346f, 0.848966f, - 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, - 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, 1.210489f, 1.217114f, 1.223775f, 1.230473f, 1.237207f, 1.243978f, 1.250786f, 1.257631f, - 1.264514f, 1.271434f, 1.278392f, 1.285389f, 1.292423f, 1.299497f, 1.306608f, 1.313759f, 1.320949f, - 1.328178f, 1.335447f, 1.342756f, 1.350104f, 1.357493f, 1.364922f, 1.372392f, 1.379903f, 1.387455f, - 1.395048f, 1.402683f, 1.410360f, 1.418078f, 1.425839f, 1.433642f, 1.441488f, 1.449377f, 1.457309f, - 1.465285f, 1.473304f, 1.481367f, 1.489474f, 1.497626f, 1.505822f, 1.514063f, 1.522349f, 1.530681f, - 1.539058f, 1.547481f, 1.555950f, 1.564465f, 1.573027f, 1.581636f, 1.590292f, 1.598995f, 1.607746f, - 1.616545f, 1.625392f, 1.634287f, 1.643231f, 1.652224f, 1.661266f, 1.670358f, 1.679500f, 1.688691f, - 1.697933f, 1.707225f, 1.716569f, 1.725963f, 1.735409f, 1.744906f, 1.754456f, 1.764058f, 1.773712f, - 1.783419f, 1.793179f, 1.802993f, 1.812860f, 1.822782f, 1.832757f, 1.842788f, 1.852873f, 1.863013f, - 1.873209f, 1.883461f, 1.893768f, 1.904132f, 1.914553f, 1.925031f, 1.935567f, 1.946159f, 1.956810f, - 1.967520f, 1.978287f, 1.989114f, 2.0f + 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, 0.605245f, 0.608557f, 0.611888f, 0.615236f, + 0.618603f, 0.621989f, 0.625393f, 0.628815f, 0.632257f, 0.635717f, 0.639196f, 0.642694f, 0.646212f, 0.649748f, + 0.653304f, 0.656880f, 0.660475f, 0.664089f, 0.667724f, 0.671378f, 0.675052f, 0.678747f, 0.682461f, 0.686196f, + 0.689952f, 0.693727f, 0.697524f, 0.701341f, 0.705180f, 0.709039f, 0.712919f, 0.716821f, 0.720744f, 0.724689f, + 0.728655f, 0.732642f, 0.736652f, 0.740684f, 0.744737f, 0.748813f, 0.752911f, 0.757031f, 0.761175f, 0.765340f, + 0.769529f, 0.773740f, 0.777975f, 0.782232f, 0.786513f, 0.790818f, 0.795146f, 0.799497f, 0.803873f, 0.808272f, + 0.812696f, 0.817144f, 0.821616f, 0.826112f, 0.830633f, 0.835179f, 0.839750f, 0.844346f, 0.848966f, 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, 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, 1.210489f, 1.217114f, 1.223775f, 1.230473f, 1.237207f, 1.243978f, 1.250786f, + 1.257631f, 1.264514f, 1.271434f, 1.278392f, 1.285389f, 1.292423f, 1.299497f, 1.306608f, 1.313759f, 1.320949f, + 1.328178f, 1.335447f, 1.342756f, 1.350104f, 1.357493f, 1.364922f, 1.372392f, 1.379903f, 1.387455f, 1.395048f, + 1.402683f, 1.410360f, 1.418078f, 1.425839f, 1.433642f, 1.441488f, 1.449377f, 1.457309f, 1.465285f, 1.473304f, + 1.481367f, 1.489474f, 1.497626f, 1.505822f, 1.514063f, 1.522349f, 1.530681f, 1.539058f, 1.547481f, 1.555950f, + 1.564465f, 1.573027f, 1.581636f, 1.590292f, 1.598995f, 1.607746f, 1.616545f, 1.625392f, 1.634287f, 1.643231f, + 1.652224f, 1.661266f, 1.670358f, 1.679500f, 1.688691f, 1.697933f, 1.707225f, 1.716569f, 1.725963f, 1.735409f, + 1.744906f, 1.754456f, 1.764058f, 1.773712f, 1.783419f, 1.793179f, 1.802993f, 1.812860f, 1.822782f, 1.832757f, + 1.842788f, 1.852873f, 1.863013f, 1.873209f, 1.883461f, 1.893768f, 1.904132f, 1.914553f, 1.925031f, 1.935567f, + 1.946159f, 1.956810f, 1.967520f, 1.978287f, 1.989114f, 2.0f }; #endif #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. :/ @@ -494,20 +446,17 @@ struct AdsrEnvelope gDefaultEnvelope[] = { u8 unk_sh_data2[4] = { 0, 0, 0, 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 }, +struct NoteSubEu gDefaultNoteSub = { 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 @@ -522,7 +471,7 @@ u16 gHeadsetPanQuantization[10] = { 0x40, 0x30, 0x20, 0x10, 0, 0, 0, 0, 0, 0 }; #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 @@ -532,21 +481,19 @@ 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, - 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.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 + 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.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 }; // Linearly interpolated between @@ -556,167 +503,145 @@ 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.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.242161f, 0.253295f, 0.264429f, 0.275563f, 0.286697f, 0.297831f, 0.308965f, 0.320098f, 0.331232f, - 0.342366f, 0.3535f + 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.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, - 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.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.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.012368f, 0.0f + 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.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.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.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, + 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, - 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.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.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.542985f, 0.542732f + 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.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.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.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, + 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, - 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.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.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.561722f, 0.561476f + 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.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.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.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, + 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, - 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.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.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.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.525077f, 0.524798f, 0.524522f, 0.524247f, 0.523975f, 0.523706f, 0.523439f, 0.523174f, 0.522911f, - 0.522651f, 0.522393f + 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.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.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.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.525077f, 0.524798f, 0.524522f, + 0.524247f, 0.523975f, 0.523706f, 0.523439f, 0.523174f, 0.522911f, 0.522651f, 0.522393f }; #endif @@ -728,164 +653,69 @@ u16 unk_sh_data_3[] = { // C D // C B // A E - 0x1000, 0x1000, - 0x1000, 0x1000, - 0x1000, 0x1000, - 0x1000, 0x1000, + 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, 0x1000, - 0x0E6F, 0x1091, - 0x11EF, 0x1267, - 0x11EF, 0x1091, - 0x0E6F, 0x0BB8, + 0x0E6F, 0x1091, 0x11EF, 0x1267, 0x11EF, 0x1091, 0x0E6F, 0x0BB8, - 0x0C1D, 0x111D, - 0x1494, 0x15D2, - 0x1494, 0x111D, - 0x0C1D, 0x068E, + 0x0C1D, 0x111D, 0x1494, 0x15D2, 0x1494, 0x111D, 0x0C1D, 0x068E, - 0x0838, 0x116E, - 0x18A6, 0x1B61, - 0x18A6, 0x116E, - 0x0838, 0x0001, + 0x0838, 0x116E, 0x18A6, 0x1B61, 0x18A6, 0x116E, 0x0838, 0x0001, - 0x0227, 0x0F42, - 0x1B75, 0x206B, - 0x1B75, 0x0F42, - 0x0227, 0xFA2B, + 0x0227, 0x0F42, 0x1B75, 0x206B, 0x1B75, 0x0F42, 0x0227, 0xFA2B, - 0xFC28, 0x0AAE, - 0x1BE7, 0x2394, - 0x1BE7, 0x0AAE, - 0xFC28, 0xF874, + 0xFC28, 0x0AAE, 0x1BE7, 0x2394, 0x1BE7, 0x0AAE, 0xFC28, 0xF874, - 0xF809, 0x0582, - 0x1C36, 0x2788, - 0x1C36, 0x0582, - 0xF809, 0xFAEB, + 0xF809, 0x0582, 0x1C36, 0x2788, 0x1C36, 0x0582, 0xF809, 0xFAEB, - 0xF5F0, 0x0001, - 0x1E34, 0x2F71, - 0x1E34, 0x0001, - 0xF5F0, 0x0000, + 0xF5F0, 0x0001, 0x1E34, 0x2F71, 0x1E34, 0x0001, 0xF5F0, 0x0000, - 0xF8AD, 0xFAF3, - 0x19ED, 0x2EB6, - 0x19ED, 0xFAF3, - 0xF8AD, 0x04AC, + 0xF8AD, 0xFAF3, 0x19ED, 0x2EB6, 0x19ED, 0xFAF3, 0xF8AD, 0x04AC, - 0xFCC0, 0xF6FF, - 0x178B, 0x3207, - 0x178B, 0xF6FF, - 0xFCC0, 0x065F, + 0xFCC0, 0xF6FF, 0x178B, 0x3207, 0x178B, 0xF6FF, 0xFCC0, 0x065F, - 0x01A5, 0xF44E, - 0x1510, 0x36B4, - 0x1510, 0xF44E, - 0x01A5, 0x047B, + 0x01A5, 0xF44E, 0x1510, 0x36B4, 0x1510, 0xF44E, 0x01A5, 0x047B, - 0x05C1, 0xF3CC, - 0x1145, 0x3988, - 0x1145, 0xF3CC, - 0x05C1, 0x0001, + 0x05C1, 0xF3CC, 0x1145, 0x3988, 0x1145, 0xF3CC, 0x05C1, 0x0001, - 0x07B9, 0xF517, - 0x0D20, 0x3C4C, - 0x0D20, 0xF517, - 0x07B9, 0xFBD4, + 0x07B9, 0xF517, 0x0D20, 0x3C4C, 0x0D20, 0xF517, 0x07B9, 0xFBD4, - 0x07C0, 0xF71C, - 0x09A1, 0x4528, - 0x09A1, 0xF71C, - 0x07C0, 0xF9B7, + 0x07C0, 0xF71C, 0x09A1, 0x4528, 0x09A1, 0xF71C, 0x07C0, 0xF9B7, - 0x058F, 0xFA43, - 0x05DC, 0x585F, - 0x05DC, 0xFA43, - 0x058F, 0xFAB3, + 0x058F, 0xFA43, 0x05DC, 0x585F, 0x05DC, 0xFA43, 0x058F, 0xFAB3, }; u16 unk_sh_data_4[] = { - 0xFA73, 0xFA42, - 0xFA27, 0x5866, - 0xFA27, 0xFA42, - 0xFA73, 0xFAB2, + 0xFA73, 0xFA42, 0xFA27, 0x5866, 0xFA27, 0xFA42, 0xFA73, 0xFAB2, - 0xF842, 0xF71B, - 0xF661, 0x452B, - 0xF661, 0xF71B, - 0xF842, 0xF9B5, + 0xF842, 0xF71B, 0xF661, 0x452B, 0xF661, 0xF71B, 0xF842, 0xF9B5, - 0xF848, 0xF516, - 0xF2E1, 0x3C4D, - 0xF2E1, 0xF516, - 0xF848, 0xFBD2, + 0xF848, 0xF516, 0xF2E1, 0x3C4D, 0xF2E1, 0xF516, 0xF848, 0xFBD2, - 0xFA3F, 0xF3CA, - 0xEEBD, 0x3989, - 0xEEBD, 0xF3CA, - 0xFA3F, 0xFFFF, + 0xFA3F, 0xF3CA, 0xEEBD, 0x3989, 0xEEBD, 0xF3CA, 0xFA3F, 0xFFFF, - 0xFE5B, 0xF44C, - 0xEAF2, 0x36B5, - 0xEAF2, 0xF44C, - 0xFE5B, 0x0479, + 0xFE5B, 0xF44C, 0xEAF2, 0x36B5, 0xEAF2, 0xF44C, 0xFE5B, 0x0479, - 0x0340, 0xF6FD, - 0xE877, 0x3207, - 0xE877, 0xF6FD, - 0x0340, 0x065E, + 0x0340, 0xF6FD, 0xE877, 0x3207, 0xE877, 0xF6FD, 0x0340, 0x065E, - 0x0753, 0xFAF1, - 0xE615, 0x2EB5, - 0xE615, 0xFAF1, - 0x0753, 0x04AB, + 0x0753, 0xFAF1, 0xE615, 0x2EB5, 0xE615, 0xFAF1, 0x0753, 0x04AB, - 0x0A12, 0xFFFF, - 0xE1CD, 0x2F71, - 0xE1CD, 0xFFFF, - 0x0A12, 0x0000, + 0x0A12, 0xFFFF, 0xE1CD, 0x2F71, 0xE1CD, 0xFFFF, 0x0A12, 0x0000, - 0x07FA, 0x057F, - 0xE3CA, 0x2789, - 0xE3CA, 0x057F, - 0x07FA, 0xFAEA, + 0x07FA, 0x057F, 0xE3CA, 0x2789, 0xE3CA, 0x057F, 0x07FA, 0xFAEA, - 0x03DB, 0x0AAC, - 0xE41A, 0x2394, - 0xE41A, 0x0AAC, - 0x03DB, 0xF873, + 0x03DB, 0x0AAC, 0xE41A, 0x2394, 0xE41A, 0x0AAC, 0x03DB, 0xF873, - 0xFDDC, 0x0F41, - 0xE489, 0x206E, - 0xE489, 0x0F41, - 0xFDDC, 0xFA28, + 0xFDDC, 0x0F41, 0xE489, 0x206E, 0xE489, 0x0F41, 0xFDDC, 0xFA28, - 0xF7CA, 0x116E, - 0xE758, 0x1B63, - 0xE758, 0x116E, - 0xF7CA, 0xFFFF, + 0xF7CA, 0x116E, 0xE758, 0x1B63, 0xE758, 0x116E, 0xF7CA, 0xFFFF, - 0xF3E4, 0x111D, - 0xEB6A, 0x15D4, - 0xEB6A, 0x111D, - 0xF3E4, 0x068B, + 0xF3E4, 0x111D, 0xEB6A, 0x15D4, 0xEB6A, 0x111D, 0xF3E4, 0x068B, - 0xF192, 0x1092, - 0xEE11, 0x1268, - 0xEE11, 0x1092, - 0xF192, 0x0BB6, + 0xF192, 0x1092, 0xEE11, 0x1268, 0xEE11, 0x1092, 0xF192, 0x0BB6, - 0xF05F, 0x1026, - 0xEF89, 0x1093, - 0xEF89, 0x1026, - 0xF05F, 0x0EEB, + 0xF05F, 0x1026, 0xEF89, 0x1093, 0xEF89, 0x1026, 0xF05F, 0x0EEB, - 0x0000, 0x0000, - 0x0000, 0x0000, - 0x7FFF, 0xD001, - 0x3FFF, 0xF001, - 0x5FFF, 0x9001, - 0x7FFF, 0x8001 + 0x0000, 0x0000, 0x0000, 0x0000, 0x7FFF, 0xD001, 0x3FFF, 0xF001, 0x5FFF, 0x9001, 0x7FFF, 0x8001 }; #endif @@ -902,7 +732,7 @@ 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 @@ -920,10 +750,10 @@ volatile s32 gCurrAudioFrameDmaCount; s32 gAudioTaskIndex; s32 gCurrAiBufferIndex; -u64 *gAudioCmdBuffers[2]; -u64 *gAudioCmd; +u64* gAudioCmdBuffers[2]; +u64* gAudioCmd; -struct SPTask *gAudioTask; +struct SPTask* gAudioTask; struct SPTask gAudioTasks[2]; #if defined(VERSION_EU) || defined(VERSION_SH) @@ -931,7 +761,7 @@ f32 D_EU_802298D0; s32 gRefreshRate; #endif -s16 *gAiBuffers[NUMAIBUFFERS]; +s16* gAiBuffers[NUMAIBUFFERS]; s16 gAiBufferLengths[NUMAIBUFFERS]; #if defined(VERSION_JP) || defined(VERSION_US) @@ -953,19 +783,19 @@ u8 D_SH_80350F19; OSMesg D_SH_80350F1C[1]; OSMesgQueue D_SH_80350F20; // address written to D_SH_80350F38 -OSMesgQueue *D_SH_80350F38; +OSMesgQueue* D_SH_80350F38; OSMesg D_SH_80350F40[4]; OSMesgQueue D_SH_80350F50; // address written to D_SH_80350F68 -OSMesgQueue *D_SH_80350F68; +OSMesgQueue* D_SH_80350F68; OSMesg D_SH_80350F6C[1]; OSMesgQueue D_SH_80350F70; // address written to D_SH_80350F88 -OSMesgQueue *D_SH_80350F88; +OSMesgQueue* D_SH_80350F88; OSMesg D_SH_80350F8C[1]; OSMesgQueue D_SH_80350F90; // address written to D_SH_80350F90 -OSMesgQueue *D_SH_80350FA8; +OSMesgQueue* D_SH_80350FA8; #endif u64 gAudioGlobalsEndMarker; diff --git a/src/audio/effects.c b/src/audio/effects.c index 3f98feba..abbc1228 100644 --- a/src/audio/effects.c +++ b/src/audio/effects.c @@ -13,7 +13,7 @@ #endif #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; @@ -34,7 +34,7 @@ void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 reca } for (i = 0; i < 4; ++i) { - struct SequenceChannelLayer *layer = seqChannel->layers[i]; + struct SequenceChannelLayer* layer = seqChannel->layers[i]; if (layer != NULL && layer->enabled && layer->note != NULL) { if (layer->notePropertiesNeedInit) { layer->noteFreqScale = layer->freqScale * seqChannel->freqScale; @@ -57,13 +57,14 @@ void sequence_channel_process_sound(struct SequenceChannel *seqChannel, s32 reca seqChannel->changes.as_u8 = 0; } #else -static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) { +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)) * seqChannel->seqPlayer->gameVolume; + channelVolume = (seqChannel->volume * (seqChannel->volumeScale * seqChannel->seqPlayer->fadeVolume)) * + seqChannel->seqPlayer->gameVolume; if (seqChannel->seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_SOFTEN) != 0) { channelVolume *= seqChannel->seqPlayer->muteVolumeScale; } @@ -72,8 +73,9 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) { panLayerWeight = US_FLOAT(1.0) - seqChannel->panChannelWeight; for (i = 0; i < 4; i++) { - struct SequenceChannelLayer *layer = seqChannel->layers[i]; - if (layer != NULL && layer->enabled && layer->note != NULL || (layer != NULL && seqChannel->seqPlayer->recalculateVolume)) { + struct SequenceChannelLayer* layer = seqChannel->layers[i]; + if (layer != NULL && layer->enabled && layer->note != NULL || + (layer != NULL && seqChannel->seqPlayer->recalculateVolume)) { layer->noteFreqScale = layer->freqScale * seqChannel->freqScale; layer->noteVelocity = layer->velocitySquare * channelVolume; layer->notePan = (layer->pan * panLayerWeight) + panFromChannel; @@ -82,7 +84,7 @@ static void sequence_channel_process_sound(struct SequenceChannel *seqChannel) { } #endif -void sequence_player_process_sound(struct SequencePlayer *seqPlayer) { +void sequence_player_process_sound(struct SequencePlayer* seqPlayer) { s32 i; if (seqPlayer->fadeRemainingFrames != 0) { @@ -130,8 +132,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) { // Process channels for (i = 0; i < CHANNELS_MAX; i++) { - if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE - && seqPlayer->channels[i]->enabled == TRUE) { + if (IS_SEQUENCE_CHANNEL_VALID(seqPlayer->channels[i]) == TRUE && seqPlayer->channels[i]->enabled == TRUE) { #if defined(VERSION_EU) || defined(VERSION_SH) sequence_channel_process_sound(seqPlayer->channels[i], seqPlayer->recalculateVolume); #else @@ -145,7 +146,7 @@ void sequence_player_process_sound(struct SequencePlayer *seqPlayer) { #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) @@ -155,7 +156,7 @@ f32 get_portamento_freq_scale(struct Portamento *p) { #endif p->cur += p->speed; - v0 = (u32) p->cur; + v0 = (u32)p->cur; #if defined(VERSION_EU) || defined(VERSION_SH) if (v0 > 127) @@ -175,14 +176,14 @@ f32 get_portamento_freq_scale(struct Portamento *p) { } #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) { +s8 get_vibrato_pitch_change(struct VibratoState* vib) { s32 index; vib->time += vib->rate; @@ -208,7 +209,7 @@ s8 get_vibrato_pitch_change(struct VibratoState *vib) { } #endif -f32 get_vibrato_freq_scale(struct VibratoState *vib) { +f32 get_vibrato_freq_scale(struct VibratoState* vib) { s32 pitchChange; f32 extent; f32 result; @@ -220,30 +221,29 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) { if (vib->extentChangeTimer) { if (vib->extentChangeTimer == 1) { - vib->extent = (s32) vib->seqChannel->vibratoExtentTarget; + vib->extent = (s32)vib->seqChannel->vibratoExtentTarget; } else { - vib->extent += - ((s32) vib->seqChannel->vibratoExtentTarget - vib->extent) / (s32) vib->extentChangeTimer; + vib->extent += ((s32)vib->seqChannel->vibratoExtentTarget - vib->extent) / (s32)vib->extentChangeTimer; } vib->extentChangeTimer--; - } else if (vib->seqChannel->vibratoExtentTarget != (s32) vib->extent) { + } else if (vib->seqChannel->vibratoExtentTarget != (s32)vib->extent) { if ((vib->extentChangeTimer = vib->seqChannel->vibratoExtentChangeDelay) == 0) { - vib->extent = (s32) vib->seqChannel->vibratoExtentTarget; + vib->extent = (s32)vib->seqChannel->vibratoExtentTarget; } } if (vib->rateChangeTimer) { if (vib->rateChangeTimer == 1) { - vib->rate = (s32) vib->seqChannel->vibratoRateTarget; + vib->rate = (s32)vib->seqChannel->vibratoRateTarget; } else { - vib->rate += ((s32) vib->seqChannel->vibratoRateTarget - vib->rate) / (s32) vib->rateChangeTimer; + vib->rate += ((s32)vib->seqChannel->vibratoRateTarget - vib->rate) / (s32)vib->rateChangeTimer; } vib->rateChangeTimer--; - } else if (vib->seqChannel->vibratoRateTarget != (s32) vib->rate) { + } else if (vib->seqChannel->vibratoRateTarget != (s32)vib->rate) { if ((vib->rateChangeTimer = vib->seqChannel->vibratoRateChangeDelay) == 0) { - vib->rate = (s32) vib->seqChannel->vibratoRateTarget; + vib->rate = (s32)vib->seqChannel->vibratoRateTarget; } } @@ -252,7 +252,7 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) { } pitchChange = get_vibrato_pitch_change(vib); - extent = (f32) vib->extent / US_FLOAT(4096.0); + extent = (f32)vib->extent / US_FLOAT(4096.0); #if defined(VERSION_EU) || defined(VERSION_SH) result = US_FLOAT(1.0) + extent * (gPitchBendFrequencyScale[pitchChange + 128] - US_FLOAT(1.0)); @@ -262,7 +262,7 @@ f32 get_vibrato_freq_scale(struct VibratoState *vib) { return result; } -void note_vibrato_update(struct Note *note) { +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); @@ -280,11 +280,11 @@ void note_vibrato_update(struct Note *note) { #endif } -void note_vibrato_init(struct Note *note) { - struct VibratoState *vib; - UNUSED struct SequenceChannel *seqChannel; +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; + struct NotePlaybackState* seqPlayerState = (struct NotePlaybackState*)¬e->priority; #endif note->vibratoFreqScale = 1.0f; @@ -293,9 +293,8 @@ void note_vibrato_init(struct Note *note) { vib = ¬e->vibratoState; #if defined(VERSION_JP) || defined(VERSION_US) - if (note->parentLayer->seqChannel->vibratoExtentStart == 0 - && note->parentLayer->seqChannel->vibratoExtentTarget == 0 - && note->parentLayer->portamento.mode == 0) { + if (note->parentLayer->seqChannel->vibratoExtentStart == 0 && + note->parentLayer->seqChannel->vibratoExtentTarget == 0 && note->parentLayer->portamento.mode == 0) { vib->active = FALSE; return; } @@ -343,7 +342,7 @@ void note_vibrato_init(struct Note *note) { #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) @@ -363,9 +362,9 @@ void adsr_init(struct AdsrState *adsr, struct AdsrEnvelope *envelope, UNUSED s16 } #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) { +s32 adsr_update(struct AdsrState* adsr) { #endif u8 action = adsr->action; #if defined(VERSION_EU) || defined(VERSION_SH) @@ -398,7 +397,7 @@ s32 adsr_update(struct AdsrState *adsr) { // fallthrough #ifdef VERSION_SH - restart: + restart: #endif case ADSR_STATE_LOOP: adsr->delay = BSWAP16(adsr->envelope[adsr->envIndex].delay); @@ -425,17 +424,17 @@ s32 adsr_update(struct AdsrState *adsr) { if (adsr->delay >= 4) { adsr->delay = adsr->delay * gAudioBufferParameters.updatesPerFrame #ifdef VERSION_SH - / gAudioBufferParameters.presetUnk4 + / gAudioBufferParameters.presetUnk4 #endif - / 4; + / 4; } #if defined(VERSION_SH) if (adsr->delay == 0) { adsr->delay = 1; } - adsr->target = (f32) BSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0f; + 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; + 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; @@ -498,10 +497,10 @@ s32 adsr_update(struct AdsrState *adsr) { adsr->state = ADSR_STATE_DISABLED; } #else - if (adsr->current < 100) { - adsr->current = 0; - adsr->state = ADSR_STATE_DISABLED; - } + if (adsr->current < 100) { + adsr->current = 0; + adsr->state = ADSR_STATE_DISABLED; + } #endif break; } diff --git a/src/audio/external.c b/src/audio/external.c index c165f4cc..db2881ab 100644 --- a/src/audio/external.c +++ b/src/audio/external.c @@ -32,7 +32,7 @@ struct Sound { s32 soundBits; - f32 *position; + f32* position; }; // size = 0x8 struct ChannelVolumeScaleFade { @@ -43,9 +43,9 @@ struct ChannelVolumeScaleFade { }; // size = 0x10 struct SoundCharacteristics { - f32 *x; - f32 *y; - f32 *z; + f32* x; + f32* y; + f32* z; f32 distance; u32 priority; u32 soundBits; // packed bits, same as first arg to play_sound @@ -117,8 +117,7 @@ u8 sDialogSpeaker[] = { /*16*/ _, YOSHI, _, _, _, _, _, _, WIGLR, _ }; #undef _ -STATIC_ASSERT(ARRAY_COUNT(sDialogSpeaker) == DIALOG_COUNT, - "change this array if you are adding dialogs"); +STATIC_ASSERT(ARRAY_COUNT(sDialogSpeaker) == DIALOG_COUNT, "change this array if you are adding dialogs"); s32 sDialogSpeakerVoice[] = { SOUND_OBJ_UKIKI_CHATTER_LONG, @@ -162,14 +161,15 @@ u8 sSoundRequestCount = 0; #define MARIO_IS_IN_ROOM 7 #define DYN1(cond1, val1, res) (s16)(1 << (15 - cond1) | res), val1 -#define DYN2(cond1, val1, cond2, val2, res) \ - (s16)(1 << (15 - cond1) | 1 << (15 - cond2) | res), val1, val2 -#define DYN3(cond1, val1, cond2, val2, cond3, val3, res) \ +#define DYN2(cond1, val1, cond2, val2, res) (s16)(1 << (15 - cond1) | 1 << (15 - cond2) | res), val1, val2 +#define DYN3(cond1, val1, cond2, val2, cond3, val3, res) \ (s16)(1 << (15 - cond1) | 1 << (15 - cond2) | 1 << (15 - cond3) | res), val1, val2, val3 s16 sDynBbh[] = { - SEQ_LEVEL_SPOOKY, DYN1(MARIO_IS_IN_ROOM, BBH_OUTSIDE_ROOM, 6), - DYN1(MARIO_IS_IN_ROOM, BBH_NEAR_MERRY_GO_ROUND_ROOM, 6), 5, + SEQ_LEVEL_SPOOKY, + DYN1(MARIO_IS_IN_ROOM, BBH_OUTSIDE_ROOM, 6), + DYN1(MARIO_IS_IN_ROOM, BBH_NEAR_MERRY_GO_ROUND_ROOM, 6), + 5, }; s16 sDynDdd[] = { SEQ_LEVEL_WATER, @@ -188,19 +188,19 @@ s16 sDynJrb[] = { 5, // bogus entry, ignored (was JRB originally intended to have spooky music?) }; s16 sDynWdw[] = { - SEQ_LEVEL_UNDERGROUND, DYN2(MARIO_Y_LT, -670, MARIO_IS_IN_AREA, AREA_WDW_MAIN & 0xf, 4), - DYN1(MARIO_IS_IN_AREA, AREA_WDW_TOWN & 0xf, 4), 3, + SEQ_LEVEL_UNDERGROUND, + DYN2(MARIO_Y_LT, -670, MARIO_IS_IN_AREA, AREA_WDW_MAIN & 0xf, 4), + DYN1(MARIO_IS_IN_AREA, AREA_WDW_TOWN & 0xf, 4), + 3, }; s16 sDynHmc[] = { - SEQ_LEVEL_UNDERGROUND, DYN2(MARIO_X_GE, 0, MARIO_Y_LT, -203, 4), - DYN2(MARIO_X_LT, 0, MARIO_Y_LT, -2400, 4), 3, + SEQ_LEVEL_UNDERGROUND, + DYN2(MARIO_X_GE, 0, MARIO_Y_LT, -203, 4), + DYN2(MARIO_X_LT, 0, MARIO_Y_LT, -2400, 4), + 3, }; s16 sDynUnk38[] = { - SEQ_LEVEL_UNDERGROUND, - DYN1(MARIO_IS_IN_AREA, 1, 3), - DYN1(MARIO_IS_IN_AREA, 2, 4), - DYN1(MARIO_IS_IN_AREA, 3, 7), - 0, + SEQ_LEVEL_UNDERGROUND, DYN1(MARIO_IS_IN_AREA, 1, 3), DYN1(MARIO_IS_IN_AREA, 2, 4), DYN1(MARIO_IS_IN_AREA, 3, 7), 0, }; s16 sDynNone[] = { SEQ_SOUND_PLAYER, 0 }; @@ -211,7 +211,7 @@ u8 sBackgroundMusicForDynamics = SEQUENCE_NONE; #define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, leveldyn, _10, _11) leveldyn, #define _ sDynNone -s16 *sLevelDynamics[LEVEL_COUNT] = { +s16* sLevelDynamics[LEVEL_COUNT] = { _, // LEVEL_NONE #include "levels/level_defines.h" }; @@ -315,8 +315,7 @@ u8 sBackgroundMusicDefaultVolume[] = { 0, // SEQ_EVENT_CUTSCENE_LAKITU (not in JP) }; -STATIC_ASSERT(ARRAY_COUNT(sBackgroundMusicDefaultVolume) == SEQ_COUNT, - "change this array if you are adding sequences"); +STATIC_ASSERT(ARRAY_COUNT(sBackgroundMusicDefaultVolume) == SEQ_COUNT, "change this array if you are adding sequences"); u8 sCurrentBackgroundMusicSeqId = SEQUENCE_NONE; u8 sMusicDynamicDelay = 0; @@ -364,10 +363,9 @@ u8 sBackgroundMusicQueueSize = 0; u8 sUnused8033323C = 0; // never read, set to 0 #endif - // bss #if defined(VERSION_JP) || defined(VERSION_US) -s16 *gCurrAiBuffer; +s16* gCurrAiBuffer; #endif #ifdef VERSION_SH s8 D_SH_80343CD0_pad[0x20]; @@ -407,7 +405,7 @@ OSMesgQueue OSMesgQueue0; OSMesgQueue OSMesgQueue1; OSMesgQueue OSMesgQueue2; OSMesgQueue OSMesgQueue3; -extern OSMesgQueue *OSMesgQueues[]; +extern OSMesgQueue* OSMesgQueues[]; struct EuAudioCmd sAudioCmd[0x100]; @@ -418,8 +416,8 @@ s32 pad2[2]; // it's not just that the struct is bigger than we think, becaus OSMesg OSMesg2; // and none here. wth nintendo OSMesg OSMesg3; #else // VERSION_SH -extern OSMesgQueue *D_SH_80350F88; -extern OSMesgQueue *D_SH_80350FA8; +extern OSMesgQueue* D_SH_80350F88; +extern OSMesgQueue* D_SH_80350FA8; #endif #ifdef VERSION_JP @@ -454,17 +452,17 @@ void audio_reset_session_eu(s32 presetId) { OSMesg mesg; #ifdef VERSION_SH osRecvMesg(D_SH_80350FA8, &mesg, OS_MESG_NOBLOCK); - osSendMesg(D_SH_80350F88, (OSMesg) presetId, OS_MESG_NOBLOCK); + osSendMesg(D_SH_80350F88, (OSMesg)presetId, OS_MESG_NOBLOCK); osRecvMesg(D_SH_80350FA8, &mesg, OS_MESG_BLOCK); - if ((s32) mesg != presetId) { + if ((s32)mesg != presetId) { osRecvMesg(D_SH_80350FA8, &mesg, OS_MESG_BLOCK); } #else osRecvMesg(OSMesgQueues[3], &mesg, OS_MESG_NOBLOCK); - osSendMesg(OSMesgQueues[2], (OSMesg) presetId, OS_MESG_NOBLOCK); + osSendMesg(OSMesgQueues[2], (OSMesg)presetId, OS_MESG_NOBLOCK); osRecvMesg(OSMesgQueues[3], &mesg, OS_MESG_BLOCK); - if ((s32) mesg != presetId) { + if ((s32)mesg != presetId) { osRecvMesg(OSMesgQueues[3], &mesg, OS_MESG_BLOCK); } #endif @@ -476,7 +474,7 @@ void audio_reset_session_eu(s32 presetId) { * Called from threads: thread3_main, thread5_game_loop */ static void seq_player_fade_to_zero_volume(s32 player, FadeT fadeDuration) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; #ifndef VERSION_JP // fadeDuration is never 0 in practice @@ -494,7 +492,7 @@ static void seq_player_fade_to_zero_volume(s32 player, FadeT fadeDuration) { * Called from threads: thread4_sound, thread5_game_loop */ static void func_8031D690(s32 player, FadeT fadeInTime) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; if (fadeInTime == 0 || seqPlayer->state == SEQUENCE_PLAYER_STATE_FADE_OUT) { return; @@ -511,7 +509,7 @@ static void func_8031D690(s32 player, FadeT fadeInTime) { * Called from threads: thread5_game_loop */ static void seq_player_fade_to_percentage_of_volume(s32 player, FadeT fadeDuration, u8 percentage) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; f32 targetVolume; #if defined(VERSION_EU) || defined(VERSION_SH) @@ -546,7 +544,7 @@ static void seq_player_fade_to_percentage_of_volume(s32 player, FadeT fadeDurati * Called from threads: thread3_main, thread4_sound, thread5_game_loop */ static void seq_player_fade_to_normal_volume(s32 player, FadeT fadeDuration) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; #if defined(VERSION_EU) || defined(VERSION_SH) if (seqPlayer->state == 2) { @@ -577,7 +575,7 @@ static void seq_player_fade_to_normal_volume(s32 player, FadeT fadeDuration) { * Called from threads: thread3_main, thread4_sound, thread5_game_loop */ static void seq_player_fade_to_target_volume(s32 player, FadeT fadeDuration, u8 targetVolume) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; #if defined(VERSION_JP) || defined(VERSION_US) if (seqPlayer->state == SEQUENCE_PLAYER_STATE_FADE_OUT) { @@ -592,8 +590,7 @@ static void seq_player_fade_to_target_volume(s32 player, FadeT fadeDuration, u8 } seqPlayer->fadeVelocity = - (((f32)(FLOAT_CAST(targetVolume) / EU_FLOAT(127.0)) - seqPlayer->fadeVolume) - / (f32) fadeDuration); + (((f32)(FLOAT_CAST(targetVolume) / EU_FLOAT(127.0)) - seqPlayer->fadeVolume) / (f32)fadeDuration); #if defined(VERSION_EU) || defined(VERSION_SH) seqPlayer->state = 0; #else @@ -628,7 +625,7 @@ void maybe_tick_game_sound(void) { void func_eu_802e9bec(s32 player, s32 channel, s32 arg2) { // EU verson of unused_803209D8 // chan->stopSomething2 = arg2? - func_802ad770(0x08000000 | (player & 0xff) << 16 | (channel & 0xff) << 8, (s8) arg2); + func_802ad770(0x08000000 | (player & 0xff) << 16 | (channel & 0xff) << 8, (s8)arg2); } #else @@ -636,10 +633,10 @@ void func_eu_802e9bec(s32 player, s32 channel, s32 arg2) { /** * Called from threads: thread4_sound */ -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) { gAudioFrameCount++; if (sGameLoopTicked != 0) { update_game_sound(); @@ -655,7 +652,7 @@ void create_next_audio_buffer(s16 *samples, u32 num_samples) { /** * Called from threads: thread5_game_loop */ -void play_sound(s32 soundBits, f32 *pos) { +void play_sound(s32 soundBits, f32* pos) { sSoundRequests[sSoundRequestCount].soundBits = soundBits; sSoundRequests[sSoundRequestCount].position = pos; sSoundRequestCount++; @@ -664,7 +661,7 @@ void play_sound(s32 soundBits, f32 *pos) { /** * Called from threads: thread4_sound, thread5_game_loop (EU only) */ -static void process_sound_request(u32 bits, f32 *pos) { +static void process_sound_request(u32 bits, f32* pos) { u8 bank; u8 soundIndex; u8 counter = 0; @@ -686,16 +683,16 @@ static void process_sound_request(u32 bits, f32 *pos) { if (sSoundBanks[bank][soundIndex].x == pos) { // If the existing sound has lower or equal priority, then we should replace it. // Otherwise the new sound will be dropped. - if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_PRIORITY) - <= (bits & SOUNDARGS_MASK_PRIORITY)) { + if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_PRIORITY) <= + (bits & SOUNDARGS_MASK_PRIORITY)) { // If the existing sound is discrete or is a different continuous sound, then // interrupt it and play the new sound instead. // Otherwise the new sound is continuous and equals the existing sound, so we just // need to update the sound's freshness. - if ((sSoundBanks[bank][soundIndex].soundBits & SOUND_DISCRETE) != 0 - || (bits & SOUNDARGS_MASK_SOUNDID) - != (sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID)) { + if ((sSoundBanks[bank][soundIndex].soundBits & SOUND_DISCRETE) != 0 || + (bits & SOUNDARGS_MASK_SOUNDID) != + (sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID)) { update_background_music_after_sound(bank, soundIndex); sSoundBanks[bank][soundIndex].soundBits = bits; // In practice, the starting status is always WAITING @@ -754,7 +751,7 @@ static void process_sound_request(u32 bits, f32 *pos) { * Called from threads: thread4_sound, thread5_game_loop (EU only) */ static void process_all_sound_requests(void) { - struct Sound *sound; + struct Sound* sound; while (sSoundRequestCount != sNumProcessedSoundRequests) { sound = &sSoundRequests[sNumProcessedSoundRequests]; @@ -804,9 +801,8 @@ static void select_current_sounds(u8 bank) { u8 i; u8 j; u8 soundIndex; - u32 liveSoundPriorities[16] = { 0x10000000, 0x10000000, 0x10000000, 0x10000000, - 0x10000000, 0x10000000, 0x10000000, 0x10000000, - 0x10000000, 0x10000000, 0x10000000, 0x10000000, + u32 liveSoundPriorities[16] = { 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, + 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000, 0x10000000 }; u8 liveSoundIndices[16] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; @@ -824,8 +820,8 @@ static void select_current_sounds(u8 bank) { // If a discrete sound goes 10 frames without being played (because it is too low // priority), then mark it for deletion - if ((sSoundBanks[bank][soundIndex].soundBits & (SOUND_DISCRETE | SOUNDARGS_MASK_STATUS)) - == (SOUND_DISCRETE | SOUND_STATUS_WAITING)) { + if ((sSoundBanks[bank][soundIndex].soundBits & (SOUND_DISCRETE | SOUNDARGS_MASK_STATUS)) == + (SOUND_DISCRETE | SOUND_STATUS_WAITING)) { if (sSoundBanks[bank][soundIndex].freshness-- == 0) { sSoundBanks[bank][soundIndex].soundBits = NO_SOUND; } @@ -840,8 +836,8 @@ static void select_current_sounds(u8 bank) { } // If a sound was marked for deletion and hasn't started playing yet, delete it now - if (sSoundBanks[bank][soundIndex].soundBits == NO_SOUND - && sSoundBanks[bank][soundIndex].soundStatus == SOUND_STATUS_WAITING) { + if (sSoundBanks[bank][soundIndex].soundBits == NO_SOUND && + sSoundBanks[bank][soundIndex].soundStatus == SOUND_STATUS_WAITING) { // Since the current sound will be deleted, the next iteration should process // sound.prev.next latestSoundIndex = sSoundBanks[bank][soundIndex].prev; @@ -851,18 +847,17 @@ static void select_current_sounds(u8 bank) { // If the current sound was not just deleted, consider it as a candidate for the currently // playing sound - if (sSoundBanks[bank][soundIndex].soundStatus != SOUND_STATUS_STOPPED - && soundIndex == latestSoundIndex) { + if (sSoundBanks[bank][soundIndex].soundStatus != SOUND_STATUS_STOPPED && soundIndex == latestSoundIndex) { // Recompute distance each frame since the sound's position may have changed sSoundBanks[bank][soundIndex].distance = - sqrtf((*sSoundBanks[bank][soundIndex].x * *sSoundBanks[bank][soundIndex].x) - + (*sSoundBanks[bank][soundIndex].y * *sSoundBanks[bank][soundIndex].y) - + (*sSoundBanks[bank][soundIndex].z * *sSoundBanks[bank][soundIndex].z)) - * 1; + sqrtf((*sSoundBanks[bank][soundIndex].x * *sSoundBanks[bank][soundIndex].x) + + (*sSoundBanks[bank][soundIndex].y * *sSoundBanks[bank][soundIndex].y) + + (*sSoundBanks[bank][soundIndex].z * *sSoundBanks[bank][soundIndex].z)) * + 1; - requestedPriority = (sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_PRIORITY) - >> SOUNDARGS_SHIFT_PRIORITY; + requestedPriority = + (sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_PRIORITY) >> SOUNDARGS_SHIFT_PRIORITY; // Recompute priority, possibly based on the sound's source position relative to the // camera. @@ -871,13 +866,12 @@ static void select_current_sounds(u8 bank) { if (sSoundBanks[bank][soundIndex].soundBits & SOUND_NO_PRIORITY_LOSS) { sSoundBanks[bank][soundIndex].priority = 0x4c * (0xff - requestedPriority); } else if (*sSoundBanks[bank][soundIndex].z > 0.0f) { - sSoundBanks[bank][soundIndex].priority = - (u32) sSoundBanks[bank][soundIndex].distance - + (u32)(*sSoundBanks[bank][soundIndex].z / US_FLOAT(6.0)) - + 0x4c * (0xff - requestedPriority); + sSoundBanks[bank][soundIndex].priority = (u32)sSoundBanks[bank][soundIndex].distance + + (u32)(*sSoundBanks[bank][soundIndex].z / US_FLOAT(6.0)) + + 0x4c * (0xff - requestedPriority); } else { sSoundBanks[bank][soundIndex].priority = - (u32) sSoundBanks[bank][soundIndex].distance + 0x4c * (0xff - requestedPriority); + (u32)sSoundBanks[bank][soundIndex].distance + 0x4c * (0xff - requestedPriority); } // Insert the sound into the liveSound arrays, keeping the arrays sorted by priority. @@ -918,8 +912,7 @@ static void select_current_sounds(u8 bank) { for (i = 0; i < sUsedChannelsForSoundBank[bank]; i++) { // Check if sCurrentSound[bank][i] is present in the liveSound arrays. for (soundIndex = 0; soundIndex < sUsedChannelsForSoundBank[bank]; soundIndex++) { - if (liveSoundIndices[soundIndex] != 0xff - && sCurrentSound[bank][i] == liveSoundIndices[soundIndex]) { + if (liveSoundIndices[soundIndex] != 0xff && sCurrentSound[bank][i] == liveSoundIndices[soundIndex]) { // If found, remove it from liveSoundIndices liveSoundIndices[soundIndex] = 0xff; soundIndex = 0xfe; // Break. Afterward soundIndex will be 0xff @@ -938,10 +931,10 @@ static void select_current_sounds(u8 bank) { } // If the sound is discrete and is playing, then delete it - isDiscreteAndStatus = sSoundBanks[bank][sCurrentSound[bank][i]].soundBits - & (SOUND_DISCRETE | SOUNDARGS_MASK_STATUS); - if (isDiscreteAndStatus >= (SOUND_DISCRETE | SOUND_STATUS_PLAYING) - && sSoundBanks[bank][sCurrentSound[bank][i]].soundStatus != SOUND_STATUS_STOPPED) { + isDiscreteAndStatus = + sSoundBanks[bank][sCurrentSound[bank][i]].soundBits & (SOUND_DISCRETE | SOUNDARGS_MASK_STATUS); + if (isDiscreteAndStatus >= (SOUND_DISCRETE | SOUND_STATUS_PLAYING) && + sSoundBanks[bank][sCurrentSound[bank][i]].soundStatus != SOUND_STATUS_STOPPED) { //! @bug On JP, if a discrete sound that lowers the background music is // interrupted in this way, it will keep the background music low afterward. // There are only a few of these sounds, and it probably isn't possible to do @@ -957,9 +950,8 @@ static void select_current_sounds(u8 bank) { // If the sound is continuous and is playing, then stop playing it but don't delete // it. (A continuous sound shouldn't be deleted until it stops being requested) else { - if (isDiscreteAndStatus == SOUND_STATUS_PLAYING - && sSoundBanks[bank][sCurrentSound[bank][i]].soundStatus - != SOUND_STATUS_STOPPED) { + if (isDiscreteAndStatus == SOUND_STATUS_PLAYING && + sSoundBanks[bank][sCurrentSound[bank][i]].soundStatus != SOUND_STATUS_STOPPED) { sSoundBanks[bank][sCurrentSound[bank][i]].soundStatus = SOUND_STATUS_WAITING; } } @@ -980,9 +972,8 @@ static void select_current_sounds(u8 bank) { // Set (soundBits & status) to WAITING (soundStatus will be updated // shortly after in update_game_sound) sSoundBanks[bank][liveSoundIndices[soundIndex]].soundBits = - (sSoundBanks[bank][liveSoundIndices[soundIndex]].soundBits - & ~SOUNDARGS_MASK_STATUS) - + SOUND_STATUS_WAITING; + (sSoundBanks[bank][liveSoundIndices[soundIndex]].soundBits & ~SOUNDARGS_MASK_STATUS) + + SOUND_STATUS_WAITING; liveSoundIndices[i] = 0xff; // doesn't do anything i = 0xfe; // break @@ -1072,19 +1063,19 @@ static f32 get_sound_volume(u8 bank, u8 soundIndex, f32 volumeRange) { } else { maxSoundDistance = sLevelAcousticReaches[gCurrLevelNum] / div; if (maxSoundDistance < sSoundBanks[bank][soundIndex].distance) { - intensity = ((AUDIO_MAX_DISTANCE - sSoundBanks[bank][soundIndex].distance) - / (AUDIO_MAX_DISTANCE - maxSoundDistance)) - * (1.0f - volumeRange); + intensity = ((AUDIO_MAX_DISTANCE - sSoundBanks[bank][soundIndex].distance) / + (AUDIO_MAX_DISTANCE - maxSoundDistance)) * + (1.0f - volumeRange); } else { - intensity = - 1.0f - sSoundBanks[bank][soundIndex].distance / maxSoundDistance * volumeRange; + intensity = 1.0f - sSoundBanks[bank][soundIndex].distance / maxSoundDistance * volumeRange; } } #endif if (sSoundBanks[bank][soundIndex].soundBits & SOUND_VIBRATO) { #ifdef VERSION_JP - //! @bug Intensity is 0 when the sound is far away. Due to the subtraction below, it is possible to end up with a negative intensity. + //! @bug Intensity is 0 when the sound is far away. Due to the subtraction below, it is possible to end up + //! with a negative intensity. // When it is, objects with a volumeRange of 1 can still occasionally be lightly heard. if (intensity != 0.0) #else @@ -1149,10 +1140,10 @@ static u8 get_sound_reverb(UNUSED u8 bank, UNUSED u8 soundIndex, u8 channelIndex // reverb = reverb adjustment + level reverb + a volume-dependent value // The volume-dependent value is 0 when volume is at maximum, and raises to // LOW_VOLUME_REVERB when the volume is 0 - reverb = (u8)((u8) gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[5] - + sLevelAreaReverbs[level][area] - + (US_FLOAT(1.0) - gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume) - * LOW_VOLUME_REVERB); + reverb = + (u8)((u8)gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[5] + + sLevelAreaReverbs[level][area] + + (US_FLOAT(1.0) - gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume) * LOW_VOLUME_REVERB); if (reverb > 0x7f) { reverb = 0x7f; @@ -1204,8 +1195,7 @@ static void update_game_sound(void) { for (i = 0; i < MAX_CHANNELS_PER_SOUND_BANK; i++) { soundIndex = sCurrentSound[bank][i]; - if (soundIndex < 0xff - && sSoundBanks[bank][soundIndex].soundStatus != SOUND_STATUS_STOPPED) { + if (soundIndex < 0xff && sSoundBanks[bank][soundIndex].soundStatus != SOUND_STATUS_STOPPED) { soundStatus = sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_STATUS; soundId = (sSoundBanks[bank][soundIndex].soundBits >> SOUNDARGS_SHIFT_SOUNDID); @@ -1230,19 +1220,17 @@ static void update_game_sound(void) { if (!(sSoundBanks[bank][soundIndex].soundBits & SOUND_CONSTANT_FREQUENCY)) { if (sSoundMovingSpeed[bank] > 8) { #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728( - 0x02020000 | ((channelIndex & 0xff) << 8), - get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)); + func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), + get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)); #else value = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1); - gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = - value; + gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = value; #endif } else { #if defined(VERSION_EU) || defined(VERSION_SH) func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), - get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1) - * ((sSoundMovingSpeed[bank] + 8.0f) / 16)); + get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1) * + ((sSoundMovingSpeed[bank] + 8.0f) / 16)); #else value = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = @@ -1250,37 +1238,34 @@ static void update_game_sound(void) { #endif } #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z)); + func_802ad770( + 0x03020000 | ((channelIndex & 0xff) << 8), + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z)); #else gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->pan = - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z); + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z); #endif - if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID) - == (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) { + if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID) == + (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) { #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728( - 0x04020000 | ((channelIndex & 0xff) << 8), - get_sound_freq_scale(bank, soundIndex) - + ((f32) sSoundMovingSpeed[bank] / US_FLOAT(80.0))); + func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), + get_sound_freq_scale(bank, soundIndex) + + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(80.0))); #else value = get_sound_freq_scale(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = - ((f32) sSoundMovingSpeed[bank] / US_FLOAT(80.0)) + value; + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(80.0)) + value; #endif } else { #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728( - 0x04020000 | ((channelIndex & 0xff) << 8), - get_sound_freq_scale(bank, soundIndex) - + ((f32) sSoundMovingSpeed[bank] / US_FLOAT(400.0))); + func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), + get_sound_freq_scale(bank, soundIndex) + + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(400.0))); #else value = get_sound_freq_scale(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = - ((f32) sSoundMovingSpeed[bank] / US_FLOAT(400.0)) + value; + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(400.0)) + value; #endif } #if defined(VERSION_EU) || defined(VERSION_SH) @@ -1313,19 +1298,18 @@ static void update_game_sound(void) { get_sound_reverb(bank, soundIndex, channelIndex)); func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)); - func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z) - * 127.0f - + 0.5f); + func_802ad770( + 0x03020000 | ((channelIndex & 0xff) << 8), + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z) * + 127.0f + + 0.5f); func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), get_sound_freq_scale(bank, soundIndex)); #else gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->pan = - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z); + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = get_sound_freq_scale(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->reverbVol = @@ -1343,11 +1327,11 @@ static void update_game_sound(void) { get_sound_reverb(bank, soundIndex, channelIndex)); func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK2)); - func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z) - * 127.0f - + 0.5f); + func_802ad770( + 0x03020000 | ((channelIndex & 0xff) << 8), + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z) * + 127.0f + + 0.5f); func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), get_sound_freq_scale(bank, soundIndex)); #else @@ -1356,8 +1340,7 @@ static void update_game_sound(void) { gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK2); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->pan = - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z); + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = get_sound_freq_scale(bank, soundIndex); #endif @@ -1384,9 +1367,8 @@ static void update_game_sound(void) { update_background_music_after_sound(bank, soundIndex); sSoundBanks[bank][soundIndex].soundStatus = SOUND_STATUS_STOPPED; delete_sound_from_bank(bank, soundIndex); - } else if (soundStatus == SOUND_STATUS_STOPPED - && gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex] - ->layers[0]->finished == FALSE) { + } else if (soundStatus == SOUND_STATUS_STOPPED && + gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->layers[0]->finished == FALSE) { update_background_music_after_sound(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->soundScriptIO[0] = 0; delete_sound_from_bank(bank, soundIndex); @@ -1398,8 +1380,7 @@ static void update_game_sound(void) { // many sounds playing at once. This crash is comparatively common; RTA // speedrunners even have a setup for avoiding it within the SSL pyramid: // https://www.youtube.com/watch?v=QetyTgbQxcw - else if (gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->layers[0]->enabled - == FALSE) { + else if (gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->layers[0]->enabled == FALSE) { update_background_music_after_sound(bank, soundIndex); sSoundBanks[bank][soundIndex].soundStatus = SOUND_STATUS_STOPPED; delete_sound_from_bank(bank, soundIndex); @@ -1414,19 +1395,17 @@ static void update_game_sound(void) { if (!(sSoundBanks[bank][soundIndex].soundBits & SOUND_CONSTANT_FREQUENCY)) { if (sSoundMovingSpeed[bank] > 8) { #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728( - 0x02020000 | ((channelIndex & 0xff) << 8), - get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)); + func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), + get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)); #else value = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1); - gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = - value; + gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = value; #endif } else { #if defined(VERSION_EU) || defined(VERSION_SH) func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), - get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1) - * ((sSoundMovingSpeed[bank] + 8.0f) / 16)); + get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1) * + ((sSoundMovingSpeed[bank] + 8.0f) / 16)); #else value = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = @@ -1434,37 +1413,34 @@ static void update_game_sound(void) { #endif } #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z)); + func_802ad770( + 0x03020000 | ((channelIndex & 0xff) << 8), + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z)); #else gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->pan = - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z); + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z); #endif - if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID) - == (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) { + if ((sSoundBanks[bank][soundIndex].soundBits & SOUNDARGS_MASK_SOUNDID) == + (SOUND_MOVING_FLYING & SOUNDARGS_MASK_SOUNDID)) { #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728( - 0x04020000 | ((channelIndex & 0xff) << 8), - get_sound_freq_scale(bank, soundIndex) - + ((f32) sSoundMovingSpeed[bank] / US_FLOAT(80.0))); + func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), + get_sound_freq_scale(bank, soundIndex) + + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(80.0))); #else value = get_sound_freq_scale(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = - ((f32) sSoundMovingSpeed[bank] / US_FLOAT(80.0)) + value; + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(80.0)) + value; #endif } else { #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728( - 0x04020000 | ((channelIndex & 0xff) << 8), - get_sound_freq_scale(bank, soundIndex) - + ((f32) sSoundMovingSpeed[bank] / US_FLOAT(400.0))); + func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), + get_sound_freq_scale(bank, soundIndex) + + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(400.0))); #else value = get_sound_freq_scale(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = - ((f32) sSoundMovingSpeed[bank] / US_FLOAT(400.0)) + value; + ((f32)sSoundMovingSpeed[bank] / US_FLOAT(400.0)) + value; #endif } #if defined(VERSION_EU) || defined(VERSION_SH) @@ -1497,19 +1473,18 @@ static void update_game_sound(void) { get_sound_reverb(bank, soundIndex, channelIndex)); func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1)); - func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z) - * 127.0f - + 0.5f); + func_802ad770( + 0x03020000 | ((channelIndex & 0xff) << 8), + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z) * + 127.0f + + 0.5f); func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), get_sound_freq_scale(bank, soundIndex)); #else gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK1); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->pan = - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z); + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = get_sound_freq_scale(bank, soundIndex); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->reverbVol = @@ -1527,11 +1502,11 @@ static void update_game_sound(void) { get_sound_reverb(bank, soundIndex, channelIndex)); func_802ad728(0x02020000 | ((channelIndex & 0xff) << 8), get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK2)); - func_802ad770(0x03020000 | ((channelIndex & 0xff) << 8), - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z) - * 127.0f - + 0.5f); + func_802ad770( + 0x03020000 | ((channelIndex & 0xff) << 8), + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z) * + 127.0f + + 0.5f); func_802ad728(0x04020000 | ((channelIndex & 0xff) << 8), get_sound_freq_scale(bank, soundIndex)); #else @@ -1540,8 +1515,7 @@ static void update_game_sound(void) { gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->volume = get_sound_volume(bank, soundIndex, VOLUME_RANGE_UNK2); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->pan = - get_sound_pan(*sSoundBanks[bank][soundIndex].x, - *sSoundBanks[bank][soundIndex].z); + get_sound_pan(*sSoundBanks[bank][soundIndex].x, *sSoundBanks[bank][soundIndex].z); gSequencePlayers[SEQ_PLAYER_SFX].channels[channelIndex]->freqScale = get_sound_freq_scale(bank, soundIndex); #endif @@ -1580,13 +1554,13 @@ static void seq_player_play_sequence(u8 player, u8 seqId, u16 arg2) { } #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad770(0x46000000 | ((u8)(u32) player) << 16, seqId & SEQ_VARIATION); - func_802ad74c(0x82000000 | ((u8)(u32) player) << 16 | ((u8)(seqId & SEQ_BASE_ID)) << 8, arg2); + func_802ad770(0x46000000 | ((u8)(u32)player) << 16, seqId & SEQ_VARIATION); + func_802ad74c(0x82000000 | ((u8)(u32)player) << 16 | ((u8)(seqId & SEQ_BASE_ID)) << 8, arg2); if (player == SEQ_PLAYER_LEVEL) { targetVolume = begin_background_music_fade(0); if (targetVolume != 0xff) { - gSequencePlayers[SEQ_PLAYER_LEVEL].fadeVolumeScale = (f32) targetVolume / US_FLOAT(127.0); + gSequencePlayers[SEQ_PLAYER_LEVEL].fadeVolumeScale = (f32)targetVolume / US_FLOAT(127.0); } } #else @@ -1598,7 +1572,7 @@ static void seq_player_play_sequence(u8 player, u8 seqId, u16 arg2) { targetVolume = begin_background_music_fade(0); if (targetVolume != 0xff) { gSequencePlayers[SEQ_PLAYER_LEVEL].state = SEQUENCE_PLAYER_STATE_4; - gSequencePlayers[SEQ_PLAYER_LEVEL].fadeVolume = (f32) targetVolume / US_FLOAT(127.0); + gSequencePlayers[SEQ_PLAYER_LEVEL].fadeVolume = (f32)targetVolume / US_FLOAT(127.0); } } else { func_8031D690(player, arg2); @@ -1642,14 +1616,14 @@ void fade_volume_scale(u8 player, u8 targetScale, u16 fadeDuration) { * Called from threads: thread3_main, thread4_sound, thread5_game_loop */ static void fade_channel_volume_scale(u8 player, u8 channelIndex, u8 targetScale, u16 fadeDuration) { - struct ChannelVolumeScaleFade *temp; + struct ChannelVolumeScaleFade* temp; if (gSequencePlayers[player].channels[channelIndex] != &gSequenceChannelNone) { temp = &D_80360928[player][channelIndex]; temp->remainingFrames = fadeDuration; - temp->velocity = ((f32)(targetScale / US_FLOAT(127.0)) - - gSequencePlayers[player].channels[channelIndex]->volumeScale) - / fadeDuration; + temp->velocity = + ((f32)(targetScale / US_FLOAT(127.0)) - gSequencePlayers[player].channels[channelIndex]->volumeScale) / + fadeDuration; temp->target = targetScale; temp->current = gSequencePlayers[player].channels[channelIndex]->volumeScale; } @@ -1663,12 +1637,11 @@ static void func_8031F96C(u8 player) { // Loop over channels for (i = 0; i < CHANNELS_MAX; i++) { - if (gSequencePlayers[player].channels[i] != &gSequenceChannelNone - && D_80360928[player][i].remainingFrames != 0) { + if (gSequencePlayers[player].channels[i] != &gSequenceChannelNone && + D_80360928[player][i].remainingFrames != 0) { D_80360928[player][i].current += D_80360928[player][i].velocity; #if defined(VERSION_EU) || defined(VERSION_SH) - func_802ad728(0x01000000 | (player & 0xff) << 16 | (i & 0xff) << 8, - D_80360928[player][i].current); + func_802ad728(0x01000000 | (player & 0xff) << 16 | (i & 0xff) << 8, D_80360928[player][i].current); #else gSequencePlayers[player].channels[i]->volumeScale = D_80360928[player][i].current; #endif @@ -1681,8 +1654,7 @@ static void func_8031F96C(u8 player) { func_802ad728(0x01000000 | (player & 0xff) << 16 | (i & 0xff) << 8, FLOAT_CAST(D_80360928[player][i].target) / 127.0f); #else - gSequencePlayers[player].channels[i]->volumeScale = - D_80360928[player][i].target / 127.0f; + gSequencePlayers[player].channels[i]->volumeScale = D_80360928[player][i].target / 127.0f; #endif } } @@ -1720,7 +1692,7 @@ void process_level_music_dynamics(void) { } conditionBits = sLevelDynamics[gCurrLevelNum][1] & 0xff00; - musicDynIndex = (u8) sLevelDynamics[gCurrLevelNum][1] & 0xff; + musicDynIndex = (u8)sLevelDynamics[gCurrLevelNum][1] & 0xff; i = 2; while (conditionBits & 0xff00) { j = 0; @@ -1740,37 +1712,37 @@ void process_level_music_dynamics(void) { for (j = 0; j < condIndex; j++) { switch (conditionTypes[j]) { case MARIO_X_GE: { - if (((s16) gMarioStates[0].pos[0]) < conditionValues[j]) { + if (((s16)gMarioStates[0].pos[0]) < conditionValues[j]) { j = condIndex + 1; } break; } case MARIO_Y_GE: { - if (((s16) gMarioStates[0].pos[1]) < conditionValues[j]) { + if (((s16)gMarioStates[0].pos[1]) < conditionValues[j]) { j = condIndex + 1; } break; } case MARIO_Z_GE: { - if (((s16) gMarioStates[0].pos[2]) < conditionValues[j]) { + if (((s16)gMarioStates[0].pos[2]) < conditionValues[j]) { j = condIndex + 1; } break; } case MARIO_X_LT: { - if (((s16) gMarioStates[0].pos[0]) >= conditionValues[j]) { + if (((s16)gMarioStates[0].pos[0]) >= conditionValues[j]) { j = condIndex + 1; } break; } case MARIO_Y_LT: { - if (((s16) gMarioStates[0].pos[1]) >= conditionValues[j]) { + if (((s16)gMarioStates[0].pos[1]) >= conditionValues[j]) { j = condIndex + 1; } break; } case MARIO_Z_LT: { - if (((s16) gMarioStates[0].pos[2]) >= conditionValues[j]) { + if (((s16)gMarioStates[0].pos[2]) >= conditionValues[j]) { j = condIndex + 1; } break; @@ -1794,7 +1766,7 @@ void process_level_music_dynamics(void) { // The area matches. Break out of the loop. tempBits = 0; } else { - tempBits = sLevelDynamics[gCurrLevelNum][i] & 0xff00; + tempBits = sLevelDynamics[gCurrLevelNum][i] & 0xff00; musicDynIndex = sLevelDynamics[gCurrLevelNum][i] & 0xff; i++; } @@ -1816,12 +1788,10 @@ void process_level_music_dynamics(void) { conditionBits = tempBits; tempBits = 0; if (sMusicDynamics[musicDynIndex].bits1 & conditionBits) { - fade_channel_volume_scale(SEQ_PLAYER_LEVEL, i, sMusicDynamics[musicDynIndex].volScale1, - dur1); + fade_channel_volume_scale(SEQ_PLAYER_LEVEL, i, sMusicDynamics[musicDynIndex].volScale1, dur1); } if (sMusicDynamics[musicDynIndex].bits2 & conditionBits) { - fade_channel_volume_scale(SEQ_PLAYER_LEVEL, i, sMusicDynamics[musicDynIndex].volScale2, - dur2); + fade_channel_volume_scale(SEQ_PLAYER_LEVEL, i, sMusicDynamics[musicDynIndex].volScale2, dur2); } tempBits = conditionBits << 1; } @@ -1842,10 +1812,9 @@ void unused_8031FED0(u8 player, u32 bits, s8 arg2) { if ((bits & 3) == 0) { gSequencePlayers[player].channels[i]->volumeScale = 1.0f; } else if ((bits & 1) != 0) { - gSequencePlayers[player].channels[i]->volumeScale = (f32) arg2 / US_FLOAT(127.0); + gSequencePlayers[player].channels[i]->volumeScale = (f32)arg2 / US_FLOAT(127.0); } else { - gSequencePlayers[player].channels[i]->volumeScale = - US_FLOAT(1.0) - (f32) arg2 / US_FLOAT(127.0); + gSequencePlayers[player].channels[i]->volumeScale = US_FLOAT(1.0) - (f32)arg2 / US_FLOAT(127.0); } } bits >>= 2; @@ -1901,8 +1870,7 @@ void seq_player_unlower_volume(u8 player, u16 fadeDuration) { static u8 begin_background_music_fade(u16 fadeDuration) { u8 targetVolume = 0xff; - if (sCurrentBackgroundMusicSeqId == SEQUENCE_NONE - || sCurrentBackgroundMusicSeqId == SEQ_EVENT_CUTSCENE_CREDITS) { + if (sCurrentBackgroundMusicSeqId == SEQUENCE_NONE || sCurrentBackgroundMusicSeqId == SEQ_EVENT_CUTSCENE_CREDITS) { return 0xff; } @@ -2028,7 +1996,7 @@ void sound_init(void) { } // (unused) -void get_currently_playing_sound(u8 bank, u8 *numPlayingSounds, u8 *numSoundsInBank, u8 *soundId) { +void get_currently_playing_sound(u8 bank, u8* numPlayingSounds, u8* numSoundsInBank, u8* soundId) { u8 i; u8 count = 0; @@ -2051,15 +2019,15 @@ void get_currently_playing_sound(u8 bank, u8 *numPlayingSounds, u8 *numSoundsInB /** * Called from threads: thread5_game_loop */ -void stop_sound(u32 soundBits, f32 *pos) { +void stop_sound(u32 soundBits, f32* pos) { u8 bank = (soundBits & SOUNDARGS_MASK_BANK) >> SOUNDARGS_SHIFT_BANK; u8 soundIndex = sSoundBanks[bank][0].next; while (soundIndex != 0xff) { // If sound has same id and source position pointer - if ((u16)(soundBits >> SOUNDARGS_SHIFT_SOUNDID) - == (u16)(sSoundBanks[bank][soundIndex].soundBits >> SOUNDARGS_SHIFT_SOUNDID) - && sSoundBanks[bank][soundIndex].x == pos) { + if ((u16)(soundBits >> SOUNDARGS_SHIFT_SOUNDID) == + (u16)(sSoundBanks[bank][soundIndex].soundBits >> SOUNDARGS_SHIFT_SOUNDID) && + sSoundBanks[bank][soundIndex].x == pos) { // Mark sound for deletion update_background_music_after_sound(bank, soundIndex); @@ -2074,7 +2042,7 @@ void stop_sound(u32 soundBits, f32 *pos) { /** * Called from threads: thread5_game_loop */ -void stop_sounds_from_source(f32 *pos) { +void stop_sounds_from_source(f32* pos) { u8 bank; u8 soundIndex; @@ -2346,11 +2314,10 @@ void func_80320ED8(void) { D_EU_80300558--; } - if (gSequencePlayers[SEQ_PLAYER_ENV].enabled - || sBackgroundMusicMaxTargetVolume == TARGET_VOLUME_UNSET || D_EU_80300558 != 0) { + if (gSequencePlayers[SEQ_PLAYER_ENV].enabled || sBackgroundMusicMaxTargetVolume == TARGET_VOLUME_UNSET || + D_EU_80300558 != 0) { #else - if (gSequencePlayers[SEQ_PLAYER_ENV].enabled - || sBackgroundMusicMaxTargetVolume == TARGET_VOLUME_UNSET) { + if (gSequencePlayers[SEQ_PLAYER_ENV].enabled || sBackgroundMusicMaxTargetVolume == TARGET_VOLUME_UNSET) { #endif return; } @@ -2358,8 +2325,8 @@ void func_80320ED8(void) { sBackgroundMusicMaxTargetVolume = TARGET_VOLUME_UNSET; begin_background_music_fade(50); - if (sBackgroundMusicTargetVolume != TARGET_VOLUME_UNSET - && (D_80332120 == SEQ_EVENT_MERRY_GO_ROUND || D_80332120 == SEQ_EVENT_PIRANHA_PLANT)) { + if (sBackgroundMusicTargetVolume != TARGET_VOLUME_UNSET && + (D_80332120 == SEQ_EVENT_MERRY_GO_ROUND || D_80332120 == SEQ_EVENT_PIRANHA_PLANT)) { seq_player_play_sequence(SEQ_PLAYER_ENV, D_80332120, 1); if (D_80332124 != 0xff) { seq_player_fade_to_target_volume(SEQ_PLAYER_ENV, 1, D_80332124); diff --git a/src/audio/heap.c b/src/audio/heap.c index 9d15952d..b274c546 100644 --- a/src/audio/heap.c +++ b/src/audio/heap.c @@ -64,11 +64,11 @@ u8 gAudioUnusedBuffer[0x1000]; extern s32 gMaxAudioCmds; #ifdef VERSION_SH -void *get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId); -struct UnkEntry *func_sh_802f1ec4(u32 size); -void func_sh_802f2158(struct UnkEntry *entry); -struct UnkEntry *unk_pool2_alloc(u32 size); -void func_sh_802F2320(struct UnkEntry *entry, struct AudioBankSample *sample); +void* get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId); +struct UnkEntry* func_sh_802f1ec4(u32 size); +void func_sh_802f2158(struct UnkEntry* entry); +struct UnkEntry* unk_pool2_alloc(u32 size); +void func_sh_802F2320(struct UnkEntry* entry, struct AudioBankSample* sample); void func_sh_802f23ec(void); void unk_pools_init(u32 size1, u32 size2); @@ -119,8 +119,7 @@ f64 kth_root(f64 d, s32 k) { root = 1.0; } else { for (i = 0; i < 64; i++) { - if (1) { - } + if (1) {} next = root_newton_step(root, k, d); diff = next - root; @@ -152,11 +151,11 @@ void build_vol_rampings_table(s32 UNUSED unused, s32 len) { d = 1; } - gLeftVolRampings[0][i] = kth_root( d, k - 1); + gLeftVolRampings[0][i] = kth_root(d, k - 1); gRightVolRampings[0][i] = kth_root(1.0 / d, k - 1) * 65536.0; - gLeftVolRampings[1][i] = kth_root( d, k); + gLeftVolRampings[1][i] = kth_root(d, k); gRightVolRampings[1][i] = kth_root(1.0 / d, k) * 65536.0; - gLeftVolRampings[2][i] = kth_root( d, k + 1); + gLeftVolRampings[2][i] = kth_root(d, k + 1); gRightVolRampings[2][i] = kth_root(1.0 / d, k + 1) * 65536.0; } } @@ -190,7 +189,7 @@ void discard_bank(s32 bankId) { s32 i; for (i = 0; i < gMaxSimultaneousNotes; i++) { - struct Note *note = &gNotes[i]; + struct Note* note = &gNotes[i]; #if defined(VERSION_EU) if (note->noteSubEu.bankId == bankId) { @@ -204,8 +203,7 @@ void discard_bank(s32 bankId) { #else if (note->priority >= NOTE_PRIORITY_MIN) { #endif - eu_stubbed_printf_3("Kill Voice %d (ID %d) %d\n", note->waveId, - bankId, note->priority); + eu_stubbed_printf_3("Kill Voice %d (ID %d) %d\n", note->waveId, bankId, note->priority); eu_stubbed_printf_0("Warning: Running Sequence's data disappear!\n"); note->parentLayer->enabled = FALSE; // is 0x48, should be 0x44 note->parentLayer->finished = TRUE; @@ -231,10 +229,10 @@ void discard_sequence(s32 seqId) { } } -void *soundAlloc(struct SoundAllocPool *pool, u32 size) { +void* soundAlloc(struct SoundAllocPool* pool, u32 size) { #if defined(VERSION_EU) || defined(VERSION_SH) - u8 *start; - u8 *pos; + u8* start; + u8* pos; u32 alignedSize = ALIGN16(size); start = pool->cur; @@ -252,7 +250,7 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size) { #endif return start; #else - u8 *start; + u8* start; s32 last; s32 i; @@ -271,8 +269,8 @@ void *soundAlloc(struct SoundAllocPool *pool, u32 size) { } #ifdef VERSION_SH -void *sound_alloc_uninitialized(struct SoundAllocPool *pool, u32 size) { - u8 *start; +void* sound_alloc_uninitialized(struct SoundAllocPool* pool, u32 size) { + u8* start; u32 alignedSize = ALIGN16(size); start = pool->cur; @@ -287,23 +285,23 @@ void *sound_alloc_uninitialized(struct SoundAllocPool *pool, u32 size) { } #endif -void sound_alloc_pool_init(struct SoundAllocPool *pool, void *memAddr, u32 size) { - pool->cur = pool->start = (u8 *) ALIGN16((uintptr_t) memAddr); +void sound_alloc_pool_init(struct SoundAllocPool* pool, void* memAddr, u32 size) { + pool->cur = pool->start = (u8*)ALIGN16((uintptr_t)memAddr); #ifdef VERSION_SH - pool->size = size - ((uintptr_t) memAddr & 0xf); + pool->size = size - ((uintptr_t)memAddr & 0xf); #else pool->size = size; #endif pool->numAllocatedEntries = 0; } -void persistent_pool_clear(struct PersistentPool *persistent) { +void persistent_pool_clear(struct PersistentPool* persistent) { persistent->pool.numAllocatedEntries = 0; persistent->pool.cur = persistent->pool.start; persistent->numEntries = 0; } -void temporary_pool_clear(struct TemporaryPool *temporary) { +void temporary_pool_clear(struct TemporaryPool* temporary) { temporary->pool.numAllocatedEntries = 0; temporary->pool.cur = temporary->pool.start; temporary->nextSide = 0; @@ -317,7 +315,7 @@ void temporary_pool_clear(struct TemporaryPool *temporary) { temporary->entries[1].id = -1; } -void unused_803160F8(struct SoundAllocPool *pool) { +void unused_803160F8(struct SoundAllocPool* pool) { pool->numAllocatedEntries = 0; pool->cur = pool->start; } @@ -334,29 +332,31 @@ void sound_init_main_pools(s32 sizeForAudioInitPool) { #define SOUND_ALLOC_FUNC soundAlloc #endif -void session_pools_init(struct PoolSplit *a) { +void session_pools_init(struct PoolSplit* a) { gAudioSessionPool.cur = gAudioSessionPool.start; sound_alloc_pool_init(&gNotesAndBuffersPool, SOUND_ALLOC_FUNC(&gAudioSessionPool, a->wantSeq), a->wantSeq); sound_alloc_pool_init(&gSeqAndBankPool, SOUND_ALLOC_FUNC(&gAudioSessionPool, a->wantCustom), a->wantCustom); } -void seq_and_bank_pool_init(struct PoolSplit2 *a) { +void seq_and_bank_pool_init(struct PoolSplit2* a) { gSeqAndBankPool.cur = gSeqAndBankPool.start; - sound_alloc_pool_init(&gPersistentCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantPersistent), a->wantPersistent); - sound_alloc_pool_init(&gTemporaryCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantTemporary), a->wantTemporary); + sound_alloc_pool_init(&gPersistentCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantPersistent), + a->wantPersistent); + sound_alloc_pool_init(&gTemporaryCommonPool, SOUND_ALLOC_FUNC(&gSeqAndBankPool, a->wantTemporary), + a->wantTemporary); } -void persistent_pools_init(struct PoolSplit *a) { +void persistent_pools_init(struct PoolSplit* a) { gPersistentCommonPool.cur = gPersistentCommonPool.start; sound_alloc_pool_init(&gUnusedLoadedPool.persistent.pool, SOUND_ALLOC_FUNC(&gPersistentCommonPool, a->wantUnused), - a->wantUnused); + a->wantUnused); persistent_pool_clear(&gUnusedLoadedPool.persistent); } -void temporary_pools_init(struct PoolSplit *a) { +void temporary_pools_init(struct PoolSplit* a) { gTemporaryCommonPool.cur = gTemporaryCommonPool.start; sound_alloc_pool_init(&gUnusedLoadedPool.temporary.pool, SOUND_ALLOC_FUNC(&gTemporaryCommonPool, a->wantUnused), - a->wantUnused); + a->wantUnused); temporary_pool_clear(&gUnusedLoadedPool.temporary); } #undef SOUND_ALLOC_FUNC @@ -367,19 +367,19 @@ UNUSED static void unused_803163D4(void) { #endif #ifdef VERSION_SH -void *alloc_bank_or_seq(s32 poolIdx, s32 size, s32 arg3, s32 id) { +void* alloc_bank_or_seq(s32 poolIdx, s32 size, s32 arg3, s32 id) { #else -void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg3, s32 id) { +void* alloc_bank_or_seq(struct SoundMultiPool* arg0, s32 arg1, s32 size, s32 arg3, s32 id) { #endif // arg3 = 0, 1 or 2? #ifdef VERSION_SH - struct SoundMultiPool *arg0; + struct SoundMultiPool* arg0; #define isSound poolIdx #endif - struct TemporaryPool *tp; - struct SoundAllocPool *pool; - void *ret; + struct TemporaryPool* tp; + struct SoundAllocPool* pool; + void* ret; #if defined(VERSION_JP) || defined(VERSION_US) u16 UNUSED _firstVal; u16 UNUSED _secondVal; @@ -389,7 +389,7 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg #endif u32 nullID = -1; UNUSED s32 i; - u8 *table; + u8* table; #ifndef VERSION_SH u8 isSound; #endif @@ -436,7 +436,7 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg secondVal = table[tp->entries[1].id]; } #else - firstVal = (tp->entries[0].id == (s8)nullID ? SOUND_LOAD_STATUS_NOT_LOADED : table[tp->entries[0].id]); + firstVal = (tp->entries[0].id == (s8)nullID ? SOUND_LOAD_STATUS_NOT_LOADED : table[tp->entries[0].id]); secondVal = (tp->entries[1].id == (s8)nullID ? SOUND_LOAD_STATUS_NOT_LOADED : table[tp->entries[1].id]); #endif @@ -601,7 +601,7 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg } } return NULL; - out:; + out:; #endif } } @@ -626,40 +626,40 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg #ifdef VERSION_SH if (tp->entries[1].id != (s32)nullID) #endif - if (tp->entries[1].ptr < pool->cur) { - eu_stubbed_printf_0("WARNING: Before Area Overlaid After."); + if (tp->entries[1].ptr < pool->cur) { + eu_stubbed_printf_0("WARNING: Before Area Overlaid After."); - // Throw out the entry on the other side if it doesn't fit. - // (possible @bug: what if it's currently being loaded?) - table[tp->entries[1].id] = SOUND_LOAD_STATUS_NOT_LOADED; + // Throw out the entry on the other side if it doesn't fit. + // (possible @bug: what if it's currently being loaded?) + table[tp->entries[1].id] = SOUND_LOAD_STATUS_NOT_LOADED; - switch (isSound) { - case FALSE: - discard_sequence(tp->entries[1].id); - break; - case TRUE: - discard_bank(tp->entries[1].id); - break; - } + switch (isSound) { + case FALSE: + discard_sequence(tp->entries[1].id); + break; + case TRUE: + discard_bank(tp->entries[1].id); + break; + } - tp->entries[1].id = (s32)nullID; + tp->entries[1].id = (s32)nullID; #if defined(VERSION_EU) || defined(VERSION_SH) - tp->entries[1].ptr = pool->start + pool->size; + tp->entries[1].ptr = pool->start + pool->size; #else tp->entries[1].ptr = pool->size + pool->start; #endif - } + } ret = tp->entries[0].ptr; break; case 1: #if defined(VERSION_SH) - tp->entries[1].ptr = (u8 *) ((uintptr_t) (pool->start + pool->size - size) & ~0x0f); + tp->entries[1].ptr = (u8*)((uintptr_t)(pool->start + pool->size - size) & ~0x0f); #elif defined(VERSION_EU) tp->entries[1].ptr = pool->start + pool->size - size - 0x10; #else - tp->entries[1].ptr = pool->size + pool->start - size - 0x10; + tp->entries[1].ptr = pool->size + pool->start - size - 0x10; #endif tp->entries[1].id = id; tp->entries[1].size = size; @@ -667,24 +667,24 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg #ifdef VERSION_SH if (tp->entries[0].id != (s32)nullID) #endif - if (tp->entries[1].ptr < pool->cur) { - eu_stubbed_printf_0("WARNING: After Area Overlaid Before."); + if (tp->entries[1].ptr < pool->cur) { + eu_stubbed_printf_0("WARNING: After Area Overlaid Before."); - table[tp->entries[0].id] = SOUND_LOAD_STATUS_NOT_LOADED; + table[tp->entries[0].id] = SOUND_LOAD_STATUS_NOT_LOADED; - switch (isSound) { - case FALSE: - discard_sequence(tp->entries[0].id); - break; - case TRUE: - discard_bank(tp->entries[0].id); - break; + switch (isSound) { + case FALSE: + discard_sequence(tp->entries[0].id); + break; + case TRUE: + discard_bank(tp->entries[0].id); + break; + } + + tp->entries[0].id = (s32)nullID; + pool->cur = pool->start; } - tp->entries[0].id = (s32)nullID; - pool->cur = pool->start; - } - ret = tp->entries[1].ptr; break; @@ -723,9 +723,9 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg #elif defined(VERSION_SH) return alloc_bank_or_seq(poolIdx, size, 0, id); #else - // Prevent tail call optimization. - ret = alloc_bank_or_seq(arg0, arg1, size, 0, id); - return ret; + // Prevent tail call optimization. + ret = alloc_bank_or_seq(arg0, arg1, size, 0, id); + return ret; #endif case 1: #ifdef VERSION_SH @@ -743,7 +743,8 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg #if defined(VERSION_EU) || defined(VERSION_SH) return arg0->persistent.entries[arg0->persistent.numEntries++].ptr; #else - arg0->persistent.numEntries++; return arg0->persistent.entries[arg0->persistent.numEntries - 1].ptr; + arg0->persistent.numEntries++; + return arg0->persistent.entries[arg0->persistent.numEntries - 1].ptr; #endif #ifdef VERSION_SH #undef isSound @@ -751,8 +752,8 @@ void *alloc_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 size, s32 arg } #ifdef VERSION_SH -void *get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id) { - void *ret; +void* get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id) { + void* ret; ret = unk_pool1_lookup(poolIdx, id); if (ret != NULL) { @@ -763,7 +764,7 @@ void *get_bank_or_seq(s32 poolIdx, s32 arg1, s32 id) { } return get_bank_or_seq_inner(poolIdx, arg1, id); } -void *get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId) { +void* get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId) { u32 i; struct SoundMultiPool* loadedPool; struct TemporaryPool* temporary; @@ -808,10 +809,10 @@ void *get_bank_or_seq_inner(s32 poolIdx, s32 arg1, s32 bankId) { } #endif #ifndef VERSION_SH -void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id) { +void* get_bank_or_seq(struct SoundMultiPool* arg0, s32 arg1, s32 id) { u32 i; - UNUSED void *ret; - struct TemporaryPool *temporary = &arg0->temporary; + UNUSED void* ret; + struct TemporaryPool* temporary = &arg0->temporary; if (arg1 == 0) { // Try not to overwrite sound that we have just accessed, by setting nextSide appropriately. @@ -825,7 +826,7 @@ void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id) { eu_stubbed_printf_1("Auto Heap Unhit for ID %d\n", id); return NULL; } else { - struct PersistentPool *persistent = &arg0->persistent; + struct PersistentPool* persistent = &arg0->persistent; for (i = 0; i < persistent->numEntries; i++) { if (id == persistent->entries[i].id) { eu_stubbed_printf_2("Cache hit %d at stay %d\n", id, i); @@ -849,14 +850,14 @@ void *get_bank_or_seq(struct SoundMultiPool *arg0, s32 arg1, s32 id) { #endif #if defined(VERSION_EU) || defined(VERSION_SH) -void func_eu_802e27e4_unused(f32 arg0, f32 arg1, u16 *arg2) { +void func_eu_802e27e4_unused(f32 arg0, f32 arg1, u16* arg2) { s32 i; f32 tmp[16]; - tmp[0] = (f32) (arg1 * 262159.0f); - tmp[8] = (f32) (arg0 * 262159.0f); - tmp[1] = (f32) ((arg1 * arg0) * 262159.0f); - tmp[9] = (f32) (((arg0 * arg0) + arg1) * 262159.0f); + tmp[0] = (f32)(arg1 * 262159.0f); + tmp[8] = (f32)(arg0 * 262159.0f); + tmp[1] = (f32)((arg1 * arg0) * 262159.0f); + tmp[9] = (f32)(((arg0 * arg0) + arg1) * 262159.0f); for (i = 2; i < 8; i++) { //! @bug they probably meant to store the value to tmp[i] and tmp[8 + i] @@ -894,7 +895,7 @@ extern s16 unk_sh_data_3[15 * 8]; extern s16 unk_sh_data_4[15 * 8]; void func_sh_802F0DE8(s16 filter[8], s32 arg1) { s32 i; - s16 *ptr = &unk_sh_data_3[8 * (arg1 - 1)]; + s16* ptr = &unk_sh_data_3[8 * (arg1 - 1)]; for (i = 0; i < 8; i++) { filter[i] = ptr[i]; } @@ -902,7 +903,7 @@ void func_sh_802F0DE8(s16 filter[8], s32 arg1) { void func_sh_802F0E40(s16 filter[8], s32 arg1) { // Unused s32 i; - s16 *ptr = &unk_sh_data_4[8 * (arg1 - 1)]; + s16* ptr = &unk_sh_data_4[8 * (arg1 - 1)]; for (i = 0; i < 8; i++) { filter[i] = ptr[i]; } @@ -910,7 +911,7 @@ void func_sh_802F0E40(s16 filter[8], s32 arg1) { // Unused void fill_filter(s16 filter[8], s32 arg1, s32 arg2) { s32 i; - s16 *ptr; + s16* ptr; if (arg1 != 0) { func_sh_802F0DE8(filter, arg1); } else { @@ -949,13 +950,12 @@ void clear_curr_ai_buffer(void) { s32 currIndex = gCurrAiBufferIndex; s32 i; gAiBufferLengths[currIndex] = gAudioBufferParameters.minAiBufferLength; - for (i = 0; i < (s32) (AIBUFFER_LEN / sizeof(s16)); i++) { + for (i = 0; i < (s32)(AIBUFFER_LEN / sizeof(s16)); i++) { gAiBuffers[currIndex][i] = 0; } } #endif - #if defined(VERSION_EU) || defined(VERSION_SH) s32 audio_shut_down_and_reset_step(void) { s32 i; @@ -999,13 +999,12 @@ s32 audio_shut_down_and_reset_step(void) { if (gAudioResetFadeOutFramesLeft != 0) { gAudioResetFadeOutFramesLeft--; #ifdef VERSION_SH - if (1) { - } + if (1) {} #endif decrease_reverb_gain(); } else { for (i = 0; i < NUMAIBUFFERS; i++) { - for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) { + for (j = 0; j < (s32)(AIBUFFER_LEN / sizeof(s16)); j++) { gAiBuffers[i][j] = 0; } } @@ -1036,15 +1035,14 @@ s32 audio_shut_down_and_reset_step(void) { #ifdef VERSION_SH for (i = 0; i < NUMAIBUFFERS; i++) { gAiBufferLengths[i] = gAudioBufferParameters.maxAiBufferLength; - for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) { + for (j = 0; j < (s32)(AIBUFFER_LEN / sizeof(s16)); j++) { gAiBuffers[i][j] = 0; } } #endif } #ifdef VERSION_SH - if (gAudioResetFadeOutFramesLeft) { - } + if (gAudioResetFadeOutFramesLeft) {} #endif if (gAudioResetStatus < 3) { return 0; @@ -1061,13 +1059,13 @@ void wait_for_audio_frames(s32 frames) { #endif #if defined(VERSION_JP) || defined(VERSION_US) -void audio_reset_session(struct AudioSessionSettings *preset) { +void audio_reset_session(struct AudioSessionSettings* preset) { #else void audio_reset_session(void) { - struct AudioSessionSettingsEU *preset = &gAudioSessionPresets[gAudioResetPresetIdToLoad]; - struct ReverbSettingsEU *reverbSettings; + struct AudioSessionSettingsEU* preset = &gAudioSessionPresets[gAudioResetPresetIdToLoad]; + struct ReverbSettingsEU* reverbSettings; #endif - s16 *mem; + s16* mem; #if defined(VERSION_JP) || defined(VERSION_US) s8 updatesPerFrame; s32 reverbWindowSize; @@ -1083,7 +1081,7 @@ void audio_reset_session(void) { s32 frames; s32 remainingDmas; #else - struct SynthesisReverb *reverb; + struct SynthesisReverb* reverb; #endif eu_stubbed_printf_1("Heap Reconstruct Start %x\n", gAudioResetPresetIdToLoad); @@ -1137,7 +1135,7 @@ void audio_reset_session(void) { gCurrAudioFrameDmaCount = 0; for (j = 0; j < NUMAIBUFFERS; j++) { - for (k = 0; k < (s32) (AIBUFFER_LEN / sizeof(s16)); k++) { + for (k = 0; k < (s32)(AIBUFFER_LEN / sizeof(s16)); k++) { gAiBuffers[j][k] = 0; } } @@ -1153,10 +1151,12 @@ void audio_reset_session(void) { gAudioBufferParameters.maxAiBufferLength = gAudioBufferParameters.samplesPerFrameTarget + 0x10; #ifdef VERSION_SH gAudioBufferParameters.updatesPerFrame = (gAudioBufferParameters.samplesPerFrameTarget + 0x10) / 192 + 1; - gAudioBufferParameters.samplesPerUpdate = (gAudioBufferParameters.samplesPerFrameTarget / gAudioBufferParameters.updatesPerFrame) & -8; + gAudioBufferParameters.samplesPerUpdate = + (gAudioBufferParameters.samplesPerFrameTarget / gAudioBufferParameters.updatesPerFrame) & -8; #else gAudioBufferParameters.updatesPerFrame = (gAudioBufferParameters.samplesPerFrameTarget + 0x10) / 160 + 1; - gAudioBufferParameters.samplesPerUpdate = (gAudioBufferParameters.samplesPerFrameTarget / gAudioBufferParameters.updatesPerFrame) & 0xfff8; + gAudioBufferParameters.samplesPerUpdate = + (gAudioBufferParameters.samplesPerFrameTarget / gAudioBufferParameters.updatesPerFrame) & 0xfff8; #endif gAudioBufferParameters.samplesPerUpdateMax = gAudioBufferParameters.samplesPerUpdate + 8; gAudioBufferParameters.samplesPerUpdateMin = gAudioBufferParameters.samplesPerUpdate - 8; @@ -1170,7 +1170,8 @@ void audio_reset_session(void) { gMaxSimultaneousNotes = preset->maxSimultaneousNotes; gVolume = preset->volume; - gTempoInternalToExternal = (u32) (gAudioBufferParameters.updatesPerFrame * 2880000.0f / gTatumsPerBeat / D_EU_802298D0); + gTempoInternalToExternal = + (u32)(gAudioBufferParameters.updatesPerFrame * 2880000.0f / gTatumsPerBeat / D_EU_802298D0); gAudioBufferParameters.presetUnk4 = preset->unk1; gAudioBufferParameters.samplesPerFrameTarget *= gAudioBufferParameters.presetUnk4; @@ -1182,9 +1183,11 @@ void audio_reset_session(void) { if (gAudioBufferParameters.presetUnk4 >= 2) { gAudioBufferParameters.maxAiBufferLength -= 0x10; } - gMaxAudioCmds = gMaxSimultaneousNotes * 0x14 * gAudioBufferParameters.updatesPerFrame + preset->numReverbs * 0x20 + 0x1E0; + gMaxAudioCmds = + gMaxSimultaneousNotes * 0x14 * gAudioBufferParameters.updatesPerFrame + preset->numReverbs * 0x20 + 0x1E0; #else - gMaxAudioCmds = gMaxSimultaneousNotes * 0x10 * gAudioBufferParameters.updatesPerFrame + preset->numReverbs * 0x20 + 0x300; + gMaxAudioCmds = + gMaxSimultaneousNotes * 0x10 * gAudioBufferParameters.updatesPerFrame + preset->numReverbs * 0x20 + 0x300; #endif #else reverbWindowSize = preset->reverbWindowSize; @@ -1230,14 +1233,16 @@ void audio_reset_session(void) { #endif #if defined(VERSION_SH) - persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem + preset->persistentBankMem + preset->unk18 + preset->unkMem28 + 0x10); - temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem + preset->temporaryBankMem + preset->unk24 + preset->unkMem2C + 0x10); + persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem + preset->persistentBankMem + preset->unk18 + + preset->unkMem28 + 0x10); + temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem + preset->temporaryBankMem + preset->unk24 + + preset->unkMem2C + 0x10); #elif defined(VERSION_EU) persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentSeqMem + preset->persistentBankMem); temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporarySeqMem + preset->temporaryBankMem); #else - persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentBankMem + preset->persistentSeqMem); - temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporaryBankMem + preset->temporarySeqMem); +persistentMem = DOUBLE_SIZE_ON_64_BIT(preset->persistentBankMem + preset->persistentSeqMem); +temporaryMem = DOUBLE_SIZE_ON_64_BIT(preset->temporaryBankMem + preset->temporarySeqMem); #endif totalMem = persistentMem + temporaryMem; wantMisc = gAudioSessionPool.size - totalMem - 0x100; @@ -1279,7 +1284,8 @@ void audio_reset_session(void) { init_note_free_list(); #if defined(VERSION_EU) || defined(VERSION_SH) - gNoteSubsEu = soundAlloc(&gNotesAndBuffersPool, (gAudioBufferParameters.updatesPerFrame * gMaxSimultaneousNotes) * sizeof(struct NoteSubEu)); + gNoteSubsEu = soundAlloc(&gNotesAndBuffersPool, (gAudioBufferParameters.updatesPerFrame * gMaxSimultaneousNotes) * + sizeof(struct NoteSubEu)); for (j = 0; j != 2; j++) { gAudioCmdBuffers[j] = soundAlloc(&gNotesAndBuffersPool, gMaxAudioCmds * sizeof(u64)); @@ -1407,7 +1413,7 @@ void audio_reset_session(void) { } #ifdef VERSION_SH -void *unk_pool1_lookup(s32 poolIdx, s32 id) { +void* unk_pool1_lookup(s32 poolIdx, s32 id) { s32 i; for (i = 0; i < gUnkPool1.pool.numAllocatedEntries; i++) { @@ -1418,8 +1424,8 @@ void *unk_pool1_lookup(s32 poolIdx, s32 id) { return NULL; } -void *unk_pool1_alloc(s32 poolIndex, s32 arg1, u32 size) { - void *ret; +void* unk_pool1_alloc(s32 poolIndex, s32 arg1, u32 size) { + void* ret; s32 pos; pos = gUnkPool1.pool.numAllocatedEntries; @@ -1435,8 +1441,8 @@ void *unk_pool1_alloc(s32 poolIndex, s32 arg1, u32 size) { return ret; } -u8 *func_sh_802f1d40(u32 size, s32 bank, u8 *arg2, s8 medium) { - struct UnkEntry *ret; +u8* func_sh_802f1d40(u32 size, s32 bank, u8* arg2, s8 medium) { + struct UnkEntry* ret; ret = func_sh_802f1ec4(size); if (ret != NULL) { @@ -1447,8 +1453,8 @@ u8 *func_sh_802f1d40(u32 size, s32 bank, u8 *arg2, s8 medium) { } return NULL; } -u8 *func_sh_802f1d90(u32 size, s32 bank, u8 *arg2, s8 medium) { - struct UnkEntry *ret; +u8* func_sh_802f1d90(u32 size, s32 bank, u8* arg2, s8 medium) { + struct UnkEntry* ret; ret = unk_pool2_alloc(size); if (ret != NULL) { @@ -1459,8 +1465,8 @@ u8 *func_sh_802f1d90(u32 size, s32 bank, u8 *arg2, s8 medium) { } return NULL; } -u8 *func_sh_802f1de0(u32 size, s32 bank, u8 *arg2, s8 medium) { // duplicated function? - struct UnkEntry *ret; +u8* func_sh_802f1de0(u32 size, s32 bank, u8* arg2, s8 medium) { // duplicated function? + struct UnkEntry* ret; ret = unk_pool2_alloc(size); if (ret != NULL) { @@ -1472,7 +1478,7 @@ u8 *func_sh_802f1de0(u32 size, s32 bank, u8 *arg2, s8 medium) { // duplicated fu return NULL; } void unk_pools_init(u32 size1, u32 size2) { - void *mem; + void* mem; mem = sound_alloc_uninitialized(&gPersistentCommonPool, size1); if (mem == NULL) { @@ -1492,20 +1498,20 @@ void unk_pools_init(u32 size1, u32 size2) { gUnkPool3.numEntries = 0; } -struct UnkEntry *func_sh_802f1ec4(u32 size) { - u8 *temp_s2; - u8 *phi_s3; - u8 *memLocation; - u8 *cur; +struct UnkEntry* func_sh_802f1ec4(u32 size) { + u8* temp_s2; + u8* phi_s3; + u8* memLocation; + u8* cur; s32 i; s32 chosenIndex; - struct UnkStructSH8034EC88 *unkStruct; - struct UnkPool *pool = &gUnkPool3; + struct UnkStructSH8034EC88* unkStruct; + struct UnkPool* pool = &gUnkPool3; - u8 *itemStart; - u8 *itemEnd; + u8* itemStart; + u8* itemEnd; phi_s3 = pool->pool.cur; memLocation = sound_alloc_uninitialized(&pool->pool, size); @@ -1529,11 +1535,9 @@ struct UnkEntry *func_sh_802f1ec4(u32 size) { itemEnd = unkStruct->ramAddr + unkStruct->sample->size - 1; if (itemEnd < phi_s3 && itemStart < phi_s3) { continue; - } if (itemEnd >= temp_s2 && itemStart >= temp_s2) { continue; - } unkStruct->isFree = TRUE; @@ -1571,21 +1575,22 @@ struct UnkEntry *func_sh_802f1ec4(u32 size) { return &pool->entries[chosenIndex]; } -void func_sh_802f2158(struct UnkEntry *entry) { +void func_sh_802f2158(struct UnkEntry* entry) { s32 idx; s32 seqCount; s32 bankId1; s32 bankId2; s32 instId; s32 drumId; - struct Drum *drum; - struct Instrument *inst; + struct Drum* drum; + struct Instrument* inst; seqCount = gAlCtlHeader->seqCount; for (idx = 0; idx < seqCount; idx++) { bankId1 = gCtlEntries[idx].bankId1; bankId2 = gCtlEntries[idx].bankId2; - if ((bankId1 != 0xff && entry->bankId == bankId1) || (bankId2 != 0xff && entry->bankId == bankId2) || entry->bankId == 0) { + if ((bankId1 != 0xff && entry->bankId == bankId1) || (bankId2 != 0xff && entry->bankId == bankId2) || + entry->bankId == 0) { if (get_bank_or_seq(1, 2, idx) != NULL) { if (IS_BANK_LOAD_COMPLETE(idx) != FALSE) { for (instId = 0; instId < gCtlEntries[idx].numInstruments; instId++) { @@ -1612,17 +1617,17 @@ void func_sh_802f2158(struct UnkEntry *entry) { } } -void func_sh_802F2320(struct UnkEntry *entry, struct AudioBankSample *sample) { +void func_sh_802F2320(struct UnkEntry* entry, struct AudioBankSample* sample) { if (sample != NULL && sample->sampleAddr == entry->srcAddr) { sample->sampleAddr = entry->dstAddr; sample->medium = entry->medium; } } -struct UnkEntry *unk_pool2_alloc(u32 size) { - void *data; - struct UnkEntry *ret; - s32 *numEntries = &gUnkPool2.numEntries; +struct UnkEntry* unk_pool2_alloc(u32 size) { + void* data; + struct UnkEntry* ret; + s32* numEntries = &gUnkPool2.numEntries; data = sound_alloc_uninitialized(&gUnkPool2.pool, size); if (data == NULL) { @@ -1644,16 +1649,17 @@ void func_sh_802f23ec(void) { s32 bankId2; s32 instId; s32 drumId; - struct Drum *drum; - struct Instrument *inst; + struct Drum* drum; + struct Instrument* inst; UNUSED s32 pad; - struct UnkEntry *entry; //! @bug: not initialized but nevertheless used + struct UnkEntry* entry; //! @bug: not initialized but nevertheless used seqCount = gAlCtlHeader->seqCount; for (idx = 0; idx < seqCount; idx++) { bankId1 = gCtlEntries[idx].bankId1; bankId2 = gCtlEntries[idx].bankId2; - if ((bankId1 != 0xffu && entry->bankId == bankId1) || (bankId2 != 0xff && entry->bankId == bankId2) || entry->bankId == 0) { + if ((bankId1 != 0xffu && entry->bankId == bankId1) || (bankId2 != 0xff && entry->bankId == bankId2) || + entry->bankId == 0) { if (get_bank_or_seq(1, 3, idx) != NULL) { if (IS_BANK_LOAD_COMPLETE(idx) != FALSE) { for (i = 0; i < gUnkPool2.numEntries; i++) { diff --git a/src/audio/load.c b/src/audio/load.c index d3746372..eff963c9 100644 --- a/src/audio/load.c +++ b/src/audio/load.c @@ -14,19 +14,19 @@ #define ALIGN16(val) (((val) + 0xF) & ~0xF) struct SharedDma { - /*0x0*/ u8 *buffer; // target, points to pre-allocated buffer + /*0x0*/ u8* buffer; // target, points to pre-allocated buffer /*0x4*/ uintptr_t source; // device address /*0x8*/ u16 sizeUnused; // set to bufSize, never read /*0xA*/ u16 bufSize; // size of buffer /*0xC*/ u8 unused2; // set to 0, never read /*0xD*/ u8 reuseIndex; // position in sSampleDmaReuseQueue1/2, if ttl == 0 /*0xE*/ u8 ttl; // duration after which the DMA can be discarded -}; // size = 0x10 +}; // size = 0x10 // EU only void port_eu_init(void); -struct Note *gNotes; +struct Note* gNotes; struct SequencePlayer gSequencePlayers[SEQUENCE_PLAYERS]; struct SequenceChannel gSequenceChannels[SEQUENCE_CHANNELS]; @@ -46,8 +46,8 @@ OSIoMesg gAudioDmaIoMesg; struct SharedDma sSampleDmas[0x60]; u32 gSampleDmaNumListItems; // sh: 0x803503D4 -u32 sSampleDmaListSize1; // sh: 0x803503D8 -u32 sUnused80226B40; // set to 0, never read, sh: 0x803503DC +u32 sSampleDmaListSize1; // sh: 0x803503D8 +u32 sUnused80226B40; // set to 0, never read, sh: 0x803503DC // Circular buffer of DMAs with ttl = 0. tail <= head, wrapping around mod 256. u8 sSampleDmaReuseQueue1[256]; @@ -90,17 +90,16 @@ s8 gAudioUpdatesPerFrame; extern u64 gAudioGlobalsStartMarker; extern u64 gAudioGlobalsEndMarker; -ALSeqFile *get_audio_file_header(s32 arg0); +ALSeqFile* get_audio_file_header(s32 arg0); #include /** * Performs an immediate DMA copy */ -void audio_dma_copy_immediate(uintptr_t devAddr, void *vAddr, size_t nbytes) { +void audio_dma_copy_immediate(uintptr_t devAddr, void* vAddr, size_t nbytes) { eu_stubbed_printf_3("Romcopy %x -> %x ,size %x\n", devAddr, vAddr, nbytes); osInvalDCache(vAddr, nbytes); - osPiStartDma(&gAudioDmaIoMesg, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes, - &gAudioDmaMesgQueue); + osPiStartDma(&gAudioDmaIoMesg, OS_MESG_PRI_HIGH, OS_READ, devAddr, vAddr, nbytes, &gAudioDmaMesgQueue); osRecvMesg(&gAudioDmaMesgQueue, NULL, OS_MESG_NOBLOCK); eu_stubbed_printf_0("Romcopyend\n"); } @@ -127,7 +126,7 @@ u8 audioString49[] = "BANK LOAD MISS! FOR %d\n"; /** * Performs an asynchronus (normal priority) DMA copy */ -void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQueue *queue, OSIoMesg *mesg) { +void audio_dma_copy_async(uintptr_t devAddr, void* vAddr, size_t nbytes, OSMesgQueue* queue, OSIoMesg* mesg) { osInvalDCache(vAddr, nbytes); osPiStartDma(mesg, OS_MESG_PRI_NORMAL, OS_READ, devAddr, vAddr, nbytes, queue); } @@ -136,7 +135,8 @@ void audio_dma_copy_async(uintptr_t devAddr, void *vAddr, size_t nbytes, OSMesgQ * Performs a partial asynchronous (normal priority) DMA copy. This is limited * to 0x1000 bytes transfer at once. */ -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) { #if defined(VERSION_EU) ssize_t transfer = (*remaining >= 0x1000 ? 0x1000 : *remaining); #else @@ -154,30 +154,30 @@ void decrease_sample_dma_ttls() { for (i = 0; i < sSampleDmaListSize1; i++) { #if defined(VERSION_EU) - struct SharedDma *temp = &sSampleDmas[i]; + struct SharedDma* temp = &sSampleDmas[i]; #else - struct SharedDma *temp = sSampleDmas + i; + struct SharedDma* temp = sSampleDmas + i; #endif if (temp->ttl != 0) { temp->ttl--; if (temp->ttl == 0) { temp->reuseIndex = sSampleDmaReuseQueueHead1; - sSampleDmaReuseQueue1[sSampleDmaReuseQueueHead1++] = (u8) i; + sSampleDmaReuseQueue1[sSampleDmaReuseQueueHead1++] = (u8)i; } } } for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) { #if defined(VERSION_EU) - struct SharedDma *temp = &sSampleDmas[i]; + struct SharedDma* temp = &sSampleDmas[i]; #else - struct SharedDma *temp = sSampleDmas + i; + struct SharedDma* temp = sSampleDmas + i; #endif if (temp->ttl != 0) { temp->ttl--; if (temp->ttl == 0) { temp->reuseIndex = sSampleDmaReuseQueueHead2; - sSampleDmaReuseQueue2[sSampleDmaReuseQueueHead2++] = (u8) i; + sSampleDmaReuseQueue2[sSampleDmaReuseQueueHead2++] = (u8)i; } } } @@ -185,9 +185,9 @@ void decrease_sample_dma_ttls() { sUnused80226B40 = 0; } -void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { +void* dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8* dmaIndexRef) { s32 hasDma = FALSE; - struct SharedDma *dma; + struct SharedDma* dma; uintptr_t dmaDevAddr; u32 transfer; u32 i; @@ -199,21 +199,19 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) { dma = &sSampleDmas[i]; bufferPos = devAddr - dma->source; - if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) { + if (0 <= bufferPos && (size_t)bufferPos <= dma->bufSize - size) { // We already have a DMA request for this memory range. if (dma->ttl == 0 && sSampleDmaReuseQueueTail2 != sSampleDmaReuseQueueHead2) { // Move the DMA out of the reuse queue, by swapping it with the // tail, and then incrementing the tail. if (dma->reuseIndex != sSampleDmaReuseQueueTail2) { - sSampleDmaReuseQueue2[dma->reuseIndex] = - sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]; - sSampleDmas[sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]].reuseIndex = - dma->reuseIndex; + sSampleDmaReuseQueue2[dma->reuseIndex] = sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]; + sSampleDmas[sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]].reuseIndex = dma->reuseIndex; } sSampleDmaReuseQueueTail2++; } dma->ttl = 60; - *dmaIndexRef = (u8) i; + *dmaIndexRef = (u8)i; return &dma->buffer[(devAddr - dma->source)]; } } @@ -234,20 +232,17 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { dma = sSampleDmas + *dmaIndexRef; #endif bufferPos = devAddr - dma->source; - if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) { + if (0 <= bufferPos && (size_t)bufferPos <= dma->bufSize - size) { // We already have DMA for this memory range. if (dma->ttl == 0) { // Move the DMA out of the reuse queue, by swapping it with the // tail, and then incrementing the tail. if (dma->reuseIndex != sSampleDmaReuseQueueTail1) { #if defined(VERSION_EU) - if (1) { - } + if (1) {} #endif - sSampleDmaReuseQueue1[dma->reuseIndex] = - sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]; - sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex = - dma->reuseIndex; + sSampleDmaReuseQueue1[dma->reuseIndex] = sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]; + sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex = dma->reuseIndex; } sSampleDmaReuseQueueTail1++; } @@ -277,20 +272,19 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef) { osInvalDCache(dma->buffer, transfer); #endif #if defined(VERSION_EU) - osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, - OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue); + osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, OS_READ, dmaDevAddr, + dma->buffer, transfer, &gCurrAudioFrameDmaQueue); *dmaIndexRef = dmaIndex; return (devAddr - dmaDevAddr) + dma->buffer; #else gCurrAudioFrameDmaCount++; - osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL, - OS_READ, dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue); + osPiStartDma(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount - 1], OS_MESG_PRI_NORMAL, OS_READ, dmaDevAddr, + dma->buffer, transfer, &gCurrAudioFrameDmaQueue); *dmaIndexRef = dmaIndex; return (devAddr - dmaDevAddr) + dma->buffer; #endif } - void init_sample_dma_buffers(UNUSED s32 arg0) { s32 i; #if defined(VERSION_EU) @@ -330,9 +324,9 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { out1: #endif - for (i = 0; (u32) i < gSampleDmaNumListItems; i++) { - sSampleDmaReuseQueue1[i] = (u8) i; - sSampleDmas[i].reuseIndex = (u8) i; + for (i = 0; (u32)i < gSampleDmaNumListItems; i++) { + sSampleDmaReuseQueue1[i] = (u8)i; + sSampleDmas[i].reuseIndex = (u8)i; } for (j = gSampleDmaNumListItems; j < 0x100; j++) { @@ -340,7 +334,7 @@ out1: } sSampleDmaReuseQueueTail1 = 0; - sSampleDmaReuseQueueHead1 = (u8) gSampleDmaNumListItems; + sSampleDmaReuseQueueHead1 = (u8)gSampleDmaNumListItems; sSampleDmaListSize1 = gSampleDmaNumListItems; #if defined(VERSION_EU) @@ -368,8 +362,8 @@ out1: out2: #endif - for (i = sSampleDmaListSize1; (u32) i < gSampleDmaNumListItems; i++) { - sSampleDmaReuseQueue2[i - sSampleDmaListSize1] = (u8) i; + for (i = sSampleDmaListSize1; (u32)i < gSampleDmaNumListItems; i++) { + sSampleDmaReuseQueue2[i - sSampleDmaListSize1] = (u8)i; sSampleDmas[i].reuseIndex = (u8)(i - sSampleDmaListSize1); } @@ -390,11 +384,11 @@ uint8_t* load_sequence_immediate(s32 seqId, s32 arg1) { return GameEngine_LoadSequence(seqId)->data; } -struct CtlEntry* load_banks_immediate(s32 seqId, u8 *outDefaultBank) { +struct CtlEntry* load_banks_immediate(s32 seqId, u8* outDefaultBank) { u32 bankId; - struct AudioSequenceData *seqData = GameEngine_LoadSequence(seqId); - struct CtlEntry *output; - for(size_t i = 0; i < seqData->bankCount; i++) { + struct AudioSequenceData* seqData = GameEngine_LoadSequence(seqId); + struct CtlEntry* output; + for (size_t i = 0; i < seqData->bankCount; i++) { output = GameEngine_LoadBank(bankId = seqData->banks[i]); } *outDefaultBank = bankId; @@ -438,7 +432,7 @@ void load_sequence(u32 player, u32 seqId, s32 loadAsync) { } void load_sequence_internal(u32 player, u32 seqId, s32 loadAsync) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; if (seqId >= gSequenceCount) { return; @@ -473,7 +467,7 @@ void audio_init() { s32 i, j; UNUSED s32 lim1; // lim1 unused in EU UNUSED u32 size; - UNUSED u64 *ptr64; + UNUSED u64* ptr64; UNUSED s32 pad2; gAudioLoadLock = AUDIO_LOCK_UNINITIALIZED; @@ -488,15 +482,13 @@ void audio_init() { memset(gAudioHeap, 0, gAudioHeapSize); #else for (i = 0; i < gAudioHeapSize / 8; i++) { - ((u64 *) gAudioHeap)[i] = 0; + ((u64*)gAudioHeap)[i] = 0; } - D_EU_802298D0 = 20.03042f; gRefreshRate = 50; port_eu_init(); - if (k) { - } + if (k) {} #endif eu_stubbed_printf_1("AudioHeap is %x\n", gAudioHeapSize); @@ -513,8 +505,7 @@ void audio_init() { gAudioTasks[0].task.t.data_size = 0; gAudioTasks[1].task.t.data_size = 0; osCreateMesgQueue(&gAudioDmaMesgQueue, &gAudioDmaMesg, 1); - osCreateMesgQueue(&gCurrAudioFrameDmaQueue, gCurrAudioFrameDmaMesgBufs, - ARRAY_COUNT(gCurrAudioFrameDmaMesgBufs)); + osCreateMesgQueue(&gCurrAudioFrameDmaQueue, gCurrAudioFrameDmaMesgBufs, ARRAY_COUNT(gCurrAudioFrameDmaMesgBufs)); gCurrAudioFrameDmaCount = 0; gSampleDmaNumListItems = 0; @@ -523,7 +514,7 @@ void audio_init() { for (i = 0; i < NUMAIBUFFERS; i++) { gAiBuffers[i] = soundAlloc(&gAudioInitPool, AIBUFFER_LEN); - for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) { + for (j = 0; j < (s32)(AIBUFFER_LEN / sizeof(s16)); j++) { gAiBuffers[i][j] = 0; } } diff --git a/src/audio/load_sh.c b/src/audio/load_sh.c index d4db8928..6d585f97 100644 --- a/src/audio/load_sh.c +++ b/src/audio/load_sh.c @@ -11,20 +11,20 @@ #define ALIGN16(val) (((val) + 0xF) & ~0xF) struct SharedDma { - /*0x0*/ u8 *buffer; // target, points to pre-allocated buffer + /*0x0*/ u8* buffer; // target, points to pre-allocated buffer /*0x4*/ uintptr_t source; // device address /*0x8*/ u16 sizeUnused; // set to bufSize, never read /*0xA*/ u16 bufSize; // size of buffer /*0xC*/ u8 unused2; // set to 0, never read /*0xD*/ u8 reuseIndex; // position in sSampleDmaReuseQueue1/2, if ttl == 0 /*0xE*/ u8 ttl; // duration after which the DMA can be discarded -}; // size = 0x10 +}; // size = 0x10 void port_eu_init(void); -void patch_sound(struct AudioBankSound *sound, struct AudioBank *memBase, struct PatchStruct *patchInfo); -void *func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue *retQueue); +void patch_sound(struct AudioBankSound* sound, struct AudioBank* memBase, struct PatchStruct* patchInfo); +void* func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue* retQueue); -struct Note *gNotes; +struct Note* gNotes; UNUSED static u32 pad; @@ -36,7 +36,7 @@ struct SequenceChannel gSequenceChannelNone; struct AudioListItem gLayerFreeList; struct NotePool gNoteFreeLists; -struct AudioBankSample *D_SH_8034EA88[0x80]; +struct AudioBankSample* D_SH_8034EA88[0x80]; struct UnkStructSH8034EC88 D_SH_8034EC88[0x80]; s32 D_SH_8034F688; // index into D_SH_8034EA88 s32 D_SH_8034F68C; // index or size for D_SH_8034EC88 @@ -45,13 +45,13 @@ struct PendingDmaAudioBank { s8 inProgress; s8 timer; s8 medium; - struct AudioBank *audioBank; + struct AudioBank* audioBank; uintptr_t devAddr; - void *vAddr; + void* vAddr; u32 remaining; u32 transferSize; u32 encodedInfo; - OSMesgQueue *retQueue; + OSMesgQueue* retQueue; OSMesgQueue dmaRetQueue; OSMesg mesgs[1]; OSIoMesg ioMesg; @@ -71,7 +71,7 @@ OSMesgQueue gAudioDmaMesgQueue; OSMesg gAudioDmaMesg; OSIoMesg gAudioDmaIoMesg; -struct SharedDma *sSampleDmas; +struct SharedDma* sSampleDmas; u32 gSampleDmaNumListItems; u32 sSampleDmaListSize1; u32 sUnused80226B40; // set to 0, never read @@ -84,13 +84,13 @@ u8 sSampleDmaReuseQueueTail2; u8 sSampleDmaReuseQueueHead1; u8 sSampleDmaReuseQueueHead2; -ALSeqFile *gSeqFileHeader; -ALSeqFile *gAlCtlHeader; -ALSeqFile *gAlTbl; -u8 *gAlBankSets; +ALSeqFile* gSeqFileHeader; +ALSeqFile* gAlCtlHeader; +ALSeqFile* gAlTbl; +u8* gAlBankSets; u16 gSequenceCount; -struct CtlEntry *gCtlEntries; +struct CtlEntry* gCtlEntries; struct AudioBufferParametersEU gAudioBufferParameters; u32 sDmaBufSize; @@ -110,28 +110,28 @@ extern u8 gSoundDataADSR[]; // ctl extern u8 gSoundDataRaw[]; // tbl extern u8 gMusicData[]; // sequences -ALSeqFile *get_audio_file_header(s32 arg0); +ALSeqFile* get_audio_file_header(s32 arg0); -void *func_sh_802f3688(s32 bankId); -void *get_bank_or_seq_wrapper(s32 arg0, s32 arg1); -void func_sh_802f3d78(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3); -void func_sh_802f3c38(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 medium); -s32 func_sh_802f3dd0(OSIoMesg *m, s32 pri, s32 direction, uintptr_t devAddr, - void *dramAddr, s32 size, OSMesgQueue *retQueue, s32 medium, UNUSED const char *reason); +void* func_sh_802f3688(s32 bankId); +void* get_bank_or_seq_wrapper(s32 arg0, s32 arg1); +void func_sh_802f3d78(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 arg3); +void func_sh_802f3c38(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 medium); +s32 func_sh_802f3dd0(OSIoMesg* m, s32 pri, s32 direction, uintptr_t devAddr, void* dramAddr, s32 size, + OSMesgQueue* retQueue, s32 medium, UNUSED const char* reason); void func_sh_802f4a4c(s32 audioResetStatus); -void func_sh_802f4bd8(struct PendingDmaSample *arg0, s32 len); -void func_sh_802f4c5c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3); -struct PendingDmaAudioBank *func_sh_802f4cb4(uintptr_t devAddr, void *vAddr, s32 size, - s32 medium, s32 numChunks, OSMesgQueue *retQueue, s32 encodedInfo); +void func_sh_802f4bd8(struct PendingDmaSample* arg0, s32 len); +void func_sh_802f4c5c(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 arg3); +struct PendingDmaAudioBank* func_sh_802f4cb4(uintptr_t devAddr, void* vAddr, s32 size, s32 medium, s32 numChunks, + OSMesgQueue* retQueue, s32 encodedInfo); void func_sh_802f4dcc(s32 audioResetStatus); -void func_sh_802f4e50(struct PendingDmaAudioBank *audioBank, s32 audioResetStatus); -void func_sh_802f50ec(struct PendingDmaAudioBank *arg0, size_t len); -void func_sh_802f517c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3); -BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct PatchStruct *patchInfo, s32 arg3); +void func_sh_802f4e50(struct PendingDmaAudioBank* audioBank, s32 audioResetStatus); +void func_sh_802f50ec(struct PendingDmaAudioBank* arg0, size_t len); +void func_sh_802f517c(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 arg3); +BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank* mem, struct PatchStruct* patchInfo, s32 arg3); s32 func_sh_802f573c(s32 audioResetStatus); -void *func_sh_802f3564(s32 seqId); -s32 func_sh_802f3ec4(s32 arg0, uintptr_t *arg1); -void func_sh_802f3ed4(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED void *vAddr, UNUSED size_t nbytes); +void* func_sh_802f3564(s32 seqId); +s32 func_sh_802f3ec4(s32 arg0, uintptr_t* arg1); +void func_sh_802f3ed4(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED void* vAddr, UNUSED size_t nbytes); s32 canonicalize_index(s32 poolIdx, s32 idx); @@ -139,23 +139,23 @@ void decrease_sample_dma_ttls() { u32 i; for (i = 0; i < sSampleDmaListSize1; i++) { - struct SharedDma *temp = &sSampleDmas[i]; + struct SharedDma* temp = &sSampleDmas[i]; if (temp->ttl != 0) { temp->ttl--; if (temp->ttl == 0) { temp->reuseIndex = sSampleDmaReuseQueueHead1; - sSampleDmaReuseQueue1[sSampleDmaReuseQueueHead1++] = (u8) i; + sSampleDmaReuseQueue1[sSampleDmaReuseQueueHead1++] = (u8)i; } } } for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) { - struct SharedDma *temp = &sSampleDmas[i]; + struct SharedDma* temp = &sSampleDmas[i]; if (temp->ttl != 0) { temp->ttl--; if (temp->ttl == 0) { temp->reuseIndex = sSampleDmaReuseQueueHead2; - sSampleDmaReuseQueue2[sSampleDmaReuseQueueHead2++] = (u8) i; + sSampleDmaReuseQueue2[sSampleDmaReuseQueueHead2++] = (u8)i; } } } @@ -164,9 +164,9 @@ void decrease_sample_dma_ttls() { } extern char shindouDebugPrint62[]; // "SUPERDMA" -void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s32 medium) { +void* dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8* dmaIndexRef, s32 medium) { UNUSED s32 sp60; - struct SharedDma *dma; + struct SharedDma* dma; s32 hasDma = FALSE; uintptr_t dmaDevAddr; UNUSED u32 pad; @@ -179,21 +179,19 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s3 for (i = sSampleDmaListSize1; i < gSampleDmaNumListItems; i++) { dma = &sSampleDmas[i]; bufferPos = devAddr - dma->source; - if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) { + if (0 <= bufferPos && (size_t)bufferPos <= dma->bufSize - size) { // We already have a DMA request for this memory range. if (dma->ttl == 0 && sSampleDmaReuseQueueTail2 != sSampleDmaReuseQueueHead2) { // Move the DMA out of the reuse queue, by swapping it with the // tail, and then incrementing the tail. if (dma->reuseIndex != sSampleDmaReuseQueueTail2) { - sSampleDmaReuseQueue2[dma->reuseIndex] = - sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]; - sSampleDmas[sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]].reuseIndex = - dma->reuseIndex; + sSampleDmaReuseQueue2[dma->reuseIndex] = sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]; + sSampleDmas[sSampleDmaReuseQueue2[sSampleDmaReuseQueueTail2]].reuseIndex = dma->reuseIndex; } sSampleDmaReuseQueueTail2++; } dma->ttl = 60; - *dmaIndexRef = (u8) i; + *dmaIndexRef = (u8)i; return &dma->buffer[(devAddr - dma->source)]; } } @@ -209,16 +207,14 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s3 } else { dma = sSampleDmas + *dmaIndexRef; bufferPos = devAddr - dma->source; - if (0 <= bufferPos && (size_t) bufferPos <= dma->bufSize - size) { + if (0 <= bufferPos && (size_t)bufferPos <= dma->bufSize - size) { // We already have DMA for this memory range. if (dma->ttl == 0) { // Move the DMA out of the reuse queue, by swapping it with the // tail, and then incrementing the tail. if (dma->reuseIndex != sSampleDmaReuseQueueTail1) { - sSampleDmaReuseQueue1[dma->reuseIndex] = - sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]; - sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex = - dma->reuseIndex; + sSampleDmaReuseQueue1[dma->reuseIndex] = sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]; + sSampleDmas[sSampleDmaReuseQueue1[sSampleDmaReuseQueueTail1]].reuseIndex = dma->reuseIndex; } sSampleDmaReuseQueueTail1++; } @@ -241,8 +237,8 @@ void *dma_sample_data(uintptr_t devAddr, u32 size, s32 arg2, u8 *dmaIndexRef, s3 dma->ttl = 2; dma->source = dmaDevAddr; dma->sizeUnused = transfer; - func_sh_802f3dd0(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, OS_READ, - dmaDevAddr, dma->buffer, transfer, &gCurrAudioFrameDmaQueue, medium, shindouDebugPrint62); + func_sh_802f3dd0(&gCurrAudioFrameDmaIoMesgBufs[gCurrAudioFrameDmaCount++], OS_MESG_PRI_NORMAL, OS_READ, dmaDevAddr, + dma->buffer, transfer, &gCurrAudioFrameDmaQueue, medium, shindouDebugPrint62); *dmaIndexRef = dmaIndex; return (devAddr - dmaDevAddr) + dma->buffer; } @@ -251,11 +247,13 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { s32 i; sDmaBufSize = 0x2D0; - sSampleDmas = sound_alloc_uninitialized(&gNotesAndBuffersPool, - gMaxSimultaneousNotes * 4 * sizeof(struct SharedDma) * gAudioBufferParameters.presetUnk4); + sSampleDmas = + sound_alloc_uninitialized(&gNotesAndBuffersPool, gMaxSimultaneousNotes * 4 * sizeof(struct SharedDma) * + gAudioBufferParameters.presetUnk4); for (i = 0; i < gMaxSimultaneousNotes * 3 * gAudioBufferParameters.presetUnk4; i++) { - if ((sSampleDmas[gSampleDmaNumListItems].buffer = sound_alloc_uninitialized(&gNotesAndBuffersPool, sDmaBufSize)) == NULL) { + if ((sSampleDmas[gSampleDmaNumListItems].buffer = + sound_alloc_uninitialized(&gNotesAndBuffersPool, sDmaBufSize)) == NULL) { break; } sSampleDmas[gSampleDmaNumListItems].bufSize = sDmaBufSize; @@ -266,9 +264,9 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { gSampleDmaNumListItems++; } - for (i = 0; (u32) i < gSampleDmaNumListItems; i++) { - sSampleDmaReuseQueue1[i] = (u8) i; - sSampleDmas[i].reuseIndex = (u8) i; + for (i = 0; (u32)i < gSampleDmaNumListItems; i++) { + sSampleDmaReuseQueue1[i] = (u8)i; + sSampleDmas[i].reuseIndex = (u8)i; } for (i = gSampleDmaNumListItems; i < 0x100; i++) { @@ -276,12 +274,13 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { } sSampleDmaReuseQueueTail1 = 0; - sSampleDmaReuseQueueHead1 = (u8) gSampleDmaNumListItems; + sSampleDmaReuseQueueHead1 = (u8)gSampleDmaNumListItems; sSampleDmaListSize1 = gSampleDmaNumListItems; sDmaBufSize = 0x2D0; for (i = 0; i < gMaxSimultaneousNotes; i++) { - if ((sSampleDmas[gSampleDmaNumListItems].buffer = sound_alloc_uninitialized(&gNotesAndBuffersPool, sDmaBufSize)) == NULL) { + if ((sSampleDmas[gSampleDmaNumListItems].buffer = + sound_alloc_uninitialized(&gNotesAndBuffersPool, sDmaBufSize)) == NULL) { break; } sSampleDmas[gSampleDmaNumListItems].bufSize = sDmaBufSize; @@ -292,8 +291,8 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { gSampleDmaNumListItems++; } - for (i = sSampleDmaListSize1; (u32) i < gSampleDmaNumListItems; i++) { - sSampleDmaReuseQueue2[i - sSampleDmaListSize1] = (u8) i; + for (i = sSampleDmaListSize1; (u32)i < gSampleDmaNumListItems; i++) { + sSampleDmaReuseQueue2[i - sSampleDmaListSize1] = (u8)i; sSampleDmas[i].reuseIndex = (u8)(i - sSampleDmaListSize1); } @@ -307,7 +306,7 @@ void init_sample_dma_buffers(UNUSED s32 arg0) { sSampleDmaReuseQueueHead2 = gSampleDmaNumListItems - sSampleDmaListSize1; } -void patch_seq_file(ALSeqFile *seqFile, u8 *data, u16 arg2) { +void patch_seq_file(ALSeqFile* seqFile, u8* data, u16 arg2) { s32 i; seqFile->unk2 = arg2; @@ -319,13 +318,13 @@ void patch_seq_file(ALSeqFile *seqFile, u8 *data, u16 arg2) { } } -struct AudioBank *load_banks_immediate(s32 seqId, s32 *outDefaultBank) { +struct AudioBank* load_banks_immediate(s32 seqId, s32* outDefaultBank) { u8 bank; s32 offset; s32 i; - void *ret; + void* ret; - offset = ((u16 *)gAlBankSets)[canonicalize_index(0, seqId)]; + offset = ((u16*)gAlBankSets)[canonicalize_index(0, seqId)]; bank = 0xFF; for (i = gAlBankSets[offset++]; i > 0; i--) { bank = gAlBankSets[offset++]; @@ -348,8 +347,8 @@ void preload_sequence(u32 seqId, s32 preloadMask) { } } -s32 func_sh_802f2f38(struct AudioBankSample *sample, s32 bankId) { - u8 *sp24; +s32 func_sh_802f2f38(struct AudioBankSample* sample, s32 bankId) { + u8* sp24; if (sample->isPatched == TRUE && sample->medium != 0) { sp24 = func_sh_802f1d90(sample->size, bankId, sample->sampleAddr, sample->medium); @@ -357,9 +356,9 @@ s32 func_sh_802f2f38(struct AudioBankSample *sample, s32 bankId) { return -1; } if (sample->medium == 1) { - func_sh_802f3d78((uintptr_t) sample->sampleAddr, sp24, sample->size, gAlTbl->unk2); + func_sh_802f3d78((uintptr_t)sample->sampleAddr, sp24, sample->size, gAlTbl->unk2); } else { - func_sh_802f3c38((uintptr_t) sample->sampleAddr, sp24, sample->size, sample->medium); + func_sh_802f3c38((uintptr_t)sample->sampleAddr, sp24, sample->size, sample->medium); } sample->medium = 0; sample->sampleAddr = sp24; @@ -368,8 +367,8 @@ s32 func_sh_802f2f38(struct AudioBankSample *sample, s32 bankId) { } s32 func_sh_802f3024(s32 bankId, s32 instId, s32 arg2) { - struct Instrument *instr; - struct Drum *drum; + struct Instrument* instr; + struct Drum* drum; if (instId < 0x7F) { instr = get_instrument_inner(bankId, instId); @@ -395,17 +394,17 @@ s32 func_sh_802f3024(s32 bankId, s32 instId, s32 arg2) { return 0; } -void func_sh_802f30f4(s32 arg0, s32 arg1, s32 arg2, OSMesgQueue *arg3) { +void func_sh_802f30f4(s32 arg0, s32 arg1, s32 arg2, OSMesgQueue* arg3) { if (func_802f3f08(2, canonicalize_index(2, arg0), arg1, arg2, arg3) == 0) { osSendMesg(arg3, 0, 0); } } -void func_sh_802f3158(s32 seqId, s32 numChunks, s32 arg2, OSMesgQueue *retQueue) { +void func_sh_802f3158(s32 seqId, s32 numChunks, s32 arg2, OSMesgQueue* retQueue) { s32 val; s32 v; - val = ((u16 *) gAlBankSets)[canonicalize_index(0, seqId)]; + val = ((u16*)gAlBankSets)[canonicalize_index(0, seqId)]; v = gAlBankSets[val++]; while (v > 0) { @@ -414,10 +413,10 @@ void func_sh_802f3158(s32 seqId, s32 numChunks, s32 arg2, OSMesgQueue *retQueue) } } -u8 *func_sh_802f3220(u32 seqId, u32 *a1) { +u8* func_sh_802f3220(u32 seqId, u32* a1) { s32 val; - val = ((u16 *) gAlBankSets)[canonicalize_index(0, seqId)]; + val = ((u16*)gAlBankSets)[canonicalize_index(0, seqId)]; *a1 = gAlBankSets[val++]; if (*a1 == 0) { return NULL; @@ -443,14 +442,13 @@ void func_sh_802f3288(s32 idx) { continue; } - } } BAD_RETURN(s32) func_sh_802f3368(s32 bankId) { - struct SoundMultiPool *pool = &gBankLoadedPool; - struct TemporaryPool *temporary = &pool->temporary; - struct PersistentPool *persistent; + struct SoundMultiPool* pool = &gBankLoadedPool; + struct TemporaryPool* temporary = &pool->temporary; + struct PersistentPool* persistent; u32 i; if (temporary->entries[0].id == bankId) { @@ -464,21 +462,19 @@ BAD_RETURN(s32) func_sh_802f3368(s32 bankId) { if (persistent->entries[i].id == bankId) { persistent->entries[i].id = -1; } - } discard_bank(bankId); } - void load_sequence_internal(s32 player, s32 seqId, s32 loadAsync); void load_sequence(u32 player, u32 seqId, s32 loadAsync) { load_sequence_internal(player, seqId, loadAsync); } void load_sequence_internal(s32 player, s32 seqId, UNUSED s32 loadAsync) { - struct SequencePlayer *seqPlayer; - u8 *sequenceData; + struct SequencePlayer* seqPlayer; + u8* sequenceData; u32 s0; s32 count; u8 bank; @@ -489,7 +485,7 @@ void load_sequence_internal(s32 player, s32 seqId, UNUSED s32 loadAsync) { seqId = canonicalize_index(0, seqId); sequence_player_disable(seqPlayer); - s0 = ((u16 *) gAlBankSets)[seqId]; + s0 = ((u16*)gAlBankSets)[seqId]; count = gAlBankSets[s0++]; bank = 0xff; @@ -510,11 +506,10 @@ void load_sequence_internal(s32 player, s32 seqId, UNUSED s32 loadAsync) { seqPlayer->delay = 0; seqPlayer->finished = 0; - for (i = 0; i < 0x10; i++) { - } + for (i = 0; i < 0x10; i++) {} } -void *func_sh_802f3564(s32 seqId) { +void* func_sh_802f3564(s32 seqId) { s32 seqId2 = canonicalize_index(0, seqId); s32 temp; return func_sh_802f3764(0, seqId2, &temp); @@ -522,9 +517,9 @@ void *func_sh_802f3564(s32 seqId) { extern u8 gUnkLoadStatus[0x40]; -void *func_sh_802f3598(s32 idx, s32 *medium) { - void *ret; - ALSeqFile *f; +void* func_sh_802f3598(s32 idx, s32* medium) { + void* ret; + ALSeqFile* f; s32 temp; s32 sp28; @@ -554,11 +549,10 @@ void *func_sh_802f3598(s32 idx, s32 *medium) { *medium = f->seqArray[idx].medium; } return f->seqArray[idx].offset; - } -void *func_sh_802f3688(s32 bankId) { - void *ret; +void* func_sh_802f3688(s32 bankId) { + void* ret; s32 bankId1; s32 bankId2; s32 sp38; @@ -594,13 +588,13 @@ void *func_sh_802f3688(s32 bankId) { return ret; } -void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) { +void* func_sh_802f3764(s32 poolIdx, s32 idx, s32* arg2) { s32 size; - ALSeqFile *f; - void *vAddr; + ALSeqFile* f; + void* vAddr; s32 medium; UNUSED u32 pad2; - u8 *devAddr; + u8* devAddr; s8 loadStatus; s32 sp18; @@ -616,7 +610,6 @@ void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) { sp18 = f->seqArray[idx].magic; devAddr = f->seqArray[idx].offset; - switch (sp18) { case 0: vAddr = unk_pool1_alloc(poolIdx, idx, size); @@ -648,9 +641,9 @@ void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) { *arg2 = 1; if (medium == 1) { - func_sh_802f3d78((uintptr_t) devAddr, vAddr, size, f->unk2); + func_sh_802f3d78((uintptr_t)devAddr, vAddr, size, f->unk2); } else { - func_sh_802f3c38((uintptr_t) devAddr, vAddr, size, medium); + func_sh_802f3c38((uintptr_t)devAddr, vAddr, size, medium); } switch (sp18) { @@ -688,17 +681,17 @@ void *func_sh_802f3764(s32 poolIdx, s32 idx, s32 *arg2) { } s32 canonicalize_index(s32 poolIdx, s32 idx) { - ALSeqFile *f; + ALSeqFile* f; f = get_audio_file_header(poolIdx); if (f->seqArray[idx].len == 0) { - idx = (s32) (uintptr_t) f->seqArray[idx].offset; + idx = (s32)(uintptr_t)f->seqArray[idx].offset; } return idx; } -void *get_bank_or_seq_wrapper(s32 poolIdx, s32 id) { - void *ret; +void* get_bank_or_seq_wrapper(s32 poolIdx, s32 id) { + void* ret; ret = unk_pool1_lookup(poolIdx, id); if (ret != NULL) { @@ -711,8 +704,8 @@ void *get_bank_or_seq_wrapper(s32 poolIdx, s32 id) { return NULL; } -ALSeqFile *get_audio_file_header(s32 poolIdx) { - ALSeqFile *ret; +ALSeqFile* get_audio_file_header(s32 poolIdx) { + ALSeqFile* ret; switch (poolIdx) { default: ret = NULL; @@ -730,25 +723,24 @@ ALSeqFile *get_audio_file_header(s32 poolIdx) { return ret; } -void patch_audio_bank(s32 bankId, struct AudioBank *mem, struct PatchStruct *patchInfo) { - struct Instrument *instrument; - void **itInstrs; - struct Instrument **end; +void patch_audio_bank(s32 bankId, struct AudioBank* mem, struct PatchStruct* patchInfo) { + struct Instrument* instrument; + void** itInstrs; + struct Instrument** end; s32 i; - void *patched; - struct Drum *drum; + void* patched; + struct Drum* drum; s32 numDrums; s32 numInstruments; -#define BASE_OFFSET(x, base) (void *)((uintptr_t) (x) + (uintptr_t) base) +#define BASE_OFFSET(x, base) (void*)((uintptr_t)(x) + (uintptr_t)base) #define PATCH(x, base) (patched = BASE_OFFSET(x, base)) #define PATCH_MEM(x) x = PATCH(x, mem) numDrums = gCtlEntries[bankId].numDrums; numInstruments = gCtlEntries[bankId].numInstruments; - itInstrs = (void **) mem->drums; - if (mem->drums) { - } + itInstrs = (void**)mem->drums; + if (mem->drums) {} if (itInstrs != NULL && numDrums != 0) { if (1) { mem->drums = PATCH(itInstrs, mem); @@ -764,14 +756,13 @@ void patch_audio_bank(s32 bankId, struct AudioBank *mem, struct PatchStruct *pat drum->envelope = BASE_OFFSET(patched, mem); drum->loaded = 1; } - } } } if (numInstruments > 0) { - itInstrs = (void **) mem->instruments; - end = numInstruments + (struct Instrument **) itInstrs; + itInstrs = (void**)mem->instruments; + end = numInstruments + (struct Instrument**)itInstrs; do { if (*itInstrs != NULL) { @@ -792,8 +783,8 @@ void patch_audio_bank(s32 bankId, struct AudioBank *mem, struct PatchStruct *pat instrument->loaded = 1; } } - itInstrs = (void **) ((struct Instrument **) itInstrs) + 1; - } while ((struct Instrument **) itInstrs != ((void) 0, end)); //! This is definitely fake + itInstrs = (void**)((struct Instrument**)itInstrs) + 1; + } while ((struct Instrument**)itInstrs != ((void)0, end)); //! This is definitely fake } gCtlEntries[bankId].drums = mem->drums; gCtlEntries[bankId].instruments = mem->instruments; @@ -804,7 +795,7 @@ void patch_audio_bank(s32 bankId, struct AudioBank *mem, struct PatchStruct *pat extern char shindouDebugPrint81[]; // "FastCopy" extern char shindouDebugPrint82[]; // "FastCopy" -void func_sh_802f3c38(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 medium) { +void func_sh_802f3c38(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 medium) { nbytes = ALIGN16(nbytes); osInvalDCache(vAddr, nbytes); @@ -814,7 +805,8 @@ again: } if (nbytes >= 0x400U) { - func_sh_802f3dd0(&gAudioDmaIoMesg, 1, 0, devAddr, vAddr, 0x400, &gAudioDmaMesgQueue, medium, shindouDebugPrint81); + func_sh_802f3dd0(&gAudioDmaIoMesg, 1, 0, devAddr, vAddr, 0x400, &gAudioDmaMesgQueue, medium, + shindouDebugPrint81); osRecvMesg(&gAudioDmaMesgQueue, NULL, 1); nbytes = nbytes - 0x400; devAddr = devAddr + 0x400; @@ -823,12 +815,13 @@ again: } if (nbytes != 0) { - func_sh_802f3dd0(&gAudioDmaIoMesg, 1, 0, devAddr, vAddr, nbytes, &gAudioDmaMesgQueue, medium, shindouDebugPrint82); + func_sh_802f3dd0(&gAudioDmaIoMesg, 1, 0, devAddr, vAddr, nbytes, &gAudioDmaMesgQueue, medium, + shindouDebugPrint82); osRecvMesg(&gAudioDmaMesgQueue, NULL, 1); } } -void func_sh_802f3d78(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) { +void func_sh_802f3d78(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 arg3) { uintptr_t sp1C; sp1C = devAddr; @@ -836,8 +829,9 @@ void func_sh_802f3d78(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) { func_sh_802f3ed4(func_sh_802f3ec4(arg3, &sp1C), sp1C, vAddr, nbytes); } -s32 func_sh_802f3dd0(OSIoMesg *m, s32 pri, s32 direction, uintptr_t devAddr, void *dramAddr, s32 size, OSMesgQueue *retQueue, s32 medium, UNUSED const char *reason) { - OSPiHandle *handle; +s32 func_sh_802f3dd0(OSIoMesg* m, s32 pri, s32 direction, uintptr_t devAddr, void* dramAddr, s32 size, + OSMesgQueue* retQueue, s32 medium, UNUSED const char* reason) { + OSPiHandle* handle; if (gAudioLoadLockSH >= 0x11U) { return -1; } @@ -864,22 +858,22 @@ s32 func_sh_802f3dd0(OSIoMesg *m, s32 pri, s32 direction, uintptr_t devAddr, voi return 0; } -s32 func_sh_802f3ec4(UNUSED s32 arg0, UNUSED uintptr_t *arg1) { +s32 func_sh_802f3ec4(UNUSED s32 arg0, UNUSED uintptr_t* arg1) { return 0; } -void func_sh_802f3ed4(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED void *vAddr, UNUSED size_t nbytes) { +void func_sh_802f3ed4(UNUSED s32 arg0, UNUSED s32 arg1, UNUSED void* vAddr, UNUSED size_t nbytes) { } -void *func_sh_802f3ee8(s32 poolIdx, s32 idx) { +void* func_sh_802f3ee8(s32 poolIdx, s32 idx) { s32 temp; return func_sh_802f3764(poolIdx, idx, &temp); } -void *func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue *retQueue) { +void* func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue* retQueue) { s32 size; - ALSeqFile *f; - void *vAddr; + ALSeqFile* f; + void* vAddr; s32 medium; s32 sp18; uintptr_t devAddr; @@ -901,19 +895,18 @@ void *func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue * return 0; } break; - } vAddr = get_bank_or_seq_wrapper(poolIdx, idx); if (vAddr != NULL) { loadStatus = 2; - osSendMesg(retQueue, (OSMesg) (arg3 << 0x18), 0); + osSendMesg(retQueue, (OSMesg)(arg3 << 0x18), 0); } else { f = get_audio_file_header(poolIdx); size = f->seqArray[idx].len; size = ALIGN16(size); medium = f->seqArray[idx].medium; sp18 = f->seqArray[idx].magic; - devAddr = (uintptr_t) f->seqArray[idx].offset; + devAddr = (uintptr_t)f->seqArray[idx].offset; loadStatus = 2; switch (sp18) { @@ -946,7 +939,8 @@ void *func_802f3f08(s32 poolIdx, s32 idx, s32 numChunks, s32 arg3, OSMesgQueue * break; } - func_sh_802f4cb4(devAddr, vAddr, size, medium, numChunks, retQueue, (arg3 << 0x18) | (poolIdx << 0x10) | (idx << 8) | loadStatus); + func_sh_802f4cb4(devAddr, vAddr, size, medium, numChunks, retQueue, + (arg3 << 0x18) | (poolIdx << 0x10) | (idx << 8) | loadStatus); loadStatus = SOUND_LOAD_STATUS_IN_PROGRESS; } @@ -1002,23 +996,21 @@ void audio_init() { UNUSED s8 pad[0x34]; s32 i, j, k; s32 lim; - u64 *ptr64; - void *data; + u64* ptr64; + void* data; UNUSED u8 pad2[4]; s32 seqCount; gAudioLoadLockSH = 0; for (i = 0; i < gAudioHeapSize / 8; i++) { - ((u64 *) gAudioHeap)[i] = 0; + ((u64*)gAudioHeap)[i] = 0; } - D_EU_802298D0 = 16.713f; gRefreshRate = 60; port_eu_init(); - eu_stubbed_printf_1("AudioHeap is %x\n", gAudioHeapSize); for (i = 0; i < NUMAIBUFFERS; i++) { @@ -1033,8 +1025,7 @@ void audio_init() { gAudioTasks[0].task.t.data_size = 0; gAudioTasks[1].task.t.data_size = 0; osCreateMesgQueue(&gAudioDmaMesgQueue, &gAudioDmaMesg, 1); - osCreateMesgQueue(&gCurrAudioFrameDmaQueue, gCurrAudioFrameDmaMesgBufs, - ARRAY_COUNT(gCurrAudioFrameDmaMesgBufs)); + osCreateMesgQueue(&gCurrAudioFrameDmaQueue, gCurrAudioFrameDmaMesgBufs, ARRAY_COUNT(gCurrAudioFrameDmaMesgBufs)); osCreateMesgQueue(&gUnkQueue1, gUnkMesgBufs1, 0x10); osCreateMesgQueue(&gUnkQueue2, gUnkMesgBufs2, 0x10); gCurrAudioFrameDmaCount = 0; @@ -1045,7 +1036,7 @@ void audio_init() { for (i = 0; i < NUMAIBUFFERS; i++) { gAiBuffers[i] = sound_alloc_uninitialized(&gAudioInitPool, AIBUFFER_LEN); - for (j = 0; j < (s32) (AIBUFFER_LEN / sizeof(s16)); j++) { + for (j = 0; j < (s32)(AIBUFFER_LEN / sizeof(s16)); j++) { gAiBuffers[i][j] = 0; } } @@ -1060,21 +1051,21 @@ void audio_init() { eu_stubbed_printf_0("Main Heap Initialize.\n"); // Load headers for sounds and sequences - gSeqFileHeader = (ALSeqFile *) gShindouSequencesHeader; - gAlCtlHeader = (ALSeqFile *) gShindouSoundBanksHeader; - gAlTbl = (ALSeqFile *) gShindouSampleBanksHeader; + gSeqFileHeader = (ALSeqFile*)gShindouSequencesHeader; + gAlCtlHeader = (ALSeqFile*)gShindouSoundBanksHeader; + gAlTbl = (ALSeqFile*)gShindouSampleBanksHeader; gAlBankSets = gBankSetsData; - gSequenceCount = (s16) gSeqFileHeader->seqCount; + gSequenceCount = (s16)gSeqFileHeader->seqCount; patch_seq_file(gSeqFileHeader, gMusicData, D_SH_80315EF4); patch_seq_file(gAlCtlHeader, gSoundDataADSR, D_SH_80315EF8); patch_seq_file(gAlTbl, gSoundDataRaw, D_SH_80315EFC); seqCount = gAlCtlHeader->seqCount; gCtlEntries = sound_alloc_uninitialized(&gAudioInitPool, seqCount * sizeof(struct CtlEntry)); for (i = 0; i < seqCount; i++) { - gCtlEntries[i].bankId1 = (u8) ((gAlCtlHeader->seqArray[i].ctl.as_s16.bankAndFf >> 8) & 0xff); - gCtlEntries[i].bankId2 = (u8) (gAlCtlHeader->seqArray[i].ctl.as_s16.bankAndFf & 0xff); - gCtlEntries[i].numInstruments = (u8) ((gAlCtlHeader->seqArray[i].ctl.as_s16.numInstrumentsAndDrums >> 8) & 0xff); - gCtlEntries[i].numDrums = (u8) (gAlCtlHeader->seqArray[i].ctl.as_s16.numInstrumentsAndDrums & 0xff); + gCtlEntries[i].bankId1 = (u8)((gAlCtlHeader->seqArray[i].ctl.as_s16.bankAndFf >> 8) & 0xff); + gCtlEntries[i].bankId2 = (u8)(gAlCtlHeader->seqArray[i].ctl.as_s16.bankAndFf & 0xff); + gCtlEntries[i].numInstruments = (u8)((gAlCtlHeader->seqArray[i].ctl.as_s16.numInstrumentsAndDrums >> 8) & 0xff); + gCtlEntries[i].numDrums = (u8)(gAlCtlHeader->seqArray[i].ctl.as_s16.numInstrumentsAndDrums & 0xff); } data = sound_alloc_uninitialized(&gAudioInitPool, D_SH_80315EF0); if (data == NULL) { @@ -1084,9 +1075,9 @@ void audio_init() { init_sequence_players(); } -s32 func_sh_802f47c8(s32 bankId, u8 idx, s8 *io) { - struct AudioBankSample *sample = func_sh_802f4978(bankId, idx); - struct PendingDmaSample *temp; +s32 func_sh_802f47c8(s32 bankId, u8 idx, s8* io) { + struct AudioBankSample* sample = func_sh_802f4978(bankId, idx); + struct PendingDmaSample* temp; if (sample == NULL) { *io = 0; return -1; @@ -1113,8 +1104,8 @@ s32 func_sh_802f47c8(s32 bankId, u8 idx, s8 *io) { } temp->state = 1; temp->remaining = ALIGN16(sample->size); - temp->resultSampleAddr = (u8 *) temp->vAddr; - temp->devAddr = (uintptr_t) sample->sampleAddr; + temp->resultSampleAddr = (u8*)temp->vAddr; + temp->devAddr = (uintptr_t)sample->sampleAddr; temp->medium = sample->medium; temp->bankId = bankId; temp->idx = idx; @@ -1122,10 +1113,10 @@ s32 func_sh_802f47c8(s32 bankId, u8 idx, s8 *io) { return 0; } -struct AudioBankSample *func_sh_802f4978(s32 bankId, s32 idx) { - struct Drum *drum; - struct Instrument *inst; - struct AudioBankSample *ret; +struct AudioBankSample* func_sh_802f4978(s32 bankId, s32 idx) { + struct Drum* drum; + struct Instrument* inst; + struct AudioBankSample* ret; if (idx < 128) { inst = get_instrument_inner(bankId, idx); @@ -1146,8 +1137,8 @@ struct AudioBankSample *func_sh_802f4978(s32 bankId, s32 idx) { void stub_sh_802f49dc(void) { } -void func_sh_802f49e4(struct PendingDmaSample *arg0) { - struct AudioBankSample *sample = func_sh_802f4978(arg0->bankId, arg0->idx); +void func_sh_802f49e4(struct PendingDmaSample* arg0) { + struct AudioBankSample* sample = func_sh_802f4978(arg0->bankId, arg0->idx); if (sample != NULL) { arg0->sample = *sample; sample->sampleAddr = arg0->resultSampleAddr; @@ -1156,8 +1147,8 @@ void func_sh_802f49e4(struct PendingDmaSample *arg0) { } void func_sh_802f4a4c(s32 audioResetStatus) { - ALSeqFile *alTbl; - struct PendingDmaSample *entry; + ALSeqFile* alTbl; + struct PendingDmaSample* entry; s32 i; @@ -1192,8 +1183,8 @@ void func_sh_802f4a4c(s32 audioResetStatus) { } else { func_sh_802f4bd8(entry, 0x1000); } - entry->remaining = (s32) (entry->remaining - 0x1000); - entry->vAddr = (u8 *) entry->vAddr + 0x1000; + entry->remaining = (s32)(entry->remaining - 0x1000); + entry->vAddr = (u8*)entry->vAddr + 0x1000; entry->devAddr = entry->devAddr + 0x1000; } break; @@ -1201,14 +1192,15 @@ void func_sh_802f4a4c(s32 audioResetStatus) { } } -extern char shindouDebugPrint102[]; // "SLOWCOPY" -void func_sh_802f4bd8(struct PendingDmaSample *arg0, s32 len) { // len must be signed +extern char shindouDebugPrint102[]; // "SLOWCOPY" +void func_sh_802f4bd8(struct PendingDmaSample* arg0, s32 len) { // len must be signed osInvalDCache(arg0->vAddr, len); osCreateMesgQueue(&arg0->queue, arg0->mesgs, 1); - func_sh_802f3dd0(&arg0->ioMesg, 0, 0, arg0->devAddr, arg0->vAddr, len, &arg0->queue, arg0->medium, shindouDebugPrint102); + func_sh_802f3dd0(&arg0->ioMesg, 0, 0, arg0->devAddr, arg0->vAddr, len, &arg0->queue, arg0->medium, + shindouDebugPrint102); } -void func_sh_802f4c5c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) { +void func_sh_802f4c5c(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 arg3) { uintptr_t sp1C; sp1C = devAddr; @@ -1216,8 +1208,9 @@ void func_sh_802f4c5c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) { func_sh_802f3ed4(func_sh_802f3ec4(arg3, &sp1C), sp1C, vAddr, nbytes); } -struct PendingDmaAudioBank *func_sh_802f4cb4(uintptr_t devAddr, void *vAddr, s32 size, s32 medium, s32 numChunks, OSMesgQueue *retQueue, s32 encodedInfo) { - struct PendingDmaAudioBank *item; +struct PendingDmaAudioBank* func_sh_802f4cb4(uintptr_t devAddr, void* vAddr, s32 size, s32 medium, s32 numChunks, + OSMesgQueue* retQueue, s32 encodedInfo) { + struct PendingDmaAudioBank* item; s32 i; for (i = 0; i < ARRAY_COUNT(sPendingDmaAudioBanks); i++) { @@ -1263,9 +1256,9 @@ void func_sh_802f4dcc(s32 audioResetStatus) { } } -void func_sh_802f4e50(struct PendingDmaAudioBank *audioBank, s32 audioResetStatus) { - ALSeqFile *alSeqFile; - u32 *encodedInfo; +void func_sh_802f4e50(struct PendingDmaAudioBank* audioBank, s32 audioResetStatus) { + ALSeqFile* alSeqFile; + u32* encodedInfo; OSMesg mesg; u32 temp; u32 bankId; @@ -1292,29 +1285,29 @@ void func_sh_802f4e50(struct PendingDmaAudioBank *audioBank, s32 audioResetStatu encodedInfo = &audioBank->encodedInfo; if (audioBank->remaining == 0) { - mesg = (OSMesg) audioBank->encodedInfo; + mesg = (OSMesg)audioBank->encodedInfo; #pragma GCC diagnostic push #if defined(__clang__) #pragma GCC diagnostic ignored "-Wself-assign" #endif - mesg = mesg; //! needs an extra read from mesg here to match... + mesg = mesg; //! needs an extra read from mesg here to match... #pragma GCC diagnostic pop temp = *encodedInfo; bankId = (temp >> 8) & 0xFF; - switch ((u8) (temp >> 0x10)) { + switch ((u8)(temp >> 0x10)) { case 0: if (gSeqLoadStatus[bankId] != SOUND_LOAD_STATUS_5) { - gSeqLoadStatus[bankId] = (u8) (temp & 0xFF); + gSeqLoadStatus[bankId] = (u8)(temp & 0xFF); } break; case 2: if (gUnkLoadStatus[bankId] != SOUND_LOAD_STATUS_5) { - gUnkLoadStatus[bankId] = (u8) (temp & 0xFF); + gUnkLoadStatus[bankId] = (u8)(temp & 0xFF); } break; case 1: if (gBankLoadStatus[bankId] != SOUND_LOAD_STATUS_5) { - gBankLoadStatus[bankId] = (u8) (temp & 0xFF); + gBankLoadStatus[bankId] = (u8)(temp & 0xFF); } bankId1 = gCtlEntries[bankId].bankId1; bankId2 = gCtlEntries[bankId].bankId2; @@ -1334,7 +1327,7 @@ void func_sh_802f4e50(struct PendingDmaAudioBank *audioBank, s32 audioResetStatu func_sh_802f5310(bankId, audioBank->audioBank, &patchStruct, 1); break; } - mesg = (OSMesg) audioBank->encodedInfo; + mesg = (OSMesg)audioBank->encodedInfo; audioBank->inProgress = 0; osSendMesg(audioBank->retQueue, mesg, OS_MESG_NOBLOCK); } else if (audioBank->remaining < audioBank->transferSize) { @@ -1353,22 +1346,22 @@ void func_sh_802f4e50(struct PendingDmaAudioBank *audioBank, s32 audioResetStatu } audioBank->remaining -= audioBank->transferSize; - audioBank->devAddr += audioBank->transferSize; - audioBank->vAddr = ((u8 *) audioBank->vAddr) + audioBank->transferSize; + audioBank->devAddr += audioBank->transferSize; + audioBank->vAddr = ((u8*)audioBank->vAddr) + audioBank->transferSize; } } extern char shindouDebugPrint110[]; // "BGCOPY" -void func_sh_802f50ec(struct PendingDmaAudioBank *arg0, size_t len) { +void func_sh_802f50ec(struct PendingDmaAudioBank* arg0, size_t len) { len += 0xf; len &= ~0xf; osInvalDCache(arg0->vAddr, len); osCreateMesgQueue(&arg0->dmaRetQueue, arg0->mesgs, 1); - func_sh_802f3dd0(&arg0->ioMesg, 0, 0, arg0->devAddr, arg0->vAddr, len, &arg0->dmaRetQueue, arg0->medium, shindouDebugPrint110); + func_sh_802f3dd0(&arg0->ioMesg, 0, 0, arg0->devAddr, arg0->vAddr, len, &arg0->dmaRetQueue, arg0->medium, + shindouDebugPrint110); } - -void func_sh_802f517c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) { +void func_sh_802f517c(uintptr_t devAddr, void* vAddr, size_t nbytes, s32 arg3) { uintptr_t sp1C; sp1C = devAddr; @@ -1376,13 +1369,13 @@ void func_sh_802f517c(uintptr_t devAddr, void *vAddr, size_t nbytes, s32 arg3) { func_sh_802f3ed4(func_sh_802f3ec4(arg3, &sp1C), sp1C, vAddr, nbytes); } -void patch_sound(struct AudioBankSound *sound, struct AudioBank *memBase, struct PatchStruct *patchInfo) { - struct AudioBankSample *sample; - void *patched; +void patch_sound(struct AudioBankSound* sound, struct AudioBank* memBase, struct PatchStruct* patchInfo) { + struct AudioBankSample* sample; + void* patched; -#define PATCH(x, base) (patched = (void *)((uintptr_t) (x) + (uintptr_t) base)) +#define PATCH(x, base) (patched = (void*)((uintptr_t)(x) + (uintptr_t)base)) - if ((uintptr_t) sound->sample <= 0x80000000) { + if ((uintptr_t)sound->sample <= 0x80000000) { sample = sound->sample = PATCH(sound->sample, memBase); if (sample->size != 0 && sample->isPatched != TRUE) { sample->loop = PATCH(sample->loop, memBase); @@ -1410,12 +1403,12 @@ void patch_sound(struct AudioBankSound *sound, struct AudioBank *memBase, struct #undef PATCH } -BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct PatchStruct *patchInfo, s32 arg3) { +BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank* mem, struct PatchStruct* patchInfo, s32 arg3) { UNUSED u32 pad[2]; - u8 *addr; + u8* addr; UNUSED u32 pad1[3]; s32 sp4C; - struct AudioBankSample *temp_s0; + struct AudioBankSample* temp_s0; s32 i; uintptr_t count; s32 temp; @@ -1441,13 +1434,14 @@ BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct Patch case 0: temp = temp_s0->medium = patchInfo->medium1; if (temp != 0) { - if (temp_s0->size) { - } - addr = func_sh_802f1d90(temp_s0->size, patchInfo->bankId1, temp_s0->sampleAddr, temp_s0->medium); + if (temp_s0->size) {} + addr = + func_sh_802f1d90(temp_s0->size, patchInfo->bankId1, temp_s0->sampleAddr, temp_s0->medium); } else { temp = temp_s0->medium = patchInfo->medium2; if (temp != 0) { - addr = func_sh_802f1d90(temp_s0->size, patchInfo->bankId2, temp_s0->sampleAddr, temp_s0->medium); + addr = func_sh_802f1d90(temp_s0->size, patchInfo->bankId2, temp_s0->sampleAddr, + temp_s0->medium); } } break; @@ -1455,41 +1449,44 @@ BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct Patch case 1: temp = temp_s0->medium = patchInfo->medium1; if (temp != 0) { - addr = func_sh_802f1d40(temp_s0->size, patchInfo->bankId1, temp_s0->sampleAddr, temp_s0->medium); + addr = + func_sh_802f1d40(temp_s0->size, patchInfo->bankId1, temp_s0->sampleAddr, temp_s0->medium); } else { temp = temp_s0->medium = patchInfo->medium2; if (temp != 0) { - addr = func_sh_802f1d40(temp_s0->size, patchInfo->bankId2, temp_s0->sampleAddr, temp_s0->medium); + addr = func_sh_802f1d40(temp_s0->size, patchInfo->bankId2, temp_s0->sampleAddr, + temp_s0->medium); } } break; } - switch ((uintptr_t) addr) { + switch ((uintptr_t)addr) { case 0: break; default: - switch (arg3) { - case 0: - if (temp_s0->medium == 1) { - func_sh_802f3d78((uintptr_t) temp_s0->sampleAddr, addr, temp_s0->size, gAlTbl->unk2); - temp_s0->sampleAddr = addr; - temp_s0->medium = 0; - } else { - func_sh_802f3c38((uintptr_t) temp_s0->sampleAddr, addr, temp_s0->size, temp_s0->medium); - temp_s0->sampleAddr = addr; - temp_s0->medium = 0; - } - break; + switch (arg3) { + case 0: + if (temp_s0->medium == 1) { + func_sh_802f3d78((uintptr_t)temp_s0->sampleAddr, addr, temp_s0->size, gAlTbl->unk2); + temp_s0->sampleAddr = addr; + temp_s0->medium = 0; + } else { + func_sh_802f3c38((uintptr_t)temp_s0->sampleAddr, addr, temp_s0->size, temp_s0->medium); + temp_s0->sampleAddr = addr; + temp_s0->medium = 0; + } + break; - case 1: - D_SH_8034EC88[D_SH_8034F68C].sample = temp_s0; - D_SH_8034EC88[D_SH_8034F68C].ramAddr = addr; - D_SH_8034EC88[D_SH_8034F68C].encodedInfo = (D_SH_8034F68C << 24) | 0xffffff; - D_SH_8034EC88[D_SH_8034F68C].isFree = FALSE; - D_SH_8034EC88[D_SH_8034F68C].endAndMediumIdentification = temp_s0->sampleAddr + temp_s0->size + temp_s0->medium; - D_SH_8034F68C++; - break; - } + case 1: + D_SH_8034EC88[D_SH_8034F68C].sample = temp_s0; + D_SH_8034EC88[D_SH_8034F68C].ramAddr = addr; + D_SH_8034EC88[D_SH_8034F68C].encodedInfo = (D_SH_8034F68C << 24) | 0xffffff; + D_SH_8034EC88[D_SH_8034F68C].isFree = FALSE; + D_SH_8034EC88[D_SH_8034F68C].endAndMediumIdentification = + temp_s0->sampleAddr + temp_s0->size + temp_s0->medium; + D_SH_8034F68C++; + break; + } } continue; } @@ -1501,34 +1498,27 @@ BAD_RETURN(s32) func_sh_802f5310(s32 bankId, struct AudioBank *mem, struct Patch temp_s0 = D_SH_8034EC88[D_SH_8034F68C - 1].sample; temp = (temp_s0->size >> 12); temp += 1; - count = (uintptr_t) temp_s0->sampleAddr; - func_sh_802f4cb4( - count, - D_SH_8034EC88[D_SH_8034F68C - 1].ramAddr, - temp_s0->size, - temp_s0->medium, - temp, - &gUnkQueue2, - D_SH_8034EC88[D_SH_8034F68C - 1].encodedInfo); + count = (uintptr_t)temp_s0->sampleAddr; + func_sh_802f4cb4(count, D_SH_8034EC88[D_SH_8034F68C - 1].ramAddr, temp_s0->size, temp_s0->medium, temp, + &gUnkQueue2, D_SH_8034EC88[D_SH_8034F68C - 1].encodedInfo); } } s32 func_sh_802f573c(s32 audioResetStatus) { - struct AudioBankSample *sample; + struct AudioBankSample* sample; u32 idx; - u8 *sampleAddr; + u8* sampleAddr; u32 size; s32 unk; - u8 *added; + u8* added; if (D_SH_8034F68C > 0) { if (audioResetStatus != 0) { - if (osRecvMesg(&gUnkQueue2, (OSMesg *) &idx, OS_MESG_NOBLOCK)) { - } + if (osRecvMesg(&gUnkQueue2, (OSMesg*)&idx, OS_MESG_NOBLOCK)) {} D_SH_8034F68C = 0; return 0; } - if (osRecvMesg(&gUnkQueue2, (OSMesg *) &idx, OS_MESG_NOBLOCK) == -1) { + if (osRecvMesg(&gUnkQueue2, (OSMesg*)&idx, OS_MESG_NOBLOCK) == -1) { return 0; } idx >>= 0x18; @@ -1542,7 +1532,7 @@ s32 func_sh_802f573c(s32 audioResetStatus) { D_SH_8034EC88[idx].isFree = TRUE; } -next: + next: if (D_SH_8034F68C > 0) { if (D_SH_8034EC88[D_SH_8034F68C - 1].isFree == TRUE) { D_SH_8034F68C--; @@ -1560,14 +1550,14 @@ next: goto next; } size = sample->size; - func_sh_802f4cb4((uintptr_t) sampleAddr, D_SH_8034EC88[D_SH_8034F68C - 1].ramAddr, size, sample->medium, - unk, &gUnkQueue2, D_SH_8034EC88[D_SH_8034F68C - 1].encodedInfo); + func_sh_802f4cb4((uintptr_t)sampleAddr, D_SH_8034EC88[D_SH_8034F68C - 1].ramAddr, size, sample->medium, unk, + &gUnkQueue2, D_SH_8034EC88[D_SH_8034F68C - 1].encodedInfo); } } return 1; } -s32 func_sh_802f5900(struct AudioBankSample *sample, s32 numLoaded, struct AudioBankSample *arg2[]) { +s32 func_sh_802f5900(struct AudioBankSample* sample, s32 numLoaded, struct AudioBankSample* arg2[]) { s32 i; for (i = 0; i < numLoaded; i++) { @@ -1581,10 +1571,10 @@ s32 func_sh_802f5900(struct AudioBankSample *sample, s32 numLoaded, struct Audio return numLoaded; } -s32 func_sh_802f5948(s32 bankId, struct AudioBankSample *list[]) { +s32 func_sh_802f5948(s32 bankId, struct AudioBankSample* list[]) { s32 i; - struct Drum *drum; - struct Instrument *inst; + struct Drum* drum; + struct Instrument* inst; s32 numLoaded; s32 numDrums; s32 numInstruments; @@ -1604,7 +1594,6 @@ s32 func_sh_802f5948(s32 bankId, struct AudioBankSample *list[]) { inst = get_instrument_inner(bankId, i); if (inst == NULL) { continue; - } if (inst->normalRangeLo != 0) { numLoaded = func_sh_802f5900(inst->lowNotesSound.sample, numLoaded, list); diff --git a/src/audio/mixer.c b/src/audio/mixer.c index 67bfa0ff..9f680d77 100644 --- a/src/audio/mixer.c +++ b/src/audio/mixer.c @@ -18,10 +18,10 @@ #define HAS_NEON 0 #endif -#pragma GCC optimize ("unroll-loops") +#pragma GCC optimize("unroll-loops") #if HAS_SSE41 -#define LOADLH(l, h) _mm_castpd_si128(_mm_loadh_pd(_mm_load_sd((const double *)(l)), (const double *)(h))) +#define LOADLH(l, h) _mm_castpd_si128(_mm_loadh_pd(_mm_load_sd((const double*)(l)), (const double*)(h))) #endif #define ROUND_UP_64(v) (((v) + 63) & ~63) @@ -64,7 +64,7 @@ static struct { int16_t vol_wet; #endif - ADPCM_STATE *adpcm_loop_state; + ADPCM_STATE* adpcm_loop_state; int16_t adpcm_table[8][2][8]; @@ -80,38 +80,28 @@ static struct { } rspa; static int16_t resample_table[64][4] = { - {0x0c39, 0x66ad, 0x0d46, 0xffdf}, {0x0b39, 0x6696, 0x0e5f, 0xffd8}, - {0x0a44, 0x6669, 0x0f83, 0xffd0}, {0x095a, 0x6626, 0x10b4, 0xffc8}, - {0x087d, 0x65cd, 0x11f0, 0xffbf}, {0x07ab, 0x655e, 0x1338, 0xffb6}, - {0x06e4, 0x64d9, 0x148c, 0xffac}, {0x0628, 0x643f, 0x15eb, 0xffa1}, - {0x0577, 0x638f, 0x1756, 0xff96}, {0x04d1, 0x62cb, 0x18cb, 0xff8a}, - {0x0435, 0x61f3, 0x1a4c, 0xff7e}, {0x03a4, 0x6106, 0x1bd7, 0xff71}, - {0x031c, 0x6007, 0x1d6c, 0xff64}, {0x029f, 0x5ef5, 0x1f0b, 0xff56}, - {0x022a, 0x5dd0, 0x20b3, 0xff48}, {0x01be, 0x5c9a, 0x2264, 0xff3a}, - {0x015b, 0x5b53, 0x241e, 0xff2c}, {0x0101, 0x59fc, 0x25e0, 0xff1e}, - {0x00ae, 0x5896, 0x27a9, 0xff10}, {0x0063, 0x5720, 0x297a, 0xff02}, - {0x001f, 0x559d, 0x2b50, 0xfef4}, {0xffe2, 0x540d, 0x2d2c, 0xfee8}, - {0xffac, 0x5270, 0x2f0d, 0xfedb}, {0xff7c, 0x50c7, 0x30f3, 0xfed0}, - {0xff53, 0x4f14, 0x32dc, 0xfec6}, {0xff2e, 0x4d57, 0x34c8, 0xfebd}, - {0xff0f, 0x4b91, 0x36b6, 0xfeb6}, {0xfef5, 0x49c2, 0x38a5, 0xfeb0}, - {0xfedf, 0x47ed, 0x3a95, 0xfeac}, {0xfece, 0x4611, 0x3c85, 0xfeab}, - {0xfec0, 0x4430, 0x3e74, 0xfeac}, {0xfeb6, 0x424a, 0x4060, 0xfeaf}, - {0xfeaf, 0x4060, 0x424a, 0xfeb6}, {0xfeac, 0x3e74, 0x4430, 0xfec0}, - {0xfeab, 0x3c85, 0x4611, 0xfece}, {0xfeac, 0x3a95, 0x47ed, 0xfedf}, - {0xfeb0, 0x38a5, 0x49c2, 0xfef5}, {0xfeb6, 0x36b6, 0x4b91, 0xff0f}, - {0xfebd, 0x34c8, 0x4d57, 0xff2e}, {0xfec6, 0x32dc, 0x4f14, 0xff53}, - {0xfed0, 0x30f3, 0x50c7, 0xff7c}, {0xfedb, 0x2f0d, 0x5270, 0xffac}, - {0xfee8, 0x2d2c, 0x540d, 0xffe2}, {0xfef4, 0x2b50, 0x559d, 0x001f}, - {0xff02, 0x297a, 0x5720, 0x0063}, {0xff10, 0x27a9, 0x5896, 0x00ae}, - {0xff1e, 0x25e0, 0x59fc, 0x0101}, {0xff2c, 0x241e, 0x5b53, 0x015b}, - {0xff3a, 0x2264, 0x5c9a, 0x01be}, {0xff48, 0x20b3, 0x5dd0, 0x022a}, - {0xff56, 0x1f0b, 0x5ef5, 0x029f}, {0xff64, 0x1d6c, 0x6007, 0x031c}, - {0xff71, 0x1bd7, 0x6106, 0x03a4}, {0xff7e, 0x1a4c, 0x61f3, 0x0435}, - {0xff8a, 0x18cb, 0x62cb, 0x04d1}, {0xff96, 0x1756, 0x638f, 0x0577}, - {0xffa1, 0x15eb, 0x643f, 0x0628}, {0xffac, 0x148c, 0x64d9, 0x06e4}, - {0xffb6, 0x1338, 0x655e, 0x07ab}, {0xffbf, 0x11f0, 0x65cd, 0x087d}, - {0xffc8, 0x10b4, 0x6626, 0x095a}, {0xffd0, 0x0f83, 0x6669, 0x0a44}, - {0xffd8, 0x0e5f, 0x6696, 0x0b39}, {0xffdf, 0x0d46, 0x66ad, 0x0c39} + { 0x0c39, 0x66ad, 0x0d46, 0xffdf }, { 0x0b39, 0x6696, 0x0e5f, 0xffd8 }, { 0x0a44, 0x6669, 0x0f83, 0xffd0 }, + { 0x095a, 0x6626, 0x10b4, 0xffc8 }, { 0x087d, 0x65cd, 0x11f0, 0xffbf }, { 0x07ab, 0x655e, 0x1338, 0xffb6 }, + { 0x06e4, 0x64d9, 0x148c, 0xffac }, { 0x0628, 0x643f, 0x15eb, 0xffa1 }, { 0x0577, 0x638f, 0x1756, 0xff96 }, + { 0x04d1, 0x62cb, 0x18cb, 0xff8a }, { 0x0435, 0x61f3, 0x1a4c, 0xff7e }, { 0x03a4, 0x6106, 0x1bd7, 0xff71 }, + { 0x031c, 0x6007, 0x1d6c, 0xff64 }, { 0x029f, 0x5ef5, 0x1f0b, 0xff56 }, { 0x022a, 0x5dd0, 0x20b3, 0xff48 }, + { 0x01be, 0x5c9a, 0x2264, 0xff3a }, { 0x015b, 0x5b53, 0x241e, 0xff2c }, { 0x0101, 0x59fc, 0x25e0, 0xff1e }, + { 0x00ae, 0x5896, 0x27a9, 0xff10 }, { 0x0063, 0x5720, 0x297a, 0xff02 }, { 0x001f, 0x559d, 0x2b50, 0xfef4 }, + { 0xffe2, 0x540d, 0x2d2c, 0xfee8 }, { 0xffac, 0x5270, 0x2f0d, 0xfedb }, { 0xff7c, 0x50c7, 0x30f3, 0xfed0 }, + { 0xff53, 0x4f14, 0x32dc, 0xfec6 }, { 0xff2e, 0x4d57, 0x34c8, 0xfebd }, { 0xff0f, 0x4b91, 0x36b6, 0xfeb6 }, + { 0xfef5, 0x49c2, 0x38a5, 0xfeb0 }, { 0xfedf, 0x47ed, 0x3a95, 0xfeac }, { 0xfece, 0x4611, 0x3c85, 0xfeab }, + { 0xfec0, 0x4430, 0x3e74, 0xfeac }, { 0xfeb6, 0x424a, 0x4060, 0xfeaf }, { 0xfeaf, 0x4060, 0x424a, 0xfeb6 }, + { 0xfeac, 0x3e74, 0x4430, 0xfec0 }, { 0xfeab, 0x3c85, 0x4611, 0xfece }, { 0xfeac, 0x3a95, 0x47ed, 0xfedf }, + { 0xfeb0, 0x38a5, 0x49c2, 0xfef5 }, { 0xfeb6, 0x36b6, 0x4b91, 0xff0f }, { 0xfebd, 0x34c8, 0x4d57, 0xff2e }, + { 0xfec6, 0x32dc, 0x4f14, 0xff53 }, { 0xfed0, 0x30f3, 0x50c7, 0xff7c }, { 0xfedb, 0x2f0d, 0x5270, 0xffac }, + { 0xfee8, 0x2d2c, 0x540d, 0xffe2 }, { 0xfef4, 0x2b50, 0x559d, 0x001f }, { 0xff02, 0x297a, 0x5720, 0x0063 }, + { 0xff10, 0x27a9, 0x5896, 0x00ae }, { 0xff1e, 0x25e0, 0x59fc, 0x0101 }, { 0xff2c, 0x241e, 0x5b53, 0x015b }, + { 0xff3a, 0x2264, 0x5c9a, 0x01be }, { 0xff48, 0x20b3, 0x5dd0, 0x022a }, { 0xff56, 0x1f0b, 0x5ef5, 0x029f }, + { 0xff64, 0x1d6c, 0x6007, 0x031c }, { 0xff71, 0x1bd7, 0x6106, 0x03a4 }, { 0xff7e, 0x1a4c, 0x61f3, 0x0435 }, + { 0xff8a, 0x18cb, 0x62cb, 0x04d1 }, { 0xff96, 0x1756, 0x638f, 0x0577 }, { 0xffa1, 0x15eb, 0x643f, 0x0628 }, + { 0xffac, 0x148c, 0x64d9, 0x06e4 }, { 0xffb6, 0x1338, 0x655e, 0x07ab }, { 0xffbf, 0x11f0, 0x65cd, 0x087d }, + { 0xffc8, 0x10b4, 0x6626, 0x095a }, { 0xffd0, 0x0f83, 0x6669, 0x0a44 }, { 0xffd8, 0x0e5f, 0x6696, 0x0b39 }, + { 0xffdf, 0x0d46, 0x66ad, 0x0c39 } }; static inline int16_t clamp16(int32_t v) { @@ -138,24 +128,24 @@ void aClearBufferImpl(uint16_t addr, int nbytes) { } #ifdef NEW_AUDIO_UCODE -void aLoadBufferImpl(const void *source_addr, uint16_t dest_addr, uint16_t nbytes) { +void aLoadBufferImpl(const void* source_addr, uint16_t dest_addr, uint16_t nbytes) { memcpy(BUF_U8(dest_addr), source_addr, ROUND_DOWN_16(nbytes)); } -void aSaveBufferImpl(uint16_t source_addr, int16_t *dest_addr, uint16_t nbytes) { +void aSaveBufferImpl(uint16_t source_addr, int16_t* dest_addr, uint16_t nbytes) { memcpy(dest_addr, BUF_S16(source_addr), ROUND_DOWN_16(nbytes)); } #else -void aLoadBufferImpl(const void *source_addr) { +void aLoadBufferImpl(const void* source_addr) { memcpy(BUF_U8(rspa.in), source_addr, ROUND_UP_8(rspa.nbytes)); } -void aSaveBufferImpl(int16_t *dest_addr) { +void aSaveBufferImpl(int16_t* dest_addr) { memcpy(dest_addr, BUF_S16(rspa.out), ROUND_UP_8(rspa.nbytes)); } #endif -void aLoadADPCMImpl(int num_entries_times_16, const int16_t *book_source_addr) { +void aLoadADPCMImpl(int num_entries_times_16, const int16_t* book_source_addr) { memcpy(rspa.adpcm_table, book_source_addr, num_entries_times_16); } @@ -199,9 +189,9 @@ void aSetVolumeImpl(uint8_t flags, int16_t v, int16_t t, int16_t r) { #ifdef NEW_AUDIO_UCODE void aInterleaveImpl(uint16_t dest, uint16_t left, uint16_t right, uint16_t c) { int count = ROUND_UP_8(c) / sizeof(int16_t) / 4; - int16_t *l = BUF_S16(left); - int16_t *r = BUF_S16(right); - int16_t *d = BUF_S16(dest); + int16_t* l = BUF_S16(left); + int16_t* r = BUF_S16(right); + int16_t* d = BUF_S16(dest); while (count > 0) { int16_t l0 = *l++; int16_t l1 = *l++; @@ -225,9 +215,9 @@ void aInterleaveImpl(uint16_t dest, uint16_t left, uint16_t right, uint16_t c) { #else void aInterleaveImpl(uint16_t left, uint16_t right) { int count = ROUND_UP_16(rspa.nbytes) / sizeof(int16_t) / 8; - int16_t *l = BUF_S16(left); - int16_t *r = BUF_S16(right); - int16_t *d = BUF_S16(rspa.out); + int16_t* l = BUF_S16(left); + int16_t* r = BUF_S16(right); + int16_t* d = BUF_S16(rspa.out); while (count > 0) { int16_t l0 = *l++; int16_t l1 = *l++; @@ -271,7 +261,7 @@ void aDMEMMoveImpl(uint16_t in_addr, uint16_t out_addr, int nbytes) { memmove(BUF_U8(out_addr), BUF_U8(in_addr), nbytes); } -void aSetLoopImpl(ADPCM_STATE *adpcm_loop_state) { +void aSetLoopImpl(ADPCM_STATE* adpcm_loop_state) { rspa.adpcm_loop_state = adpcm_loop_state; } @@ -283,18 +273,18 @@ void aADPCMdecImpl(uint8_t flags, ADPCM_STATE state) { const __m128i mult = _mm_set_epi16(0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01); const __m128i mask = _mm_set1_epi16((int16_t)0xf000); #elif HAS_NEON - static const int8_t pos0_data[] = {-1, 0, -1, 0, -1, 1, -1, 1, -1, 2, -1, 2, -1, 3, -1, 3}; - static const int8_t pos1_data[] = {-1, 4, -1, 4, -1, 5, -1, 5, -1, 6, -1, 6, -1, 7, -1, 7}; - static const int16_t mult_data[] = {0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10}; - static const int16_t table_prefix_data[] = {0, 0, 0, 0, 0, 0, 0, 1 << 11}; + static const int8_t pos0_data[] = { -1, 0, -1, 0, -1, 1, -1, 1, -1, 2, -1, 2, -1, 3, -1, 3 }; + static const int8_t pos1_data[] = { -1, 4, -1, 4, -1, 5, -1, 5, -1, 6, -1, 6, -1, 7, -1, 7 }; + static const int16_t mult_data[] = { 0x01, 0x10, 0x01, 0x10, 0x01, 0x10, 0x01, 0x10 }; + static const int16_t table_prefix_data[] = { 0, 0, 0, 0, 0, 0, 0, 1 << 11 }; const int8x16_t pos0 = vld1q_s8(pos0_data); const int8x16_t pos1 = vld1q_s8(pos1_data); const int16x8_t mult = vld1q_s16(mult_data); const int16x8_t mask = vdupq_n_s16((int16_t)0xf000); const int16x8_t table_prefix = vld1q_s16(table_prefix_data); #endif - uint8_t *in = BUF_U8(rspa.in); - int16_t *out = BUF_S16(rspa.out); + uint8_t* in = BUF_U8(rspa.in); + int16_t* out = BUF_S16(rspa.out); int nbytes = ROUND_UP_32(rspa.nbytes); if (flags & A_INIT) { memset(out, 0, 16 * sizeof(int16_t)); @@ -311,7 +301,7 @@ void aADPCMdecImpl(uint8_t flags, ADPCM_STATE state) { int16x8_t result = vld1q_s16(out - 8); #endif while (nbytes > 0) { - int shift = *in >> 4; // should be in 0..12 + int shift = *in >> 4; // should be in 0..12 int table_index = *in++ & 0xf; // should be in 0..7 int16_t (*tbl)[8] = rspa.adpcm_table[table_index]; int i; @@ -319,11 +309,12 @@ void aADPCMdecImpl(uint8_t flags, ADPCM_STATE state) { // The _mm_loadu_si64 instruction was added in GCC 9, and results in the same // asm as the following instructions, so better be compatible with old GCC. //__m128i inv = _mm_loadu_si64(in); - uint64_t v; memcpy(&v, in, 8); + uint64_t v; + memcpy(&v, in, 8); __m128i inv = _mm_set_epi64x(0, v); - __m128i invec[2] = {_mm_shuffle_epi8(inv, pos0), _mm_shuffle_epi8(inv, pos1)}; - __m128i tblvec0 = _mm_loadu_si128((const __m128i *)tbl[0]); - __m128i tblvec1 = _mm_loadu_si128((const __m128i *)(tbl[1])); + __m128i invec[2] = { _mm_shuffle_epi8(inv, pos0), _mm_shuffle_epi8(inv, pos1) }; + __m128i tblvec0 = _mm_loadu_si128((const __m128i*)tbl[0]); + __m128i tblvec1 = _mm_loadu_si128((const __m128i*)(tbl[1])); __m128i tbllo = _mm_unpacklo_epi16(tblvec0, tblvec1); __m128i tblhi = _mm_unpackhi_epi16(tblvec0, tblvec1); __m128i shiftcount = _mm_set_epi64x(0, 12 - shift); // _mm_cvtsi64_si128 does not exist on 32-bit x86 @@ -354,25 +345,27 @@ void aADPCMdecImpl(uint8_t flags, ADPCM_STATE state) { muls[1] = _mm_madd_epi16(tblvec1_rev[6], invec[i]); muls[0] = _mm_madd_epi16(tblvec1_rev[7], invec[i]); - acc0 = _mm_add_epi32(acc0, _mm_hadd_epi32(_mm_hadd_epi32(muls[0], muls[1]), _mm_hadd_epi32(muls[2], muls[3]))); - acc1 = _mm_add_epi32(acc1, _mm_hadd_epi32(_mm_hadd_epi32(muls[4], muls[5]), _mm_hadd_epi32(muls[6], muls[7]))); + acc0 = + _mm_add_epi32(acc0, _mm_hadd_epi32(_mm_hadd_epi32(muls[0], muls[1]), _mm_hadd_epi32(muls[2], muls[3]))); + acc1 = + _mm_add_epi32(acc1, _mm_hadd_epi32(_mm_hadd_epi32(muls[4], muls[5]), _mm_hadd_epi32(muls[6], muls[7]))); acc0 = _mm_srai_epi32(acc0, 11); acc1 = _mm_srai_epi32(acc1, 11); result = _mm_packs_epi32(acc0, acc1); - _mm_storeu_si128((__m128i *)out, result); + _mm_storeu_si128((__m128i*)out, result); out += 8; prev_interleaved = _mm_shuffle_epi32(result, _MM_SHUFFLE(3, 3, 3, 3)); } #elif HAS_NEON - int8x8_t inv = vld1_s8((int8_t *)in); - int16x8_t tblvec[2] = {vld1q_s16(tbl[0]), vld1q_s16(tbl[1])}; - int16x8_t invec[2] = {vreinterpretq_s16_s8(vcombine_s8(vtbl1_s8(inv, vget_low_s8(pos0)), - vtbl1_s8(inv, vget_high_s8(pos0)))), - vreinterpretq_s16_s8(vcombine_s8(vtbl1_s8(inv, vget_low_s8(pos1)), - vtbl1_s8(inv, vget_high_s8(pos1))))}; + int8x8_t inv = vld1_s8((int8_t*)in); + int16x8_t tblvec[2] = { vld1q_s16(tbl[0]), vld1q_s16(tbl[1]) }; + int16x8_t invec[2] = { + vreinterpretq_s16_s8(vcombine_s8(vtbl1_s8(inv, vget_low_s8(pos0)), vtbl1_s8(inv, vget_high_s8(pos0)))), + vreinterpretq_s16_s8(vcombine_s8(vtbl1_s8(inv, vget_low_s8(pos1)), vtbl1_s8(inv, vget_high_s8(pos1)))) + }; int16x8_t shiftcount = vdupq_n_s16(shift - 12); // negative means right shift int16x8_t tblvec1[8]; @@ -444,15 +437,15 @@ void aADPCMdecImpl(uint8_t flags, ADPCM_STATE state) { } void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { - int16_t tmp[16] = {0}; - int16_t *in_initial = BUF_S16(rspa.in); - int16_t *in = in_initial; - int16_t *out = BUF_S16(rspa.out); + int16_t tmp[16] = { 0 }; + int16_t* in_initial = BUF_S16(rspa.in); + int16_t* in = in_initial; + int16_t* out = BUF_S16(rspa.out); int nbytes = ROUND_UP_16(rspa.nbytes); uint32_t pitch_accumulator = 0; int i = 0; #if !HAS_SSE41 && !HAS_NEON - int16_t *tbl = NULL; + int16_t* tbl = NULL; int32_t sample = 0; #endif if (flags & A_INIT) { @@ -479,9 +472,9 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { __m128i acc_b = _mm_add_epi32(_mm_unpackhi_epi16(pl, ph), pitchacclo_vec); do { - __m128i tbl_positions = _mm_srli_epi16(_mm_packus_epi32( - _mm_and_si128(acc_a, _mm_set1_epi32(0xffff)), - _mm_and_si128(acc_b, _mm_set1_epi32(0xffff))), 10); + __m128i tbl_positions = _mm_srli_epi16(_mm_packus_epi32(_mm_and_si128(acc_a, _mm_set1_epi32(0xffff)), + _mm_and_si128(acc_b, _mm_set1_epi32(0xffff))), + 10); __m128i in_positions = _mm_packus_epi32(_mm_srli_epi32(acc_a, 16), _mm_srli_epi32(acc_b, 16)); __m128i tbl_entries[4]; @@ -496,10 +489,14 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { (const double *)&in[_mm_extract_epi16(in_positions, 2 * i + 1)])); samples[i] = _mm_mulhrs_epi16(samples[i], tbl_entries[i]); }*/ - tbl_entries[0] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 0)], resample_table[_mm_extract_epi16(tbl_positions, 1)]); - tbl_entries[1] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 2)], resample_table[_mm_extract_epi16(tbl_positions, 3)]); - tbl_entries[2] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 4)], resample_table[_mm_extract_epi16(tbl_positions, 5)]); - tbl_entries[3] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 6)], resample_table[_mm_extract_epi16(tbl_positions, 7)]); + tbl_entries[0] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 0)], + resample_table[_mm_extract_epi16(tbl_positions, 1)]); + tbl_entries[1] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 2)], + resample_table[_mm_extract_epi16(tbl_positions, 3)]); + tbl_entries[2] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 4)], + resample_table[_mm_extract_epi16(tbl_positions, 5)]); + tbl_entries[3] = LOADLH(resample_table[_mm_extract_epi16(tbl_positions, 6)], + resample_table[_mm_extract_epi16(tbl_positions, 7)]); samples[0] = LOADLH(&in[_mm_extract_epi16(in_positions, 0)], &in[_mm_extract_epi16(in_positions, 1)]); samples[1] = LOADLH(&in[_mm_extract_epi16(in_positions, 2)], &in[_mm_extract_epi16(in_positions, 3)]); samples[2] = LOADLH(&in[_mm_extract_epi16(in_positions, 4)], &in[_mm_extract_epi16(in_positions, 5)]); @@ -509,7 +506,8 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { samples[2] = _mm_mulhrs_epi16(samples[2], tbl_entries[2]); samples[3] = _mm_mulhrs_epi16(samples[3], tbl_entries[3]); - _mm_storeu_si128((__m128i *)out, _mm_hadds_epi16(_mm_hadds_epi16(samples[0], samples[1]), _mm_hadds_epi16(samples[2], samples[3]))); + _mm_storeu_si128((__m128i*)out, _mm_hadds_epi16(_mm_hadds_epi16(samples[0], samples[1]), + _mm_hadds_epi16(samples[2], samples[3]))); acc_a = _mm_add_epi32(acc_a, pitchvec_8_steps); acc_b = _mm_add_epi32(acc_b, pitchvec_8_steps); @@ -519,7 +517,7 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { in += (uint16_t)_mm_extract_epi16(acc_a, 1); pitch_accumulator = (uint16_t)_mm_extract_epi16(acc_a, 0); #elif HAS_NEON - static const uint16_t multiples_data[8] = {0, 2, 4, 6, 8, 10, 12, 14}; + static const uint16_t multiples_data[8] = { 0, 2, 4, 6, 8, 10, 12, 14 }; uint16x8_t multiples = vld1q_u16(multiples_data); uint32x4_t pitchvec_8_steps = vdupq_n_u32((pitch << 1) * 8); uint32x4_t pitchacclo_vec = vdupq_n_u32((uint16_t)pitch_accumulator); @@ -535,14 +533,22 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { int16x8x2_t unzipped1; int16x8x2_t unzipped2; - tbl_entries[0] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 0)]), vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 1)])); - tbl_entries[1] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 2)]), vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 3)])); - tbl_entries[2] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 4)]), vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 5)])); - tbl_entries[3] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 6)]), vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 7)])); - samples[0] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 0)]), vld1_s16(&in[vgetq_lane_u16(in_positions, 1)])); - samples[1] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 2)]), vld1_s16(&in[vgetq_lane_u16(in_positions, 3)])); - samples[2] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 4)]), vld1_s16(&in[vgetq_lane_u16(in_positions, 5)])); - samples[3] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 6)]), vld1_s16(&in[vgetq_lane_u16(in_positions, 7)])); + tbl_entries[0] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 0)]), + vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 1)])); + tbl_entries[1] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 2)]), + vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 3)])); + tbl_entries[2] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 4)]), + vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 5)])); + tbl_entries[3] = vcombine_s16(vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 6)]), + vld1_s16(resample_table[vgetq_lane_u16(tbl_positions, 7)])); + samples[0] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 0)]), + vld1_s16(&in[vgetq_lane_u16(in_positions, 1)])); + samples[1] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 2)]), + vld1_s16(&in[vgetq_lane_u16(in_positions, 3)])); + samples[2] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 4)]), + vld1_s16(&in[vgetq_lane_u16(in_positions, 5)])); + samples[3] = vcombine_s16(vld1_s16(&in[vgetq_lane_u16(in_positions, 6)]), + vld1_s16(&in[vgetq_lane_u16(in_positions, 7)])); samples[0] = vqrdmulhq_s16(samples[0], tbl_entries[0]); samples[1] = vqrdmulhq_s16(samples[1], tbl_entries[1]); samples[2] = vqrdmulhq_s16(samples[2], tbl_entries[2]); @@ -568,10 +574,8 @@ void aResampleImpl(uint8_t flags, uint16_t pitch, RESAMPLE_STATE state) { do { for (i = 0; i < 8; i++) { tbl = resample_table[pitch_accumulator * 64 >> 16]; - sample = ((in[0] * tbl[0] + 0x4000) >> 15) + - ((in[1] * tbl[1] + 0x4000) >> 15) + - ((in[2] * tbl[2] + 0x4000) >> 15) + - ((in[3] * tbl[3] + 0x4000) >> 15); + sample = ((in[0] * tbl[0] + 0x4000) >> 15) + ((in[1] * tbl[1] + 0x4000) >> 15) + + ((in[2] * tbl[2] + 0x4000) >> 15) + ((in[3] * tbl[3] + 0x4000) >> 15); *out++ = clamp16(sample); pitch_accumulator += (pitch << 1); @@ -606,30 +610,30 @@ void aEnvSetup2Impl(uint16_t initial_vol_left, uint16_t initial_vol_right) { rspa.vol[1] = initial_vol_right; } -void aEnvMixerImpl(uint16_t in_addr, uint16_t n_samples, bool swap_reverb, - bool neg_left, bool neg_right, - uint16_t dry_left_addr, uint16_t dry_right_addr, - uint16_t wet_left_addr, uint16_t wet_right_addr) -{ - int16_t *in = BUF_S16(in_addr); - int16_t *dry[2] = {BUF_S16(dry_left_addr), BUF_S16(dry_right_addr)}; - int16_t *wet[2] = {BUF_S16(wet_left_addr), BUF_S16(wet_right_addr)}; - int16_t negs[2] = {neg_left ? -1 : 0, neg_right ? -1 : 0}; - int swapped[2] = {swap_reverb ? 1 : 0, swap_reverb ? 0 : 1}; +void aEnvMixerImpl(uint16_t in_addr, uint16_t n_samples, bool swap_reverb, bool neg_left, bool neg_right, + uint16_t dry_left_addr, uint16_t dry_right_addr, uint16_t wet_left_addr, uint16_t wet_right_addr) { + int16_t* in = BUF_S16(in_addr); + int16_t* dry[2] = { BUF_S16(dry_left_addr), BUF_S16(dry_right_addr) }; + int16_t* wet[2] = { BUF_S16(wet_left_addr), BUF_S16(wet_right_addr) }; + int16_t negs[2] = { neg_left ? -1 : 0, neg_right ? -1 : 0 }; + int swapped[2] = { swap_reverb ? 1 : 0, swap_reverb ? 0 : 1 }; int n = ROUND_UP_16(n_samples); - uint16_t vols[2] = {rspa.vol[0], rspa.vol[1]}; - uint16_t rates[2] = {rspa.rate[0], rspa.rate[1]}; + uint16_t vols[2] = { rspa.vol[0], rspa.vol[1] }; + uint16_t rates[2] = { rspa.rate[0], rspa.rate[1] }; uint16_t vol_wet = rspa.vol_wet; uint16_t rate_wet = rspa.rate_wet; do { for (int i = 0; i < 8; i++) { - int16_t samples[2] = {*in, *in}; in++; + int16_t samples[2] = { *in, *in }; + in++; for (int j = 0; j < 2; j++) { samples[j] = (samples[j] * vols[j] >> 16) ^ negs[j]; - *dry[j] = clamp16(*dry[j] + samples[j]); dry[j]++; - *wet[j] = clamp16(*wet[j] + (samples[swapped[j]] * vol_wet >> 16)); wet[j]++; + *dry[j] = clamp16(*dry[j] + samples[j]); + dry[j]++; + *wet[j] = clamp16(*wet[j] + (samples[swapped[j]] * vol_wet >> 16)); + wet[j]++; } } vols[0] += rates[0]; @@ -641,9 +645,9 @@ void aEnvMixerImpl(uint16_t in_addr, uint16_t n_samples, bool swap_reverb, } #else void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { - int16_t *in = BUF_S16(rspa.in); - int16_t *dry[2] = {BUF_S16(rspa.out), BUF_S16(rspa.dry_right)}; - int16_t *wet[2] = {BUF_S16(rspa.wet_left), BUF_S16(rspa.wet_right)}; + int16_t* in = BUF_S16(rspa.in); + int16_t* dry[2] = { BUF_S16(rspa.out), BUF_S16(rspa.dry_right) }; + int16_t* wet[2] = { BUF_S16(rspa.wet_left), BUF_S16(rspa.wet_right) }; int nbytes = ROUND_UP_16(rspa.nbytes); #if HAS_SSE41 @@ -659,9 +663,9 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { int c; if (flags & A_INIT) { - float vol_init[2] = {rspa.vol[0], rspa.vol[1]}; - float rate_float[2] = {(float)rspa.rate[0] * (1.0f / 65536.0f), (float)rspa.rate[1] * (1.0f / 65536.0f)}; - float step_diff[2] = {vol_init[0] * (rate_float[0] - 1.0f), vol_init[1] * (rate_float[1] - 1.0f)}; + float vol_init[2] = { rspa.vol[0], rspa.vol[1] }; + float rate_float[2] = { (float)rspa.rate[0] * (1.0f / 65536.0f), (float)rspa.rate[1] * (1.0f / 65536.0f) }; + float step_diff[2] = { vol_init[0] * (rate_float[0] - 1.0f), vol_init[1] * (rate_float[1] - 1.0f) }; for (c = 0; c < 2; c++) { vols[c][0] = _mm_add_ps( @@ -687,10 +691,10 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { state[39] = rspa.vol_wet; } else { float floats[2]; - vols[0][0] = _mm_loadu_ps((const float *)state); - vols[0][1] = _mm_loadu_ps((const float *)(state + 8)); - vols[1][0] = _mm_loadu_ps((const float *)(state + 16)); - vols[1][1] = _mm_loadu_ps((const float *)(state + 24)); + vols[0][0] = _mm_loadu_ps((const float*)state); + vols[0][1] = _mm_loadu_ps((const float*)(state + 8)); + vols[1][0] = _mm_loadu_ps((const float*)(state + 16)); + vols[1][1] = _mm_loadu_ps((const float*)(state + 24)); memcpy(floats, state + 32, 8); rate[0] = _mm_set1_ps(floats[0]); rate[1] = _mm_set1_ps(floats[1]); @@ -702,7 +706,7 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { wet_factor = _mm_set1_epi16(state[39]); } do { - in_loaded = _mm_loadu_si128((const __m128i *)in); + in_loaded = _mm_loadu_si128((const __m128i*)in); in += 8; for (c = 0; c < 2; c++) { if (increasing[c]) { @@ -714,17 +718,15 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { } vol_s16 = _mm_packs_epi32(_mm_cvtps_epi32(vols[c][0]), _mm_cvtps_epi32(vols[c][1])); - _mm_storeu_si128((__m128i *)dry[c], - _mm_adds_epi16( - _mm_loadu_si128((const __m128i *)dry[c]), - _mm_mulhrs_epi16(in_loaded, _mm_mulhrs_epi16(vol_s16, dry_factor)))); + _mm_storeu_si128((__m128i*)dry[c], + _mm_adds_epi16(_mm_loadu_si128((const __m128i*)dry[c]), + _mm_mulhrs_epi16(in_loaded, _mm_mulhrs_epi16(vol_s16, dry_factor)))); dry[c] += 8; if (flags & A_AUX) { - _mm_storeu_si128((__m128i *)wet[c], - _mm_adds_epi16( - _mm_loadu_si128((const __m128i *)wet[c]), - _mm_mulhrs_epi16(in_loaded, _mm_mulhrs_epi16(vol_s16, wet_factor)))); + _mm_storeu_si128((__m128i*)wet[c], + _mm_adds_epi16(_mm_loadu_si128((const __m128i*)wet[c]), + _mm_mulhrs_epi16(in_loaded, _mm_mulhrs_epi16(vol_s16, wet_factor)))); wet[c] += 8; } @@ -735,10 +737,10 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { nbytes -= 8 * sizeof(int16_t); } while (nbytes > 0); - _mm_storeu_ps((float *)state, vols[0][0]); - _mm_storeu_ps((float *)(state + 8), vols[0][1]); - _mm_storeu_ps((float *)(state + 16), vols[1][0]); - _mm_storeu_ps((float *)(state + 24), vols[1][1]); + _mm_storeu_ps((float*)state, vols[0][0]); + _mm_storeu_ps((float*)(state + 8), vols[0][1]); + _mm_storeu_ps((float*)(state + 16), vols[1][0]); + _mm_storeu_ps((float*)(state + 24), vols[1][1]); #elif HAS_NEON float32x4_t vols[2][2]; int16_t dry_factor; @@ -752,12 +754,12 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { int c; if (flags & A_INIT) { - float vol_init[2] = {rspa.vol[0], rspa.vol[1]}; - float rate_float[2] = {(float)rspa.rate[0] * (1.0f / 65536.0f), (float)rspa.rate[1] * (1.0f / 65536.0f)}; - float step_diff[2] = {vol_init[0] * (rate_float[0] - 1.0f), vol_init[1] * (rate_float[1] - 1.0f)}; - static const float step_dividers_data[2][4] = {{1.0f / 8.0f, 2.0f / 8.0f, 3.0f / 8.0f, 4.0f / 8.0f}, - {5.0f / 8.0f, 6.0f / 8.0f, 7.0f / 8.0f, 8.0f / 8.0f}}; - float32x4_t step_dividers[2] = {vld1q_f32(step_dividers_data[0]), vld1q_f32(step_dividers_data[1])}; + float vol_init[2] = { rspa.vol[0], rspa.vol[1] }; + float rate_float[2] = { (float)rspa.rate[0] * (1.0f / 65536.0f), (float)rspa.rate[1] * (1.0f / 65536.0f) }; + float step_diff[2] = { vol_init[0] * (rate_float[0] - 1.0f), vol_init[1] * (rate_float[1] - 1.0f) }; + static const float step_dividers_data[2][4] = { { 1.0f / 8.0f, 2.0f / 8.0f, 3.0f / 8.0f, 4.0f / 8.0f }, + { 5.0f / 8.0f, 6.0f / 8.0f, 7.0f / 8.0f, 8.0f / 8.0f } }; + float32x4_t step_dividers[2] = { vld1q_f32(step_dividers_data[0]), vld1q_f32(step_dividers_data[1]) }; for (c = 0; c < 2; c++) { vols[c][0] = vaddq_f32(vdupq_n_f32(vol_init[c]), vmulq_n_f32(step_dividers[0], step_diff[c])); @@ -804,10 +806,12 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { } vol_s16 = vcombine_s16(vqmovn_s32(vcvtq_s32_f32(vols[c][0])), vqmovn_s32(vcvtq_s32_f32(vols[c][1]))); - vst1q_s16(dry[c], vqaddq_s16(vld1q_s16(dry[c]), vqrdmulhq_s16(in_loaded, vqrdmulhq_n_s16(vol_s16, dry_factor)))); + vst1q_s16(dry[c], + vqaddq_s16(vld1q_s16(dry[c]), vqrdmulhq_s16(in_loaded, vqrdmulhq_n_s16(vol_s16, dry_factor)))); dry[c] += 8; if (flags & A_AUX) { - vst1q_s16(wet[c], vqaddq_s16(vld1q_s16(wet[c]), vqrdmulhq_s16(in_loaded, vqrdmulhq_n_s16(vol_s16, wet_factor)))); + vst1q_s16(wet[c], vqaddq_s16(vld1q_s16(wet[c]), + vqrdmulhq_s16(in_loaded, vqrdmulhq_n_s16(vol_s16, wet_factor)))); wet[c] += 8; } vols[c][0] = vmulq_n_f32(vols[c][0], rate[c]); @@ -870,9 +874,11 @@ void aEnvMixerImpl(uint8_t flags, ENVMIX_STATE state) { vols[c][i] = target[c] << 16; } } - dry[c][i] = clamp16((dry[c][i] * 0x7fff + in[i] * (((vols[c][i] >> 16) * vol_dry + 0x4000) >> 15) + 0x4000) >> 15); + dry[c][i] = clamp16( + (dry[c][i] * 0x7fff + in[i] * (((vols[c][i] >> 16) * vol_dry + 0x4000) >> 15) + 0x4000) >> 15); if (flags & A_AUX) { - wet[c][i] = clamp16((wet[c][i] * 0x7fff + in[i] * (((vols[c][i] >> 16) * vol_wet + 0x4000) >> 15) + 0x4000) >> 15); + wet[c][i] = clamp16( + (wet[c][i] * 0x7fff + in[i] * (((vols[c][i] >> 16) * vol_wet + 0x4000) >> 15) + 0x4000) >> 15); } vols[c][i] = clamp32((int64_t)vols[c][i] * rate[c] >> 16); } @@ -908,8 +914,8 @@ void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr, uint16_t count) void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr) { int nbytes = ROUND_UP_32(rspa.nbytes); #endif - int16_t *in = BUF_S16(in_addr); - int16_t *out = BUF_S16(out_addr); + int16_t* in = BUF_S16(in_addr); + int16_t* out = BUF_S16(out_addr); #if HAS_SSE41 __m128i gain_vec = _mm_set1_epi16(gain); #elif !HAS_NEON @@ -922,16 +928,16 @@ void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr) { while (nbytes > 0) { #if HAS_SSE41 __m128i out1, out2, in1, in2; - out1 = _mm_loadu_si128((const __m128i *)out); - out2 = _mm_loadu_si128((const __m128i *)(out + 8)); - in1 = _mm_loadu_si128((const __m128i *)in); - in2 = _mm_loadu_si128((const __m128i *)(in + 8)); + out1 = _mm_loadu_si128((const __m128i*)out); + out2 = _mm_loadu_si128((const __m128i*)(out + 8)); + in1 = _mm_loadu_si128((const __m128i*)in); + in2 = _mm_loadu_si128((const __m128i*)(in + 8)); out1 = _mm_subs_epi16(out1, in1); out2 = _mm_subs_epi16(out2, in2); - _mm_storeu_si128((__m128i *)out, out1); - _mm_storeu_si128((__m128i *)(out + 8), out2); + _mm_storeu_si128((__m128i*)out, out1); + _mm_storeu_si128((__m128i*)(out + 8), out2); out += 16; in += 16; @@ -950,16 +956,16 @@ void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr) { while (nbytes > 0) { #if HAS_SSE41 __m128i out1, out2, in1, in2; - out1 = _mm_loadu_si128((const __m128i *)out); - out2 = _mm_loadu_si128((const __m128i *)(out + 8)); - in1 = _mm_loadu_si128((const __m128i *)in); - in2 = _mm_loadu_si128((const __m128i *)(in + 8)); + out1 = _mm_loadu_si128((const __m128i*)out); + out2 = _mm_loadu_si128((const __m128i*)(out + 8)); + in1 = _mm_loadu_si128((const __m128i*)in); + in2 = _mm_loadu_si128((const __m128i*)(in + 8)); out1 = _mm_adds_epi16(out1, _mm_mulhrs_epi16(in1, gain_vec)); out2 = _mm_adds_epi16(out2, _mm_mulhrs_epi16(in2, gain_vec)); - _mm_storeu_si128((__m128i *)out, out1); - _mm_storeu_si128((__m128i *)(out + 8), out2); + _mm_storeu_si128((__m128i*)out, out1); + _mm_storeu_si128((__m128i*)(out + 8), out2); out += 16; in += 16; @@ -979,10 +985,10 @@ void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr) { out += 16; in += 16; #else - for (i = 0; i < 16; i++) { - sample = ((*out * 0x7fff + *in++ * gain) + 0x4000) >> 15; - *out++ = clamp16(sample); - } + for (i = 0; i < 16; i++) { + sample = ((*out * 0x7fff + *in++ * gain) + 0x4000) >> 15; + *out++ = clamp16(sample); + } #endif nbytes -= 16 * sizeof(int16_t); @@ -991,8 +997,8 @@ void aMixImpl(int16_t gain, uint16_t in_addr, uint16_t out_addr) { #ifdef NEW_AUDIO_UCODE void aS8DecImpl(uint8_t flags, ADPCM_STATE state) { - uint8_t *in = BUF_U8(rspa.in); - int16_t *out = BUF_S16(rspa.out); + uint8_t* in = BUF_U8(rspa.in); + int16_t* out = BUF_S16(rspa.out); int nbytes = ROUND_UP_32(rspa.nbytes); if (flags & A_INIT) { memset(out, 0, 16 * sizeof(int16_t)); @@ -1028,35 +1034,51 @@ void aS8DecImpl(uint8_t flags, ADPCM_STATE state) { } void aAddMixerImpl(uint16_t in_addr, uint16_t out_addr, uint16_t count) { - int16_t *in = BUF_S16(in_addr); - int16_t *out = BUF_S16(out_addr); + int16_t* in = BUF_S16(in_addr); + int16_t* out = BUF_S16(out_addr); int nbytes = ROUND_UP_64(ROUND_DOWN_16(count)); do { - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; - *out = clamp16(*out + *in++); out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; + *out = clamp16(*out + *in++); + out++; nbytes -= 16 * sizeof(int16_t); } while (nbytes > 0); } void aDuplicateImpl(uint16_t in_addr, uint16_t out_addr, uint16_t count) { - uint8_t *in = BUF_U8(in_addr); - uint8_t *out = BUF_U8(out_addr); + uint8_t* in = BUF_U8(in_addr); + uint8_t* out = BUF_U8(out_addr); uint8_t tmp[128]; memcpy(tmp, in, 128); @@ -1067,8 +1089,8 @@ void aDuplicateImpl(uint16_t in_addr, uint16_t out_addr, uint16_t count) { } void aDMEMMove2Impl(uint8_t t, uint16_t in_addr, uint16_t out_addr, uint16_t count) { - uint8_t *in = BUF_U8(in_addr); - uint8_t *out = BUF_U8(out_addr); + uint8_t* in = BUF_U8(in_addr); + uint8_t* out = BUF_U8(out_addr); int nbytes = ROUND_UP_32(count); do { @@ -1079,36 +1101,48 @@ void aDMEMMove2Impl(uint8_t t, uint16_t in_addr, uint16_t out_addr, uint16_t cou } void aResampleZohImpl(uint16_t pitch, uint16_t start_fract) { - int16_t *in = BUF_S16(rspa.in); - int16_t *out = BUF_S16(rspa.out); + int16_t* in = BUF_S16(rspa.in); + int16_t* out = BUF_S16(rspa.out); int nbytes = ROUND_UP_8(rspa.nbytes); uint32_t pos = start_fract; uint32_t pitch_add = pitch << 2; do { - *out++ = in[pos >> 17]; pos += pitch_add; - *out++ = in[pos >> 17]; pos += pitch_add; - *out++ = in[pos >> 17]; pos += pitch_add; - *out++ = in[pos >> 17]; pos += pitch_add; + *out++ = in[pos >> 17]; + pos += pitch_add; + *out++ = in[pos >> 17]; + pos += pitch_add; + *out++ = in[pos >> 17]; + pos += pitch_add; + *out++ = in[pos >> 17]; + pos += pitch_add; nbytes -= 4 * sizeof(int16_t); } while (nbytes > 0); } void aDownsampleHalfImpl(uint16_t n_samples, uint16_t in_addr, uint16_t out_addr) { - int16_t *in = BUF_S16(in_addr); - int16_t *out = BUF_S16(out_addr); + int16_t* in = BUF_S16(in_addr); + int16_t* out = BUF_S16(out_addr); int n = ROUND_UP_8(n_samples); do { - *out++ = *in++; in++; - *out++ = *in++; in++; - *out++ = *in++; in++; - *out++ = *in++; in++; - *out++ = *in++; in++; - *out++ = *in++; in++; - *out++ = *in++; in++; - *out++ = *in++; in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; + *out++ = *in++; + in++; n -= 8; } while (n > 0); @@ -1121,7 +1155,7 @@ void aFilterImpl(uint8_t flags, uint16_t count_or_buf, int16_t state_or_filter[8 } else { int16_t tmp[16]; int count = rspa.filter_count; - int16_t *buf = BUF_S16(count_or_buf); + int16_t* buf = BUF_S16(count_or_buf); if (flags == A_INIT) { memset(tmp, 0, 8 * sizeof(int16_t)); @@ -1150,18 +1184,26 @@ void aFilterImpl(uint8_t flags, uint16_t count_or_buf, int16_t state_or_filter[8 } void aHiLoGainImpl(uint8_t g, uint16_t count, uint16_t addr) { - int16_t *samples = BUF_S16(addr); + int16_t* samples = BUF_S16(addr); int nbytes = ROUND_UP_32(count); do { - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; - *samples = clamp16((*samples * g) >> 4); samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; + *samples = clamp16((*samples * g) >> 4); + samples++; nbytes -= 8; } while (nbytes > 0); @@ -1169,8 +1211,8 @@ void aHiLoGainImpl(uint8_t g, uint16_t count, uint16_t addr) { void aUnknown25Impl(uint8_t f, uint16_t count, uint16_t out_addr, uint16_t in_addr) { int nbytes = ROUND_UP_64(count); - int16_t *in = BUF_S16(in_addr + f); - int16_t *out = BUF_S16(out_addr); + int16_t* in = BUF_S16(in_addr + f); + int16_t* out = BUF_S16(out_addr); int16_t tbl[32]; memcpy(tbl, in, 32 * sizeof(int16_t)); diff --git a/src/audio/playback.c b/src/audio/playback.c index 65790fca..7b1c7045 100644 --- a/src/audio/playback.c +++ b/src/audio/playback.c @@ -10,16 +10,16 @@ #include "effects.h" #include "external.h" -void note_set_resampling_rate(struct Note *note, f32 resamplingRateInput); +void note_set_resampling_rate(struct Note* note, f32 resamplingRateInput); #if defined(VERSION_EU) || defined(VERSION_SH) #ifdef VERSION_SH -void note_set_vel_pan_reverb(struct Note *note, struct ReverbInfo *reverbInfo) +void note_set_vel_pan_reverb(struct Note* note, struct ReverbInfo* reverbInfo) #else -void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbVol) +void note_set_vel_pan_reverb(struct Note* note, f32 velocity, u8 pan, u8 reverbVol) #endif { - struct NoteSubEu *sub = ¬e->noteSubEu; + struct NoteSubEu* sub = ¬e->noteSubEu; f32 volRight, volLeft; u8 strongRight; u8 strongLeft; @@ -127,8 +127,8 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV velocity = 1.0f; } - sub->targetVolLeft = ((s32) (velocity * volLeft * 4095.999f)); - sub->targetVolRight = ((s32) (velocity * volRight * 4095.999f)); + sub->targetVolLeft = ((s32)(velocity * volLeft * 4095.999f)); + sub->targetVolRight = ((s32)(velocity * volRight * 4095.999f)); sub->synthesisVolume = reverbInfo->synthesisVolume; sub->filter = reverbInfo->filter; #else @@ -141,8 +141,8 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV velocity = 32767.f; } - sub->targetVolLeft = ((s32) (velocity * volLeft) & 0xffff) >> 5; - sub->targetVolRight = ((s32) (velocity * volRight) & 0xffff) >> 5; + sub->targetVolLeft = ((s32)(velocity * volLeft) & 0xffff) >> 5; + sub->targetVolRight = ((s32)(velocity * volRight) & 0xffff) >> 5; #endif //! @bug for the change to UQ0.7, the if statement should also have been changed accordingly @@ -169,9 +169,9 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, u8 pan, u8 reverbV #define MIN_RESAMPLING_RATE 1.99996f #endif -void note_set_resampling_rate(struct Note *note, f32 resamplingRateInput) { +void note_set_resampling_rate(struct Note* note, f32 resamplingRateInput) { f32 resamplingRate = 0.0f; - struct NoteSubEu *tempSub = ¬e->noteSubEu; + struct NoteSubEu* tempSub = ¬e->noteSubEu; #ifdef VERSION_EU if (resamplingRateInput < 0.0f) { @@ -196,12 +196,12 @@ void note_set_resampling_rate(struct Note *note, f32 resamplingRateInput) { resamplingRate = resamplingRateInput * 0.5f; } } - note->noteSubEu.resamplingRateFixedPoint = (s32) (resamplingRate * 32768.0f); + note->noteSubEu.resamplingRateFixedPoint = (s32)(resamplingRate * 32768.0f); } #ifdef VERSION_EU -struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instrument, s32 semitone) { - struct AudioBankSound *sound; +struct AudioBankSound* instrument_get_audio_bank_sound(struct Instrument* instrument, s32 semitone) { + struct AudioBankSound* sound; if (semitone < instrument->normalRangeLo) { sound = &instrument->lowNotesSound; } else if (semitone <= instrument->normalRangeHi) { @@ -212,8 +212,8 @@ struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instru return sound; } -struct Instrument *get_instrument_inner(s32 bankId, s32 instId) { - struct Instrument *inst; +struct Instrument* get_instrument_inner(s32 bankId, s32 instId) { + struct Instrument* inst; if (IS_BANK_LOAD_COMPLETE(bankId) == FALSE) { stubbed_printf("Audio: voiceman: No bank error %d\n", bankId); @@ -222,8 +222,7 @@ struct Instrument *get_instrument_inner(s32 bankId, s32 instId) { } if (instId >= gCtlEntries[bankId].numInstruments) { - stubbed_printf("Audio: voiceman: progNo. overflow %d,%d\n", - instId, gCtlEntries[bankId].numInstruments); + stubbed_printf("Audio: voiceman: progNo. overflow %d,%d\n", instId, gCtlEntries[bankId].numInstruments); gAudioErrorFlags = ((bankId << 8) + instId) + 0x3000000; return NULL; } @@ -236,12 +235,11 @@ struct Instrument *get_instrument_inner(s32 bankId, s32 instId) { } #ifdef VERSION_EU - if (((uintptr_t) gBankLoadedPool.persistent.pool.start <= (uintptr_t) inst - && (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.persistent.pool.start - + gBankLoadedPool.persistent.pool.size)) - || ((uintptr_t) gBankLoadedPool.temporary.pool.start <= (uintptr_t) inst - && (uintptr_t) inst <= (uintptr_t)(gBankLoadedPool.temporary.pool.start - + gBankLoadedPool.temporary.pool.size))) { + if (((uintptr_t)gBankLoadedPool.persistent.pool.start <= (uintptr_t)inst && + (uintptr_t)inst <= + (uintptr_t)(gBankLoadedPool.persistent.pool.start + gBankLoadedPool.persistent.pool.size)) || + ((uintptr_t)gBankLoadedPool.temporary.pool.start <= (uintptr_t)inst && + (uintptr_t)inst <= (uintptr_t)(gBankLoadedPool.temporary.pool.start + gBankLoadedPool.temporary.pool.size))) { return inst; } @@ -253,8 +251,8 @@ struct Instrument *get_instrument_inner(s32 bankId, s32 instId) { #endif } -struct Drum *get_drum(s32 bankId, s32 drumId) { - struct Drum *drum; +struct Drum* get_drum(s32 bankId, s32 drumId) { + struct Drum* drum; #ifdef VERSION_SH if (IS_BANK_LOAD_COMPLETE(bankId) == FALSE) { @@ -265,13 +263,11 @@ struct Drum *get_drum(s32 bankId, s32 drumId) { #endif if (drumId >= gCtlEntries[bankId].numDrums) { - stubbed_printf("Audio: voiceman: Percussion Overflow %d,%d\n", - drumId, gCtlEntries[bankId].numDrums); + stubbed_printf("Audio: voiceman: Percussion Overflow %d,%d\n", drumId, gCtlEntries[bankId].numDrums); gAudioErrorFlags = ((bankId << 8) + drumId) + 0x4000000; return NULL; } - drum = gCtlEntries[bankId].drums[drumId]; if (drum == NULL) { stubbed_printf("Audio: voiceman: Percpointer NULL %d,%d\n", bankId, drumId); @@ -283,12 +279,12 @@ struct Drum *get_drum(s32 bankId, s32 drumId) { #endif // VERSION_EU #if defined(VERSION_EU) || defined(VERSION_SH) -void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer); +void note_init_for_layer(struct Note* note, struct SequenceChannelLayer* seqLayer); #else -s32 note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer); +s32 note_init_for_layer(struct Note* note, struct SequenceChannelLayer* seqLayer); #endif -void note_init(struct Note *note) { +void note_init(struct Note* note) { if (note->parentLayer->adsr.releaseRate == 0) { adsr_init(¬e->adsr, note->parentLayer->seqChannel->adsr.envelope, ¬e->adsrVolScale); } else { @@ -308,7 +304,7 @@ void note_init(struct Note *note) { #if defined(VERSION_EU) || defined(VERSION_SH) #define note_disable2 note_disable -void note_disable(struct Note *note) { +void note_disable(struct Note* note) { if (note->noteSubEu.needsInit == TRUE) { note->noteSubEu.needsInit = FALSE; } @@ -331,7 +327,7 @@ void note_disable(struct Note *note) { #endif } #else -void note_disable2(struct Note *note) { +void note_disable2(struct Note* note) { note_disable(note); } #endif // VERSION_EU || VERSION_SH @@ -349,10 +345,10 @@ void process_notes(void) { f32 cap; #endif #endif - struct Note *note; + struct Note* note; #if defined(VERSION_EU) || defined(VERSION_SH) - struct NotePlaybackState *playbackState; - struct NoteSubEu *noteSubEu; + struct NotePlaybackState* playbackState; + struct NoteSubEu* noteSubEu; #ifndef VERSION_SH UNUSED u8 pad[12]; u8 reverbVol; @@ -364,28 +360,26 @@ void process_notes(void) { #endif u8 bookOffset; #endif - struct NoteAttributes *attributes; + struct NoteAttributes* attributes; #if defined(VERSION_JP) || defined(VERSION_US) - struct AudioListItem *it; + struct AudioListItem* it; #endif s32 i; // Macro versions of audio_list_push_front and audio_list_remove. // Should ideally be changed to use copt. -#define PREPEND(item, head_arg) \ - ((it = (item), it->prev != NULL) \ - ? it \ - : (it->prev = (head_arg), it->next = (head_arg)->next, (head_arg)->next->prev = it, \ - (head_arg)->next = it, (head_arg)->u.count++, it->pool = (head_arg)->pool, it)) -#define POP(item) \ - ((it = (item), it->prev == NULL) \ - ? it \ - : (it->prev->next = it->next, it->next->prev = it->prev, it->prev = NULL, it)) +#define PREPEND(item, head_arg) \ + ((it = (item), it->prev != NULL) \ + ? it \ + : (it->prev = (head_arg), it->next = (head_arg)->next, (head_arg)->next->prev = it, (head_arg)->next = it, \ + (head_arg)->u.count++, it->pool = (head_arg)->pool, it)) +#define POP(item) \ + ((it = (item), it->prev == NULL) ? it : (it->prev->next = it->next, it->next->prev = it->prev, it->prev = NULL, it)) for (i = 0; i < gMaxSimultaneousNotes; i++) { note = &gNotes[i]; #if defined(VERSION_EU) || defined(VERSION_SH) - playbackState = (struct NotePlaybackState *) ¬e->priority; + playbackState = (struct NotePlaybackState*)¬e->priority; if (note->parentLayer != NO_LAYER) { #ifdef VERSION_SH if (note != playbackState->parentLayer->note && playbackState->unkSH34 == 0) { @@ -403,8 +397,7 @@ void process_notes(void) { playbackState->unkSH34 = 1; continue; } else if (playbackState->parentLayer->seqChannel->seqPlayer->muted && - (playbackState->parentLayer->seqChannel->muteBehavior - & (MUTE_BEHAVIOR_STOP_NOTES))) { + (playbackState->parentLayer->seqChannel->muteBehavior & (MUTE_BEHAVIOR_STOP_NOTES))) { // do nothing } else { goto d; @@ -427,14 +420,14 @@ void process_notes(void) { playbackState->priority = NOTE_PRIORITY_STOPPING; continue; } else if (playbackState->parentLayer->seqChannel->seqPlayer->muted) { - if ((playbackState->parentLayer->seqChannel->muteBehavior - & (MUTE_BEHAVIOR_STOP_SCRIPT | MUTE_BEHAVIOR_STOP_NOTES))) { + if ((playbackState->parentLayer->seqChannel->muteBehavior & + (MUTE_BEHAVIOR_STOP_SCRIPT | MUTE_BEHAVIOR_STOP_NOTES))) { goto c; } } goto d; if (1) { - c: + c: seq_channel_layer_note_release(playbackState->parentLayer); audio_list_remove(¬e->listItem); audio_list_push_front(¬e->listItem.pool->decaying, ¬e->listItem); @@ -444,7 +437,7 @@ void process_notes(void) { continue; } #endif - d: + d: if (playbackState->priority != NOTE_PRIORITY_DISABLED) { #ifdef VERSION_SH if (1) {} @@ -481,8 +474,7 @@ void process_notes(void) { } } #ifndef VERSION_SH - if (1) { - } + if (1) {} #endif } else if (playbackState->adsr.state == ADSR_STATE_DISABLED) { note_disable(note); @@ -513,8 +505,8 @@ void process_notes(void) { reverbInfo.synthesisVolume = playbackState->parentLayer->seqChannel->synthesisVolume; reverbInfo.filter = playbackState->parentLayer->seqChannel->filter; bookOffset = playbackState->parentLayer->seqChannel->bookOffset & 0x7; - if (playbackState->parentLayer->seqChannel->seqPlayer->muted - && (playbackState->parentLayer->seqChannel->muteBehavior & 8)) { + if (playbackState->parentLayer->seqChannel->seqPlayer->muted && + (playbackState->parentLayer->seqChannel->muteBehavior & 8)) { reverbInfo.freqScale = 0.0f; reverbInfo.velocity = 0.0f; } @@ -530,8 +522,7 @@ void process_notes(void) { velocity = attributes->velocity; pan = attributes->pan; reverbVol = attributes->reverbVol; - if (1) { - } + if (1) {} bookOffset = noteSubEu->bookOffset; } else { frequency = playbackState->parentLayer->noteFreqScale; @@ -548,7 +539,7 @@ void process_notes(void) { note_set_vel_pan_reverb(note, velocity, pan, reverbVol); #endif noteSubEu->bookOffset = bookOffset; - skip:; + skip:; } #else if (note->priority != NOTE_PRIORITY_DISABLED) { @@ -563,8 +554,7 @@ void process_notes(void) { PREPEND(¬e->listItem, &gNoteFreeLists.disabled); } else { note_vibrato_init(note); - audio_list_push_back(¬e->listItem.pool->active, - POP(¬e->listItem)); + audio_list_push_back(¬e->listItem.pool->active, POP(¬e->listItem)); note->wantedParentLayer = NO_LAYER; } } else { @@ -620,8 +610,8 @@ void process_notes(void) { #if defined(VERSION_SH) // These three are matching but have been moved from above in shindou: -struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instrument, s32 semitone) { - struct AudioBankSound *sound; +struct AudioBankSound* instrument_get_audio_bank_sound(struct Instrument* instrument, s32 semitone) { + struct AudioBankSound* sound; if (semitone < instrument->normalRangeLo) { sound = &instrument->lowNotesSound; } else if (semitone <= instrument->normalRangeHi) { @@ -631,8 +621,8 @@ struct AudioBankSound *instrument_get_audio_bank_sound(struct Instrument *instru } return sound; } -struct Instrument *get_instrument_inner(s32 bankId, s32 instId) { - struct Instrument *inst; +struct Instrument* get_instrument_inner(s32 bankId, s32 instId) { + struct Instrument* inst; if (IS_BANK_LOAD_COMPLETE(bankId) == FALSE) { gAudioErrorFlags = bankId + 0x10000000; @@ -653,8 +643,8 @@ struct Instrument *get_instrument_inner(s32 bankId, s32 instId) { return inst; } -struct Drum *get_drum(s32 bankId, s32 drumId) { - struct Drum *drum; +struct Drum* get_drum(s32 bankId, s32 drumId) { + struct Drum* drum; if (IS_BANK_LOAD_COMPLETE(bankId) == FALSE) { gAudioErrorFlags = bankId + 0x10000000; @@ -666,7 +656,6 @@ struct Drum *get_drum(s32 bankId, s32 drumId) { return NULL; } - drum = gCtlEntries[bankId].drums[drumId]; if (drum == NULL) { gAudioErrorFlags = ((bankId << 8) + drumId) + 0x5000000; @@ -675,9 +664,9 @@ struct Drum *get_drum(s32 bankId, s32 drumId) { } #endif -void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLayer, s32 target) { - struct Note *note; - struct NoteAttributes *attributes; +void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer* seqLayer, s32 target) { + struct Note* note; + struct NoteAttributes* attributes; if (seqLayer == NO_LAYER) { return; @@ -707,8 +696,8 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa if (note->parentLayer != seqLayer) { #if defined(VERSION_EU) || defined(VERSION_SH) - if (note->parentLayer == NO_LAYER && note->wantedParentLayer == NO_LAYER && - note->prevParentLayer == seqLayer && target != ADSR_STATE_DECAY) { + if (note->parentLayer == NO_LAYER && note->wantedParentLayer == NO_LAYER && note->prevParentLayer == seqLayer && + target != ADSR_STATE_DECAY) { // Just guessing that this printf goes here... it's hard to parse. eu_stubbed_printf_0("Slow Release Batting\n"); note->adsr.fadeOutVel = gAudioBufferParameters.updatesPerFrameInv; @@ -765,7 +754,8 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa note->adsr.action |= ADSR_ACTION_DECAY; #if defined(VERSION_EU) || defined(VERSION_SH) if (seqLayer->adsr.releaseRate == 0) { - note->adsr.fadeOutVel = seqLayer->seqChannel->adsr.releaseRate * gAudioBufferParameters.unkUpdatesPerFrameScaled; + note->adsr.fadeOutVel = + seqLayer->seqChannel->adsr.releaseRate * gAudioBufferParameters.unkUpdatesPerFrameScaled; } else { note->adsr.fadeOutVel = seqLayer->adsr.releaseRate * gAudioBufferParameters.unkUpdatesPerFrameScaled; } @@ -787,16 +777,16 @@ void seq_channel_layer_decay_release_internal(struct SequenceChannelLayer *seqLa } } -void seq_channel_layer_note_decay(struct SequenceChannelLayer *seqLayer) { +void seq_channel_layer_note_decay(struct SequenceChannelLayer* seqLayer) { seq_channel_layer_decay_release_internal(seqLayer, ADSR_STATE_DECAY); } -void seq_channel_layer_note_release(struct SequenceChannelLayer *seqLayer) { +void seq_channel_layer_note_release(struct SequenceChannelLayer* seqLayer) { seq_channel_layer_decay_release_internal(seqLayer, ADSR_STATE_RELEASE); } #if defined(VERSION_EU) || defined(VERSION_SH) -s32 build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLayer, s32 waveId) { +s32 build_synthetic_wave(struct Note* note, struct SequenceChannelLayer* seqLayer, s32 waveId) { f32 freqScale; f32 ratio; u8 sampleCountIndex; @@ -835,7 +825,7 @@ s32 build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLaye } #else -void build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLayer) { +void build_synthetic_wave(struct Note* note, struct SequenceChannelLayer* seqLayer) { s32 i; s32 j; s32 pos; @@ -867,7 +857,7 @@ void build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLay } // Load wave sample - note->instOrWave = (u8) seqLayer->seqChannel->instOrWave; + note->instOrWave = (u8)seqLayer->seqChannel->instOrWave; for (i = -1, pos = 0; pos < 0x40; pos += stepSize) { i++; note->synthesisBuffers->samples[i] = gWaveSamples[seqLayer->seqChannel->instOrWave - 0x80][pos]; @@ -891,7 +881,7 @@ void build_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLay } #endif -void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLayer) { +void init_synthetic_wave(struct Note* note, struct SequenceChannelLayer* seqLayer) { #if defined(VERSION_EU) || defined(VERSION_SH) s32 sampleCountIndex; s32 waveSampleCountIndex; @@ -902,9 +892,13 @@ void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLaye sampleCountIndex = note->sampleCountIndex; waveSampleCountIndex = build_synthetic_wave(note, seqLayer, waveId); #if defined(VERSION_EU) || defined(VERSION_SH) - note->synthesisState.samplePosInt = note->synthesisState.samplePosInt * euUnknownData_8030194c[waveSampleCountIndex] / euUnknownData_8030194c[sampleCountIndex]; + note->synthesisState.samplePosInt = note->synthesisState.samplePosInt * + euUnknownData_8030194c[waveSampleCountIndex] / + euUnknownData_8030194c[sampleCountIndex]; #else // Not a real change. Just temporary so I can remove this variable. - note->synthesisState.samplePosInt = note->synthesisState.samplePosInt * gDefaultShortNoteVelocityTable[waveSampleCountIndex] / gDefaultShortNoteVelocityTable[sampleCountIndex]; + note->synthesisState.samplePosInt = note->synthesisState.samplePosInt * + gDefaultShortNoteVelocityTable[waveSampleCountIndex] / + gDefaultShortNoteVelocityTable[sampleCountIndex]; #endif #else s32 sampleCount = note->sampleCount; @@ -917,13 +911,13 @@ void init_synthetic_wave(struct Note *note, struct SequenceChannelLayer *seqLaye #endif } -void init_note_list(struct AudioListItem *list) { +void init_note_list(struct AudioListItem* list) { list->prev = list; list->next = list; list->u.count = 0; } -void init_note_lists(struct NotePool *pool) { +void init_note_lists(struct NotePool* pool) { init_note_list(&pool->disabled); init_note_list(&pool->decaying); init_note_list(&pool->releasing); @@ -945,11 +939,11 @@ void init_note_free_list(void) { } } -void note_pool_clear(struct NotePool *pool) { +void note_pool_clear(struct NotePool* pool) { s32 i; - struct AudioListItem *source; - struct AudioListItem *cur; - struct AudioListItem *dest; + struct AudioListItem* source; + struct AudioListItem* cur; + struct AudioListItem* dest; UNUSED s32 j; // unused in EU for (i = 0; i < 4; i++) { @@ -1003,12 +997,12 @@ void note_pool_clear(struct NotePool *pool) { } } -void note_pool_fill(struct NotePool *pool, s32 count) { +void note_pool_fill(struct NotePool* pool, s32 count) { s32 i; s32 j; - struct Note *note; - struct AudioListItem *source; - struct AudioListItem *dest; + struct Note* note; + struct AudioListItem* source; + struct AudioListItem* dest; note_pool_clear(pool); @@ -1051,7 +1045,7 @@ void note_pool_fill(struct NotePool *pool, s32 count) { } } -void audio_list_push_front(struct AudioListItem *list, struct AudioListItem *item) { +void audio_list_push_front(struct AudioListItem* list, struct AudioListItem* item) { // add 'item' to the front of the list given by 'list', if it's not in any list if (item->prev != NULL) { eu_stubbed_printf_0("Error:Same List Add\n"); @@ -1065,7 +1059,7 @@ void audio_list_push_front(struct AudioListItem *list, struct AudioListItem *ite } } -void audio_list_remove(struct AudioListItem *item) { +void audio_list_remove(struct AudioListItem* item) { // remove 'item' from the list it's in, if any if (item->prev == NULL) { eu_stubbed_printf_0("Already Cut\n"); @@ -1076,16 +1070,16 @@ void audio_list_remove(struct AudioListItem *item) { } } -struct Note *pop_node_with_lower_prio(struct AudioListItem *list, s32 limit) { - struct AudioListItem *cur = list->next; - struct AudioListItem *best; +struct Note* pop_node_with_lower_prio(struct AudioListItem* list, s32 limit) { + struct AudioListItem* cur = list->next; + struct AudioListItem* best; if (cur == list) { return NULL; } for (best = cur; cur != list; cur = cur->next) { - if (((struct Note *) best->u.value)->priority >= ((struct Note *) cur->u.value)->priority) { + if (((struct Note*)best->u.value)->priority >= ((struct Note*)cur->u.value)->priority) { best = cur; } } @@ -1095,11 +1089,11 @@ struct Note *pop_node_with_lower_prio(struct AudioListItem *list, s32 limit) { return NULL; } - if (limit <= ((struct Note *) best->u.value)->priority) { + if (limit <= ((struct Note*)best->u.value)->priority) { return NULL; } #else - if (limit < ((struct Note *) best->u.value)->priority) { + if (limit < ((struct Note*)best->u.value)->priority) { return NULL; } #endif @@ -1111,10 +1105,10 @@ struct Note *pop_node_with_lower_prio(struct AudioListItem *list, s32 limit) { } #if defined(VERSION_EU) || defined(VERSION_SH) -void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer) { +void note_init_for_layer(struct Note* note, struct SequenceChannelLayer* seqLayer) { UNUSED s32 pad[4]; s16 instId; - struct NoteSubEu *sub = ¬e->noteSubEu; + struct NoteSubEu* sub = ¬e->noteSubEu; note->prevParentLayer = NO_LAYER; note->parentLayer = seqLayer; @@ -1150,7 +1144,7 @@ void note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLaye sub->reverbIndex = seqLayer->seqChannel->reverbIndex & 3; } #else -s32 note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer) { +s32 note_init_for_layer(struct Note* note, struct SequenceChannelLayer* seqLayer) { note->prevParentLayer = NO_LAYER; note->parentLayer = seqLayer; note->priority = seqLayer->seqChannel->notePriority; @@ -1173,12 +1167,12 @@ s32 note_init_for_layer(struct Note *note, struct SequenceChannelLayer *seqLayer } #endif -void func_80319728(struct Note *note, struct SequenceChannelLayer *seqLayer) { +void func_80319728(struct Note* note, struct SequenceChannelLayer* seqLayer) { seq_channel_layer_note_release(note->parentLayer); note->wantedParentLayer = seqLayer; } -void note_release_and_take_ownership(struct Note *note, struct SequenceChannelLayer *seqLayer) { +void note_release_and_take_ownership(struct Note* note, struct SequenceChannelLayer* seqLayer) { note->wantedParentLayer = seqLayer; #ifdef VERSION_SH note->priority = seqLayer->seqChannel->notePriority; @@ -1194,8 +1188,8 @@ void note_release_and_take_ownership(struct Note *note, struct SequenceChannelLa note->adsr.action |= ADSR_ACTION_RELEASE; } -struct Note *alloc_note_from_disabled(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) { - struct Note *note = audio_list_pop_back(&pool->disabled); +struct Note* alloc_note_from_disabled(struct NotePool* pool, struct SequenceChannelLayer* seqLayer) { + struct Note* note = audio_list_pop_back(&pool->disabled); if (note != NULL) { #if defined(VERSION_EU) || defined(VERSION_SH) note_init_for_layer(note, seqLayer); @@ -1210,8 +1204,8 @@ struct Note *alloc_note_from_disabled(struct NotePool *pool, struct SequenceChan return note; } -struct Note *alloc_note_from_decaying(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) { - struct Note *note = audio_list_pop_back(&pool->decaying); +struct Note* alloc_note_from_decaying(struct NotePool* pool, struct SequenceChannelLayer* seqLayer) { + struct Note* note = audio_list_pop_back(&pool->decaying); if (note != NULL) { note_release_and_take_ownership(note, seqLayer); audio_list_push_back(&pool->releasing, ¬e->listItem); @@ -1219,11 +1213,11 @@ struct Note *alloc_note_from_decaying(struct NotePool *pool, struct SequenceChan return note; } -struct Note *alloc_note_from_active(struct NotePool *pool, struct SequenceChannelLayer *seqLayer) { +struct Note* alloc_note_from_active(struct NotePool* pool, struct SequenceChannelLayer* seqLayer) { #ifdef VERSION_SH - struct Note *rNote; + struct Note* rNote; #endif - struct Note *aNote; + struct Note* aNote; #ifdef VERSION_SH s32 rPriority, aPriority; rPriority = aPriority = 0x10; @@ -1268,17 +1262,17 @@ struct Note *alloc_note_from_active(struct NotePool *pool, struct SequenceChanne #endif } -struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) { - struct Note *ret; +struct Note* alloc_note(struct SequenceChannelLayer* seqLayer) { + struct Note* ret; u32 policy = seqLayer->seqChannel->noteAllocPolicy; if (policy & NOTE_ALLOC_LAYER) { ret = seqLayer->note; if (ret != NULL && ret->prevParentLayer == seqLayer #if defined(VERSION_EU) || defined(VERSION_SH) - && ret->wantedParentLayer == NO_LAYER + && ret->wantedParentLayer == NO_LAYER #endif - ) { + ) { note_release_and_take_ownership(ret, seqLayer); audio_list_remove(&ret->listItem); #if defined(VERSION_EU) || defined(VERSION_SH) @@ -1291,9 +1285,9 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) { } if (policy & NOTE_ALLOC_CHANNEL) { - if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer))) { + if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer))) { #ifdef VERSION_SH goto null_return; #else @@ -1306,12 +1300,12 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) { } if (policy & NOTE_ALLOC_SEQ) { - if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_disabled(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) - && !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) - && !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_active(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer))) { + if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_disabled(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) && + !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) && + !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_active(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer))) { #ifdef VERSION_SH goto null_return; #else @@ -1324,9 +1318,9 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) { } if (policy & NOTE_ALLOC_GLOBAL_FREELIST) { - if (!(ret = alloc_note_from_disabled(&gNoteFreeLists, seqLayer)) - && !(ret = alloc_note_from_decaying(&gNoteFreeLists, seqLayer)) - && !(ret = alloc_note_from_active(&gNoteFreeLists, seqLayer))) { + if (!(ret = alloc_note_from_disabled(&gNoteFreeLists, seqLayer)) && + !(ret = alloc_note_from_decaying(&gNoteFreeLists, seqLayer)) && + !(ret = alloc_note_from_active(&gNoteFreeLists, seqLayer))) { #ifdef VERSION_SH goto null_return; #else @@ -1338,15 +1332,15 @@ struct Note *alloc_note(struct SequenceChannelLayer *seqLayer) { return ret; } - if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_disabled(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) - && !(ret = alloc_note_from_disabled(&gNoteFreeLists, seqLayer)) - && !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) - && !(ret = alloc_note_from_decaying(&gNoteFreeLists, seqLayer)) - && !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer)) - && !(ret = alloc_note_from_active(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) - && !(ret = alloc_note_from_active(&gNoteFreeLists, seqLayer))) { + if (!(ret = alloc_note_from_disabled(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_disabled(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) && + !(ret = alloc_note_from_disabled(&gNoteFreeLists, seqLayer)) && + !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_decaying(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) && + !(ret = alloc_note_from_decaying(&gNoteFreeLists, seqLayer)) && + !(ret = alloc_note_from_active(&seqLayer->seqChannel->notePool, seqLayer)) && + !(ret = alloc_note_from_active(&seqLayer->seqChannel->seqPlayer->notePool, seqLayer)) && + !(ret = alloc_note_from_active(&gNoteFreeLists, seqLayer))) { #ifdef VERSION_SH goto null_return; #else @@ -1366,7 +1360,7 @@ null_return: #if defined(VERSION_JP) || defined(VERSION_US) void reclaim_notes(void) { - struct Note *note; + struct Note* note; s32 i; s32 cond; @@ -1384,8 +1378,8 @@ void reclaim_notes(void) { sequence_channel_disable(note->parentLayer->seqChannel); note->priority = NOTE_PRIORITY_STOPPING; } else if (note->parentLayer->seqChannel->seqPlayer->muted) { - if (note->parentLayer->seqChannel->muteBehavior - & (MUTE_BEHAVIOR_STOP_SCRIPT | MUTE_BEHAVIOR_STOP_NOTES)) { + if (note->parentLayer->seqChannel->muteBehavior & + (MUTE_BEHAVIOR_STOP_SCRIPT | MUTE_BEHAVIOR_STOP_NOTES)) { cond = TRUE; } } else { @@ -1404,7 +1398,7 @@ void reclaim_notes(void) { #endif void note_init_all(void) { - struct Note *note; + struct Note* note; s32 i; for (i = 0; i < gMaxSimultaneousNotes; i++) { @@ -1444,7 +1438,8 @@ void note_init_all(void) { note->portamento.cur = 0.0f; note->portamento.speed = 0.0f; #if defined(VERSION_SH) - note->synthesisState.synthesisBuffers = sound_alloc_uninitialized(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers)); + note->synthesisState.synthesisBuffers = + sound_alloc_uninitialized(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers)); #elif defined(VERSION_EU) note->synthesisState.synthesisBuffers = soundAlloc(&gNotesAndBuffersPool, sizeof(struct NoteSynthesisBuffers)); #else diff --git a/src/audio/port_eu.c b/src/audio/port_eu.c index d0423104..682e9eb8 100644 --- a/src/audio/port_eu.c +++ b/src/audio/port_eu.c @@ -24,7 +24,7 @@ typedef s32 FadeT; extern volatile u8 gAudioResetStatus; extern u8 gAudioResetPresetIdToLoad; -extern OSMesgQueue *OSMesgQueues[]; +extern OSMesgQueue* OSMesgQueues[]; extern struct EuAudioCmd sAudioCmd[0x100]; void func_8031D690(s32 player, FadeT fadeInTime); @@ -33,13 +33,13 @@ void decrease_sample_dma_ttls(void); s32 audio_shut_down_and_reset_step(void); void func_802ad7ec(u32); -struct SPTask *create_next_audio_frame_task(void) { +struct SPTask* create_next_audio_frame_task(void) { u32 samplesRemainingInAI; s32 writtenCmds; s32 index; - OSTask_t *task; + OSTask_t* task; s32 flags; - s16 *currAiBuffer; + s16* currAiBuffer; s32 oldDmaCount; OSMesg sp30; OSMesg sp2C; @@ -50,7 +50,7 @@ struct SPTask *create_next_audio_frame_task(void) { return NULL; } - osSendMesg(OSMesgQueues[0], (OSMesg) gAudioFrameCount, 0); + osSendMesg(OSMesgQueues[0], (OSMesg)gAudioFrameCount, 0); gAudioTaskIndex ^= 1; gCurrAiBufferIndex++; @@ -70,14 +70,14 @@ struct SPTask *create_next_audio_frame_task(void) { decrease_sample_dma_ttls(); if (osRecvMesg(OSMesgQueues[2], &sp30, 0) != -1) { - gAudioResetPresetIdToLoad = (u8) (s32) sp30; + 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); + osSendMesg(OSMesgQueues[3], (OSMesg)(s32)gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK); } return NULL; } @@ -88,8 +88,10 @@ struct SPTask *create_next_audio_frame_task(void) { index = gCurrAiBufferIndex; currAiBuffer = gAiBuffers[index]; - gAiBufferLengths[index] = ((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI + - EXTRA_BUFFERED_AI_SAMPLES_TARGET) & ~0xf) + SAMPLES_TO_OVERPRODUCE; + gAiBufferLengths[index] = + ((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI + EXTRA_BUFFERED_AI_SAMPLES_TARGET) & + ~0xf) + + SAMPLES_TO_OVERPRODUCE; if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength) { gAiBufferLengths[index] = gAudioBufferParameters.minAiBufferLength; } @@ -98,7 +100,7 @@ struct SPTask *create_next_audio_frame_task(void) { } if (osRecvMesg(OSMesgQueues[1], &sp2C, OS_MESG_NOBLOCK) != -1) { - func_802ad7ec((u32) sp2C); + func_802ad7ec((u32)sp2C); } flags = 0; @@ -114,7 +116,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) @@ -130,7 +132,7 @@ struct SPTask *create_next_audio_frame_task(void) { return gAudioTask; } -void eu_process_audio_cmd(struct EuAudioCmd *cmd) { +void eu_process_audio_cmd(struct EuAudioCmd* cmd) { s32 i; switch (cmd->u.s.op) { @@ -148,8 +150,7 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) { if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) { if (cmd->u2.as_s32 == 0) { sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]); - } - else { + } else { seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32); } } @@ -177,7 +178,7 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) { const char undefportcmd[] = "Undefined Port Command %d\n"; -extern OSMesgQueue *OSMesgQueues[]; +extern OSMesgQueue* OSMesgQueues[]; extern u8 D_EU_80302010; extern u8 D_EU_80302014; extern OSMesg OSMesg0; @@ -192,7 +193,6 @@ void seq_player_fade_to_zero_volume(s32 player, FadeT fadeOutTime) { gSequencePlayers[player].fadeVelocity = -(gSequencePlayers[player].fadeVolume / fadeOutTime); gSequencePlayers[player].state = 2; gSequencePlayers[player].fadeRemainingFrames = fadeOutTime; - } void func_8031D690(s32 player, FadeT fadeInTime) { @@ -214,19 +214,19 @@ void port_eu_init_queues(void) { osCreateMesgQueue(OSMesgQueues[3], &OSMesg3, 1); } -void func_802ad6f0(s32 arg0, s32 *arg1) { - struct EuAudioCmd *cmd = &sAudioCmd[D_EU_80302010 & 0xff]; +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); + func_802ad6f0(arg0, (s32*)&arg1); } void func_802ad74c(u32 arg0, u32 arg1) { - func_802ad6f0(arg0, (s32*) &arg1); + func_802ad6f0(arg0, (s32*)&arg1); } void func_802ad770(u32 arg0, s8 arg1) { @@ -235,29 +235,27 @@ void func_802ad770(u32 arg0, s8 arg1) { } void func_802ad7a0(void) { - osSendMesg(OSMesgQueues[1], - (OSMesg)(u32)((D_EU_80302014 & 0xff) << 8 | (D_EU_80302010 & 0xff)), - OS_MESG_NOBLOCK); + osSendMesg(OSMesgQueues[1], (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) { - struct EuAudioCmd *cmd; - struct SequencePlayer *seqPlayer; - struct SequenceChannel *chan; + struct EuAudioCmd* cmd; + struct SequencePlayer* seqPlayer; + struct SequenceChannel* chan; u8 end = arg0 & 0xff; u8 i = (arg0 >> 8) & 0xff; for (;;) { - if (i == end) break; + if (i == end) + break; cmd = &sAudioCmd[i++ & 0xff]; if (cmd->u.s.arg1 < SEQUENCE_PLAYERS) { seqPlayer = &gSequencePlayers[cmd->u.s.arg1]; if ((cmd->u.s.op & 0x80) != 0) { eu_process_audio_cmd(cmd); - } - else if ((cmd->u.s.op & 0x40) != 0) { + } else if ((cmd->u.s.op & 0x40) != 0) { switch (cmd->u.s.op) { case 0x41: seqPlayer->fadeVolumeScale = cmd->u2.as_f32; @@ -276,8 +274,7 @@ void func_802ad7ec(u32 arg0) { 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) { diff --git a/src/audio/port_sh.c b/src/audio/port_sh.c index 6485c973..2b1bd75f 100644 --- a/src/audio/port_sh.c +++ b/src/audio/port_sh.c @@ -14,22 +14,22 @@ #define SAMPLES_TO_OVERPRODUCE 0x10 extern s32 D_SH_80314FC8; -extern struct SPTask *D_SH_80314FCC; +extern struct SPTask* D_SH_80314FCC; extern u8 D_SH_80315098; extern u8 D_SH_8031509C; -extern OSMesgQueue *D_SH_80350F68; +extern OSMesgQueue* D_SH_80350F68; void func_8031D690(s32 playerIndex, s32 numFrames); void seq_player_fade_to_zero_volume(s32 arg0, s32 numFrames); void func_802ad7ec(u32 arg0); -struct SPTask *create_next_audio_frame_task(void) { +struct SPTask* create_next_audio_frame_task(void) { u32 samplesRemainingInAI; s32 writtenCmds; s32 index; - OSTask_t *task; + OSTask_t* task; s32 flags; - s16 *currAiBuffer; + s16* currAiBuffer; s32 oldDmaCount; s32 sp38; s32 sp34; @@ -42,7 +42,7 @@ struct SPTask *create_next_audio_frame_task(void) { } return NULL; } - osSendMesg(D_SH_80350F38, (OSMesg) gAudioFrameCount, OS_MESG_NOBLOCK); + osSendMesg(D_SH_80350F38, (OSMesg)gAudioFrameCount, OS_MESG_NOBLOCK); gAudioTaskIndex ^= 1; gCurrAiBufferIndex++; @@ -57,23 +57,22 @@ struct SPTask *create_next_audio_frame_task(void) { } 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 (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); + osSendMesg(D_SH_80350FA8, (OSMesg)(s32)gAudioResetPresetIdToLoad, OS_MESG_NOBLOCK); } D_SH_80314FCC = 0; return NULL; @@ -87,12 +86,14 @@ struct SPTask *create_next_audio_frame_task(void) { } 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); + gAiBufferLengths[index] = (s16)((((gAudioBufferParameters.samplesPerFrameTarget - samplesRemainingInAI) + + EXTRA_BUFFERED_AI_SAMPLES_TARGET) & + ~0xf) + + SAMPLES_TO_OVERPRODUCE); if (gAiBufferLengths[index] < gAudioBufferParameters.minAiBufferLength) { gAiBufferLengths[index] = gAudioBufferParameters.minAiBufferLength; } @@ -100,16 +101,16 @@ struct SPTask *create_next_audio_frame_task(void) { gAiBufferLengths[index] = gAudioBufferParameters.maxAiBufferLength; } - if (osRecvMesg(D_SH_80350F68, (OSMesg *) &sp34, 0) != -1) { + 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; @@ -119,7 +120,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; @@ -146,10 +147,10 @@ struct SPTask *create_next_audio_frame_task(void) { } } -void eu_process_audio_cmd(struct EuAudioCmd *cmd) { +void eu_process_audio_cmd(struct EuAudioCmd* cmd) { s32 i; - struct Note *note; - struct NoteSubEu *sub; + struct Note* note; + struct NoteSubEu* sub; switch (cmd->u.s.op) { case 0x81: @@ -166,8 +167,7 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) { if (gSequencePlayers[cmd->u.s.arg1].enabled != FALSE) { if (cmd->u2.as_s32 == 0) { sequence_player_disable(&gSequencePlayers[cmd->u.s.arg1]); - } - else { + } else { seq_player_fade_to_zero_volume(cmd->u.s.arg1, cmd->u2.as_s32); } } @@ -224,7 +224,7 @@ void eu_process_audio_cmd(struct EuAudioCmd *cmd) { } void seq_player_fade_to_zero_volume(s32 arg0, s32 fadeOutTime) { - struct SequencePlayer *player; + struct SequencePlayer* player; if (fadeOutTime == 0) { fadeOutTime = 1; @@ -232,11 +232,11 @@ void seq_player_fade_to_zero_volume(s32 arg0, s32 fadeOutTime) { 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) { - struct SequencePlayer *player; + struct SequencePlayer* player; if (fadeInTime != 0) { player = &gSequencePlayers[playerIndex]; @@ -262,8 +262,8 @@ void port_eu_init_queues(void) { } extern struct EuAudioCmd sAudioCmd[0x100]; -void func_802ad6f0(s32 arg0, s32 *arg1) { - struct EuAudioCmd *cmd = &sAudioCmd[D_SH_80350F18 & 0xff]; +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++; @@ -273,11 +273,11 @@ void func_802ad6f0(s32 arg0, s32 *arg1) { } void func_802ad728(u32 arg0, f32 arg1) { - func_802ad6f0(arg0, (s32 *) &arg1); + func_802ad6f0(arg0, (s32*)&arg1); } void func_802ad74c(u32 arg0, u32 arg1) { - func_802ad6f0(arg0, (s32 *) &arg1); + func_802ad6f0(arg0, (s32*)&arg1); } void func_802ad770(u32 arg0, s8 arg1) { @@ -304,9 +304,9 @@ void func_sh_802f6540(void) { } void func_802ad7ec(u32 arg0) { - struct EuAudioCmd *cmd; - struct SequencePlayer *seqPlayer; - struct SequenceChannel *chan; + struct EuAudioCmd* cmd; + struct SequencePlayer* seqPlayer; + struct SequenceChannel* chan; u8 end; UNUSED static char shindouDebugPrint134[] = "Continue Port\n"; @@ -333,16 +333,13 @@ void func_802ad7ec(u32 arg0) { 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) { eu_process_audio_cmd(cmd); - } - else if ((cmd->u.s.op & 0x40) != 0) { + } else if ((cmd->u.s.op & 0x40) != 0) { switch (cmd->u.s.op) { case 0x41: if (seqPlayer->fadeVolumeScale != cmd->u2.as_f32) { @@ -367,8 +364,7 @@ void func_802ad7ec(u32 arg0) { 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) { @@ -421,18 +417,18 @@ 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); } @@ -440,7 +436,7 @@ 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) { return 0; @@ -471,8 +467,8 @@ void func_sh_802f69cc(void) { } s32 func_sh_802f6a08(s32 playerIndex, s32 channelIndex, s32 soundScriptIOIndex) { - struct SequenceChannel *seqChannel; - struct SequencePlayer *player; + struct SequenceChannel* seqChannel; + struct SequencePlayer* player; player = &gSequencePlayers[playerIndex]; if (player->enabled) { diff --git a/src/audio/seqplayer.c b/src/audio/seqplayer.c index 90e29a85..a30f9fa9 100644 --- a/src/audio/seqplayer.c +++ b/src/audio/seqplayer.c @@ -17,18 +17,18 @@ #define PORTAMENTO_MODE_5 5 #ifdef VERSION_SH -void seq_channel_layer_process_script_part1(struct SequenceChannelLayer *layer); -s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer); -s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s32 cmd); -s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer *layer, s32 cmd); -s32 seq_channel_layer_process_script_part5(struct SequenceChannelLayer *layer, s32 cmd); +void seq_channel_layer_process_script_part1(struct SequenceChannelLayer* layer); +s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer* layer); +s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer* layer, s32 cmd); +s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer* layer, s32 cmd); +s32 seq_channel_layer_process_script_part5(struct SequenceChannelLayer* layer, s32 cmd); #endif -void seq_channel_layer_process_script(struct SequenceChannelLayer *layer); -void sequence_channel_process_script(struct SequenceChannel *seqChannel); -u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrument **instOut, - struct AdsrSettings *adsr); +void seq_channel_layer_process_script(struct SequenceChannelLayer* layer); +void sequence_channel_process_script(struct SequenceChannel* seqChannel); +u8 get_instrument(struct SequenceChannel* seqChannel, u8 instId, struct Instrument** instOut, + struct AdsrSettings* adsr); -void sequence_channel_init(struct SequenceChannel *seqChannel) { +void sequence_channel_init(struct SequenceChannel* seqChannel) { s32 i; seqChannel->enabled = FALSE; @@ -95,12 +95,12 @@ void sequence_channel_init(struct SequenceChannel *seqChannel) { init_note_lists(&seqChannel->notePool); } -s32 seq_channel_set_layer(struct SequenceChannel *seqChannel, s32 layerIndex) { - struct SequenceChannelLayer *layer; +s32 seq_channel_set_layer(struct SequenceChannel* seqChannel, s32 layerIndex) { + struct SequenceChannelLayer* layer; if (seqChannel->layers[layerIndex] == NULL) { #if defined(VERSION_EU) || defined(VERSION_SH) - struct SequenceChannelLayer *layer; + struct SequenceChannelLayer* layer; #endif layer = audio_list_pop_back(&gLayerFreeList); seqChannel->layers[layerIndex] = layer; @@ -153,7 +153,7 @@ s32 seq_channel_set_layer(struct SequenceChannel *seqChannel, s32 layerIndex) { return 0; } -void seq_channel_layer_disable(struct SequenceChannelLayer *layer) { +void seq_channel_layer_disable(struct SequenceChannelLayer* layer) { if (layer != NULL) { seq_channel_layer_note_decay(layer); layer->enabled = FALSE; @@ -161,14 +161,14 @@ void seq_channel_layer_disable(struct SequenceChannelLayer *layer) { } } -void seq_channel_layer_free(struct SequenceChannel *seqChannel, s32 layerIndex) { - struct SequenceChannelLayer *layer = seqChannel->layers[layerIndex]; +void seq_channel_layer_free(struct SequenceChannel* seqChannel, s32 layerIndex) { + struct SequenceChannelLayer* layer = seqChannel->layers[layerIndex]; if (layer != NULL) { #if defined(VERSION_EU) || defined(VERSION_SH) audio_list_push_back(&gLayerFreeList, &layer->listItem); #else - struct AudioListItem *item = &layer->listItem; + struct AudioListItem* item = &layer->listItem; if (item->prev == NULL) { gLayerFreeList.prev->next = item; item->prev = gLayerFreeList.prev; @@ -183,7 +183,7 @@ void seq_channel_layer_free(struct SequenceChannel *seqChannel, s32 layerIndex) } } -void sequence_channel_disable(struct SequenceChannel *seqChannel) { +void sequence_channel_disable(struct SequenceChannel* seqChannel) { s32 i; for (i = 0; i < LAYERS_MAX; i++) { seq_channel_layer_free(seqChannel, i); @@ -194,7 +194,7 @@ void sequence_channel_disable(struct SequenceChannel *seqChannel) { seqChannel->finished = TRUE; } -struct SequenceChannel *allocate_sequence_channel(void) { +struct SequenceChannel* allocate_sequence_channel(void) { s32 i; for (i = 0; i < ARRAY_COUNT(gSequenceChannels); i++) { if (gSequenceChannels[i].seqPlayer == NULL) { @@ -208,8 +208,8 @@ struct SequenceChannel *allocate_sequence_channel(void) { return &gSequenceChannelNone; } -void sequence_player_init_channels(struct SequencePlayer *seqPlayer, u16 channelBits) { - struct SequenceChannel *seqChannel; +void sequence_player_init_channels(struct SequencePlayer* seqPlayer, u16 channelBits) { + struct SequenceChannel* seqChannel; s32 i; for (i = 0; i < CHANNELS_MAX; i++) { @@ -241,8 +241,8 @@ void sequence_player_init_channels(struct SequencePlayer *seqPlayer, u16 channel } } -void sequence_player_disable_channels(struct SequencePlayer *seqPlayer, u16 channelBits) { - struct SequenceChannel *seqChannel; +void sequence_player_disable_channels(struct SequencePlayer* seqPlayer, u16 channelBits) { + struct SequenceChannel* seqChannel; s32 i; eu_stubbed_printf_0("SUBTRACK DIM\n"); @@ -272,21 +272,20 @@ void sequence_player_disable_channels(struct SequencePlayer *seqPlayer, u16 chan } } -void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex, void *script) { - struct SequenceChannel *seqChannel = seqPlayer->channels[channelIndex]; +void sequence_channel_enable(struct SequencePlayer* seqPlayer, u8 channelIndex, void* script) { + struct SequenceChannel* seqChannel = seqPlayer->channels[channelIndex]; s32 i; if (IS_SEQUENCE_CHANNEL_VALID(seqChannel) == FALSE) { #ifdef VERSION_EU - struct SequencePlayer *bgMusic = &gSequencePlayers[0]; - struct SequencePlayer *miscMusic = &gSequencePlayers[1]; + struct SequencePlayer* bgMusic = &gSequencePlayers[0]; + struct SequencePlayer* miscMusic = &gSequencePlayers[1]; if (seqPlayer == bgMusic) { stubbed_printf("GROUP 0:"); } else if (seqPlayer == miscMusic) { stubbed_printf("GROUP 1:"); } else { - stubbed_printf("SEQID %d,BANKID %d\n", - seqPlayer->seqId, seqPlayer->defaultBank[0]); + stubbed_printf("SEQID %d,BANKID %d\n", seqPlayer->seqId, seqPlayer->defaultBank[0]); } stubbed_printf("ERR:SUBTRACK %d NOT ALLOCATED\n", channelIndex); #endif @@ -304,7 +303,7 @@ void sequence_channel_enable(struct SequencePlayer *seqPlayer, u8 channelIndex, } } -void sequence_player_disable(struct SequencePlayer *seqPlayer) { +void sequence_player_disable(struct SequencePlayer* seqPlayer) { sequence_player_disable_channels(seqPlayer, 0xffff); note_pool_clear(&seqPlayer->notePool); seqPlayer->finished = TRUE; @@ -334,7 +333,7 @@ void sequence_player_disable(struct SequencePlayer *seqPlayer) { /** * Add an item to the end of a list, if it's not already in any list. */ -void audio_list_push_back(struct AudioListItem *list, struct AudioListItem *item) { +void audio_list_push_back(struct AudioListItem* list, struct AudioListItem* item) { if (item->prev != NULL) { eu_stubbed_printf_0("Error:Same List Add\n"); } else { @@ -350,8 +349,8 @@ void audio_list_push_back(struct AudioListItem *list, struct AudioListItem *item /** * Remove the last item from a list, and return it (or NULL if empty). */ -void *audio_list_pop_back(struct AudioListItem *list) { - struct AudioListItem *item = list->prev; +void* audio_list_pop_back(struct AudioListItem* list) { + struct AudioListItem* item = list->prev; if (item == list) { return NULL; } @@ -381,22 +380,22 @@ void init_layer_freelist(void) { } } -u8 m64_read_u8(struct M64ScriptState *state) { +u8 m64_read_u8(struct M64ScriptState* state) { #if defined(VERSION_EU) || defined(VERSION_SH) return *(state->pc++); #else - u8 *midiArg = state->pc++; + u8* midiArg = state->pc++; return *midiArg; #endif } -s16 m64_read_s16(struct M64ScriptState *state) { +s16 m64_read_s16(struct M64ScriptState* state) { s16 ret = *(state->pc++) << 8; ret = *(state->pc++) | ret; return ret; } -u16 m64_read_compressed_u16(struct M64ScriptState *state) { +u16 m64_read_compressed_u16(struct M64ScriptState* state) { u16 ret = *(state->pc++); if (ret & 0x80) { ret = (ret << 8) & 0x7f00; @@ -406,7 +405,7 @@ u16 m64_read_compressed_u16(struct M64ScriptState *state) { } #if defined(VERSION_SH) -void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { +void seq_channel_layer_process_script(struct SequenceChannelLayer* layer) { s32 cmd; if (layer->enabled == FALSE) { @@ -441,17 +440,17 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { } } #elif defined(VERSION_EU) -void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { - struct SequencePlayer *seqPlayer; - struct SequenceChannel *seqChannel; +void seq_channel_layer_process_script(struct SequenceChannelLayer* layer) { + struct SequencePlayer* seqPlayer; + struct SequenceChannel* seqChannel; #ifdef VERSION_EU UNUSED u32 pad0; #endif - struct M64ScriptState *state; - struct Portamento *portamento; - struct AudioBankSound *sound; - struct Instrument *instrument; - struct Drum *drum; + struct M64ScriptState* state; + struct Portamento* portamento; + struct AudioBankSound* sound; + struct Instrument* instrument; + struct Drum* drum; s32 temp_a0_5; #ifdef VERSION_EU u16 sp3A; @@ -569,7 +568,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #if defined(VERSION_EU) || defined(VERSION_SH) layer->pan = temp_a0_5; #else - layer->pan = (f32) temp_a0_5 / US_FLOAT(128.0); + layer->pan = (f32)temp_a0_5 / US_FLOAT(128.0); #endif } break; @@ -614,8 +613,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { layer->instrument = NULL; } - if (1) { - } + if (1) {} if (cmd == 0xff) { layer->adsr.releaseRate = 0; @@ -634,8 +632,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { layer->portamento.mode = m64_read_u8(state); // cmd is reused for the portamento's semitone - cmd = m64_read_u8(state) + seqChannel->transposition + - layer->transposition + seqPlayer->transposition; + cmd = m64_read_u8(state) + seqChannel->transposition + layer->transposition + seqPlayer->transposition; if (cmd >= 0x80) { cmd = 0; @@ -660,7 +657,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #if defined(VERSION_EU) || defined(VERSION_SH) case 0xcb: sp3A = m64_read_s16(state); - layer->adsr.envelope = (struct AdsrEnvelope *) (seqPlayer->seqData + sp3A); + layer->adsr.envelope = (struct AdsrEnvelope*)(seqPlayer->seqData + sp3A); layer->adsr.releaseRate = m64_read_u8(state); break; @@ -747,8 +744,8 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #else layer->duration = layer->noteDuration * sp3A / 256; #endif - if ((seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_STOP_NOTES) != 0) - || seqChannel->stopSomething2 + if ((seqPlayer->muted && (seqChannel->muteBehavior & MUTE_BEHAVIOR_STOP_NOTES) != 0) || + seqChannel->stopSomething2 #if defined(VERSION_JP) || defined(VERSION_US) || !seqChannel->hasInstrument #endif @@ -757,7 +754,8 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { } else { #if defined(VERSION_EU) || defined(VERSION_SH) s32 temp = layer->instOrWave; - if (temp == 0xff) temp = seqChannel->instOrWave; + if (temp == 0xff) + temp = seqChannel->instOrWave; if (temp == 0) #else if (seqChannel->instOrWave == 0) @@ -831,9 +829,9 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #if defined(VERSION_EU) sound = instrument_get_audio_bank_sound(instrument, vel); #else - sound = (u8) vel < instrument->normalRangeLo ? &instrument->lowNotesSound - : (u8) vel <= instrument->normalRangeHi ? - &instrument->normalNotesSound : &instrument->highNotesSound; + sound = (u8)vel < instrument->normalRangeLo ? &instrument->lowNotesSound + : (u8)vel <= instrument->normalRangeHi ? &instrument->normalNotesSound + : &instrument->highNotesSound; #endif sameSound = (sound == layer->sound); layer->sound = sound; @@ -876,9 +874,9 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #endif if (PORTAMENTO_IS_SPECIAL(layer->portamento)) { - portamento->speed = US_FLOAT(32512.0) * FLOAT_CAST(seqPlayer->tempo) - / ((f32) layer->delay * (f32) gTempoInternalToExternal - * FLOAT_CAST(layer->portamentoTime)); + portamento->speed = + US_FLOAT(32512.0) * FLOAT_CAST(seqPlayer->tempo) / + ((f32)layer->delay * (f32)gTempoInternalToExternal * FLOAT_CAST(layer->portamentoTime)); } else { portamento->speed = US_FLOAT(127.0) / FLOAT_CAST(layer->portamentoTime); } @@ -891,9 +889,9 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { #if defined(VERSION_EU) sound = instrument_get_audio_bank_sound(instrument, cmd); #else - sound = cmd < instrument->normalRangeLo ? - &instrument->lowNotesSound : cmd <= instrument->normalRangeHi ? - &instrument->normalNotesSound : &instrument->highNotesSound; + sound = cmd < instrument->normalRangeLo ? &instrument->lowNotesSound + : cmd <= instrument->normalRangeHi ? &instrument->normalNotesSound + : &instrument->highNotesSound; #endif sameSound = (sound == layer->sound); layer->sound = sound; @@ -941,8 +939,7 @@ void seq_channel_layer_process_script(struct SequenceChannelLayer *layer) { note_vibrato_init(layer->note); } #if defined(VERSION_EU) || defined(VERSION_SH) - if (seqChannel) { - } + if (seqChannel) {} #endif } @@ -958,7 +955,7 @@ u8 audioString107[] = "Error: Your assignchannel is stolen.\n"; #endif #ifdef VERSION_SH -void seq_channel_layer_process_script_part1(struct SequenceChannelLayer *layer) { +void seq_channel_layer_process_script_part1(struct SequenceChannelLayer* layer) { if (!layer->continuousNotes) { seq_channel_layer_note_decay(layer); } else if (layer->note != NULL && layer->note->wantedParentLayer == layer) { @@ -973,7 +970,7 @@ void seq_channel_layer_process_script_part1(struct SequenceChannelLayer *layer) layer->notePropertiesNeedInit = TRUE; } -s32 seq_channel_layer_process_script_part5(struct SequenceChannelLayer *layer, s32 cmd) { +s32 seq_channel_layer_process_script_part5(struct SequenceChannelLayer* layer, s32 cmd) { if (!layer->stopSomething && layer->sound != NULL && layer->sound->sample->codec == CODEC_SKIP && layer->sound->sample->medium != 0) { layer->stopSomething = TRUE; @@ -997,10 +994,10 @@ s32 seq_channel_layer_process_script_part5(struct SequenceChannelLayer *layer, s return 0; } -s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { - struct SequenceChannel *seqChannel = layer->seqChannel; - struct SequencePlayer *seqPlayer = seqChannel->seqPlayer; - struct M64ScriptState *state; +s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer* layer) { + struct SequenceChannel* seqChannel = layer->seqChannel; + struct SequencePlayer* seqPlayer = seqChannel->seqPlayer; + struct M64ScriptState* state; s32 temp_a0_5; u16 sp3A; u8 cmd; @@ -1062,7 +1059,7 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { case 0xca: // layer_setpan temp_a0_5 = *(state->pc++); if (cmd == 0xc1) { - layer->velocitySquare = (f32) (temp_a0_5 * temp_a0_5) / (f32) (127 * 127); + layer->velocitySquare = (f32)(temp_a0_5 * temp_a0_5) / (f32)(127 * 127); } else { layer->pan = temp_a0_5; } @@ -1103,8 +1100,7 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { layer->instrument = NULL; } - if (1) { - } + if (1) {} if (cmd == 0xff) { layer->adsr.releaseRate = 0; @@ -1122,8 +1118,7 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { layer->portamento.mode = m64_read_u8(state); // cmd is reused for the portamento's semitone - cmd = m64_read_u8(state) + seqChannel->transposition + - layer->transposition + seqPlayer->transposition; + cmd = m64_read_u8(state) + seqChannel->transposition + layer->transposition + seqPlayer->transposition; if (cmd >= 0x80) { cmd = 0; @@ -1147,7 +1142,7 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { case 0xcb: sp3A = m64_read_s16(state); - layer->adsr.envelope = (struct AdsrEnvelope *) (seqPlayer->seqData + sp3A); + layer->adsr.envelope = (struct AdsrEnvelope*)(seqPlayer->seqData + sp3A); layer->adsr.releaseRate = m64_read_u8(state); break; @@ -1168,7 +1163,7 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { switch (cmd & 0xf0) { case 0xd0: // layer_setshortnotevelocityfromtable sp3A = seqPlayer->shortNoteVelocityTable[cmd & 0xf]; - layer->velocitySquare = (f32) (sp3A * sp3A) / (f32) (127 * 127); + layer->velocitySquare = (f32)(sp3A * sp3A) / (f32)(127 * 127); break; case 0xe0: // layer_setshortnotedurationfromtable layer->noteDuration = seqPlayer->shortNoteDurationTable[cmd & 0xf]; @@ -1182,20 +1177,20 @@ s32 seq_channel_layer_process_script_part2(struct SequenceChannelLayer *layer) { return cmd; } -s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer *layer, s32 cmd1) { +s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer* layer, s32 cmd1) { s32 sameSound = TRUE; - struct SequenceChannel *seqChannel = layer->seqChannel; - struct Portamento *portamento; - struct AudioBankSound *sound; - struct Instrument *instrument; - struct Drum *drum; + struct SequenceChannel* seqChannel = layer->seqChannel; + struct Portamento* portamento; + struct AudioBankSound* sound; + struct Instrument* instrument; + struct Drum* drum; f32 tuning; s32 vel; f32 freqScale; f32 sp24; f32 temp_f12; UNUSED s32 pad[2]; - struct SequencePlayer *seqPlayer = seqChannel->seqPlayer; + struct SequencePlayer* seqPlayer = seqChannel->seqPlayer; u8 cmd = cmd1; f32 temp_f2; @@ -1282,9 +1277,9 @@ s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer *layer, s portamento->extent = sp24 / freqScale - 1.0f; if (PORTAMENTO_IS_SPECIAL(layer->portamento)) { - portamento->speed = US_FLOAT(32512.0) * FLOAT_CAST(seqPlayer->tempo) - / ((f32) layer->delay * (f32) gTempoInternalToExternal - * FLOAT_CAST(layer->portamentoTime)); + portamento->speed = + US_FLOAT(32512.0) * FLOAT_CAST(seqPlayer->tempo) / + ((f32)layer->delay * (f32)gTempoInternalToExternal * FLOAT_CAST(layer->portamentoTime)); } else { portamento->speed = US_FLOAT(127.0) / FLOAT_CAST(layer->portamentoTime); } @@ -1309,12 +1304,12 @@ s32 seq_channel_layer_process_script_part4(struct SequenceChannelLayer *layer, s return sameSound; } -s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s32 cmd) { - struct M64ScriptState *state = &layer->scriptState; +s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer* layer, s32 cmd) { + struct M64ScriptState* state = &layer->scriptState; u16 sp3A; s32 vel; - struct SequenceChannel *seqChannel = layer->seqChannel; - struct SequencePlayer *seqPlayer = seqChannel->seqPlayer; + struct SequenceChannel* seqChannel = layer->seqChannel; + struct SequencePlayer* seqPlayer = seqChannel->seqPlayer; if (cmd == 0xc0) { // layer_delay layer->delay = m64_read_compressed_u16(state); @@ -1349,7 +1344,7 @@ s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s if (vel >= 0x80 || vel < 0) { vel = 0x7f; } - layer->velocitySquare = ((f32) vel * (f32) vel) / (f32) (0x7f * 0x7f); + layer->velocitySquare = ((f32)vel * (f32)vel) / (f32)(0x7f * 0x7f); // the remaining bits are used for the semitone cmd -= (cmd & 0xc0); } else { @@ -1374,8 +1369,7 @@ s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s layer->delay = sp3A; layer->duration = layer->noteDuration * sp3A >> 8; - if ((seqPlayer->muted && (seqChannel->muteBehavior & 0x50) != 0) - || seqChannel->stopSomething2) { + if ((seqPlayer->muted && (seqChannel->muteBehavior & 0x50) != 0) || seqChannel->stopSomething2) { layer->stopSomething = TRUE; return -1; } @@ -1384,14 +1378,15 @@ s32 seq_channel_layer_process_script_part3(struct SequenceChannelLayer *layer, s } #endif -u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrument **instOut, struct AdsrSettings *adsr) { - struct CtlEntry *bank = GameEngine_LoadBank(seqChannel->bankId); - if(instId >= bank->numInstruments) { +u8 get_instrument(struct SequenceChannel* seqChannel, u8 instId, struct Instrument** instOut, + struct AdsrSettings* adsr) { + struct CtlEntry* bank = GameEngine_LoadBank(seqChannel->bankId); + if (instId >= bank->numInstruments) { *instOut = NULL; return 0; } struct Instrument* inst = bank->instruments[instId]; - if(inst == NULL) { + if (inst == NULL) { *instOut = NULL; return 0; } @@ -1402,20 +1397,19 @@ u8 get_instrument(struct SequenceChannel *seqChannel, u8 instId, struct Instrume return instId; } -void set_instrument(struct SequenceChannel *seqChannel, u8 instId) { +void set_instrument(struct SequenceChannel* seqChannel, u8 instId) { if (instId >= 0x80) { seqChannel->instOrWave = instId; seqChannel->instrument = NULL; } else if (instId == 0x7f) { seqChannel->instOrWave = 0; - seqChannel->instrument = (struct Instrument *) 1; + seqChannel->instrument = (struct Instrument*)1; } else { #if defined(VERSION_EU) || defined(VERSION_SH) - if ((seqChannel->instOrWave = - get_instrument(seqChannel, instId, &seqChannel->instrument, &seqChannel->adsr)) == 0) + if ((seqChannel->instOrWave = get_instrument(seqChannel, instId, &seqChannel->instrument, &seqChannel->adsr)) == + 0) #else - seqChannel->instOrWave = - get_instrument(seqChannel, instId, &seqChannel->instrument, &seqChannel->adsr); + seqChannel->instOrWave = get_instrument(seqChannel, instId, &seqChannel->instrument, &seqChannel->adsr); if (seqChannel->instOrWave == 0) #endif { @@ -1426,13 +1420,13 @@ void set_instrument(struct SequenceChannel *seqChannel, u8 instId) { seqChannel->hasInstrument = TRUE; } -void sequence_channel_set_volume(struct SequenceChannel *seqChannel, u8 volume) { +void sequence_channel_set_volume(struct SequenceChannel* seqChannel, u8 volume) { seqChannel->volume = FLOAT_CAST(volume) / US_FLOAT(127.0); } -void sequence_channel_process_script(struct SequenceChannel *seqChannel) { - struct M64ScriptState *state; - struct SequencePlayer *seqPlayer; +void sequence_channel_process_script(struct SequenceChannel* seqChannel) { + struct M64ScriptState* state; + struct SequencePlayer* seqPlayer; u8 cmd; s8 temp; u8 loBits; @@ -1440,7 +1434,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { s32 sp38; s8 value; s32 i; - u8 *seqData; + u8* seqData; if (!seqChannel->enabled) { return; @@ -1603,7 +1597,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0xc2: // chan_setdyntable sp5A = m64_read_s16(state); - seqChannel->dynTable = (void *) (seqPlayer->seqData + sp5A); + seqChannel->dynTable = (void*)(seqPlayer->seqData + sp5A); break; case 0xc5: // chan_dynsetdyntable @@ -1611,10 +1605,11 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { #if defined(VERSION_EU) || defined(VERSION_SH) seqData = (*seqChannel->dynTable)[value]; sp38 = (u16)((seqData[0] << 8) + seqData[1]); - seqChannel->dynTable = (void *) (seqPlayer->seqData + sp38); + seqChannel->dynTable = (void*)(seqPlayer->seqData + sp38); #else - sp5A = (u16)((((*seqChannel->dynTable)[value])[0] << 8) + (((*seqChannel->dynTable)[value])[1])); - seqChannel->dynTable = (void *) (seqPlayer->seqData + sp5A); + sp5A = (u16)((((*seqChannel->dynTable)[value])[0] << 8) + + (((*seqChannel->dynTable)[value])[1])); + seqChannel->dynTable = (void*)(seqPlayer->seqData + sp5A); #endif } break; @@ -1626,7 +1621,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { // bank set. Note that in the binary format (not in the JSON!) // the banks are listed backwards, so we counts from the back. // (gAlBankSets[offset] is number of banks) - sp38 = ((u16 *) gAlBankSets)[seqPlayer->seqId]; + sp38 = ((u16*)gAlBankSets)[seqPlayer->seqId]; loBits = *(sp38 + gAlBankSets); cmd = gAlBankSets[(s32)sp38 + loBits - cmd]; @@ -1678,7 +1673,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { break; case 0xd3: // chan_pitchbend; pitch bend by <= 1 octave in either direction (-127..127) - // (m64_read_u8(state) is really s8 here) + // (m64_read_u8(state) is really s8 here) #ifdef VERSION_SH cmd = m64_read_u8(state) + 128; #else @@ -1723,7 +1718,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0xda: // chan_setenvelope sp5A = m64_read_s16(state); - seqChannel->adsr.envelope = (struct AdsrEnvelope *) (seqPlayer->seqData + sp5A); + seqChannel->adsr.envelope = (struct AdsrEnvelope*)(seqPlayer->seqData + sp5A); break; case 0xd9: // chan_setdecayrelease @@ -1737,8 +1732,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { break; case 0xd7: // chan_setvibratorate - seqChannel->vibratoRateStart = seqChannel->vibratoRateTarget = - m64_read_u8(state) * 32; + seqChannel->vibratoRateStart = seqChannel->vibratoRateTarget = m64_read_u8(state) * 32; seqChannel->vibratoRateChangeDelay = 0; break; @@ -1779,17 +1773,17 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { // the banks are listed backwards, so we counts from the back. // (gAlBankSets[offset] is number of banks) #if defined(VERSION_EU) || defined(VERSION_SH) - sp38 = ((u16 *) gAlBankSets)[seqPlayer->seqId]; + sp38 = ((u16*)gAlBankSets)[seqPlayer->seqId]; loBits = *(sp38 + gAlBankSets); cmd = gAlBankSets[(s32)sp38 + loBits - cmd]; #else - struct AudioSequenceData *sequence = GameEngine_LoadSequence(seqPlayer->seqId); + struct AudioSequenceData* sequence = GameEngine_LoadSequence(seqPlayer->seqId); cmd = sequence->banks[cmd]; #endif #ifdef VERSION_SH if (get_bank_or_seq(1, 2, cmd) != NULL) #else - if(IS_BANK_LOAD_COMPLETE(cmd)) + if (IS_BANK_LOAD_COMPLETE(cmd)) #endif { seqChannel->bankId = cmd; @@ -1799,16 +1793,15 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { break; case 0xc7: // chan_writeseq; write to sequence data (!) - { + { #if !defined(VERSION_EU) && !defined(VERSION_SH) - u8 *seqData; + u8* seqData; #endif - cmd = m64_read_u8(state); - sp5A = m64_read_s16(state); - seqData = seqPlayer->seqData + sp5A; - *seqData = (u8)value + cmd; - } - break; + cmd = m64_read_u8(state); + sp5A = m64_read_s16(state); + seqData = seqPlayer->seqData + sp5A; + *seqData = (u8)value + cmd; + } break; case 0xc8: // chan_subtract case 0xc9: // chan_bitand @@ -1888,7 +1881,8 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { state->pc = seqPlayer->seqData + sp38; if (0 && sp38 >= gSeqFileHeader->seqArray[seqPlayer->seqId].len) { - eu_stubbed_printf_3("Err :Sub %x ,address %x:Undefined SubTrack Function %x", seqChannel, state->pc, sp38); + eu_stubbed_printf_3("Err :Sub %x ,address %x:Undefined SubTrack Function %x", + seqChannel, state->pc, sp38); } #else state->depth++, state->stack[state->depth - 1] = state->pc; @@ -1909,7 +1903,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { seqChannel->muteBehavior = *seqData++; seqChannel->noteAllocPolicy = *seqData++; seqChannel->notePriority = *seqData++; - seqChannel->transposition = (s8) *seqData++; + seqChannel->transposition = (s8)*seqData++; seqChannel->newPan = *seqData++; seqChannel->panChannelWeight = *seqData++; seqChannel->reverbVol = *seqData++; @@ -1921,7 +1915,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { seqChannel->muteBehavior = m64_read_u8(state); seqChannel->noteAllocPolicy = m64_read_u8(state); seqChannel->notePriority = m64_read_u8(state); - seqChannel->transposition = (s8) m64_read_u8(state); + seqChannel->transposition = (s8)m64_read_u8(state); seqChannel->newPan = m64_read_u8(state); seqChannel->panChannelWeight = m64_read_u8(state); seqChannel->reverbVol = m64_read_u8(state); @@ -1967,7 +1961,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { case 0xb0: sp5A = m64_read_s16(state); seqData = seqPlayer->seqData + sp5A; - seqChannel->filter = (s16 *) (seqData); + seqChannel->filter = (s16*)(seqData); break; case 0xb1: @@ -1991,15 +1985,15 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { i = (value * 2); sp5A = m64_read_s16(state); sp38 = sp5A + i; - seqChannel->unkC8 = *(u16 *) (seqPlayer->seqData + sp38); + seqChannel->unkC8 = *(u16*)(seqPlayer->seqData + sp38); break; case 0xb4: - seqChannel->dynTable = (void *) (seqPlayer->seqData + seqChannel->unkC8); + seqChannel->dynTable = (void*)(seqPlayer->seqData + seqChannel->unkC8); break; case 0xb5: - seqChannel->unkC8 = *(u16 *) (*seqChannel->dynTable)[value]; + seqChannel->unkC8 = *(u16*)(*seqChannel->dynTable)[value]; break; case 0xb6: @@ -2042,19 +2036,19 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { } } else { #endif - loBits = cmd & 0xf; + loBits = cmd & 0xf; - switch (cmd & 0xf0) { + switch (cmd & 0xf0) { #ifdef VERSION_SH - case 0x00: - seqChannel->delay = loBits; - goto out; + case 0x00: + seqChannel->delay = loBits; + goto out; - case 0x10: - seqChannel->soundScriptIO[loBits] = -1; - if (func_sh_802f47c8(seqChannel->bankId, (u8)value, &seqChannel->soundScriptIO[loBits]) == -1) { - } - break; + case 0x10: + seqChannel->soundScriptIO[loBits] = -1; + if (func_sh_802f47c8(seqChannel->bankId, (u8)value, &seqChannel->soundScriptIO[loBits]) == + -1) {} + break; #else case 0x00: // chan_testlayerfinished if (seqChannel->layers[loBits] != NULL) { @@ -2068,89 +2062,89 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { break; #endif - // sh: 0x70 - case 0x70: // chan_iowriteval; write data back to audio lib - seqChannel->soundScriptIO[loBits] = value; - break; + // sh: 0x70 + case 0x70: // chan_iowriteval; write data back to audio lib + seqChannel->soundScriptIO[loBits] = value; + break; #ifdef VERSION_SH - case 0x60: + case 0x60: #else case 0x80: // chan_ioreadval; read data from audio lib #endif - value = seqChannel->soundScriptIO[loBits]; - if (loBits < 4) { - seqChannel->soundScriptIO[loBits] = -1; - } - break; + value = seqChannel->soundScriptIO[loBits]; + if (loBits < 4) { + seqChannel->soundScriptIO[loBits] = -1; + } + break; - // sh: 0x50 - case 0x50: // chan_ioreadvalsub; subtract with read data from audio lib - value -= seqChannel->soundScriptIO[loBits]; - break; + // sh: 0x50 + case 0x50: // chan_ioreadvalsub; subtract with read data from audio lib + value -= seqChannel->soundScriptIO[loBits]; + break; #ifndef VERSION_SH #ifdef VERSION_EU - // sh: 0x00 - case 0x60: // chan_delayshort - seqChannel->delay = loBits; - goto out; + // sh: 0x00 + case 0x60: // chan_delayshort + seqChannel->delay = loBits; + goto out; #endif - case 0x90: // chan_setlayer - sp5A = m64_read_s16(state); - if (seq_channel_set_layer(seqChannel, loBits) == 0) { + case 0x90: // chan_setlayer + sp5A = m64_read_s16(state); + if (seq_channel_set_layer(seqChannel, loBits) == 0) { #ifdef VERSION_EU - if (1) {} + if (1) {} #endif - seqChannel->layers[loBits]->scriptState.pc = seqPlayer->seqData + sp5A; - } - break; + seqChannel->layers[loBits]->scriptState.pc = seqPlayer->seqData + sp5A; + } + break; - case 0xa0: // chan_freelayer - seq_channel_layer_free(seqChannel, loBits); - break; + case 0xa0: // chan_freelayer + seq_channel_layer_free(seqChannel, loBits); + break; - case 0xb0: // chan_dynsetlayer - if (value != -1 && seq_channel_set_layer(seqChannel, loBits) != -1) { - seqData = (*seqChannel->dynTable)[value]; - sp5A = ((seqData[0] << 8) + seqData[1]); - seqChannel->layers[loBits]->scriptState.pc = seqPlayer->seqData + sp5A; - } - break; + case 0xb0: // chan_dynsetlayer + if (value != -1 && seq_channel_set_layer(seqChannel, loBits) != -1) { + seqData = (*seqChannel->dynTable)[value]; + sp5A = ((seqData[0] << 8) + seqData[1]); + seqChannel->layers[loBits]->scriptState.pc = seqPlayer->seqData + sp5A; + } + break; #ifndef VERSION_EU - case 0x60: // chan_setnotepriority (arg must be >= 2) - seqChannel->notePriority = loBits; - break; + case 0x60: // chan_setnotepriority (arg must be >= 2) + seqChannel->notePriority = loBits; + break; #endif #endif #ifdef VERSION_SH - case 0x20: + case 0x20: #else case 0x10: // chan_startchannel #endif - sp5A = m64_read_s16(state); - sequence_channel_enable(seqPlayer, loBits, seqPlayer->seqData + sp5A); - break; + sp5A = m64_read_s16(state); + sequence_channel_enable(seqPlayer, loBits, seqPlayer->seqData + sp5A); + break; #ifndef VERSION_SH - case 0x20: // chan_disablechannel - sequence_channel_disable(seqPlayer->channels[loBits]); - break; + case 0x20: // chan_disablechannel + sequence_channel_disable(seqPlayer->channels[loBits]); + break; #endif - case 0x30: // chan_iowriteval2; write data back to audio lib for another channel - cmd = m64_read_u8(state); - seqPlayer->channels[loBits]->soundScriptIO[cmd] = value; - break; + case 0x30: // chan_iowriteval2; write data back to audio lib for another channel + cmd = m64_read_u8(state); + seqPlayer->channels[loBits]->soundScriptIO[cmd] = value; + break; - case 0x40: // chan_ioreadval2; read data from audio lib from another channel - cmd = m64_read_u8(state); - value = seqPlayer->channels[loBits]->soundScriptIO[cmd]; - break; - } + case 0x40: // chan_ioreadval2; read data from audio lib from another channel + cmd = m64_read_u8(state); + value = seqPlayer->channels[loBits]->soundScriptIO[cmd]; + break; + } #ifdef VERSION_SH } #endif @@ -2158,7 +2152,7 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { } } #if defined(VERSION_EU) || defined(VERSION_SH) - out: +out: #endif for (i = 0; i < LAYERS_MAX; i++) { @@ -2168,22 +2162,22 @@ void sequence_channel_process_script(struct SequenceChannel *seqChannel) { } } -void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { +void sequence_player_process_sequence(struct SequencePlayer* seqPlayer) { u8 cmd; u8 loBits; u8 temp; s32 value; s32 i; u16 u16v; - u8 *seqData; - struct M64ScriptState *state; + u8* seqData; + struct M64ScriptState* state; if (seqPlayer->enabled == FALSE) { return; } // If discarded, bail out. - if (IS_SEQ_LOAD_COMPLETE(seqPlayer->seqId) == FALSE || IS_BANK_LOAD_COMPLETE(seqPlayer->defaultBank[0]) == FALSE ){ + if (IS_SEQ_LOAD_COMPLETE(seqPlayer->seqId) == FALSE || IS_BANK_LOAD_COMPLETE(seqPlayer->defaultBank[0]) == FALSE) { eu_stubbed_printf_1("Disappear Sequence or Bank %d\n", seqPlayer->seqId); sequence_player_disable(seqPlayer); return; @@ -2204,7 +2198,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { if (seqPlayer->tempoAcc < gTempoInternalToExternal) { return; } - seqPlayer->tempoAcc -= (u16) gTempoInternalToExternal; + seqPlayer->tempoAcc -= (u16)gTempoInternalToExternal; state = &seqPlayer->scriptState; if (seqPlayer->delay > 1) { @@ -2286,7 +2280,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { if (cmd == 0xf2 && value >= 0) { break; } - state->pc += (s8) temp; + state->pc += (s8)temp; break; #endif @@ -2312,7 +2306,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { // fallthrough case 0xde: // seq_transposerel; add transposition - seqPlayer->transposition += (s8) m64_read_u8(state); + seqPlayer->transposition += (s8)m64_read_u8(state); break; case 0xdd: // seq_settempo (bpm) @@ -2326,7 +2320,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { if (cmd == 0xdd) { seqPlayer->tempo = temp * TEMPO_SCALE; } else { - seqPlayer->tempo += (s8) temp * TEMPO_SCALE; + seqPlayer->tempo += (s8)temp * TEMPO_SCALE; } #endif @@ -2334,16 +2328,16 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { seqPlayer->tempo = gTempoInternalToExternal; } - //if (cmd) {} + // if (cmd) {} - if ((s16) seqPlayer->tempo <= 0) { + if ((s16)seqPlayer->tempo <= 0) { seqPlayer->tempo = 1; } break; #ifdef VERSION_SH case 0xdc: // seq_addtempo (bpm) - seqPlayer->tempoAdd = (s8) m64_read_u8(state) * TEMPO_SCALE; + seqPlayer->tempoAdd = (s8)m64_read_u8(state) * TEMPO_SCALE; break; #endif @@ -2362,8 +2356,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { case SEQUENCE_PLAYER_STATE_2: seqPlayer->fadeRemainingFrames = u16v; seqPlayer->state = cmd; - seqPlayer->fadeVelocity = - (0.0f - seqPlayer->fadeVolume) / (s32)(u16v & 0xFFFFu); + seqPlayer->fadeVelocity = (0.0f - seqPlayer->fadeVolume) / (s32)(u16v & 0xFFFFu); break; } break; @@ -2380,7 +2373,8 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { case SEQUENCE_PLAYER_STATE_0: seqPlayer->fadeRemainingFrames = seqPlayer->fadeTimerUnkEu; if (seqPlayer->fadeTimerUnkEu != 0) { - seqPlayer->fadeVelocity = (temp32 / 127.0f - seqPlayer->fadeVolume) / FLOAT_CAST(seqPlayer->fadeRemainingFrames); + seqPlayer->fadeVelocity = (temp32 / 127.0f - seqPlayer->fadeVolume) / + FLOAT_CAST(seqPlayer->fadeRemainingFrames); } else { seqPlayer->fadeVolume = temp32 / 127.0f; } @@ -2393,8 +2387,8 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { case SEQUENCE_PLAYER_STATE_2: if (seqPlayer->fadeRemainingFrames != 0) { f32 targetVolume = FLOAT_CAST(cmd) / US_FLOAT(127.0); - seqPlayer->fadeVelocity = (targetVolume - seqPlayer->fadeVolume) - / FLOAT_CAST(seqPlayer->fadeRemainingFrames); + seqPlayer->fadeVelocity = (targetVolume - seqPlayer->fadeVolume) / + FLOAT_CAST(seqPlayer->fadeRemainingFrames); break; } // fallthrough @@ -2410,15 +2404,14 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { case 0xda: // seq_changevol temp = m64_read_u8(state); - seqPlayer->fadeVolume = - seqPlayer->fadeVolume + (f32)(s8) temp / US_FLOAT(127.0); + seqPlayer->fadeVolume = seqPlayer->fadeVolume + (f32)(s8)temp / US_FLOAT(127.0); break; #endif #if defined(VERSION_EU) || defined(VERSION_SH) case 0xd9: temp = m64_read_u8(state); - seqPlayer->fadeVolumeScale = (s8) temp / 127.0f; + seqPlayer->fadeVolumeScale = (s8)temp / 127.0f; break; #endif @@ -2434,7 +2427,7 @@ void sequence_player_process_sequence(struct SequencePlayer *seqPlayer) { case 0xd5: // seq_setmutescale temp = m64_read_u8(state); - seqPlayer->muteVolumeScale = (f32)(s8) temp / US_FLOAT(127.0); + seqPlayer->muteVolumeScale = (f32)(s8)temp / US_FLOAT(127.0); break; case 0xd4: // seq_mute @@ -2582,7 +2575,7 @@ void process_sequences(UNUSED s32 iterationsRemaining) { } void init_sequence_player(u32 player) { - struct SequencePlayer *seqPlayer = &gSequencePlayers[player]; + struct SequencePlayer* seqPlayer = &gSequencePlayers[player]; #if defined(VERSION_EU) || defined(VERSION_SH) sequence_player_disable(seqPlayer); #endif diff --git a/src/audio/shindou_debug_prints.c b/src/audio/shindou_debug_prints.c index 5dbdbf2f..6e3b8d9f 100644 --- a/src/audio/shindou_debug_prints.c +++ b/src/audio/shindou_debug_prints.c @@ -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"; @@ -14,7 +14,7 @@ char shindouDebugPrint6[] = "Kill Voice %d (ID %d) %d\n"; char shindouDebugPrint7[] = "Warning: Running Sequence's data disappear!\n"; char shindouDebugPrint8[] = "%x %x %x\n"; char shindouDebugPrint9[] = "Audio:Memory:Heap OverFlow : Not Allocate %d!\n"; -char shindouDebugPrint10[] = "%x %x %x\n"; // Again +char shindouDebugPrint10[] = "%x %x %x\n"; // Again char shindouDebugPrint11[] = "Audio:Memory:Heap OverFlow : Not Allocate %d!\n"; // Again char shindouDebugPrint12[] = "Audio:Memory:DataHeap Not Allocate \n"; char shindouDebugPrint13[] = "StayHeap Not Allocate %d\n"; @@ -65,7 +65,7 @@ char shindouDebugPrint57[] = "Request--------Single-Stay, %d\n"; char shindouDebugPrint58[] = "Try Kill %d \n"; char shindouDebugPrint59[] = "Try Kill %x %x\n"; char shindouDebugPrint60[] = "Try Kill %x %x %x\n"; -s32 shindouDebugPrintPadding[] = {0, 0, 0}; +s32 shindouDebugPrintPadding[] = { 0, 0, 0 }; // load.c char shindouDebugPrint61[] = "CAUTION:WAVE CACHE FULL %d"; @@ -140,7 +140,7 @@ char shindouDebugPrint127[] = "Spec Change Override. %d -> %d\n"; char shindouDebugPrint128[] = "Audio:now-max tasklen is %d / %d\n"; char shindouDebugPrint129[] = "Audio:Warning:ABI Tasklist length over (%d)\n"; s32 D_SH_80314FC8 = 0x80; -struct SPTask *D_SH_80314FCC = NULL; +struct SPTask* D_SH_80314FCC = NULL; char shindouDebugPrint130[] = "BGLOAD Start %d\n"; char shindouDebugPrint131[] = "Error: OverFlow Your Request\n"; char shindouDebugPrint132[] = "---AudioSending (%d->%d) \n"; diff --git a/src/audio/synthesis.c b/src/audio/synthesis.c index 041b80bf..6bcfcfcc 100644 --- a/src/audio/synthesis.c +++ b/src/audio/synthesis.c @@ -24,16 +24,16 @@ #define DMEM_ADDR_WET_LEFT_CH 0x740 #define DMEM_ADDR_WET_RIGHT_CH 0x880 -#define aSetLoadBufferPair(pkt, c, off) \ - aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_LEFT_CH, 0, DEFAULT_LEN_1CH - c); \ - aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ - aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_RIGHT_CH, 0, DEFAULT_LEN_1CH - c); \ +#define aSetLoadBufferPair(pkt, c, off) \ + aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_LEFT_CH, 0, DEFAULT_LEN_1CH - c); \ + aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ + aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_RIGHT_CH, 0, DEFAULT_LEN_1CH - c); \ aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off))) -#define aSetSaveBufferPair(pkt, c, d, off) \ - aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_LEFT_CH, d); \ - aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ - aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \ +#define aSetSaveBufferPair(pkt, c, d, off) \ + aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_LEFT_CH, d); \ + aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ + aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \ aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off))); #define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1)) @@ -45,22 +45,25 @@ struct VolumeChange { u16 targetRight; }; -u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex); +u64* synthesis_do_one_audio_update(s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex); #ifdef VERSION_EU -u64 *synthesis_process_note(struct Note *note, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s16 *aiBuf, s32 bufLen, u64 *cmd); -u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad); -u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags); -u64 *process_envelope(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags); -u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight); +u64* synthesis_process_note(struct Note* note, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + s16* aiBuf, s32 bufLen, u64* cmd); +u64* load_wave_samples(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + s32 nSamplesToLoad); +u64* final_resample(u64* cmd, struct NoteSynthesisState* synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags); +u64* process_envelope(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, s32 nSamples, + u16 inBuf, s32 headsetPanSettings, u32 flags); +u64* note_apply_headset_pan_effects(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* note, s32 bufLen, + s32 flags, s32 leftRight); #else -u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd); -u64 *load_wave_samples(u64 *cmd, struct Note *note, s32 nSamplesToLoad); -u64 *final_resample(u64 *cmd, struct Note *note, s32 count, u16 pitch, u16 dmemIn, u32 flags); -u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, - u32 flags); -u64 *process_envelope_inner(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, - s32 headsetPanSettings, struct VolumeChange *vol); -u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32 flags, s32 leftRight); +u64* synthesis_process_notes(s16* aiBuf, s32 bufLen, u64* cmd); +u64* load_wave_samples(u64* cmd, struct Note* note, s32 nSamplesToLoad); +u64* final_resample(u64* cmd, struct Note* note, s32 count, u16 pitch, u16 dmemIn, u32 flags); +u64* process_envelope(u64* cmd, struct Note* note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags); +u64* process_envelope_inner(u64* cmd, struct Note* note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, + struct VolumeChange* vol); +u64* note_apply_headset_pan_effects(u64* cmd, struct Note* note, s32 bufLen, s32 flags, s32 leftRight); #endif #ifdef VERSION_EU @@ -75,14 +78,14 @@ u8 sAudioSynthesisPad[0x20]; s16 gVolume; s8 gUseReverb; s8 gNumSynthesisReverbs; -struct NoteSubEu *gNoteSubsEu; +struct NoteSubEu* gNoteSubsEu; #endif #ifdef VERSION_EU f32 gLeftVolRampings[3][1024]; f32 gRightVolRampings[3][1024]; -f32 *gCurrentLeftVolRamping; // Points to any of the three left buffers above -f32 *gCurrentRightVolRamping; // Points to any of the three right buffers above +f32* gCurrentLeftVolRamping; // Points to any of the three left buffers above +f32* gCurrentRightVolRamping; // Points to any of the three right buffers above u8 audioString1[] = "pitch %x: delaybytes %d : olddelay %d\n"; u8 audioString2[] = "cont %x: delaybytes %d : olddelay %d\n"; @@ -92,8 +95,8 @@ u8 audioString2[] = "cont %x: delaybytes %d : olddelay %d\n"; // Equivalent functionality as the US/JP version, // just that the reverb structure is chosen from an array with index void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) { - struct ReverbRingBufferItem *item; - struct SynthesisReverb *reverb = &gSynthesisReverbs[reverbIndex]; + struct ReverbRingBufferItem* item; + struct SynthesisReverb* reverb = &gSynthesisReverbs[reverbIndex]; s32 srcPos; s32 dstPos; s32 nSamples; @@ -108,12 +111,9 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) // Touches both left and right since they are adjacent in memory osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH); - for (srcPos = 0, dstPos = 0; dstPos < item->lengthA / 2; - srcPos += reverb->downsampleRate, dstPos++) { - reverb->ringBuffer.left[item->startPos + dstPos] = - item->toDownsampleLeft[srcPos]; - reverb->ringBuffer.right[item->startPos + dstPos] = - item->toDownsampleRight[srcPos]; + for (srcPos = 0, dstPos = 0; dstPos < item->lengthA / 2; srcPos += reverb->downsampleRate, dstPos++) { + reverb->ringBuffer.left[item->startPos + dstPos] = item->toDownsampleLeft[srcPos]; + reverb->ringBuffer.right[item->startPos + dstPos] = item->toDownsampleRight[srcPos]; } for (dstPos = 0; dstPos < item->lengthB / 2; srcPos += reverb->downsampleRate, dstPos++) { reverb->ringBuffer.left[dstPos] = item->toDownsampleLeft[srcPos]; @@ -129,7 +129,7 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) // There is space in the ring buffer before it wraps around item->lengthA = nSamples * 2; item->lengthB = 0; - item->startPos = (s32) reverb->nextRingBufferPos; + item->startPos = (s32)reverb->nextRingBufferPos; reverb->nextRingBufferPos += nSamples; } else { // Ring buffer wrapped around @@ -144,7 +144,7 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) } #else void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex) { - struct ReverbRingBufferItem *item; + struct ReverbRingBufferItem* item; s32 srcPos; s32 dstPos; s32 nSamples; @@ -159,12 +159,9 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex) { // Touches both left and right since they are adjacent in memory osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH); - for (srcPos = 0, dstPos = 0; dstPos < item->lengthA / 2; - srcPos += gReverbDownsampleRate, dstPos++) { - gSynthesisReverb.ringBuffer.left[dstPos + item->startPos] = - item->toDownsampleLeft[srcPos]; - gSynthesisReverb.ringBuffer.right[dstPos + item->startPos] = - item->toDownsampleRight[srcPos]; + for (srcPos = 0, dstPos = 0; dstPos < item->lengthA / 2; srcPos += gReverbDownsampleRate, dstPos++) { + gSynthesisReverb.ringBuffer.left[dstPos + item->startPos] = item->toDownsampleLeft[srcPos]; + gSynthesisReverb.ringBuffer.right[dstPos + item->startPos] = item->toDownsampleRight[srcPos]; } for (dstPos = 0; dstPos < item->lengthB / 2; srcPos += gReverbDownsampleRate, dstPos++) { gSynthesisReverb.ringBuffer.left[dstPos] = item->toDownsampleLeft[srcPos]; @@ -179,7 +176,7 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex) { // There is space in the ring buffer before it wraps around item->lengthA = numSamplesAfterDownsampling * 2; item->lengthB = 0; - item->startPos = (s32) gSynthesisReverb.nextRingBufferPos; + item->startPos = (s32)gSynthesisReverb.nextRingBufferPos; gSynthesisReverb.nextRingBufferPos += numSamplesAfterDownsampling; } else { // Ring buffer wrapped around @@ -198,7 +195,7 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex) { #endif #ifdef VERSION_EU -u64 *synthesis_load_reverb_ring_buffer(u64 *cmd, u16 addr, u16 srcOffset, s32 len, s32 reverbIndex) { +u64* synthesis_load_reverb_ring_buffer(u64* cmd, u16 addr, u16 srcOffset, s32 len, s32 reverbIndex) { aSetBuffer(cmd++, 0, addr, 0, len); aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.left[srcOffset])); @@ -210,7 +207,7 @@ u64 *synthesis_load_reverb_ring_buffer(u64 *cmd, u16 addr, u16 srcOffset, s32 le #endif #ifdef VERSION_EU -u64 *synthesis_save_reverb_ring_buffer(u64 *cmd, u16 addr, u16 destOffset, s32 len, s32 reverbIndex) { +u64* synthesis_save_reverb_ring_buffer(u64* cmd, u16 addr, u16 destOffset, s32 len, s32 reverbIndex) { aSetBuffer(cmd++, 0, 0, addr, len); aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.left[destOffset])); @@ -223,8 +220,8 @@ u64 *synthesis_save_reverb_ring_buffer(u64 *cmd, u16 addr, u16 destOffset, s32 l #ifdef VERSION_EU void synthesis_load_note_subs_eu(s32 updateIndex) { - struct NoteSubEu *src; - struct NoteSubEu *dest; + struct NoteSubEu* src; + struct NoteSubEu* dest; s32 i; for (i = 0; i < gMaxSimultaneousNotes; i++) { @@ -265,12 +262,12 @@ s32 get_volume_ramping(u16 sourceVol, u16 targetVol, s32 arg2) { #ifdef VERSION_EU // TODO: (Scrub C) pointless mask and whitespace -u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { +u64* synthesis_execute(u64* cmdBuf, s32* writtenCmds, s16* aiBuf, s32 bufLen) { s32 i, j; - f32 *leftVolRamp; - f32 *rightVolRamp; - u32 *aiBufPtr; - u64 *cmd = cmdBuf; + f32* leftVolRamp; + f32* rightVolRamp; + u32* aiBufPtr; + u64* cmd = cmdBuf; s32 chunkLen; s32 nextVolRampTable; @@ -279,7 +276,7 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { synthesis_load_note_subs_eu(gAudioBufferParameters.updatesPerFrame - i); } aSegment(cmd++, 0, 0); - aiBufPtr = (u32 *) aiBuf; + aiBufPtr = (u32*)aiBuf; for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) { if (i == 1) { #pragma GCC diagnostic push @@ -287,15 +284,27 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { #pragma GCC diagnostic ignored "-Wself-assign" #endif // self-assignment has no affect when added here, could possibly simplify a macro definition - chunkLen = bufLen; nextVolRampTable = nextVolRampTable; leftVolRamp = gLeftVolRampings[nextVolRampTable]; rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF]; + chunkLen = bufLen; + nextVolRampTable = nextVolRampTable; + leftVolRamp = gLeftVolRampings[nextVolRampTable]; + rightVolRamp = gRightVolRampings[nextVolRampTable & 0xFFFFFFFF]; #pragma GCC diagnostic pop } else { if (bufLen / i >= gAudioBufferParameters.samplesPerUpdateMax) { - chunkLen = gAudioBufferParameters.samplesPerUpdateMax; nextVolRampTable = 2; leftVolRamp = gLeftVolRampings[2]; rightVolRamp = gRightVolRampings[2]; + chunkLen = gAudioBufferParameters.samplesPerUpdateMax; + nextVolRampTable = 2; + leftVolRamp = gLeftVolRampings[2]; + rightVolRamp = gRightVolRampings[2]; } else if (bufLen / i <= gAudioBufferParameters.samplesPerUpdateMin) { - chunkLen = gAudioBufferParameters.samplesPerUpdateMin; nextVolRampTable = 0; leftVolRamp = gLeftVolRampings[0]; rightVolRamp = gRightVolRampings[0]; + chunkLen = gAudioBufferParameters.samplesPerUpdateMin; + nextVolRampTable = 0; + leftVolRamp = gLeftVolRampings[0]; + rightVolRamp = gRightVolRampings[0]; } else { - chunkLen = gAudioBufferParameters.samplesPerUpdate; nextVolRampTable = 1; leftVolRamp = gLeftVolRampings[1]; rightVolRamp = gRightVolRampings[1]; + chunkLen = gAudioBufferParameters.samplesPerUpdate; + nextVolRampTable = 1; + leftVolRamp = gLeftVolRampings[1]; + rightVolRamp = gRightVolRampings[1]; } } gCurrentLeftVolRamping = leftVolRamp; @@ -305,7 +314,7 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { prepare_reverb_ring_buffer(chunkLen, gAudioBufferParameters.updatesPerFrame - i, j); } } - cmd = synthesis_do_one_audio_update((s16 *) aiBufPtr, chunkLen, cmd, gAudioBufferParameters.updatesPerFrame - i); + cmd = synthesis_do_one_audio_update((s16*)aiBufPtr, chunkLen, cmd, gAudioBufferParameters.updatesPerFrame - i); bufLen -= chunkLen; aiBufPtr += chunkLen; } @@ -321,11 +330,11 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { } #else // bufLen will be divisible by 16 -u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { +u64* synthesis_execute(u64* cmdBuf, s32* writtenCmds, s16* aiBuf, s32 bufLen) { s32 chunkLen; s32 i; - u32 *aiBufPtr = (u32 *) aiBuf; - u64 *cmd = cmdBuf + 1; + u32* aiBufPtr = (u32*)aiBuf; + u64* cmd = cmdBuf + 1; s32 v0; aSegment(cmdBuf, 0, 0); @@ -347,7 +356,7 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { if (gSynthesisReverb.useReverb != 0) { prepare_reverb_ring_buffer(chunkLen, gAudioUpdatesPerFrame - i); } - cmd = synthesis_do_one_audio_update((s16 *) aiBufPtr, chunkLen, cmd, gAudioUpdatesPerFrame - i); + cmd = synthesis_do_one_audio_update((s16*)aiBufPtr, chunkLen, cmd, gAudioUpdatesPerFrame - i); bufLen -= chunkLen; aiBufPtr += chunkLen; } @@ -360,10 +369,9 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { } #endif - #ifdef VERSION_EU -u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) { - struct ReverbRingBufferItem *item; +u64* synthesis_resample_and_mix_reverb(u64* cmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) { + struct ReverbRingBufferItem* item; s16 startPad; s16 paddedLengthA; @@ -373,45 +381,54 @@ u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s1 if (gSynthesisReverbs[reverbIndex].downsampleRate == 1) { cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengthA, reverbIndex); if (item->lengthB != 0) { - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, reverbIndex); + cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, + reverbIndex); } aSetBuffer(cmd++, 0, 0, 0, DEFAULT_LEN_2CH); aMix(cmd++, 0, 0x7fff, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH); - aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH); + aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, + DMEM_ADDR_WET_LEFT_CH); } else { startPad = (item->startPos % 8u) * 2; paddedLengthA = ALIGN(startPad + item->lengthA, 4); - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, (item->startPos - startPad / 2), DEFAULT_LEN_1CH, reverbIndex); + cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, (item->startPos - startPad / 2), + DEFAULT_LEN_1CH, reverbIndex); if (item->lengthB != 0) { - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + paddedLengthA, 0, DEFAULT_LEN_1CH - paddedLengthA, reverbIndex); + cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + paddedLengthA, 0, + DEFAULT_LEN_1CH - paddedLengthA, reverbIndex); } aSetBuffer(cmd++, 0, DMEM_ADDR_RESAMPLED + startPad, DMEM_ADDR_WET_LEFT_CH, bufLen * 2); - aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateLeft)); + aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, + VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateLeft)); aSetBuffer(cmd++, 0, DMEM_ADDR_RESAMPLED2 + startPad, DMEM_ADDR_WET_RIGHT_CH, bufLen * 2); - aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateRight)); + aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, + VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateRight)); aSetBuffer(cmd++, 0, 0, 0, DEFAULT_LEN_2CH); aMix(cmd++, 0, 0x7fff, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH); - aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH); + aMix(cmd++, 0, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, + DMEM_ADDR_WET_LEFT_CH); } return cmd; } -u64 *synthesis_save_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { - struct ReverbRingBufferItem *item; +u64* synthesis_save_reverb_samples(u64* cmd, s16 reverbIndex, s16 updateIndex) { + struct ReverbRingBufferItem* item; item = &gSynthesisReverbs[reverbIndex].items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex]; if (gSynthesisReverbs[reverbIndex].useReverb != 0) { switch (gSynthesisReverbs[reverbIndex].downsampleRate) { case 1: // Put the oldest samples in the ring buffer into the wet channels - cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengthA, reverbIndex); + cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengthA, + reverbIndex); if (item->lengthB != 0) { // Ring buffer wrapped - cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, reverbIndex); + cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, + item->lengthB, reverbIndex); } break; @@ -419,7 +436,9 @@ u64 *synthesis_save_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { // Downsampling is done later by CPU when RSP is done, therefore we need to have double // buffering. Left and right buffers are adjacent in memory. aSetBuffer(cmd++, 0, 0, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH); - aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex].toDownsampleLeft)); + aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex] + .items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex] + .toDownsampleLeft)); gSynthesisReverbs[reverbIndex].resampleFlags = 0; break; } @@ -429,8 +448,8 @@ u64 *synthesis_save_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { #endif #ifdef VERSION_EU -u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) { - struct NoteSubEu *noteSubEu; +u64* synthesis_do_one_audio_update(s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex) { + struct NoteSubEu* noteSubEu; u8 noteIndices[56]; s32 temp; s32 i; @@ -470,10 +489,8 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI for (; i < notePos; i++) { temp = updateIndex * gMaxSimultaneousNotes; if (j == gNoteSubsEu[temp + noteIndices[i]].reverbIndex) { - cmd = synthesis_process_note(&gNotes[noteIndices[i]], - &gNoteSubsEu[temp + noteIndices[i]], - &gNotes[noteIndices[i]].synthesisState, - aiBuf, bufLen, cmd); + cmd = synthesis_process_note(&gNotes[noteIndices[i]], &gNoteSubsEu[temp + noteIndices[i]], + &gNotes[noteIndices[i]].synthesisState, aiBuf, bufLen, cmd); continue; } else { break; @@ -486,10 +503,8 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI for (; i < notePos; i++) { temp = updateIndex * gMaxSimultaneousNotes; if (IS_BANK_LOAD_COMPLETE(gNoteSubsEu[temp + noteIndices[i]].bankId) == TRUE) { - cmd = synthesis_process_note(&gNotes[noteIndices[i]], - &gNoteSubsEu[temp + noteIndices[i]], - &gNotes[noteIndices[i]].synthesisState, - aiBuf, bufLen, cmd); + cmd = synthesis_process_note(&gNotes[noteIndices[i]], &gNoteSubsEu[temp + noteIndices[i]], + &gNotes[noteIndices[i]].synthesisState, aiBuf, bufLen, cmd); } else { gAudioErrorFlags = (gNoteSubsEu[temp + noteIndices[i]].bankId + (i << 8)) + 0x10000000; } @@ -503,12 +518,12 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI return cmd; } #else -u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) { +u64* synthesis_do_one_audio_update(s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex) { UNUSED s32 pad1[1]; s16 ra; s16 t4; UNUSED s32 pad[2]; - struct ReverbRingBufferItem *v1; + struct ReverbRingBufferItem* v1; UNUSED s32 pad2[1]; s16 temp; @@ -552,11 +567,14 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI ra = ra + temp; } aSetBuffer(cmd++, 0, t4 + DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH, bufLen << 1); - aResample(cmd++, gSynthesisReverb.resampleFlags, (u16) gSynthesisReverb.resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.resampleStateLeft)); + aResample(cmd++, gSynthesisReverb.resampleFlags, (u16)gSynthesisReverb.resampleRate, + VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.resampleStateLeft)); aSetBuffer(cmd++, 0, t4 + DMEM_ADDR_WET_RIGHT_CH, DMEM_ADDR_RIGHT_CH, bufLen << 1); - aResample(cmd++, gSynthesisReverb.resampleFlags, (u16) gSynthesisReverb.resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.resampleStateRight)); + aResample(cmd++, gSynthesisReverb.resampleFlags, (u16)gSynthesisReverb.resampleRate, + VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.resampleStateRight)); aSetBuffer(cmd++, 0, 0, 0, DEFAULT_LEN_2CH); - aMix(cmd++, 0, /*gain*/ 0x8000 + gSynthesisReverb.reverbGain, /*in*/ DMEM_ADDR_LEFT_CH, /*out*/ DMEM_ADDR_LEFT_CH); + aMix(cmd++, 0, /*gain*/ 0x8000 + gSynthesisReverb.reverbGain, /*in*/ DMEM_ADDR_LEFT_CH, + /*out*/ DMEM_ADDR_LEFT_CH); aDMEMMove(cmd++, DMEM_ADDR_LEFT_CH, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH); } cmd = synthesis_process_notes(aiBuf, bufLen, cmd); @@ -570,7 +588,8 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI // Downsampling is done later by CPU when RSP is done, therefore we need to have double // buffering. Left and right buffers are adjacent in memory. aSetBuffer(cmd++, 0, 0, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH); - aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.items[gSynthesisReverb.curFrame][updateIndex].toDownsampleLeft)); + aSaveBuffer(cmd++, VIRTUAL_TO_PHYSICAL2( + gSynthesisReverb.items[gSynthesisReverb.curFrame][updateIndex].toDownsampleLeft)); gSynthesisReverb.resampleFlags = 0; } } @@ -580,47 +599,48 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI #ifdef VERSION_EU // Processes just one note, not all -u64 *synthesis_process_note(struct Note *note, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, UNUSED s16 *aiBuf, s32 bufLen, u64 *cmd) { +u64* synthesis_process_note(struct Note* note, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + UNUSED s16* aiBuf, s32 bufLen, u64* cmd) { UNUSED s32 pad0[3]; #else -u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { - s32 noteIndex; // sp174 - struct Note *note; // s7 +u64* synthesis_process_notes(s16* aiBuf, s32 bufLen, u64* cmd) { + s32 noteIndex; // sp174 + struct Note* note; // s7 UNUSED u8 pad0[0x08]; #endif - struct AudioBankSample *audioBookSample; // sp164, sp138 - struct AdpcmLoop *loopInfo; // sp160, sp134 - s16 *curLoadedBook = NULL; // sp154, sp130 + struct AudioBankSample* audioBookSample; // sp164, sp138 + struct AdpcmLoop* loopInfo; // sp160, sp134 + s16* curLoadedBook = NULL; // sp154, sp130 #ifdef VERSION_EU UNUSED u8 padEU[0x04]; #endif UNUSED u8 pad8[0x04]; #ifndef VERSION_EU - u16 resamplingRateFixedPoint; // sp5c, sp11A + u16 resamplingRateFixedPoint; // sp5c, sp11A #endif - s32 noteFinished; // 150 t2, sp124 - s32 restart; // 14c t3, sp120 - s32 flags; // sp148, sp11C + s32 noteFinished; // 150 t2, sp124 + s32 restart; // 14c t3, sp120 + s32 flags; // sp148, sp11C #ifdef VERSION_EU - u16 resamplingRateFixedPoint; // sp5c, sp11A + u16 resamplingRateFixedPoint; // sp5c, sp11A #endif - UNUSED u8 pad7[0x0c]; // sp100 + UNUSED u8 pad7[0x0c]; // sp100 UNUSED s32 tempBufLen; #ifdef VERSION_EU - s32 sp130; //sp128, sp104 + s32 sp130; // sp128, sp104 UNUSED u32 pad9; #else UNUSED u32 pad9; - s32 sp130; //sp128, sp104 + s32 sp130; // sp128, sp104 #endif s32 nAdpcmSamplesProcessed; // signed required for US s32 t0; #ifdef VERSION_EU - u8 *sampleAddr; // sp120, spF4 + u8* sampleAddr; // sp120, spF4 s32 s6; #else s32 s6; - u8 *sampleAddr; // sp120, spF4 + u8* sampleAddr; // sp120, spF4 #endif #ifdef VERSION_EU @@ -628,8 +648,8 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { // Might have been used to store (samplesLenFixedPoint >> 0x10), but doing so causes strange // behavior with the break near the end of the loop, causing US and JP to need a goto instead UNUSED s32 samplesLenInt; - s32 endPos; // sp110, spE4 - s32 nSamplesToProcess; // sp10c/a0, spE0 + s32 endPos; // sp110, spE4 + s32 nSamplesToProcess; // sp10c/a0, spE0 s32 s2; #else // Might have been used to store (samplesLenFixedPoint >> 0x10), but doing so causes strange @@ -637,13 +657,13 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { UNUSED s32 samplesLenInt; s32 samplesLenAdjusted; // 108 s32 s2; - s32 endPos; // sp110, spE4 - s32 nSamplesToProcess; // sp10c/a0, spE0 + s32 endPos; // sp110, spE4 + s32 nSamplesToProcess; // sp10c/a0, spE0 #endif s32 leftRight; s32 s3; - s32 s5; //s4 + s32 s5; // s4 u32 samplesLenFixedPoint; // v1_1 s32 nSamplesInThisIteration; // v1_2 @@ -651,9 +671,9 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifndef VERSION_EU s32 t9; #endif - u8 *v0_2; - s32 nParts; // spE8, spBC - s32 curPart; // spE4, spB8 + u8* v0_2; + s32 nParts; // spE8, spBC + s32 curPart; // spE4, spB8 #ifndef VERSION_EU f32 resamplingRate; // f12 @@ -666,23 +686,22 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { s32 resampledTempLen; // spD8, spAC u16 noteSamplesDmemAddrBeforeResampling; // spD6, spAA - #ifndef VERSION_EU for (noteIndex = 0; noteIndex < gMaxSimultaneousNotes; noteIndex++) { note = &gNotes[noteIndex]; #ifdef VERSION_US //! This function requires note->enabled to be volatile, but it breaks other functions like note_enable. //! Casting to a struct with just the volatile bitfield works, but there may be a better way to match. - if (((struct vNote *)note)->enabled && IS_BANK_LOAD_COMPLETE(note->bankId) == FALSE) { + if (((struct vNote*)note)->enabled && IS_BANK_LOAD_COMPLETE(note->bankId) == FALSE) { #else if (IS_BANK_LOAD_COMPLETE(note->bankId) == FALSE) { #endif gAudioErrorFlags = (note->bankId << 8) + noteIndex + 0x1000000; - } else if (((struct vNote *)note)->enabled) { + } else if (((struct vNote*)note)->enabled) { #else - if (note->noteSubEu.enabled == FALSE) { - return cmd; - } else { + if (note->noteSubEu.enabled == FALSE) { + return cmd; + } else { #endif flags = 0; #ifdef VERSION_EU @@ -692,20 +711,20 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifdef VERSION_EU if (noteSubEu->needsInit == TRUE) { #else - if (note->needsInit == TRUE) { + if (note->needsInit == TRUE) { #endif flags = A_INIT; #ifndef VERSION_EU note->samplePosInt = 0; note->samplePosFrac = 0; #else - synthesisState->restart = FALSE; - synthesisState->samplePosInt = 0; - synthesisState->samplePosFrac = 0; - synthesisState->curVolLeft = 1; - synthesisState->curVolRight = 1; - synthesisState->prevHeadsetPanRight = 0; - synthesisState->prevHeadsetPanLeft = 0; + synthesisState->restart = FALSE; + synthesisState->samplePosInt = 0; + synthesisState->samplePosFrac = 0; + synthesisState->curVolLeft = 1; + synthesisState->curVolRight = 1; + synthesisState->prevHeadsetPanRight = 0; + synthesisState->prevHeadsetPanLeft = 0; #endif } @@ -729,10 +748,10 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { samplesLenFixedPoint = note->samplePosFrac + (resamplingRateFixedPoint * bufLen) * 2; note->samplePosFrac = samplesLenFixedPoint & 0xFFFF; // 16-bit store, can't reuse #else - resamplingRateFixedPoint = noteSubEu->resamplingRateFixedPoint; - nParts = noteSubEu->hasTwoAdpcmParts + 1; - samplesLenFixedPoint = (resamplingRateFixedPoint * tempBufLen * 2) + synthesisState->samplePosFrac; - synthesisState->samplePosFrac = samplesLenFixedPoint & 0xFFFF; + resamplingRateFixedPoint = noteSubEu->resamplingRateFixedPoint; + nParts = noteSubEu->hasTwoAdpcmParts + 1; + samplesLenFixedPoint = (resamplingRateFixedPoint * tempBufLen * 2) + synthesisState->samplePosFrac; + synthesisState->samplePosFrac = samplesLenFixedPoint & 0xFFFF; #endif #ifdef VERSION_EU @@ -742,14 +761,14 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { synthesisState->samplePosInt += samplesLenFixedPoint >> 0x10; } #else - if (note->sound == NULL) { - // A wave synthesis note (not ADPCM) + if (note->sound == NULL) { + // A wave synthesis note (not ADPCM) - cmd = load_wave_samples(cmd, note, samplesLenFixedPoint >> 0x10); - noteSamplesDmemAddrBeforeResampling = DMEM_ADDR_UNCOMPRESSED_NOTE + note->samplePosInt * 2; - note->samplePosInt += (samplesLenFixedPoint >> 0x10); - flags = 0; - } + cmd = load_wave_samples(cmd, note, samplesLenFixedPoint >> 0x10); + noteSamplesDmemAddrBeforeResampling = DMEM_ADDR_UNCOMPRESSED_NOTE + note->samplePosInt * 2; + note->samplePosInt += (samplesLenFixedPoint >> 0x10); + flags = 0; + } #endif else { // ADPCM note @@ -757,7 +776,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifdef VERSION_EU audioBookSample = noteSubEu->sound.audioBankSound->sample; #else - audioBookSample = note->sound->sample; + audioBookSample = note->sound->sample; #endif loopInfo = audioBookSample->loop; @@ -772,8 +791,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { samplesLenAdjusted = samplesLenFixedPoint >> 0x10; } else if ((samplesLenFixedPoint >> 0x10) & 1) { samplesLenAdjusted = ((samplesLenFixedPoint >> 0x10) & ~1) + (curPart * 2); - } - else { + } else { samplesLenAdjusted = (samplesLenFixedPoint >> 0x10); } @@ -784,8 +802,8 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { nEntries = 16 * audioBookSample->book->order * audioBookSample->book->npredictors; aLoadADPCM(cmd++, nEntries, VIRTUAL_TO_PHYSICAL2(curLoadedBook + noteSubEu->bookOffset)); #else - nEntries = audioBookSample->book->order * audioBookSample->book->npredictors; - aLoadADPCM(cmd++, nEntries * 16, VIRTUAL_TO_PHYSICAL2(curLoadedBook)); + nEntries = audioBookSample->book->order * audioBookSample->book->npredictors; + aLoadADPCM(cmd++, nEntries * 16, VIRTUAL_TO_PHYSICAL2(curLoadedBook)); #endif } @@ -806,8 +824,8 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { s2 = synthesisState->samplePosInt & 0xf; samplesRemaining = endPos - synthesisState->samplePosInt; #else - s2 = note->samplePosInt & 0xf; - samplesRemaining = endPos - note->samplePosInt; + s2 = note->samplePosInt & 0xf; + samplesRemaining = endPos - note->samplePosInt; #endif #ifdef VERSION_EU @@ -815,9 +833,9 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { s2 = 16; } #else - if (s2 == 0 && note->restart == FALSE) { - s2 = 16; - } + if (s2 == 0 && note->restart == FALSE) { + s2 = 16; + } #endif s6 = 16 - s2; // a1 @@ -829,7 +847,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifndef VERSION_EU s0 = samplesRemaining + s2 - 0x10; #else - s0 = samplesRemaining - s6; + s0 = samplesRemaining - s6; #endif s3 = 0; if (s0 <= 0) { @@ -851,35 +869,33 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { if (audioBookSample->loaded == 0x81) { v0_2 = sampleAddr + temp * 9; } else { - v0_2 = dma_sample_data( - (uintptr_t) (sampleAddr + temp * 9), - t0 * 9, flags, &synthesisState->sampleDmaIndex); + v0_2 = dma_sample_data((uintptr_t)(sampleAddr + temp * 9), t0 * 9, flags, + &synthesisState->sampleDmaIndex); } #else - temp = (note->samplePosInt - s2 + 0x10) / 16; -// v0_2 = dma_sample_data( -// (uintptr_t) (sampleAddr + temp * 9), -// t0 * 9, flags, ¬e->sampleDmaIndex); - // Bounds check: ensure we don't read past the sample buffer - { - u32 offset = temp * 9; - u32 size = t0 * 9; - if (audioBookSample->sampleSize > 0 && - offset + size > audioBookSample->sampleSize) { - // Clamp to prevent buffer overflow - if (offset >= audioBookSample->sampleSize) { - offset = 0; - size = 0; - t0 = 0; - } else { - size = audioBookSample->sampleSize - offset; - t0 = size / 9; - } + temp = (note->samplePosInt - s2 + 0x10) / 16; + // v0_2 = dma_sample_data( + // (uintptr_t) (sampleAddr + temp * 9), + // t0 * 9, flags, ¬e->sampleDmaIndex); + // Bounds check: ensure we don't read past the sample buffer + { + u32 offset = temp * 9; + u32 size = t0 * 9; + if (audioBookSample->sampleSize > 0 && offset + size > audioBookSample->sampleSize) { + // Clamp to prevent buffer overflow + if (offset >= audioBookSample->sampleSize) { + offset = 0; + size = 0; + t0 = 0; + } else { + size = audioBookSample->sampleSize - offset; + t0 = size / 9; } - v0_2 = (uintptr_t) (sampleAddr + offset); } + v0_2 = (uintptr_t)(sampleAddr + offset); + } #endif - a3 = (u32)((uintptr_t) v0_2 & 0xf); + a3 = (u32)((uintptr_t)v0_2 & 0xf); aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA, 0, t0 * 9 + a3); aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(v0_2 - a3)); } else { @@ -894,18 +910,18 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { synthesisState->restart = FALSE; } #else - if (note->restart != FALSE) { - aSetLoop(cmd++, VIRTUAL_TO_PHYSICAL2(audioBookSample->loop->state)); - flags = A_LOOP; // = 2 - note->restart = FALSE; - } + if (note->restart != FALSE) { + aSetLoop(cmd++, VIRTUAL_TO_PHYSICAL2(audioBookSample->loop->state)); + flags = A_LOOP; // = 2 + note->restart = FALSE; + } #endif nSamplesInThisIteration = s0 + s6 - s3; #ifdef VERSION_EU if (nAdpcmSamplesProcessed == 0) { - aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, - DMEM_ADDR_UNCOMPRESSED_NOTE, s0 * 2); + aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, DMEM_ADDR_UNCOMPRESSED_NOTE, + s0 * 2); aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); sp130 = s2 * 2; @@ -919,15 +935,17 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2); } #else - if (nAdpcmSamplesProcessed == 0) { - aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, DMEM_ADDR_UNCOMPRESSED_NOTE, s0 * 2); - aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->adpcmdecState)); - sp130 = s2 * 2; - } else { - aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, DMEM_ADDR_UNCOMPRESSED_NOTE + ALIGN(s5, 5), s0 * 2); - aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->adpcmdecState)); - aDMEMMove(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + ALIGN(s5, 5) + (s2 * 2), DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2); - } + if (nAdpcmSamplesProcessed == 0) { + aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, DMEM_ADDR_UNCOMPRESSED_NOTE, s0 * 2); + aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->adpcmdecState)); + sp130 = s2 * 2; + } else { + aSetBuffer(cmd++, 0, DMEM_ADDR_COMPRESSED_ADPCM_DATA + a3, + DMEM_ADDR_UNCOMPRESSED_NOTE + ALIGN(s5, 5), s0 * 2); + aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->adpcmdecState)); + aDMEMMove(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + ALIGN(s5, 5) + (s2 * 2), + DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2); + } #endif nAdpcmSamplesProcessed += nSamplesInThisIteration; @@ -960,9 +978,9 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { note->noteSubEu.finished = 1; note->noteSubEu.enabled = 0; #else - note->samplePosInt = 0; - note->finished = 1; - ((struct vNote *)note)->enabled = 0; + note->samplePosInt = 0; + note->finished = 1; + ((struct vNote*)note)->enabled = 0; #endif break; } @@ -974,12 +992,12 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { synthesisState->samplePosInt += nSamplesToProcess; } #else - if (restart) { - note->restart = TRUE; - note->samplePosInt = loopInfo->start; - } else { - note->samplePosInt += nSamplesToProcess; - } + if (restart) { + note->restart = TRUE; + note->samplePosInt = loopInfo->start; + } else { + note->samplePosInt += nSamplesToProcess; + } #endif } @@ -991,38 +1009,40 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { case 2: switch (curPart) { case 0: - aSetBuffer(cmd++, 0, DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, DMEM_ADDR_RESAMPLED, samplesLenAdjusted + 4); + aSetBuffer(cmd++, 0, DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, DMEM_ADDR_RESAMPLED, + samplesLenAdjusted + 4); #ifdef VERSION_EU - aResample(cmd++, A_INIT, 0xff60, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->dummyResampleState)); + aResample( + cmd++, A_INIT, 0xff60, + VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->dummyResampleState)); #else - aResample(cmd++, A_INIT, 0xff60, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->dummyResampleState)); + aResample(cmd++, A_INIT, 0xff60, + VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->dummyResampleState)); #endif resampledTempLen = samplesLenAdjusted + 4; noteSamplesDmemAddrBeforeResampling = DMEM_ADDR_RESAMPLED + 4; #ifdef VERSION_EU if (noteSubEu->finished != FALSE) { #else - if (note->finished != FALSE) { + if (note->finished != FALSE) { #endif - aClearBuffer(cmd++, DMEM_ADDR_RESAMPLED + resampledTempLen, samplesLenAdjusted + 0x10); + aClearBuffer(cmd++, DMEM_ADDR_RESAMPLED + resampledTempLen, + samplesLenAdjusted + 0x10); } break; case 1: - aSetBuffer(cmd++, 0, DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, - DMEM_ADDR_RESAMPLED2, + aSetBuffer(cmd++, 0, DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, DMEM_ADDR_RESAMPLED2, samplesLenAdjusted + 8); #ifdef VERSION_EU - aResample(cmd++, A_INIT, 0xff60, - VIRTUAL_TO_PHYSICAL2( - synthesisState->synthesisBuffers->dummyResampleState)); + aResample( + cmd++, A_INIT, 0xff60, + VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->dummyResampleState)); #else - aResample(cmd++, A_INIT, 0xff60, - VIRTUAL_TO_PHYSICAL2( - note->synthesisBuffers->dummyResampleState)); + aResample(cmd++, A_INIT, 0xff60, + VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->dummyResampleState)); #endif - aDMEMMove(cmd++, DMEM_ADDR_RESAMPLED2 + 4, - DMEM_ADDR_RESAMPLED + resampledTempLen, + aDMEMMove(cmd++, DMEM_ADDR_RESAMPLED2 + 4, DMEM_ADDR_RESAMPLED + resampledTempLen, samplesLenAdjusted + 4); break; } @@ -1031,7 +1051,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifdef VERSION_EU if (noteSubEu->finished != FALSE) { #else - if (note->finished != FALSE) { + if (note->finished != FALSE) { #endif break; } @@ -1049,13 +1069,13 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { cmd = final_resample(cmd, synthesisState, bufLen * 2, resamplingRateFixedPoint, noteSamplesDmemAddrBeforeResampling, flags); #else - if (note->needsInit == TRUE) { - flags = A_INIT; - note->needsInit = FALSE; - } + if (note->needsInit == TRUE) { + flags = A_INIT; + note->needsInit = FALSE; + } - cmd = final_resample(cmd, note, bufLen * 2, resamplingRateFixedPoint, - noteSamplesDmemAddrBeforeResampling, flags); + cmd = + final_resample(cmd, note, bufLen * 2, resamplingRateFixedPoint, noteSamplesDmemAddrBeforeResampling, flags); #endif #ifdef VERSION_EU @@ -1064,10 +1084,10 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { } else if (noteSubEu->headsetPanLeft != 0 || synthesisState->prevHeadsetPanLeft != 0) { leftRight = 2; #else - if (note->headsetPanRight != 0 || note->prevHeadsetPanRight != 0) { - leftRight = 1; - } else if (note->headsetPanLeft != 0 || note->prevHeadsetPanLeft != 0) { - leftRight = 2; + if (note->headsetPanRight != 0 || note->prevHeadsetPanRight != 0) { + leftRight = 1; + } else if (note->headsetPanLeft != 0 || note->prevHeadsetPanLeft != 0) { + leftRight = 2; #endif } else { leftRight = 0; @@ -1076,7 +1096,7 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { #ifdef VERSION_EU cmd = process_envelope(cmd, noteSubEu, synthesisState, bufLen, 0, leftRight, flags); #else - cmd = process_envelope(cmd, note, bufLen, 0, leftRight, flags); + cmd = process_envelope(cmd, note, bufLen, 0, leftRight, flags); #endif #ifdef VERSION_EU @@ -1084,9 +1104,9 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { cmd = note_apply_headset_pan_effects(cmd, noteSubEu, synthesisState, bufLen * 2, flags, leftRight); } #else - if (note->usesHeadsetPanEffects) { - cmd = note_apply_headset_pan_effects(cmd, note, bufLen * 2, flags, leftRight); - } + if (note->usesHeadsetPanEffects) { + cmd = note_apply_headset_pan_effects(cmd, note, bufLen * 2, flags, leftRight); + } #endif } #ifndef VERSION_EU @@ -1104,7 +1124,8 @@ u64 *synthesis_process_notes(s16 *aiBuf, s32 bufLen, u64 *cmd) { } #ifdef VERSION_EU -u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad) { +u64* load_wave_samples(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + s32 nSamplesToLoad) { s32 a3; s32 repeats; s32 i; @@ -1125,7 +1146,7 @@ u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthes return cmd; } #else -u64 *load_wave_samples(u64 *cmd, struct Note *note, s32 nSamplesToLoad) { +u64* load_wave_samples(u64* cmd, struct Note* note, s32 nSamplesToLoad) { s32 a3; s32 i; aSetBuffer(cmd++, /*flags*/ 0, /*dmemin*/ DMEM_ADDR_UNCOMPRESSED_NOTE, /*dmemout*/ 0, @@ -1135,7 +1156,9 @@ u64 *load_wave_samples(u64 *cmd, struct Note *note, s32 nSamplesToLoad) { a3 = 64 - note->samplePosInt; if (a3 < nSamplesToLoad) { for (i = 0; i <= (nSamplesToLoad - a3 + 63) / 64 - 1; i++) { - aDMEMMove(cmd++, /*dmemin*/ DMEM_ADDR_UNCOMPRESSED_NOTE, /*dmemout*/ DMEM_ADDR_UNCOMPRESSED_NOTE + (1 + i) * sizeof(note->synthesisBuffers->samples), /*count*/ sizeof(note->synthesisBuffers->samples)); + aDMEMMove(cmd++, /*dmemin*/ DMEM_ADDR_UNCOMPRESSED_NOTE, + /*dmemout*/ DMEM_ADDR_UNCOMPRESSED_NOTE + (1 + i) * sizeof(note->synthesisBuffers->samples), + /*count*/ sizeof(note->synthesisBuffers->samples)); } } return cmd; @@ -1143,13 +1166,13 @@ u64 *load_wave_samples(u64 *cmd, struct Note *note, s32 nSamplesToLoad) { #endif #ifdef VERSION_EU -u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags) { +u64* final_resample(u64* cmd, struct NoteSynthesisState* synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags) { aSetBuffer(cmd++, /*flags*/ 0, dmemIn, /*dmemout*/ DMEM_ADDR_TEMP, count); aResample(cmd++, flags, pitch, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->finalResampleState)); return cmd; } #else -u64 *final_resample(u64 *cmd, struct Note *note, s32 count, u16 pitch, u16 dmemIn, u32 flags) { +u64* final_resample(u64* cmd, struct Note* note, s32 count, u16 pitch, u16 dmemIn, u32 flags) { aSetBuffer(cmd++, /*flags*/ 0, dmemIn, /*dmemout*/ DMEM_ADDR_TEMP, count); aResample(cmd++, flags, pitch, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->finalResampleState)); return cmd; @@ -1157,8 +1180,7 @@ u64 *final_resample(u64 *cmd, struct Note *note, s32 count, u16 pitch, u16 dmemI #endif #ifndef VERSION_EU -u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, - UNUSED u32 flags) { +u64* process_envelope(u64* cmd, struct Note* note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { UNUSED u8 pad[16]; struct VolumeChange vol; vol.sourceLeft = note->curVolLeft; @@ -1170,14 +1192,15 @@ u64 *process_envelope(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, s32 return process_envelope_inner(cmd, note, nSamples, inBuf, headsetPanSettings, &vol); } -u64 *process_envelope_inner(u64 *cmd, struct Note *note, s32 nSamples, u16 inBuf, - s32 headsetPanSettings, struct VolumeChange *vol) { +u64* process_envelope_inner(u64* cmd, struct Note* note, s32 nSamples, u16 inBuf, s32 headsetPanSettings, + struct VolumeChange* vol) { UNUSED u8 pad[3]; u8 mixerFlags; UNUSED u8 pad2[8]; s32 rampLeft, rampRight; #elif defined(VERSION_EU) -u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { +u64* process_envelope(u64* cmd, struct NoteSubEu* note, struct NoteSynthesisState* synthesisState, s32 nSamples, + u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { UNUSED u8 pad1[20]; u16 sourceRight; u16 sourceLeft; @@ -1212,18 +1235,15 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat switch (headsetPanSettings) { case 1: aSetBuffer(cmd++, 0, inBuf, DMEM_ADDR_NOTE_PAN_TEMP, nSamples * 2); - aSetBuffer(cmd++, A_AUX, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aSetBuffer(cmd++, A_AUX, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH); break; case 2: aSetBuffer(cmd++, 0, inBuf, DMEM_ADDR_LEFT_CH, nSamples * 2); - aSetBuffer(cmd++, A_AUX, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aSetBuffer(cmd++, A_AUX, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH); break; default: aSetBuffer(cmd++, 0, inBuf, DMEM_ADDR_LEFT_CH, nSamples * 2); - aSetBuffer(cmd++, A_AUX, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aSetBuffer(cmd++, A_AUX, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_RIGHT_CH); break; } } else { @@ -1233,8 +1253,7 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat if (note->stereoStrongRight) { aClearBuffer(cmd++, DMEM_ADDR_STEREO_STRONG_TEMP_DRY, DEFAULT_LEN_2CH); aSetBuffer(cmd++, 0, inBuf, DMEM_ADDR_STEREO_STRONG_TEMP_DRY, nSamples * 2); - aSetBuffer(cmd++, A_AUX, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_STEREO_STRONG_TEMP_WET, - DMEM_ADDR_WET_RIGHT_CH); + aSetBuffer(cmd++, A_AUX, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_STEREO_STRONG_TEMP_WET, DMEM_ADDR_WET_RIGHT_CH); } else if (note->stereoStrongLeft) { aClearBuffer(cmd++, DMEM_ADDR_STEREO_STRONG_TEMP_DRY, DEFAULT_LEN_2CH); aSetBuffer(cmd++, 0, inBuf, DMEM_ADDR_LEFT_CH, nSamples * 2); @@ -1249,8 +1268,7 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat #ifdef VERSION_EU if (targetLeft == sourceLeft && targetRight == sourceRight && !note->envMixerNeedsInit) { #else - if (vol->targetLeft == vol->sourceLeft && vol->targetRight == vol->sourceRight - && !note->envMixerNeedsInit) { + if (vol->targetLeft == vol->sourceLeft && vol->targetRight == vol->sourceRight && !note->envMixerNeedsInit) { #endif mixerFlags = A_CONTINUE; } else { @@ -1282,12 +1300,10 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat #ifdef VERSION_EU if (gUseReverb && note->reverbVol != 0) { - aEnvMixer(cmd++, mixerFlags | A_AUX, - VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->mixEnvelopeState)); + aEnvMixer(cmd++, mixerFlags | A_AUX, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->mixEnvelopeState)); #else if (gSynthesisReverb.useReverb && note->reverbVol != 0) { - aEnvMixer(cmd++, mixerFlags | A_AUX, - VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->mixEnvelopeState)); + aEnvMixer(cmd++, mixerFlags | A_AUX, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->mixEnvelopeState)); #endif if (note->stereoStrongRight) { aSetBuffer(cmd++, 0, 0, 0, nSamples * 2); @@ -1323,9 +1339,10 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat } #ifdef VERSION_EU -u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight) { +u64* note_apply_headset_pan_effects(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* note, s32 bufLen, + s32 flags, s32 leftRight) { #else -u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32 flags, s32 leftRight) { +u64* note_apply_headset_pan_effects(u64* cmd, struct Note* note, s32 bufLen, s32 flags, s32 leftRight) { #endif u16 dest; u16 pitch; @@ -1380,8 +1397,7 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32 #ifdef VERSION_EU pitch = (bufLen << 0xf) / (bufLen + panShift - prevPanShift + 8); - if (pitch) { - } + if (pitch) {} #else pitch = (bufLen << 0xf) / (panShift + bufLen - prevPanShift + 8); #endif @@ -1427,7 +1443,7 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct Note *note, s32 bufLen, s32 #ifndef VERSION_EU // Moved to playback.c in EU -void note_init_volume(struct Note *note) { +void note_init_volume(struct Note* note) { note->targetVolLeft = 0; note->targetVolRight = 0; note->reverbVol = 0; @@ -1438,7 +1454,7 @@ void note_init_volume(struct Note *note) { note->frequency = 0.0f; } -void note_set_vel_pan_reverb(struct Note *note, f32 velocity, f32 pan, u8 reverbVol) { +void note_set_vel_pan_reverb(struct Note* note, f32 velocity, f32 pan, u8 reverbVol) { s32 panIndex; f32 volLeft; f32 volRight; @@ -1496,7 +1512,6 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, f32 pan, u8 reverb velocity = 0; } - float master_vol = CVarGetFloat("gGameMasterVolume", 1.0f); volLeft *= master_vol; volRight *= master_vol; @@ -1529,11 +1544,11 @@ void note_set_vel_pan_reverb(struct Note *note, f32 velocity, f32 pan, u8 reverb } } -void note_set_frequency(struct Note *note, f32 frequency) { +void note_set_frequency(struct Note* note, f32 frequency) { note->frequency = frequency; } -void note_enable(struct Note *note) { +void note_enable(struct Note* note) { note->enabled = TRUE; note->needsInit = TRUE; note->restart = FALSE; @@ -1547,7 +1562,7 @@ void note_enable(struct Note *note) { note->prevHeadsetPanLeft = 0; } -void note_disable(struct Note *note) { +void note_disable(struct Note* note) { if (note->needsInit == TRUE) { note->needsInit = FALSE; } else { diff --git a/src/audio/synthesis_sh.c b/src/audio/synthesis_sh.c index 05e684ea..db2b23c4 100644 --- a/src/audio/synthesis_sh.c +++ b/src/audio/synthesis_sh.c @@ -9,7 +9,6 @@ #include "internal.h" #include "external.h" - #define DMEM_ADDR_TEMP 0x450 #define DMEM_ADDR_RESAMPLED 0x470 #define DMEM_ADDR_RESAMPLED2 0x5f0 @@ -21,16 +20,16 @@ #define DMEM_ADDR_WET_LEFT_CH 0xc90 #define DMEM_ADDR_WET_RIGHT_CH 0xe10 -#define aSetLoadBufferPair(pkt, c, off) \ - aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_LEFT_CH, 0, DEFAULT_LEN_1CH - c); \ - aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ - aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_RIGHT_CH, 0, DEFAULT_LEN_1CH - c); \ +#define aSetLoadBufferPair(pkt, c, off) \ + aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_LEFT_CH, 0, DEFAULT_LEN_1CH - c); \ + aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ + aSetBuffer(pkt, 0, c + DMEM_ADDR_WET_RIGHT_CH, 0, DEFAULT_LEN_1CH - c); \ aLoadBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off))) -#define aSetSaveBufferPair(pkt, c, d, off) \ - aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_LEFT_CH, d); \ - aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ - aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \ +#define aSetSaveBufferPair(pkt, c, d, off) \ + aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_LEFT_CH, d); \ + aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.left + (off))); \ + aSetBuffer(pkt, 0, 0, c + DMEM_ADDR_WET_RIGHT_CH, d); \ aSaveBuffer(pkt, VIRTUAL_TO_PHYSICAL2(gSynthesisReverb.ringBuffer.right + (off))); #define ALIGN(val, amnt) (((val) + (1 << amnt) - 1) & ~((1 << amnt) - 1)) @@ -42,12 +41,16 @@ struct VolumeChange { u16 targetRight; }; -u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex); -u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex); -u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad); -u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags); -u64 *process_envelope(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, u32 flags); -u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight); +u64* synthesis_do_one_audio_update(s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex); +u64* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex); +u64* load_wave_samples(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + s32 nSamplesToLoad); +u64* final_resample(u64* cmd, struct NoteSynthesisState* synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags); +u64* process_envelope(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, s32 nSamples, + u16 inBuf, s32 headsetPanSettings, u32 flags); +u64* note_apply_headset_pan_effects(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* note, s32 bufLen, + s32 flags, s32 leftRight); struct SynthesisReverb gSynthesisReverbs[4]; u8 sAudioSynthesisPad[0x10]; @@ -56,14 +59,14 @@ s16 gVolume; s8 gUseReverb; s8 gNumSynthesisReverbs; s16 D_SH_803479B4; // contains 4096 -struct NoteSubEu *gNoteSubsEu; +struct NoteSubEu* gNoteSubsEu; // Equivalent functionality as the US/JP version, // just that the reverb structure is chosen from an array with index // Identical in EU. void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) { - struct ReverbRingBufferItem *item; - struct SynthesisReverb *reverb = &gSynthesisReverbs[reverbIndex]; + struct ReverbRingBufferItem* item; + struct SynthesisReverb* reverb = &gSynthesisReverbs[reverbIndex]; s32 srcPos; s32 dstPos; s32 nSamples; @@ -78,12 +81,9 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) // Touches both left and right since they are adjacent in memory osInvalDCache(item->toDownsampleLeft, DEFAULT_LEN_2CH); - for (srcPos = 0, dstPos = 0; dstPos < item->lengthA / 2; - srcPos += reverb->downsampleRate, dstPos++) { - reverb->ringBuffer.left[item->startPos + dstPos] = - item->toDownsampleLeft[srcPos]; - reverb->ringBuffer.right[item->startPos + dstPos] = - item->toDownsampleRight[srcPos]; + for (srcPos = 0, dstPos = 0; dstPos < item->lengthA / 2; srcPos += reverb->downsampleRate, dstPos++) { + reverb->ringBuffer.left[item->startPos + dstPos] = item->toDownsampleLeft[srcPos]; + reverb->ringBuffer.right[item->startPos + dstPos] = item->toDownsampleRight[srcPos]; } for (dstPos = 0; dstPos < item->lengthB / 2; srcPos += reverb->downsampleRate, dstPos++) { reverb->ringBuffer.left[dstPos] = item->toDownsampleLeft[srcPos]; @@ -99,7 +99,7 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) // There is space in the ring buffer before it wraps around item->lengthA = nSamples * 2; item->lengthB = 0; - item->startPos = (s32) reverb->nextRingBufferPos; + item->startPos = (s32)reverb->nextRingBufferPos; reverb->nextRingBufferPos += nSamples; } else { // Ring buffer wrapped around @@ -113,17 +113,15 @@ void prepare_reverb_ring_buffer(s32 chunkLen, u32 updateIndex, s32 reverbIndex) item->chunkLen = chunkLen; } -u64 *synthesis_load_reverb_ring_buffer(u64 *cmd, u16 addr, u16 srcOffset, s32 len, s32 reverbIndex) { - aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.left[srcOffset]), - addr, len); +u64* synthesis_load_reverb_ring_buffer(u64* cmd, u16 addr, u16 srcOffset, s32 len, s32 reverbIndex) { + aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.left[srcOffset]), addr, len); aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.right[srcOffset]), addr + DEFAULT_LEN_1CH, len); return cmd; } -u64 *synthesis_save_reverb_ring_buffer(u64 *cmd, u16 addr, u16 destOffset, s32 len, s32 reverbIndex) { - aSaveBuffer(cmd++, addr, - VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.left[destOffset]), len); +u64* synthesis_save_reverb_ring_buffer(u64* cmd, u16 addr, u16 destOffset, s32 len, s32 reverbIndex) { + aSaveBuffer(cmd++, addr, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.left[destOffset]), len); aSaveBuffer(cmd++, addr + DEFAULT_LEN_1CH, VIRTUAL_TO_PHYSICAL2(&gSynthesisReverbs[reverbIndex].ringBuffer.right[destOffset]), len); return cmd; @@ -142,8 +140,8 @@ void func_sh_802ed644(s32 updateIndexStart, s32 noteIndex) { } void synthesis_load_note_subs_eu(s32 updateIndex) { - struct NoteSubEu *src; - struct NoteSubEu *dest; + struct NoteSubEu* src; + struct NoteSubEu* dest; s32 i; for (i = 0; i < gMaxSimultaneousNotes; i++) { @@ -159,17 +157,17 @@ void synthesis_load_note_subs_eu(s32 updateIndex) { } // TODO: (Scrub C) pointless mask and whitespace -u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { +u64* synthesis_execute(u64* cmdBuf, s32* writtenCmds, s16* aiBuf, s32 bufLen) { s32 i, j; - u32 *aiBufPtr; - u64 *cmd = cmdBuf; + u32* aiBufPtr; + u64* cmd = cmdBuf; s32 chunkLen; for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) { process_sequences(i - 1); synthesis_load_note_subs_eu(gAudioBufferParameters.updatesPerFrame - i); } - aiBufPtr = (u32 *) aiBuf; + aiBufPtr = (u32*)aiBuf; for (i = gAudioBufferParameters.updatesPerFrame; i > 0; i--) { if (i == 1) { chunkLen = bufLen; @@ -187,7 +185,7 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { prepare_reverb_ring_buffer(chunkLen, gAudioBufferParameters.updatesPerFrame - i, j); } } - cmd = synthesis_do_one_audio_update((s16 *) aiBufPtr, chunkLen, cmd, gAudioBufferParameters.updatesPerFrame - i); + cmd = synthesis_do_one_audio_update((s16*)aiBufPtr, chunkLen, cmd, gAudioBufferParameters.updatesPerFrame - i); bufLen -= chunkLen; aiBufPtr += chunkLen; } @@ -202,8 +200,8 @@ u64 *synthesis_execute(u64 *cmdBuf, s32 *writtenCmds, s16 *aiBuf, s32 bufLen) { return cmd; } -u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) { - struct ReverbRingBufferItem *item; +u64* synthesis_resample_and_mix_reverb(u64* cmd, s32 bufLen, s16 reverbIndex, s16 updateIndex) { + struct ReverbRingBufferItem* item; s16 startPad; s16 paddedLengthA; @@ -212,40 +210,49 @@ u64 *synthesis_resample_and_mix_reverb(u64 *cmd, s32 bufLen, s16 reverbIndex, s1 if (gSynthesisReverbs[reverbIndex].downsampleRate == 1) { cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengthA, reverbIndex); if (item->lengthB != 0) { - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, reverbIndex); + cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, + reverbIndex); } aAddMixer(cmd++, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH, DEFAULT_LEN_2CH); - aMix(cmd++, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH); + aMix(cmd++, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH, + DEFAULT_LEN_2CH); } else { startPad = (item->startPos % 8u) * 2; paddedLengthA = ALIGN(startPad + item->lengthA, 4); - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, (item->startPos - startPad / 2), DEFAULT_LEN_1CH, reverbIndex); + cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, (item->startPos - startPad / 2), + DEFAULT_LEN_1CH, reverbIndex); if (item->lengthB != 0) { - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + paddedLengthA, 0, DEFAULT_LEN_1CH - paddedLengthA, reverbIndex); + cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + paddedLengthA, 0, + DEFAULT_LEN_1CH - paddedLengthA, reverbIndex); } aSetBuffer(cmd++, 0, DMEM_ADDR_RESAMPLED + startPad, DMEM_ADDR_WET_LEFT_CH, bufLen * 2); - aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateLeft)); + aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, + VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateLeft)); aSetBuffer(cmd++, 0, DMEM_ADDR_RESAMPLED2 + startPad, DMEM_ADDR_WET_RIGHT_CH, bufLen * 2); - aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateRight)); + aResample(cmd++, gSynthesisReverbs[reverbIndex].resampleFlags, gSynthesisReverbs[reverbIndex].resampleRate, + VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].resampleStateRight)); aAddMixer(cmd++, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_LEFT_CH, DEFAULT_LEN_2CH); - aMix(cmd++, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_2CH); + aMix(cmd++, 0x8000 + gSynthesisReverbs[reverbIndex].reverbGain, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_WET_LEFT_CH, + DEFAULT_LEN_2CH); } if (gSynthesisReverbs[reverbIndex].panRight != 0 || gSynthesisReverbs[reverbIndex].panLeft != 0) { // Leak some audio from the left reverb channel into the right reverb channel and vice versa (pan) aDMEMMove(cmd++, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_RESAMPLED, DEFAULT_LEN_1CH); - aMix(cmd++, gSynthesisReverbs[reverbIndex].panRight, DMEM_ADDR_WET_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, DEFAULT_LEN_1CH); - aMix(cmd++, gSynthesisReverbs[reverbIndex].panLeft, DMEM_ADDR_RESAMPLED, DMEM_ADDR_WET_RIGHT_CH, DEFAULT_LEN_1CH); + aMix(cmd++, gSynthesisReverbs[reverbIndex].panRight, DMEM_ADDR_WET_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, + DEFAULT_LEN_1CH); + aMix(cmd++, gSynthesisReverbs[reverbIndex].panLeft, DMEM_ADDR_RESAMPLED, DMEM_ADDR_WET_RIGHT_CH, + DEFAULT_LEN_1CH); } return cmd; } -u64 *synthesis_load_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { - struct ReverbRingBufferItem *item; - struct SynthesisReverb *reverb; +u64* synthesis_load_reverb_samples(u64* cmd, s16 reverbIndex, s16 updateIndex) { + struct ReverbRingBufferItem* item; + struct SynthesisReverb* reverb; reverb = &gSynthesisReverbs[reverbIndex]; item = &reverb->items[reverb->curFrame][updateIndex]; @@ -253,22 +260,25 @@ u64 *synthesis_load_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, item->startPos, item->lengthA, reverbIndex); if (item->lengthB != 0) { // Ring buffer wrapped - cmd = synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + item->lengthA, 0, item->lengthB, reverbIndex); + cmd = + synthesis_load_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + item->lengthA, 0, item->lengthB, reverbIndex); } return cmd; } -u64 *synthesis_save_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { - struct ReverbRingBufferItem *item; +u64* synthesis_save_reverb_samples(u64* cmd, s16 reverbIndex, s16 updateIndex) { + struct ReverbRingBufferItem* item; item = &gSynthesisReverbs[reverbIndex].items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex]; switch (gSynthesisReverbs[reverbIndex].downsampleRate) { case 1: // Put the oldest samples in the ring buffer into the wet channels - cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengthA, reverbIndex); + cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH, item->startPos, item->lengthA, + reverbIndex); if (item->lengthB != 0) { // Ring buffer wrapped - cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, reverbIndex); + cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_WET_LEFT_CH + item->lengthA, 0, item->lengthB, + reverbIndex); } break; @@ -276,16 +286,19 @@ u64 *synthesis_save_reverb_samples(u64 *cmd, s16 reverbIndex, s16 updateIndex) { // Downsampling is done later by CPU when RSP is done, therefore we need to have double // buffering. Left and right buffers are adjacent in memory. aSaveBuffer(cmd++, DMEM_ADDR_WET_LEFT_CH, - VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex].items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex].toDownsampleLeft), DEFAULT_LEN_2CH); + VIRTUAL_TO_PHYSICAL2(gSynthesisReverbs[reverbIndex] + .items[gSynthesisReverbs[reverbIndex].curFrame][updateIndex] + .toDownsampleLeft), + DEFAULT_LEN_2CH); break; } gSynthesisReverbs[reverbIndex].resampleFlags = 0; return cmd; } -u64 *func_sh_802EDF24(u64 *cmd, s16 reverbIndex, s16 updateIndex) { - struct ReverbRingBufferItem *item; - struct SynthesisReverb *reverb; +u64* func_sh_802EDF24(u64* cmd, s16 reverbIndex, s16 updateIndex) { + struct ReverbRingBufferItem* item; + struct SynthesisReverb* reverb; reverb = &gSynthesisReverbs[reverbIndex]; item = &reverb->items[reverb->curFrame][updateIndex]; @@ -293,13 +306,14 @@ u64 *func_sh_802EDF24(u64 *cmd, s16 reverbIndex, s16 updateIndex) { cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED, item->startPos, item->lengthA, reverbIndex); if (item->lengthB != 0) { // Ring buffer wrapped - cmd = synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + item->lengthA, 0, item->lengthB, reverbIndex); + cmd = + synthesis_save_reverb_ring_buffer(cmd, DMEM_ADDR_RESAMPLED + item->lengthA, 0, item->lengthB, reverbIndex); } return cmd; } -u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) { - struct NoteSubEu *noteSubEu; +u64* synthesis_do_one_audio_update(s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex) { + struct NoteSubEu* noteSubEu; u8 noteIndices[56]; s32 temp; s32 i; @@ -339,10 +353,8 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI for (; i < notePos; i++) { temp = updateIndex * gMaxSimultaneousNotes; if (j == gNoteSubsEu[temp + noteIndices[i]].reverbIndex) { - cmd = synthesis_process_note(noteIndices[i], - &gNoteSubsEu[temp + noteIndices[i]], - &gNotes[noteIndices[i]].synthesisState, - aiBuf, bufLen, cmd, updateIndex); + cmd = synthesis_process_note(noteIndices[i], &gNoteSubsEu[temp + noteIndices[i]], + &gNotes[noteIndices[i]].synthesisState, aiBuf, bufLen, cmd, updateIndex); continue; } else { break; @@ -361,18 +373,17 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI if (gSynthesisReverbs[j].unk5 != -1) { if (gSynthesisReverbs[gSynthesisReverbs[j].unk5].downsampleRate == 1) { cmd = synthesis_load_reverb_samples(cmd, gSynthesisReverbs[j].unk5, updateIndex); - aMix(cmd++, gSynthesisReverbs[j].unk08, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_RESAMPLED, DEFAULT_LEN_2CH); + aMix(cmd++, gSynthesisReverbs[j].unk08, DMEM_ADDR_WET_LEFT_CH, DMEM_ADDR_RESAMPLED, + DEFAULT_LEN_2CH); cmd = func_sh_802EDF24(cmd++, gSynthesisReverbs[j].unk5, updateIndex); } } } } for (; i < notePos; i++) { - struct NoteSubEu *noteSubEu2 = &gNoteSubsEu[updateIndex * gMaxSimultaneousNotes + noteIndices[i]]; - cmd = synthesis_process_note(noteIndices[i], - noteSubEu2, - &gNotes[noteIndices[i]].synthesisState, - aiBuf, bufLen, cmd, updateIndex); + struct NoteSubEu* noteSubEu2 = &gNoteSubsEu[updateIndex * gMaxSimultaneousNotes + noteIndices[i]]; + cmd = synthesis_process_note(noteIndices[i], noteSubEu2, &gNotes[noteIndices[i]].synthesisState, aiBuf, bufLen, + cmd, updateIndex); } temp = bufLen * 2; @@ -381,56 +392,57 @@ u64 *synthesis_do_one_audio_update(s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateI return cmd; } -u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, UNUSED s16 *aiBuf, s32 bufLen, u64 *cmd, s32 updateIndex) { +u64* synthesis_process_note(s32 noteIndex, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + UNUSED s16* aiBuf, s32 bufLen, u64* cmd, s32 updateIndex) { UNUSED s32 pad0[3]; - struct AudioBankSample *audioBookSample; // sp164, sp138 - struct AdpcmLoop *loopInfo; // sp160, sp134 - s16 *curLoadedBook; // sp154, sp130 + struct AudioBankSample* audioBookSample; // sp164, sp138 + struct AdpcmLoop* loopInfo; // sp160, sp134 + s16* curLoadedBook; // sp154, sp130 UNUSED u8 padEU[0x04]; UNUSED u8 pad8[0x04]; - s32 noteFinished; // 150 t2, sp124 - s32 restart; // 14c t3, sp120 - s32 flags; // sp148, sp11C, t8 + s32 noteFinished; // 150 t2, sp124 + s32 restart; // 14c t3, sp120 + s32 flags; // sp148, sp11C, t8 u16 resamplingRateFixedPoint; // sp5c, sp11A - s32 nSamplesToLoad; //s0, Ec - UNUSED u8 pad7[0x0c]; // sp100 - s32 sp130; //sp128, sp104 + s32 nSamplesToLoad; // s0, Ec + UNUSED u8 pad7[0x0c]; // sp100 + s32 sp130; // sp128, sp104 UNUSED s32 tempBufLen; UNUSED u32 pad9; s32 t0; - u8 *sampleAddr; // sp120, spF4 + u8* sampleAddr; // sp120, spF4 s32 s6; - s32 samplesLenAdjusted; // 108, spEC + s32 samplesLenAdjusted; // 108, spEC s32 nAdpcmSamplesProcessed; // signed required for US // spc0 - s32 endPos; // sp110, spE4 - s32 nSamplesToProcess; // sp10c/a0, spE0 + s32 endPos; // sp110, spE4 + s32 nSamplesToProcess; // sp10c/a0, spE0 // Might have been used to store (samplesLenFixedPoint >> 0x10), but doing so causes strange // behavior with the break near the end of the loop, causing US and JP to need a goto instead UNUSED s32 samplesLenInt; s32 s2; - s32 leftRight; //s0 - s32 s5; //s4 - u32 samplesLenFixedPoint; // v1_1 - s32 s3; // spA0 + s32 leftRight; // s0 + s32 s5; // s4 + u32 samplesLenFixedPoint; // v1_1 + s32 s3; // spA0 s32 nSamplesInThisIteration; // v1_2 u32 a3; - u8 *v0_2; + u8* v0_2; s32 unk_s6; // sp90 s32 s5Aligned; s32 sp88; s32 sp84; u32 temp; - s32 nParts; // spE8, spBC + s32 nParts; // spE8, spBC s32 curPart; // spE4, spB8 s32 aligned; UNUSED u32 padSH1; - s32 resampledTempLen; // spD8, spAC, sp6c + s32 resampledTempLen; // spD8, spAC, sp6c u16 noteSamplesDmemAddrBeforeResampling; // spD6, spAA, sp6a -- 6C UNUSED u32 padSH2; UNUSED u32 padSH3; UNUSED u32 padSH4; - struct Note *note; // sp58 - u16 sp56; // sp56 + struct Note* note; // sp58 + u16 sp56; // sp56 u16 addr; u8 synthesisVolume; @@ -467,7 +479,6 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N sp56 = 0; } - synthesisState->unk5 = nParts; if (noteSubEu->isSyntheticWave) { @@ -483,7 +494,7 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N resampledTempLen = 0; for (curPart = 0; curPart < nParts; curPart++) { nAdpcmSamplesProcessed = 0; // s8 - s5 = 0; // s4 + s5 = 0; // s4 if (nParts == 1) { samplesLenAdjusted = nSamplesToLoad; @@ -557,7 +568,8 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N sp88 = 0x10; sp84 = 0; break; - case CODEC_SKIP: goto skip; + case CODEC_SKIP: + goto skip; } if (t0 != 0) { temp = (synthesisState->samplePosInt + sp88 - s2) / 16; @@ -565,7 +577,8 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N v0_2 = sp84 + (temp * unk_s6) + sampleAddr; } else { v0_2 = dma_sample_data((uintptr_t)(sp84 + (temp * unk_s6) + sampleAddr), - ALIGN(t0 * unk_s6 + 16, 4), flags, &synthesisState->sampleDmaIndex, audioBookSample->medium); + ALIGN(t0 * unk_s6 + 16, 4), flags, &synthesisState->sampleDmaIndex, + audioBookSample->medium); } a3 = ((uintptr_t)v0_2 & 0xf); @@ -588,7 +601,8 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N aligned = ALIGN(t0 * unk_s6 + 16, 4); addr = (DMEM_ADDR_COMPRESSED_ADPCM_DATA - aligned) & 0xffff; aSetBuffer(cmd++, 0, addr + a3, DMEM_ADDR_UNCOMPRESSED_NOTE, s0 * 2); - aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); + aADPCMdec(cmd++, flags, + VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); break; case CODEC_S8: aligned = ALIGN(t0 * unk_s6 + 16, 4); @@ -605,7 +619,8 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N aligned = ALIGN(t0 * unk_s6 + 16, 4); addr = (DMEM_ADDR_COMPRESSED_ADPCM_DATA - aligned) & 0xffff; aSetBuffer(cmd++, 0, addr + a3, DMEM_ADDR_UNCOMPRESSED_NOTE + s5Aligned, s0 * 2); - aADPCMdec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); + aADPCMdec(cmd++, flags, + VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); break; case CODEC_S8: aligned = ALIGN(t0 * unk_s6 + 16, 4); @@ -614,7 +629,8 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N aS8Dec(cmd++, flags, VIRTUAL_TO_PHYSICAL2(synthesisState->synthesisBuffers->adpcmdecState)); break; } - aDMEMMove(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + s5Aligned + (s2 * 2), DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2); + aDMEMMove(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + s5Aligned + (s2 * 2), + DMEM_ADDR_UNCOMPRESSED_NOTE + s5, (nSamplesInThisIteration) * 2); } nAdpcmSamplesProcessed += nSamplesInThisIteration; switch (flags) { @@ -634,10 +650,10 @@ u64 *synthesis_process_note(s32 noteIndex, struct NoteSubEu *noteSubEu, struct N break; } flags = 0; -skip: + skip: if (noteFinished) { aClearBuffer(cmd++, DMEM_ADDR_UNCOMPRESSED_NOTE + s5, - (samplesLenAdjusted - nAdpcmSamplesProcessed) * 2); + (samplesLenAdjusted - nAdpcmSamplesProcessed) * 2); noteSubEu->finished = 1; note->noteSubEu.finished = 1; func_sh_802ed644(updateIndex, noteIndex); @@ -658,15 +674,19 @@ skip: case 2: switch (curPart) { case 0: - aDownsampleHalf(cmd++, ALIGN(samplesLenAdjusted / 2, 3), DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, DMEM_ADDR_RESAMPLED); + aDownsampleHalf(cmd++, ALIGN(samplesLenAdjusted / 2, 3), + DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, DMEM_ADDR_RESAMPLED); resampledTempLen = samplesLenAdjusted; noteSamplesDmemAddrBeforeResampling = DMEM_ADDR_RESAMPLED; if (noteSubEu->finished != FALSE) { - aClearBuffer(cmd++, noteSamplesDmemAddrBeforeResampling + resampledTempLen, samplesLenAdjusted + 0x10); + aClearBuffer(cmd++, noteSamplesDmemAddrBeforeResampling + resampledTempLen, + samplesLenAdjusted + 0x10); } break; case 1: - aDownsampleHalf(cmd++, ALIGN(samplesLenAdjusted / 2, 3), DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, resampledTempLen + DMEM_ADDR_RESAMPLED); + aDownsampleHalf(cmd++, ALIGN(samplesLenAdjusted / 2, 3), + DMEM_ADDR_UNCOMPRESSED_NOTE + sp130, + resampledTempLen + DMEM_ADDR_RESAMPLED); break; } } @@ -681,8 +701,8 @@ skip: noteSubEu->needsInit = FALSE; } flags = flags | sp56; - cmd = final_resample(cmd, synthesisState, bufLen * 2, resamplingRateFixedPoint, - noteSamplesDmemAddrBeforeResampling, flags); + cmd = final_resample(cmd, synthesisState, bufLen * 2, resamplingRateFixedPoint, noteSamplesDmemAddrBeforeResampling, + flags); if ((flags & 1) != 0) { flags = 1; } @@ -690,7 +710,6 @@ skip: if (noteSubEu->filter) { aFilter(cmd++, 0x02, bufLen * 2, noteSubEu->filter); aFilter(cmd++, flags, DMEM_ADDR_TEMP, synthesisState->synthesisBuffers->filterBuffer); - } if (noteSubEu->bookOffset == 3) { @@ -724,11 +743,11 @@ skip: return cmd; } -u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *synthesisState, s32 nSamplesToLoad) { +u64* load_wave_samples(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* synthesisState, + s32 nSamplesToLoad) { s32 a3; s32 repeats; - aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(noteSubEu->sound.samples), - DMEM_ADDR_UNCOMPRESSED_NOTE, 128); + aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(noteSubEu->sound.samples), DMEM_ADDR_UNCOMPRESSED_NOTE, 128); synthesisState->samplePosInt &= 0x3f; a3 = 64 - synthesisState->samplePosInt; @@ -736,15 +755,15 @@ u64 *load_wave_samples(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthes repeats = (nSamplesToLoad - a3 + 63) / 64; if (repeats != 0) { aDuplicate(cmd++, - /*dmemin*/ DMEM_ADDR_UNCOMPRESSED_NOTE, - /*dmemout*/ DMEM_ADDR_UNCOMPRESSED_NOTE + 128, - /*copies*/ repeats); + /*dmemin*/ DMEM_ADDR_UNCOMPRESSED_NOTE, + /*dmemout*/ DMEM_ADDR_UNCOMPRESSED_NOTE + 128, + /*copies*/ repeats); } } return cmd; } -u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags) { +u64* final_resample(u64* cmd, struct NoteSynthesisState* synthesisState, s32 count, u16 pitch, u16 dmemIn, u32 flags) { if (pitch == 0) { aClearBuffer(cmd++, DMEM_ADDR_TEMP, count); } else { @@ -754,7 +773,8 @@ u64 *final_resample(u64 *cmd, struct NoteSynthesisState *synthesisState, s32 cou return cmd; } -u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisState *synthesisState, s32 nSamples, u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { +u64* process_envelope(u64* cmd, struct NoteSubEu* note, struct NoteSynthesisState* synthesisState, s32 nSamples, + u16 inBuf, s32 headsetPanSettings, UNUSED u32 flags) { u16 sourceRight; u16 sourceLeft; u16 targetLeft; @@ -801,52 +821,33 @@ u64 *process_envelope(u64 *cmd, struct NoteSubEu *note, struct NoteSynthesisStat switch (headsetPanSettings) { case 1: - aEnvMixer(cmd++, - inBuf, nSamples, - (sourceReverbVol & 0x80) >> 7, - note->stereoStrongRight, note->stereoStrongLeft, - DMEM_ADDR_NOTE_PAN_TEMP, - DMEM_ADDR_RIGHT_CH, - DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aEnvMixer(cmd++, inBuf, nSamples, (sourceReverbVol & 0x80) >> 7, note->stereoStrongRight, + note->stereoStrongLeft, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, + DMEM_ADDR_WET_RIGHT_CH); break; case 2: - aEnvMixer(cmd++, - inBuf, nSamples, - (sourceReverbVol & 0x80) >> 7, - note->stereoStrongRight, note->stereoStrongLeft, - DMEM_ADDR_LEFT_CH, - DMEM_ADDR_NOTE_PAN_TEMP, - DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aEnvMixer(cmd++, inBuf, nSamples, (sourceReverbVol & 0x80) >> 7, note->stereoStrongRight, + note->stereoStrongLeft, DMEM_ADDR_LEFT_CH, DMEM_ADDR_NOTE_PAN_TEMP, DMEM_ADDR_WET_LEFT_CH, + DMEM_ADDR_WET_RIGHT_CH); break; default: - aEnvMixer(cmd++, - inBuf, nSamples, - (sourceReverbVol & 0x80) >> 7, - note->stereoStrongRight, note->stereoStrongLeft, - DMEM_ADDR_LEFT_CH, - DMEM_ADDR_RIGHT_CH, - DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aEnvMixer(cmd++, inBuf, nSamples, (sourceReverbVol & 0x80) >> 7, note->stereoStrongRight, + note->stereoStrongLeft, DMEM_ADDR_LEFT_CH, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, + DMEM_ADDR_WET_RIGHT_CH); break; } } else { aEnvSetup1(cmd++, (sourceReverbVol & 0x7f) * 2, rampReverb, rampLeft, rampRight); aEnvSetup2(cmd++, sourceLeft, sourceRight); - aEnvMixer(cmd++, - inBuf, nSamples, - (sourceReverbVol & 0x80) >> 7, - note->stereoStrongRight, note->stereoStrongLeft, - DMEM_ADDR_LEFT_CH, - DMEM_ADDR_RIGHT_CH, - DMEM_ADDR_WET_LEFT_CH, - DMEM_ADDR_WET_RIGHT_CH); + aEnvMixer(cmd++, inBuf, nSamples, (sourceReverbVol & 0x80) >> 7, note->stereoStrongRight, + note->stereoStrongLeft, DMEM_ADDR_LEFT_CH, DMEM_ADDR_RIGHT_CH, DMEM_ADDR_WET_LEFT_CH, + DMEM_ADDR_WET_RIGHT_CH); } return cmd; } -u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struct NoteSynthesisState *note, s32 bufLen, s32 flags, s32 leftRight) { +u64* note_apply_headset_pan_effects(u64* cmd, struct NoteSubEu* noteSubEu, struct NoteSynthesisState* note, s32 bufLen, + s32 flags, s32 leftRight) { u16 dest; u16 pitch; u8 prevPanShift; @@ -884,8 +885,8 @@ u64 *note_apply_headset_pan_effects(u64 *cmd, struct NoteSubEu *noteSubEu, struc } if (prevPanShift != 0) { - aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->panSamplesBuffer), - DMEM_ADDR_NOTE_PAN_TEMP, ALIGN(prevPanShift, 4)); + aLoadBuffer(cmd++, VIRTUAL_TO_PHYSICAL2(note->synthesisBuffers->panSamplesBuffer), DMEM_ADDR_NOTE_PAN_TEMP, + ALIGN(prevPanShift, 4)); aDMEMMove(cmd++, DMEM_ADDR_TEMP, DMEM_ADDR_NOTE_PAN_TEMP + prevPanShift, bufLen + panShift - prevPanShift); } else { aDMEMMove(cmd++, DMEM_ADDR_TEMP, DMEM_ADDR_NOTE_PAN_TEMP, bufLen + panShift); diff --git a/src/buffers/buffers.c b/src/buffers/buffers.c index ee73dbe3..58164dd6 100644 --- a/src/buffers/buffers.c +++ b/src/buffers/buffers.c @@ -28,7 +28,6 @@ ALIGNED8 struct SaveBuffer gSaveBuffer; // 0x190a0 bytes struct GfxPool gGfxPools[2]; - // Yield buffer for audio, 0x400 bytes. Stubbed out post-JP since the audio // task never yields. #ifdef VERSION_JP diff --git a/src/engine/behavior_script.c b/src/engine/behavior_script.c index c7093b9e..27149b23 100644 --- a/src/engine/behavior_script.c +++ b/src/engine/behavior_script.c @@ -15,23 +15,23 @@ #include "surface_collision.h" // Macros for retrieving arguments from behavior scripts. -#define BHV_CMD_GET_1ST_U8(index) (u8)((gCurBhvCommand[index] >> 24) & 0xFF) // unused -#define BHV_CMD_GET_2ND_U8(index) (u8)((gCurBhvCommand[index] >> 16) & 0xFF) -#define BHV_CMD_GET_3RD_U8(index) (u8)((gCurBhvCommand[index] >> 8) & 0xFF) -#define BHV_CMD_GET_4TH_U8(index) (u8)((gCurBhvCommand[index]) & 0xFF) +#define BHV_CMD_GET_1ST_U8(index) (u8)((gCurBhvCommand[index] >> 24) & 0xFF) // unused +#define BHV_CMD_GET_2ND_U8(index) (u8)((gCurBhvCommand[index] >> 16) & 0xFF) +#define BHV_CMD_GET_3RD_U8(index) (u8)((gCurBhvCommand[index] >> 8) & 0xFF) +#define BHV_CMD_GET_4TH_U8(index) (u8)((gCurBhvCommand[index]) & 0xFF) #define BHV_CMD_GET_1ST_S16(index) (s16)(gCurBhvCommand[index] >> 16) #define BHV_CMD_GET_2ND_S16(index) (s16)(gCurBhvCommand[index] & 0xFFFF) -#define BHV_CMD_GET_U32(index) (u32)(gCurBhvCommand[index]) -#define BHV_CMD_GET_VPTR(index) (void *)(gCurBhvCommand[index]) +#define BHV_CMD_GET_U32(index) (u32)(gCurBhvCommand[index]) +#define BHV_CMD_GET_VPTR(index) (void*)(gCurBhvCommand[index]) #define BHV_CMD_GET_ADDR_OF_CMD(index) (uintptr_t)(&gCurBhvCommand[index]) static u16 gRandomSeed16; // Unused function that directly jumps to a behavior command and resets the object's stack index. -UNUSED static void goto_behavior_unused(const BehaviorScript *bhvAddr) { +UNUSED static void goto_behavior_unused(const BehaviorScript* bhvAddr) { gCurBhvCommand = segmented_to_virtual(bhvAddr); gCurrentObject->bhvStackIndex = 0; } @@ -68,7 +68,7 @@ u16 random_u16(void) { // Generate a pseudorandom float in the range [0, 1). f32 random_float(void) { f32 rnd = random_u16(); - return rnd / (double) 0x10000; + return rnd / (double)0x10000; } // Return either -1 or 1 with a 50:50 chance. @@ -81,7 +81,7 @@ s32 random_sign(void) { } // Update an object's graphical position and rotation to match its real position and rotation. -void obj_update_gfx_pos_and_angle(struct Object *obj) { +void obj_update_gfx_pos_and_angle(struct Object* obj) { obj->header.gfx.pos[0] = obj->oPosX; obj->header.gfx.pos[1] = obj->oPosY + obj->oGraphYOffset; obj->header.gfx.pos[2] = obj->oPosZ; @@ -155,9 +155,9 @@ static s32 bhv_cmd_set_model(void) { // Usage: SPAWN_CHILD(modelID, behavior) static s32 bhv_cmd_spawn_child(void) { u32 model = BHV_CMD_GET_U32(1); - const BehaviorScript *behavior = BHV_CMD_GET_VPTR(2); + const BehaviorScript* behavior = BHV_CMD_GET_VPTR(2); - struct Object *child = spawn_object_at_origin(gCurrentObject, 0, model, behavior); + struct Object* child = spawn_object_at_origin(gCurrentObject, 0, model, behavior); obj_copy_pos_and_angle(child, gCurrentObject); gCurBhvCommand += 3; @@ -168,9 +168,9 @@ static s32 bhv_cmd_spawn_child(void) { // Usage: SPAWN_OBJ(modelID, behavior) static s32 bhv_cmd_spawn_obj(void) { u32 model = BHV_CMD_GET_U32(1); - const BehaviorScript *behavior = BHV_CMD_GET_VPTR(2); + const BehaviorScript* behavior = BHV_CMD_GET_VPTR(2); - struct Object *object = spawn_object_at_origin(gCurrentObject, 0, model, behavior); + struct Object* object = spawn_object_at_origin(gCurrentObject, 0, model, behavior); obj_copy_pos_and_angle(object, gCurrentObject); // TODO: Does this cmd need renaming? This line is the only difference between this and the above func. gCurrentObject->prevObj = object; @@ -184,9 +184,9 @@ static s32 bhv_cmd_spawn_obj(void) { static s32 bhv_cmd_spawn_child_with_param(void) { u32 bhvParam = BHV_CMD_GET_2ND_S16(0); u32 modelID = BHV_CMD_GET_U32(1); - const BehaviorScript *behavior = BHV_CMD_GET_VPTR(2); + const BehaviorScript* behavior = BHV_CMD_GET_VPTR(2); - struct Object *child = spawn_object_at_origin(gCurrentObject, 0, modelID, behavior); + struct Object* child = spawn_object_at_origin(gCurrentObject, 0, modelID, behavior); obj_copy_pos_and_angle(child, gCurrentObject); child->oBehParams2ndByte = bhvParam; @@ -216,7 +216,7 @@ static s32 bhv_cmd_break_unused(void) { // Command 0x02: Jumps to a new behavior command and stores the return address in the object's behavior stack. // Usage: CALL(addr) static s32 bhv_cmd_call(void) { - const BehaviorScript *jumpAddress; + const BehaviorScript* jumpAddress; gCurBhvCommand++; cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(1)); // Store address of the next bhv command in the stack. @@ -229,7 +229,7 @@ static s32 bhv_cmd_call(void) { // Command 0x03: Jumps back to the behavior command stored in the object's behavior stack. Used after CALL. // Usage: RETURN() static s32 bhv_cmd_return(void) { - gCurBhvCommand = (const BehaviorScript *) cur_obj_bhv_stack_pop(); // Retrieve command address and jump to it. + gCurBhvCommand = (const BehaviorScript*)cur_obj_bhv_stack_pop(); // Retrieve command address and jump to it. return BHV_PROC_CONTINUE; } @@ -242,7 +242,8 @@ static s32 bhv_cmd_delay(void) { gCurrentObject->bhvDelayTimer++; // Increment timer } else { gCurrentObject->bhvDelayTimer = 0; - gCurBhvCommand++; // Delay ended, move to next bhv command (note: following commands will not execute until next frame) + gCurBhvCommand++; // Delay ended, move to next bhv command (note: following commands will not execute until next + // frame) } return BHV_PROC_BREAK; @@ -267,7 +268,7 @@ static s32 bhv_cmd_delay_var(void) { // Command 0x04: Jumps to a new behavior script without saving anything. // Usage: GOTO(addr) static s32 bhv_cmd_goto(void) { - gCurBhvCommand++; // Useless + gCurBhvCommand++; // Useless gCurBhvCommand = segmented_to_virtual(BHV_CMD_GET_VPTR(0)); // Jump directly to address return BHV_PROC_CONTINUE; } @@ -279,7 +280,7 @@ static s32 bhv_cmd_begin_repeat_unused(void) { s32 count = BHV_CMD_GET_2ND_U8(0); cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(1)); // Store address of the first command of the loop in the stack - cur_obj_bhv_stack_push(count); // Store repeat count in the stack too + cur_obj_bhv_stack_push(count); // Store repeat count in the stack too gCurBhvCommand++; return BHV_PROC_CONTINUE; @@ -291,7 +292,7 @@ static s32 bhv_cmd_begin_repeat(void) { s32 count = BHV_CMD_GET_2ND_S16(0); cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(1)); // Store address of the first command of the loop in the stack - cur_obj_bhv_stack_push(count); // Store repeat count in the stack too + cur_obj_bhv_stack_push(count); // Store repeat count in the stack too gCurBhvCommand++; return BHV_PROC_CONTINUE; @@ -304,11 +305,11 @@ static s32 bhv_cmd_end_repeat(void) { count--; if (count != 0) { - gCurBhvCommand = (const BehaviorScript *) cur_obj_bhv_stack_pop(); // Jump back to the first command in the loop + gCurBhvCommand = (const BehaviorScript*)cur_obj_bhv_stack_pop(); // Jump back to the first command in the loop // Save address and count to the stack again cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(0)); cur_obj_bhv_stack_push(count); - } else { // Finished iterating over the loop + } else { // Finished iterating over the loop cur_obj_bhv_stack_pop(); // Necessary to remove address from the stack gCurBhvCommand++; } @@ -317,18 +318,18 @@ static s32 bhv_cmd_end_repeat(void) { return BHV_PROC_BREAK; } -// Command 0x07: Also marks the end of a repeating loop, but continues executing commands following the loop on the same frame. -// Usage: END_REPEAT_CONTINUE() +// Command 0x07: Also marks the end of a repeating loop, but continues executing commands following the loop on the same +// frame. Usage: END_REPEAT_CONTINUE() static s32 bhv_cmd_end_repeat_continue(void) { u32 count = cur_obj_bhv_stack_pop(); count--; if (count != 0) { - gCurBhvCommand = (const BehaviorScript *) cur_obj_bhv_stack_pop(); // Jump back to the first command in the loop + gCurBhvCommand = (const BehaviorScript*)cur_obj_bhv_stack_pop(); // Jump back to the first command in the loop // Save address and count to the stack again cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(0)); cur_obj_bhv_stack_push(count); - } else { // Finished iterating over the loop + } else { // Finished iterating over the loop cur_obj_bhv_stack_pop(); // Necessary to remove address from the stack gCurBhvCommand++; } @@ -349,8 +350,8 @@ static s32 bhv_cmd_begin_loop(void) { // Command 0x09: Marks the end of an infinite loop. // Usage: END_LOOP() static s32 bhv_cmd_end_loop(void) { - gCurBhvCommand = (const BehaviorScript *) cur_obj_bhv_stack_pop(); // Jump back to the first command in the loop - cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(0)); // Save address to the stack again + gCurBhvCommand = (const BehaviorScript*)cur_obj_bhv_stack_pop(); // Jump back to the first command in the loop + cur_obj_bhv_stack_push(BHV_CMD_GET_ADDR_OF_CMD(0)); // Save address to the stack again return BHV_PROC_BREAK; } @@ -428,8 +429,8 @@ static s32 bhv_cmd_set_random_int(void) { return BHV_PROC_CONTINUE; } -// Command 0x13: Gets a random short, right shifts it the specified amount and adds min to it, then sets the specified field to that value. -// Usage: SET_INT_RAND_RSHIFT(field, min, rshift) +// Command 0x13: Gets a random short, right shifts it the specified amount and adds min to it, then sets the specified +// field to that value. Usage: SET_INT_RAND_RSHIFT(field, min, rshift) static s32 bhv_cmd_set_int_rand_rshift(void) { u8 field = BHV_CMD_GET_2ND_U8(0); s32 min = BHV_CMD_GET_2ND_S16(0); @@ -454,8 +455,8 @@ static s32 bhv_cmd_add_random_float(void) { return BHV_PROC_CONTINUE; } -// Command 0x17: Gets a random short, right shifts it the specified amount and adds min to it, then adds the value to the specified field. Unused. -// Usage: ADD_INT_RAND_RSHIFT(field, min, rshift) +// Command 0x17: Gets a random short, right shifts it the specified amount and adds min to it, then adds the value to +// the specified field. Unused. Usage: ADD_INT_RAND_RSHIFT(field, min, rshift) static s32 bhv_cmd_add_int_rand_rshift(void) { u8 field = BHV_CMD_GET_2ND_U8(0); s32 min = BHV_CMD_GET_2ND_S16(0); @@ -535,7 +536,7 @@ static s32 bhv_cmd_load_animations(void) { // Usage: ANIMATE(animIndex) static s32 bhv_cmd_animate(void) { s32 animIndex = BHV_CMD_GET_2ND_U8(0); - struct Animation **animations = gCurrentObject->oAnimations; + struct Animation** animations = gCurrentObject->oAnimations; geo_obj_init_animation(&gCurrentObject->header.gfx, &animations[animIndex]); @@ -731,7 +732,7 @@ static s32 bhv_cmd_set_int_random_from_table(void) { // Command 0x2A: Loads collision data for the object. // Usage: LOAD_COLLISION_DATA(collisionData) static s32 bhv_cmd_load_collision_data(void) { - u32 *collisionData = segmented_to_virtual(BHV_CMD_GET_VPTR(1)); + u32* collisionData = segmented_to_virtual(BHV_CMD_GET_VPTR(1)); gCurrentObject->collisionData = collisionData; @@ -780,7 +781,6 @@ static s32 bhv_cmd_scale(void) { return BHV_PROC_CONTINUE; } - // Command 0x30: Sets various parameters that the object uses for calculating physics. // Usage: SET_OBJ_PHYSICS(wallHitboxRadius, gravity, bounciness, dragStrength, friction, buoyancy, unused1, unused2) static s32 bhv_cmd_set_obj_physics(void) { @@ -817,7 +817,7 @@ static s32 bhv_cmd_parent_bit_clear(void) { // Command 0x37: Spawns a water droplet with the given parameters. // Usage: SPAWN_WATER_DROPLET(dropletParams) static s32 bhv_cmd_spawn_water_droplet(void) { - struct WaterDropletParams *dropletParams = BHV_CMD_GET_VPTR(1); + struct WaterDropletParams* dropletParams = BHV_CMD_GET_VPTR(1); spawn_water_droplet(gCurrentObject, dropletParams); @@ -903,7 +903,8 @@ static BhvCommandProc BehaviorCmdTable[] = { bhv_cmd_spawn_water_droplet, }; -// Execute the behavior script of the current object, process the object flags, and other miscellaneous code for updating objects. +// Execute the behavior script of the current object, process the object flags, and other miscellaneous code for +// updating objects. void cur_obj_update(void) { UNUSED u8 filler[4]; @@ -927,8 +928,8 @@ void cur_obj_update(void) { // If the object's action has changed, reset the action timer. if (gCurrentObject->oAction != gCurrentObject->oPrevAction) { - (void) (gCurrentObject->oTimer = 0, gCurrentObject->oSubAction = 0, - gCurrentObject->oPrevAction = gCurrentObject->oAction); + (void)(gCurrentObject->oTimer = 0, gCurrentObject->oSubAction = 0, + gCurrentObject->oPrevAction = gCurrentObject->oAction); } // Execute the behavior script. @@ -948,12 +949,12 @@ void cur_obj_update(void) { // If the object's action has changed, reset the action timer. if (gCurrentObject->oAction != gCurrentObject->oPrevAction) { - (void) (gCurrentObject->oTimer = 0, gCurrentObject->oSubAction = 0, - gCurrentObject->oPrevAction = gCurrentObject->oAction); + (void)(gCurrentObject->oTimer = 0, gCurrentObject->oSubAction = 0, + gCurrentObject->oPrevAction = gCurrentObject->oAction); } // Execute various code based on object flags. - objFlags = (s16) gCurrentObject->oFlags; + objFlags = (s16)gCurrentObject->oFlags; if (objFlags & OBJ_FLAG_SET_FACE_ANGLE_TO_MOVE_ANGLE) { obj_set_face_angle_to_move_angle(gCurrentObject); diff --git a/src/engine/geo_layout.c b/src/engine/geo_layout.c index 25ec6c62..64463539 100644 --- a/src/engine/geo_layout.c +++ b/src/engine/geo_layout.c @@ -47,8 +47,8 @@ GeoLayoutCommandProc GeoLayoutJumpTable[] = { }; struct GraphNode gObjParentGraphNode; -struct AllocOnlyPool *gGraphNodePool; -struct GraphNode *gCurRootGraphNode; +struct AllocOnlyPool* gGraphNodePool; +struct GraphNode* gCurRootGraphNode; UNUSED s32 D_8038BCA8; @@ -91,16 +91,16 @@ UNUSED s32 D_8038BCA8; * so everything was reduced to a single ObjectParent with a single group, and * camera switching was all done in one node. End of speculation. */ -struct GraphNode **gGeoViews; +struct GraphNode** gGeoViews; u16 gGeoNumViews; // length of gGeoViews array uintptr_t gGeoLayoutStack[16]; -struct GraphNode *gCurGraphNodeList[32]; +struct GraphNode* gCurGraphNodeList[32]; s16 gCurGraphNodeIndex; s16 gGeoLayoutStackIndex; // similar to SP register in MIPS UNUSED s16 D_8038BD7C; s16 gGeoLayoutReturnIndex; // similar to RA register in MIPS -u8 *gGeoLayoutCommand; +u8* gGeoLayoutCommand; u32 unused_8038B894[3] = { 0 }; @@ -109,7 +109,7 @@ u32 unused_8038B894[3] = { 0 }; cmd+0x04: void *branchTarget */ void geo_layout_cmd_branch_and_link(void) { - gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + CMD_PROCESS_OFFSET(8)); + 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)); @@ -120,7 +120,7 @@ void geo_layout_cmd_end(void) { gGeoLayoutStackIndex = gGeoLayoutReturnIndex; gGeoLayoutReturnIndex = gGeoLayoutStack[--gGeoLayoutStackIndex] & 0xFFFF; gCurGraphNodeIndex = gGeoLayoutStack[gGeoLayoutStackIndex] >> 16; - gGeoLayoutCommand = (u8 *) gGeoLayoutStack[--gGeoLayoutStackIndex]; + gGeoLayoutCommand = (u8*)gGeoLayoutStack[--gGeoLayoutStackIndex]; } /* @@ -129,7 +129,7 @@ void geo_layout_cmd_end(void) { */ void geo_layout_cmd_branch(void) { if (cur_geo_cmd_u8(0x01) == 1) { - gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t) (gGeoLayoutCommand + CMD_PROCESS_OFFSET(8)); + gGeoLayoutStack[gGeoLayoutStackIndex++] = (uintptr_t)(gGeoLayoutCommand + CMD_PROCESS_OFFSET(8)); } gGeoLayoutCommand = segmented_to_virtual(cur_geo_cmd_ptr(0x04)); @@ -137,7 +137,7 @@ void geo_layout_cmd_branch(void) { // 0x03: Return from branch void geo_layout_cmd_return(void) { - gGeoLayoutCommand = (u8 *) gGeoLayoutStack[--gGeoLayoutStackIndex]; + gGeoLayoutCommand = (u8*)gGeoLayoutStack[--gGeoLayoutStackIndex]; } // 0x04: Open node @@ -203,7 +203,7 @@ void geo_layout_cmd_update_node_flags(void) { */ void geo_layout_cmd_node_root(void) { s32 i; - struct GraphNodeRoot *graphNode; + struct GraphNodeRoot* graphNode; s16 x = cur_geo_cmd_s16(0x04); s16 y = cur_geo_cmd_s16(0x06); @@ -218,7 +218,7 @@ void geo_layout_cmd_node_root(void) { graphNode = init_graph_node_root(gGraphNodePool, NULL, 0, x, y, width, height); // TODO: check type - gGeoViews = alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode *)); + gGeoViews = alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(struct GraphNode*)); graphNode->views = gGeoViews; graphNode->numViews = gGeoNumViews; @@ -237,8 +237,8 @@ void geo_layout_cmd_node_root(void) { 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; + struct GraphNodeOrthoProjection* graphNode; + f32 scale = (f32)cur_geo_cmd_s16(0x02) / 100.0f; graphNode = init_graph_node_ortho_projection(gGraphNodePool, NULL, scale); @@ -256,7 +256,7 @@ void geo_layout_cmd_node_ortho_projection(void) { [cmd+0x08: GraphNodeFunc frustumFunc] */ void geo_layout_cmd_node_perspective(void) { - struct GraphNodePerspective *graphNode; + struct GraphNodePerspective* graphNode; GraphNodeFunc frustumFunc = NULL; s16 fov = cur_geo_cmd_s16(0x02); s16 near = cur_geo_cmd_s16(0x04); @@ -264,11 +264,11 @@ void geo_layout_cmd_node_perspective(void) { 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); + graphNode = init_graph_node_perspective(gGraphNodePool, NULL, (f32)fov, near, far, frustumFunc, 0); register_scene_graph_node(&graphNode->fnNode.node); @@ -280,7 +280,7 @@ void geo_layout_cmd_node_perspective(void) { additional functionality */ void geo_layout_cmd_node_start(void) { - struct GraphNodeStart *graphNode; + struct GraphNodeStart* graphNode; graphNode = init_graph_node_start(gGraphNodePool, NULL); @@ -299,7 +299,7 @@ void geo_layout_cmd_nop3(void) { cmd+0x01: u8 enableZBuffer (1 = on, 0 = off) */ void geo_layout_cmd_node_master_list(void) { - struct GraphNodeMasterList *graphNode; + struct GraphNodeMasterList* graphNode; graphNode = init_graph_node_master_list(gGraphNodePool, NULL, cur_geo_cmd_u8(0x01)); @@ -315,7 +315,7 @@ void geo_layout_cmd_node_master_list(void) { cmd+0x06: s16 maxDistance */ void geo_layout_cmd_node_level_of_detail(void) { - struct GraphNodeLevelOfDetail *graphNode; + struct GraphNodeLevelOfDetail* graphNode; s16 minDistance = cur_geo_cmd_s16(0x04); s16 maxDistance = cur_geo_cmd_s16(0x06); @@ -335,14 +335,13 @@ void geo_layout_cmd_node_level_of_detail(void) { Used for animating coins, blinking, color selection, etc. */ void geo_layout_cmd_node_switch_case(void) { - struct GraphNodeSwitchCase *graphNode; + 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); + 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); register_scene_graph_node(&graphNode->fnNode.node); @@ -361,16 +360,16 @@ void geo_layout_cmd_node_switch_case(void) { cmd+0x10: GraphNodeFunc func */ void geo_layout_cmd_node_camera(void) { - struct GraphNodeCamera *graphNode; - s16 *cmdPos = (s16 *) &gGeoLayoutCommand[4]; + struct GraphNodeCamera* graphNode; + 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)); + graphNode = init_graph_node_camera(gGraphNodePool, NULL, pos, focus, (GraphNodeFunc)cur_geo_cmd_ptr(0x10), + cur_geo_cmd_s16(0x02)); register_scene_graph_node(&graphNode->fnNode.node); @@ -414,15 +413,15 @@ void geo_layout_cmd_node_camera(void) { [cmd+var: void *displayList] */ void geo_layout_cmd_node_translation_rotation(void) { - struct GraphNodeTranslationRotation *graphNode; + struct GraphNodeTranslationRotation* graphNode; Vec3s translation, rotation; - void *displayList = NULL; + 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) { case 0: @@ -445,16 +444,16 @@ void geo_layout_cmd_node_translation_rotation(void) { } if (params & 0x80) { - displayList = *(void **) &cmdPos[0]; + displayList = *(void**)&cmdPos[0]; drawingLayer = params & 0x0F; cmdPos += 2 << CMD_SIZE_SHIFT; } - graphNode = init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList, - translation, rotation); + graphNode = + init_graph_node_translation_rotation(gGraphNodePool, NULL, drawingLayer, displayList, translation, rotation); register_scene_graph_node(&graphNode->node); - gGeoLayoutCommand = (u8 *) cmdPos; + gGeoLayoutCommand = (u8*)cmdPos; } /* @@ -468,29 +467,28 @@ void geo_layout_cmd_node_translation_rotation(void) { [cmd+0x08: void *displayList] */ void geo_layout_cmd_node_translation(void) { - struct GraphNodeTranslation *graphNode; + struct GraphNodeTranslation* graphNode; Vec3s translation; s16 drawingLayer = 0; s16 params = cur_geo_cmd_u8(0x01); - s16 *cmdPos = (s16 *) gGeoLayoutCommand; - void *displayList = NULL; + s16* cmdPos = (s16*)gGeoLayoutCommand; + void* displayList = NULL; cmdPos = read_vec3s(translation, &cmdPos[1]); if (params & 0x80) { - displayList = *(void **) &cmdPos[0]; + displayList = *(void**)&cmdPos[0]; drawingLayer = params & 0x0F; cmdPos += 2 << CMD_SIZE_SHIFT; } - graphNode = - init_graph_node_translation(gGraphNodePool, NULL, drawingLayer, displayList, translation); + graphNode = init_graph_node_translation(gGraphNodePool, NULL, drawingLayer, displayList, translation); register_scene_graph_node(&graphNode->node); - gGeoLayoutCommand = (u8 *) cmdPos; + gGeoLayoutCommand = (u8*)cmdPos; } /* @@ -504,19 +502,19 @@ void geo_layout_cmd_node_translation(void) { [cmd+0x08: void *displayList] */ void geo_layout_cmd_node_rotation(void) { - struct GraphNodeRotation *graphNode; + struct GraphNodeRotation* graphNode; Vec3s sp2c; s16 drawingLayer = 0; s16 params = cur_geo_cmd_u8(0x01); - s16 *cmdPos = (s16 *) gGeoLayoutCommand; - void *displayList = NULL; + s16* cmdPos = (s16*)gGeoLayoutCommand; + void* displayList = NULL; cmdPos = read_vec3s_angle(sp2c, &cmdPos[1]); if (params & 0x80) { - displayList = *(void **) &cmdPos[0]; + displayList = *(void**)&cmdPos[0]; drawingLayer = params & 0x0F; cmdPos += 2 << CMD_SIZE_SHIFT; } @@ -525,7 +523,7 @@ void geo_layout_cmd_node_rotation(void) { register_scene_graph_node(&graphNode->node); - gGeoLayoutCommand = (u8 *) cmdPos; + gGeoLayoutCommand = (u8*)cmdPos; } /* @@ -537,12 +535,12 @@ void geo_layout_cmd_node_rotation(void) { [cmd+0x08: void *displayList] */ void geo_layout_cmd_node_scale(void) { - struct GraphNodeScale *graphNode; + struct GraphNodeScale* graphNode; s16 drawingLayer = 0; s16 params = cur_geo_cmd_u8(0x01); f32 scale = cur_geo_cmd_u32(0x04) / 65536.0f; - void *displayList = NULL; + void* displayList = NULL; if (params & 0x80) { displayList = cur_geo_cmd_ptr(0x08); @@ -571,16 +569,15 @@ void geo_layout_cmd_nop2(void) { cmd+0x08: void *displayList */ void geo_layout_cmd_node_animated_part(void) { - struct GraphNodeAnimatedPart *graphNode; + struct GraphNodeAnimatedPart* graphNode; Vec3s translation; s32 drawingLayer = cur_geo_cmd_u8(0x01); - void *displayList = cur_geo_cmd_ptr(0x08); - s16 *cmdPos = (s16 *) gGeoLayoutCommand; + void* displayList = cur_geo_cmd_ptr(0x08); + s16* cmdPos = (s16*)gGeoLayoutCommand; read_vec3s(translation, &cmdPos[1]); - graphNode = - init_graph_node_animated_part(gGraphNodePool, NULL, drawingLayer, displayList, translation); + graphNode = init_graph_node_animated_part(gGraphNodePool, NULL, drawingLayer, displayList, translation); register_scene_graph_node(&graphNode->node); @@ -598,17 +595,17 @@ void geo_layout_cmd_node_animated_part(void) { [cmd+0x08: void *displayList] */ void geo_layout_cmd_node_billboard(void) { - struct GraphNodeBillboard *graphNode; + struct GraphNodeBillboard* graphNode; Vec3s translation; s16 drawingLayer = 0; s16 params = cur_geo_cmd_u8(0x01); - s16 *cmdPos = (s16 *) gGeoLayoutCommand; - void *displayList = NULL; + s16* cmdPos = (s16*)gGeoLayoutCommand; + void* displayList = NULL; cmdPos = read_vec3s(translation, &cmdPos[1]); if (params & 0x80) { - displayList = *(void **) &cmdPos[0]; + displayList = *(void**)&cmdPos[0]; drawingLayer = params & 0x0F; cmdPos += 2 << CMD_SIZE_SHIFT; } @@ -617,7 +614,7 @@ void geo_layout_cmd_node_billboard(void) { register_scene_graph_node(&graphNode->node); - gGeoLayoutCommand = (u8 *) cmdPos; + gGeoLayoutCommand = (u8*)cmdPos; } /* @@ -626,9 +623,9 @@ void geo_layout_cmd_node_billboard(void) { cmd+0x04: void *displayList */ void geo_layout_cmd_node_display_list(void) { - struct GraphNodeDisplayList *graphNode; + struct GraphNodeDisplayList* graphNode; s32 drawingLayer = cur_geo_cmd_u8(0x01); - void *displayList = cur_geo_cmd_ptr(0x04); + void* displayList = cur_geo_cmd_ptr(0x04); graphNode = init_graph_node_display_list(gGraphNodePool, NULL, drawingLayer, displayList); @@ -644,7 +641,7 @@ void geo_layout_cmd_node_display_list(void) { cmd+0x06: s16 shadowScale */ void geo_layout_cmd_node_shadow(void) { - struct GraphNodeShadow *graphNode; + struct GraphNodeShadow* graphNode; u8 shadowType = cur_geo_cmd_s16(0x02); u8 shadowSolidity = cur_geo_cmd_s16(0x04); s16 shadowScale = cur_geo_cmd_s16(0x06); @@ -658,7 +655,7 @@ 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; + struct GraphNodeObjectParent* graphNode; graphNode = init_graph_node_object_parent(gGraphNodePool, NULL, &gObjParentGraphNode); @@ -673,11 +670,11 @@ void geo_layout_cmd_node_object_parent(void) { cmd+0x04: GraphNodeFunc func */ void geo_layout_cmd_node_generated(void) { - struct GraphNodeGenerated *graphNode; + struct GraphNodeGenerated* graphNode; graphNode = init_graph_node_generated(gGraphNodePool, NULL, - (GraphNodeFunc) cur_geo_cmd_ptr(0x04), // asm function - cur_geo_cmd_s16(0x02)); // parameter + (GraphNodeFunc)cur_geo_cmd_ptr(0x04), // asm function + cur_geo_cmd_s16(0x02)); // parameter register_scene_graph_node(&graphNode->fnNode.node); @@ -690,13 +687,13 @@ void geo_layout_cmd_node_generated(void) { cmd+0x04: GraphNodeFunc backgroundFunc */ void geo_layout_cmd_node_background(void) { - struct GraphNodeBackground *graphNode; + struct GraphNodeBackground* graphNode; - 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 - 0); + 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 + 0); register_scene_graph_node(&graphNode->fnNode.node); @@ -714,15 +711,15 @@ void geo_layout_cmd_nop(void) { cmd+0x02: s16 index (of gGeoViews) */ void geo_layout_cmd_copy_view(void) { - struct GraphNodeObjectParent *graphNode; - struct GraphNode *node = NULL; + struct GraphNodeObjectParent* graphNode; + struct GraphNode* node = NULL; s16 index = cur_geo_cmd_s16(0x02); if (index >= 0) { node = gGeoViews[index]; if (node->type == GRAPH_NODE_TYPE_OBJECT_PARENT) { - node = ((struct GraphNodeObjectParent *) node)->sharedChild; + node = ((struct GraphNodeObjectParent*)node)->sharedChild; } else { node = NULL; } @@ -744,13 +741,13 @@ void geo_layout_cmd_copy_view(void) { cmd+0x08: GraphNodeFunc nodeFunc */ void geo_layout_cmd_node_held_obj(void) { - struct GraphNodeHeldObject *graphNode; + struct GraphNodeHeldObject* graphNode; 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)); + graphNode = init_graph_node_held_object(gGraphNodePool, NULL, NULL, offset, (GraphNodeFunc)cur_geo_cmd_ptr(0x08), + cur_geo_cmd_u8(0x01)); register_scene_graph_node(&graphNode->fnNode.node); @@ -763,13 +760,13 @@ void geo_layout_cmd_node_held_obj(void) { cmd+0x02: s16 cullingRadius */ void geo_layout_cmd_node_culling_radius(void) { - struct GraphNodeCullingRadius *graphNode; + struct GraphNodeCullingRadius* graphNode; 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; @@ -787,7 +784,7 @@ struct GraphNode *process_geo_layout(struct AllocOnlyPool *pool, void *segptr) { gGeoLayoutStack[0] = 0; gGeoLayoutStack[1] = 0; - if(GameEngine_OTRSigCheck(segptr) == 1){ + if (GameEngine_OTRSigCheck(segptr) == 1) { GeoLayoutExecute(segptr); } else { gGeoLayoutCommand = segmented_to_virtual(segptr); diff --git a/src/engine/graph_node.c b/src/engine/graph_node.c index 75c4899f..b10def56 100644 --- a/src/engine/graph_node.c +++ b/src/engine/graph_node.c @@ -22,7 +22,7 @@ UNUSED Vec3s gVec3sOne = { 1, 1, 1 }; * Initialize a geo node with a given type. Sets all links such that there * are no siblings, parent or children for this node. */ -void init_scene_graph_node_links(struct GraphNode *graphNode, s32 type) { +void init_scene_graph_node_links(struct GraphNode* graphNode, s32 type) { graphNode->type = type; graphNode->flags = GRAPH_RENDER_ACTIVE; graphNode->prev = graphNode; @@ -34,8 +34,8 @@ void init_scene_graph_node_links(struct GraphNode *graphNode, s32 type) { /** * Allocated and returns a newly created root node */ -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) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeRoot)); } @@ -59,9 +59,8 @@ struct GraphNodeRoot *init_graph_node_root(struct AllocOnlyPool *pool, struct Gr /** * Allocates and returns a newly created otrhographic projection node */ -struct GraphNodeOrthoProjection * -init_graph_node_ortho_projection(struct AllocOnlyPool *pool, struct GraphNodeOrthoProjection *graphNode, - f32 scale) { +struct GraphNodeOrthoProjection* +init_graph_node_ortho_projection(struct AllocOnlyPool* pool, struct GraphNodeOrthoProjection* graphNode, f32 scale) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeOrthoProjection)); } @@ -77,10 +76,9 @@ init_graph_node_ortho_projection(struct AllocOnlyPool *pool, struct GraphNodeOrt /** * Allocates and returns a newly created perspective node */ -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) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodePerspective)); } @@ -105,8 +103,7 @@ struct GraphNodePerspective *init_graph_node_perspective(struct AllocOnlyPool *p /** * Allocates and returns a newly created start node */ -struct GraphNodeStart *init_graph_node_start(struct AllocOnlyPool *pool, - struct GraphNodeStart *graphNode) { +struct GraphNodeStart* init_graph_node_start(struct AllocOnlyPool* pool, struct GraphNodeStart* graphNode) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeStart)); } @@ -121,8 +118,8 @@ struct GraphNodeStart *init_graph_node_start(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created master list node */ -struct GraphNodeMasterList *init_graph_node_master_list(struct AllocOnlyPool *pool, - struct GraphNodeMasterList *graphNode, s16 on) { +struct GraphNodeMasterList* init_graph_node_master_list(struct AllocOnlyPool* pool, + struct GraphNodeMasterList* graphNode, s16 on) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeMasterList)); } @@ -141,9 +138,9 @@ struct GraphNodeMasterList *init_graph_node_master_list(struct AllocOnlyPool *po /** * Allocates and returns a newly created render range node */ -struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct AllocOnlyPool *pool, - struct GraphNodeLevelOfDetail *graphNode, - s16 minDistance, s16 maxDistance) { +struct GraphNodeLevelOfDetail* init_graph_node_render_range(struct AllocOnlyPool* pool, + struct GraphNodeLevelOfDetail* graphNode, s16 minDistance, + s16 maxDistance) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeLevelOfDetail)); } @@ -160,10 +157,9 @@ struct GraphNodeLevelOfDetail *init_graph_node_render_range(struct AllocOnlyPool /** * Allocates and returns a newly created switch case node */ -struct GraphNodeSwitchCase *init_graph_node_switch_case(struct AllocOnlyPool *pool, - struct GraphNodeSwitchCase *graphNode, - s16 numCases, s16 selectedCase, - GraphNodeFunc nodeFunc, s32 unused) { +struct GraphNodeSwitchCase* init_graph_node_switch_case(struct AllocOnlyPool* pool, + struct GraphNodeSwitchCase* graphNode, s16 numCases, + s16 selectedCase, GraphNodeFunc nodeFunc, s32 unused) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeSwitchCase)); } @@ -186,9 +182,8 @@ struct GraphNodeSwitchCase *init_graph_node_switch_case(struct AllocOnlyPool *po /** * Allocates and returns a newly created camera node */ -struct GraphNodeCamera *init_graph_node_camera(struct AllocOnlyPool *pool, - struct GraphNodeCamera *graphNode, f32 *pos, - f32 *focus, GraphNodeFunc func, s32 mode) { +struct GraphNodeCamera* init_graph_node_camera(struct AllocOnlyPool* pool, struct GraphNodeCamera* graphNode, f32* pos, + f32* focus, GraphNodeFunc func, s32 mode) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCamera)); } @@ -213,10 +208,9 @@ struct GraphNodeCamera *init_graph_node_camera(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created translation rotation node */ -struct GraphNodeTranslationRotation * -init_graph_node_translation_rotation(struct AllocOnlyPool *pool, - struct GraphNodeTranslationRotation *graphNode, s32 drawingLayer, - void *displayList, Vec3s translation, Vec3s rotation) { +struct GraphNodeTranslationRotation* +init_graph_node_translation_rotation(struct AllocOnlyPool* pool, struct GraphNodeTranslationRotation* graphNode, + s32 drawingLayer, void* displayList, Vec3s translation, Vec3s rotation) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeTranslationRotation)); } @@ -236,10 +230,9 @@ init_graph_node_translation_rotation(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created translation node */ -struct GraphNodeTranslation *init_graph_node_translation(struct AllocOnlyPool *pool, - struct GraphNodeTranslation *graphNode, - s32 drawingLayer, void *displayList, - Vec3s translation) { +struct GraphNodeTranslation* init_graph_node_translation(struct AllocOnlyPool* pool, + struct GraphNodeTranslation* graphNode, s32 drawingLayer, + void* displayList, Vec3s translation) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeTranslation)); } @@ -258,10 +251,8 @@ struct GraphNodeTranslation *init_graph_node_translation(struct AllocOnlyPool *p /** * Allocates and returns a newly created rotation node */ -struct GraphNodeRotation *init_graph_node_rotation(struct AllocOnlyPool *pool, - struct GraphNodeRotation *graphNode, - s32 drawingLayer, void *displayList, - Vec3s rotation) { +struct GraphNodeRotation* init_graph_node_rotation(struct AllocOnlyPool* pool, struct GraphNodeRotation* graphNode, + s32 drawingLayer, void* displayList, Vec3s rotation) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeRotation)); } @@ -279,9 +270,8 @@ struct GraphNodeRotation *init_graph_node_rotation(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created scaling node */ -struct GraphNodeScale *init_graph_node_scale(struct AllocOnlyPool *pool, - struct GraphNodeScale *graphNode, s32 drawingLayer, - void *displayList, f32 scale) { +struct GraphNodeScale* init_graph_node_scale(struct AllocOnlyPool* pool, struct GraphNodeScale* graphNode, + s32 drawingLayer, void* displayList, f32 scale) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeScale)); } @@ -299,10 +289,8 @@ struct GraphNodeScale *init_graph_node_scale(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created object node */ -struct GraphNodeObject *init_graph_node_object(struct AllocOnlyPool *pool, - struct GraphNodeObject *graphNode, - struct GraphNode *sharedChild, Vec3f pos, Vec3s angle, - Vec3f scale) { +struct GraphNodeObject* init_graph_node_object(struct AllocOnlyPool* pool, struct GraphNodeObject* graphNode, + struct GraphNode* sharedChild, Vec3f pos, Vec3s angle, Vec3f scale) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeObject)); } @@ -329,9 +317,8 @@ struct GraphNodeObject *init_graph_node_object(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created frustum culling radius node */ -struct GraphNodeCullingRadius *init_graph_node_culling_radius(struct AllocOnlyPool *pool, - struct GraphNodeCullingRadius *graphNode, - s16 radius) { +struct GraphNodeCullingRadius* init_graph_node_culling_radius(struct AllocOnlyPool* pool, + struct GraphNodeCullingRadius* graphNode, s16 radius) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeCullingRadius)); } @@ -347,10 +334,9 @@ struct GraphNodeCullingRadius *init_graph_node_culling_radius(struct AllocOnlyPo /** * Allocates and returns a newly created animated part node */ -struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool *pool, - struct GraphNodeAnimatedPart *graphNode, - s32 drawingLayer, void *displayList, - Vec3s translation) { +struct GraphNodeAnimatedPart* init_graph_node_animated_part(struct AllocOnlyPool* pool, + struct GraphNodeAnimatedPart* graphNode, s32 drawingLayer, + void* displayList, Vec3s translation) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeAnimatedPart)); } @@ -368,10 +354,8 @@ struct GraphNodeAnimatedPart *init_graph_node_animated_part(struct AllocOnlyPool /** * Allocates and returns a newly created billboard node */ -struct GraphNodeBillboard *init_graph_node_billboard(struct AllocOnlyPool *pool, - struct GraphNodeBillboard *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) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBillboard)); } @@ -389,9 +373,9 @@ struct GraphNodeBillboard *init_graph_node_billboard(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created displaylist node */ -struct GraphNodeDisplayList *init_graph_node_display_list(struct AllocOnlyPool *pool, - struct GraphNodeDisplayList *graphNode, - s32 drawingLayer, void *displayList) { +struct GraphNodeDisplayList* init_graph_node_display_list(struct AllocOnlyPool* pool, + struct GraphNodeDisplayList* graphNode, s32 drawingLayer, + void* displayList) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeDisplayList)); } @@ -408,9 +392,8 @@ struct GraphNodeDisplayList *init_graph_node_display_list(struct AllocOnlyPool * /** * Allocates and returns a newly created shadow node */ -struct GraphNodeShadow *init_graph_node_shadow(struct AllocOnlyPool *pool, - struct GraphNodeShadow *graphNode, s16 shadowScale, - u8 shadowSolidity, u8 shadowType) { +struct GraphNodeShadow* init_graph_node_shadow(struct AllocOnlyPool* pool, struct GraphNodeShadow* graphNode, + s16 shadowScale, u8 shadowSolidity, u8 shadowType) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeShadow)); } @@ -428,9 +411,9 @@ struct GraphNodeShadow *init_graph_node_shadow(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created object parent node */ -struct GraphNodeObjectParent *init_graph_node_object_parent(struct AllocOnlyPool *pool, - struct GraphNodeObjectParent *graphNode, - struct GraphNode *sharedChild) { +struct GraphNodeObjectParent* init_graph_node_object_parent(struct AllocOnlyPool* pool, + struct GraphNodeObjectParent* graphNode, + struct GraphNode* sharedChild) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeObjectParent)); } @@ -446,8 +429,7 @@ struct GraphNodeObjectParent *init_graph_node_object_parent(struct AllocOnlyPool /** * Allocates and returns a newly created generated node */ -struct GraphNodeGenerated *init_graph_node_generated(struct AllocOnlyPool *pool, - struct GraphNodeGenerated *graphNode, +struct GraphNodeGenerated* init_graph_node_generated(struct AllocOnlyPool* pool, struct GraphNodeGenerated* graphNode, GraphNodeFunc gfxFunc, s32 parameter) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeGenerated)); @@ -469,10 +451,9 @@ struct GraphNodeGenerated *init_graph_node_generated(struct AllocOnlyPool *pool, /** * Allocates and returns a newly created background node */ -struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *pool, - struct GraphNodeBackground *graphNode, - u16 background, GraphNodeFunc backgroundFunc, - s32 zero) { +struct GraphNodeBackground* init_graph_node_background(struct AllocOnlyPool* pool, + struct GraphNodeBackground* graphNode, u16 background, + GraphNodeFunc backgroundFunc, s32 zero) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeBackground)); } @@ -495,11 +476,9 @@ struct GraphNodeBackground *init_graph_node_background(struct AllocOnlyPool *poo /** * Allocates and returns a newly created held object node */ -struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *pool, - struct GraphNodeHeldObject *graphNode, - struct Object *objNode, - Vec3s translation, - GraphNodeFunc nodeFunc, s32 playerIndex) { +struct GraphNodeHeldObject* init_graph_node_held_object(struct AllocOnlyPool* pool, + struct GraphNodeHeldObject* graphNode, struct Object* objNode, + Vec3s translation, GraphNodeFunc nodeFunc, s32 playerIndex) { if (pool != NULL) { graphNode = alloc_only_pool_alloc(pool, sizeof(struct GraphNodeHeldObject)); } @@ -522,9 +501,9 @@ struct GraphNodeHeldObject *init_graph_node_held_object(struct AllocOnlyPool *po /** * Adds 'childNode' to the end of the list children from 'parent' */ -struct GraphNode *geo_add_child(struct GraphNode *parent, struct GraphNode *childNode) { - struct GraphNode *parentFirstChild; - struct GraphNode *parentLastChild; +struct GraphNode* geo_add_child(struct GraphNode* parent, struct GraphNode* childNode) { + struct GraphNode* parentFirstChild; + struct GraphNode* parentLastChild; if (childNode != NULL) { childNode->parent = parent; @@ -552,9 +531,9 @@ struct GraphNode *geo_add_child(struct GraphNode *parent, struct GraphNode *chil * since geo nodes are allocated in a pointer-bumping pool that * gets thrown out when changing areas. */ -struct GraphNode *geo_remove_child(struct GraphNode *graphNode) { - struct GraphNode *parent; - struct GraphNode **firstChild; +struct GraphNode* geo_remove_child(struct GraphNode* graphNode) { + struct GraphNode* parent; + struct GraphNode** firstChild; parent = graphNode->parent; firstChild = &parent->children; @@ -582,10 +561,10 @@ struct GraphNode *geo_remove_child(struct GraphNode *graphNode) { * object is always drawn before any other objects. (Note that the geo order * is independent from processing group order, where Mario is not first.) */ -struct GraphNode *geo_make_first_child(struct GraphNode *newFirstChild) { - struct GraphNode *lastSibling; - struct GraphNode *parent; - struct GraphNode **firstChild; +struct GraphNode* geo_make_first_child(struct GraphNode* newFirstChild) { + struct GraphNode* lastSibling; + struct GraphNode* parent; + struct GraphNode** firstChild; parent = newFirstChild->parent; firstChild = &parent->children; @@ -610,15 +589,15 @@ struct GraphNode *geo_make_first_child(struct GraphNode *newFirstChild) { * Helper function for geo_call_global_function_nodes that recursively * traverses the scene graph and calls the functions of global nodes. */ -void geo_call_global_function_nodes_helper(struct GraphNode *graphNode, s32 callContext) { - struct GraphNode **globalPtr; - struct GraphNode *curNode; - struct FnGraphNode *asFnNode; +void geo_call_global_function_nodes_helper(struct GraphNode* graphNode, s32 callContext) { + struct GraphNode** globalPtr; + struct GraphNode* curNode; + struct FnGraphNode* asFnNode; curNode = graphNode; do { - asFnNode = (struct FnGraphNode *) curNode; + asFnNode = (struct FnGraphNode*)curNode; if (curNode->type & GRAPH_NODE_TYPE_FUNCTIONAL) { if (asFnNode->func != NULL) { @@ -629,16 +608,16 @@ void geo_call_global_function_nodes_helper(struct GraphNode *graphNode, s32 call if (curNode->children != NULL) { switch (curNode->type) { case GRAPH_NODE_TYPE_MASTER_LIST: - globalPtr = (struct GraphNode **) &gCurGraphNodeMasterList; + globalPtr = (struct GraphNode**)&gCurGraphNodeMasterList; break; case GRAPH_NODE_TYPE_PERSPECTIVE: - globalPtr = (struct GraphNode **) &gCurGraphNodeCamFrustum; + globalPtr = (struct GraphNode**)&gCurGraphNodeCamFrustum; break; case GRAPH_NODE_TYPE_CAMERA: - globalPtr = (struct GraphNode **) &gCurGraphNodeCamera; + globalPtr = (struct GraphNode**)&gCurGraphNodeCamera; break; case GRAPH_NODE_TYPE_OBJECT: - globalPtr = (struct GraphNode **) &gCurGraphNodeObject; + globalPtr = (struct GraphNode**)&gCurGraphNodeObject; break; default: globalPtr = NULL; @@ -665,9 +644,9 @@ void geo_call_global_function_nodes_helper(struct GraphNode *graphNode, s32 call * callContext is one of the GEO_CONTEXT_ defines. * The graphNode argument should be of type GraphNodeRoot. */ -void geo_call_global_function_nodes(struct GraphNode *graphNode, s32 callContext) { +void geo_call_global_function_nodes(struct GraphNode* graphNode, s32 callContext) { if (graphNode->flags & GRAPH_RENDER_ACTIVE) { - gCurGraphNodeRoot = (struct GraphNodeRoot *) graphNode; + gCurGraphNodeRoot = (struct GraphNodeRoot*)graphNode; if (graphNode->children != NULL) { geo_call_global_function_nodes_helper(graphNode->children, callContext); @@ -680,7 +659,7 @@ void geo_call_global_function_nodes(struct GraphNode *graphNode, s32 callContext /** * When objects are cleared, this is called on all object nodes (loaded or unloaded). */ -void geo_reset_object_node(struct GraphNodeObject *graphNode) { +void geo_reset_object_node(struct GraphNodeObject* graphNode) { init_graph_node_object(NULL, graphNode, 0, gVec3fZero, gVec3sZero, gVec3fOne); geo_add_child(&gObjParentGraphNode, &graphNode->node); @@ -690,7 +669,7 @@ void geo_reset_object_node(struct GraphNodeObject *graphNode) { /** * Initialize an object node using the given parameters */ -void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f pos, Vec3s angle) { +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); @@ -709,13 +688,13 @@ void geo_obj_init(struct GraphNodeObject *graphNode, void *sharedChild, Vec3f po /** * Initialize and object node using the given SpawnInfo struct */ -void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo *spawn) { +void geo_obj_init_spawninfo(struct GraphNodeObject* graphNode, struct SpawnInfo* spawn) { vec3f_set(graphNode->scale, 1.0f, 1.0f, 1.0f); vec3s_copy(graphNode->angle, spawn->startAngle); - graphNode->pos[0] = (f32) spawn->startPos[0]; - graphNode->pos[1] = (f32) spawn->startPos[1]; - graphNode->pos[2] = (f32) spawn->startPos[2]; + graphNode->pos[0] = (f32)spawn->startPos[0]; + graphNode->pos[1] = (f32)spawn->startPos[1]; + graphNode->pos[2] = (f32)spawn->startPos[2]; graphNode->areaIndex = spawn->areaIndex; graphNode->activeAreaIndex = spawn->activeAreaIndex; @@ -733,15 +712,15 @@ void geo_obj_init_spawninfo(struct GraphNodeObject *graphNode, struct SpawnInfo /** * Initialize the animation of an object node */ -void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr) { - struct Animation **animSegmented = animPtrAddr; +void geo_obj_init_animation(struct GraphNodeObject* graphNode, struct Animation** animPtrAddr) { + struct Animation** animSegmented = animPtrAddr; // TODO: In theory we dont need this but lets keep it - if(animSegmented == NULL){ + if (animSegmented == NULL) { return; } - struct Animation *anim = segmented_to_virtual(*animSegmented); + struct Animation* anim = segmented_to_virtual(*animSegmented); if (graphNode->animInfo.curAnim != anim) { graphNode->animInfo.curAnim = anim; @@ -754,9 +733,9 @@ void geo_obj_init_animation(struct GraphNodeObject *graphNode, struct Animation /** * Initialize the animation of an object node */ -void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Animation **animPtrAddr, u32 animAccel) { - struct Animation **animSegmented = animPtrAddr; - struct Animation *anim = segmented_to_virtual(*animSegmented); +void geo_obj_init_animation_accel(struct GraphNodeObject* graphNode, struct Animation** animPtrAddr, u32 animAccel) { + struct Animation** animSegmented = animPtrAddr; + struct Animation* anim = segmented_to_virtual(*animSegmented); if (graphNode->animInfo.curAnim != anim) { graphNode->animInfo.curAnim = anim; @@ -776,7 +755,7 @@ void geo_obj_init_animation_accel(struct GraphNodeObject *graphNode, struct Anim * and the second s16 the actual index. This index can be used to index in the array * with actual animation values. */ -s32 retrieve_animation_index(s32 frame, u16 **attributes) { +s32 retrieve_animation_index(s32 frame, u16** attributes) { s32 result; if (frame < (*attributes)[0]) { @@ -795,9 +774,9 @@ s32 retrieve_animation_index(s32 frame, u16 **attributes) { * whether it plays forwards or backwards, and whether it stops or loops at * the end etc. */ -s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist) { +s16 geo_update_animation_frame(struct AnimInfo* obj, s32* accelAssist) { s32 result; - struct Animation *anim = obj->curAnim; + struct Animation* anim = obj->curAnim; if (obj->animTimer == gAreaUpdateCounter || anim->flags & ANIM_FLAG_2) { if (accelAssist != NULL) { @@ -852,12 +831,12 @@ s16 geo_update_animation_frame(struct AnimInfo *obj, s32 *accelAssist) { * currently happens in-line in geo_process_shadow where it also accounts for * animations without lateral translation. */ -void geo_retreive_animation_translation(struct GraphNodeObject *obj, Vec3f position) { - struct Animation *animation = obj->animInfo.curAnim; +void geo_retreive_animation_translation(struct GraphNodeObject* obj, Vec3f position) { + struct Animation* animation = obj->animInfo.curAnim; if (animation != NULL) { - u16 *attribute = segmented_to_virtual((void *) animation->index); - s16 *values = segmented_to_virtual((void *) animation->values); + u16* attribute = segmented_to_virtual((void*)animation->index); + s16* values = segmented_to_virtual((void*)animation->values); s16 frame = obj->animInfo.animFrame; @@ -865,9 +844,9 @@ void geo_retreive_animation_translation(struct GraphNodeObject *obj, Vec3f posit frame = 0; } - position[0] = (f32) values[retrieve_animation_index(frame, &attribute)]; - position[1] = (f32) values[retrieve_animation_index(frame, &attribute)]; - position[2] = (f32) values[retrieve_animation_index(frame, &attribute)]; + position[0] = (f32)values[retrieve_animation_index(frame, &attribute)]; + position[1] = (f32)values[retrieve_animation_index(frame, &attribute)]; + position[2] = (f32)values[retrieve_animation_index(frame, &attribute)]; } else { vec3f_set(position, 0, 0, 0); } @@ -877,15 +856,15 @@ void geo_retreive_animation_translation(struct GraphNodeObject *obj, Vec3f posit * Unused function to find the root of the geo node tree, which should be a * GraphNodeRoot. If it is not for some reason, null is returned. */ -struct GraphNodeRoot *geo_find_root(struct GraphNode *graphNode) { - struct GraphNodeRoot *resGraphNode = NULL; +struct GraphNodeRoot* geo_find_root(struct GraphNode* graphNode) { + struct GraphNodeRoot* resGraphNode = NULL; while (graphNode->parent != NULL) { graphNode = graphNode->parent; } if (graphNode->type == GRAPH_NODE_TYPE_ROOT) { - resGraphNode = (struct GraphNodeRoot *) graphNode; + resGraphNode = (struct GraphNodeRoot*)graphNode; } return resGraphNode; diff --git a/src/engine/graph_node_manager.c b/src/engine/graph_node_manager.c index b0b7fb9d..0f6b57c8 100644 --- a/src/engine/graph_node_manager.c +++ b/src/engine/graph_node_manager.c @@ -5,14 +5,14 @@ #include "graph_node.h" #if IS_64_BIT -static s16 next_s16_in_geo_script(s16 **src) { +static s16 next_s16_in_geo_script(s16** src) { s16 ret; if (((uintptr_t)(*src) & 7) == 4) { - *src += 2; // skip 32 bits + *src += 2; // skip 32 bits } ret = *(*src)++; if (((uintptr_t)(*src) & 7) == 4) { - *src += 2; // skip 32 bits + *src += 2; // skip 32 bits } return ret; } @@ -24,7 +24,7 @@ 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); @@ -36,7 +36,7 @@ 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); @@ -48,7 +48,7 @@ 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; @@ -60,7 +60,7 @@ 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) { +void register_scene_graph_node(struct GraphNode* graphNode) { if (graphNode != NULL) { gCurGraphNodeList[gCurGraphNodeIndex] = graphNode; @@ -70,8 +70,7 @@ void register_scene_graph_node(struct GraphNode *graphNode) { } } else { if (gCurGraphNodeList[gCurGraphNodeIndex - 1]->type == GRAPH_NODE_TYPE_OBJECT_PARENT) { - ((struct GraphNodeObjectParent *) gCurGraphNodeList[gCurGraphNodeIndex - 1]) - ->sharedChild = graphNode; + ((struct GraphNodeObjectParent*)gCurGraphNodeList[gCurGraphNodeIndex - 1])->sharedChild = graphNode; } else { geo_add_child(gCurGraphNodeList[gCurGraphNodeIndex - 1], graphNode); } diff --git a/src/engine/level_script.c b/src/engine/level_script.c index 9237e101..dc1bb64e 100644 --- a/src/engine/level_script.c +++ b/src/engine/level_script.c @@ -23,11 +23,11 @@ #include "surface_collision.h" #include "surface_load.h" -#define CMD_GET(type, offset) (*(type *) (CMD_PROCESS_OFFSET(offset) + (u8 *) sCurrentCmd)) +#define CMD_GET(type, offset) (*(type*)(CMD_PROCESS_OFFSET(offset) + (u8*)sCurrentCmd)) // These are equal -#define CMD_NEXT ((struct LevelCommand *) ((u8 *) sCurrentCmd + (sCurrentCmd->size << CMD_SIZE_SHIFT))) -#define NEXT_CMD ((struct LevelCommand *) ((sCurrentCmd->size << CMD_SIZE_SHIFT) + (u8 *) sCurrentCmd)) +#define CMD_NEXT ((struct LevelCommand*)((u8*)sCurrentCmd + (sCurrentCmd->size << CMD_SIZE_SHIFT))) +#define NEXT_CMD ((struct LevelCommand*)((sCurrentCmd->size << CMD_SIZE_SHIFT) + (u8*)sCurrentCmd)) struct LevelCommand { /*00*/ u8 type; @@ -39,19 +39,19 @@ enum ScriptStatus { SCRIPT_RUNNING = 1, SCRIPT_PAUSED = 0, SCRIPT_PAUSED2 = -1 } static uintptr_t sStack[32]; -static struct AllocOnlyPool *sLevelPool = NULL; +static struct AllocOnlyPool* sLevelPool = NULL; static u16 sDelayFrames = 0; static u16 sDelayFrames2 = 0; static s16 sCurrAreaIndex = -1; -static uintptr_t *sStackTop = sStack; -static uintptr_t *sStackBase = NULL; +static uintptr_t* sStackTop = sStack; +static uintptr_t* sStackBase = NULL; static s16 sScriptStatus; static s32 sRegister; -static struct LevelCommand *sCurrentCmd; +static struct LevelCommand* sCurrentCmd; static s32 eval_script_op(s8 op, s32 arg) { s32 result = 0; @@ -88,23 +88,22 @@ static s32 eval_script_op(s8 op, s32 arg) { static void level_cmd_load_and_execute(void) { main_pool_push_state(); - load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), MEMORY_POOL_LEFT); + load_segment(CMD_GET(s16, 2), CMD_GET(void*, 4), CMD_GET(void*, 8), MEMORY_POOL_LEFT); - *sStackTop++ = (uintptr_t) NEXT_CMD; - *sStackTop++ = (uintptr_t) sStackBase; + *sStackTop++ = (uintptr_t)NEXT_CMD; + *sStackTop++ = (uintptr_t)sStackBase; sStackBase = sStackTop; - sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 12)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void*, 12)); } static void level_cmd_exit_and_execute(void) { - void *targetAddr = CMD_GET(void *, 12); + void* targetAddr = CMD_GET(void*, 12); main_pool_pop_state(); main_pool_push_state(); - load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), - MEMORY_POOL_LEFT); + load_segment(CMD_GET(s16, 2), CMD_GET(void*, 4), CMD_GET(void*, 8), MEMORY_POOL_LEFT); sStackTop = sStackBase; sCurrentCmd = segmented_to_virtual(targetAddr); @@ -114,8 +113,8 @@ static void level_cmd_exit(void) { main_pool_pop_state(); sStackTop = sStackBase; - sStackBase = (uintptr_t *) *(--sStackTop); - sCurrentCmd = (struct LevelCommand *) *(--sStackTop); + sStackBase = (uintptr_t*)*(--sStackTop); + sCurrentCmd = (struct LevelCommand*)*(--sStackTop); } static void level_cmd_sleep(void) { @@ -141,20 +140,20 @@ static void level_cmd_sleep2(void) { } static void level_cmd_jump(void) { - sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void*, 4)); } static void level_cmd_jump_and_link(void) { - *sStackTop++ = (uintptr_t) NEXT_CMD; - sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 4)); + *sStackTop++ = (uintptr_t)NEXT_CMD; + sCurrentCmd = segmented_to_virtual(CMD_GET(void*, 4)); } static void level_cmd_return(void) { - sCurrentCmd = (struct LevelCommand *) *(--sStackTop); + sCurrentCmd = (struct LevelCommand*)*(--sStackTop); } static void level_cmd_jump_and_link_push_arg(void) { - *sStackTop++ = (uintptr_t) NEXT_CMD; + *sStackTop++ = (uintptr_t)NEXT_CMD; *sStackTop++ = CMD_GET(s16, 2); sCurrentCmd = CMD_NEXT; } @@ -163,10 +162,10 @@ static void level_cmd_jump_repeat(void) { s32 val = *(sStackTop - 1); if (val == 0) { - sCurrentCmd = (struct LevelCommand *) *(sStackTop - 2); + sCurrentCmd = (struct LevelCommand*)*(sStackTop - 2); } else if (--val != 0) { *(sStackTop - 1) = val; - sCurrentCmd = (struct LevelCommand *) *(sStackTop - 2); + sCurrentCmd = (struct LevelCommand*)*(sStackTop - 2); } else { sCurrentCmd = CMD_NEXT; sStackTop -= 2; @@ -174,7 +173,7 @@ static void level_cmd_jump_repeat(void) { } static void level_cmd_loop_begin(void) { - *sStackTop++ = (uintptr_t) NEXT_CMD; + *sStackTop++ = (uintptr_t)NEXT_CMD; *sStackTop++ = 0; sCurrentCmd = CMD_NEXT; } @@ -184,13 +183,13 @@ static void level_cmd_loop_until(void) { sCurrentCmd = CMD_NEXT; sStackTop -= 2; } else { - sCurrentCmd = (struct LevelCommand *) *(sStackTop - 2); + sCurrentCmd = (struct LevelCommand*)*(sStackTop - 2); } } static void level_cmd_jump_if(void) { if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) { - sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8)); + sCurrentCmd = segmented_to_virtual(CMD_GET(void*, 8)); } else { sCurrentCmd = CMD_NEXT; } @@ -198,8 +197,8 @@ static void level_cmd_jump_if(void) { static void level_cmd_jump_and_link_if(void) { if (eval_script_op(CMD_GET(u8, 2), CMD_GET(s32, 4)) != 0) { - *sStackTop++ = (uintptr_t) NEXT_CMD; - sCurrentCmd = segmented_to_virtual(CMD_GET(void *, 8)); + *sStackTop++ = (uintptr_t)NEXT_CMD; + sCurrentCmd = segmented_to_virtual(CMD_GET(void*, 8)); } else { sCurrentCmd = CMD_NEXT; } @@ -263,27 +262,26 @@ static void level_cmd_pop_pool_state(void) { } static void level_cmd_load_to_fixed_address(void) { - load_to_fixed_pool_addr(CMD_GET(void *, 4), CMD_GET(void *, 8), CMD_GET(void *, 12)); + load_to_fixed_pool_addr(CMD_GET(void*, 4), CMD_GET(void*, 8), CMD_GET(void*, 12)); sCurrentCmd = CMD_NEXT; } static void level_cmd_load_raw(void) { - load_segment(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8), - MEMORY_POOL_LEFT); + load_segment(CMD_GET(s16, 2), CMD_GET(void*, 4), CMD_GET(void*, 8), MEMORY_POOL_LEFT); sCurrentCmd = CMD_NEXT; } static void level_cmd_load_mio0(void) { - load_segment_decompress(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8)); + load_segment_decompress(CMD_GET(s16, 2), CMD_GET(void*, 4), CMD_GET(void*, 8)); sCurrentCmd = CMD_NEXT; } static void level_cmd_load_mario_head(void) { // TODO: Fix these hardcoded sizes - void *addr = main_pool_alloc(DOUBLE_SIZE_ON_64_BIT(0xE1000), MEMORY_POOL_LEFT); + void* addr = main_pool_alloc(DOUBLE_SIZE_ON_64_BIT(0xE1000), MEMORY_POOL_LEFT); if (addr != NULL) { gdm_init(addr, DOUBLE_SIZE_ON_64_BIT(0xE1000)); - gd_add_to_heap(gZBuffer, sizeof(gZBuffer)); // 0x25800 + gd_add_to_heap(gZBuffer, sizeof(gZBuffer)); // 0x25800 gd_add_to_heap(gFramebuffer0, 3 * sizeof(gFramebuffer0)); // 0x70800 gdm_setup(); gdm_maketestdl(CMD_GET(s16, 2)); @@ -294,12 +292,12 @@ static void level_cmd_load_mario_head(void) { } static void level_cmd_load_mio0_texture(void) { - load_segment_decompress_heap(CMD_GET(s16, 2), CMD_GET(void *, 4), CMD_GET(void *, 8)); + load_segment_decompress_heap(CMD_GET(s16, 2), CMD_GET(void*, 4), CMD_GET(void*, 8)); sCurrentCmd = CMD_NEXT; } static void level_cmd_init_level(void) { - init_graph_node_start(NULL, (struct GraphNodeStart *) &gObjParentGraphNode); + init_graph_node_start(NULL, (struct GraphNodeStart*)&gObjParentGraphNode); clear_objects(); clear_areas(); main_pool_push_state(); @@ -318,8 +316,7 @@ static void level_cmd_clear_level(void) { static void level_cmd_alloc_level_pool(void) { if (sLevelPool == NULL) { - sLevelPool = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), - MEMORY_POOL_LEFT); + sLevelPool = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), MEMORY_POOL_LEFT); } sCurrentCmd = CMD_NEXT; @@ -343,19 +340,18 @@ static void level_cmd_free_level_pool(void) { static void level_cmd_begin_area(void) { u8 areaIndex = CMD_GET(u8, 2); - void *geoLayoutAddr = CMD_GET(void *, 4); + void* geoLayoutAddr = CMD_GET(void*, 4); if (areaIndex < 8) { - struct GraphNodeRoot *screenArea = - (struct GraphNodeRoot *) process_geo_layout(sLevelPool, geoLayoutAddr); - struct GraphNodeCamera *node = (struct GraphNodeCamera *) screenArea->views[0]; + struct GraphNodeRoot* screenArea = (struct GraphNodeRoot*)process_geo_layout(sLevelPool, geoLayoutAddr); + struct GraphNodeCamera* node = (struct GraphNodeCamera*)screenArea->views[0]; sCurrAreaIndex = areaIndex; screenArea->areaIndex = areaIndex; gAreas[areaIndex].unk04 = screenArea; if (node != NULL) { - gAreas[areaIndex].camera = (struct Camera *) node->config.camera; + gAreas[areaIndex].camera = (struct Camera*)node->config.camera; } else { gAreas[areaIndex].camera = NULL; } @@ -372,11 +368,10 @@ static void level_cmd_end_area(void) { static void level_cmd_load_model_from_dl(void) { s16 val1 = CMD_GET(s16, 2) & 0x0FFF; s16 val2 = ((u16)CMD_GET(s16, 2)) >> 12; - void *val3 = CMD_GET(void *, 4); + void* val3 = CMD_GET(void*, 4); if (val1 < 256) { - gLoadedGraphNodes[val1] = - (struct GraphNode *) init_graph_node_display_list(sLevelPool, 0, val2, val3); + gLoadedGraphNodes[val1] = (struct GraphNode*)init_graph_node_display_list(sLevelPool, 0, val2, val3); } sCurrentCmd = CMD_NEXT; @@ -384,7 +379,7 @@ static void level_cmd_load_model_from_dl(void) { static void level_cmd_load_model_from_geo(void) { s16 arg0 = CMD_GET(s16, 2); - void *arg1 = CMD_GET(void *, 4); + void* arg1 = CMD_GET(void*, 4); if (arg0 < 256) { gLoadedGraphNodes[arg0] = process_geo_layout(sLevelPool, arg1); @@ -401,15 +396,14 @@ static void level_cmd_23(void) { s16 model = CMD_GET(s16, 2) & 0x0FFF; s16 arg0H = ((u16)CMD_GET(s16, 2)) >> 12; - void *arg1 = CMD_GET(void *, 4); + void* arg1 = CMD_GET(void*, 4); // load an f32, but using an integer load instruction for some reason (hence the union) arg2.i = CMD_GET(s32, 8); if (model < 256) { // GraphNodeScale has a GraphNode at the top. This // is being stored to the array, so cast the pointer. - gLoadedGraphNodes[model] = - (struct GraphNode *) init_graph_node_scale(sLevelPool, 0, arg0H, arg1, arg2.f); + gLoadedGraphNodes[model] = (struct GraphNode*)init_graph_node_scale(sLevelPool, 0, arg0H, arg1, arg2.f); } sCurrentCmd = CMD_NEXT; @@ -422,7 +416,7 @@ static void level_cmd_init_mario(void) { gMarioSpawnInfo->activeAreaIndex = -1; gMarioSpawnInfo->areaIndex = 0; gMarioSpawnInfo->behaviorArg = CMD_GET(u32, 4); - gMarioSpawnInfo->behaviorScript = CMD_GET(void *, 8); + gMarioSpawnInfo->behaviorScript = CMD_GET(void*, 8); gMarioSpawnInfo->model = gLoadedGraphNodes[CMD_GET(u8, 3)]; gMarioSpawnInfo->next = NULL; @@ -432,7 +426,7 @@ static void level_cmd_init_mario(void) { static void level_cmd_place_object(void) { u8 val7 = 1 << (gCurrActNum - 1); u16 model; - struct SpawnInfo *spawnInfo; + struct SpawnInfo* spawnInfo; if (sCurrAreaIndex != -1 && ((CMD_GET(u8, 2) & val7) || CMD_GET(u8, 2) == 0x1F)) { model = CMD_GET(u8, 3); @@ -450,7 +444,7 @@ static void level_cmd_place_object(void) { spawnInfo->activeAreaIndex = sCurrAreaIndex; spawnInfo->behaviorArg = CMD_GET(u32, 16); - spawnInfo->behaviorScript = CMD_GET(void *, 20); + spawnInfo->behaviorScript = CMD_GET(void*, 20); spawnInfo->model = gLoadedGraphNodes[model]; spawnInfo->next = gAreas[sCurrAreaIndex].objectSpawnInfos; @@ -462,8 +456,7 @@ static void level_cmd_place_object(void) { static void level_cmd_create_warp_node(void) { if (sCurrAreaIndex != -1) { - struct ObjectWarpNode *warpNode = - alloc_only_pool_alloc(sLevelPool, sizeof(struct ObjectWarpNode)); + struct ObjectWarpNode* warpNode = alloc_only_pool_alloc(sLevelPool, sizeof(struct ObjectWarpNode)); warpNode->node.id = CMD_GET(u8, 2); warpNode->node.destLevel = CMD_GET(u8, 3) + CMD_GET(u8, 6); @@ -481,12 +474,11 @@ static void level_cmd_create_warp_node(void) { static void level_cmd_create_instant_warp(void) { s32 i; - struct InstantWarp *warp; + struct InstantWarp* warp; if (sCurrAreaIndex != -1) { if (gAreas[sCurrAreaIndex].instantWarps == NULL) { - gAreas[sCurrAreaIndex].instantWarps = - alloc_only_pool_alloc(sLevelPool, 4 * sizeof(struct InstantWarp)); + gAreas[sCurrAreaIndex].instantWarps = alloc_only_pool_alloc(sLevelPool, 4 * sizeof(struct InstantWarp)); for (i = INSTANT_WARP_INDEX_START; i < INSTANT_WARP_INDEX_STOP; i++) { gAreas[sCurrAreaIndex].instantWarps[i].id = 0; @@ -516,12 +508,11 @@ static void level_cmd_set_terrain_type(void) { static void level_cmd_create_painting_warp_node(void) { s32 i; - struct WarpNode *node; + struct WarpNode* node; if (sCurrAreaIndex != -1) { if (gAreas[sCurrAreaIndex].paintingWarpNodes == NULL) { - gAreas[sCurrAreaIndex].paintingWarpNodes = - alloc_only_pool_alloc(sLevelPool, 45 * sizeof(struct WarpNode)); + gAreas[sCurrAreaIndex].paintingWarpNodes = alloc_only_pool_alloc(sLevelPool, 45 * sizeof(struct WarpNode)); for (i = 0; i < 45; i++) { gAreas[sCurrAreaIndex].paintingWarpNodes[i].id = 0; @@ -540,12 +531,11 @@ static void level_cmd_create_painting_warp_node(void) { } static void level_cmd_3A(void) { - struct UnusedArea28 *val4; + struct UnusedArea28* val4; if (sCurrAreaIndex != -1) { if ((val4 = gAreas[sCurrAreaIndex].unused) == NULL) { - val4 = gAreas[sCurrAreaIndex].unused = - alloc_only_pool_alloc(sLevelPool, sizeof(struct UnusedArea28)); + val4 = gAreas[sCurrAreaIndex].unused = alloc_only_pool_alloc(sLevelPool, sizeof(struct UnusedArea28)); } val4->unk00 = CMD_GET(s16, 2); @@ -559,13 +549,12 @@ static void level_cmd_3A(void) { } static void level_cmd_create_whirlpool(void) { - struct Whirlpool *whirlpool; + struct Whirlpool* whirlpool; s32 index = CMD_GET(u8, 2); - s32 beatBowser2 = - (save_file_get_flags() & (SAVE_FLAG_HAVE_KEY_2 | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR)) != 0; + s32 beatBowser2 = (save_file_get_flags() & (SAVE_FLAG_HAVE_KEY_2 | SAVE_FLAG_UNLOCKED_UPSTAIRS_DOOR)) != 0; - if (CMD_GET(u8, 3) == 0 || (CMD_GET(u8, 3) == 1 && !beatBowser2) - || (CMD_GET(u8, 3) == 2 && beatBowser2) || (CMD_GET(u8, 3) == 3 && gCurrActNum >= 2)) { + if (CMD_GET(u8, 3) == 0 || (CMD_GET(u8, 3) == 1 && !beatBowser2) || (CMD_GET(u8, 3) == 2 && beatBowser2) || + (CMD_GET(u8, 3) == 3 && gCurrActNum >= 2)) { if (sCurrAreaIndex != -1 && index < 2) { if ((whirlpool = gAreas[sCurrAreaIndex].whirlpools[index]) == NULL) { whirlpool = alloc_only_pool_alloc(sLevelPool, sizeof(struct Whirlpool)); @@ -592,11 +581,11 @@ static void level_cmd_set_gamma(void) { static void level_cmd_set_terrain_data(void) { if (sCurrAreaIndex != -1) { - Collision *data; + Collision* data; u32 size; // The game modifies the terrain data and must be reset upon level reload. - data = segmented_to_virtual(CMD_GET(void *, 4)); + data = segmented_to_virtual(CMD_GET(void*, 4)); size = get_area_terrain_size(data) * sizeof(Collision); gAreas[sCurrAreaIndex].terrainData = alloc_only_pool_alloc(sLevelPool, size); memcpy(gAreas[sCurrAreaIndex].terrainData, data, size); @@ -606,7 +595,7 @@ static void level_cmd_set_terrain_data(void) { static void level_cmd_set_rooms(void) { if (sCurrAreaIndex != -1) { - gAreas[sCurrAreaIndex].surfaceRooms = segmented_to_virtual(CMD_GET(void *, 4)); + gAreas[sCurrAreaIndex].surfaceRooms = segmented_to_virtual(CMD_GET(void*, 4)); } sCurrentCmd = CMD_NEXT; } @@ -615,7 +604,7 @@ static void level_cmd_set_macro_objects(void) { if (sCurrAreaIndex != -1) { // The game modifies the macro object data (for example marking coins as taken), // so it must be reset when the level reloads. - MacroObject *data = segmented_to_virtual(CMD_GET(void *, 4)); + MacroObject* data = segmented_to_virtual(CMD_GET(void*, 4)); s32 len = 0; while (data[len++] != MACRO_OBJECT_END()) { len += 4; @@ -628,7 +617,7 @@ static void level_cmd_set_macro_objects(void) { static void level_cmd_load_area(void) { s16 areaIndex = CMD_GET(u8, 2); - UNUSED void *unused = (u8 *) sCurrentCmd + 4; + UNUSED void* unused = (u8*)sCurrentCmd + 4; stop_sounds_in_continuous_banks(); load_area(areaIndex); @@ -808,7 +797,7 @@ static void (*LevelScriptJumpTable[])(void) = { /*3C*/ level_cmd_get_or_set_var, }; -struct LevelCommand *level_script_execute(struct LevelCommand *cmd) { +struct LevelCommand* level_script_execute(struct LevelCommand* cmd) { sScriptStatus = SCRIPT_RUNNING; sCurrentCmd = cmd; diff --git a/src/engine/math_util.c b/src/engine/math_util.c index 0cc9df02..8082f1c5 100644 --- a/src/engine/math_util.c +++ b/src/engine/math_util.c @@ -13,7 +13,7 @@ Mat4 sInterpolationMatrixStack[0x1000]; Mat4* gInterpolationMatrix = &sInterpolationMatrixStack[0]; // Variables for a spline curve animation (used for the flight path in the grand star cutscene) -Vec4s *gSplineKeyframe; +Vec4s* gSplineKeyframe; float gSplineKeyframeFraction; int gSplineState; @@ -23,14 +23,14 @@ int gSplineState; #ifdef __GNUC__ #if defined(__clang__) - #pragma GCC diagnostic ignored "-Wreturn-stack-address" +#pragma GCC diagnostic ignored "-Wreturn-stack-address" #else - #pragma GCC diagnostic ignored "-Wreturn-local-addr" +#pragma GCC diagnostic ignored "-Wreturn-local-addr" #endif #endif /// 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]; @@ -38,7 +38,7 @@ 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; @@ -46,7 +46,7 @@ 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]; @@ -54,7 +54,7 @@ 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]; @@ -62,7 +62,7 @@ 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]; @@ -70,7 +70,7 @@ 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; @@ -78,7 +78,7 @@ 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]; @@ -86,7 +86,7 @@ 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]; @@ -94,7 +94,7 @@ 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]; @@ -102,7 +102,7 @@ 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]; @@ -113,7 +113,7 @@ 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); @@ -126,7 +126,7 @@ 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]); @@ -134,7 +134,7 @@ 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]; @@ -142,7 +142,7 @@ 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]); @@ -157,8 +157,8 @@ void *vec3f_normalize(Vec3f dest) { /// 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; + register u32* d = (u32*)dest; + register u32* s = (u32*)src; for (i = 0; i < 16; i++) { *d++ = *s++; @@ -170,14 +170,16 @@ void mtxf_copy(Mat4 dest, Mat4 src) { */ void mtxf_identity(Mat4 mtx) { register s32 i; - register f32 *dest; + 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; } /** @@ -365,12 +367,9 @@ void mtxf_billboard(Mat4 dest, Mat4 mtx, Vec3f position, s16 angle) { dest[2][2] = 1; 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]; - dest[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]; + dest[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]; + dest[3][2] = mtx[0][2] * position[0] + mtx[1][2] * position[1] + mtx[2][2] * position[2] + mtx[3][2]; dest[3][3] = 1; } @@ -425,7 +424,7 @@ void mtxf_align_terrain_normal(Mat4 dest, Vec3f upDir, Vec3f pos, s16 yaw) { * 'radius' is the distance from each triangle vertex to the center */ void mtxf_align_terrain_triangle(Mat4 mtx, Vec3f pos, s16 yaw, f32 radius) { - struct Surface *sp74; + struct Surface* sp74; Vec3f point0; Vec3f point1; Vec3f point2; @@ -582,7 +581,7 @@ void mtxf_mul_vec3s(Mat4 mtx, Vec3s 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) { +void mtxf_to_mtx(Mtx* dest, Mat4 src) { // Avoid type-casting which is technically UB by calling the equivalent // guMtxF2L function. This helps little-endian systems, as well. FrameInterpolation_RecordMatrixMtxFToMtx((MtxF*)src, dest); @@ -592,7 +591,7 @@ void mtxf_to_mtx(Mtx *dest, Mat4 src) { /** * 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); @@ -617,12 +616,9 @@ void get_pos_from_transform_mtx(Vec3f dest, Mat4 objMtx, Mat4 camMtx) { 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; - dest[1] = - 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; + dest[0] = 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; + dest[2] = objMtx[3][0] * camMtx[2][0] + objMtx[3][1] * camMtx[2][1] + objMtx[3][2] * camMtx[2][2] - camZ; } /** @@ -630,7 +626,7 @@ 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]; @@ -753,7 +749,7 @@ s16 atan2s(f32 y, f32 x) { * Compute the atan2 in radians by calling atan2s and converting the result. */ f32 atan2f(f32 y, f32 x) { - return (f32) atan2s(y, x) * M_PI / 0x8000; + return (f32)atan2s(y, x) * M_PI / 0x8000; } #endif @@ -836,7 +832,7 @@ 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; diff --git a/src/engine/surface_collision.c b/src/engine/surface_collision.c index 26599187..2c7e6ae7 100644 --- a/src/engine/surface_collision.c +++ b/src/engine/surface_collision.c @@ -17,9 +17,8 @@ * Iterate through the list of walls until all walls are checked and * have given their wall push. */ -static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode, - struct WallCollisionData *data) { - register struct Surface *surf; +static s32 find_wall_collisions_from_list(struct SurfaceNode* surfaceNode, struct WallCollisionData* data) { + register struct Surface* surf; register f32 offset; register f32 radius = data->radius; register f32 x = data->x; @@ -58,8 +57,12 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode, // 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]; + 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) { @@ -83,8 +86,12 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode, } } } 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]; + 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) { @@ -123,14 +130,13 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode, // 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)) { + 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)) { + if (gCurrentObject != NULL && gCurrentObject == gMarioObject && + (gMarioState->flags & MARIO_VANISH_CAP)) { continue; } } @@ -157,7 +163,7 @@ static s32 find_wall_collisions_from_list(struct SurfaceNode *surfaceNode, /** * Formats the position and wall search for find_wall_collisions. */ -s32 f32_find_wall_collision(f32 *xPtr, f32 *yPtr, f32 *zPtr, f32 offsetY, f32 radius) { +s32 f32_find_wall_collision(f32* xPtr, f32* yPtr, f32* zPtr, f32 offsetY, f32 radius) { struct WallCollisionData collision; s32 numCollisions = 0; @@ -182,8 +188,8 @@ s32 f32_find_wall_collision(f32 *xPtr, f32 *yPtr, f32 *zPtr, f32 offsetY, f32 ra /** * Find wall collisions and receive their push. */ -s32 find_wall_collisions(struct WallCollisionData *colData) { - struct SurfaceNode *node; +s32 find_wall_collisions(struct WallCollisionData* colData) { + struct SurfaceNode* node; s16 cellX, cellZ; s32 numCollisions = 0; s16 x = colData->x; @@ -224,10 +230,10 @@ s32 find_wall_collisions(struct WallCollisionData *colData) { /** * Iterate through the list of ceilings and find the first ceiling over a given point. */ -static struct Surface *find_ceil_from_list(struct SurfaceNode *surfaceNode, s32 x, s32 y, s32 z, f32 *pheight) { - register struct Surface *surf; +static struct Surface* find_ceil_from_list(struct SurfaceNode* surfaceNode, s32 x, s32 y, s32 z, f32* pheight) { + register struct Surface* surf; register s32 x1, z1, x2, z2, x3, z3; - struct Surface *ceil = NULL; + struct Surface* ceil = NULL; ceil = NULL; @@ -304,11 +310,11 @@ static struct Surface *find_ceil_from_list(struct SurfaceNode *surfaceNode, s32 /** * Find the lowest ceiling above a given position and return the height. */ -f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) { +f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface** pceil) { s16 cellZ, cellX; struct Surface *ceil, *dynamicCeil; - struct SurfaceNode *surfaceList; + struct SurfaceNode* surfaceList; f32 height = CELL_HEIGHT_LIMIT; f32 dynamicHeight = CELL_HEIGHT_LIMIT; @@ -316,9 +322,9 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) { //! (Parallel Universes) Because position is casted to an s16, reaching higher // float locations can return ceilings despite them not existing there. // (Dynamic ceilings will unload due to the range.) - s16 x = (s16) posX; - s16 y = (s16) posY; - s16 z = (s16) posZ; + s16 x = (s16)posX; + s16 y = (s16)posY; + s16 z = (s16)posZ; *pceil = NULL; @@ -361,8 +367,8 @@ f32 find_ceil(f32 posX, f32 posY, f32 posZ, struct Surface **pceil) { /** * Find the height of the highest floor below an object. */ -f32 unused_obj_find_floor_height(struct Object *obj) { - struct Surface *floor; +f32 unused_obj_find_floor_height(struct Object* obj) { + struct Surface* floor; f32 floorHeight = find_floor(obj->oPosX, obj->oPosY, obj->oPosZ, &floor); return floorHeight; } @@ -379,8 +385,8 @@ UNUSED static u8 unused8038BE50[0x40]; * with data about the floor's normal vector and origin offset. Also update * sFloorGeo. */ -f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct FloorGeometry **floorGeo) { - struct Surface *floor; +f32 find_floor_height_and_data(f32 xPos, f32 yPos, f32 zPos, struct FloorGeometry** floorGeo) { + struct Surface* floor; f32 floorHeight = find_floor(xPos, yPos, zPos, &floor); *floorGeo = NULL; @@ -401,13 +407,13 @@ u8 gInterpolatingSurfaces; /** * Iterate through the list of floors and find the first floor under a given point. */ -static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 x, s32 y, s32 z, f32 *pheight) { - register struct Surface *surf; +static struct Surface* find_floor_from_list(struct SurfaceNode* surfaceNode, s32 x, s32 y, s32 z, f32* pheight) { + register struct Surface* surf; register f32 x1, z1, x2, z2, x3, z3; f32 nx, ny, nz; f32 oo; f32 height; - struct Surface *floor = NULL; + struct Surface* floor = NULL; s32 interpolate; // Iterate through the list of floors until there are no more floors. @@ -424,7 +430,7 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 f32 diff = (surf->prevVertex1[0] - x1) * (surf->prevVertex1[0] - x1); diff += (surf->prevVertex1[1] - surf->vertex1[1]) * (surf->prevVertex1[1] - surf->vertex1[1]); diff += (surf->prevVertex1[2] - z1) * (surf->prevVertex1[2] - z1); - //printf("%f\n", sqrtf(diff)); + // printf("%f\n", sqrtf(diff)); if (diff > 10000) { interpolate = FALSE; } else { @@ -526,7 +532,7 @@ static struct Surface *find_floor_from_list(struct SurfaceNode *surfaceNode, s32 * Find the height of the highest floor below a point. */ f32 find_floor_height(f32 x, f32 y, f32 z) { - struct Surface *floor; + struct Surface* floor; f32 floorHeight = find_floor(x, y, z, &floor); @@ -537,15 +543,15 @@ f32 find_floor_height(f32 x, f32 y, f32 z) { * Find the highest dynamic floor under a given position. Perhaps originally static * and dynamic floors were checked separately. */ -f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) { - struct SurfaceNode *surfaceList; - struct Surface *floor; +f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface** pfloor) { + struct SurfaceNode* surfaceList; + struct Surface* floor; f32 floorHeight = FLOOR_LOWER_LIMIT; // Would normally cause PUs, but dynamic floors unload at that range. - s16 x = (s16) xPos; - s16 y = (s16) yPos; - s16 z = (s16) zPos; + s16 x = (s16)xPos; + s16 y = (s16)yPos; + s16 z = (s16)zPos; // Each level is split into cells to limit load, find the appropriate cell. s16 cellX = ((x + LEVEL_BOUNDARY_MAX) / CELL_SIZE) & NUM_CELLS_INDEX; @@ -562,11 +568,11 @@ f32 unused_find_dynamic_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfl /** * Find the highest floor under a given position and return the height. */ -f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) { +f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface** pfloor) { s16 cellZ, cellX; struct Surface *floor, *dynamicFloor; - struct SurfaceNode *surfaceList; + struct SurfaceNode* surfaceList; f32 height = FLOOR_LOWER_LIMIT; f32 dynamicHeight = FLOOR_LOWER_LIMIT; @@ -574,9 +580,9 @@ f32 find_floor(f32 xPos, f32 yPos, f32 zPos, struct Surface **pfloor) { //! (Parallel Universes) Because position is casted to an s16, reaching higher // float locations can return floors despite them not existing there. // (Dynamic floors will unload due to the range.) - s16 x = (s16) xPos; - s16 y = (s16) yPos; - s16 z = (s16) zPos; + s16 x = (s16)xPos; + s16 y = (s16)yPos; + s16 z = (s16)zPos; *pfloor = NULL; @@ -646,7 +652,7 @@ f32 find_water_level(f32 x, f32 z) { s16 val; f32 loX, hiX, loZ, hiZ; f32 waterLevel = FLOOR_LOWER_LIMIT; - s16 *p = gEnvironmentRegions; + s16* p = gEnvironmentRegions; if (p != NULL) { numRegions = *p++; @@ -682,7 +688,7 @@ f32 find_poison_gas_level(f32 x, f32 z) { s16 val; f32 loX, hiX, loZ, hiZ; f32 gasLevel = FLOOR_LOWER_LIMIT; - s16 *p = gEnvironmentRegions; + s16* p = gEnvironmentRegions; if (p != NULL) { numRegions = *p++; @@ -719,7 +725,7 @@ f32 find_poison_gas_level(f32 x, f32 z) { /** * Finds the length of a surface list for debug purposes. */ -static s32 surface_list_length(struct SurfaceNode *list) { +static s32 surface_list_length(struct SurfaceNode* list) { s32 count = 0; while (list != NULL) { @@ -735,7 +741,7 @@ static s32 surface_list_length(struct SurfaceNode *list) { * and some allocation information. */ void debug_surface_list_info(f32 xPos, f32 zPos) { - struct SurfaceNode *list; + struct SurfaceNode* list; s32 numFloors = 0; s32 numWalls = 0; s32 numCeils = 0; @@ -790,8 +796,8 @@ void debug_surface_list_info(f32 xPos, f32 zPos) { * An unused function that finds and interacts with any type of surface. * Perhaps an original implementation of surfaces before they were more specialized. */ -s32 unused_resolve_floor_or_ceil_collisions(s32 checkCeil, f32 *px, f32 *py, f32 *pz, f32 radius, - struct Surface **psurface, f32 *surfaceHeight) { +s32 unused_resolve_floor_or_ceil_collisions(s32 checkCeil, f32* px, f32* py, f32* pz, f32 radius, + struct Surface** psurface, f32* surfaceHeight) { f32 nx, ny, nz, oo; f32 x = *px; f32 y = *py; diff --git a/src/engine/surface_load.c b/src/engine/surface_load.c index 8deed46e..4a2532e3 100644 --- a/src/engine/surface_load.c +++ b/src/engine/surface_load.c @@ -27,8 +27,8 @@ SpatialPartitionCell gDynamicSurfacePartition[NUM_CELLS][NUM_CELLS]; /** * Pools of data to contain either surface nodes or surfaces. */ -struct SurfaceNode *sSurfaceNodePool; -struct Surface *sSurfacePool; +struct SurfaceNode* sSurfaceNodePool; +struct Surface* sSurfacePool; /** * The size of the surface pool (2300). @@ -40,8 +40,8 @@ u8 unused8038EEA8[0x30]; /** * Allocate the part of the surface node pool to contain a surface node. */ -static struct SurfaceNode *alloc_surface_node(void) { - struct SurfaceNode *node = &sSurfaceNodePool[gSurfaceNodesAllocated]; +static struct SurfaceNode* alloc_surface_node(void) { + struct SurfaceNode* node = &sSurfaceNodePool[gSurfaceNodesAllocated]; gSurfaceNodesAllocated++; node->next = NULL; @@ -49,8 +49,7 @@ static struct SurfaceNode *alloc_surface_node(void) { //! A bounds check! If there's more surface nodes than 7000 allowed, // we, um... // Perhaps originally just debug feedback? - if (gSurfaceNodesAllocated >= 7000) { - } + if (gSurfaceNodesAllocated >= 7000) {} return node; } @@ -59,16 +58,15 @@ static struct SurfaceNode *alloc_surface_node(void) { * Allocate the part of the surface pool to contain a surface and * initialize the surface. */ -static struct Surface *alloc_surface(void) { +static struct Surface* alloc_surface(void) { - struct Surface *surface = &sSurfacePool[gSurfacesAllocated]; + struct Surface* surface = &sSurfacePool[gSurfacesAllocated]; gSurfacesAllocated++; //! A bounds check! If there's more surfaces than the 2300 allowed, // we, um... // Perhaps originally just debug feedback? - if (gSurfacesAllocated >= sSurfacePoolSize) { - } + if (gSurfacesAllocated >= sSurfacePoolSize) {} surface->type = 0; surface->force = 0; @@ -82,7 +80,7 @@ static struct Surface *alloc_surface(void) { /** * Iterates through the entire partition, clearing the surfaces. */ -static void clear_spatial_partition(SpatialPartitionCell *cells) { +static void clear_spatial_partition(SpatialPartitionCell* cells) { register s32 i = NUM_CELLS * NUM_CELLS; while (i--) { @@ -108,9 +106,9 @@ static void clear_static_surfaces(void) { * @param cellZ The Z position of the cell in which the surface resides * @param surface The surface to add */ -static void add_surface_to_cell(s16 dynamic, s16 cellX, s16 cellZ, struct Surface *surface) { - struct SurfaceNode *newNode = alloc_surface_node(); - struct SurfaceNode *list; +static void add_surface_to_cell(s16 dynamic, s16 cellX, s16 cellZ, struct Surface* surface) { + struct SurfaceNode* newNode = alloc_surface_node(); + struct SurfaceNode* list; s16 surfacePriority; s16 priority; s16 sortDir; @@ -263,7 +261,7 @@ static s16 upper_cell_index(s16 coord) { * @param surface The surface to check * @param dynamic Boolean determining whether the surface is static or dynamic */ -static void add_surface(struct Surface *surface, s32 dynamic) { +static void add_surface(struct Surface* surface, s32 dynamic) { // minY/maxY maybe? s32 instead of s16, though. UNUSED s32 unused1, unused2; s16 minX, minZ, maxX, maxZ; @@ -299,8 +297,8 @@ UNUSED static void stub_surface_load_1(void) { * @param vertexData The raw data containing vertex positions * @param vertexIndices Helper which tells positions in vertexData to start reading vertices */ -static struct Surface *read_surface_data(s16 *vertexData, s16 **vertexIndices) { - struct Surface *surface; +static struct Surface* read_surface_data(s16* vertexData, s16** vertexIndices) { + struct Surface* surface; register s32 x1, y1, z1; register s32 x2, y2, z2; register s32 x3, y3, z3; @@ -438,10 +436,10 @@ static s32 surf_has_no_cam_collision(s16 surfaceType) { * Load in the surfaces for a given surface type. This includes setting the flags, * exertion, and room. */ -static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s8 **surfaceRooms) { +static void load_static_surfaces(s16** data, s16* vertexData, s16 surfaceType, s8** surfaceRooms) { s32 i; s32 numSurfaces; - struct Surface *surface; + struct Surface* surface; s8 room = 0; s16 hasForce = surface_has_force(surfaceType); s16 flags = surf_has_no_cam_collision(surfaceType); @@ -459,7 +457,7 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s if (surface != NULL) { surface->room = room; surface->type = surfaceType; - surface->flags = (s8) flags; + surface->flags = (s8)flags; if (hasForce) { surface->force = *(*data + 3); @@ -480,10 +478,10 @@ static void load_static_surfaces(s16 **data, s16 *vertexData, s16 surfaceType, s /** * Read the data for vertices for reference by triangles. */ -static s16 *read_vertex_data(s16 **data) { +static s16* read_vertex_data(s16** data) { s32 numVertices; UNUSED u8 filler[16]; - s16 *vertexData; + s16* vertexData; numVertices = *(*data); (*data)++; @@ -497,15 +495,14 @@ static s16 *read_vertex_data(s16 **data) { /** * Loads in special environmental regions, such as water, poison gas, and JRB fog. */ -static void load_environmental_regions(s16 **data) { +static void load_environmental_regions(s16** data) { s32 numRegions; s32 i; gEnvironmentRegions = *data; numRegions = *(*data)++; - if (numRegions > 20) { - } + if (numRegions > 20) {} for (i = 0; i < numRegions; i++) { UNUSED s16 val, loX, loZ, hiX, hiZ; @@ -539,8 +536,8 @@ void alloc_surface_pools(void) { /** * Get the size of the terrain data, to get the correct size when copying later. */ -u32 get_area_terrain_size(s16 *data) { - s16 *startPos = data; +u32 get_area_terrain_size(s16* data) { + s16* startPos = data; s32 end = FALSE; s16 terrainLoadType; s32 numVertices; @@ -584,14 +581,13 @@ u32 get_area_terrain_size(s16 *data) { return data - startPos; } - /** * Process the level file, loading in vertices, surfaces, some objects, and environmental * boxes (water, gas, JRB fog). */ -void load_area_terrain(s16 index, s16 *data, s8 *surfaceRooms, s16 *macroObjects) { +void load_area_terrain(s16 index, s16* data, s8* surfaceRooms, s16* macroObjects) { s16 terrainLoadType; - s16 *vertexData; + s16* vertexData; UNUSED u8 filler[4]; // Initialize the data for this. @@ -661,12 +657,12 @@ UNUSED static void unused_80383604(void) { /** * Applies an object's transformation to the object's vertices. */ -void transform_object_vertices(s16 **data, s16 *vertexData) { - register s16 *vertices; +void transform_object_vertices(s16** data, s16* vertexData) { + register s16* vertices; register f32 vx, vy, vz; register s32 numVertices; - Mat4 *objectTransform; + Mat4* objectTransform; Mat4 m; objectTransform = &gCurrentObject->transform; @@ -701,7 +697,7 @@ void transform_object_vertices(s16 **data, s16 *vertexData) { /** * Load in the surfaces for the gCurrentObject. This includes setting the flags, exertion, and room. */ -void load_object_surfaces(s16 **data, s16 *vertexData) { +void load_object_surfaces(s16** data, s16* vertexData) { s32 surfaceType; s32 i; s32 numSurfaces; @@ -729,7 +725,7 @@ void load_object_surfaces(s16 **data, s16 *vertexData) { } for (i = 0; i < numSurfaces; i++) { - struct Surface *surface = read_surface_data(vertexData, data); + struct Surface* surface = read_surface_data(vertexData, data); if (surface != NULL) { surface->object = gCurrentObject; @@ -742,7 +738,7 @@ void load_object_surfaces(s16 **data, s16 *vertexData) { } surface->flags |= flags; - surface->room = (s8) room; + surface->room = (s8)room; add_surface(surface, TRUE); } @@ -761,7 +757,7 @@ void load_object_collision_model(void) { UNUSED u8 filler[4]; s16 vertexData[600]; - s16 *collisionData = segmented_to_virtual(gCurrentObject->collisionData); + s16* collisionData = segmented_to_virtual(gCurrentObject->collisionData); f32 marioDist = gCurrentObject->oDistanceToMario; f32 tangibleDist = gCurrentObject->oCollisionDistance; @@ -778,8 +774,8 @@ void load_object_collision_model(void) { } // Update if no Time Stop, in range, and in the current room. - if (!(gTimeStopState & TIME_STOP_ACTIVE) && marioDist < tangibleDist - && !(gCurrentObject->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) { + if (!(gTimeStopState & TIME_STOP_ACTIVE) && marioDist < tangibleDist && + !(gCurrentObject->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) { collisionData++; transform_object_vertices(&collisionData, vertexData); diff --git a/src/game/area.c b/src/game/area.c index ab4569bf..ddefaa09 100644 --- a/src/game/area.c +++ b/src/game/area.c @@ -24,7 +24,7 @@ #include "dialog_ids.h" struct SpawnInfo gPlayerSpawnInfos[1]; -struct GraphNode *D_8033A160[0x100]; +struct GraphNode* D_8033A160[0x100]; struct Area gAreaData[8]; struct WarpTransition gWarpTransition; @@ -36,13 +36,13 @@ s16 gSavedCourseNum; s16 gMenuOptSelectIndex; s16 gSaveOptSelectIndex; -struct SpawnInfo *gMarioSpawnInfo = &gPlayerSpawnInfos[0]; -struct GraphNode **gLoadedGraphNodes = D_8033A160; -struct Area *gAreas = gAreaData; -struct Area *gCurrentArea = NULL; -struct CreditsEntry *gCurrCreditsEntry = NULL; -Vp *D_8032CE74 = NULL; -Vp *D_8032CE78 = NULL; +struct SpawnInfo* gMarioSpawnInfo = &gPlayerSpawnInfos[0]; +struct GraphNode** gLoadedGraphNodes = D_8033A160; +struct Area* gAreas = gAreaData; +struct Area* gCurrentArea = NULL; +struct CreditsEntry* gCurrCreditsEntry = NULL; +Vp* D_8032CE74 = NULL; +Vp* D_8032CE78 = NULL; s16 gWarpTransDelay = 0; u32 gFBSetColor = 0; u32 gWarpTransFBSetColor = 0; @@ -57,22 +57,52 @@ s16 gCurrLevelNum = LEVEL_MIN; * from warp behavior. * When looping through sWarpBhvSpawnTable, if the behavior function in the table matches * the spawn behavior executed, the index of that behavior is used with sSpawnTypeFromWarpBhv -*/ + */ -const BehaviorScript *sWarpBhvSpawnTable[] = { - bhvDoorWarp, bhvStar, bhvExitPodiumWarp, bhvWarp, - bhvWarpPipe, bhvFadingWarp, bhvInstantActiveWarp, bhvAirborneWarp, - bhvHardAirKnockBackWarp, bhvSpinAirborneCircleWarp, bhvDeathWarp, bhvSpinAirborneWarp, - bhvFlyingWarp, bhvSwimmingWarp, bhvPaintingStarCollectWarp, bhvPaintingDeathWarp, - bhvAirborneStarCollectWarp, bhvAirborneDeathWarp, bhvLaunchStarCollectWarp, bhvLaunchDeathWarp, +const BehaviorScript* sWarpBhvSpawnTable[] = { + bhvDoorWarp, + bhvStar, + bhvExitPodiumWarp, + bhvWarp, + bhvWarpPipe, + bhvFadingWarp, + bhvInstantActiveWarp, + bhvAirborneWarp, + bhvHardAirKnockBackWarp, + bhvSpinAirborneCircleWarp, + bhvDeathWarp, + bhvSpinAirborneWarp, + bhvFlyingWarp, + bhvSwimmingWarp, + bhvPaintingStarCollectWarp, + bhvPaintingDeathWarp, + bhvAirborneStarCollectWarp, + bhvAirborneDeathWarp, + bhvLaunchStarCollectWarp, + bhvLaunchDeathWarp, }; u8 sSpawnTypeFromWarpBhv[] = { - MARIO_SPAWN_DOOR_WARP, MARIO_SPAWN_UNKNOWN_02, MARIO_SPAWN_UNKNOWN_03, MARIO_SPAWN_UNKNOWN_03, - MARIO_SPAWN_UNKNOWN_03, MARIO_SPAWN_TELEPORT, MARIO_SPAWN_INSTANT_ACTIVE, MARIO_SPAWN_AIRBORNE, - MARIO_SPAWN_HARD_AIR_KNOCKBACK, MARIO_SPAWN_SPIN_AIRBORNE_CIRCLE, MARIO_SPAWN_DEATH, MARIO_SPAWN_SPIN_AIRBORNE, - MARIO_SPAWN_FLYING, MARIO_SPAWN_SWIMMING, MARIO_SPAWN_PAINTING_STAR_COLLECT, MARIO_SPAWN_PAINTING_DEATH, - MARIO_SPAWN_AIRBORNE_STAR_COLLECT, MARIO_SPAWN_AIRBORNE_DEATH, MARIO_SPAWN_LAUNCH_STAR_COLLECT, MARIO_SPAWN_LAUNCH_DEATH, + MARIO_SPAWN_DOOR_WARP, + MARIO_SPAWN_UNKNOWN_02, + MARIO_SPAWN_UNKNOWN_03, + MARIO_SPAWN_UNKNOWN_03, + MARIO_SPAWN_UNKNOWN_03, + MARIO_SPAWN_TELEPORT, + MARIO_SPAWN_INSTANT_ACTIVE, + MARIO_SPAWN_AIRBORNE, + MARIO_SPAWN_HARD_AIR_KNOCKBACK, + MARIO_SPAWN_SPIN_AIRBORNE_CIRCLE, + MARIO_SPAWN_DEATH, + MARIO_SPAWN_SPIN_AIRBORNE, + MARIO_SPAWN_FLYING, + MARIO_SPAWN_SWIMMING, + MARIO_SPAWN_PAINTING_STAR_COLLECT, + MARIO_SPAWN_PAINTING_DEATH, + MARIO_SPAWN_AIRBORNE_STAR_COLLECT, + MARIO_SPAWN_AIRBORNE_DEATH, + MARIO_SPAWN_LAUNCH_STAR_COLLECT, + MARIO_SPAWN_LAUNCH_DEATH, }; Vp D_8032CF00 = { { @@ -81,14 +111,14 @@ Vp D_8032CF00 = { { } }; #ifdef VERSION_EU -const char *gNoControllerMsg[] = { +const char* gNoControllerMsg[] = { "NO CONTROLLER", "MANETTE DEBRANCHEE", "CONTROLLER FEHLT", }; #endif -void override_viewport_and_clip(Vp *a, Vp *b, u8 c, u8 d, u8 e) { +void override_viewport_and_clip(Vp* a, Vp* b, u8 c, u8 d, u8 e) { u16 sp6 = ((c >> 3) << 11) | ((d >> 3) << 6) | ((e >> 3) << 1) | 1; gFBSetColor = (sp6 << 16) | sp6; @@ -127,9 +157,9 @@ void print_intro_text(void) { } } -u32 get_mario_spawn_type(struct Object *o) { +u32 get_mario_spawn_type(struct Object* o) { s32 i; - const BehaviorScript *behavior = virtual_to_segmented(0x13, o->behavior); + const BehaviorScript* behavior = virtual_to_segmented(0x13, o->behavior); for (i = 0; i < 20; i++) { if (sWarpBhvSpawnTable[i] == behavior) { @@ -139,8 +169,8 @@ u32 get_mario_spawn_type(struct Object *o) { return 0; } -struct ObjectWarpNode *area_get_warp_node(u8 id) { - struct ObjectWarpNode *node = NULL; +struct ObjectWarpNode* area_get_warp_node(u8 id) { + struct ObjectWarpNode* node = NULL; for (node = gCurrentArea->warpNodes; node != NULL; node = node->next) { if (node->node.id == id) { @@ -150,18 +180,18 @@ struct ObjectWarpNode *area_get_warp_node(u8 id) { return node; } -struct ObjectWarpNode *area_get_warp_node_from_params(struct Object *o) { +struct ObjectWarpNode* area_get_warp_node_from_params(struct Object* o) { u8 sp1F = (o->oBehParams & 0x00FF0000) >> 16; return area_get_warp_node(sp1F); } void load_obj_warp_nodes(void) { - struct ObjectWarpNode *sp24; - struct Object *sp20 = (struct Object *) gObjParentGraphNode.children; + struct ObjectWarpNode* sp24; + struct Object* sp20 = (struct Object*)gObjParentGraphNode.children; do { - struct Object *sp1C = sp20; + struct Object* sp1C = sp20; if (sp1C->activeFlags != ACTIVE_FLAG_DEACTIVATED && get_mario_spawn_type(sp1C) != 0) { sp24 = area_get_warp_node_from_params(sp1C); @@ -169,8 +199,7 @@ void load_obj_warp_nodes(void) { sp24->object = sp1C; } } - } while ((sp20 = (struct Object *) sp20->header.gfx.node.next) - != (struct Object *) gObjParentGraphNode.children); + } while ((sp20 = (struct Object*)sp20->header.gfx.node.next) != (struct Object*)gObjParentGraphNode.children); } void clear_areas(void) { @@ -227,8 +256,7 @@ void load_area(s32 index) { gCurrAreaIndex = gCurrentArea->index; if (gCurrentArea->terrainData != NULL) { - load_area_terrain(index, gCurrentArea->terrainData, gCurrentArea->surfaceRooms, - gCurrentArea->macroObjects); + load_area_terrain(index, gCurrentArea->terrainData, gCurrentArea->surfaceRooms, gCurrentArea->macroObjects); } if (gCurrentArea->objectSpawnInfos != NULL) { @@ -389,8 +417,8 @@ void render_game(void) { if (gWarpTransition.isActive) { if (gWarpTransDelay == 0) { - gWarpTransition.isActive = !render_screen_transition(0, gWarpTransition.type, gWarpTransition.time, - &gWarpTransition.data); + gWarpTransition.isActive = + !render_screen_transition(0, gWarpTransition.type, gWarpTransition.time, &gWarpTransition.data); if (!gWarpTransition.isActive) { if (gWarpTransition.type & 1) { gWarpTransition.pauseRendering = TRUE; diff --git a/src/game/behavior_actions.c b/src/game/behavior_actions.c index b638fd86..09bb430a 100644 --- a/src/game/behavior_actions.c +++ b/src/game/behavior_actions.c @@ -55,9 +55,8 @@ static s32 sCapSaveFlags[] = { // Boo Roll static s16 sBooHitRotations[] = { - 6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624, 3329, 3046, 2775, - 2517, 2271, 2039, 1818, 1611, 1416, 1233, 1063, 906, 761, 629, - 509, 402, 308, 226, 157, 100, 56, 25, 4, 0, + 6047, 5664, 5292, 4934, 4587, 4254, 3933, 3624, 3329, 3046, 2775, 2517, 2271, 2039, 1818, 1611, + 1416, 1233, 1063, 906, 761, 629, 509, 402, 308, 226, 157, 100, 56, 25, 4, 0, }; #include "behaviors/star_door.inc.c" @@ -143,11 +142,11 @@ void spawn_mist_particles_variable(s32 count, s32 offsetY, f32 size) { #include "behaviors/breakable_box.inc.c" // 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; if (run == TRUE) { - struct Object *sp1C = (struct Object *) gCurGraphNodeObject; + 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); @@ -221,7 +220,7 @@ void vec3f_copy_2(Vec3f dest, Vec3f src) { s32 set_obj_anim_with_accel_and_sound(s16 a0, s16 a1, s32 a2) { f32 sp1C; - if ((sp1C = o->header.gfx.animInfo.animAccel / (f32) 0x10000) == 0) { + if ((sp1C = o->header.gfx.animInfo.animAccel / (f32)0x10000) == 0) { sp1C = 1.0f; } diff --git a/src/game/behaviors/activated_bf_plat.inc.c b/src/game/behaviors/activated_bf_plat.inc.c index 8b6399b7..e27681b3 100644 --- a/src/game/behaviors/activated_bf_plat.inc.c +++ b/src/game/behaviors/activated_bf_plat.inc.c @@ -17,7 +17,7 @@ * move off of it. To do this, they changed it to a bhvPlatformOnTrack, but * forgot to remove its entry in this table. */ -static Collision const *sActivatedBackAndForthPlatformCollisionModels[] = { +static Collision const* sActivatedBackAndForthPlatformCollisionModels[] = { /* ACTIVATED_BF_PLAT_TYPE_BITS_ARROW_PLAT */ bits_seg7_collision_0701AD54, /* ACTIVATED_BF_PLAT_TYPE_BITFS_MESH_PLAT */ bitfs_seg7_collision_070157E0, /* ACTIVATED_BF_PLAT_TYPE_BITFS_ELEVATOR */ bitfs_seg7_collision_07015124 @@ -38,8 +38,7 @@ void bhv_activated_back_and_forth_platform_init(void) { o->oActivatedBackAndForthPlatformFlipRotation = 0x8000; } - o->collisionData = - segmented_to_virtual(sActivatedBackAndForthPlatformCollisionModels[platformType]); + o->collisionData = segmented_to_virtual(sActivatedBackAndForthPlatformCollisionModels[platformType]); // Max distance the platform should move. // Equivalent to 50 * (oBehParams2ndByte & 0x7F), i.e. 50 * (oBehParams2ndByte % 128). @@ -88,9 +87,7 @@ void bhv_activated_back_and_forth_platform_update(void) { // clamp_f32 returns whether the value needed to be clamped. // So if the offset got out of bounds (i.e. platform has reached an end of its path), // or Mario is over 3000 units away, the platform will reset the wait timer and flip around. - if (clamp_f32(&o->oActivatedBackAndForthPlatformOffset, 0.0f, - o->oActivatedBackAndForthPlatformMaxOffset) - || + if (clamp_f32(&o->oActivatedBackAndForthPlatformOffset, 0.0f, o->oActivatedBackAndForthPlatformMaxOffset) || // The platform will not reset if Mario goes far away and it's travelling backwards (o->oActivatedBackAndForthPlatformVel > 0.0f && o->oDistanceToMario > 3000.0f)) { // Reset the wait timer diff --git a/src/game/behaviors/amp.inc.c b/src/game/behaviors/amp.inc.c index 4fbdadb7..91471fa7 100644 --- a/src/game/behaviors/amp.inc.c +++ b/src/game/behaviors/amp.inc.c @@ -102,8 +102,7 @@ static void homing_amp_appear_loop(void) { */ static void homing_amp_chase_loop(void) { // Lock on to Mario if he ever goes within 11.25 degrees of the amp's line of sight - if ((o->oAngleToMario - 0x400 < o->oMoveAngleYaw) - && (o->oMoveAngleYaw < o->oAngleToMario + 0x400)) { + if ((o->oAngleToMario - 0x400 < o->oMoveAngleYaw) && (o->oMoveAngleYaw < o->oAngleToMario + 0x400)) { o->oHomingAmpLockedOn = TRUE; o->oTimer = 0; } diff --git a/src/game/behaviors/animated_floor_switch.inc.c b/src/game/behaviors/animated_floor_switch.inc.c index e0e8471f..a0154614 100644 --- a/src/game/behaviors/animated_floor_switch.inc.c +++ b/src/game/behaviors/animated_floor_switch.inc.c @@ -1,7 +1,7 @@ // animated_floor_switch.inc.c struct Struct80331A54 { - const Collision *collision; + const Collision* collision; s16 model; }; @@ -70,8 +70,8 @@ void bhv_animates_on_floor_switch_press_loop(void) { o->oFloorSwitchPressAnimationUnkFC = 1; } - o->collisionData = segmented_to_virtual( - D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].collision); + o->collisionData = + segmented_to_virtual(D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].collision); cur_obj_set_model(D_80331A54[o->oBehParams2ndByte][o->oFloorSwitchPressAnimationUnkF8 / 2].model); } diff --git a/src/game/behaviors/bbh_haunted_bookshelf.inc.c b/src/game/behaviors/bbh_haunted_bookshelf.inc.c index e6591217..0856b246 100644 --- a/src/game/behaviors/bbh_haunted_bookshelf.inc.c +++ b/src/game/behaviors/bbh_haunted_bookshelf.inc.c @@ -19,8 +19,7 @@ void bhv_haunted_bookshelf_loop(void) { switch (o->oAction) { case HAUNTED_BOOKSHELF_ACT_IDLE: // ??? - if (o->oTimer == 0) { - } + if (o->oTimer == 0) {} // This code never runs, since the action is set to 1 directly // by bhvHauntedBookshelfManager. Maybe this was diff --git a/src/game/behaviors/bbh_merry_go_round.inc.c b/src/game/behaviors/bbh_merry_go_round.inc.c index 5b634428..90053bd7 100644 --- a/src/game/behaviors/bbh_merry_go_round.inc.c +++ b/src/game/behaviors/bbh_merry_go_round.inc.c @@ -22,7 +22,7 @@ static void handle_merry_go_round_music(void) { } } else { // Get Mario's floor and floor surface type - struct Surface *marioFloor; + struct Surface* marioFloor; u16 marioFloorType; find_floor(gMarioObject->oPosX, gMarioObject->oPosY, gMarioObject->oPosZ, &marioFloor); @@ -53,8 +53,7 @@ static void handle_merry_go_round_music(void) { // If he is, play the creaking sound. if ( // The merry-go-round is a dynamic surface. - gMarioCurrentRoom != BBH_DYNAMIC_SURFACE_ROOM - && gMarioCurrentRoom != BBH_NEAR_MERRY_GO_ROUND_ROOM) { + gMarioCurrentRoom != BBH_DYNAMIC_SURFACE_ROOM && gMarioCurrentRoom != BBH_NEAR_MERRY_GO_ROUND_ROOM) { func_80321080(300); // Switch to BBH music? FIXME: Audio needs labelling o->oMerryGoRoundMusicShouldPlay = FALSE; } else { diff --git a/src/game/behaviors/bbh_tilting_trap.inc.c b/src/game/behaviors/bbh_tilting_trap.inc.c index d54460af..12fed889 100644 --- a/src/game/behaviors/bbh_tilting_trap.inc.c +++ b/src/game/behaviors/bbh_tilting_trap.inc.c @@ -15,7 +15,7 @@ void bhv_bbh_tilting_trap_platform_loop(void) { // if statement, while immediately setting it over here. // This was done so that Mario leaving or getting on the platform // resets oTimer to 0. - if(!ROM_JP) { + if (!ROM_JP) { if (gMarioObject->platform == o) { o->oAction = BBH_TILTING_TRAP_PLATFORM_ACT_MARIO_ON; } else { @@ -37,7 +37,7 @@ void bhv_bbh_tilting_trap_platform_loop(void) { // 200 angle units/frame, and clamp it to 0 if it's within 200 units of 0. o->oAngleVelPitch = 0; - if ((s16) o->oFaceAnglePitch > 0) { + if ((s16)o->oFaceAnglePitch > 0) { if (o->oFaceAnglePitch < 200) { o->oFaceAnglePitch = 0; } else { diff --git a/src/game/behaviors/beta_boo_key.inc.c b/src/game/behaviors/beta_boo_key.inc.c index 23249555..686c51df 100644 --- a/src/game/behaviors/beta_boo_key.inc.c +++ b/src/game/behaviors/beta_boo_key.inc.c @@ -113,7 +113,7 @@ static void beta_boo_key_drop(void) { f32 velocityMagnitude; // Update the key to be inside the boo - struct Object *parent = o->parentObj; + struct Object* parent = o->parentObj; obj_copy_pos(o, parent); // This if statement to only run this code on the first frame @@ -147,7 +147,7 @@ static void beta_boo_key_drop(void) { */ static void beta_boo_key_inside_boo_loop(void) { // Update the key to be inside the boo at all times - struct Object *parent = o->parentObj; + struct Object* parent = o->parentObj; obj_copy_pos(o, parent); // Use a Y offset of 40 to make the key model aligned correctly. diff --git a/src/game/behaviors/beta_trampoline.inc.c b/src/game/behaviors/beta_trampoline.inc.c index 100ebc23..2f9aa6f7 100644 --- a/src/game/behaviors/beta_trampoline.inc.c +++ b/src/game/behaviors/beta_trampoline.inc.c @@ -58,7 +58,7 @@ void bhv_beta_trampoline_top_loop(void) { // When initialized, spawn the rest of the trampoline if (o->oTimer == 0) { - struct Object *trampolinePart; + struct Object* trampolinePart; trampolinePart = spawn_object(o, MODEL_TRAMPOLINE_CENTER, bhvBetaTrampolineSpring); trampolinePart->oPosY -= 75.0f; diff --git a/src/game/behaviors/blue_coin.inc.c b/src/game/behaviors/blue_coin.inc.c index 902a6739..c8754e5a 100644 --- a/src/game/behaviors/blue_coin.inc.c +++ b/src/game/behaviors/blue_coin.inc.c @@ -9,7 +9,7 @@ * Update function for bhvHiddenBlueCoin. */ void bhv_hidden_blue_coin_loop(void) { - struct Object *blueCoinSwitch; + struct Object* blueCoinSwitch; switch (o->oAction) { case HIDDEN_BLUE_COIN_ACT_INACTIVE: diff --git a/src/game/behaviors/blue_fish.inc.c b/src/game/behaviors/blue_fish.inc.c index 452748da..49671634 100644 --- a/src/game/behaviors/blue_fish.inc.c +++ b/src/game/behaviors/blue_fish.inc.c @@ -100,7 +100,7 @@ void bhv_blue_fish_movement_loop(void) { * They move at random within 200.0f */ void bhv_tank_fish_group_loop(void) { - struct Object *fish; + struct Object* fish; s32 i; switch (o->oAction) { diff --git a/src/game/behaviors/bobomb.inc.c b/src/game/behaviors/bobomb.inc.c index 4db4137b..7f2ebbca 100644 --- a/src/game/behaviors/bobomb.inc.c +++ b/src/game/behaviors/bobomb.inc.c @@ -29,9 +29,9 @@ void bobomb_spawn_coin(void) { void bobomb_act_explode(void) { if (o->oTimer < 5) { - cur_obj_scale(1.0 + (f32) o->oTimer / 5.0); + cur_obj_scale(1.0 + (f32)o->oTimer / 5.0); } else { - struct Object *explosion = spawn_object(o, MODEL_EXPLOSION, bhvExplosion); + struct Object* explosion = spawn_object(o, MODEL_EXPLOSION, bhvExplosion); explosion->oGraphYOffset += 100.0f; bobomb_spawn_coin(); @@ -72,8 +72,8 @@ void bobomb_act_patrol(void) { o->oForwardVel = 5.0f; collisionFlags = object_step(); - if ((obj_return_home_if_safe(o, o->oHomeX, o->oHomeY, o->oHomeZ, 400) == TRUE) - && (obj_check_if_facing_toward_angle(o->oMoveAngleYaw, o->oAngleToMario, 0x2000) == TRUE)) { + if ((obj_return_home_if_safe(o, o->oHomeX, o->oHomeY, o->oHomeZ, 400) == TRUE) && + (obj_check_if_facing_toward_angle(o->oMoveAngleYaw, o->oAngleToMario, 0x2000) == TRUE)) { o->oBobombFuseLit = 1; o->oAction = BOBOMB_ACT_CHASE_MARIO; } @@ -83,7 +83,7 @@ void bobomb_act_patrol(void) { void bobomb_act_chase_mario(void) { UNUSED u8 filler[4]; - s16 animFrame = ++o->header.gfx.animInfo.animFrame; + s16 animFrame = ++o->header.gfx.animInfo.animFrame; s16 collisionFlags; o->oForwardVel = 20.0f; @@ -215,7 +215,7 @@ void bobomb_thrown_loop(void) { o->oAction = BOBOMB_ACT_LAUNCHED; } -void curr_obj_random_blink(s32 *blinkTimer) { +void curr_obj_random_blink(s32* blinkTimer) { if (*blinkTimer == 0) { if ((s16)(random_float() * 100.0f) == 0) { o->oAnimState = 1; @@ -329,7 +329,7 @@ void bobomb_buddy_act_idle(void) { * then tells Mario that is "Ready for blastoff". */ void bobomb_buddy_cannon_dialog(s16 dialogFirstText, s16 dialogSecondText) { - struct Object *cannonClosed; + struct Object* cannonClosed; s16 buddyText, cutscene; switch (o->oBobombBuddyCannonStatus) { @@ -379,8 +379,8 @@ void bobomb_buddy_act_talk(void) { switch (o->oBobombBuddyRole) { case BOBOMB_BUDDY_ROLE_ADVICE: - if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, o->oBehParams2ndByte) - != BOBOMB_BUDDY_BP_STYPE_GENERIC) { + if (cutscene_object_with_dialog(CUTSCENE_DIALOG, o, o->oBehParams2ndByte) != + BOBOMB_BUDDY_BP_STYPE_GENERIC) { set_mario_npc_dialog(MARIO_DIALOG_STOP); o->activeFlags &= ~ACTIVE_FLAG_INITIATED_TIME_STOP; @@ -410,7 +410,7 @@ void bobomb_buddy_act_turn_to_talk(void) { o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oAngleToMario, 0x1000); - if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario) { + if ((s16)o->oMoveAngleYaw == (s16)o->oAngleToMario) { o->oAction = BOBOMB_BUDDY_ACT_TALK; } diff --git a/src/game/behaviors/boo.inc.c b/src/game/behaviors/boo.inc.c index a7135b33..6df37936 100644 --- a/src/game/behaviors/boo.inc.c +++ b/src/game/behaviors/boo.inc.c @@ -71,8 +71,7 @@ static s32 boo_should_be_active(void) { return TRUE; } } else if (!boo_should_be_stopped()) { - if (o->oDistanceToMario < activationRadius - && (o->oRoom == gMarioCurrentRoom || gMarioCurrentRoom == 0)) { + if (o->oDistanceToMario < activationRadius && (o->oRoom == gMarioCurrentRoom || gMarioCurrentRoom == 0)) { return TRUE; } } @@ -87,9 +86,9 @@ void bhv_courtyard_boo_triplet_init(void) { obj_mark_for_deletion(o); } else { for (i = 0; i < 3; i++) { - struct Object *boo = spawn_object_relative( - 1, sCourtyardBooTripletPositions[i][0], sCourtyardBooTripletPositions[i][1], - sCourtyardBooTripletPositions[i][2], o, MODEL_BOO, bhvGhostHuntBoo); + struct Object* boo = + spawn_object_relative(1, sCourtyardBooTripletPositions[i][0], sCourtyardBooTripletPositions[i][1], + sCourtyardBooTripletPositions[i][2], o, MODEL_BOO, bhvGhostHuntBoo); boo->oMoveAngleYaw = random_u16(); } @@ -141,8 +140,8 @@ static s32 boo_vanish_or_appear(void) { o->oVelY = 0.0f; - if (relativeAngleToMario > relativeAngleToMarioThreshhold - || relativeMarioFaceAngle < relativeMarioFaceAngleThreshhold) { + if (relativeAngleToMario > relativeAngleToMarioThreshhold || + relativeMarioFaceAngle < relativeMarioFaceAngleThreshhold) { if (o->oOpacity == 40) { o->oBooTargetOpacity = 255; cur_obj_play_sound_2(SOUND_OBJ_BOO_LAUGH_LONG); @@ -162,11 +161,11 @@ static void boo_set_move_yaw_for_during_hit(s32 hurt) { cur_obj_become_intangible(); o->oFlags &= ~OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW; - o->oBooMoveYawBeforeHit = (f32) o->oMoveAngleYaw; + o->oBooMoveYawBeforeHit = (f32)o->oMoveAngleYaw; if (hurt) { o->oBooMoveYawDuringHit = gMarioObject->oMoveAngleYaw; - } else if (coss((s16) o->oMoveAngleYaw - (s16) o->oAngleToMario) < 0.0f) { + } else if (coss((s16)o->oMoveAngleYaw - (s16)o->oAngleToMario) < 0.0f) { o->oBooMoveYawDuringHit = o->oMoveAngleYaw; } else { o->oBooMoveYawDuringHit = (s16)(o->oMoveAngleYaw + 0x8000); @@ -186,7 +185,7 @@ static void boo_move_during_hit(s32 roll, f32 fVel) { o->oMoveAngleYaw = o->oBooMoveYawDuringHit; if (roll) { - o->oFaceAngleYaw += sBooHitRotations[o->oTimer]; + o->oFaceAngleYaw += sBooHitRotations[o->oTimer]; o->oFaceAngleRoll += sBooHitRotations[o->oTimer]; } } @@ -265,7 +264,7 @@ static s32 boo_update_during_death(void) { o->oBooDeathStatus = BOO_DEATH_STATUS_DEAD; if (o->oBooParentBigBoo != NULL) { - struct Object *parentBigBoo = o->oBooParentBigBoo; + struct Object* parentBigBoo = o->oBooParentBigBoo; if (ROM_JP || !cur_obj_has_behavior(bhvBoo)) { parentBigBoo->oBigBooNumMinionBoosKilled++; @@ -295,8 +294,7 @@ static s32 boo_get_attack_status(void) { s32 attackStatus = BOO_NOT_ATTACKED; if (o->oInteractStatus & INT_STATUS_INTERACTED) { - if ((o->oInteractStatus & INT_STATUS_WAS_ATTACKED) - && !obj_has_attack_type(ATTACK_FROM_ABOVE)) { + if ((o->oInteractStatus & INT_STATUS_WAS_ATTACKED) && !obj_has_attack_type(ATTACK_FROM_ABOVE)) { cur_obj_become_intangible(); o->oInteractStatus = 0; @@ -336,8 +334,7 @@ static void boo_chase_mario(f32 a0, s16 a1, f32 a2) { if (!mario_is_in_air_action()) { sp1C = o->oPosY - gMarioObject->oPosY; if (a0 < sp1C && sp1C < 500.0f) { - o->oVelY = increment_velocity_toward_range - (o->oPosY, gMarioObject->oPosY + 50.0f, 10.0f, 2.0f); + o->oVelY = increment_velocity_toward_range(o->oPosY, gMarioObject->oPosY + 50.0f, 10.0f, 2.0f); } } @@ -461,24 +458,18 @@ static void boo_act_4(void) { } static void (*sBooActions[])(void) = { - boo_act_0, - boo_act_1, - boo_act_2, - boo_act_3, - boo_act_4, - boo_act_5, + boo_act_0, boo_act_1, boo_act_2, boo_act_3, boo_act_4, boo_act_5, }; void bhv_boo_loop(void) { - //PARTIAL_UPDATE + // PARTIAL_UPDATE cur_obj_update_floor_and_walls(); cur_obj_call_action_function(sBooActions); cur_obj_move_standard(78); boo_approach_target_opacity_and_update_scale(); - if (obj_has_behavior(o->parentObj, bhvMerryGoRoundBooManager) - && o->activeFlags == ACTIVE_FLAG_DEACTIVATED) { + if (obj_has_behavior(o->parentObj, bhvMerryGoRoundBooManager) && o->activeFlags == ACTIVE_FLAG_DEACTIVATED) { o->parentObj->oMerryGoRoundBooManagerNumBoosKilled++; } @@ -495,10 +486,8 @@ static void big_boo_act_0(void) { o->oBooParentBigBoo = NULL; - if (boo_should_be_active() && - (ROM_JP ? o->oBigBooNumMinionBoosKilled >= 5 : - o->oBigBooNumMinionBoosKilled >= gDebugInfo[DEBUG_PAGE_ENEMYINFO][0] + 5) - ) { + if (boo_should_be_active() && (ROM_JP ? o->oBigBooNumMinionBoosKilled >= 5 + : o->oBigBooNumMinionBoosKilled >= gDebugInfo[DEBUG_PAGE_ENEMYINFO][0] + 5)) { o->oAction = 1; cur_obj_set_pos_to_home(); @@ -525,11 +514,14 @@ static void big_boo_act_1(void) { f32 sp1C; if (o->oHealth == 3) { - sp22 = 0x180; sp1C = 0.5f; + sp22 = 0x180; + sp1C = 0.5f; } else if (o->oHealth == 2) { - sp22 = 0x240; sp1C = 0.6f; + sp22 = 0x240; + sp1C = 0.6f; } else { - sp22 = 0x300; sp1C = 0.8f; + sp22 = 0x300; + sp1C = 0.8f; } boo_chase_mario(-100.0f, sp22, sp1C); @@ -573,7 +565,7 @@ static void big_boo_spawn_balcony_star(void) { } static void big_boo_spawn_merry_go_round_star(void) { - struct Object *merryGoRound; + struct Object* merryGoRound; spawn_default_star(-1600.0f, -2100.0f, 205.0f); @@ -618,7 +610,7 @@ static void big_boo_act_3(void) { } static void big_boo_act_4(void) { - if(!ROM_JP) { + if (!ROM_JP) { boo_stop(); } @@ -626,11 +618,11 @@ static void big_boo_act_4(void) { obj_set_pos(o, 973, 0, 626); if (o->oTimer > 60 && o->oDistanceToMario < 600.0f) { - obj_set_pos(o, 973, 0, 717); + obj_set_pos(o, 973, 0, 717); - spawn_object_relative(0, 0, 0, 0, o, MODEL_BBH_STAIRCASE_STEP, bhvBooStaircase); + spawn_object_relative(0, 0, 0, 0, o, MODEL_BBH_STAIRCASE_STEP, bhvBooStaircase); spawn_object_relative(1, 0, 0, -200, o, MODEL_BBH_STAIRCASE_STEP, bhvBooStaircase); - spawn_object_relative(2, 0, 0, 200, o, MODEL_BBH_STAIRCASE_STEP, bhvBooStaircase); + spawn_object_relative(2, 0, 0, 200, o, MODEL_BBH_STAIRCASE_STEP, bhvBooStaircase); obj_mark_for_deletion(o); } @@ -640,15 +632,11 @@ static void big_boo_act_4(void) { } static void (*sBooGivingStarActions[])(void) = { - big_boo_act_0, - big_boo_act_1, - big_boo_act_2, - big_boo_act_3, - big_boo_act_4, + big_boo_act_0, big_boo_act_1, big_boo_act_2, big_boo_act_3, big_boo_act_4, }; void bhv_big_boo_loop(void) { - //PARTIAL_UPDATE + // PARTIAL_UPDATE obj_set_hitbox(o, &sBooGivingStarHitbox); @@ -712,7 +700,7 @@ void bhv_boo_with_cage_init(void) { if (gHudDisplay.stars < SPAWN_CASTLE_BOO_STAR_REQUIREMENT) { obj_mark_for_deletion(o); } else { - struct Object *cage = spawn_object(o, MODEL_HAUNTED_CAGE, bhvBooCage); + struct Object* cage = spawn_object(o, MODEL_HAUNTED_CAGE, bhvBooCage); cage->oBehParams = o->oBehParams; } } @@ -725,7 +713,7 @@ static void (*sBooWithCageActions[])(void) = { }; void bhv_boo_with_cage_loop(void) { - //PARTIAL_UPDATE + // PARTIAL_UPDATE cur_obj_update_floor_and_walls(); cur_obj_call_action_function(sBooWithCageActions); @@ -742,8 +730,7 @@ void bhv_merry_go_round_boo_manager_loop(void) { if (o->oDistanceToMario < 1000.0f) { if (o->oMerryGoRoundBooManagerNumBoosKilled < 5) { if (o->oMerryGoRoundBooManagerNumBoosSpawned != 5) { - if (o->oMerryGoRoundBooManagerNumBoosSpawned - - o->oMerryGoRoundBooManagerNumBoosKilled < 2) { + if (o->oMerryGoRoundBooManagerNumBoosSpawned - o->oMerryGoRoundBooManagerNumBoosKilled < 2) { spawn_object(o, MODEL_BOO, bhvMerryGoRoundBoo); o->oMerryGoRoundBooManagerNumBoosSpawned++; } @@ -753,12 +740,12 @@ void bhv_merry_go_round_boo_manager_loop(void) { } if (o->oMerryGoRoundBooManagerNumBoosKilled >= 5) { - struct Object *boo = spawn_object(o, MODEL_BOO, bhvMerryGoRoundBigBoo); + struct Object* boo = spawn_object(o, MODEL_BOO, bhvMerryGoRoundBigBoo); obj_copy_behavior_params(boo, o); o->oAction = 2; - if(ROM_JP) { + if (ROM_JP) { play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource); } else { play_puzzle_jingle(); diff --git a/src/game/behaviors/boo_cage.inc.c b/src/game/behaviors/boo_cage.inc.c index 76f1f04e..84809c0f 100644 --- a/src/game/behaviors/boo_cage.inc.c +++ b/src/game/behaviors/boo_cage.inc.c @@ -74,8 +74,7 @@ void bhv_boo_cage_loop(void) { // set the action to BOO_CAGE_ACT_ON_GROUND. // This is the only use of the OBJ_MOVE_AT_WATER_SURFACE flag in the game. // It seems to serve no purpose here. - if (o->oMoveFlags - & (OBJ_MOVE_UNDERWATER_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_ON_GROUND)) { + if (o->oMoveFlags & (OBJ_MOVE_UNDERWATER_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_ON_GROUND)) { o->oAction++; } diff --git a/src/game/behaviors/boulder.inc.c b/src/game/behaviors/boulder.inc.c index 7a685bbd..7a41c9e9 100644 --- a/src/game/behaviors/boulder.inc.c +++ b/src/game/behaviors/boulder.inc.c @@ -49,14 +49,13 @@ void bhv_big_boulder_loop(void) { } void bhv_big_boulder_generator_loop(void) { - struct Object *sp1C; + struct Object* sp1C; if (o->oTimer >= 256) { o->oTimer = 0; } - if (!current_mario_room_check(4) - || is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 1500)) { + if (!current_mario_room_check(4) || is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 1500)) { return; } diff --git a/src/game/behaviors/bouncing_fireball.inc.c b/src/game/behaviors/bouncing_fireball.inc.c index 49b8bdc6..676a98fe 100644 --- a/src/game/behaviors/bouncing_fireball.inc.c +++ b/src/game/behaviors/bouncing_fireball.inc.c @@ -23,9 +23,8 @@ void bhv_bouncing_fireball_flame_loop(void) { o->oForwardVel = 30.0f; } - if (o->oMoveFlags - & (OBJ_MOVE_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_UNDERWATER_ON_GROUND) - && o->oTimer > 100) { + if (o->oMoveFlags & (OBJ_MOVE_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_UNDERWATER_ON_GROUND) && + o->oTimer > 100) { obj_mark_for_deletion(o); } break; @@ -41,7 +40,7 @@ void bhv_bouncing_fireball_flame_loop(void) { } void bhv_bouncing_fireball_loop(void) { - struct Object *sp2C; + struct Object* sp2C; f32 sp28; switch (o->oAction) { diff --git a/src/game/behaviors/bowling_ball.inc.c b/src/game/behaviors/bowling_ball.inc.c index 055a09eb..f7532192 100644 --- a/src/game/behaviors/bowling_ball.inc.c +++ b/src/game/behaviors/bowling_ball.inc.c @@ -13,30 +13,25 @@ static struct ObjectHitbox sBowlingBallHitbox = { }; static Trajectory sThiHugeMetalBallTraj[] = { - TRAJECTORY_POS(0, /*pos*/ -4786, 101, -2166), - TRAJECTORY_POS(1, /*pos*/ -5000, 81, -2753), - TRAJECTORY_POS(2, /*pos*/ -5040, 33, -3846), - TRAJECTORY_POS(3, /*pos*/ -4966, 38, -4966), - TRAJECTORY_POS(4, /*pos*/ -4013, -259, -4893), + TRAJECTORY_POS(0, /*pos*/ -4786, 101, -2166), + TRAJECTORY_POS(1, /*pos*/ -5000, 81, -2753), + TRAJECTORY_POS(2, /*pos*/ -5040, 33, -3846), + TRAJECTORY_POS(3, /*pos*/ -4966, 38, -4966), + TRAJECTORY_POS(4, /*pos*/ -4013, -259, -4893), TRAJECTORY_POS(5, /*pos*/ -2573, -1019, -4780), TRAJECTORY_POS(6, /*pos*/ -1053, -1399, -4806), - TRAJECTORY_POS(7, /*pos*/ 760, -1637, -4833), - TRAJECTORY_POS(8, /*pos*/ 2866, -2047, -4886), - TRAJECTORY_POS(9, /*pos*/ 3386, -6546, -4833), + TRAJECTORY_POS(7, /*pos*/ 760, -1637, -4833), + TRAJECTORY_POS(8, /*pos*/ 2866, -2047, -4886), + TRAJECTORY_POS(9, /*pos*/ 3386, -6546, -4833), TRAJECTORY_END(), }; static Trajectory sThiTinyMetalBallTraj[] = { - TRAJECTORY_POS(0, /*pos*/ -1476, 29, -680), - TRAJECTORY_POS(1, /*pos*/ -1492, 14, -1072), - TRAJECTORY_POS(2, /*pos*/ -1500, 3, -1331), - TRAJECTORY_POS(3, /*pos*/ -1374, -17, -1527), - TRAJECTORY_POS(4, /*pos*/ -1178, -83, -1496), - TRAJECTORY_POS(5, /*pos*/ -292, -424, -1425), - TRAJECTORY_POS(6, /*pos*/ 250, -491, -1433), - TRAJECTORY_POS(7, /*pos*/ 862, -613, -1449), - TRAJECTORY_POS(8, /*pos*/ 1058, -1960, -1449), - TRAJECTORY_END(), + TRAJECTORY_POS(0, /*pos*/ -1476, 29, -680), TRAJECTORY_POS(1, /*pos*/ -1492, 14, -1072), + TRAJECTORY_POS(2, /*pos*/ -1500, 3, -1331), TRAJECTORY_POS(3, /*pos*/ -1374, -17, -1527), + TRAJECTORY_POS(4, /*pos*/ -1178, -83, -1496), TRAJECTORY_POS(5, /*pos*/ -292, -424, -1425), + TRAJECTORY_POS(6, /*pos*/ 250, -491, -1433), TRAJECTORY_POS(7, /*pos*/ 862, -613, -1449), + TRAJECTORY_POS(8, /*pos*/ 1058, -1960, -1449), TRAJECTORY_END(), }; void bhv_bowling_ball_init(void) { @@ -68,11 +63,11 @@ void bowling_ball_set_waypoints(void) { break; case BBALL_BP_STYPE_THI_LARGE: - o->oPathedStartWaypoint = (struct Waypoint *) sThiHugeMetalBallTraj; + o->oPathedStartWaypoint = (struct Waypoint*)sThiHugeMetalBallTraj; break; case BBALL_BP_STYPE_THI_SMALL: - o->oPathedStartWaypoint = (struct Waypoint *) sThiTinyMetalBallTraj; + o->oPathedStartWaypoint = (struct Waypoint*)sThiTinyMetalBallTraj; break; } } @@ -187,15 +182,15 @@ void bhv_generic_bowling_ball_spawner_loop(void) { o->oTimer = 0; } - if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 1000) - || o->oPosY < gMarioObject->header.gfx.pos[1]) { + if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 1000) || + o->oPosY < gMarioObject->header.gfx.pos[1]) { return; } if ((o->oTimer & o->oBBallSpawnerPeriodMinus1) == 0) { /* Modulus */ - if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, o->oBBallSpawnerMaxSpawnDist) - && (s32)(random_float() * o->oBBallSpawnerSpawnOdds) == 0) { - struct Object *bowlingBall = spawn_object(o, MODEL_BOWLING_BALL, bhvBowlingBall); + if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, o->oBBallSpawnerMaxSpawnDist) && + (s32)(random_float() * o->oBBallSpawnerSpawnOdds) == 0) { + struct Object* bowlingBall = spawn_object(o, MODEL_BOWLING_BALL, bhvBowlingBall); bowlingBall->oBehParams2ndByte = o->oBehParams2ndByte; } } @@ -206,15 +201,14 @@ void bhv_thi_bowling_ball_spawner_loop(void) { o->oTimer = 0; } - if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 800) - || o->oPosY < gMarioObject->header.gfx.pos[1]) { + if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 800) || + o->oPosY < gMarioObject->header.gfx.pos[1]) { return; } if ((o->oTimer % 64) == 0) { - if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 12000) - && (s32)(random_float() * 1.5) == 0) { - struct Object *bowlingBall = spawn_object(o, MODEL_BOWLING_BALL, bhvBowlingBall); + if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 12000) && (s32)(random_float() * 1.5) == 0) { + struct Object* bowlingBall = spawn_object(o, MODEL_BOWLING_BALL, bhvBowlingBall); bowlingBall->oBehParams2ndByte = o->oBehParams2ndByte; } } @@ -227,7 +221,7 @@ void bhv_bob_pit_bowling_ball_init(void) { } void bhv_bob_pit_bowling_ball_loop(void) { - struct FloorGeometry *sp1c; + struct FloorGeometry* sp1c; UNUSED s16 collisionFlags = object_step(); find_floor_height_and_data(o->oPosX, o->oPosY, o->oPosZ, &sp1c); diff --git a/src/game/behaviors/bowser.inc.c b/src/game/behaviors/bowser.inc.c index e1d3e289..fd8d8ae8 100644 --- a/src/game/behaviors/bowser.inc.c +++ b/src/game/behaviors/bowser.inc.c @@ -10,7 +10,7 @@ * By default it starts tangible */ void bowser_tail_anchor_act_default(void) { - struct Object *bowser = o->parentObj; + struct Object* bowser = o->parentObj; cur_obj_become_tangible(); cur_obj_scale(1.0f); @@ -78,13 +78,13 @@ void bhv_bowser_tail_anchor_loop(void) { * Bowser's Flame spawn main loop */ void bhv_bowser_flame_spawn_loop(void) { - struct Object *bowser = o->parentObj; + struct Object* bowser = o->parentObj; s32 animFrame; f32 posX; f32 posZ; f32 cossYaw = coss(bowser->oMoveAngleYaw); f32 sinsYaw = sins(bowser->oMoveAngleYaw); - s16 *data = segmented_to_virtual(dBowserFlamesOrientationValues); + s16* data = segmented_to_virtual(dBowserFlamesOrientationValues); // Check for Bowser breathing animation if (bowser->oSoundStateID == BOWSER_ANIM_BREATH) { @@ -105,7 +105,7 @@ void bhv_bowser_flame_spawn_loop(void) { o->oPosY = bowser->oPosY + data[5 * animFrame + 1]; o->oPosZ = bowser->oPosZ + (posZ * cossYaw - posX * sinsYaw); o->oMoveAnglePitch = data[5 * animFrame + 4] + 0xC00; - o->oMoveAngleYaw = data[5 * animFrame + 3] + (s16) bowser->oMoveAngleYaw; + o->oMoveAngleYaw = data[5 * animFrame + 3] + (s16)bowser->oMoveAngleYaw; // Spawns the flames on a non-odd animFrame value if (!(animFrame & 1)) { spawn_object(o, MODEL_RED_FLAME, bhvFlameMovingForwardGrowing); @@ -157,7 +157,7 @@ void bhv_bowser_body_anchor_loop(void) { */ s32 bowser_spawn_shockwave(void) { if (o->oBehParams2ndByte == BOWSER_BP_BITS) { - struct Object *wave = spawn_object(o, MODEL_BOWSER_WAVE, bhvBowserShockWave); + struct Object* wave = spawn_object(o, MODEL_BOWSER_WAVE, bhvBowserShockWave); wave->oPosY = o->oFloorHeight; return TRUE; } @@ -168,7 +168,7 @@ s32 bowser_spawn_shockwave(void) { * Misc effects that Bowser plays when he lands with drastic actions * Plays step sound, spawns particles and changes camera event */ -void bowser_bounce_effects(s32 *timer) { +void bowser_bounce_effects(s32* timer) { if (o->oMoveFlags & OBJ_MOVE_LANDED) { (*timer)++; if (*timer < 4) { @@ -234,7 +234,7 @@ void bowser_init_camera_actions(void) { o->oAction = BOWSER_ACT_WAIT; } else if (o->oBowserCamAct == BOWSER_CAM_ACT_WALK) { o->oAction = BOWSER_ACT_INTRO_WALK; - // Start with a big jump in BitFS to do a platform tilt + // Start with a big jump in BitFS to do a platform tilt } else if (o->oBehParams2ndByte == BOWSER_BP_BITFS) { o->oAction = BOWSER_ACT_BIG_JUMP; } else { @@ -262,12 +262,12 @@ void bowser_act_intro_walk(void) { if (bowser_set_anim_look_up_and_walk()) { o->oSubAction++; } - // Then slowly walk + // Then slowly walk } else if (o->oSubAction == 1) { if (bowser_set_anim_slow_gait()) { o->oSubAction++; } - // And finally stop, and set to wait mode + // And finally stop, and set to wait mode } else if (bowser_set_anim_look_down_stop_walk()) { if (o->oBowserCamAct == BOWSER_CAM_ACT_WALK) { o->oBowserCamAct = BOWSER_CAM_ACT_IDLE; @@ -352,16 +352,15 @@ void bowser_bitfs_actions(void) { // Set attacks when Bowser Reacts if (!o->oBowserIsReacting) { if (o->oBowserStatus & BOWSER_STATUS_ANGLE_MARIO) { - if (o->oDistanceToMario < 1300.0f) { // nearby - if (rand < 0.5) { // 50% chance + if (o->oDistanceToMario < 1300.0f) { // nearby + if (rand < 0.5) { // 50% chance o->oAction = BOWSER_ACT_TELEPORT; } else { o->oAction = BOWSER_ACT_SPIT_FIRE_ONTO_FLOOR; } } else { // far away o->oAction = BOWSER_ACT_CHARGE_MARIO; - if (500.0f < o->oBowserDistToCenter && o->oBowserDistToCenter < 1500.0f - && rand < 0.5) { // 50% chance + if (500.0f < o->oBowserDistToCenter && o->oBowserDistToCenter < 1500.0f && rand < 0.5) { // 50% chance o->oAction = BOWSER_ACT_BIG_JUMP; } } @@ -535,12 +534,12 @@ void bowser_act_walk_to_mario(void) { if (o->oBowserTimer > 4) { o->oBowserStatus &= ~BOWSER_STATUS_FIRE_SKY; } - // Do subaction below if angles is less than 0x2000 + // Do subaction below if angles is less than 0x2000 } else if (angleFromMario < 0x2000) { o->oSubAction++; } } - // Stop walking and set to default action + // Stop walking and set to default action } else if (bowser_set_anim_look_down_stop_walk()) { o->oAction = BOWSER_ACT_DEFAULT; } @@ -640,7 +639,7 @@ void bowser_act_hit_mine(void) { cur_obj_init_animation_with_sound(BOWSER_ANIM_FLIP); o->oSubAction++; o->oBowserTimer = 0; - // Play flip animation again, extend it and play bounce effects + // Play flip animation again, extend it and play bounce effects } else if (o->oSubAction == BOWSER_SUB_ACT_HIT_MINE_FALL) { cur_obj_init_animation_with_sound(BOWSER_ANIM_FLIP); cur_obj_extend_animation_if_at_end(); @@ -652,7 +651,7 @@ void bowser_act_hit_mine(void) { o->oForwardVel = 0.0f; o->oSubAction++; } - // Play these actions once he is stand up + // Play these actions once he is stand up } else if (o->oSubAction == BOWSER_SUB_ACT_HIT_MINE_STOP) { if (cur_obj_check_if_near_animation_end()) { // Makes Bowser dance at one health (in BitS) @@ -757,7 +756,7 @@ void bowser_act_big_jump(void) { } } else { } - // Set to default action when the animation is over + // Set to default action when the animation is over } else if (cur_obj_check_if_near_animation_end()) { o->oAction = BOWSER_ACT_DEFAULT; } @@ -784,7 +783,7 @@ void bowser_act_quick_jump(void) { o->oBowserTimer = 0; o->oSubAction++; } - // Lands then quickly returns to default action + // Lands then quickly returns to default action } else if (o->oSubAction == 1) { if (bowser_land()) { o->oSubAction++; @@ -933,8 +932,7 @@ void bowser_act_charge_mario(void) { o->oBowserTimer = 0; cur_obj_init_animation_with_sound(BOWSER_ANIM_RUN_SLIP); spawn_object_relative_with_scale(0, 100, -50, 0, 3.0f, o, MODEL_SMOKE, bhvWhitePuffSmoke2); - spawn_object_relative_with_scale(0, -100, -50, 0, 3.0f, o, MODEL_SMOKE, - bhvWhitePuffSmoke2); + spawn_object_relative_with_scale(0, -100, -50, 0, 3.0f, o, MODEL_SMOKE, bhvWhitePuffSmoke2); // End Charge once Bowser stops running if (approach_f32_signed(&o->oForwardVel, 0, -1.0f)) { o->oSubAction = BOWSER_SUB_ACT_CHARGE_END; @@ -972,7 +970,7 @@ void bowser_act_charge_mario(void) { * Checks if Bowser hits a mine from a distance, returns TRUE if so */ s32 bowser_check_hit_mine(void) { - struct Object *mine; + struct Object* mine; f32 dist; mine = cur_obj_find_nearest_object_with_behavior(bhvBowserBomb, &dist); @@ -1003,7 +1001,7 @@ void bowser_act_thrown(void) { o->oForwardVel = 0.0f; o->oSubAction++; // stops this current subaction } - // Stand up and after play, set to default act + // Stand up and after play, set to default act } else if (cur_obj_init_animation_and_check_if_near_end(BOWSER_ANIM_STAND_UP)) { o->oAction = BOWSER_ACT_DEFAULT; } @@ -1036,7 +1034,7 @@ void bowser_set_goal_invisible(void) { void bowser_act_jump_onto_stage(void) { s32 onDynamicFloor; UNUSED u8 filler[4]; - struct Surface *floor = o->oFloor; + struct Surface* floor = o->oFloor; // Set dynamic floor check (Object platforms) if (floor != NULL && floor->flags & SURFACE_FLAG_DYNAMIC) { @@ -1097,8 +1095,8 @@ void bowser_act_jump_onto_stage(void) { // Spawn shockwave (BitS only) if is not on a platform if (onDynamicFloor == FALSE) { bowser_spawn_shockwave(); - // If is on a dynamic floor in BitS, then jump - // because of the falling platform + // If is on a dynamic floor in BitS, then jump + // because of the falling platform } else if (o->oBehParams2ndByte == BOWSER_BP_BITS) { o->oAction = BOWSER_ACT_BIG_JUMP; } @@ -1205,8 +1203,8 @@ void bowser_dead_bounce(void) { s32 bowser_dead_wait_for_mario(void) { s32 ret = FALSE; cur_obj_become_intangible(); - if (cur_obj_init_animation_and_check_if_near_end(BOWSER_ANIM_LAY_DOWN) && o->oDistanceToMario < 700.0f - && abs_angle_diff(gMarioObject->oMoveAngleYaw, o->oAngleToMario) > 0x6000) { + if (cur_obj_init_animation_and_check_if_near_end(BOWSER_ANIM_LAY_DOWN) && o->oDistanceToMario < 700.0f && + abs_angle_diff(gMarioObject->oMoveAngleYaw, o->oAngleToMario) > 0x6000) { ret = TRUE; } cur_obj_extend_animation_if_at_end(); @@ -1278,16 +1276,15 @@ s32 bowser_dead_default_stage_ending(void) { o->oBowserTimer++; } // Play Bowser defeated dialog - if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, - (DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), - sBowserDefeatedDialogText[o->oBehParams2ndByte], 0)) { + if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, (DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), + sBowserDefeatedDialogText[o->oBehParams2ndByte], 0)) { // Dialog is done, fade out music and play explode sound effect o->oBowserTimer++; cur_obj_play_sound_2(SOUND_GENERAL2_BOWSER_EXPLODE); seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); seq_player_fade_out(SEQ_PLAYER_LEVEL, 1); } - // Hide Bowser and spawn collectable once done twirling + // Hide Bowser and spawn collectable once done twirling } else if (bowser_dead_twirl_up()) { bowser_dead_hide(); spawn_triangle_break_particles(20, MODEL_YELLOW_COIN, 1.0f, 0); @@ -1321,8 +1318,8 @@ s32 bowser_dead_final_stage_ending(void) { o->oBowserTimer++; } // Play Bowser defeated dialog - if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, - (DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), dialogID, 0)) { + if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, (DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), + dialogID, 0)) { // Dialog is done, fade out music and spawn grand star cur_obj_set_model(MODEL_BOWSER_NO_SHADOW); seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); @@ -1330,7 +1327,7 @@ s32 bowser_dead_final_stage_ending(void) { bowser_spawn_collectable(); o->oBowserTimer++; } - // Slowly fade him out + // Slowly fade him out } else if (o->oOpacity > 4) { o->oOpacity -= 4; } else { @@ -1394,7 +1391,7 @@ void bowser_act_dead(void) { /** * Sets values for the BitFS platform to tilt */ -void bowser_tilt_platform(struct Object *platform, s16 angSpeed) { +void bowser_tilt_platform(struct Object* platform, s16 angSpeed) { s16 angle = o->oBowserAngleToCenter + 0x8000; platform->oAngleVelPitch = coss(angle) * angSpeed; platform->oAngleVelRoll = -sins(angle) * angSpeed; @@ -1419,18 +1416,8 @@ struct BowserTiltPlatformInfo { * Data for the BitFS tilt Platform */ struct BowserTiltPlatformInfo sBowsertiltPlatformData[] = { - { 1, 10, 40 }, - { 0, 0, 74 }, - { -1, -10, 114 }, - { 1, -20, 134 }, - { -1, 20, 154 }, - { 1, 40, 164 }, - { -1, -40, 174 }, - { 1, -80, 179 }, - { -1, 80, 184 }, - { 1, 160, 186 }, - { -1, -160, 186 }, - { 1, 0, 0 }, + { 1, 10, 40 }, { 0, 0, 74 }, { -1, -10, 114 }, { 1, -20, 134 }, { -1, 20, 154 }, { 1, 40, 164 }, + { -1, -40, 174 }, { 1, -80, 179 }, { -1, 80, 184 }, { 1, 160, 186 }, { -1, -160, 186 }, { 1, 0, 0 }, }; /** @@ -1438,7 +1425,7 @@ struct BowserTiltPlatformInfo sBowsertiltPlatformData[] = { */ void bowser_act_tilt_lava_platform(void) { // Set platform object - struct Object *platform = cur_obj_nearest_object_with_behavior(bhvTiltingBowserLavaPlatform); + struct Object* platform = cur_obj_nearest_object_with_behavior(bhvTiltingBowserLavaPlatform); UNUSED s16 angle = o->oBowserAngleToCenter + 0x8000; s16 angSpeed; UNUSED u8 filler[4]; @@ -1581,8 +1568,8 @@ s8 sBowserHealth[] = { 1, 1, 3 }; * Update Bowser's actions when he's hands free */ void bowser_free_update(void) { - struct Surface *floor; - struct Object *platform; + struct Surface* floor; + struct Object* platform; UNUSED f32 floorHeight; // Platform displacement check (for BitFS) @@ -1738,7 +1725,7 @@ void bhv_bowser_loop(void) { if (o->oOpacity > 255) { o->oOpacity = 255; } - // reduce opacity when oBowserTargetOpacity is 0 + // reduce opacity when oBowserTargetOpacity is 0 } else { o->oOpacity -= 20; if (o->oOpacity < 0) { @@ -1781,10 +1768,10 @@ void bhv_bowser_init(void) { o->oBowserEyesShut = FALSE; } -Gfx *geo_update_body_rot_from_parent(s32 callContext, UNUSED struct GraphNode *node, Mat4 mtx) { +Gfx* geo_update_body_rot_from_parent(s32 callContext, UNUSED struct GraphNode* node, Mat4 mtx) { if (callContext == GEO_CONTEXT_RENDER) { Mat4 mtx2; - struct Object *obj = (struct Object *) gCurGraphNodeObject; + struct Object* obj = (struct Object*)gCurGraphNodeObject; if (obj->prevObj != NULL) { create_transformation_from_matrices(mtx2, mtx, *gCurGraphNodeCamera->matrixPtr); obj_update_pos_from_parent_transformation(mtx2, obj->prevObj); @@ -1806,15 +1793,15 @@ enum BowserEyesGSCId { /*0x04*/ BOWSER_EYES_FAR_LEFT, /*0x05*/ BOWSER_EYES_RIGHT, /*0x06*/ BOWSER_EYES_FAR_RIGHT, - /*0x07*/ BOWSER_EYES_DERP, // unused + /*0x07*/ BOWSER_EYES_DERP, // unused /*0x08*/ BOWSER_EYES_CROSS, // unused - /*0x08*/ BOWSER_EYES_RESET // set eyes back to open + /*0x08*/ BOWSER_EYES_RESET // set eyes back to open }; /** * Controls Bowser's eye open stage, including blinking and look directions */ -void bowser_open_eye_switch(struct Object *obj, struct GraphNodeSwitchCase *switchCase) { +void bowser_open_eye_switch(struct Object* obj, struct GraphNodeSwitchCase* switchCase) { s32 eyeCase; s16 angleFromMario; @@ -1910,11 +1897,11 @@ void bowser_open_eye_switch(struct Object *obj, struct GraphNodeSwitchCase *swit * state. Checks whether oBowserEyesShut is TRUE and closes eyes if so and processes * direction otherwise. */ -Gfx *geo_switch_bowser_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) { +Gfx* geo_switch_bowser_eyes(s32 callContext, struct GraphNode* node, UNUSED Mat4* mtx) { UNUSED s16 eyeShut; UNUSED u8 filler[4]; - struct Object *obj = (struct Object *) gCurGraphNodeObject; - struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node; + struct Object* obj = (struct Object*)gCurGraphNodeObject; + struct GraphNodeSwitchCase* switchCase = (struct GraphNodeSwitchCase*)node; if (callContext == GEO_CONTEXT_RENDER) { if (gCurGraphNodeHeldObject != NULL) { @@ -1939,13 +1926,13 @@ Gfx *geo_switch_bowser_eyes(s32 callContext, struct GraphNode *node, UNUSED Mat4 /** * Geo switch that sets Bowser's Rainbow coloring (in BitS) */ -Gfx *geo_bits_bowser_coloring(s32 callContext, struct GraphNode *node, UNUSED s32 context) { - Gfx *gfxHead = NULL; - Gfx *gfx; +Gfx* geo_bits_bowser_coloring(s32 callContext, struct GraphNode* node, UNUSED s32 context) { + Gfx* gfxHead = NULL; + Gfx* gfx; if (callContext == GEO_CONTEXT_RENDER) { - struct Object *obj = (struct Object *) gCurGraphNodeObject; - struct GraphNodeGenerated *graphNode = (struct GraphNodeGenerated *) node; + struct Object* obj = (struct Object*)gCurGraphNodeObject; + struct GraphNodeGenerated* graphNode = (struct GraphNodeGenerated*)node; if (gCurGraphNodeHeldObject != NULL) { obj = gCurGraphNodeHeldObject->objNode; diff --git a/src/game/behaviors/bowser_bomb.inc.c b/src/game/behaviors/bowser_bomb.inc.c index 756b2051..5901a2a9 100644 --- a/src/game/behaviors/bowser_bomb.inc.c +++ b/src/game/behaviors/bowser_bomb.inc.c @@ -18,10 +18,10 @@ void bhv_bowser_bomb_loop(void) { } void bhv_bowser_bomb_explosion_loop(void) { - cur_obj_scale((f32) o->oTimer / 14.0f * 9.0 + 1.0); + cur_obj_scale((f32)o->oTimer / 14.0f * 9.0 + 1.0); if ((o->oTimer % 4 == 0) && (o->oTimer < 20)) { - struct Object *mineSmoke = spawn_object(o, MODEL_BOWSER_SMOKE, bhvBowserBombSmoke); + struct Object* mineSmoke = spawn_object(o, MODEL_BOWSER_SMOKE, bhvBowserBombSmoke); mineSmoke->oPosX += random_float() * 600.0f - 400.0f; mineSmoke->oPosZ += random_float() * 600.0f - 400.0f; mineSmoke->oVelY += random_float() * 10.0f; @@ -37,7 +37,7 @@ void bhv_bowser_bomb_explosion_loop(void) { } void bhv_bowser_bomb_smoke_loop(void) { - cur_obj_scale((f32) o->oTimer / 14.0f * 9.0 + 1.0); + cur_obj_scale((f32)o->oTimer / 14.0f * 9.0 + 1.0); if (o->oTimer % 2 == 0) { o->oAnimState++; diff --git a/src/game/behaviors/bowser_falling_platform.inc.c b/src/game/behaviors/bowser_falling_platform.inc.c index 85da27a7..68ed0d0a 100644 --- a/src/game/behaviors/bowser_falling_platform.inc.c +++ b/src/game/behaviors/bowser_falling_platform.inc.c @@ -1,7 +1,7 @@ // bowser_falling_platform.inc.c struct BowserFallingPlatformData { - const Collision *collision; + const Collision* collision; s16 posX; s16 posZ; s16 angle; @@ -9,16 +9,16 @@ struct BowserFallingPlatformData { struct BowserFallingPlatformData sBowserFallingPlatform[] = { { NULL, 0, 0, 0 }, - { bowser_3_seg7_collision_07004B94, -800, -1000, -20992 }, - { bowser_3_seg7_collision_07004C18, -1158, 390, -18432 }, - { bowser_3_seg7_collision_07004C9C, -1158, 390, -7680 }, - { bowser_3_seg7_collision_07004D20, 0, 1240, -6144 }, - { bowser_3_seg7_collision_07004DA4, 0, 1240, 6144 }, - { bowser_3_seg7_collision_07004E28, 1158, 390, 7680 }, - { bowser_3_seg7_collision_07004EAC, 1158, 390, 18432 }, - { bowser_3_seg7_collision_07004F30, 800, -1000, 20992 }, - { bowser_3_seg7_collision_07004FB4, 800, -1000, -31744 }, - { bowser_3_seg7_collision_07005038, -800, -1000, 31744 }, + { bowser_3_seg7_collision_07004B94, -800, -1000, -20992 }, + { bowser_3_seg7_collision_07004C18, -1158, 390, -18432 }, + { bowser_3_seg7_collision_07004C9C, -1158, 390, -7680 }, + { bowser_3_seg7_collision_07004D20, 0, 1240, -6144 }, + { bowser_3_seg7_collision_07004DA4, 0, 1240, 6144 }, + { bowser_3_seg7_collision_07004E28, 1158, 390, 7680 }, + { bowser_3_seg7_collision_07004EAC, 1158, 390, 18432 }, + { bowser_3_seg7_collision_07004F30, 800, -1000, 20992 }, + { bowser_3_seg7_collision_07004FB4, 800, -1000, -31744 }, + { bowser_3_seg7_collision_07005038, -800, -1000, 31744 }, }; void falling_bowser_plat_act_start(void) { @@ -31,25 +31,22 @@ void falling_bowser_plat_act_start(void) { void falling_bowser_plat_act_check(void) { UNUSED u8 filler[4]; - struct Object *bowser = o->oBitsPlatformBowser; + struct Object* bowser = o->oBitsPlatformBowser; if (bowser->platform == o) { - if (bowser->oAction == BOWSER_ACT_BIG_JUMP - && bowser->oBowserStatus & BOWSER_STATUS_BIG_JUMP) { + if (bowser->oAction == BOWSER_ACT_BIG_JUMP && bowser->oBowserStatus & BOWSER_STATUS_BIG_JUMP) { o->oAction = BOWSER_BITS_PLAT_ACT_FALL; } } - if (bowser->oHealth == 1 - && (bowser->oAction == BOWSER_ACT_DANCE || bowser->oHeldState != HELD_FREE)) { + if (bowser->oHealth == 1 && (bowser->oAction == BOWSER_ACT_DANCE || bowser->oHeldState != HELD_FREE)) { o->oSubAction = 1; } if (o->oSubAction == 0) { o->oBitsPlatformTimer = 0; } else { - if ((gDebugInfo[DEBUG_PAGE_EFFECTINFO][6] + 20) - * (o->oBehParams2ndByte - 1) < o->oBitsPlatformTimer) { + if ((gDebugInfo[DEBUG_PAGE_EFFECTINFO][6] + 20) * (o->oBehParams2ndByte - 1) < o->oBitsPlatformTimer) { o->oAction = BOWSER_BITS_PLAT_ACT_FALL; } o->oBitsPlatformTimer++; @@ -60,7 +57,7 @@ void falling_bowser_plat_act_fall(void) { Vec3f pos; s16 angle; f32 val; - UNUSED struct Object *bowser = o->oBitsPlatformBowser; + UNUSED struct Object* bowser = o->oBitsPlatformBowser; if (o->oTimer == 0 || o->oTimer == 22) { cur_obj_play_sound_2(SOUND_GENERAL_BOWSER_PLATFORM_2); @@ -75,8 +72,7 @@ void falling_bowser_plat_act_fall(void) { } if (!(o->oTimer & 1) && o->oTimer < 14) { - angle = sBowserFallingPlatform[o->oBehParams2ndByte].angle - + (gDebugInfo[DEBUG_PAGE_EFFECTINFO][1] << 8); + angle = sBowserFallingPlatform[o->oBehParams2ndByte].angle + (gDebugInfo[DEBUG_PAGE_EFFECTINFO][1] << 8); val = -(o->oTimer / 2) * 290 + 1740; vec3f_copy_2(pos, &o->oPosX); o->oPosX = sBowserFallingPlatform[o->oBehParams2ndByte].posX + sins(angle + 0x14B0) * val; diff --git a/src/game/behaviors/bowser_flame.inc.c b/src/game/behaviors/bowser_flame.inc.c index 08a6d670..e783c333 100644 --- a/src/game/behaviors/bowser_flame.inc.c +++ b/src/game/behaviors/bowser_flame.inc.c @@ -119,7 +119,7 @@ void bhv_flame_moving_forward_growing_init(void) { void bhv_flame_moving_forward_growing_loop(void) { UNUSED u8 filler[4]; - UNUSED struct Object *flame; + UNUSED struct Object* flame; obj_set_hitbox(o, &sGrowingBowserFlameHitbox); o->oFlameScale = o->oFlameScale + 0.5; @@ -212,14 +212,11 @@ void bhv_blue_bowser_flame_loop(void) { if (o->oTimer > 20) { if (o->oBehParams2ndByte == 0) { for (i = 0; i < 3; i++) { - spawn_object_relative_with_scale(0, 0, 0, 0, 5.0f, o, MODEL_RED_FLAME, - bhvFlameFloatingLanding); + spawn_object_relative_with_scale(0, 0, 0, 0, 5.0f, o, MODEL_RED_FLAME, bhvFlameFloatingLanding); } } else { - spawn_object_relative_with_scale(1, 0, 0, 0, 8.0f, o, MODEL_BLUE_FLAME, - bhvFlameFloatingLanding); - spawn_object_relative_with_scale(2, 0, 0, 0, 8.0f, o, MODEL_BLUE_FLAME, - bhvFlameFloatingLanding); + spawn_object_relative_with_scale(1, 0, 0, 0, 8.0f, o, MODEL_BLUE_FLAME, bhvFlameFloatingLanding); + spawn_object_relative_with_scale(2, 0, 0, 0, 8.0f, o, MODEL_BLUE_FLAME, bhvFlameFloatingLanding); } obj_mark_for_deletion(o); } @@ -234,7 +231,7 @@ void bhv_flame_bouncing_init(void) { } void bhv_flame_bouncing_loop(void) { - struct Object *bowser; + struct Object* bowser; if (o->oTimer == 0) { o->oFlameBowser = cur_obj_nearest_object_with_behavior(bhvBowser); @@ -262,7 +259,7 @@ void bhv_flame_bouncing_loop(void) { } void bhv_blue_flames_group_loop(void) { - struct Object *flame; + struct Object* flame; s32 i; if (o->oTimer == 0) { diff --git a/src/game/behaviors/bowser_key_cutscene.inc.c b/src/game/behaviors/bowser_key_cutscene.inc.c index 6f3ac484..280318ba 100644 --- a/src/game/behaviors/bowser_key_cutscene.inc.c +++ b/src/game/behaviors/bowser_key_cutscene.inc.c @@ -1,9 +1,9 @@ // bowser_key_cutscene.inc.c -Gfx *geo_scale_bowser_key(s32 run, struct GraphNode *node, UNUSED f32 mtx[4][4]) { +Gfx* geo_scale_bowser_key(s32 run, struct GraphNode* node, UNUSED f32 mtx[4][4]) { if (run == TRUE) { - struct Object *sp4 = (struct Object *) gCurGraphNodeObject; - ((struct GraphNodeScale *) node->next)->scale = sp4->oBowserKeyScale; + struct Object* sp4 = (struct Object*)gCurGraphNodeObject; + ((struct GraphNodeScale*)node->next)->scale = sp4->oBowserKeyScale; } return NULL; } diff --git a/src/game/behaviors/bowser_puzzle_piece.inc.c b/src/game/behaviors/bowser_puzzle_piece.inc.c index aaed6022..f2adf4d9 100644 --- a/src/game/behaviors/bowser_puzzle_piece.inc.c +++ b/src/game/behaviors/bowser_puzzle_piece.inc.c @@ -13,41 +13,27 @@ * * Note that pieces 11 and 14 do not move. */ -static s8 sPieceActions01[] = { 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, -1 }; -static s8 sPieceActions02[] = { 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, -1 }; -static s8 sPieceActions05[] = { 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, -1 }; -static s8 sPieceActions06[] = { 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, -1 }; -static s8 sPieceActions10[] = { 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions09[] = { 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions13[] = { 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions12[] = { 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, - 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions08[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, - 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions07[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, - 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions03[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, - 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions04[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions11[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; -static s8 sPieceActions14[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions01[] = { 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, -1 }; +static s8 sPieceActions02[] = { 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, -1 }; +static s8 sPieceActions05[] = { 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, -1 }; +static s8 sPieceActions06[] = { 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, -1 }; +static s8 sPieceActions10[] = { 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions09[] = { 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions13[] = { 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions12[] = { 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions08[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions07[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 4, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions03[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 6, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions04[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions11[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; +static s8 sPieceActions14[] = { 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, -1 }; struct BowserPuzzlePiece { u8 model; s8 xOffset; s8 zOffset; s8 initialAction; - s8 *actionList; + s8* actionList; }; /* @@ -65,30 +51,27 @@ struct BowserPuzzlePiece { * * (* = star platform) */ -static struct BowserPuzzlePiece sBowserPuzzlePieces[] = { - { MODEL_LLL_BOWSER_PIECE_1, -5, -15, 1, sPieceActions01 }, - { MODEL_LLL_BOWSER_PIECE_2, 5, -15, 0, sPieceActions02 }, - { MODEL_LLL_BOWSER_PIECE_3, -15, -5, 0, sPieceActions03 }, - { MODEL_LLL_BOWSER_PIECE_4, -5, -5, 0, sPieceActions04 }, - { MODEL_LLL_BOWSER_PIECE_5, 5, -5, 0, sPieceActions05 }, - { MODEL_LLL_BOWSER_PIECE_6, 15, -5, 0, sPieceActions06 }, - { MODEL_LLL_BOWSER_PIECE_7, -15, 5, 0, sPieceActions07 }, - { MODEL_LLL_BOWSER_PIECE_8, -5, 5, 0, sPieceActions08 }, - { MODEL_LLL_BOWSER_PIECE_9, 5, 5, 0, sPieceActions09 }, - { MODEL_LLL_BOWSER_PIECE_10, 15, 5, 0, sPieceActions10 }, - { MODEL_LLL_BOWSER_PIECE_11, -15, 15, 0, sPieceActions11 }, - { MODEL_LLL_BOWSER_PIECE_12, -5, 15, 0, sPieceActions12 }, - { MODEL_LLL_BOWSER_PIECE_13, 5, 15, 0, sPieceActions13 }, - { MODEL_LLL_BOWSER_PIECE_14, 15, 15, 0, sPieceActions14 } -}; +static struct BowserPuzzlePiece sBowserPuzzlePieces[] = { { MODEL_LLL_BOWSER_PIECE_1, -5, -15, 1, sPieceActions01 }, + { MODEL_LLL_BOWSER_PIECE_2, 5, -15, 0, sPieceActions02 }, + { MODEL_LLL_BOWSER_PIECE_3, -15, -5, 0, sPieceActions03 }, + { MODEL_LLL_BOWSER_PIECE_4, -5, -5, 0, sPieceActions04 }, + { MODEL_LLL_BOWSER_PIECE_5, 5, -5, 0, sPieceActions05 }, + { MODEL_LLL_BOWSER_PIECE_6, 15, -5, 0, sPieceActions06 }, + { MODEL_LLL_BOWSER_PIECE_7, -15, 5, 0, sPieceActions07 }, + { MODEL_LLL_BOWSER_PIECE_8, -5, 5, 0, sPieceActions08 }, + { MODEL_LLL_BOWSER_PIECE_9, 5, 5, 0, sPieceActions09 }, + { MODEL_LLL_BOWSER_PIECE_10, 15, 5, 0, sPieceActions10 }, + { MODEL_LLL_BOWSER_PIECE_11, -15, 15, 0, sPieceActions11 }, + { MODEL_LLL_BOWSER_PIECE_12, -5, 15, 0, sPieceActions12 }, + { MODEL_LLL_BOWSER_PIECE_13, 5, 15, 0, sPieceActions13 }, + { MODEL_LLL_BOWSER_PIECE_14, 15, 15, 0, sPieceActions14 } }; /** * Spawn a single puzzle piece. */ -void bhv_lll_bowser_puzzle_spawn_piece(s16 model, const BehaviorScript *behavior, - f32 xOffset, f32 zOffset, - s8 initialAction, s8 *actionList) { - struct Object *puzzlePiece = spawn_object(o, model, behavior); +void bhv_lll_bowser_puzzle_spawn_piece(s16 model, const BehaviorScript* behavior, f32 xOffset, f32 zOffset, + s8 initialAction, s8* actionList) { + struct Object* puzzlePiece = spawn_object(o, model, behavior); puzzlePiece->oPosX += xOffset; puzzlePiece->oPosY += 50.0f; puzzlePiece->oPosZ += zOffset; @@ -108,8 +91,7 @@ void bhv_lll_bowser_puzzle_spawn_pieces(f32 pieceWidth) { bhv_lll_bowser_puzzle_spawn_piece(sBowserPuzzlePieces[i].model, bhvLllBowserPuzzlePiece, sBowserPuzzlePieces[i].xOffset * pieceWidth / 10.0f, sBowserPuzzlePieces[i].zOffset * pieceWidth / 10.0f, - sBowserPuzzlePieces[i].initialAction, - sBowserPuzzlePieces[i].actionList); + sBowserPuzzlePieces[i].initialAction, sBowserPuzzlePieces[i].actionList); } // The pieces should only be spawned once so go to the next action. @@ -132,8 +114,7 @@ void bhv_lll_bowser_puzzle_loop(void) { if (o->oBowserPuzzleCompletionFlags == 3 && o->oDistanceToMario < 1000.0f) { // Spawn 5 coins. for (i = 0; i < 5; i++) { - UNUSED struct Object *coin = - spawn_object(o, MODEL_YELLOW_COIN, bhvSingleCoinGetsSpawned); + UNUSED struct Object* coin = spawn_object(o, MODEL_YELLOW_COIN, bhvSingleCoinGetsSpawned); } // Reset completion flags (even though they never get checked again). @@ -167,7 +148,7 @@ void bhv_lll_bowser_puzzle_piece_action_1(void) { * Update the puzzle piece. */ void bhv_lll_bowser_puzzle_piece_update(void) { - s8 *nextAction = o->oBowserPuzzlePieceNextAction; + s8* nextAction = o->oBowserPuzzlePieceNextAction; // If Mario is standing on this puzzle piece, set a flag in the parent. if (gMarioObject->platform == o) { @@ -256,12 +237,8 @@ void bhv_lll_bowser_puzzle_piece_move_down(void) { } void (*sBowserPuzzlePieceActions[])(void) = { - bhv_lll_bowser_puzzle_piece_action_0, - bhv_lll_bowser_puzzle_piece_action_1, - bhv_lll_bowser_puzzle_piece_idle, - bhv_lll_bowser_puzzle_piece_move_left, - bhv_lll_bowser_puzzle_piece_move_right, - bhv_lll_bowser_puzzle_piece_move_up, + bhv_lll_bowser_puzzle_piece_action_0, bhv_lll_bowser_puzzle_piece_action_1, bhv_lll_bowser_puzzle_piece_idle, + bhv_lll_bowser_puzzle_piece_move_left, bhv_lll_bowser_puzzle_piece_move_right, bhv_lll_bowser_puzzle_piece_move_up, bhv_lll_bowser_puzzle_piece_move_down, }; diff --git a/src/game/behaviors/break_particles.inc.c b/src/game/behaviors/break_particles.inc.c index a3db1aa4..7c985e5b 100644 --- a/src/game/behaviors/break_particles.inc.c +++ b/src/game/behaviors/break_particles.inc.c @@ -1,7 +1,7 @@ // break_particles.inc.c void spawn_triangle_break_particles(s16 numTris, s16 triModel, f32 triSize, s16 triAnimState) { - struct Object *triangle; + struct Object* triangle; s32 i; for (i = 0; i < numTris; i++) { diff --git a/src/game/behaviors/breakable_box_small.inc.c b/src/game/behaviors/breakable_box_small.inc.c index 1cf6ae74..352a3bbb 100644 --- a/src/game/behaviors/breakable_box_small.inc.c +++ b/src/game/behaviors/breakable_box_small.inc.c @@ -23,7 +23,7 @@ void bhv_breakable_box_small_init(void) { } void small_breakable_box_spawn_dust(void) { - struct Object *sp24 = spawn_object(o, MODEL_SMOKE, bhvSmoke); + struct Object* sp24 = spawn_object(o, MODEL_SMOKE, bhvSmoke); sp24->oPosX += (s32)(random_float() * 80.0f) - 40; sp24->oPosZ += (s32)(random_float() * 80.0f) - 40; } diff --git a/src/game/behaviors/bub.inc.c b/src/game/behaviors/bub.inc.c index 47c9b6ae..b72e0333 100644 --- a/src/game/behaviors/bub.inc.c +++ b/src/game/behaviors/bub.inc.c @@ -42,8 +42,7 @@ void bhv_bub_spawner_loop(void) { void bub_move_vertically(s32 a0) { f32 sp1C = o->parentObj->oPosY; - if (sp1C - 100.0f - o->oCheepCheepUnk104 < o->oPosY - && o->oPosY < sp1C + 1000.0f + o->oCheepCheepUnk104) { + if (sp1C - 100.0f - o->oCheepCheepUnk104 < o->oPosY && o->oPosY < sp1C + 1000.0f + o->oCheepCheepUnk104) { o->oPosY = approach_f32_symmetric(o->oPosY, o->oCheepCheepUnkF8, a0); } else { } diff --git a/src/game/behaviors/bubba.inc.c b/src/game/behaviors/bubba.inc.c index b973496d..66bb0511 100644 --- a/src/game/behaviors/bubba.inc.c +++ b/src/game/behaviors/bubba.inc.c @@ -84,8 +84,8 @@ void bubba_act_1(void) { o->oBubbaUnk1AC = o->oBubbaUnk104; - if (obj_is_near_to_and_facing_mario(500.0f, 3000) - && abs_angle_diff(o->oBubbaUnk1AC, o->oMoveAnglePitch) < 3000) { + if (obj_is_near_to_and_facing_mario(500.0f, 3000) && + abs_angle_diff(o->oBubbaUnk1AC, o->oMoveAnglePitch) < 3000) { o->oBubbaUnk100 = 30; o->oBubbaUnkF4 = 0; o->oAnimState = 1; @@ -101,8 +101,8 @@ void bhv_bubba_loop(void) { o->oInteractionSubtype &= ~INT_SUBTYPE_EATS_MARIO; o->oBubbaUnk104 = obj_turn_pitch_toward_mario(120.0f, 0); - if (abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) < 0x1000 - && abs_angle_diff(o->oBubbaUnk104 + 0x800, o->oMoveAnglePitch) < 0x2000) { + if (abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) < 0x1000 && + abs_angle_diff(o->oBubbaUnk104 + 0x800, o->oMoveAnglePitch) < 0x2000) { if (o->oAnimState != 0 && o->oDistanceToMario < 250.0f) { o->oInteractionSubtype |= INT_SUBTYPE_EATS_MARIO; } @@ -125,7 +125,7 @@ void bhv_bubba_loop(void) { if (o->oMoveFlags & OBJ_MOVE_MASK_IN_WATER) { if (o->oMoveFlags & OBJ_MOVE_ENTERED_WATER) { - struct Object *sp38 = spawn_object(o, MODEL_WATER_SPLASH, bhvWaterSplash); + struct Object* sp38 = spawn_object(o, MODEL_WATER_SPLASH, bhvWaterSplash); if (sp38 != NULL) { obj_scale(sp38, 3.0f); } @@ -137,8 +137,8 @@ void bhv_bubba_loop(void) { if ((o->oBubbaUnk10C -= o->oBubbaUnk108) > 1.0f) { s16 sp36 = random_u16(); o->oBubbaUnk10C -= 1.0f; - spawn_object_relative(0, 150.0f * coss(sp36), 0x64, 150.0f * sins(sp36), o, - MODEL_WHITE_PARTICLE_SMALL, bhvSmallParticleSnow); + spawn_object_relative(0, 150.0f * coss(sp36), 0x64, 150.0f * sins(sp36), o, MODEL_WHITE_PARTICLE_SMALL, + bhvSmallParticleSnow); } } diff --git a/src/game/behaviors/bubble.inc.c b/src/game/behaviors/bubble.inc.c index 9b977015..394ce2ff 100644 --- a/src/game/behaviors/bubble.inc.c +++ b/src/game/behaviors/bubble.inc.c @@ -7,7 +7,7 @@ void bhv_object_bubble_init(void) { } void bhv_object_bubble_loop(void) { - struct Object *bubbleSplash; + struct Object* bubbleSplash; f32 waterY = find_water_level(o->oPosX, o->oPosZ); f32 bubbleY = o->oPosY; diff --git a/src/game/behaviors/bullet_bill.inc.c b/src/game/behaviors/bullet_bill.inc.c index 64056cd6..6ab756ad 100644 --- a/src/game/behaviors/bullet_bill.inc.c +++ b/src/game/behaviors/bullet_bill.inc.c @@ -79,11 +79,7 @@ void bullet_bill_act_4(void) { } void (*sBulletBillActions[])(void) = { - bullet_bill_act_0, - bullet_bill_act_1, - bullet_bill_act_2, - bullet_bill_act_3, - bullet_bill_act_4, + bullet_bill_act_0, bullet_bill_act_1, bullet_bill_act_2, bullet_bill_act_3, bullet_bill_act_4, }; void bhv_bullet_bill_loop(void) { diff --git a/src/game/behaviors/bully.inc.c b/src/game/behaviors/bully.inc.c index 85340bc1..25c153e5 100644 --- a/src/game/behaviors/bully.inc.c +++ b/src/game/behaviors/bully.inc.c @@ -54,9 +54,9 @@ void bhv_big_bully_init(void) { void bully_check_mario_collision(void) { if ( #ifdef VERSION_SH - o->oAction != BULLY_ACT_LAVA_DEATH && o->oAction != BULLY_ACT_DEATH_PLANE_DEATH && + o->oAction != BULLY_ACT_LAVA_DEATH && o->oAction != BULLY_ACT_DEATH_PLANE_DEATH && #endif - o->oInteractStatus & INT_STATUS_INTERACTED) { + o->oInteractStatus & INT_STATUS_INTERACTED) { if (o->oBehParams2ndByte == BULLY_BP_SIZE_SMALL) { cur_obj_play_sound_2(SOUND_OBJ2_BULLY_ATTACKED); } else { @@ -98,7 +98,7 @@ void bully_act_chase_mario(void) { } void bully_act_knockback(void) { - if (o->oForwardVel < 10.0 && (s32) o->oVelY == 0) { + if (o->oForwardVel < 10.0 && (s32)o->oVelY == 0) { o->oForwardVel = 1.0; o->oBullyKBTimerAndMinionKOCounter++; o->oFlags |= OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW; @@ -188,7 +188,7 @@ void bully_step(void) { } void bully_spawn_coin(void) { - struct Object *coin = spawn_object(o, MODEL_YELLOW_COIN, bhvMovingYellowCoin); + struct Object* coin = spawn_object(o, MODEL_YELLOW_COIN, bhvMovingYellowCoin); cur_obj_play_sound_2(SOUND_GENERAL_COIN_SPURT); @@ -212,8 +212,7 @@ void bully_act_level_death(void) { spawn_default_star(130.0f, 1600.0f, -4335.0f); } else { spawn_default_star(0, 950.0f, -6800.0f); - spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvLllTumblingBridge, - 0, 154, -5631, 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvLllTumblingBridge, 0, 154, -5631, 0, 0, 0); } } } @@ -270,8 +269,7 @@ void bhv_bully_loop(void) { } void big_bully_spawn_minion(s32 x, s32 y, s32 z, s16 yaw) { - struct Object *bully = - spawn_object_abs_with_rot(o, 0, MODEL_BULLY, bhvSmallBully, x, y, z, 0, yaw, 0); + struct Object* bully = spawn_object_abs_with_rot(o, 0, MODEL_BULLY, bhvSmallBully, x, y, z, 0, yaw, 0); bully->oBullySubtype = BULLY_STYPE_MINION; bully->oBehParams2ndByte = BULLY_BP_SIZE_SMALL; } diff --git a/src/game/behaviors/butterfly.inc.c b/src/game/behaviors/butterfly.inc.c index 7e9563b8..39f9df85 100644 --- a/src/game/behaviors/butterfly.inc.c +++ b/src/game/behaviors/butterfly.inc.c @@ -11,15 +11,15 @@ void bhv_butterfly_init(void) { } void butterfly_step(s32 speed) { - struct FloorGeometry *sp24; + struct FloorGeometry* sp24; s16 yaw = o->oMoveAngleYaw; s16 pitch = o->oMoveAnglePitch; s16 yPhase = o->oButterflyYPhase; f32 floorY; - o->oVelX = sins(yaw) * (f32) speed; - o->oVelY = sins(pitch) * (f32) speed; - o->oVelZ = coss(yaw) * (f32) speed; + o->oVelX = sins(yaw) * (f32)speed; + o->oVelY = sins(pitch) * (f32)speed; + o->oVelZ = coss(yaw) * (f32)speed; o->oPosX += o->oVelX; o->oPosZ += o->oVelZ; diff --git a/src/game/behaviors/camera_lakitu.inc.c b/src/game/behaviors/camera_lakitu.inc.c index a1a3ca02..f4f4c30e 100644 --- a/src/game/behaviors/camera_lakitu.inc.c +++ b/src/game/behaviors/camera_lakitu.inc.c @@ -28,9 +28,9 @@ void bhv_camera_lakitu_init(void) { static void camera_lakitu_intro_act_trigger_cutscene(void) { //! These bounds are slightly smaller than the actual bridge bounds, allowing // the RTA speedrunning method of lakitu skip - if (gMarioObject->oPosX > -544.0f && gMarioObject->oPosX < 545.0f - && gMarioObject->oPosY > 800.0f && gMarioObject->oPosZ > -2000.0f - && gMarioObject->oPosZ < -177.0f && gMarioObject->oPosZ < -177.0f // always double check your conditions + if (gMarioObject->oPosX > -544.0f && gMarioObject->oPosX < 545.0f && gMarioObject->oPosY > 800.0f && + gMarioObject->oPosZ > -2000.0f && gMarioObject->oPosZ < -177.0f && + gMarioObject->oPosZ < -177.0f // always double check your conditions && set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) { o->oAction = CAMERA_LAKITU_INTRO_ACT_SPAWN_CLOUD; } @@ -84,9 +84,8 @@ static void camera_lakitu_intro_act_show_dialog(void) { targetMoveYaw = o->oAngleToMario; } else { // Stay moving in a circle around mario - s16 turnAmount = 0x4000 - - atan2s(o->oCameraLakituCircleRadius, - o->oDistanceToMario - o->oCameraLakituCircleRadius); + s16 turnAmount = + 0x4000 - atan2s(o->oCameraLakituCircleRadius, o->oDistanceToMario - o->oCameraLakituCircleRadius); if ((s16)(o->oMoveAngleYaw - o->oAngleToMario) < 0) { turnAmount = -turnAmount; } @@ -102,16 +101,16 @@ static void camera_lakitu_intro_act_show_dialog(void) { } // Once within 1000 units, slow down approach_f32_ptr(&o->oCameraLakituSpeed, 20.0f, 1.0f); - if (o->oDistanceToMario < 500.0f - && abs_angle_diff(gMarioObject->oFaceAngleYaw, o->oFaceAngleYaw) > 0x7000) { + if (o->oDistanceToMario < 500.0f && + abs_angle_diff(gMarioObject->oFaceAngleYaw, o->oFaceAngleYaw) > 0x7000) { // Once within 500 units and facing toward mario, come // to a stop approach_f32_ptr(&o->oCameraLakituSpeed, 0.0f, 5.0f); } } } - } else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_034)) { + } else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, + DIALOG_034)) { o->oCameraLakituFinishedDialog = TRUE; } } @@ -162,8 +161,7 @@ void bhv_camera_lakitu_update(void) { o->oHomeZ = gLakituState.curFocus[2]; o->oFaceAngleYaw = -cur_obj_angle_to_home(); - o->oFaceAnglePitch = atan2s(cur_obj_lateral_dist_to_home(), - o->oPosY - gLakituState.curFocus[1]); + o->oFaceAnglePitch = atan2s(cur_obj_lateral_dist_to_home(), o->oPosY - gLakituState.curFocus[1]); o->oPosX = 4331.53f + val0C; } diff --git a/src/game/behaviors/cannon.inc.c b/src/game/behaviors/cannon.inc.c index 2b0dac0d..8ae007f0 100644 --- a/src/game/behaviors/cannon.inc.c +++ b/src/game/behaviors/cannon.inc.c @@ -21,8 +21,8 @@ void opened_cannon_act_0(void) { if (o->oDistanceToMario < 500.0f) { cur_obj_become_tangible(); cur_obj_enable_rendering(); - if (o->oInteractStatus & INT_STATUS_INTERACTED - && !(o->oInteractStatus & INT_STATUS_TOUCHED_BOB_OMB)) { // bob-omb explodes when it gets into a cannon + if (o->oInteractStatus & INT_STATUS_INTERACTED && + !(o->oInteractStatus & INT_STATUS_TOUCHED_BOB_OMB)) { // bob-omb explodes when it gets into a cannon o->oAction = 4; o->oCannonUnk10C = 1; o->oCannonUnkF8 = 1; @@ -64,8 +64,7 @@ void opened_cannon_act_6(void) { if (o->oTimer < 6) { } else { if (o->oTimer < 22) { - o->oMoveAngleYaw = - sins(o->oCannonUnkF4) * 0x4000 + ((s16)(o->oBehParams2ndByte << 8)); + o->oMoveAngleYaw = sins(o->oCannonUnkF4) * 0x4000 + ((s16)(o->oBehParams2ndByte << 8)); o->oCannonUnkF4 += 0x400; } else if (o->oTimer < 26) { } else { @@ -115,13 +114,8 @@ void opened_cannon_act_3(void) { } void (*sOpenedCannonActions[])(void) = { - opened_cannon_act_0, - opened_cannon_act_1, - opened_cannon_act_2, - opened_cannon_act_3, - opened_cannon_act_4, - opened_cannon_act_5, - opened_cannon_act_6, + opened_cannon_act_0, opened_cannon_act_1, opened_cannon_act_2, opened_cannon_act_3, + opened_cannon_act_4, opened_cannon_act_5, opened_cannon_act_6, }; void bhv_cannon_base_loop(void) { @@ -135,7 +129,7 @@ void bhv_cannon_base_loop(void) { } void bhv_cannon_barrel_loop(void) { - struct Object *parent = o->parentObj; + struct Object* parent = o->parentObj; if (parent->header.gfx.node.flags & GRAPH_RENDER_ACTIVE) { cur_obj_enable_rendering(); diff --git a/src/game/behaviors/cannon_door.inc.c b/src/game/behaviors/cannon_door.inc.c index 52ab3e86..0f194fbb 100644 --- a/src/game/behaviors/cannon_door.inc.c +++ b/src/game/behaviors/cannon_door.inc.c @@ -3,7 +3,7 @@ void bhv_cannon_closed_init(void) { if (save_file_is_cannon_unlocked() == TRUE) { // If the cannon is open, spawn a cannon and despawn the object. - struct Object *cannon = spawn_object(o, MODEL_CANNON_BASE, bhvCannon); + struct Object* cannon = spawn_object(o, MODEL_CANNON_BASE, bhvCannon); cannon->oBehParams2ndByte = o->oBehParams2ndByte; cannon->oPosX = o->oHomeX; diff --git a/src/game/behaviors/cap.inc.c b/src/game/behaviors/cap.inc.c index 2aacb145..ce38409f 100644 --- a/src/game/behaviors/cap.inc.c +++ b/src/game/behaviors/cap.inc.c @@ -261,7 +261,7 @@ void bhv_normal_cap_loop(void) { break; } - if ((s32) o->oForwardVel != 0) { + if ((s32)o->oForwardVel != 0) { save_file_set_cap_pos(o->oPosX, o->oPosY, o->oPosZ); } diff --git a/src/game/behaviors/capswitch.inc.c b/src/game/behaviors/capswitch.inc.c index aecde91d..f670f09c 100644 --- a/src/game/behaviors/capswitch.inc.c +++ b/src/game/behaviors/capswitch.inc.c @@ -42,10 +42,11 @@ void cap_switch_act_2(void) { } } else { //! Neither of these flags are defined in this function so they do nothing. - // On an extra note, there's a specific check for this cutscene and + // On an extra note, there's a specific check for this cutscene and // there's no dialog defined since the cutscene itself calls the dialog. - s32 dialogResponse = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_FRONT, - (DIALOG_FLAG_TEXT_RESPONSE | DIALOG_FLAG_UNK_CAPSWITCH), CUTSCENE_CAP_SWITCH_PRESS, 0); + s32 dialogResponse = cur_obj_update_dialog_with_cutscene( + MARIO_DIALOG_LOOK_FRONT, (DIALOG_FLAG_TEXT_RESPONSE | DIALOG_FLAG_UNK_CAPSWITCH), CUTSCENE_CAP_SWITCH_PRESS, + 0); if (dialogResponse) { o->oAction = 3; } diff --git a/src/game/behaviors/castle_floor_trap.inc.c b/src/game/behaviors/castle_floor_trap.inc.c index ee91a020..0a57a136 100644 --- a/src/game/behaviors/castle_floor_trap.inc.c +++ b/src/game/behaviors/castle_floor_trap.inc.c @@ -8,15 +8,14 @@ void bhv_floor_trap_in_castle_loop(void) { } void bhv_castle_floor_trap_init(void) { - struct Object *sp2C; + struct Object* sp2C; sp2C = spawn_object_relative(0, -358, 0, 0, o, MODEL_CASTLE_BOWSER_TRAP, bhvFloorTrapInCastle); sp2C = spawn_object_relative(0, 358, 0, 0, o, MODEL_CASTLE_BOWSER_TRAP, bhvFloorTrapInCastle); sp2C->oMoveAngleYaw += 0x8000; } void bhv_castle_floor_trap_open_detect(void) { - if (gMarioStates[0].action == ACT_SPECIAL_EXIT_AIRBORNE - || gMarioStates[0].action == ACT_SPECIAL_DEATH_EXIT) { + if (gMarioStates[0].action == ACT_SPECIAL_EXIT_AIRBORNE || gMarioStates[0].action == ACT_SPECIAL_DEATH_EXIT) { o->oAction = 4; // rotates trapdoor so it looks always open } else { o->oAngleVelRoll = 0x400; diff --git a/src/game/behaviors/celebration_star.inc.c b/src/game/behaviors/celebration_star.inc.c index 92cb866a..c19573b0 100644 --- a/src/game/behaviors/celebration_star.inc.c +++ b/src/game/behaviors/celebration_star.inc.c @@ -51,12 +51,12 @@ void celeb_star_act_face_camera(void) { if (o->oTimer < 10) { #if BUGFIX_STAR_BOWSER_KEY if (o->oCelebStarUnkF4 == 0) { - cur_obj_scale((f32) o->oTimer / 10.0); + cur_obj_scale((f32)o->oTimer / 10.0); } else { - cur_obj_scale((f32) o->oTimer / 30.0); + cur_obj_scale((f32)o->oTimer / 30.0); } #else - cur_obj_scale((f32) o->oTimer / 10.0); + cur_obj_scale((f32)o->oTimer / 10.0); #endif o->oFaceAngleYaw += 0x1000; } else { diff --git a/src/game/behaviors/chain_chomp.inc.c b/src/game/behaviors/chain_chomp.inc.c index 54c136c9..e66fced1 100644 --- a/src/game/behaviors/chain_chomp.inc.c +++ b/src/game/behaviors/chain_chomp.inc.c @@ -31,7 +31,7 @@ void bhv_chain_chomp_chain_part_update(void) { if (o->parentObj->oAction == CHAIN_CHOMP_ACT_UNLOAD_CHAIN) { obj_mark_for_deletion(o); } else if (o->oBehParams2ndByte != CHAIN_CHOMP_CHAIN_PART_BP_PIVOT) { - struct ChainSegment *segment = &o->parentObj->oChainChompSegments[o->oBehParams2ndByte]; + struct ChainSegment* segment = &o->parentObj->oChainChompSegments[o->oBehParams2ndByte]; // Set position relative to the pivot o->oPosX = o->parentObj->parentObj->oPosX + segment->posX; @@ -47,7 +47,7 @@ void bhv_chain_chomp_chain_part_update(void) { * When mario gets close enough, allocate chain segments and spawn their objects. */ static void chain_chomp_act_uninitialized(void) { - struct ChainSegment *segments; + struct ChainSegment* segments; s32 i; if (o->oDistanceToMario < 3000.0f) { @@ -65,9 +65,7 @@ static void chain_chomp_act_uninitialized(void) { cur_obj_set_pos_to_home(); // Spawn the pivot and set to parent - if ((o->parentObj = - spawn_object(o, CHAIN_CHOMP_CHAIN_PART_BP_PIVOT, bhvChainChompChainPart)) - != NULL) { + if ((o->parentObj = spawn_object(o, CHAIN_CHOMP_CHAIN_PART_BP_PIVOT, bhvChainChompChainPart)) != NULL) { // Spawn the non-pivot chain parts, starting from the chain // chomp and moving toward the pivot for (i = 1; i <= 4; i++) { @@ -86,8 +84,8 @@ static void chain_chomp_act_uninitialized(void) { * part as well as from the pivot. */ static void chain_chomp_update_chain_segments(void) { - struct ChainSegment *prevSegment; - struct ChainSegment *segment; + struct ChainSegment* prevSegment; + struct ChainSegment* segment; f32 offsetX; f32 offsetY; f32 offsetZ; @@ -222,13 +220,11 @@ static void chain_chomp_sub_act_lunge(void) { val04 = 220.0f; } - o->oChainChompMaxDistBetweenChainParts = - val04 / 220.0f * o->oChainChompMaxDistFromPivotPerChainPart; + o->oChainChompMaxDistBetweenChainParts = val04 / 220.0f * o->oChainChompMaxDistFromPivotPerChainPart; o->oTimer = 0; } else { // Turn toward pivot - cur_obj_rotate_yaw_toward(atan2s(o->oChainChompSegments[0].posZ, o->oChainChompSegments[0].posX), - 0x1000); + cur_obj_rotate_yaw_toward(atan2s(o->oChainChompSegments[0].posZ, o->oChainChompSegments[0].posX), 0x1000); if (o->oChainChompUnk104 != 0.0f) { approach_f32_ptr(&o->oChainChompUnk104, 0.0f, 0.8f); @@ -256,8 +252,8 @@ static void chain_chomp_released_trigger_cutscene(void) { //! Can delay this if we get into a cutscene-unfriendly action after the // last post ground pound and before this - if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK - && (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) && cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) { + if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK && + (o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) && cutscene_object(CUTSCENE_STAR_SPAWN, o) == 1) { o->oChainChompReleaseStatus = CHAIN_CHOMP_RELEASED_LUNGE_AROUND; o->oTimer = 0; } @@ -396,10 +392,9 @@ static void chain_chomp_act_move(void) { o->oChainChompSegments[0].posY = o->oPosY - o->parentObj->oPosY; o->oChainChompSegments[0].posZ = o->oPosZ - o->parentObj->oPosZ; - o->oChainChompDistToPivot = - sqrtf(o->oChainChompSegments[0].posX * o->oChainChompSegments[0].posX - + o->oChainChompSegments[0].posY * o->oChainChompSegments[0].posY - + o->oChainChompSegments[0].posZ * o->oChainChompSegments[0].posZ); + o->oChainChompDistToPivot = sqrtf(o->oChainChompSegments[0].posX * o->oChainChompSegments[0].posX + + o->oChainChompSegments[0].posY * o->oChainChompSegments[0].posY + + o->oChainChompSegments[0].posZ * o->oChainChompSegments[0].posZ); // If the chain is fully stretched maxDistToPivot = o->oChainChompMaxDistFromPivotPerChainPart * 5; diff --git a/src/game/behaviors/checkerboard_platform.inc.c b/src/game/behaviors/checkerboard_platform.inc.c index bfba5f0a..81397203 100644 --- a/src/game/behaviors/checkerboard_platform.inc.c +++ b/src/game/behaviors/checkerboard_platform.inc.c @@ -16,7 +16,7 @@ void bhv_checkerboard_elevator_group_init(void) { s32 sp38; s32 sp34; s32 i; - struct Object *sp2C; + struct Object* sp2C; if (o->oBehParams2ndByte == 0) { o->oBehParams2ndByte = 65; @@ -32,8 +32,7 @@ void bhv_checkerboard_elevator_group_init(void) { sp38 = D_8032F754[sp34].unk0; } - sp2C = spawn_object_relative(i, 0, i * sp3C, sp38, o, MODEL_CHECKERBOARD_PLATFORM, - bhvCheckerboardPlatformSub); + sp2C = spawn_object_relative(i, 0, i * sp3C, sp38, o, MODEL_CHECKERBOARD_PLATFORM, bhvCheckerboardPlatformSub); sp2C->oCheckerBoardPlatformUnk1AC = D_8032F754[sp34].unk2; vec3f_copy_2(sp2C->header.gfx.scale, D_8032F754[sp34].unk1); } diff --git a/src/game/behaviors/chuckya.inc.c b/src/game/behaviors/chuckya.inc.c index cf18ea56..91566012 100644 --- a/src/game/behaviors/chuckya.inc.c +++ b/src/game/behaviors/chuckya.inc.c @@ -7,11 +7,7 @@ struct UnusedChuckyaData { }; struct UnusedChuckyaData sUnusedChuckyaData[] = { - { 2, 0.f, 1.f }, - { 2, 10.f, 1.f }, - { 2, 20.f, 1.f }, - { 2, 20.f, 1.f }, - { 8, 10.f, 1.f }, + { 2, 0.f, 1.f }, { 2, 10.f, 1.f }, { 2, 20.f, 1.f }, { 2, 20.f, 1.f }, { 8, 10.f, 1.f }, }; void common_anchor_mario_behavior(f32 sp28, f32 sp2C, s32 sp30) { @@ -80,7 +76,7 @@ s32 unknown_chuckya_function(s32 sp20, f32 sp24, f32 sp28, s16 sp2C) { return sp1C; } -s32 approach_forward_vel(f32 *forwardVel, f32 spC, f32 sp10) { +s32 approach_forward_vel(f32* forwardVel, f32 spC, f32 sp10) { s32 sp4 = 0; if (*forwardVel > spC) { @@ -116,8 +112,7 @@ void chuckya_act_0(void) { o->oForwardVel = 0.0f; if (cur_obj_lateral_dist_from_mario_to_home() < 2000.0f) { cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x400); - if (o->oChuckyaUnkFC > 40 - || abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) < 0x1000) { + if (o->oChuckyaUnkFC > 40 || abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) < 0x1000) { o->oSubAction = 1; } } else { @@ -191,8 +186,7 @@ void chuckya_act_1(void) { } else { cur_obj_init_animation_with_sound(1); o->oMoveAngleYaw += INT_STATUS_GRABBED_MARIO; - if (o->oChuckyaUnkFC-- < 0 - && (check_if_moving_over_floor(50.0f, 150.0f) || o->oChuckyaUnkFC < -16)) { + if (o->oChuckyaUnkFC-- < 0 && (check_if_moving_over_floor(50.0f, 150.0f) || o->oChuckyaUnkFC < -16)) { o->oSubAction++; } } diff --git a/src/game/behaviors/clock_arm.inc.c b/src/game/behaviors/clock_arm.inc.c index fbf8b931..c1d5f9f7 100644 --- a/src/game/behaviors/clock_arm.inc.c +++ b/src/game/behaviors/clock_arm.inc.c @@ -4,11 +4,10 @@ * Main loop of the hour and minute hands of the Tick Tock Clock painting. */ void bhv_rotating_clock_arm_loop(void) { - struct Surface *marioSurface; + struct Surface* marioSurface; u16 rollAngle = o->oFaceAngleRoll; - o->oFloorHeight = - find_floor(gMarioObject->oPosX, gMarioObject->oPosY, gMarioObject->oPosZ, &marioSurface); + o->oFloorHeight = find_floor(gMarioObject->oPosX, gMarioObject->oPosY, gMarioObject->oPosZ, &marioSurface); // Seems to make sure Mario is on a default surface & 4 frames pass before // allowing him to change the Tick Tock Clock speed setting. @@ -20,10 +19,9 @@ void bhv_rotating_clock_arm_loop(void) { } } else if (o->oAction == 1) { // If Mario is touching the Tick Tock Clock painting... - if (marioSurface != NULL - && (marioSurface->type == SURFACE_TTC_PAINTING_1 - || marioSurface->type == SURFACE_TTC_PAINTING_2 - || marioSurface->type == SURFACE_TTC_PAINTING_3)) { + if (marioSurface != NULL && + (marioSurface->type == SURFACE_TTC_PAINTING_1 || marioSurface->type == SURFACE_TTC_PAINTING_2 || + marioSurface->type == SURFACE_TTC_PAINTING_3)) { // And this is the minute hand... if (cur_obj_has_behavior(bhvClockMinuteHand)) { // Set Tick Tick Clock's speed based on the angle of the hand. diff --git a/src/game/behaviors/cloud.inc.c b/src/game/behaviors/cloud.inc.c index 0efc7806..4eaaa76f 100644 --- a/src/game/behaviors/cloud.inc.c +++ b/src/game/behaviors/cloud.inc.c @@ -18,7 +18,7 @@ static s8 sCloudPartHeights[] = { 11, 8, 12, 8, 9, 9 }; * Spawn the visual parts of the cloud, including fwoosh's face. */ static void cloud_act_spawn_parts(void) { - struct Object *cloudPart; + struct Object* cloudPart; s32 i; // Spawn the pieces of the cloud itself @@ -197,8 +197,7 @@ void bhv_cloud_part_update(void) { o->oPosX = o->parentObj->oCloudCenterX + cloudRadius * sins(angleFromCenter) + localOffset; - o->oPosY = - o->parentObj->oCloudCenterY + localOffset + scale * sCloudPartHeights[o->oBehParams2ndByte]; + o->oPosY = o->parentObj->oCloudCenterY + localOffset + scale * sCloudPartHeights[o->oBehParams2ndByte]; o->oPosZ = o->parentObj->oPosZ + cloudRadius * coss(angleFromCenter) + localOffset; diff --git a/src/game/behaviors/coffin.inc.c b/src/game/behaviors/coffin.inc.c index d675fdcd..6d1b769d 100644 --- a/src/game/behaviors/coffin.inc.c +++ b/src/game/behaviors/coffin.inc.c @@ -18,8 +18,7 @@ struct LateralPosition { * Array of positions for all coffins relative to their spawner. */ struct LateralPosition coffinRelativePos[] = { - { 412, -150 }, { 762, -150 }, { 1112, -150 }, - { 412, 150 }, { 762, 150 }, { 1112, 150 }, + { 412, -150 }, { 762, -150 }, { 1112, -150 }, { 412, 150 }, { 762, 150 }, { 1112, 150 }, }; /** @@ -27,7 +26,7 @@ struct LateralPosition coffinRelativePos[] = { * Loads the coffins when in the room, they unload themselves. */ void bhv_coffin_spawner_loop(void) { - struct Object *coffin; + struct Object* coffin; s32 i; s16 relativeZ; @@ -37,8 +36,8 @@ void bhv_coffin_spawner_loop(void) { relativeZ = coffinRelativePos[i].z; // Behavior param of 0 for all even i, 1 for all odd - coffin = spawn_object_relative(i & 1, coffinRelativePos[i].x, 0, relativeZ, o, - MODEL_BBH_WOODEN_TOMB, bhvCoffin); + coffin = spawn_object_relative(i & 1, coffinRelativePos[i].x, 0, relativeZ, o, MODEL_BBH_WOODEN_TOMB, + bhvCoffin); // Never true, game would enter a while(1) before it could. // Possible a remnant of days this didn't happen. @@ -95,10 +94,9 @@ void coffin_act_idle(void) { // This checks a box around the coffin and if it has been a bit since it stood up. // It also checks in the case Mario is squished, so he doesn't get permanently squished. - if (o->oTimer > 60 - && (o->oDistanceToMario > 100.0f || gMarioState->action == ACT_SQUISHED) - && gMarioObject->oPosY - o->oPosY < 200.0f && absf(distForwards) < 140.0f - && distSideways < 150.0f && distSideways > -450.0f) { + if (o->oTimer > 60 && (o->oDistanceToMario > 100.0f || gMarioState->action == ACT_SQUISHED) && + gMarioObject->oPosY - o->oPosY < 200.0f && absf(distForwards) < 140.0f && distSideways < 150.0f && + distSideways > -450.0f) { cur_obj_play_sound_2(SOUND_GENERAL_BUTTON_PRESS_2_LOWPRIO); o->oAction = COFFIN_ACT_STAND_UP; } diff --git a/src/game/behaviors/coin.inc.c b/src/game/behaviors/coin.inc.c index 00826f70..8061d8d3 100644 --- a/src/game/behaviors/coin.inc.c +++ b/src/game/behaviors/coin.inc.c @@ -13,19 +13,11 @@ struct ObjectHitbox sYellowCoinHitbox = { }; s16 sCoinArrowPositions[][2] = { - { 0, -150 }, - { 0, -50 }, - { 0, 50 }, - { 0, 150 }, - { -50, 100 }, - { -100, 50 }, - { 50, 100 }, - { 100, 50 }, + { 0, -150 }, { 0, -50 }, { 0, 50 }, { 0, 150 }, { -50, 100 }, { -100, 50 }, { 50, 100 }, { 100, 50 }, }; s32 bhv_coin_sparkles_init(void) { - if (o->oInteractStatus & INT_STATUS_INTERACTED - && !(o->oInteractStatus & INT_STATUS_TOUCHED_BOB_OMB)) { + if (o->oInteractStatus & INT_STATUS_INTERACTED && !(o->oInteractStatus & INT_STATUS_TOUCHED_BOB_OMB)) { spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles); obj_mark_for_deletion(o); return TRUE; @@ -77,7 +69,7 @@ void bhv_coin_init(void) { } void bhv_coin_loop(void) { - struct Surface *sp1C; + struct Surface* sp1C; cur_obj_update_floor_and_walls(); cur_obj_if_hit_wall_bounce_away(); @@ -160,7 +152,7 @@ void bhv_coin_formation_spawn_loop(void) { } void spawn_coin_in_formation(s32 sp50, s32 sp54) { - struct Object *sp4C; + struct Object* sp4C; Vec3i sp40; s32 sp3C = 1; s32 sp38 = 1; @@ -201,8 +193,7 @@ void spawn_coin_in_formation(s32 sp50, s32 sp54) { } if (sp3C) { - sp4C = spawn_object_relative(sp50, sp40[0], sp40[1], sp40[2], o, MODEL_YELLOW_COIN, - bhvCoinFormationSpawn); + sp4C = spawn_object_relative(sp50, sp40[0], sp40[1], sp40[2], o, MODEL_YELLOW_COIN, bhvCoinFormationSpawn); sp4C->oCoinUnkF8 = sp38; } } @@ -268,7 +259,7 @@ void coin_inside_boo_act_1(void) { void coin_inside_boo_act_0(void) { s16 sp26; f32 sp20; - struct Object *parent = o->parentObj; + struct Object* parent = o->parentObj; cur_obj_become_intangible(); @@ -303,7 +294,7 @@ void bhv_coin_sparkles_loop(void) { } void bhv_golden_coin_sparkles_loop(void) { - struct Object *sp2C; + struct Object* sp2C; UNUSED u8 filler[4]; f32 sp24 = 30.0f; diff --git a/src/game/behaviors/collide_particles.inc.c b/src/game/behaviors/collide_particles.inc.c index 4f69d406..3a3cab36 100644 --- a/src/game/behaviors/collide_particles.inc.c +++ b/src/game/behaviors/collide_particles.inc.c @@ -29,7 +29,7 @@ void bhv_punch_tiny_triangle_init(void) { UNUSED u8 filler[4]; for (i = 0; i < 6; i++) { - struct Object *triangle = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPunchTinyTriangle); + struct Object* triangle = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPunchTinyTriangle); triangle->oMoveAngleYaw = gMarioObject->oMoveAngleYaw + sTinyTriMovementParams[2 * i] + 0x8000; triangle->oVelY = sins(sTinyTriMovementParams[2 * i + 1]) * 25.0f; triangle->oForwardVel = coss(sTinyTriMovementParams[2 * i + 1]) * 25.0f; @@ -55,7 +55,7 @@ void bhv_tiny_star_particles_init(void) { UNUSED u8 filler[4]; for (i = 0; i < 7; i++) { - struct Object *particle = spawn_object(o, MODEL_CARTOON_STAR, bhvWallTinyStarParticle); + struct Object* particle = spawn_object(o, MODEL_CARTOON_STAR, bhvWallTinyStarParticle); particle->oMoveAngleYaw = gMarioObject->oMoveAngleYaw + sTinyStarMovementParams[2 * i] + 0x8000; particle->oVelY = sins(sTinyStarMovementParams[2 * i + 1]) * 25.0f; particle->oForwardVel = coss(sTinyStarMovementParams[2 * i + 1]) * 25.0f; @@ -81,7 +81,7 @@ void bhv_pound_tiny_star_particle_init(void) { s32 sp20 = 8; for (sp24 = 0; sp24 < sp20; sp24++) { - struct Object *particle = spawn_object(o, MODEL_CARTOON_STAR, bhvPoundTinyStarParticle); + struct Object* particle = spawn_object(o, MODEL_CARTOON_STAR, bhvPoundTinyStarParticle); particle->oMoveAngleYaw = (sp24 * 65536) / sp20; } } diff --git a/src/game/behaviors/controllable_platform.inc.c b/src/game/behaviors/controllable_platform.inc.c index ae03dc8a..ea114537 100644 --- a/src/game/behaviors/controllable_platform.inc.c +++ b/src/game/behaviors/controllable_platform.inc.c @@ -57,19 +57,19 @@ void bhv_controllable_platform_sub_loop(void) { } void bhv_controllable_platform_init(void) { - struct Object *sp34; + struct Object* sp34; - sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 0, - 51, 204, 0, 0, 0); + sp34 = + spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 0, 51, 204, 0, 0, 0); sp34->oBehParams2ndByte = 1; - sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 0, - 51, -204, 0, -0x8000, 0); + sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 0, 51, -204, 0, + -0x8000, 0); sp34->oBehParams2ndByte = 2; - sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 204, - 51, 0, 0, 0x4000, 0); + sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, 204, 51, 0, 0, + 0x4000, 0); sp34->oBehParams2ndByte = 3; - sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, - -204, 51, 0, 0, -0x4000, 0); + sp34 = spawn_object_rel_with_rot(o, MODEL_HMC_METAL_ARROW_PLATFORM, bhvControllablePlatformSub, -204, 51, 0, 0, + -0x4000, 0); sp34->oBehParams2ndByte = 4; D_80331694 = 0; @@ -93,8 +93,7 @@ void controllable_platform_check_walls(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED V controllable_platform_hit_wall(sp1B); } else { if (sp1C[0] == 1) { - if (((sp1B == 1 || sp1B == 2) && (s32) sp20[2] != 0) - || ((sp1B == 3 || sp1B == 4) && (s32) sp20[0] != 0)) { + if (((sp1B == 1 || sp1B == 2) && (s32)sp20[2] != 0) || ((sp1B == 3 || sp1B == 4) && (s32)sp20[0] != 0)) { controllable_platform_hit_wall(sp1B); } else { o->oPosX += sp20[0]; @@ -103,8 +102,7 @@ void controllable_platform_check_walls(s8 sp1B, s8 sp1C[3], Vec3f sp20, UNUSED V } if (sp1C[2] == 1) { - if (((sp1B == 1 || sp1B == 2) && (s32) sp28[2] != 0) - || ((sp1B == 3 || sp1B == 4) && (s32) sp28[0] != 0)) { + if (((sp1B == 1 || sp1B == 2) && (s32)sp28[2] != 0) || ((sp1B == 3 || sp1B == 4) && (s32)sp28[0] != 0)) { controllable_platform_hit_wall(sp1B); } else { o->oPosX += sp28[0]; @@ -141,8 +139,8 @@ void controllable_platform_tilt_from_mario(void) { s16 sp1E = gMarioObject->header.gfx.pos[0] - o->oPosX; s16 sp1C = gMarioObject->header.gfx.pos[2] - o->oPosZ; - if (gMarioObject->platform == o - || gMarioObject->platform == cur_obj_nearest_object_with_behavior(bhvControllablePlatformSub)) { + if (gMarioObject->platform == o || + gMarioObject->platform == cur_obj_nearest_object_with_behavior(bhvControllablePlatformSub)) { o->oFaceAnglePitch = sp1C * 4; o->oFaceAngleRoll = -sp1E * 4; if (D_80331694 == 6) { @@ -214,8 +212,8 @@ void bhv_controllable_platform_loop(void) { case 6: if (obj_flicker_and_disappear(o, 150)) { - spawn_object_abs_with_rot(o, 0, MODEL_HMC_METAL_PLATFORM, bhvControllablePlatform, - o->oHomeX, o->oHomeY, o->oHomeZ, 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_HMC_METAL_PLATFORM, bhvControllablePlatform, o->oHomeX, o->oHomeY, + o->oHomeZ, 0, 0, 0); } break; } diff --git a/src/game/behaviors/corkbox.inc.c b/src/game/behaviors/corkbox.inc.c index df2d7955..b435ed8e 100644 --- a/src/game/behaviors/corkbox.inc.c +++ b/src/game/behaviors/corkbox.inc.c @@ -41,16 +41,15 @@ void bhv_bobomb_explosion_bubble_loop(void) { void bhv_respawner_loop(void) { if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, o->oRespawnerMinSpawnDist)) { - struct Object *spawnedObject = spawn_object(o, o->oRespawnerModelToRespawn, - o->oRespawnerBehaviorToRespawn); + struct Object* spawnedObject = spawn_object(o, o->oRespawnerModelToRespawn, o->oRespawnerBehaviorToRespawn); spawnedObject->oBehParams = o->oBehParams; o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } } -void create_respawner(s32 model, const BehaviorScript *behToSpawn, s32 minSpawnDist) { - struct Object *respawner = spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvRespawner, o->oHomeX, - o->oHomeY, o->oHomeZ, 0, 0, 0); +void create_respawner(s32 model, const BehaviorScript* behToSpawn, s32 minSpawnDist) { + struct Object* respawner = + spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvRespawner, o->oHomeX, o->oHomeY, o->oHomeZ, 0, 0, 0); respawner->oBehParams = o->oBehParams; respawner->oRespawnerModelToRespawn = model; respawner->oRespawnerMinSpawnDist = minSpawnDist; diff --git a/src/game/behaviors/donut_platform.inc.c b/src/game/behaviors/donut_platform.inc.c index 4c0eefc5..ea279321 100644 --- a/src/game/behaviors/donut_platform.inc.c +++ b/src/game/behaviors/donut_platform.inc.c @@ -1,17 +1,14 @@ // donut_platform.inc.c static Vec3s sDonutPlatformPositions[] = { - { 0x0B4C, 0xF7D7, 0x19A4 }, { 0xF794, 0x08A3, 0xFFA9 }, { 0x069C, 0x09D8, 0xFFE0 }, - { 0x05CF, 0x09D8, 0xFFE0 }, { 0x0502, 0x09D8, 0xFFE0 }, { 0x054C, 0xF7D7, 0x19A4 }, - { 0x0A7F, 0xF7D7, 0x19A4 }, { 0x09B2, 0xF7D7, 0x19A4 }, { 0x06E6, 0xF7D7, 0x19A4 }, - { 0x0619, 0xF7D7, 0x19A4 }, { 0xEFB5, 0xF7D7, 0x19A4 }, { 0x00E6, 0xF7D7, 0x19A4 }, - { 0x0019, 0xF7D7, 0x19A4 }, { 0xFF4D, 0xF7D7, 0x19A4 }, { 0xF081, 0xF7D7, 0x19A4 }, - { 0xE34F, 0xF671, 0x197A }, { 0xEEE8, 0xF7D7, 0x19A4 }, { 0xE74F, 0xF7D7, 0x197A }, - { 0xE683, 0xF7D7, 0x197A }, { 0xE5B6, 0xF7D7, 0x197A }, { 0xEE83, 0xF4A4, 0x19A4 }, - { 0xE41C, 0xF671, 0x197A }, { 0xE4E9, 0xF671, 0x197A }, { 0xECE9, 0xF4A4, 0x19A4 }, - { 0xEDB6, 0xF4A4, 0x19A4 }, { 0xFC3F, 0x0A66, 0xFF45 }, { 0x00EF, 0x04CD, 0xFF53 }, - { 0x0022, 0x04CD, 0xFF53 }, { 0xFF57, 0x04CD, 0xFF53 }, { 0xFB73, 0x0A66, 0xFF45 }, - { 0xFD0C, 0x0A66, 0xFF45 }, + { 0x0B4C, 0xF7D7, 0x19A4 }, { 0xF794, 0x08A3, 0xFFA9 }, { 0x069C, 0x09D8, 0xFFE0 }, { 0x05CF, 0x09D8, 0xFFE0 }, + { 0x0502, 0x09D8, 0xFFE0 }, { 0x054C, 0xF7D7, 0x19A4 }, { 0x0A7F, 0xF7D7, 0x19A4 }, { 0x09B2, 0xF7D7, 0x19A4 }, + { 0x06E6, 0xF7D7, 0x19A4 }, { 0x0619, 0xF7D7, 0x19A4 }, { 0xEFB5, 0xF7D7, 0x19A4 }, { 0x00E6, 0xF7D7, 0x19A4 }, + { 0x0019, 0xF7D7, 0x19A4 }, { 0xFF4D, 0xF7D7, 0x19A4 }, { 0xF081, 0xF7D7, 0x19A4 }, { 0xE34F, 0xF671, 0x197A }, + { 0xEEE8, 0xF7D7, 0x19A4 }, { 0xE74F, 0xF7D7, 0x197A }, { 0xE683, 0xF7D7, 0x197A }, { 0xE5B6, 0xF7D7, 0x197A }, + { 0xEE83, 0xF4A4, 0x19A4 }, { 0xE41C, 0xF671, 0x197A }, { 0xE4E9, 0xF671, 0x197A }, { 0xECE9, 0xF4A4, 0x19A4 }, + { 0xEDB6, 0xF4A4, 0x19A4 }, { 0xFC3F, 0x0A66, 0xFF45 }, { 0x00EF, 0x04CD, 0xFF53 }, { 0x0022, 0x04CD, 0xFF53 }, + { 0xFF57, 0x04CD, 0xFF53 }, { 0xFB73, 0x0A66, 0xFF45 }, { 0xFD0C, 0x0A66, 0xFF45 }, }; void bhv_donut_platform_spawner_update(void) { @@ -27,9 +24,9 @@ void bhv_donut_platform_spawner_update(void) { // dist > 1000 and dist < 2000 if (marioSqDist > 1000000.0f && marioSqDist < 4000000.0f) { - if (spawn_object_relative(i, sDonutPlatformPositions[i][0], - sDonutPlatformPositions[i][1], sDonutPlatformPositions[i][2], - o, MODEL_RR_DONUT_PLATFORM, bhvDonutPlatform) != NULL) { + if (spawn_object_relative(i, sDonutPlatformPositions[i][0], sDonutPlatformPositions[i][1], + sDonutPlatformPositions[i][2], o, MODEL_RR_DONUT_PLATFORM, + bhvDonutPlatform) != NULL) { o->oDonutPlatformSpawnerSpawnedPlatforms |= platformFlag; } } @@ -40,8 +37,7 @@ void bhv_donut_platform_spawner_update(void) { void bhv_donut_platform_update(void) { if (o->oTimer != 0 && ((o->oMoveFlags & OBJ_MOVE_MASK_ON_GROUND) || o->oDistanceToMario > 2500.0f)) { o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms = - o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms - & ((1 << o->oBehParams2ndByte) ^ 0xFFFFFFFF); + o->parentObj->oDonutPlatformSpawnerSpawnedPlatforms & ((1 << o->oBehParams2ndByte) ^ 0xFFFFFFFF); if (o->oDistanceToMario > 2500.0f) { obj_mark_for_deletion(o); diff --git a/src/game/behaviors/door.inc.c b/src/game/behaviors/door.inc.c index c25626c7..c99f542e 100644 --- a/src/game/behaviors/door.inc.c +++ b/src/game/behaviors/door.inc.c @@ -5,7 +5,9 @@ struct DoorAction { s32 action; }; -static struct DoorAction sDoorActions[] = { { 0x40000, 3 }, { 0x80000, 4 }, { 0x10000, 1 }, { 0x20000, 2 }, { 0xFFFFFFFF, 0 }, }; +static struct DoorAction sDoorActions[] = { + { 0x40000, 3 }, { 0x80000, 4 }, { 0x10000, 1 }, { 0x20000, 2 }, { 0xFFFFFFFF, 0 }, +}; static s32 sDoorOpenSounds[] = { SOUND_GENERAL_OPEN_WOOD_DOOR, SOUND_GENERAL_OPEN_IRON_DOOR }; @@ -88,7 +90,7 @@ void bhv_door_loop(void) { void bhv_door_init(void) { f32 x; f32 z; - struct Surface *floor; + struct Surface* floor; x = o->oPosX; z = o->oPosZ; diff --git a/src/game/behaviors/dorrie.inc.c b/src/game/behaviors/dorrie.inc.c index b945dfbc..7dc9ef94 100644 --- a/src/game/behaviors/dorrie.inc.c +++ b/src/game/behaviors/dorrie.inc.c @@ -5,7 +5,7 @@ void dorrie_raise_head(void) { f32 xzDisp; f32 yDisp; - o->oDorrieNeckAngle -= (s16) absf(370.0f * sins(o->oDorrieHeadRaiseSpeed)); + o->oDorrieNeckAngle -= (s16)absf(370.0f * sins(o->oDorrieHeadRaiseSpeed)); xzDisp = 440.0f * (coss(o->oDorrieNeckAngle) - coss(startAngle)); yDisp = 440.0f * (sins(o->oDorrieNeckAngle) - sins(startAngle)); @@ -43,8 +43,7 @@ void dorrie_act_move(void) { } obj_forward_vel_approach(targetSpeed, 0.5f); - o->oDorrieYawVel = - approach_s16_symmetric(o->oDorrieYawVel, (s16)(targetYaw - o->oMoveAngleYaw) / 50, 5); + o->oDorrieYawVel = approach_s16_symmetric(o->oDorrieYawVel, (s16)(targetYaw - o->oMoveAngleYaw) / 50, 5); o->oMoveAngleYaw += o->oDorrieYawVel; } @@ -61,12 +60,12 @@ void dorrie_act_lower_head(void) { if (cur_obj_init_anim_check_frame(2, 35)) { cur_obj_reverse_animation(); - if(ROM_JP) { + if (ROM_JP) { if (o->oTimer > 150) { dorrie_begin_head_raise(FALSE); } else if (gMarioObject->platform == o) { - if (o->oDorrieForwardDistToMario > 830.0f - && set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) { + if (o->oDorrieForwardDistToMario > 830.0f && + set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) { dorrie_begin_head_raise(TRUE); } else if (o->oDorrieForwardDistToMario > 320.0f) { o->oTimer = 0; @@ -74,8 +73,8 @@ void dorrie_act_lower_head(void) { } } else { if (gMarioObject->platform == o) { - if (o->oDorrieOffsetY == -17.0f && o->oDorrieForwardDistToMario > 780.0f - && set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) { + if (o->oDorrieOffsetY == -17.0f && o->oDorrieForwardDistToMario > 780.0f && + set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_START) { dorrie_begin_head_raise(TRUE); } else if (o->oDorrieForwardDistToMario > 320.0f) { o->oTimer = 0; @@ -121,8 +120,7 @@ void bhv_dorrie_update(void) { o->oDorrieDistToHome = cur_obj_lateral_dist_to_home(); // Shift dorrie's bounds to account for her neck - boundsShift = - 440.0f * coss(o->oDorrieNeckAngle) * coss(o->oMoveAngleYaw - o->oDorrieAngleToHome); + boundsShift = 440.0f * coss(o->oDorrieNeckAngle) * coss(o->oMoveAngleYaw - o->oDorrieAngleToHome); if (clamp_f32(&o->oDorrieDistToHome, 1650.0f + boundsShift, 2300.0f + boundsShift)) { o->oPosX = o->oHomeX - o->oDorrieDistToHome * sins(o->oDorrieAngleToHome); diff --git a/src/game/behaviors/drawbridge.inc.c b/src/game/behaviors/drawbridge.inc.c index 6630b6b5..24885414 100644 --- a/src/game/behaviors/drawbridge.inc.c +++ b/src/game/behaviors/drawbridge.inc.c @@ -29,7 +29,7 @@ void bhv_lll_drawbridge_loop(void) { break; } - if ((s16) o->oFaceAngleRoll < -0x1FFD) { + if ((s16)o->oFaceAngleRoll < -0x1FFD) { o->oFaceAngleRoll = 0xDFFF; //! Because the global timer increments when the game is paused, pausing and unpausing @@ -40,7 +40,7 @@ void bhv_lll_drawbridge_loop(void) { } } - if ((s16) o->oFaceAngleRoll >= 0) { + if ((s16)o->oFaceAngleRoll >= 0) { o->oFaceAngleRoll = 0; //! Because the global timer increments when the game is paused, pausing and unpausing diff --git a/src/game/behaviors/elevator.inc.c b/src/game/behaviors/elevator.inc.c index 7d2ec042..20ba77b2 100644 --- a/src/game/behaviors/elevator.inc.c +++ b/src/game/behaviors/elevator.inc.c @@ -1,13 +1,7 @@ // elevator.inc.c static s16 sElevatorHeights[] = { - -51, 0, 0, - -461, 0, 0, - -512, 0, 0, - -2611, 0, 0, - -2360, 0, 0, - 214, 0, 0, - -50, 1945, 1, + -51, 0, 0, -461, 0, 0, -512, 0, 0, -2611, 0, 0, -2360, 0, 0, 214, 0, 0, -50, 1945, 1, }; void elevator_starting_shake(void) { @@ -116,11 +110,7 @@ void bhv_elevator_init(void) { } void (*sElevatorActions[])(void) = { - elevator_act_0, - elevator_act_1, - elevator_act_2, - elevator_act_3, - elevator_act_4, + elevator_act_0, elevator_act_1, elevator_act_2, elevator_act_3, elevator_act_4, }; void bhv_elevator_loop(void) { diff --git a/src/game/behaviors/end_birds_1.inc.c b/src/game/behaviors/end_birds_1.inc.c index 69889724..30ca57f6 100644 --- a/src/game/behaviors/end_birds_1.inc.c +++ b/src/game/behaviors/end_birds_1.inc.c @@ -14,8 +14,7 @@ void bhv_end_birds_1_loop(void) { break; case 1: - vec3f_set(sp34, o->oIntroLakituUnk110, o->oIntroLakituUnk10C, - o->oIntroLakituUnk108); + vec3f_set(sp34, o->oIntroLakituUnk110, o->oIntroLakituUnk10C, o->oIntroLakituUnk108); if (o->oTimer < 100) { obj_rotate_towards_point(o, sp34, 0, 0, 0x20, 0x20); diff --git a/src/game/behaviors/end_birds_2.inc.c b/src/game/behaviors/end_birds_2.inc.c index 388a4781..237adc53 100644 --- a/src/game/behaviors/end_birds_2.inc.c +++ b/src/game/behaviors/end_birds_2.inc.c @@ -15,8 +15,7 @@ void bhv_end_birds_2_loop(void) { break; case 1: - vec3f_get_dist_and_angle(gCamera->pos, gCamera->focus, &sp34, &sp32, - &sp30); + vec3f_get_dist_and_angle(gCamera->pos, gCamera->focus, &sp34, &sp32, &sp30); sp30 += 0x1000; sp32 += 0; // nice work, Nintendo vec3f_set_dist_and_angle(gCamera->pos, sp3C, 14000.0f, sp32, sp30); diff --git a/src/game/behaviors/enemy_lakitu.inc.c b/src/game/behaviors/enemy_lakitu.inc.c index b120d7dc..bc12948a 100644 --- a/src/game/behaviors/enemy_lakitu.inc.c +++ b/src/game/behaviors/enemy_lakitu.inc.c @@ -97,9 +97,9 @@ static void enemy_lakitu_sub_act_no_spiny(void) { if (o->oEnemyLakituSpinyCooldown != 0) { o->oEnemyLakituSpinyCooldown--; - } else if (o->oEnemyLakituNumSpinies < 3 && o->oDistanceToMario < 800.0f - && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x4000) { - struct Object *spiny = spawn_object(o, MODEL_SPINY_BALL, bhvSpiny); + } else if (o->oEnemyLakituNumSpinies < 3 && o->oDistanceToMario < 800.0f && + abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x4000) { + struct Object* spiny = spawn_object(o, MODEL_SPINY_BALL, bhvSpiny); if (spiny != NULL) { o->prevObj = spiny; spiny->oAction = SPINY_ACT_HELD_BY_LAKITU; @@ -123,9 +123,8 @@ static void enemy_lakitu_sub_act_hold_spiny(void) { o->oEnemyLakituSpinyCooldown--; } // TODO: Check if anything interesting happens if we bypass this with speed - else if (o->oDistanceToMario > o->oDrawingDistance - 100.0f - || (o->oDistanceToMario < 500.0f - && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x2000)) { + else if (o->oDistanceToMario > o->oDrawingDistance - 100.0f || + (o->oDistanceToMario < 500.0f && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x2000)) { o->oSubAction = ENEMY_LAKITU_SUB_ACT_THROW_SPINY; o->oEnemyLakituFaceForwardCountdown = 20; } diff --git a/src/game/behaviors/exclamation_box.inc.c b/src/game/behaviors/exclamation_box.inc.c index bc664769..78bcbdcf 100644 --- a/src/game/behaviors/exclamation_box.inc.c +++ b/src/game/behaviors/exclamation_box.inc.c @@ -17,27 +17,25 @@ struct Struct802C0DF0 { u8 unk1; u8 unk2; u8 model; - const BehaviorScript *behavior; + const BehaviorScript* behavior; }; -struct Struct802C0DF0 sExclamationBoxContents[] = { - { 0, 0, 0, MODEL_MARIOS_WING_CAP, bhvWingCap }, - { 1, 0, 0, MODEL_MARIOS_METAL_CAP, bhvMetalCap }, - { 2, 0, 0, MODEL_MARIOS_CAP, bhvVanishCap }, - { 3, 0, 0, MODEL_KOOPA_SHELL, bhvKoopaShell }, - { 4, 0, 0, MODEL_YELLOW_COIN, bhvSingleCoinGetsSpawned }, - { 5, 0, 0, MODEL_NONE, bhvThreeCoinsSpawn }, - { 6, 0, 0, MODEL_NONE, bhvTenCoinsSpawn }, - { 7, 0, 0, MODEL_1UP, bhv1upWalking }, - { 8, 0, 0, MODEL_STAR, bhvSpawnedStar }, - { 9, 0, 0, MODEL_1UP, bhv1upRunningAway }, - { 10, 0, 1, MODEL_STAR, bhvSpawnedStar }, - { 11, 0, 2, MODEL_STAR, bhvSpawnedStar }, - { 12, 0, 3, MODEL_STAR, bhvSpawnedStar }, - { 13, 0, 4, MODEL_STAR, bhvSpawnedStar }, - { 14, 0, 5, MODEL_STAR, bhvSpawnedStar }, - { 99, 0, 0, 0, NULL } -}; +struct Struct802C0DF0 sExclamationBoxContents[] = { { 0, 0, 0, MODEL_MARIOS_WING_CAP, bhvWingCap }, + { 1, 0, 0, MODEL_MARIOS_METAL_CAP, bhvMetalCap }, + { 2, 0, 0, MODEL_MARIOS_CAP, bhvVanishCap }, + { 3, 0, 0, MODEL_KOOPA_SHELL, bhvKoopaShell }, + { 4, 0, 0, MODEL_YELLOW_COIN, bhvSingleCoinGetsSpawned }, + { 5, 0, 0, MODEL_NONE, bhvThreeCoinsSpawn }, + { 6, 0, 0, MODEL_NONE, bhvTenCoinsSpawn }, + { 7, 0, 0, MODEL_1UP, bhv1upWalking }, + { 8, 0, 0, MODEL_STAR, bhvSpawnedStar }, + { 9, 0, 0, MODEL_1UP, bhv1upRunningAway }, + { 10, 0, 1, MODEL_STAR, bhvSpawnedStar }, + { 11, 0, 2, MODEL_STAR, bhvSpawnedStar }, + { 12, 0, 3, MODEL_STAR, bhvSpawnedStar }, + { 13, 0, 4, MODEL_STAR, bhvSpawnedStar }, + { 14, 0, 5, MODEL_STAR, bhvSpawnedStar }, + { 99, 0, 0, 0, NULL } }; void bhv_rotating_exclamation_box_loop(void) { if (o->parentObj->oAction != 1) { @@ -48,8 +46,7 @@ void bhv_rotating_exclamation_box_loop(void) { void exclamation_box_act_0(void) { if (o->oBehParams2ndByte < 3) { o->oAnimState = o->oBehParams2ndByte; - if ((save_file_get_flags() & sCapSaveFlags[o->oBehParams2ndByte]) - || ((o->oBehParams >> 24) & 0xFF)) { + if ((save_file_get_flags() & sCapSaveFlags[o->oBehParams2ndByte]) || ((o->oBehParams >> 24) & 0xFF)) { o->oAction = 2; } else { o->oAction = 1; @@ -66,8 +63,7 @@ void exclamation_box_act_1(void) { spawn_object(o, MODEL_EXCLAMATION_POINT, bhvRotatingExclamationMark); cur_obj_set_model(MODEL_EXCLAMATION_BOX_OUTLINE); } - if ((save_file_get_flags() & sCapSaveFlags[o->oBehParams2ndByte]) - || ((o->oBehParams >> 24) & 0xFF)) { + if ((save_file_get_flags() & sCapSaveFlags[o->oBehParams2ndByte]) || ((o->oBehParams >> 24) & 0xFF)) { o->oAction = 2; cur_obj_set_model(MODEL_EXCLAMATION_BOX); } @@ -115,8 +111,8 @@ void exclamation_box_act_3(void) { } } -void exclamation_box_spawn_contents(struct Struct802C0DF0 *a0, u8 a1) { - struct Object *sp1C = NULL; +void exclamation_box_spawn_contents(struct Struct802C0DF0* a0, u8 a1) { + struct Object* sp1C = NULL; while (a0->unk0 != 99) { if (a1 == a0->unk0) { @@ -154,12 +150,8 @@ void exclamation_box_act_5(void) { } void (*sExclamationBoxActions[])(void) = { - exclamation_box_act_0, - exclamation_box_act_1, - exclamation_box_act_2, - exclamation_box_act_3, - exclamation_box_act_4, - exclamation_box_act_5, + exclamation_box_act_0, exclamation_box_act_1, exclamation_box_act_2, + exclamation_box_act_3, exclamation_box_act_4, exclamation_box_act_5, }; void bhv_exclamation_box_loop(void) { diff --git a/src/game/behaviors/explosion.inc.c b/src/game/behaviors/explosion.inc.c index 9122499c..c58178ea 100644 --- a/src/game/behaviors/explosion.inc.c +++ b/src/game/behaviors/explosion.inc.c @@ -24,5 +24,5 @@ void bhv_explosion_loop(void) { o->oOpacity -= 14; - cur_obj_scale((f32) o->oTimer / 9.0f + 1.0); + cur_obj_scale((f32)o->oTimer / 9.0f + 1.0); } diff --git a/src/game/behaviors/eyerok.inc.c b/src/game/behaviors/eyerok.inc.c index 756f4e1c..30d90816 100644 --- a/src/game/behaviors/eyerok.inc.c +++ b/src/game/behaviors/eyerok.inc.c @@ -22,9 +22,8 @@ static s32 eyerok_check_mario_relative_z(s32 arg0) { } } -static void eyerok_spawn_hand(s16 side, s32 model, const BehaviorScript *behavior) { - struct Object *hand = spawn_object_relative_with_scale(side, -500 * side, 0, 300, 1.5f, - o, model, behavior); +static void eyerok_spawn_hand(s16 side, s32 model, const BehaviorScript* behavior) { + struct Object* hand = spawn_object_relative_with_scale(side, -500 * side, 0, 300, 1.5f, o, model, behavior); if (hand != NULL) { hand->oFaceAngleYaw -= 0x4000 * side; } @@ -181,17 +180,15 @@ static void eyerok_hand_pound_ground(void) { } static void eyerok_hand_act_sleep(void) { - if (o->parentObj->oAction != EYEROK_BOSS_ACT_SLEEP - && ++o->oEyerokHandWakeUpTimer > -3 * o->oBehParams2ndByte) { + if (o->parentObj->oAction != EYEROK_BOSS_ACT_SLEEP && ++o->oEyerokHandWakeUpTimer > -3 * o->oBehParams2ndByte) { if (cur_obj_check_if_near_animation_end()) { o->parentObj->oEyerokBossNumHands++; o->oAction = EYEROK_HAND_ACT_IDLE; o->collisionData = segmented_to_virtual(ssl_seg7_collision_07028274); } else { approach_f32_ptr(&o->oPosX, o->oHomeX, 15.0f); - o->oPosY = o->oHomeY - + (200 * o->oBehParams2ndByte + 400) - * sins((s16)(absf(o->oPosX - o->oHomeX) / 724.0f * 0x8000)); + o->oPosY = o->oHomeY + + (200 * o->oBehParams2ndByte + 400) * sins((s16)(absf(o->oPosX - o->oHomeX) / 724.0f * 0x8000)); obj_face_yaw_approach(o->oMoveAngleYaw, 400); } } else { @@ -287,8 +284,7 @@ static void eyerok_hand_act_show_eye(void) { if (o->parentObj->oEyerokBossNumHands != 2) { obj_face_yaw_approach(o->oMoveAngleYaw, 0x800); - if (o->oTimer > 10 - && (o->oPosZ - gMarioObject->oPosZ > 0.0f || (o->oMoveFlags & OBJ_MOVE_HIT_EDGE))) { + if (o->oTimer > 10 && (o->oPosZ - gMarioObject->oPosZ > 0.0f || (o->oMoveFlags & OBJ_MOVE_HIT_EDGE))) { o->parentObj->oEyerokBossActiveHand = 0; o->oForwardVel = 0.0f; } @@ -372,9 +368,9 @@ static void eyerok_hand_act_retreat(void) { } static void eyerok_hand_act_target_mario(void) { - if (eyerok_check_mario_relative_z(400) || o->oPosZ - gMarioObject->oPosZ > 0.0f - || o->oPosZ - o->parentObj->oPosZ > 1700.0f || absf(o->oPosX - o->parentObj->oPosX) > 900.0f - || (o->oMoveFlags & OBJ_MOVE_HIT_WALL)) { + if (eyerok_check_mario_relative_z(400) || o->oPosZ - gMarioObject->oPosZ > 0.0f || + o->oPosZ - o->parentObj->oPosZ > 1700.0f || absf(o->oPosX - o->parentObj->oPosX) > 900.0f || + (o->oMoveFlags & OBJ_MOVE_HIT_WALL)) { o->oForwardVel = 0.0f; if (approach_f32_ptr(&o->oPosY, o->oHomeY + 300.0f, 20.0f)) { o->oAction = EYEROK_HAND_ACT_SMASH; @@ -438,18 +434,15 @@ static void eyerok_hand_act_fist_sweep(void) { } static void eyerok_hand_act_begin_double_pound(void) { - if (o->parentObj->oEyerokBossUnk104 < 0 - || o->parentObj->oEyerokBossActiveHand == o->oBehParams2ndByte) { + if (o->parentObj->oEyerokBossUnk104 < 0 || o->parentObj->oEyerokBossActiveHand == o->oBehParams2ndByte) { o->oAction = EYEROK_HAND_ACT_DOUBLE_POUND; o->oMoveAngleYaw = (s32)(o->oFaceAngleYaw - 0x4000 * o->parentObj->oEyerokBossUnk108); } else { - f32 sp4 = o->parentObj->oPosX + 400.0f * o->parentObj->oEyerokBossUnk108 - - 180.0f * o->oBehParams2ndByte; + f32 sp4 = o->parentObj->oPosX + 400.0f * o->parentObj->oEyerokBossUnk108 - 180.0f * o->oBehParams2ndByte; o->oPosX = o->oHomeX + (sp4 - o->oHomeX) * o->parentObj->oEyerokBossUnk110; o->oPosY = o->oHomeY + 300.0f * o->parentObj->oEyerokBossUnk110; - o->oPosZ = - o->oHomeZ + (o->parentObj->oEyerokBossUnk10C - o->oHomeZ) * o->parentObj->oEyerokBossUnk110; + o->oPosZ = o->oHomeZ + (o->parentObj->oEyerokBossUnk10C - o->oHomeZ) * o->parentObj->oEyerokBossUnk110; } } diff --git a/src/game/behaviors/ferris_wheel.inc.c b/src/game/behaviors/ferris_wheel.inc.c index 2fdaf047..55eba3a1 100644 --- a/src/game/behaviors/ferris_wheel.inc.c +++ b/src/game/behaviors/ferris_wheel.inc.c @@ -9,8 +9,8 @@ * Properties for the ferris wheel axle and platforms. */ struct FerrisWheelProperties { - Collision const *axleCollision; - Collision const *platformCollision; + Collision const* axleCollision; + Collision const* platformCollision; s16 platformModel; }; @@ -28,15 +28,13 @@ static struct FerrisWheelProperties sFerrisWheelProperties[] = { * behavior script. */ void bhv_ferris_wheel_axle_init(void) { - struct Object *platform; + struct Object* platform; s32 i; - o->collisionData = - segmented_to_virtual(sFerrisWheelProperties[o->oBehParams2ndByte].axleCollision); + o->collisionData = segmented_to_virtual(sFerrisWheelProperties[o->oBehParams2ndByte].axleCollision); for (i = 0; i < 4; i++) { - platform = spawn_object_relative(i, 0, 0, 0, o, - sFerrisWheelProperties[o->oBehParams2ndByte].platformModel, + platform = spawn_object_relative(i, 0, 0, 0, o, sFerrisWheelProperties[o->oBehParams2ndByte].platformModel, bhvFerrisWheelPlatform); if (platform != NULL) { @@ -59,13 +57,13 @@ void bhv_ferris_wheel_platform_update(void) { offsetAngle = o->parentObj->oFaceAngleRoll + o->oBehParams2ndByte * 0x4000; offsetXZ = 400.0f * coss(offsetAngle); - o->oPosX = o->parentObj->oPosX + offsetXZ * sins(o->parentObj->oMoveAngleYaw) - + 300.0f * coss(o->parentObj->oMoveAngleYaw); + o->oPosX = + o->parentObj->oPosX + offsetXZ * sins(o->parentObj->oMoveAngleYaw) + 300.0f * coss(o->parentObj->oMoveAngleYaw); o->oPosY = o->parentObj->oPosY + 400.0f * sins(offsetAngle); - o->oPosZ = o->parentObj->oPosZ + offsetXZ * coss(o->parentObj->oMoveAngleYaw) - + 300.0f * sins(o->parentObj->oMoveAngleYaw); + o->oPosZ = + o->parentObj->oPosZ + offsetXZ * coss(o->parentObj->oMoveAngleYaw) + 300.0f * sins(o->parentObj->oMoveAngleYaw); obj_perform_position_op(POS_OP_COMPUTE_VELOCITY); } diff --git a/src/game/behaviors/fire_piranha_plant.inc.c b/src/game/behaviors/fire_piranha_plant.inc.c index be1ea9cb..7aba83e8 100644 --- a/src/game/behaviors/fire_piranha_plant.inc.c +++ b/src/game/behaviors/fire_piranha_plant.inc.c @@ -52,15 +52,13 @@ void bhv_fire_piranha_plant_init(void) { static void fire_piranha_plant_act_hide(void) { if (o->oFirePiranhaPlantDeathSpinTimer != 0) { - o->oMoveAngleYaw += (s32) o->oFirePiranhaPlantDeathSpinVel; + o->oMoveAngleYaw += (s32)o->oFirePiranhaPlantDeathSpinVel; approach_f32_ptr(&o->oFirePiranhaPlantDeathSpinVel, 0.0f, 200.0f); - if (cur_obj_check_if_near_animation_end() - && --o->oFirePiranhaPlantDeathSpinTimer == 0) { + if (cur_obj_check_if_near_animation_end() && --o->oFirePiranhaPlantDeathSpinTimer == 0) { cur_obj_play_sound_2(SOUND_OBJ_ENEMY_DEFEAT_SHRINK); } - } else if (approach_f32_ptr(&o->oFirePiranhaPlantScale, 0.0f, - 0.04f * o->oFirePiranhaPlantNeutralScale)) { + } else if (approach_f32_ptr(&o->oFirePiranhaPlantScale, 0.0f, 0.04f * o->oFirePiranhaPlantNeutralScale)) { cur_obj_become_intangible(); if (o->oFirePiranhaPlantActive) { @@ -75,8 +73,8 @@ static void fire_piranha_plant_act_hide(void) { obj_die_if_health_non_positive(); set_object_respawn_info_bits(o, 1); } - } else if (sNumActiveFirePiranhaPlants < 2 && o->oTimer > 100 - && o->oDistanceToMario > 100.0f && o->oDistanceToMario < 800.0f) { + } else if (sNumActiveFirePiranhaPlants < 2 && o->oTimer > 100 && o->oDistanceToMario > 100.0f && + o->oDistanceToMario < 800.0f) { cur_obj_play_sound_2(SOUND_OBJ_PIRANHA_PLANT_APPEAR); o->oFirePiranhaPlantActive = TRUE; @@ -107,9 +105,8 @@ static void fire_piranha_plant_act_grow(void) { } else if (obj_is_rendering_enabled() && cur_obj_check_anim_frame(56)) { cur_obj_play_sound_2(SOUND_OBJ_FLAME_BLOWN); obj_spit_fire(0, (s32)(30.0f * o->oFirePiranhaPlantNeutralScale), - (s32)(140.0f * o->oFirePiranhaPlantNeutralScale), - 2.5f * o->oFirePiranhaPlantNeutralScale, MODEL_RED_FLAME_SHADOW, - 20.0f, 15.0f, 0x1000); + (s32)(140.0f * o->oFirePiranhaPlantNeutralScale), 2.5f * o->oFirePiranhaPlantNeutralScale, + MODEL_RED_FLAME_SHADOW, 20.0f, 15.0f, 0x1000); } } else if (o->oFirePiranhaPlantScale > o->oFirePiranhaPlantNeutralScale / 2) { cur_obj_become_tangible(); diff --git a/src/game/behaviors/fish.inc.c b/src/game/behaviors/fish.inc.c index 7ef29699..b8b0983e 100644 --- a/src/game/behaviors/fish.inc.c +++ b/src/game/behaviors/fish.inc.c @@ -13,24 +13,36 @@ static void fish_spawner_act_spawn(void) { s32 schoolQuantity; s16 model; f32 minDistToMario; - const struct Animation * const *fishAnimation; + const struct Animation* const* fishAnimation; switch (o->oBehParams2ndByte) { // Cases need to be on one line to match with and without optimizations. case FISH_SPAWNER_BP_MANY_BLUE: - model = MODEL_FISH; schoolQuantity = 20; minDistToMario = 1500.0f; fishAnimation = blue_fish_seg3_anims_0301C2B0; + model = MODEL_FISH; + schoolQuantity = 20; + minDistToMario = 1500.0f; + fishAnimation = blue_fish_seg3_anims_0301C2B0; break; case FISH_SPAWNER_BP_FEW_BLUE: - model = MODEL_FISH; schoolQuantity = 5; minDistToMario = 1500.0f; fishAnimation = blue_fish_seg3_anims_0301C2B0; + model = MODEL_FISH; + schoolQuantity = 5; + minDistToMario = 1500.0f; + fishAnimation = blue_fish_seg3_anims_0301C2B0; break; case FISH_SPAWNER_BP_MANY_CYAN: - model = MODEL_CYAN_FISH; schoolQuantity = 20; minDistToMario = 1500.0f; fishAnimation = cyan_fish_seg6_anims_0600E264; + model = MODEL_CYAN_FISH; + schoolQuantity = 20; + minDistToMario = 1500.0f; + fishAnimation = cyan_fish_seg6_anims_0600E264; break; case FISH_SPAWNER_BP_FEW_CYAN: - model = MODEL_CYAN_FISH; schoolQuantity = 5; minDistToMario = 1500.0f; fishAnimation = cyan_fish_seg6_anims_0600E264; + model = MODEL_CYAN_FISH; + schoolQuantity = 5; + minDistToMario = 1500.0f; + fishAnimation = cyan_fish_seg6_anims_0600E264; break; } @@ -39,7 +51,7 @@ static void fish_spawner_act_spawn(void) { // Fish moves randomly within a range of 700.0f. if (o->oDistanceToMario < minDistToMario || gCurrLevelNum == LEVEL_SA) { for (i = 0; i < schoolQuantity; i++) { - struct Object *fishObject = spawn_object(o, model, bhvFish); + struct Object* fishObject = spawn_object(o, model, bhvFish); fishObject->oBehParams2ndByte = o->oBehParams2ndByte; obj_init_animation_with_sound(fishObject, fishAnimation, 0); obj_translate_xyz_random(fishObject, 700.0f); @@ -81,7 +93,7 @@ void bhv_fish_spawner_loop(void) { static void fish_vertical_roam(s32 speed) { f32 parentY = o->parentObj->oPosY; - // If the stage is Secret Aquarium, the fish can + // If the stage is Secret Aquarium, the fish can // travel as far vertically as they wish. if (gCurrLevelNum == LEVEL_SA) { if (500.0f < absf(o->oPosY - o->oFishGoalY)) { @@ -89,10 +101,10 @@ static void fish_vertical_roam(s32 speed) { } o->oPosY = approach_f32_symmetric(o->oPosY, o->oFishGoalY, speed); - // Allow the fish to roam vertically if within - // range of the fish spawner. - } else if (parentY - 100.0f - o->oFishDepthDistance < o->oPosY - && o->oPosY < parentY + 1000.0f + o->oFishDepthDistance) { + // Allow the fish to roam vertically if within + // range of the fish spawner. + } else if (parentY - 100.0f - o->oFishDepthDistance < o->oPosY && + o->oPosY < parentY + 1000.0f + o->oFishDepthDistance) { o->oPosY = approach_f32_symmetric(o->oPosY, o->oFishGoalY, speed); } } @@ -136,7 +148,7 @@ static void fish_act_roam(void) { fish_vertical_roam(4); } - // Don't let the fish leave the water vertically. + // Don't let the fish leave the water vertically. } else { o->oPosY = o->oFishWaterLevel - 50.0f; if (fishY > 300.0f) { @@ -204,7 +216,7 @@ static void fish_act_flee(void) { fish_vertical_roam(4); } - // Don't let the fish leave the water vertically. + // Don't let the fish leave the water vertically. } else { o->oPosY = o->oFishWaterLevel - 50.0f; if (fishY > 300.0f) { @@ -260,7 +272,7 @@ void bhv_fish_loop(void) { return; } - // Unreachable code, perhaps for debugging or testing. + // Unreachable code, perhaps for debugging or testing. } else { o->oFishWaterLevel = 1000.0f; } diff --git a/src/game/behaviors/flame.inc.c b/src/game/behaviors/flame.inc.c index 801b1fa5..bf93cbe5 100644 --- a/src/game/behaviors/flame.inc.c +++ b/src/game/behaviors/flame.inc.c @@ -21,8 +21,7 @@ void bhv_small_piranha_flame_loop(void) { obj_compute_vel_from_move_pitch(o->oSmallPiranhaFlameStartSpeed); cur_obj_move_standard(-78); - spawn_object_with_scale(o, o->oSmallPiranhaFlameModel, bhvSmallPiranhaFlame, - 0.4f * o->header.gfx.scale[0]); + spawn_object_with_scale(o, o->oSmallPiranhaFlameModel, bhvSmallPiranhaFlame, 0.4f * o->header.gfx.scale[0]); if (o->oTimer > o->oSmallPiranhaFlameNextFlameTimer) { spawn_object_relative_with_scale(1, 0, o->oGraphYOffset, 0, o->header.gfx.scale[0], o, @@ -34,8 +33,7 @@ void bhv_small_piranha_flame_loop(void) { obj_check_attacks(&sPiranhaPlantFireHitbox, o->oAction); o->oSmallPiranhaFlameSpeed += o->oSmallPiranhaFlameStartSpeed; - if (o->oSmallPiranhaFlameSpeed > 1500.0f - || (o->oMoveFlags & (OBJ_MOVE_HIT_WALL | OBJ_MOVE_MASK_IN_WATER))) { + if (o->oSmallPiranhaFlameSpeed > 1500.0f || (o->oMoveFlags & (OBJ_MOVE_HIT_WALL | OBJ_MOVE_MASK_IN_WATER))) { obj_die_if_health_non_positive(); } } diff --git a/src/game/behaviors/flamethrower.inc.c b/src/game/behaviors/flamethrower.inc.c index ae0922aa..b6516908 100644 --- a/src/game/behaviors/flamethrower.inc.c +++ b/src/game/behaviors/flamethrower.inc.c @@ -48,15 +48,14 @@ void bhv_flamethrower_flame_loop(void) { } void bhv_flamethrower_loop(void) { - struct Object *flame; + struct Object* flame; f32 flameVel; s32 sp34; s32 model; UNUSED u8 filler[8]; if (o->oAction == 0) { - if ((gCurrLevelNum != LEVEL_BBH || gMarioOnMerryGoRound == TRUE) - && o->oDistanceToMario < 2000.0f) { + if ((gCurrLevelNum != LEVEL_BBH || gMarioOnMerryGoRound == TRUE) && o->oDistanceToMario < 2000.0f) { o->oAction++; } } else if (o->oAction == 1) { diff --git a/src/game/behaviors/floating_platform.inc.c b/src/game/behaviors/floating_platform.inc.c index 1dea8a68..250a29b1 100644 --- a/src/game/behaviors/floating_platform.inc.c +++ b/src/game/behaviors/floating_platform.inc.c @@ -1,7 +1,7 @@ // floating_platform.inc.c f32 floating_platform_find_home_y(void) { - struct Surface *sp24; + struct Surface* sp24; f32 sp20 = find_water_level(o->oPosX, o->oPosZ); f32 sp1C = find_floor(o->oPosX, o->oPosY, o->oPosZ, &sp24); @@ -15,10 +15,10 @@ f32 floating_platform_find_home_y(void) { } void floating_platform_act_0(void) { - s16 sp6 = (gMarioObject->header.gfx.pos[0] - o->oPosX) * coss(-1*o->oMoveAngleYaw) - + (gMarioObject->header.gfx.pos[2] - o->oPosZ) * sins(-1*o->oMoveAngleYaw); - s16 sp4 = (gMarioObject->header.gfx.pos[2] - o->oPosZ) * coss(-1*o->oMoveAngleYaw) - - (gMarioObject->header.gfx.pos[0] - o->oPosX) * sins(-1*o->oMoveAngleYaw); + s16 sp6 = (gMarioObject->header.gfx.pos[0] - o->oPosX) * coss(-1 * o->oMoveAngleYaw) + + (gMarioObject->header.gfx.pos[2] - o->oPosZ) * sins(-1 * o->oMoveAngleYaw); + s16 sp4 = (gMarioObject->header.gfx.pos[2] - o->oPosZ) * coss(-1 * o->oMoveAngleYaw) - + (gMarioObject->header.gfx.pos[0] - o->oPosX) * sins(-1 * o->oMoveAngleYaw); if (gMarioObject->platform == o) { o->oFaceAnglePitch = sp4 * 2; @@ -47,8 +47,7 @@ void floating_platform_act_0(void) { } } - o->oPosY = o->oHomeY - 64.0f - o->oFloatingPlatformUnkF8 - + sins(o->oFloatingPlatformUnk100 * 0x800) * 10.0f; + o->oPosY = o->oHomeY - 64.0f - o->oFloatingPlatformUnkF8 + sins(o->oFloatingPlatformUnk100 * 0x800) * 10.0f; o->oFloatingPlatformUnk100++; diff --git a/src/game/behaviors/fly_guy.inc.c b/src/game/behaviors/fly_guy.inc.c index d5911582..279cd78d 100644 --- a/src/game/behaviors/fly_guy.inc.c +++ b/src/game/behaviors/fly_guy.inc.c @@ -68,8 +68,8 @@ static void fly_guy_act_approach_mario(void) { // If facing toward mario and we are either near mario laterally or // far above him - if (abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x2000 - && (o->oPosY - gMarioObject->oPosY > 400.0f || o->oDistanceToMario < 400.0f)) { + if (abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x2000 && + (o->oPosY - gMarioObject->oPosY > 400.0f || o->oDistanceToMario < 400.0f)) { // Either shoot fire or lunge if (o->oBehParams2ndByte != 0 && random_u16() % 2) { o->oAction = FLY_GUY_ACT_SHOOT_FIRE; diff --git a/src/game/behaviors/flying_bookend_switch.inc.c b/src/game/behaviors/flying_bookend_switch.inc.c index 91d7fdc9..53738668 100644 --- a/src/game/behaviors/flying_bookend_switch.inc.c +++ b/src/game/behaviors/flying_bookend_switch.inc.c @@ -135,7 +135,7 @@ void bhv_flying_bookend_loop(void) { void bhv_bookend_spawn_loop(void) { if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) { if (o->oTimer > 40 && obj_is_near_to_and_facing_mario(600.0f, 0x2000)) { - struct Object *sp1C = spawn_object(o, MODEL_BOOKEND, bhvFlyingBookend); + struct Object* sp1C = spawn_object(o, MODEL_BOOKEND, bhvFlyingBookend); if (sp1C != NULL) { sp1C->oAction = 3; @@ -152,8 +152,7 @@ void bookshelf_manager_act_0(void) { if (!(o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) { for (i = 0; i < 3; i++) { - spawn_object_relative(i, D_80331B30[i].unk00, D_80331B30[i].unk02, 0, o, - MODEL_BOOKEND, bhvBookSwitch); + spawn_object_relative(i, D_80331B30[i].unk00, D_80331B30[i].unk02, 0, o, MODEL_BOOKEND, bhvBookSwitch); } o->oAction = 1; @@ -258,9 +257,9 @@ void bhv_book_switch_loop(void) { } if (approach_f32_ptr(&o->oBookSwitchUnkF4, 50.0f, 20.0f)) { - if (o->parentObj->oBookSwitchManagerUnkF4 >= 0 && o->oTimer > 60 - && (attackType == ATTACK_PUNCH || attackType == ATTACK_KICK_OR_TRIP - || attackType == ATTACK_FROM_BELOW)) { + if (o->parentObj->oBookSwitchManagerUnkF4 >= 0 && o->oTimer > 60 && + (attackType == ATTACK_PUNCH || attackType == ATTACK_KICK_OR_TRIP || + attackType == ATTACK_FROM_BELOW)) { o->oAction = 2; } } else { @@ -274,7 +273,7 @@ void bhv_book_switch_loop(void) { play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource); o->parentObj->oBookSwitchManagerUnkF4++; } else { - struct Object *sp38; + struct Object* sp38; s16 sp36 = random_u16() & 0x1; s16 sp34 = gMarioObject->oPosZ + 1.5f * gMarioStates[0].vel[2]; @@ -284,9 +283,8 @@ void bhv_book_switch_loop(void) { sp34 = 0; } - sp38 = spawn_object_abs_with_rot(o, 0, MODEL_BOOKEND, bhvFlyingBookend, - 0x1FC * sp36 - 0x8CA, 890, sp34, 0, - 0x8000 * sp36 + 0x4000, 0); + sp38 = spawn_object_abs_with_rot(o, 0, MODEL_BOOKEND, bhvFlyingBookend, 0x1FC * sp36 - 0x8CA, 890, + sp34, 0, 0x8000 * sp36 + 0x4000, 0); if (sp38 != NULL) { sp38->oAction = 3; diff --git a/src/game/behaviors/goomba.inc.c b/src/game/behaviors/goomba.inc.c index 7089c34f..22db846f 100644 --- a/src/game/behaviors/goomba.inc.c +++ b/src/game/behaviors/goomba.inc.c @@ -78,9 +78,7 @@ void bhv_goomba_triplet_spawner_update(void) { if (o->oDistanceToMario < 3000.0f) { // The spawner is capable of spawning more than 3 goombas, but this // is not used in the game - s32 dAngle = - 0x10000 - / (((o->oBehParams2ndByte & GOOMBA_TRIPLET_SPAWNER_BP_EXTRA_GOOMBAS_MASK) >> 2) + 3); + s32 dAngle = 0x10000 / (((o->oBehParams2ndByte & GOOMBA_TRIPLET_SPAWNER_BP_EXTRA_GOOMBAS_MASK) >> 2) + 3); for (angle = 0, goombaFlag = 1 << 8; angle < 0xFFFF; angle += dAngle, goombaFlag <<= 1) { // Only spawn goombas which haven't been killed yet @@ -88,8 +86,9 @@ void bhv_goomba_triplet_spawner_update(void) { s16 dx = 500.0f * coss(angle); s16 dz = 500.0f * sins(angle); - spawn_object_relative((o->oBehParams2ndByte & GOOMBA_TRIPLET_SPAWNER_BP_SIZE_MASK) - | (goombaFlag >> 6), dx, 0, dz, o, MODEL_GOOMBA, bhvGoomba); + spawn_object_relative((o->oBehParams2ndByte & GOOMBA_TRIPLET_SPAWNER_BP_SIZE_MASK) | + (goombaFlag >> 6), + dx, 0, dz, o, MODEL_GOOMBA, bhvGoomba); } } @@ -137,11 +136,9 @@ static void goomba_begin_jump(void) { */ static void mark_goomba_as_dead(void) { if (o->parentObj != o) { - set_object_respawn_info_bits( - o->parentObj, (o->oBehParams2ndByte & GOOMBA_BP_TRIPLET_FLAG_MASK) >> 2); + set_object_respawn_info_bits(o->parentObj, (o->oBehParams2ndByte & GOOMBA_BP_TRIPLET_FLAG_MASK) >> 2); - o->parentObj->oBehParams = - o->parentObj->oBehParams | (o->oBehParams2ndByte & GOOMBA_BP_TRIPLET_FLAG_MASK) << 6; + o->parentObj->oBehParams = o->parentObj->oBehParams | (o->oBehParams2ndByte & GOOMBA_BP_TRIPLET_FLAG_MASK) << 6; } } @@ -175,8 +172,7 @@ static void goomba_act_walk(void) { o->oGoombaWalkTimer = random_linear_offset(20, 30); } - if (!(o->oGoombaTurningAwayFromWall = - obj_bounce_off_walls_edges_objects(&o->oGoombaTargetYaw))) { + if (!(o->oGoombaTurningAwayFromWall = obj_bounce_off_walls_edges_objects(&o->oGoombaTargetYaw))) { if (o->oDistanceToMario < 500.0f) { // If close to mario, begin chasing him. If not already chasing // him, jump first @@ -303,8 +299,7 @@ void bhv_goomba_update(void) { // without harming it (e.g. by punching it), the goomba will be marked as dead // and will not respawn if Mario leaves and re-enters the spawner's radius // even though the goomba isn't actually dead. - if (obj_handle_attacks(&sGoombaHitbox, GOOMBA_ACT_ATTACKED_MARIO, - sGoombaAttackHandlers[o->oGoombaSize & 1])) { + if (obj_handle_attacks(&sGoombaHitbox, GOOMBA_ACT_ATTACKED_MARIO, sGoombaAttackHandlers[o->oGoombaSize & 1])) { mark_goomba_as_dead(); } diff --git a/src/game/behaviors/grill_door.inc.c b/src/game/behaviors/grill_door.inc.c index 99ce3583..91dda2be 100644 --- a/src/game/behaviors/grill_door.inc.c +++ b/src/game/behaviors/grill_door.inc.c @@ -3,12 +3,12 @@ struct OpenableGrill { s16 halfWidth; s16 modelID; - const Collision *collision; + const Collision* collision; }; struct OpenableGrill gOpenableGrills[] = { { 320, MODEL_BOB_BARS_GRILLS, bob_seg7_collision_gate }, - { 410, MODEL_HMC_RED_GRILLS, hmc_seg7_collision_0702B65C }, + { 410, MODEL_HMC_RED_GRILLS, hmc_seg7_collision_0702B65C }, }; void bhv_openable_cage_door_loop(void) { @@ -26,7 +26,7 @@ void bhv_openable_cage_door_loop(void) { } void bhv_openable_grill_loop(void) { - struct Object *grillObj; + struct Object* grillObj; s32 grillIdx; switch (o->oAction) { @@ -46,8 +46,7 @@ void bhv_openable_grill_loop(void) { break; case 1: - if ((o->oOpenableGrillUnkF4 = - cur_obj_nearest_object_with_behavior(bhvFloorSwitchGrills)) != NULL) { + if ((o->oOpenableGrillUnkF4 = cur_obj_nearest_object_with_behavior(bhvFloorSwitchGrills)) != NULL) { o->oAction++; } break; diff --git a/src/game/behaviors/ground_particles.inc.c b/src/game/behaviors/ground_particles.inc.c index aff00af5..4cd74d57 100644 --- a/src/game/behaviors/ground_particles.inc.c +++ b/src/game/behaviors/ground_particles.inc.c @@ -47,7 +47,7 @@ void bhv_ground_sand_init(void) { static s16 sSmokeMovementParams[] = { 2, -8, 1, 4 }; void spawn_smoke_with_velocity(void) { - struct Object *smoke = spawn_object_with_scale(o, MODEL_SMOKE, bhvWhitePuffSmoke2, 1.0f); + struct Object* smoke = spawn_object_with_scale(o, MODEL_SMOKE, bhvWhitePuffSmoke2, 1.0f); smoke->oForwardVel = sSmokeMovementParams[0]; smoke->oVelY = sSmokeMovementParams[1]; diff --git a/src/game/behaviors/haunted_chair.inc.c b/src/game/behaviors/haunted_chair.inc.c index d66b34c6..61387c1e 100644 --- a/src/game/behaviors/haunted_chair.inc.c +++ b/src/game/behaviors/haunted_chair.inc.c @@ -13,7 +13,7 @@ struct ObjectHitbox sHauntedChairHitbox = { }; void bhv_haunted_chair_init(void) { - struct Object *val04; + struct Object* val04; f32 val00; val04 = cur_obj_find_nearest_object_with_behavior(bhvMadPiano, &val00); @@ -56,8 +56,8 @@ void haunted_chair_act_0(void) { } } } else { - oscillate_toward(o->oHauntedChairUnk100, &o->oHauntedChairUnkF8, o->oHauntedChairUnk104, - 4000.0f, 20.0f, 2.0f); + oscillate_toward(o->oHauntedChairUnk100, &o->oHauntedChairUnkF8, o->oHauntedChairUnk104, 4000.0f, 20.0f, + 2.0f); } } else if (o->oHauntedChairUnkF4 != 0) { if (o->oDistanceToMario < 500.0f) { diff --git a/src/game/behaviors/heave_ho.inc.c b/src/game/behaviors/heave_ho.inc.c index 2a8ab260..cf157761 100644 --- a/src/game/behaviors/heave_ho.inc.c +++ b/src/game/behaviors/heave_ho.inc.c @@ -1,7 +1,8 @@ // heave_ho.inc.c -s16 D_8032F460[][2] = { { 30, 0 }, { 42, 1 }, { 52, 0 }, { 64, 1 }, { 74, 0 }, - { 86, 1 }, { 96, 0 }, { 108, 1 }, { 118, 0 }, { -1, 0 }, }; +s16 D_8032F460[][2] = { + { 30, 0 }, { 42, 1 }, { 52, 0 }, { 64, 1 }, { 74, 0 }, { 86, 1 }, { 96, 0 }, { 108, 1 }, { 118, 0 }, { -1, 0 }, +}; void bhv_heave_ho_throw_mario_loop(void) { o->oParentRelativePosX = 200.0f; diff --git a/src/game/behaviors/hidden_star.inc.c b/src/game/behaviors/hidden_star.inc.c index 759e3600..2432f6d0 100644 --- a/src/game/behaviors/hidden_star.inc.c +++ b/src/game/behaviors/hidden_star.inc.c @@ -4,8 +4,8 @@ void bhv_hidden_star_init(void) { s16 count = count_objects_with_behavior(bhvHiddenStarTrigger); if (count == 0) { - struct Object *star = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStar, - o->oPosX, o->oPosY, o->oPosZ, 0, 0, 0); + struct Object* star = + spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStar, o->oPosX, o->oPosY, o->oPosZ, 0, 0, 0); star->oBehParams = o->oBehParams; o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } @@ -33,7 +33,7 @@ void bhv_hidden_star_loop(void) { void bhv_hidden_star_trigger_loop(void) { if (obj_check_if_collided_with_object(o, gMarioObject) == TRUE) { - struct Object *hiddenStar = cur_obj_nearest_object_with_behavior(bhvHiddenStar); + struct Object* hiddenStar = cur_obj_nearest_object_with_behavior(bhvHiddenStar); if (hiddenStar != NULL) { hiddenStar->oHiddenStarTriggerCounter++; @@ -42,11 +42,11 @@ void bhv_hidden_star_trigger_loop(void) { spawn_orange_number(hiddenStar->oHiddenStarTriggerCounter, 0, 0, 0); } - if(ROM_JP) { + if (ROM_JP) { play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource); } else { - play_sound(SOUND_MENU_COLLECT_SECRET - + (((u8) hiddenStar->oHiddenStarTriggerCounter - 1) << 16), gGlobalSoundSource); + play_sound(SOUND_MENU_COLLECT_SECRET + (((u8)hiddenStar->oHiddenStarTriggerCounter - 1) << 16), + gGlobalSoundSource); } } diff --git a/src/game/behaviors/hoot.inc.c b/src/game/behaviors/hoot.inc.c index 238d2754..e5a7f9c1 100644 --- a/src/game/behaviors/hoot.inc.c +++ b/src/game/behaviors/hoot.inc.c @@ -11,7 +11,7 @@ void bhv_hoot_init(void) { cur_obj_become_intangible(); } -f32 hoot_find_next_floor(struct FloorGeometry **floorGeo, f32 arg1) { +f32 hoot_find_next_floor(struct FloorGeometry** floorGeo, f32 arg1) { f32 sp24 = arg1 * sins(o->oMoveAngleYaw) + o->oPosX; UNUSED f32 sp20 = o->oPosY; f32 sp1c = arg1 * coss(o->oMoveAngleYaw) + o->oPosZ; @@ -21,7 +21,7 @@ f32 hoot_find_next_floor(struct FloorGeometry **floorGeo, f32 arg1) { } void hoot_floor_bounce(void) { - struct FloorGeometry *floorGeo; + struct FloorGeometry* floorGeo; f32 floorY; floorY = hoot_find_next_floor(&floorGeo, 375.0f); @@ -45,7 +45,7 @@ void hoot_floor_bounce(void) { } void hoot_free_step(s16 fastOscY, s32 speed) { - struct FloorGeometry *floorGeo; + struct FloorGeometry* floorGeo; s16 yaw = o->oMoveAngleYaw; s16 pitch = o->oMoveAnglePitch; s16 animFrame = o->header.gfx.animInfo.animFrame; @@ -114,7 +114,7 @@ void hoot_carry_step(s32 speed, UNUSED f32 xPrev, UNUSED f32 zPrev) { } void hoot_surface_collision(f32 xPrev, UNUSED f32 yPrev, f32 zPrev) { - struct FloorGeometry *floorGeo; + struct FloorGeometry* floorGeo; struct WallCollisionData hitbox; f32 floorY; @@ -255,8 +255,8 @@ void bhv_hoot_loop(void) { case HOOT_AVAIL_WANTS_TO_TALK: hoot_awake_loop(); - if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK - && cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_044)) { + if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_UP) == MARIO_DIALOG_STATUS_SPEAK && + cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_044)) { set_mario_npc_dialog(MARIO_DIALOG_STOP); cur_obj_become_tangible(); diff --git a/src/game/behaviors/intro_lakitu.inc.c b/src/game/behaviors/intro_lakitu.inc.c index cc7859cd..213373e5 100644 --- a/src/game/behaviors/intro_lakitu.inc.c +++ b/src/game/behaviors/intro_lakitu.inc.c @@ -9,21 +9,19 @@ * Add the camera's position to `offset`, rotate the point to be relative to the camera's focus, then * set lakitu's location. */ -void intro_lakitu_set_offset_from_camera(struct Object *obj, Vec3f offset) { +void intro_lakitu_set_offset_from_camera(struct Object* obj, Vec3f offset) { f32 dist; Vec3s focusAngles; s16 offsetPitch, offsetYaw; vec3f_add(offset, gCamera->pos); - vec3f_get_dist_and_angle(gCamera->pos, gCamera->focus, - &dist, &focusAngles[0], &focusAngles[1]); + vec3f_get_dist_and_angle(gCamera->pos, gCamera->focus, &dist, &focusAngles[0], &focusAngles[1]); vec3f_get_dist_and_angle(gCamera->pos, offset, &dist, &offsetPitch, &offsetYaw); - vec3f_set_dist_and_angle(gCamera->pos, offset, dist, - focusAngles[0] + offsetPitch, focusAngles[1] + offsetYaw); + vec3f_set_dist_and_angle(gCamera->pos, offset, dist, focusAngles[0] + offsetPitch, focusAngles[1] + offsetYaw); vec3f_to_object_pos(obj, offset); } -void intro_lakitu_set_focus(struct Object *obj, Vec3f newFocus) { +void intro_lakitu_set_focus(struct Object* obj, Vec3f newFocus) { UNUSED u8 filler1[12]; Vec3f origin; f32 dist; @@ -42,16 +40,14 @@ void intro_lakitu_set_focus(struct Object *obj, Vec3f newFocus) { * Move lakitu along the spline `offset`, relative to the camera, and face him towards the corresponding * location along the spline `focus`. */ -s32 intro_lakitu_set_pos_and_focus(struct Object *obj, struct CutsceneSplinePoint offset[], +s32 intro_lakitu_set_pos_and_focus(struct Object* obj, struct CutsceneSplinePoint offset[], struct CutsceneSplinePoint focus[]) { Vec3f newOffset, newFocus; s32 splineFinished = 0; s16 splineSegment = obj->oIntroLakituSplineSegment; - if ((move_point_along_spline(newFocus, offset, &splineSegment, - &obj->oIntroLakituSplineSegmentProgress) == 1) - || (move_point_along_spline(newOffset, focus, &splineSegment, - &obj->oIntroLakituSplineSegmentProgress) == 1)) { + if ((move_point_along_spline(newFocus, offset, &splineSegment, &obj->oIntroLakituSplineSegmentProgress) == 1) || + (move_point_along_spline(newOffset, focus, &splineSegment, &obj->oIntroLakituSplineSegmentProgress) == 1)) { splineFinished++; } @@ -81,8 +77,7 @@ void bhv_intro_lakitu_loop(void) { o->oIntroLakituSplineSegment = 0.0f; o->oIntroLakituSplineSegmentProgress = 0.0f; - o->oIntroLakituCloud = - spawn_object_relative_with_scale(1, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud); + o->oIntroLakituCloud = spawn_object_relative_with_scale(1, 0, 0, 0, 2.0f, o, MODEL_MIST, bhvCloud); if (gCamera->cutscene == CUTSCENE_END_WAVING) { o->oAction = 100; @@ -167,7 +162,7 @@ void bhv_intro_lakitu_loop(void) { o->oFaceAnglePitch = atan2s(200.0f, o->oPosY - 400.0f); o->oFaceAngleYaw = approach_s16_asymptotic(o->oFaceAngleYaw, o->oMoveAngleYaw + 0x8000, 4); vec3f_set_dist_and_angle(sp58, sp4C, o->oIntroLakituUnk100, 0, o->oMoveAngleYaw); - sp4C[1] += 150.0f * coss((s16) o->oIntroLakituUnk104); + sp4C[1] += 150.0f * coss((s16)o->oIntroLakituUnk104); o->oIntroLakituUnk104 += o->oIntroLakituUnk108; o->oIntroLakituUnk108 = approach_f32_asymptotic(o->oIntroLakituUnk108, 512.0f, 0.05f); sp4C[0] += o->oIntroLakituUnk10C; @@ -213,8 +208,8 @@ void bhv_intro_lakitu_loop(void) { o->oForwardVel = approach_f32_asymptotic(o->oForwardVel, -10.0f, 0.05f); o->oMoveAngleYaw += 0x78; o->oMoveAnglePitch += 0x40; - o->oFaceAngleYaw = camera_approach_s16_symmetric( - o->oFaceAngleYaw, calculate_yaw(sp4C, gCamera->pos), 0x200); + o->oFaceAngleYaw = + camera_approach_s16_symmetric(o->oFaceAngleYaw, calculate_yaw(sp4C, gCamera->pos), 0x200); } if (o->oTimer > 105) { @@ -231,8 +226,8 @@ void bhv_intro_lakitu_loop(void) { object_pos_to_vec3f(sp4C, o); o->oForwardVel = approach_f32_asymptotic(o->oForwardVel, 60.0f, 0.05f); - o->oFaceAngleYaw = camera_approach_s16_symmetric( - o->oFaceAngleYaw, calculate_yaw(sp4C, gCamera->pos), 0x200); + o->oFaceAngleYaw = + camera_approach_s16_symmetric(o->oFaceAngleYaw, calculate_yaw(sp4C, gCamera->pos), 0x200); if (o->oTimer < 62) { o->oMoveAngleYaw = approach_s16_asymptotic(o->oMoveAngleYaw, 0x1800, 0x1E); diff --git a/src/game/behaviors/intro_peach.inc.c b/src/game/behaviors/intro_peach.inc.c index 551b3108..c7d0fa72 100644 --- a/src/game/behaviors/intro_peach.inc.c +++ b/src/game/behaviors/intro_peach.inc.c @@ -4,15 +4,14 @@ * Set peach's location relative to the camera focus. * If nonzero, make peach's opacity approach targetOpacity by increment */ -void intro_peach_set_pos_and_opacity(struct Object *obj, f32 targetOpacity, f32 increment) { +void intro_peach_set_pos_and_opacity(struct Object* obj, f32 targetOpacity, f32 increment) { Vec3f newPos; s16 focusPitch, focusYaw; f32 UNUSED dist, newOpacity; vec3f_get_dist_and_angle(gLakituState.pos, gLakituState.focus, &dist, &focusPitch, &focusYaw); vec3f_set_dist_and_angle(gLakituState.pos, newPos, obj->oIntroPeachDistToCamera, - obj->oIntroPeachPitchFromFocus + focusPitch, - obj->oIntroPeachYawFromFocus + focusYaw); + obj->oIntroPeachPitchFromFocus + focusPitch, obj->oIntroPeachYawFromFocus + focusYaw); vec3f_to_object_pos(obj, newPos); newOpacity = obj->oOpacity; diff --git a/src/game/behaviors/intro_scene.inc.c b/src/game/behaviors/intro_scene.inc.c index 42d5e806..0b36197e 100644 --- a/src/game/behaviors/intro_scene.inc.c +++ b/src/game/behaviors/intro_scene.inc.c @@ -1,9 +1,9 @@ // intro_scene.inc.c -void spawn_child_obj_relative(struct Object *parent, s16 xOffset, s16 yOffset, s16 zOffset, - s16 pitchOffset, s16 yawOffset, s16 rollOffset, - s16 forwardVel, s32 model, const BehaviorScript *behavior) { - struct Object *obj = spawn_object(parent, model, behavior); +void spawn_child_obj_relative(struct Object* parent, s16 xOffset, s16 yOffset, s16 zOffset, s16 pitchOffset, + s16 yawOffset, s16 rollOffset, s16 forwardVel, s32 model, + const BehaviorScript* behavior) { + struct Object* obj = spawn_object(parent, model, behavior); obj->header.gfx.animInfo.animFrame = random_float() * 6.0f; obj->oEndBirdUnk104 = sCutsceneVars[9].point[0]; @@ -25,7 +25,7 @@ void spawn_child_obj_relative(struct Object *parent, s16 xOffset, s16 yOffset, s } void bhv_intro_scene_loop(void) { - UNUSED struct Object *obj; + UNUSED struct Object* obj; if (gCutsceneObjSpawn != 0) { o->oPosX = gCamera->pos[0]; @@ -45,40 +45,26 @@ void bhv_intro_scene_loop(void) { break; case 7: - spawn_child_obj_relative( - o, 0, 205, 500, 0x1000, 0x6000, -0x1E00, 25, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, 0, 205, 800, 0x1800, 0x6000, -0x1400, 35, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, -100, 300, 500, 0x800, 0x6000, 0, 25, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, 100, -200, 800, 0, 0x4000, 0x1400, 45, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, -80, 300, 350, 0x1800, 0x5000, 0xA00, 35, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, -300, 300, 500, 0x800, 0x6000, 0x2800, 25, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, -400, -200, 800, 0, 0x4000, -0x1400, 45, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, 0, 205, 500, 0x1000, 0x6000, -0x1E00, 25, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, 0, 205, 800, 0x1800, 0x6000, -0x1400, 35, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, -100, 300, 500, 0x800, 0x6000, 0, 25, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, 100, -200, 800, 0, 0x4000, 0x1400, 45, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, -80, 300, 350, 0x1800, 0x5000, 0xA00, 35, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, -300, 300, 500, 0x800, 0x6000, 0x2800, 25, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, -400, -200, 800, 0, 0x4000, -0x1400, 45, MODEL_BIRDS, bhvEndBirds1); break; case 9: - spawn_child_obj_relative( - o, 50, 205, 500, 0x1000, 0x6000, 0, 35, MODEL_BIRDS, bhvEndBirds1); - spawn_child_obj_relative( - o, 0, 285, 800, 0x1800, 0x6000, 0, 35, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, 50, 205, 500, 0x1000, 0x6000, 0, 35, MODEL_BIRDS, bhvEndBirds1); + spawn_child_obj_relative(o, 0, 285, 800, 0x1800, 0x6000, 0, 35, MODEL_BIRDS, bhvEndBirds1); break; case 8: - spawn_child_obj_relative( - o, -100, -100, -700, 0, 0, -0xF00, 25, MODEL_BIRDS, bhvEndBirds2); - spawn_child_obj_relative( - o, -250, 255, -200, 0, 0, -0x1400, 25, MODEL_BIRDS, bhvEndBirds2); - spawn_child_obj_relative( - o, -100, 155, -600, 0, 0, -0x500, 35, MODEL_BIRDS, bhvEndBirds2); - spawn_child_obj_relative( - o, 250, 200, -1200, 0, 0, -0x700, 25, MODEL_BIRDS, bhvEndBirds2); - spawn_child_obj_relative( - o, -250, 255, -700, 0, 0, 0, 25, MODEL_BIRDS, bhvEndBirds2); + spawn_child_obj_relative(o, -100, -100, -700, 0, 0, -0xF00, 25, MODEL_BIRDS, bhvEndBirds2); + spawn_child_obj_relative(o, -250, 255, -200, 0, 0, -0x1400, 25, MODEL_BIRDS, bhvEndBirds2); + spawn_child_obj_relative(o, -100, 155, -600, 0, 0, -0x500, 35, MODEL_BIRDS, bhvEndBirds2); + spawn_child_obj_relative(o, 250, 200, -1200, 0, 0, -0x700, 25, MODEL_BIRDS, bhvEndBirds2); + spawn_child_obj_relative(o, -250, 255, -700, 0, 0, 0, 25, MODEL_BIRDS, bhvEndBirds2); break; } diff --git a/src/game/behaviors/jrb_ship.inc.c b/src/game/behaviors/jrb_ship.inc.c index 0918d8d0..adf72640 100644 --- a/src/game/behaviors/jrb_ship.inc.c +++ b/src/game/behaviors/jrb_ship.inc.c @@ -45,8 +45,8 @@ void bhv_jrb_sliding_box_loop(void) { Vec3f sp54; Vec3f sp48; Vec3s sp40; - struct Object *sp3C; - struct Surface *sp38; + struct Object* sp3C; + struct Surface* sp38; UNUSED Vec3f sp2C; Vec3f sp20; s16 sp1E; diff --git a/src/game/behaviors/kickable_board.inc.c b/src/game/behaviors/kickable_board.inc.c index 87cf7466..f28932ed 100644 --- a/src/game/behaviors/kickable_board.inc.c +++ b/src/game/behaviors/kickable_board.inc.c @@ -1,8 +1,8 @@ // kickable_board.inc.c s32 check_mario_attacking(UNUSED s32 unused) { - if (obj_check_if_collided_with_object(o, gMarioObject) - && abs_angle_diff(o->oMoveAngleYaw, gMarioObject->oMoveAngleYaw) > 0x6000) { + if (obj_check_if_collided_with_object(o, gMarioObject) && + abs_angle_diff(o->oMoveAngleYaw, gMarioObject->oMoveAngleYaw) > 0x6000) { if (gMarioStates[0].action == ACT_SLIDE_KICK) { return 1; } diff --git a/src/game/behaviors/king_bobomb.inc.c b/src/game/behaviors/king_bobomb.inc.c index e530658c..f6f2b2ff 100644 --- a/src/game/behaviors/king_bobomb.inc.c +++ b/src/game/behaviors/king_bobomb.inc.c @@ -1,10 +1,10 @@ // king_bobomb.inc.c // Copy of geo_update_projectile_pos_from_parent -Gfx *geo_update_held_mario_pos(s32 run, UNUSED struct GraphNode *node, Mat4 mtx) { +Gfx* geo_update_held_mario_pos(s32 run, UNUSED struct GraphNode* node, Mat4 mtx) { if (run == TRUE) { Mat4 sp20; - struct Object *sp1C = (struct Object *) gCurGraphNodeObject; + struct Object* sp1C = (struct Object*)gCurGraphNodeObject; if (sp1C->prevObj != NULL) { create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr); obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj); @@ -20,7 +20,7 @@ void bhv_bobomb_anchor_mario_loop(void) { } void king_bobomb_act_0(void) { - if(!ROM_JP) { + if (!ROM_JP) { o->oForwardVel = 0.0f; o->oVelY = 0.0f; } @@ -36,8 +36,8 @@ void king_bobomb_act_0(void) { o->oSubAction++; seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40); } - } else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_017)) { + } else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, + DIALOG_017)) { o->oAction = 2; o->oFlags |= OBJ_FLAG_HOLDABLE; } @@ -200,8 +200,8 @@ void king_bobomb_act_6(void) { void king_bobomb_act_7(void) { cur_obj_init_animation_with_sound(2); - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, DIALOG_116)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, + DIALOG_116)) { create_sound_spawner(SOUND_OBJ_KING_WHOMP_DEATH); cur_obj_hide(); @@ -211,7 +211,7 @@ void king_bobomb_act_7(void) { spawn_triangle_break_particles(20, MODEL_DIRT_ANIMATION, 3.0f, 4); cur_obj_shake_screen(SHAKE_POS_SMALL); - if(ROM_JP) { + if (ROM_JP) { o->oPosY += 100.0f; spawn_default_star(2000.0f, 4500.0f, -4500.0f); } else { @@ -228,7 +228,7 @@ void king_bobomb_act_8(void) { } } -void king_bobomb_act_4(void) { // bobomb been thrown +void king_bobomb_act_4(void) { // bobomb been thrown if (o->oPosY - o->oHomeY > -100.0f) { // not thrown off hill if (o->oMoveFlags & OBJ_MOVE_LANDED) { o->oHealth--; @@ -319,8 +319,8 @@ void king_bobomb_act_5(void) { // bobomb returns home break; case 4: - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_128)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, + DIALOG_128)) { o->oAction = 2; } break; @@ -328,15 +328,8 @@ void king_bobomb_act_5(void) { // bobomb returns home } void (*sKingBobombActions[])(void) = { - king_bobomb_act_0, - king_bobomb_act_1, - king_bobomb_act_2, - king_bobomb_act_3, - king_bobomb_act_4, - king_bobomb_act_5, - king_bobomb_act_6, - king_bobomb_act_7, - king_bobomb_act_8, + king_bobomb_act_0, king_bobomb_act_1, king_bobomb_act_2, king_bobomb_act_3, king_bobomb_act_4, + king_bobomb_act_5, king_bobomb_act_6, king_bobomb_act_7, king_bobomb_act_8, }; struct SoundState sKingBobombSoundStates[] = { diff --git a/src/game/behaviors/klepto.inc.c b/src/game/behaviors/klepto.inc.c index 9a1e10b3..56754e2a 100644 --- a/src/game/behaviors/klepto.inc.c +++ b/src/game/behaviors/klepto.inc.c @@ -126,9 +126,8 @@ static void klepto_change_target(void) { } static void klepto_circle_target(f32 radius, f32 targetSpeed) { - if (o->oAnimState != KLEPTO_ANIM_STATE_HOLDING_NOTHING - && ((o->oTimer > 60 && o->oDistanceToMario > 2000.0f) - || o->oTimer >= o->oKleptoTimeUntilTargetChange)) { + if (o->oAnimState != KLEPTO_ANIM_STATE_HOLDING_NOTHING && + ((o->oTimer > 60 && o->oDistanceToMario > 2000.0f) || o->oTimer >= o->oKleptoTimeUntilTargetChange)) { klepto_change_target(); o->oKleptoTimeUntilTargetChange = random_linear_offset(300, 300); o->oAction = KLEPTO_ACT_APPROACH_TARGET_HOLDING; @@ -145,8 +144,7 @@ static void klepto_circle_target(f32 radius, f32 targetSpeed) { //! The multiplied value is sometimes out of range for an s16 during the s32 -> s16 cast, // which might invert sign. - turnAmount = (s16)(s32)(abs_angle_diff(o->oKleptoYawToTarget, o->oMoveAngleYaw) - * (0.03f * o->oKleptoSpeed)); + turnAmount = (s16)(s32)(abs_angle_diff(o->oKleptoYawToTarget, o->oMoveAngleYaw) * (0.03f * o->oKleptoSpeed)); clamp_s16(&turnAmount, 400, 700); obj_rotate_yaw_and_bounce_off_walls(o->oKleptoYawToTarget, turnAmount); @@ -189,9 +187,9 @@ static void klepto_act_wait_for_mario(void) { static void klepto_act_turn_toward_mario(void) { klepto_target_mario(); - if (klepto_set_and_check_if_anim_at_end() && cur_obj_check_if_at_animation_end() - && o->oKleptoDistanceToTarget > 800.0f - && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x800 && o->oKleptoUnk1B0 < 0x400) { + if (klepto_set_and_check_if_anim_at_end() && cur_obj_check_if_at_animation_end() && + o->oKleptoDistanceToTarget > 800.0f && abs_angle_diff(o->oAngleToMario, o->oFaceAngleYaw) < 0x800 && + o->oKleptoUnk1B0 < 0x400) { cur_obj_play_sound_2(SOUND_OBJ_KLEPTO1); o->oAction = KLEPTO_ACT_DIVE_AT_MARIO; o->oMoveAngleYaw = o->oFaceAngleYaw; @@ -241,10 +239,9 @@ static void klepto_act_dive_at_mario(void) { } } - if (gMarioStates[0].action != ACT_SLEEPING - && !(gMarioStates[0].action & (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE)) - && o->oDistanceToMario < 200.0f && dy > 50.0f && dy < 90.0f - && mario_lose_cap_to_enemy(1)) { + if (gMarioStates[0].action != ACT_SLEEPING && + !(gMarioStates[0].action & (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE)) && + o->oDistanceToMario < 200.0f && dy > 50.0f && dy < 90.0f && mario_lose_cap_to_enemy(1)) { o->oAnimState = KLEPTO_ANIM_STATE_HOLDING_CAP; } } @@ -284,8 +281,7 @@ static void klepto_act_retreat(void) { obj_face_pitch_approach(o->oMoveAnglePitch, 1000); obj_rotate_yaw_and_bounce_off_walls(o->oKleptoYawToTarget, 600); - if (obj_face_yaw_approach(o->oMoveAngleYaw, 1000) - && abs_angle_diff(o->oFaceAnglePitch, o->oMoveAnglePitch) == 0) { + if (obj_face_yaw_approach(o->oMoveAngleYaw, 1000) && abs_angle_diff(o->oFaceAnglePitch, o->oMoveAnglePitch) == 0) { o->oAction = KLEPTO_ACT_RESET_POSITION; o->oHomeY = 1500.0f; o->oKleptoUnk1AE = -100; @@ -375,9 +371,8 @@ void bhv_klepto_update(void) { o->oFlags &= ~OBJ_FLAG_SET_FACE_YAW_TO_MOVE_YAW; cur_obj_become_intangible(); - } else if (gMarioStates[0].action == ACT_SLEEPING - || (gMarioStates[0].action - & (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE))) { + } else if (gMarioStates[0].action == ACT_SLEEPING || + (gMarioStates[0].action & (ACT_FLAG_SHORT_HITBOX | ACT_FLAG_BUTT_OR_STOMACH_SLIDE))) { cur_obj_become_intangible(); } else { cur_obj_become_tangible(); diff --git a/src/game/behaviors/koopa.inc.c b/src/game/behaviors/koopa.inc.c index 04b345c9..51ee4539 100644 --- a/src/game/behaviors/koopa.inc.c +++ b/src/game/behaviors/koopa.inc.c @@ -53,7 +53,7 @@ static u8 sKoopaShelledAttackHandlers[] = { struct KoopaTheQuickProperties { s16 initText; s16 winText; - Trajectory const *path; + Trajectory const* path; Vec3s starPos; }; @@ -106,8 +106,7 @@ static void koopa_play_footstep_sound(s8 animFrame1, s8 animFrame2) { * running away. */ static s32 koopa_check_run_from_mario(void) { - if (o->oKoopaDistanceToMario < 300.0f - && abs_angle_diff(o->oKoopaAngleToMario, o->oMoveAngleYaw) < 0x3000) { + if (o->oKoopaDistanceToMario < 300.0f && abs_angle_diff(o->oKoopaAngleToMario, o->oMoveAngleYaw) < 0x3000) { o->oAction = KOOPA_SHELLED_ACT_RUN_FROM_MARIO; return TRUE; } @@ -123,7 +122,7 @@ static void koopa_shelled_act_stopped(void) { o->oForwardVel = 0.0f; if (cur_obj_init_anim_and_check_if_end(7)) { o->oAction = KOOPA_SHELLED_ACT_WALK; - o->oKoopaTargetYaw = o->oMoveAngleYaw + 0x2000 * (s16) random_sign(); + o->oKoopaTargetYaw = o->oMoveAngleYaw + 0x2000 * (s16)random_sign(); } } @@ -329,7 +328,7 @@ static void koopa_shelled_update(void) { */ static void koopa_unshelled_act_run(void) { f32 distToShell = 99999.0f; - struct Object *shell; + struct Object* shell; cur_obj_init_animation_with_sound(3); koopa_play_footstep_sound(0, 6); @@ -347,8 +346,7 @@ static void koopa_unshelled_act_run(void) { if (shell != NULL) { //! This overrides turning toward home o->oKoopaTargetYaw = obj_angle_to_object(o, shell); - } else if (!(o->oKoopaTurningAwayFromWall = - obj_bounce_off_walls_edges_objects(&o->oKoopaTargetYaw))) { + } else if (!(o->oKoopaTurningAwayFromWall = obj_bounce_off_walls_edges_objects(&o->oKoopaTargetYaw))) { // Otherwise run around randomly if (o->oKoopaUnshelledTimeUntilTurn != 0) { o->oKoopaUnshelledTimeUntilTurn--; @@ -359,9 +357,8 @@ static void koopa_unshelled_act_run(void) { // If mario is far away, or our running away from mario coincides with // running toward the shell - if (o->oDistanceToMario > 800.0f - || (shell != NULL - && abs_angle_diff(o->oKoopaTargetYaw, o->oAngleToMario + 0x8000) < 0x2000)) { + if (o->oDistanceToMario > 800.0f || + (shell != NULL && abs_angle_diff(o->oKoopaTargetYaw, o->oAngleToMario + 0x8000) < 0x2000)) { // then turn toward the shell cur_obj_rotate_yaw_toward(o->oKoopaTargetYaw, 0x600); } else { @@ -371,8 +368,8 @@ static void koopa_unshelled_act_run(void) { } // If we think we have a shot, dive for the shell - if (obj_forward_vel_approach(20.0f, 1.0f) && distToShell < 600.0f - && abs_angle_diff(o->oKoopaTargetYaw, o->oMoveAngleYaw) < 0xC00) { + if (obj_forward_vel_approach(20.0f, 1.0f) && distToShell < 600.0f && + abs_angle_diff(o->oKoopaTargetYaw, o->oMoveAngleYaw) < 0xC00) { o->oMoveAngleYaw = o->oKoopaTargetYaw; o->oAction = KOOPA_UNSHELLED_ACT_DIVE; o->oForwardVel *= 1.2f; @@ -386,7 +383,7 @@ static void koopa_unshelled_act_run(void) { * and otherwise enter the running action. */ static void koopa_unshelled_act_dive(void) { - struct Object *shell; + struct Object* shell; f32 distToShell; if (o->oTimer > 10) { @@ -404,8 +401,7 @@ static void koopa_unshelled_act_dive(void) { // units behind mario. // Using this, we can get the koopa to pick up and despawn its shell // while mario is riding it. - if (shell != NULL && dist_between_objects(shell, gMarioObject) > 200.0f - && distToShell < 50.0f) { + if (shell != NULL && dist_between_objects(shell, gMarioObject) > 200.0f && distToShell < 50.0f) { o->oKoopaMovementType = KOOPA_BP_NORMAL; o->oAction = KOOPA_SHELLED_ACT_LYING; o->oForwardVel *= 0.5f; @@ -516,8 +512,7 @@ static void koopa_the_quick_act_wait_before_race(void) { * return to the waiting action. */ static void koopa_the_quick_act_show_init_text(void) { - s32 response = obj_update_race_proposition_dialog( - sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].initText); + s32 response = obj_update_race_proposition_dialog(sKoopaTheQuickProperties[o->oKoopaTheQuickRaceIndex].initText); if (response == DIALOG_RESPONSE_YES) { UNUSED u8 filler[4]; @@ -543,7 +538,7 @@ static void koopa_the_quick_act_show_init_text(void) { * indicate that the ball is likely to collide. */ static s32 koopa_the_quick_detect_bowling_ball(void) { - struct Object *ball; + struct Object* ball; f32 distToBall; ball = cur_obj_find_nearest_object_with_behavior(bhvBowlingBall, &distToBall); @@ -603,7 +598,7 @@ static void koopa_the_quick_act_race(void) { f32 downhillSteepness; s32 bowlingBallStatus; - downhillSteepness = 1.0f + sins((s16)(f32) o->oPathedTargetPitch); + downhillSteepness = 1.0f + sins((s16)(f32)o->oPathedTargetPitch); cur_obj_rotate_yaw_toward(o->oPathedTargetYaw, (s32)(o->oKoopaAgility * 150.0f)); switch (o->oSubAction) { @@ -614,8 +609,8 @@ static void koopa_the_quick_act_race(void) { case KOOPA_THE_QUICK_SUB_ACT_RUN: koopa_the_quick_animate_footsteps(); - if (o->parentObj->oKoopaRaceEndpointRaceStatus != 0 && o->oDistanceToMario > 1500.0f - && (o->oPathedPrevWaypointFlags & WAYPOINT_MASK_00FF) < 28) { + if (o->parentObj->oKoopaRaceEndpointRaceStatus != 0 && o->oDistanceToMario > 1500.0f && + (o->oPathedPrevWaypointFlags & WAYPOINT_MASK_00FF) < 28) { // Move faster if mario has already finished the race or // cheated by shooting from cannon o->oKoopaAgility = 8.0f; @@ -625,8 +620,7 @@ static void koopa_the_quick_act_race(void) { o->oKoopaAgility = 4.0f; } - obj_forward_vel_approach(o->oKoopaAgility * 6.0f * downhillSteepness, - o->oKoopaAgility * 0.1f); + obj_forward_vel_approach(o->oKoopaAgility * 6.0f * downhillSteepness, o->oKoopaAgility * 0.1f); // Move upward if we hit a wall, to climb it if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) { @@ -643,8 +637,7 @@ static void koopa_the_quick_act_race(void) { o->oForwardVel = 0.0f; } - if (bowlingBallStatus != 0 - || (o->oPathedPrevWaypointFlags & WAYPOINT_MASK_00FF) >= 8) { + if (bowlingBallStatus != 0 || (o->oPathedPrevWaypointFlags & WAYPOINT_MASK_00FF) >= 8) { o->oVelY = 80.0f; } else { o->oVelY = 40.0f; @@ -731,8 +724,8 @@ static void koopa_the_quick_act_after_race(void) { o->oFlags &= ~OBJ_FLAG_ACTIVE_FROM_AFAR; } } else if (o->parentObj->oKoopaRaceEndpointDialog > 0) { - s32 dialogResponse = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->parentObj->oKoopaRaceEndpointDialog); + s32 dialogResponse = cur_obj_update_dialog_with_cutscene( + MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->parentObj->oKoopaRaceEndpointDialog); if (dialogResponse != 0) { o->parentObj->oKoopaRaceEndpointDialog = DIALOG_NONE; o->oTimer = 0; diff --git a/src/game/behaviors/koopa_shell.inc.c b/src/game/behaviors/koopa_shell.inc.c index dec89024..cdd7f9a9 100644 --- a/src/game/behaviors/koopa_shell.inc.c +++ b/src/game/behaviors/koopa_shell.inc.c @@ -18,8 +18,7 @@ void koopa_shell_spawn_water_drop(void) { spawn_object(o, MODEL_WAVE_TRAIL, bhvObjectWaveTrail); if (gMarioStates[0].forwardVel > 10.0f) { - struct Object *drop = spawn_object_with_scale(o, MODEL_WHITE_PARTICLE_SMALL, - bhvWaterDroplet, 1.5f); + struct Object* drop = spawn_object_with_scale(o, MODEL_WHITE_PARTICLE_SMALL, bhvWaterDroplet, 1.5f); drop->oVelY = random_float() * 30.0f; obj_translate_xz_random(drop, 110.0f); } @@ -54,12 +53,12 @@ void bhv_koopa_shell_flame_spawn(void) { } void koopa_shell_spawn_sparkles(f32 a) { - struct Object *sp1C = spawn_object(o, MODEL_NONE, bhvSparkleSpawn); + struct Object* sp1C = spawn_object(o, MODEL_NONE, bhvSparkleSpawn); sp1C->oPosY += a; } void bhv_koopa_shell_loop(void) { - struct Surface *sp34; + struct Surface* sp34; obj_set_hitbox(o, &sKoopaShellHitbox); cur_obj_scale(1.0f); diff --git a/src/game/behaviors/lll_floating_wood_piece.inc.c b/src/game/behaviors/lll_floating_wood_piece.inc.c index 6abb42a1..15acd6a0 100644 --- a/src/game/behaviors/lll_floating_wood_piece.inc.c +++ b/src/game/behaviors/lll_floating_wood_piece.inc.c @@ -14,15 +14,14 @@ void bhv_lll_wood_piece_loop(void) { } void bhv_lll_floating_wood_bridge_loop(void) { - struct Object *sp3C; + struct Object* sp3C; s32 i; switch (o->oAction) { case 0: if (o->oDistanceToMario < 2500.0f) { for (i = 1; i < 4; i++) { - sp3C = spawn_object_relative(0, (i - 2) * 300, 0, 0, o, - MODEL_LLL_WOOD_BRIDGE, bhvLllWoodPiece); + sp3C = spawn_object_relative(0, (i - 2) * 300, 0, 0, o, MODEL_LLL_WOOD_BRIDGE, bhvLllWoodPiece); sp3C->oLllWoodPieceOscillationTimer = i * 0x1000; } o->oAction = 1; diff --git a/src/game/behaviors/lll_hexagonal_ring.inc.c b/src/game/behaviors/lll_hexagonal_ring.inc.c index 28a34565..fee5bbdb 100644 --- a/src/game/behaviors/lll_hexagonal_ring.inc.c +++ b/src/game/behaviors/lll_hexagonal_ring.inc.c @@ -1,11 +1,11 @@ // lll_hexagonal_ring.inc.c void hexagonal_ring_spawn_flames(void) { - struct Object *sp1C = spawn_object(o, MODEL_RED_FLAME, bhvVolcanoFlames); + struct Object* sp1C = spawn_object(o, MODEL_RED_FLAME, bhvVolcanoFlames); f32 size; sp1C->oPosY += 550.0f; - sp1C->oMoveAngleYaw = (s16) random_u16(); + sp1C->oMoveAngleYaw = (s16)random_u16(); sp1C->oForwardVel = random_float() * 40.0f + 20.0f; sp1C->oVelY = random_float() * 50.0f + 10.0f; diff --git a/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c b/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c index 054723fd..182dde30 100644 --- a/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c +++ b/src/game/behaviors/lll_octagonal_rotating_mesh.inc.c @@ -2,11 +2,12 @@ s16 D_8032F860[] = { 2, 30, 0x4000, 0, 1, 220, 900, 30, 1, 30, 0, -30, 2, 30, -0x4000, 0, 1, 220, 900, 30, 1, 30, 0, -30, 3, 0 }; -s16 D_8032F894[] = { 4, 0, 0, 0, 1, 475, 900, 30, 1, 30, 0, -30, 2, - 30, 0x8000, 0, 1, 475, 900, 30, 1, 30, 0, -30, 3, 0 }; -s16 *D_8032F8C8[] = { D_8032F860, D_8032F894 }; +s16 D_8032F894[] = { + 4, 0, 0, 0, 1, 475, 900, 30, 1, 30, 0, -30, 2, 30, 0x8000, 0, 1, 475, 900, 30, 1, 30, 0, -30, 3, 0 +}; +s16* D_8032F8C8[] = { D_8032F860, D_8032F894 }; -s32 lll_octagonal_mesh_move(s16 *a0, s32 a1) { +s32 lll_octagonal_mesh_move(s16* a0, s32 a1) { switch (a0[a1]) { case 4: o->oMoveAngleYaw = a0[a1 + 2]; @@ -43,7 +44,7 @@ s32 lll_octagonal_mesh_move(s16 *a0, s32 a1) { return a1; } -s32 lll_octagonal_mesh_find_y_offset(s32 *a0, f32 *a1, s32 a2, s32 a3) { +s32 lll_octagonal_mesh_find_y_offset(s32* a0, f32* a1, s32 a2, s32 a3) { if (cur_obj_is_mario_on_platform()) { if (a0[0] < 0x4000) { a0[0] += a2; @@ -79,8 +80,7 @@ void bhv_lll_moving_octagonal_mesh_platform_loop(void) { print_debug_top_down_objectinfo("number %d\n", o->oHorizontalMovementUnkF8); cur_obj_move_using_fvel_and_gravity(); - if (lll_octagonal_mesh_find_y_offset(&o->oHorizontalMovementUnk104, - &o->oHorizontalMovementUnk108, 0x400, -80)) { + if (lll_octagonal_mesh_find_y_offset(&o->oHorizontalMovementUnk104, &o->oHorizontalMovementUnk108, 0x400, -80)) { o->oHorizontalMovementUnkF4 += 0x800; o->oHorizontalMovementUnk100 -= sins(o->oHorizontalMovementUnkF4) * 2; } diff --git a/src/game/behaviors/lll_rotating_hex_flame.inc.c b/src/game/behaviors/lll_rotating_hex_flame.inc.c index 4637f317..d9f1d1c6 100644 --- a/src/game/behaviors/lll_rotating_hex_flame.inc.c +++ b/src/game/behaviors/lll_rotating_hex_flame.inc.c @@ -14,7 +14,7 @@ void bhv_lll_rotating_hex_flame_loop(void) { } void fire_bar_spawn_flames(s16 a0) { - struct Object *sp2C; + struct Object* sp2C; UNUSED u8 filler[4]; s32 i; s32 sp20; diff --git a/src/game/behaviors/lll_sinking_rock_block.inc.c b/src/game/behaviors/lll_sinking_rock_block.inc.c index d057abe2..2d4036ca 100644 --- a/src/game/behaviors/lll_sinking_rock_block.inc.c +++ b/src/game/behaviors/lll_sinking_rock_block.inc.c @@ -1,8 +1,7 @@ // lll_sinking_rock_block.inc.c void bhv_lll_sinking_rock_block_loop(void) { - lll_octagonal_mesh_find_y_offset(&o->oSinkWhenSteppedOnUnk104, - &o->oSinkWhenSteppedOnUnk108, 124, -110); + lll_octagonal_mesh_find_y_offset(&o->oSinkWhenSteppedOnUnk104, &o->oSinkWhenSteppedOnUnk108, 124, -110); o->oGraphYOffset = 0.0f; o->oPosY = o->oHomeY + o->oSinkWhenSteppedOnUnk108; } diff --git a/src/game/behaviors/lll_volcano_flames.inc.c b/src/game/behaviors/lll_volcano_flames.inc.c index 204521b3..56f2487a 100644 --- a/src/game/behaviors/lll_volcano_flames.inc.c +++ b/src/game/behaviors/lll_volcano_flames.inc.c @@ -9,8 +9,7 @@ void bhv_volcano_flames_loop(void) { cur_obj_move_y(-4.0f, -0.7f, 2.0f); - if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE - | OBJ_MOVE_UNDERWATER_OFF_GROUND)) { + if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_UNDERWATER_OFF_GROUND)) { obj_mark_for_deletion(o); } } diff --git a/src/game/behaviors/manta_ray.inc.c b/src/game/behaviors/manta_ray.inc.c index eb9848ce..3cb8e0e4 100644 --- a/src/game/behaviors/manta_ray.inc.c +++ b/src/game/behaviors/manta_ray.inc.c @@ -7,11 +7,11 @@ */ static Trajectory sMantaRayTraj[] = { - TRAJECTORY_POS(0, /*pos*/ -4500, -1380, -40), - TRAJECTORY_POS(1, /*pos*/ -4120, -2240, 740), - TRAJECTORY_POS(2, /*pos*/ -3280, -3080, 1040), - TRAJECTORY_POS(3, /*pos*/ -2240, -3320, 720), - TRAJECTORY_POS(4, /*pos*/ -1840, -3140, -280), + TRAJECTORY_POS(0, /*pos*/ -4500, -1380, -40), + TRAJECTORY_POS(1, /*pos*/ -4120, -2240, 740), + TRAJECTORY_POS(2, /*pos*/ -3280, -3080, 1040), + TRAJECTORY_POS(3, /*pos*/ -2240, -3320, 720), + TRAJECTORY_POS(4, /*pos*/ -1840, -3140, -280), TRAJECTORY_POS(5, /*pos*/ -2320, -2480, -1100), TRAJECTORY_POS(6, /*pos*/ -3220, -1600, -1360), TRAJECTORY_POS(7, /*pos*/ -4180, -1020, -1040), @@ -34,7 +34,7 @@ static struct ObjectHitbox sMantaRayHitbox = { * Initializes the manta ray when spawned. */ void bhv_manta_ray_init(void) { - struct Object *ringManager = spawn_object(o, MODEL_NONE, bhvMantaRayRingManager); + struct Object* ringManager = spawn_object(o, MODEL_NONE, bhvMantaRayRingManager); o->parentObj = ringManager; obj_set_hitbox(o, &sMantaRayHitbox); cur_obj_scale(2.5f); @@ -44,18 +44,18 @@ static void manta_ray_move(void) { s16 animFrame = o->header.gfx.animInfo.animFrame; s32 pathStatus = 0; - o->oPathedStartWaypoint = (struct Waypoint *) sMantaRayTraj; + o->oPathedStartWaypoint = (struct Waypoint*)sMantaRayTraj; pathStatus = cur_obj_follow_path(pathStatus); - o->oMantaTargetYaw = o->oPathedTargetYaw; + o->oMantaTargetYaw = o->oPathedTargetYaw; o->oMantaTargetPitch = o->oPathedTargetPitch; o->oForwardVel = 10.0f; - o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oMantaTargetYaw, 0x80); + o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, o->oMantaTargetYaw, 0x80); o->oMoveAnglePitch = approach_s16_symmetric(o->oMoveAnglePitch, o->oMantaTargetPitch, 0x80); // This causes the ray to tilt as it turns. - if ((s16) o->oMantaTargetYaw != (s16) o->oMoveAngleYaw) { + if ((s16)o->oMantaTargetYaw != (s16)o->oMoveAngleYaw) { o->oMoveAngleRoll -= 91; if (o->oMoveAngleRoll < -5461.3332) { o->oMoveAngleRoll = -0x4000 / 3; @@ -74,14 +74,14 @@ static void manta_ray_move(void) { } static void manta_ray_act_spawn_ring(void) { - struct Object *ringManager = o->parentObj; + struct Object* ringManager = o->parentObj; if (o->oTimer == 300) { o->oTimer = 0; } if (o->oTimer == 0 || o->oTimer == 50 || o->oTimer == 150 || o->oTimer == 200 || o->oTimer == 250) { - struct Object *ring = spawn_object(o, MODEL_WATER_RING, bhvMantaRayWaterRing); + struct Object* ring = spawn_object(o, MODEL_WATER_RING, bhvMantaRayWaterRing); ring->oFaceAngleYaw = o->oMoveAngleYaw; ring->oFaceAnglePitch = o->oMoveAnglePitch + 0x4000; diff --git a/src/game/behaviors/metal_box.inc.c b/src/game/behaviors/metal_box.inc.c index c0dddc60..b8f4770b 100644 --- a/src/game/behaviors/metal_box.inc.c +++ b/src/game/behaviors/metal_box.inc.c @@ -13,7 +13,7 @@ struct ObjectHitbox sMetalBoxHitbox = { }; s32 check_if_moving_over_floor(f32 a0, f32 a1) { - struct Surface *sp24; + struct Surface* sp24; f32 sp20 = o->oPosX + sins(o->oMoveAngleYaw) * a1; f32 floorHeight; f32 sp18 = o->oPosZ + coss(o->oMoveAngleYaw) * a1; @@ -33,8 +33,7 @@ void bhv_pushable_loop(void) { obj_set_hitbox(o, &sMetalBoxHitbox); o->oForwardVel = 0.0f; - if (obj_check_if_collided_with_object(o, gMarioObject) - && (gMarioStates[0].flags & MARIO_UNKNOWN_31)) { + if (obj_check_if_collided_with_object(o, gMarioObject) && (gMarioStates[0].flags & MARIO_UNKNOWN_31)) { s16 sp1C = obj_angle_to_object(o, gMarioObject); if (abs_angle_diff(sp1C, gMarioObject->oMoveAngleYaw) > 0x4000) { o->oMoveAngleYaw = (s16)((gMarioObject->oMoveAngleYaw + 0x2000) & 0xC000); diff --git a/src/game/behaviors/mips.inc.c b/src/game/behaviors/mips.inc.c index cf2d4004..44b7ffe8 100644 --- a/src/game/behaviors/mips.inc.c +++ b/src/game/behaviors/mips.inc.c @@ -12,18 +12,18 @@ void bhv_mips_init(void) { u8 starFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_NONE)); // If the player has >= 15 stars and hasn't collected first MIPS star... - if (save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 15 - && !(starFlags & SAVE_FLAG_TO_STAR_FLAG(SAVE_FLAG_COLLECTED_MIPS_STAR_1))) { + if (save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 15 && + !(starFlags & SAVE_FLAG_TO_STAR_FLAG(SAVE_FLAG_COLLECTED_MIPS_STAR_1))) { o->oBehParams2ndByte = 0; - if(!ROM_JP) { + if (!ROM_JP) { o->oMipsForwardVelocity = 40.0f; } } // If the player has >= 50 stars and hasn't collected second MIPS star... - else if (save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 50 - && !(starFlags & SAVE_FLAG_TO_STAR_FLAG(SAVE_FLAG_COLLECTED_MIPS_STAR_2))) { + else if (save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 50 && + !(starFlags & SAVE_FLAG_TO_STAR_FLAG(SAVE_FLAG_COLLECTED_MIPS_STAR_2))) { o->oBehParams2ndByte = 1; - if(!ROM_JP) { + if (!ROM_JP) { o->oMipsForwardVelocity = 45.0f; } } else { @@ -50,11 +50,11 @@ s16 bhv_mips_find_furthest_waypoint_to_mario(void) { s16 furthestWaypointIndex = -1; f32 furthestWaypointDistance = -10000.0f; f32 distanceToMario; - struct Waypoint **pathBase = segmented_to_virtual(inside_castle_seg7_trajectory_mips); + struct Waypoint** pathBase = segmented_to_virtual(inside_castle_seg7_trajectory_mips); // For each waypoint in MIPS path... for (i = 0; i < 10; i++) { - struct Waypoint *waypoint = segmented_to_virtual(pathBase[i]); + struct Waypoint* waypoint = segmented_to_virtual(pathBase[i]); x = waypoint->pos[0]; y = waypoint->pos[1]; z = waypoint->pos[2]; @@ -62,8 +62,7 @@ s16 bhv_mips_find_furthest_waypoint_to_mario(void) { // Is the waypoint within 800 units of MIPS? if (is_point_close_to_object(o, x, y, z, 800)) { // Is this further from Mario than the last waypoint? - distanceToMario = - sqr(x - gMarioObject->header.gfx.pos[0]) + sqr(z - gMarioObject->header.gfx.pos[2]); + distanceToMario = sqr(x - gMarioObject->header.gfx.pos[0]) + sqr(z - gMarioObject->header.gfx.pos[2]); if (furthestWaypointDistance < distanceToMario) { furthestWaypointIndex = i; furthestWaypointDistance = distanceToMario; @@ -73,7 +72,7 @@ s16 bhv_mips_find_furthest_waypoint_to_mario(void) { // Set MIPS' next waypoint to be the closest waypoint to Mario. o->oMipsStartWaypointIndex = furthestWaypointIndex; - return (s16) o->oMipsStartWaypointIndex; + return (s16)o->oMipsStartWaypointIndex; } /** @@ -107,8 +106,8 @@ void bhv_mips_act_follow_path(void) { s32 followStatus = 0; // Retrieve current waypoint. - struct Waypoint **pathBase = segmented_to_virtual(inside_castle_seg7_trajectory_mips); - struct Waypoint *waypoint = segmented_to_virtual(*(pathBase + o->oMipsStartWaypointIndex)); + struct Waypoint** pathBase = segmented_to_virtual(inside_castle_seg7_trajectory_mips); + struct Waypoint* waypoint = segmented_to_virtual(*(pathBase + o->oMipsStartWaypointIndex)); // Set start waypoint and follow the path from there. o->oPathedStartWaypoint = waypoint; diff --git a/src/game/behaviors/moneybag.inc.c b/src/game/behaviors/moneybag.inc.c index 2d5a0239..32759a49 100644 --- a/src/game/behaviors/moneybag.inc.c +++ b/src/game/behaviors/moneybag.inc.c @@ -109,8 +109,8 @@ void moneybag_act_move_around(void) { collisionFlags = object_step(); - if (((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED) - && (o->oMoneybagJumpState == MONEYBAG_JUMP_LANDING)) { + if (((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED) && + (o->oMoneybagJumpState == MONEYBAG_JUMP_LANDING)) { if ((s32)(random_float() * 6.0f) == 1) { o->oMoneybagJumpState = MONEYBAG_JUMP_WALK_AROUND; o->oTimer = 0; @@ -122,8 +122,8 @@ void moneybag_act_move_around(void) { moneybag_jump(collisionFlags); moneybag_check_mario_collision(); - if (!is_point_within_radius_of_mario(o->oHomeX, o->oHomeY, o->oHomeZ, 800) - && ((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED)) { + if (!is_point_within_radius_of_mario(o->oHomeX, o->oHomeY, o->oHomeZ, 800) && + ((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED)) { o->oAction = MONEYBAG_ACT_RETURN_HOME; } } @@ -137,8 +137,8 @@ void moneybag_act_return_home(void) { o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, sp22, 0x800); collisionFlags = object_step(); - if (((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED) - && (o->oMoneybagJumpState == MONEYBAG_JUMP_LANDING)) { + if (((collisionFlags & OBJ_COL_FLAGS_LANDED) == OBJ_COL_FLAGS_LANDED) && + (o->oMoneybagJumpState == MONEYBAG_JUMP_LANDING)) { o->oMoneybagJumpState = MONEYBAG_JUMP_WALK_HOME; } @@ -147,7 +147,7 @@ void moneybag_act_return_home(void) { if (is_point_close_to_object(o, o->oHomeX, o->oHomeY, o->oHomeZ, 100)) { spawn_object(o, MODEL_YELLOW_COIN, bhvMoneybagHidden); - if(!ROM_JP) { + if (!ROM_JP) { cur_obj_play_sound_2(SOUND_GENERAL_VANISH_SFX); } cur_obj_init_animation(0); @@ -218,7 +218,7 @@ void bhv_moneybag_hidden_loop(void) { case FAKE_MONEYBAG_COIN_ACT_IDLE: if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 400)) { spawn_object(o, MODEL_MONEYBAG, bhvMoneybag); - if(!ROM_JP) { + if (!ROM_JP) { cur_obj_play_sound_2(SOUND_GENERAL_VANISH_SFX); } o->oAction = FAKE_MONEYBAG_COIN_ACT_TRANSFORM; diff --git a/src/game/behaviors/monty_mole.inc.c b/src/game/behaviors/monty_mole.inc.c index 884774ad..e7051c98 100644 --- a/src/game/behaviors/monty_mole.inc.c +++ b/src/game/behaviors/monty_mole.inc.c @@ -9,7 +9,7 @@ * The first hole in the list of monty mole holes. The list is a singly linked * list using the parentObj field. */ -struct Object *sMontyMoleHoleList; +struct Object* sMontyMoleHoleList; /** * The number of nearby monty moles that have been killed in a row. @@ -29,20 +29,20 @@ f32 sMontyMoleLastKilledPosZ; * The result is a singly linked list in reverse processing order. Return the * start of this list. */ -static struct Object *link_objects_with_behavior(const BehaviorScript *behavior) { - const BehaviorScript *behaviorAddr = segmented_to_virtual(behavior); - struct Object *obj; - struct Object *lastObject = NULL; - struct ObjectNode *listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; +static struct Object* link_objects_with_behavior(const BehaviorScript* behavior) { + const BehaviorScript* behaviorAddr = segmented_to_virtual(behavior); + struct Object* obj; + struct Object* lastObject = NULL; + struct ObjectNode* listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; - obj = (struct Object *) listHead->next; - while (obj != (struct Object *) listHead) { + obj = (struct Object*)listHead->next; + while (obj != (struct Object*)listHead) { if (obj->behavior == behaviorAddr && obj->activeFlags != ACTIVE_FLAG_DEACTIVATED) { obj->parentObj = lastObject; lastObject = obj; } - obj = (struct Object *) obj->header.next; + obj = (struct Object*)obj->header.next; } return lastObject; @@ -52,8 +52,8 @@ static struct Object *link_objects_with_behavior(const BehaviorScript *behavior) * Select a random hole that is within minDistToMario and 1500 of mario, and * whose cooldown is zero. Return NULL if no hole is available. */ -static struct Object *monty_mole_select_available_hole(f32 minDistToMario) { - struct Object *hole = sMontyMoleHoleList; +static struct Object* monty_mole_select_available_hole(f32 minDistToMario) { + struct Object* hole = sMontyMoleHoleList; s32 numAvailableHoles = 0; while (hole != NULL) { @@ -203,12 +203,12 @@ static void monty_mole_act_rise_from_hole(void) { * Otherwise, enter the begin jump into hole action. */ static void monty_mole_act_spawn_rock(void) { - struct Object *rock; + struct Object* rock; if (cur_obj_init_anim_and_check_if_end(2)) { - if (o->oBehParams2ndByte != MONTY_MOLE_BP_NO_ROCK - && abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) < 0x4000 - && (rock = spawn_object(o, MODEL_PEBBLE, bhvMontyMoleRock)) != NULL) { + if (o->oBehParams2ndByte != MONTY_MOLE_BP_NO_ROCK && + abs_angle_diff(o->oAngleToMario, o->oMoveAngleYaw) < 0x4000 && + (rock = spawn_object(o, MODEL_PEBBLE, bhvMontyMoleRock)) != NULL) { o->prevObj = rock; o->oAction = MONTY_MOLE_ACT_THROW_ROCK; } else { diff --git a/src/game/behaviors/moving_coin.inc.c b/src/game/behaviors/moving_coin.inc.c index 63fea18d..b1559b85 100644 --- a/src/game/behaviors/moving_coin.inc.c +++ b/src/game/behaviors/moving_coin.inc.c @@ -24,13 +24,12 @@ static struct ObjectHitbox sMovingBlueCoinHitbox = { /* hurtboxHeight: */ 0, }; -s32 coin_step(s16 *collisionFlagsPtr) { +s32 coin_step(s16* collisionFlagsPtr) { *collisionFlagsPtr = object_step(); obj_check_floor_death(*collisionFlagsPtr, sObjFloor); - if ((*collisionFlagsPtr & OBJ_COL_FLAG_GROUNDED) - && !(*collisionFlagsPtr & OBJ_COL_FLAG_NO_Y_VEL)) { + if ((*collisionFlagsPtr & OBJ_COL_FLAG_GROUNDED) && !(*collisionFlagsPtr & OBJ_COL_FLAG_NO_Y_VEL)) { cur_obj_play_sound_2(SOUND_GENERAL_COIN_DROP); return TRUE; } diff --git a/src/game/behaviors/mr_blizzard.inc.c b/src/game/behaviors/mr_blizzard.inc.c index 019f85e3..c7873f71 100644 --- a/src/game/behaviors/mr_blizzard.inc.c +++ b/src/game/behaviors/mr_blizzard.inc.c @@ -14,8 +14,7 @@ struct ObjectHitbox sMrBlizzardHitbox = { }; // Mr. Blizzard particle spawner. -void mr_blizzard_spawn_white_particles(s8 count, s8 offsetY, s8 forwardVelBase, s8 velYBase, - s8 sizeBase) { +void mr_blizzard_spawn_white_particles(s8 count, s8 offsetY, s8 forwardVelBase, s8 velYBase, s8 sizeBase) { static struct SpawnParticlesInfo D_80331A00 = { /* behParam: */ 0, /* count: */ 6, @@ -51,8 +50,8 @@ void bhv_mr_blizzard_init(void) { o->oMrBlizzardTargetMoveYaw = o->oMoveAngleYaw; } else { // Cap wearing Mr. Blizzard from SL. - if ((o->oBehParams2ndByte != MR_BLIZZARD_STYPE_NO_CAP) - && (save_file_get_flags() & SAVE_FLAG_CAP_ON_MR_BLIZZARD)) { + if ((o->oBehParams2ndByte != MR_BLIZZARD_STYPE_NO_CAP) && + (save_file_get_flags() & SAVE_FLAG_CAP_ON_MR_BLIZZARD)) { o->oAnimState = 1; } @@ -69,9 +68,8 @@ static void mr_blizzard_act_spawn_snowball(void) { // If Mr. Blizzard is not holding a snowball, and the animation reaches 5 frames // spawn the Mr. Blizzard snowball. if (o->oMrBlizzardHeldObj == NULL && cur_obj_init_anim_check_frame(0, 5)) { - o->oMrBlizzardHeldObj = - spawn_object_relative(0, -70, (s32)(o->oMrBlizzardGraphYOffset + 153.0f), 0, o, - MODEL_WHITE_PARTICLE, bhvMrBlizzardSnowball); + o->oMrBlizzardHeldObj = spawn_object_relative(0, -70, (s32)(o->oMrBlizzardGraphYOffset + 153.0f), 0, o, + MODEL_WHITE_PARTICLE, bhvMrBlizzardSnowball); } else if (cur_obj_check_anim_frame(10)) { o->prevObj = o->oMrBlizzardHeldObj; } else if (cur_obj_check_if_near_animation_end()) { @@ -204,7 +202,7 @@ static void mr_blizzard_act_death(void) { // If Mr. Blizzard is wearing Mario's cap, clear // the save flag and spawn Mario's cap. if (o->oAnimState != 0) { - struct Object *cap; + struct Object* cap; save_file_clear_flags(SAVE_FLAG_CAP_ON_MR_BLIZZARD); cap = spawn_object_relative(0, 5, 105, 0, o, MODEL_MARIOS_CAP, bhvNormalCap); @@ -324,7 +322,7 @@ static void mr_blizzard_act_jump(void) { // Otherwise, set DistFromHome to 700. cur_obj_play_sound_2(SOUND_OBJ_SNOW_SAND1); if (o->oMrBlizzardDistFromHome != 0) { - o->oMrBlizzardDistFromHome = (s32) cur_obj_lateral_dist_to_home(); + o->oMrBlizzardDistFromHome = (s32)cur_obj_lateral_dist_to_home(); } else { o->oMrBlizzardDistFromHome = 700; } @@ -372,8 +370,8 @@ void bhv_mr_blizzard_update(void) { // slowly fall over. o->oFaceAngleRoll = o->oMrBlizzardDizziness; // Mr. Blizzard's graphical position changes by changing the Y offset. - o->oGraphYOffset = o->oMrBlizzardGraphYOffset + absf(20.0f * sins(o->oFaceAngleRoll)) - - 40.0f * (1.0f - o->oMrBlizzardScale); + o->oGraphYOffset = + o->oMrBlizzardGraphYOffset + absf(20.0f * sins(o->oFaceAngleRoll)) - 40.0f * (1.0f - o->oMrBlizzardScale); cur_obj_scale(o->oMrBlizzardScale); cur_obj_move_standard(78); diff --git a/src/game/behaviors/mr_i.inc.c b/src/game/behaviors/mr_i.inc.c index 4d94542c..86a489ed 100644 --- a/src/game/behaviors/mr_i.inc.c +++ b/src/game/behaviors/mr_i.inc.c @@ -18,8 +18,8 @@ void mr_i_piranha_particle_act_0(void) { if (o->oInteractStatus & INT_STATUS_INTERACTED) { o->oAction = 1; - } else if ((o->oTimer > 100) || (o->oMoveFlags & OBJ_MOVE_HIT_WALL) - || (o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) { + } else if ((o->oTimer > 100) || (o->oMoveFlags & OBJ_MOVE_HIT_WALL) || + (o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM)) { obj_mark_for_deletion(o); spawn_mist_particles(); } @@ -43,7 +43,7 @@ void bhv_mr_i_particle_loop(void) { } void spawn_mr_i_particle(void) { - struct Object *particle; + struct Object* particle; f32 sp18 = o->header.gfx.scale[1]; particle = spawn_object(o, MODEL_PURPLE_MARBLE, bhvMrIParticle); diff --git a/src/game/behaviors/mushroom_1up.inc.c b/src/game/behaviors/mushroom_1up.inc.c index 861fc325..e52a1b4b 100644 --- a/src/game/behaviors/mushroom_1up.inc.c +++ b/src/game/behaviors/mushroom_1up.inc.c @@ -270,7 +270,7 @@ void bhv_1up_hidden_loop(void) { void bhv_1up_hidden_trigger_loop(void) { if (obj_check_if_collided_with_object(o, gMarioObject) == TRUE) { - struct Object *sp1C = cur_obj_nearest_object_with_behavior(bhvHidden1up); + struct Object* sp1C = cur_obj_nearest_object_with_behavior(bhvHidden1up); if (sp1C != NULL) { sp1C->o1UpHiddenUnkF4++; } @@ -317,7 +317,7 @@ void bhv_1up_hidden_in_pole_loop(void) { void bhv_1up_hidden_in_pole_trigger_loop(void) { if (obj_check_if_collided_with_object(o, gMarioObject) == TRUE) { - struct Object *sp1C = cur_obj_nearest_object_with_behavior(bhvHidden1upInPole); + struct Object* sp1C = cur_obj_nearest_object_with_behavior(bhvHidden1upInPole); if (sp1C != NULL) { sp1C->o1UpHiddenUnkF4++; } diff --git a/src/game/behaviors/orange_number.inc.c b/src/game/behaviors/orange_number.inc.c index 3b5554d8..e219eb24 100644 --- a/src/game/behaviors/orange_number.inc.c +++ b/src/game/behaviors/orange_number.inc.c @@ -14,7 +14,7 @@ void bhv_orange_number_loop(void) { } if (o->oTimer == 35) { - struct Object *sp1C = spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles); + struct Object* sp1C = spawn_object(o, MODEL_SPARKLES, bhvGoldenCoinSparkles); sp1C->oPosY -= 30.0f; o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } diff --git a/src/game/behaviors/piranha_bubbles.inc.c b/src/game/behaviors/piranha_bubbles.inc.c index 21e01f66..cbfa9650 100644 --- a/src/game/behaviors/piranha_bubbles.inc.c +++ b/src/game/behaviors/piranha_bubbles.inc.c @@ -28,7 +28,7 @@ void bhv_piranha_plant_waking_bubbles_loop(void) { * and the cycle can repeat. */ void bhv_piranha_plant_bubble_loop(void) { - struct Object *parent = o->parentObj; // the Piranha Plant + struct Object* parent = o->parentObj; // the Piranha Plant f32 scale = 0; s32 i; s32 animFrame = parent->header.gfx.animInfo.animFrame; @@ -71,9 +71,11 @@ void bhv_piranha_plant_bubble_loop(void) { } else if (animFrame > beginGrowingFrame) { // Grow from 1.0f to 5.0f. scale = sins(( - // they should have used beginGrowingFrame here: - (animFrame - (lastFrame / 2.0f + 4.0f)) / beginGrowingFrame - ) * 0x4000) * 4.0f + 1.0; + // they should have used beginGrowingFrame here: + (animFrame - (lastFrame / 2.0f + 4.0f)) / beginGrowingFrame) * + 0x4000) * + 4.0f + + 1.0; } else { // Stay at 1.0f for a few frames. scale = 1.0f; diff --git a/src/game/behaviors/platform_on_track.inc.c b/src/game/behaviors/platform_on_track.inc.c index 51007e62..e7031451 100644 --- a/src/game/behaviors/platform_on_track.inc.c +++ b/src/game/behaviors/platform_on_track.inc.c @@ -8,7 +8,7 @@ /** * Collision models for the different types of platforms. */ -static Collision const *sPlatformOnTrackCollisionModels[] = { +static Collision const* sPlatformOnTrackCollisionModels[] = { /* PLATFORM_ON_TRACK_TYPE_CARPET */ rr_seg7_collision_07029038, /* PLATFORM_ON_TRACK_TYPE_SKI_LIFT */ ccm_seg7_collision_070163F8, /* PLATFORM_ON_TRACK_TYPE_CHECKERED */ checkerboard_platform_seg8_collision_0800D710, @@ -18,16 +18,10 @@ static Collision const *sPlatformOnTrackCollisionModels[] = { /** * Paths for the different instances of these platforms. */ -static Trajectory const *sPlatformOnTrackPaths[] = { - rr_seg7_trajectory_0702EC3C, - rr_seg7_trajectory_0702ECC0, - ccm_seg7_trajectory_0701669C, - bitfs_seg7_trajectory_070159AC, - hmc_seg7_trajectory_0702B86C, - lll_seg7_trajectory_0702856C, - lll_seg7_trajectory_07028660, - rr_seg7_trajectory_0702ED9C, - rr_seg7_trajectory_0702EEE0, +static Trajectory const* sPlatformOnTrackPaths[] = { + rr_seg7_trajectory_0702EC3C, rr_seg7_trajectory_0702ECC0, ccm_seg7_trajectory_0701669C, + bitfs_seg7_trajectory_070159AC, hmc_seg7_trajectory_0702B86C, lll_seg7_trajectory_0702856C, + lll_seg7_trajectory_07028660, rr_seg7_trajectory_0702ED9C, rr_seg7_trajectory_0702EEE0, }; /** @@ -63,8 +57,7 @@ void bhv_platform_on_track_init(void) { o->oPlatformOnTrackIsNotSkiLift = o->oPlatformOnTrackType - PLATFORM_ON_TRACK_TYPE_SKI_LIFT; - o->collisionData = - segmented_to_virtual(sPlatformOnTrackCollisionModels[o->oPlatformOnTrackType]); + o->collisionData = segmented_to_virtual(sPlatformOnTrackCollisionModels[o->oPlatformOnTrackType]); o->oPlatformOnTrackStartWaypoint = segmented_to_virtual(sPlatformOnTrackPaths[pathIndex]); @@ -141,14 +134,14 @@ static void platform_on_track_act_move_along_track(void) { } // Fall after reaching the last waypoint if desired - if (o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_END - && !((u16)(o->oBehParams >> 16) & PLATFORM_ON_TRACK_BP_RETURN_TO_START)) { + if (o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_END && + !((u16)(o->oBehParams >> 16) & PLATFORM_ON_TRACK_BP_RETURN_TO_START)) { o->oAction = PLATFORM_ON_TRACK_ACT_FALL; } else { // The ski lift should pause or stop after reaching a special waypoint if (o->oPlatformOnTrackPrevWaypointFlags != 0 && !o->oPlatformOnTrackIsNotSkiLift) { - if (o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_END - || o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_PLATFORM_ON_TRACK_PAUSE) { + if (o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_END || + o->oPlatformOnTrackPrevWaypointFlags == WAYPOINT_FLAGS_PLATFORM_ON_TRACK_PAUSE) { cur_obj_play_sound_2(SOUND_GENERAL_UNKNOWN4_LOWPRIO); o->oForwardVel = 0.0f; @@ -196,7 +189,7 @@ static void platform_on_track_act_move_along_track(void) { initialAngle = o->oFaceAngleYaw; clamp_s16(&yawSpeed, 100, 500); obj_face_yaw_approach(targetFaceYaw, yawSpeed); - o->oAngleVelYaw = (s16) o->oFaceAngleYaw - initialAngle; + o->oAngleVelYaw = (s16)o->oFaceAngleYaw - initialAngle; } // Turn face roll and compute roll vel @@ -208,7 +201,7 @@ static void platform_on_track_act_move_along_track(void) { //! If the platform is moving counterclockwise upward or // clockwise downward, this will be backward obj_face_roll_approach(o->oMoveAnglePitch, rollSpeed); - o->oAngleVelRoll = (s16) o->oFaceAngleRoll - initialAngle; + o->oAngleVelRoll = (s16)o->oFaceAngleRoll - initialAngle; } } @@ -251,12 +244,12 @@ static void platform_on_track_rock_ski_lift(void) { s32 targetRoll = 0; UNUSED s32 initialRoll = o->oFaceAngleRoll; - o->oFaceAngleRoll += (s32) o->oPlatformOnTrackSkiLiftRollVel; + o->oFaceAngleRoll += (s32)o->oPlatformOnTrackSkiLiftRollVel; // Tilt away from the moving direction and toward mario if (gMarioObject->platform == o) { - targetRoll = o->oForwardVel * sins(o->oMoveAngleYaw) * -50.0f - + (s32)(o->oDistanceToMario * sins(o->oAngleToMario - o->oFaceAngleYaw) * -4.0f); + targetRoll = o->oForwardVel * sins(o->oMoveAngleYaw) * -50.0f + + (s32)(o->oDistanceToMario * sins(o->oAngleToMario - o->oFaceAngleYaw) * -4.0f); } oscillate_toward( @@ -309,8 +302,7 @@ void bhv_platform_on_track_update(void) { */ void bhv_track_ball_update(void) { // Despawn after the elevator passes this ball - s16 relativeIndex = - (s16) o->oBehParams2ndByte - (s16) o->parentObj->oPlatformOnTrackBaseBallIndex - 1; + s16 relativeIndex = (s16)o->oBehParams2ndByte - (s16)o->parentObj->oPlatformOnTrackBaseBallIndex - 1; if (relativeIndex < 1 || relativeIndex > 5) { obj_mark_for_deletion(o); } diff --git a/src/game/behaviors/pokey.inc.c b/src/game/behaviors/pokey.inc.c index 9f870869..33a881a6 100644 --- a/src/game/behaviors/pokey.inc.c +++ b/src/game/behaviors/pokey.inc.c @@ -58,8 +58,8 @@ void bhv_pokey_body_part_update(void) { // index by killing two body parts on the frame before a new part // spawns, but one of the body parts shifts upward immediately, // so not very interesting - if (o->oBehParams2ndByte > 1 - && !(o->parentObj->oPokeyAliveBodyPartFlags & (1 << (o->oBehParams2ndByte - 1)))) { + if (o->oBehParams2ndByte > 1 && + !(o->parentObj->oPokeyAliveBodyPartFlags & (1 << (o->oBehParams2ndByte - 1)))) { o->parentObj->oPokeyAliveBodyPartFlags = o->parentObj->oPokeyAliveBodyPartFlags | 1 << (o->oBehParams2ndByte - 1); @@ -75,8 +75,8 @@ void bhv_pokey_body_part_update(void) { //! If you kill a body part as it's expanding, the body part that // was above it will instantly shrink and begin expanding in its // place. - else if (o->parentObj->oPokeyBottomBodyPartSize < 1.0f - && o->oBehParams2ndByte + 1 == o->parentObj->oPokeyNumAliveBodyParts) { + else if (o->parentObj->oPokeyBottomBodyPartSize < 1.0f && + o->oBehParams2ndByte + 1 == o->parentObj->oPokeyNumAliveBodyParts) { approach_f32_ptr(&o->parentObj->oPokeyBottomBodyPartSize, 1.0f, 0.1f); cur_obj_scale(o->parentObj->oPokeyBottomBodyPartSize * 3.0f); } @@ -87,9 +87,9 @@ void bhv_pokey_body_part_update(void) { o->oPosZ = o->parentObj->oPosZ + sins(offsetAngle) * 6.0f; // This is the height of the tower beneath the body part - baseHeight = o->parentObj->oPosY - + (120 * (o->parentObj->oPokeyNumAliveBodyParts - o->oBehParams2ndByte) - 240) - + 120.0f * o->parentObj->oPokeyBottomBodyPartSize; + baseHeight = o->parentObj->oPosY + + (120 * (o->parentObj->oPokeyNumAliveBodyParts - o->oBehParams2ndByte) - 240) + + 120.0f * o->parentObj->oPokeyBottomBodyPartSize; // We treat the base height as a minimum height, allowing the body // part to briefly stay in the air after a part below it dies @@ -147,7 +147,7 @@ void bhv_pokey_body_part_update(void) { * action. */ static void pokey_act_uninitialized(void) { - struct Object *bodyPart; + struct Object* bodyPart; s32 i; s16 partModel; @@ -203,13 +203,11 @@ static void pokey_act_wander(void) { // is killed, the new part's index is equal to the number // of living body parts - struct Object *bodyPart - = spawn_object_relative(o->oPokeyNumAliveBodyParts, 0, 0, 0, o, - MODEL_POKEY_BODY_PART, bhvPokeyBodyPart); + struct Object* bodyPart = spawn_object_relative(o->oPokeyNumAliveBodyParts, 0, 0, 0, o, + MODEL_POKEY_BODY_PART, bhvPokeyBodyPart); if (bodyPart != NULL) { - o->oPokeyAliveBodyPartFlags = - o->oPokeyAliveBodyPartFlags | (1 << o->oPokeyNumAliveBodyParts); + o->oPokeyAliveBodyPartFlags = o->oPokeyAliveBodyPartFlags | (1 << o->oPokeyNumAliveBodyParts); o->oPokeyNumAliveBodyParts++; o->oPokeyBottomBodyPartSize = 0.0f; @@ -223,16 +221,14 @@ static void pokey_act_wander(void) { } if (o->oPokeyTurningAwayFromWall) { - o->oPokeyTurningAwayFromWall = - obj_resolve_collisions_and_turn(o->oPokeyTargetYaw, 0x200); + o->oPokeyTurningAwayFromWall = obj_resolve_collisions_and_turn(o->oPokeyTargetYaw, 0x200); } else { // If far from home, turn back toward home if (o->oDistanceToMario >= 25000.0f) { o->oPokeyTargetYaw = o->oAngleToMario; } - if (!(o->oPokeyTurningAwayFromWall = - obj_bounce_off_walls_edges_objects(&o->oPokeyTargetYaw))) { + if (!(o->oPokeyTurningAwayFromWall = obj_bounce_off_walls_edges_objects(&o->oPokeyTargetYaw))) { if (o->oPokeyChangeTargetTimer != 0) { o->oPokeyChangeTargetTimer--; } else if (o->oDistanceToMario > 2000.0f) { diff --git a/src/game/behaviors/pole.inc.c b/src/game/behaviors/pole.inc.c index 1066e003..670c3d6a 100644 --- a/src/game/behaviors/pole.inc.c +++ b/src/game/behaviors/pole.inc.c @@ -28,7 +28,7 @@ void bhv_pole_init(void) { */ void bhv_giant_pole_loop(void) { if (o->oTimer == 0) { - struct Object *topBall = spawn_object(o, MODEL_YELLOW_SPHERE, bhvYellowBall); + struct Object* topBall = spawn_object(o, MODEL_YELLOW_SPHERE, bhvYellowBall); topBall->oPosY += o->hitboxHeight + 50.0f; } bhv_pole_base_loop(); diff --git a/src/game/behaviors/pole_base.inc.c b/src/game/behaviors/pole_base.inc.c index 874c8704..d9320adf 100644 --- a/src/game/behaviors/pole_base.inc.c +++ b/src/game/behaviors/pole_base.inc.c @@ -1,8 +1,7 @@ // pole_base.inc.c void bhv_pole_base_loop(void) { - if (o->oPosY - 10.0f < gMarioObject->oPosY - && gMarioObject->oPosY < o->oPosY + o->hitboxHeight + 30.0f) { + if (o->oPosY - 10.0f < gMarioObject->oPosY && gMarioObject->oPosY < o->oPosY + o->hitboxHeight + 30.0f) { if (o->oTimer > 10 && !(gMarioStates[0].action & MARIO_PUNCHING)) { cur_obj_push_mario_away(70.0f); } diff --git a/src/game/behaviors/pyramid_elevator.inc.c b/src/game/behaviors/pyramid_elevator.inc.c index ac089de9..4a61fefa 100644 --- a/src/game/behaviors/pyramid_elevator.inc.c +++ b/src/game/behaviors/pyramid_elevator.inc.c @@ -14,8 +14,7 @@ void bhv_pyramid_elevator_init(void) { s32 i; for (i = 0; i < 10; i++) { - struct Object *ball = spawn_object(o, MODEL_TRAJECTORY_MARKER_BALL, - bhvPyramidElevatorTrajectoryMarkerBall); + struct Object* ball = spawn_object(o, MODEL_TRAJECTORY_MARKER_BALL, bhvPyramidElevatorTrajectoryMarkerBall); ball->oPosY = 4600 - i * 460; } } @@ -75,7 +74,7 @@ void bhv_pyramid_elevator_loop(void) { * Otherwise, set their scale. */ void bhv_pyramid_elevator_trajectory_marker_ball_loop(void) { - struct Object *elevator; + struct Object* elevator; cur_obj_scale(0.15f); elevator = cur_obj_nearest_object_with_behavior(bhvPyramidElevator); diff --git a/src/game/behaviors/pyramid_top.inc.c b/src/game/behaviors/pyramid_top.inc.c index 14b6bc2f..2d17854c 100644 --- a/src/game/behaviors/pyramid_top.inc.c +++ b/src/game/behaviors/pyramid_top.inc.c @@ -15,14 +15,10 @@ * Spawn the four pillars' touch detectors. */ void bhv_pyramid_top_init(void) { - spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, - 1789, 1024, 764, 0, 0, 0); - spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, - 1789, 896, -2579, 0, 0, 0); - spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, - -5883, 1024, -2579, 0, 0, 0); - spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, - -5883, 1024, 764, 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, 1789, 1024, 764, 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, 1789, 896, -2579, 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, -5883, 1024, -2579, 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_NONE, bhvPyramidPillarTouchDetector, -5883, 1024, 764, 0, 0, 0); } /** @@ -51,7 +47,7 @@ void bhv_pyramid_top_spinning(void) { // Every frame until 90 frames have passed, generate a pyramid fragment // with a random velocity and angle. if (o->oTimer < 90) { - struct Object *pyramidFragment = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPyramidTopFragment); + struct Object* pyramidFragment = spawn_object(o, MODEL_DIRT_ANIMATION, bhvPyramidTopFragment); pyramidFragment->oForwardVel = random_float() * 10.0f + 20.0f; pyramidFragment->oMoveAngleYaw = random_u16(); pyramidFragment->oPyramidTopFragmentsScale = 0.8f; @@ -68,7 +64,7 @@ void bhv_pyramid_top_spinning(void) { * Explode the pyramid top, generating dust and pyramid fragments. */ void bhv_pyramid_top_explode(void) { - struct Object *pyramidFragment; + struct Object* pyramidFragment; s16 i; spawn_mist_particles_variable(0, 0, 690); diff --git a/src/game/behaviors/racing_penguin.inc.c b/src/game/behaviors/racing_penguin.inc.c index 8c42a4c4..76a7de3a 100644 --- a/src/game/behaviors/racing_penguin.inc.c +++ b/src/game/behaviors/racing_penguin.inc.c @@ -20,8 +20,8 @@ void bhv_racing_penguin_init(void) { } static void racing_penguin_act_wait_for_mario(void) { - if (o->oTimer > o->oRacingPenguinInitTextCooldown && o->oPosY - gMarioObject->oPosY <= 0.0f - && cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) { + if (o->oTimer > o->oRacingPenguinInitTextCooldown && o->oPosY - gMarioObject->oPosY <= 0.0f && + cur_obj_can_mario_activate_textbox_2(400.0f, 400.0f)) { o->oAction = RACING_PENGUIN_ACT_SHOW_INIT_TEXT; } } @@ -30,7 +30,7 @@ static void racing_penguin_act_show_init_text(void) { s32 response = obj_update_race_proposition_dialog(sRacingPenguinData[o->oBehParams2ndByte].text); if (response == DIALOG_RESPONSE_YES) { - struct Object *child; + struct Object* child; child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceFinishLine); child->parentObj = o; @@ -38,8 +38,7 @@ static void racing_penguin_act_show_init_text(void) { child = cur_obj_nearest_object_with_behavior(bhvPenguinRaceShortcutCheck); child->parentObj = o; - o->oPathedStartWaypoint = o->oPathedPrevWaypoint = - segmented_to_virtual(ccm_seg7_trajectory_penguin_race); + o->oPathedStartWaypoint = o->oPathedPrevWaypoint = segmented_to_virtual(ccm_seg7_trajectory_penguin_race); o->oPathedPrevWaypointFlags = 0; o->oAction = RACING_PENGUIN_ACT_PREPARE_FOR_RACE; @@ -132,7 +131,7 @@ static void racing_penguin_act_show_final_text(void) { } } else { cur_obj_init_animation_with_sound(0); - if(!ROM_JP) { + if (!ROM_JP) { play_penguin_walking_sound(1); } @@ -140,13 +139,13 @@ static void racing_penguin_act_show_final_text(void) { } } else if (o->oRacingPenguinFinalTextbox > 0) { s32 textResult; - if ((textResult = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, o->oRacingPenguinFinalTextbox))) { + if ((textResult = cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, + CUTSCENE_DIALOG, o->oRacingPenguinFinalTextbox))) { o->oRacingPenguinFinalTextbox = -1; o->oTimer = 0; } } else if (o->oRacingPenguinMarioWon) { - if(ROM_JP) { + if (ROM_JP) { spawn_default_star(-7339.0f, -5700.0f, -6774.0f); } else { cur_obj_spawn_star_at_y_offset(-7339.0f, -5700.0f, -6774.0f, 200.0f); @@ -186,9 +185,9 @@ void bhv_racing_penguin_update(void) { } void bhv_penguin_race_finish_line_update(void) { - if ((o->parentObj->oRacingPenguinReachedBottom - || (o->oDistanceToMario < 1000.0f && gMarioObject->oPosZ - o->oPosZ < 0.0f)) - && !o->parentObj->oRacingPenguinReachedBottom) { + if ((o->parentObj->oRacingPenguinReachedBottom || + (o->oDistanceToMario < 1000.0f && gMarioObject->oPosZ - o->oPosZ < 0.0f)) && + !o->parentObj->oRacingPenguinReachedBottom) { o->parentObj->oRacingPenguinMarioWon = TRUE; } } diff --git a/src/game/behaviors/red_coin.inc.c b/src/game/behaviors/red_coin.inc.c index 388c0e8b..7f1eed2d 100644 --- a/src/game/behaviors/red_coin.inc.c +++ b/src/game/behaviors/red_coin.inc.c @@ -25,17 +25,15 @@ static struct ObjectHitbox sRedCoinHitbox = { */ void bhv_red_coin_init(void) { // This floor and floor height are unused. Perhaps for orange number spawns originally? - struct Surface *dummyFloor; + struct Surface* dummyFloor; UNUSED f32 floorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &dummyFloor); // Set the red coins to have a parent of the closest red coin star. - struct Object *hiddenRedCoinStar; + struct Object* hiddenRedCoinStar; - if ((hiddenRedCoinStar = - cur_obj_nearest_object_with_behavior(bhvHiddenRedCoinStar)) != NULL) { + if ((hiddenRedCoinStar = cur_obj_nearest_object_with_behavior(bhvHiddenRedCoinStar)) != NULL) { o->parentObj = hiddenRedCoinStar; - } else if ((hiddenRedCoinStar = - cur_obj_nearest_object_with_behavior(bhvBowserCourseRedCoinStar)) != NULL) { + } else if ((hiddenRedCoinStar = cur_obj_nearest_object_with_behavior(bhvBowserCourseRedCoinStar)) != NULL) { o->parentObj = hiddenRedCoinStar; } else { o->parentObj = NULL; @@ -61,14 +59,13 @@ void bhv_red_coin_loop(void) { spawn_orange_number(o->parentObj->oHiddenStarTriggerCounter, 0, 0, 0); } - if(ROM_JP) { + if (ROM_JP) { // For JP version, play an identical sound for all coins. create_sound_spawner(SOUND_GENERAL_RED_COIN); } else { // On all versions but the JP version, each coin collected plays a higher noise. - play_sound(SOUND_MENU_COLLECT_RED_COIN - + (((u8) o->parentObj->oHiddenStarTriggerCounter - 1) << 16), - gGlobalSoundSource); + play_sound(SOUND_MENU_COLLECT_RED_COIN + (((u8)o->parentObj->oHiddenStarTriggerCounter - 1) << 16), + gGlobalSoundSource); } } diff --git a/src/game/behaviors/rolling_log.inc.c b/src/game/behaviors/rolling_log.inc.c index d77a3b5b..9e42049b 100644 --- a/src/game/behaviors/rolling_log.inc.c +++ b/src/game/behaviors/rolling_log.inc.c @@ -21,8 +21,8 @@ void bhv_ttm_rolling_log_init(void) { void rolling_log_roll_log(void) { if (gMarioObject->platform == o) { - f32 sp24 = (gMarioObject->header.gfx.pos[2] - o->oPosZ) * coss(-1*o->oMoveAngleYaw) - - (gMarioObject->header.gfx.pos[0] - o->oPosX) * sins(-1*o->oMoveAngleYaw); + f32 sp24 = (gMarioObject->header.gfx.pos[2] - o->oPosZ) * coss(-1 * o->oMoveAngleYaw) - + (gMarioObject->header.gfx.pos[0] - o->oPosX) * sins(-1 * o->oMoveAngleYaw); if (sp24 > 0) { o->oAngleVelPitch += 0x10; } else { diff --git a/src/game/behaviors/rotating_octagonal_plat.inc.c b/src/game/behaviors/rotating_octagonal_plat.inc.c index 3e644848..2bb7ae43 100644 --- a/src/game/behaviors/rotating_octagonal_plat.inc.c +++ b/src/game/behaviors/rotating_octagonal_plat.inc.c @@ -1,6 +1,6 @@ // rotating_octagonal_plat.inc.c -static const Collision *sOctagonalPlatformCollision[] = { +static const Collision* sOctagonalPlatformCollision[] = { bits_seg7_collision_0701AA84, rr_seg7_collision_07029508, }; diff --git a/src/game/behaviors/rotating_platform.inc.c b/src/game/behaviors/rotating_platform.inc.c index 5be9c399..26bddb82 100644 --- a/src/game/behaviors/rotating_platform.inc.c +++ b/src/game/behaviors/rotating_platform.inc.c @@ -6,7 +6,7 @@ struct WFRotatingPlatformData { s16 unused; s16 scale; - const Collision *collisionData; + const Collision* collisionData; s16 collisionDistance; }; diff --git a/src/game/behaviors/scuttlebug.inc.c b/src/game/behaviors/scuttlebug.inc.c index 6ec01555..4fd24713 100644 --- a/src/game/behaviors/scuttlebug.inc.c +++ b/src/game/behaviors/scuttlebug.inc.c @@ -12,7 +12,7 @@ struct ObjectHitbox sScuttlebugHitbox = { /* hurtboxHeight: */ 60, }; -s32 update_angle_from_move_flags(s32 *angle) { +s32 update_angle_from_move_flags(s32* angle) { if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) { *angle = o->oWallAngle; return 1; @@ -29,9 +29,8 @@ void bhv_scuttlebug_loop(void) { cur_obj_update_floor_and_walls(); - if (o->oSubAction != 0 - && cur_obj_set_hitbox_and_die_if_attacked(&sScuttlebugHitbox, SOUND_OBJ_DYING_ENEMY1, - o->oScuttlebugUnkF4)) { + if (o->oSubAction != 0 && + cur_obj_set_hitbox_and_die_if_attacked(&sScuttlebugHitbox, SOUND_OBJ_DYING_ENEMY1, o->oScuttlebugUnkF4)) { o->oSubAction = 3; } @@ -81,7 +80,7 @@ void bhv_scuttlebug_loop(void) { case 2: o->oForwardVel = 5.0f; - if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario) { + if ((s16)o->oMoveAngleYaw == (s16)o->oAngleToMario) { o->oSubAction = 1; } if (o->oPosY - o->oHomeY < -200.0f) { @@ -145,7 +144,7 @@ void bhv_scuttlebug_loop(void) { void bhv_scuttlebug_spawn_loop(void) { if (o->oAction == 0) { if (o->oTimer > 30 && 500.0f < o->oDistanceToMario && o->oDistanceToMario < 1500.0f) { - struct Object *scuttlebug; + struct Object* scuttlebug; cur_obj_play_sound_2(SOUND_OBJ2_SCUTTLEBUG_ALERT); scuttlebug = spawn_object(o, MODEL_SCUTTLEBUG, bhvScuttlebug); scuttlebug->oScuttlebugUnkF4 = o->oScuttlebugSpawnerUnkF4; diff --git a/src/game/behaviors/seaweed.inc.c b/src/game/behaviors/seaweed.inc.c index 4399d029..9f38acb3 100644 --- a/src/game/behaviors/seaweed.inc.c +++ b/src/game/behaviors/seaweed.inc.c @@ -5,7 +5,7 @@ void bhv_seaweed_init(void) { } void bhv_seaweed_bundle_init(void) { - struct Object *seaweed; + struct Object* seaweed; seaweed = spawn_object(o, MODEL_SEAWEED, bhvSeaweed); seaweed->oFaceAngleYaw = 14523; diff --git a/src/game/behaviors/seesaw_platform.inc.c b/src/game/behaviors/seesaw_platform.inc.c index 5b2e4bc1..ebf9fdf5 100644 --- a/src/game/behaviors/seesaw_platform.inc.c +++ b/src/game/behaviors/seesaw_platform.inc.c @@ -6,15 +6,10 @@ /** * Collision models for the different seesaw platforms. */ -static Collision const *sSeesawPlatformCollisionModels[] = { - bitdw_seg7_collision_0700F70C, - bits_seg7_collision_0701ADD8, - bits_seg7_collision_0701AE5C, - bob_seg7_collision_bridge, - bitfs_seg7_collision_07015928, - rr_seg7_collision_07029750, - rr_seg7_collision_07029858, - vcutm_seg7_collision_0700AC44, +static Collision const* sSeesawPlatformCollisionModels[] = { + bitdw_seg7_collision_0700F70C, bits_seg7_collision_0701ADD8, bits_seg7_collision_0701AE5C, + bob_seg7_collision_bridge, bitfs_seg7_collision_07015928, rr_seg7_collision_07029750, + rr_seg7_collision_07029858, vcutm_seg7_collision_0700AC44, }; /** @@ -35,7 +30,7 @@ void bhv_seesaw_platform_init(void) { */ void bhv_seesaw_platform_update(void) { UNUSED s32 startPitch = o->oFaceAnglePitch; - o->oFaceAnglePitch += (s32) o->oSeesawPlatformPitchVel; + o->oFaceAnglePitch += (s32)o->oSeesawPlatformPitchVel; if (absf(o->oSeesawPlatformPitchVel) > 10.0f) { cur_obj_play_sound_1(SOUND_ENV_BOAT_ROCKING1); diff --git a/src/game/behaviors/shock_wave.inc.c b/src/game/behaviors/shock_wave.inc.c index a580baa2..d2c38daa 100644 --- a/src/game/behaviors/shock_wave.inc.c +++ b/src/game/behaviors/shock_wave.inc.c @@ -36,8 +36,8 @@ void bhv_bowser_shock_wave_loop(void) { distMin2 = o->oBowserShockWaveScale * sBowserShockwaveHitPoints[2]; distMax2 = o->oBowserShockWaveScale * sBowserShockwaveHitPoints[3]; // If Mario is in between distMin and distMax values, shock him - if ((distMin1 < o->oDistanceToMario && o->oDistanceToMario < distMax1) - || (distMin2 < o->oDistanceToMario && o->oDistanceToMario < distMax2)) { + if ((distMin1 < o->oDistanceToMario && o->oDistanceToMario < distMax1) || + (distMin2 < o->oDistanceToMario && o->oDistanceToMario < distMax2)) { gMarioObject->oInteractStatus |= INT_STATUS_MARIO_SHOCKWAVE; } } diff --git a/src/game/behaviors/skeeter.inc.c b/src/game/behaviors/skeeter.inc.c index 522d38d1..7cb1aefa 100644 --- a/src/game/behaviors/skeeter.inc.c +++ b/src/game/behaviors/skeeter.inc.c @@ -28,8 +28,8 @@ static void skeeter_spawn_waves(void) { s32 i; for (i = 0; i < 4; i++) { - spawn_object_relative_with_scale(0, D_80331C38[i].unk00, 0, D_80331C38[i].unk02, 0.8f, o, - MODEL_IDLE_WATER_WAVE, bhvSkeeterWave); + spawn_object_relative_with_scale(0, D_80331C38[i].unk00, 0, D_80331C38[i].unk02, 0.8f, o, MODEL_IDLE_WATER_WAVE, + bhvSkeeterWave); } } @@ -46,9 +46,8 @@ static void skeeter_act_idle(void) { if (o->oMoveFlags & OBJ_MOVE_AT_WATER_SURFACE) { skeeter_spawn_waves(); - if (o->oTimer > 60 - && obj_smooth_turn(&o->oSkeeterUnk1AC, &o->oMoveAngleYaw, o->oSkeeterTargetAngle, - 0.02f, 5, 50, 200)) { + if (o->oTimer > 60 && + obj_smooth_turn(&o->oSkeeterUnk1AC, &o->oMoveAngleYaw, o->oSkeeterTargetAngle, 0.02f, 5, 50, 200)) { if (o->oSkeeterWaitTime != 0) { o->oSkeeterWaitTime--; } else if (cur_obj_check_if_near_animation_end()) { diff --git a/src/game/behaviors/sl_snowman_wind.inc.c b/src/game/behaviors/sl_snowman_wind.inc.c index 2bdc5ca2..406f955e 100644 --- a/src/game/behaviors/sl_snowman_wind.inc.c +++ b/src/game/behaviors/sl_snowman_wind.inc.c @@ -21,13 +21,13 @@ void bhv_sl_snowman_wind_loop(void) { } vec3f_copy_2(&o->oPosX, tempPos); - // Mario has come close, begin dialog. + // Mario has come close, begin dialog. } else if (o->oSubAction == SL_SNOWMAN_WIND_ACT_TALKING) { if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TEXT_DEFAULT, DIALOG_153, 0)) { o->oSubAction++; } - // Blowing, spawn wind particles (SL_SNOWMAN_WIND_ACT_BLOWING) + // Blowing, spawn wind particles (SL_SNOWMAN_WIND_ACT_BLOWING) } else if (o->oDistanceToMario < 1500.0f && absf(gMarioObject->oPosY - o->oHomeY) < 500.0f) { // Point towards Mario, but only within 0x1500 angle units of the original angle. if ((marioAngleFromWindSource = o->oAngleToMario - o->oSLSnowmanWindOriginalYaw) > 0) { diff --git a/src/game/behaviors/sl_walking_penguin.inc.c b/src/game/behaviors/sl_walking_penguin.inc.c index 11273ebc..8f129f48 100644 --- a/src/game/behaviors/sl_walking_penguin.inc.c +++ b/src/game/behaviors/sl_walking_penguin.inc.c @@ -9,13 +9,13 @@ struct SLWalkingPenguinStep { // The penguin follows a preset list of movements while walking forward. struct SLWalkingPenguinStep sSLWalkingPenguinErraticSteps[] = { - { 60, PENGUIN_ANIM_WALK, 6.0f, 1.0f }, // Walk forwards for 2 seconds - { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second + { 60, PENGUIN_ANIM_WALK, 6.0f, 1.0f }, // Walk forwards for 2 seconds + { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second { 30, PENGUIN_ANIM_WALK, 12.0f, 2.0f }, // Walk forwards quickly for 1 second - { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second + { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second { 30, PENGUIN_ANIM_WALK, -6.0f, 1.0f }, // Walk backwards for 1 second - { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second - { -1, 0, 0.0f, 0.0f }, // Repeat + { 30, PENGUIN_ANIM_IDLE, 0.0f, 1.0f }, // Stop for 1 second + { -1, 0, 0.0f, 0.0f }, // Repeat }; static s32 sl_walking_penguin_turn(void) { @@ -71,8 +71,7 @@ void bhv_sl_walking_penguin_loop(void) { cur_obj_init_animation_with_accel_and_sound( sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].anim, - sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].animSpeed - ); + sSLWalkingPenguinErraticSteps[o->oSLWalkingPenguinCurStep].animSpeed); } break; diff --git a/src/game/behaviors/sliding_platform_2.inc.c b/src/game/behaviors/sliding_platform_2.inc.c index 853bc409..53c69f97 100644 --- a/src/game/behaviors/sliding_platform_2.inc.c +++ b/src/game/behaviors/sliding_platform_2.inc.c @@ -1,6 +1,6 @@ // sliding_platform_2.inc.c -static Collision const *sSlidingPlatform2CollisionData[] = { +static Collision const* sSlidingPlatform2CollisionData[] = { bits_seg7_collision_0701A9A0, bits_seg7_collision_0701AA0C, bitfs_seg7_collision_07015714, diff --git a/src/game/behaviors/snow_mound.inc.c b/src/game/behaviors/snow_mound.inc.c index 3710f86e..17be38d0 100644 --- a/src/game/behaviors/snow_mound.inc.c +++ b/src/game/behaviors/snow_mound.inc.c @@ -25,10 +25,10 @@ void bhv_sliding_snow_mound_loop(void) { } void bhv_snow_mound_spawn_loop(void) { - struct Object *sp1C; + struct Object* sp1C; - if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000) - || o->oPosY + 1000.0f < gMarioObject->header.gfx.pos[1]) { + if (!is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 6000) || + o->oPosY + 1000.0f < gMarioObject->header.gfx.pos[1]) { return; } diff --git a/src/game/behaviors/snowman.inc.c b/src/game/behaviors/snowman.inc.c index a89dc0d6..8c97c89a 100644 --- a/src/game/behaviors/snowman.inc.c +++ b/src/game/behaviors/snowman.inc.c @@ -13,7 +13,7 @@ static struct ObjectHitbox sRollingSphereHitbox = { }; void bhv_snowmans_bottom_init(void) { - struct Object *snowmansHead; + struct Object* snowmansHead; o->oHomeX = o->oPosX; o->oHomeY = o->oPosY; @@ -66,9 +66,9 @@ void snowmans_bottom_act_1(void) { } if (followStatus == PATH_REACHED_END) { - UNUSED s16 sp1E = (u16) o->oAngleToMario - (u16) o->oMoveAngleYaw; - if (obj_check_if_facing_toward_angle(o->oMoveAngleYaw, o->oAngleToMario, 0x2000) == TRUE - && o->oSnowmansBottomUnk1AC == 1) { + UNUSED s16 sp1E = (u16)o->oAngleToMario - (u16)o->oMoveAngleYaw; + if (obj_check_if_facing_toward_angle(o->oMoveAngleYaw, o->oAngleToMario, 0x2000) == TRUE && + o->oSnowmansBottomUnk1AC == 1) { o->oSnowmansBottomUnkF8 = o->oAngleToMario; } else { o->oSnowmansBottomUnkF8 = o->oMoveAngleYaw; @@ -122,8 +122,8 @@ void snowmans_bottom_act_3(void) { void bhv_snowmans_bottom_loop(void) { switch (o->oAction) { case 0: - if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 400) == 1 - && set_mario_npc_dialog(MARIO_DIALOG_LOOK_FRONT) == MARIO_DIALOG_STATUS_SPEAK) { + if (is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 400) == 1 && + set_mario_npc_dialog(MARIO_DIALOG_LOOK_FRONT) == MARIO_DIALOG_STATUS_SPEAK) { s16 response = cutscene_object_with_dialog(CUTSCENE_DIALOG, o, DIALOG_110); if (response != DIALOG_RESPONSE_NONE) { o->oForwardVel = 10.0f; @@ -171,8 +171,7 @@ void bhv_snowmans_head_init(void) { o->oBuoyancy = 2.0f; if ((starFlags & (1 << sp36)) && gCurrActNum != sp36 + 1) { - spawn_object_abs_with_rot(o, 0, MODEL_CCM_SNOWMAN_BASE, bhvBigSnowmanWhole, -4230, -1344, 1813, - 0, 0, 0); + spawn_object_abs_with_rot(o, 0, MODEL_CCM_SNOWMAN_BASE, bhvBigSnowmanWhole, -4230, -1344, 1813, 0, 0, 0); o->oPosX = -4230.0f; o->oPosY = -994.0f; o->oPosZ = 1813.0f; @@ -186,7 +185,8 @@ void bhv_snowmans_head_loop(void) { switch (o->oAction) { case 0: - if (trigger_obj_dialog_when_facing(&o->oSnowmansHeadDialogActive, DIALOG_109, 400.0f, MARIO_DIALOG_LOOK_FRONT)) { + if (trigger_obj_dialog_when_facing(&o->oSnowmansHeadDialogActive, DIALOG_109, 400.0f, + MARIO_DIALOG_LOOK_FRONT)) { o->oAction = 1; } break; @@ -212,7 +212,8 @@ void bhv_snowmans_head_loop(void) { break; case 4: - if (trigger_obj_dialog_when_facing(&o->oSnowmansHeadDialogActive, DIALOG_111, 700.0f, MARIO_DIALOG_LOOK_UP)) { + if (trigger_obj_dialog_when_facing(&o->oSnowmansHeadDialogActive, DIALOG_111, 700.0f, + MARIO_DIALOG_LOOK_UP)) { spawn_mist_particles(); spawn_default_star(-4700.0f, -1024.0f, 1890.0f); o->oAction = 1; diff --git a/src/game/behaviors/snufit.inc.c b/src/game/behaviors/snufit.inc.c index d3a9fc59..c0c3ce39 100644 --- a/src/game/behaviors/snufit.inc.c +++ b/src/game/behaviors/snufit.inc.c @@ -31,14 +31,13 @@ struct ObjectHitbox sSnufitBulletHitbox = { }; /** - * This geo function shifts snufit's mask when it shrinks down, + * This geo function shifts snufit's mask when it shrinks down, * since the parts move independently. */ -Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) { +Gfx* geo_snufit_move_mask(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) { if (callContext == GEO_CONTEXT_RENDER) { - struct Object *obj = (struct Object *) gCurGraphNodeObject; - struct GraphNodeTranslationRotation *transNode - = (struct GraphNodeTranslationRotation *) node->next; + struct Object* obj = (struct Object*)gCurGraphNodeObject; + struct GraphNodeTranslationRotation* transNode = (struct GraphNodeTranslationRotation*)node->next; transNode->translation[0] = obj->oSnufitXOffset; transNode->translation[1] = obj->oSnufitYOffset; @@ -51,10 +50,10 @@ Gfx *geo_snufit_move_mask(s32 callContext, struct GraphNode *node, UNUSED Mat4 * /** * This function scales the body of snufit, which needs done seperately from its mask. */ -Gfx *geo_snufit_scale_body(s32 callContext, struct GraphNode *node, UNUSED Mat4 *c) { +Gfx* geo_snufit_scale_body(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) { if (callContext == GEO_CONTEXT_RENDER) { - struct Object *obj = (struct Object *) gCurGraphNodeObject; - struct GraphNodeScale *scaleNode = (struct GraphNodeScale *) node->next; + struct Object* obj = (struct Object*)gCurGraphNodeObject; + struct GraphNodeScale* scaleNode = (struct GraphNodeScale*)node->next; scaleNode->scale = obj->oSnufitBodyScale / 1000.0f; } @@ -74,12 +73,10 @@ void snufit_act_idle(void) { if (o->oTimer > marioDist && o->oDistanceToMario < 800.0f) { // Controls an alternating scaling factor in a cos. - o->oSnufitBodyScalePeriod - = approach_s16_symmetric(o->oSnufitBodyScalePeriod, 0, 1500); - o->oSnufitBodyBaseScale - = approach_s16_symmetric(o->oSnufitBodyBaseScale, 600, 15); + o->oSnufitBodyScalePeriod = approach_s16_symmetric(o->oSnufitBodyScalePeriod, 0, 1500); + o->oSnufitBodyBaseScale = approach_s16_symmetric(o->oSnufitBodyBaseScale, 600, 15); - if ((s16) o->oSnufitBodyScalePeriod == 0 && o->oSnufitBodyBaseScale == 600) { + if ((s16)o->oSnufitBodyScalePeriod == 0 && o->oSnufitBodyBaseScale == 600) { o->oAction = SNUFIT_ACT_SHOOT; o->oSnufitBullets = 0; } @@ -92,12 +89,10 @@ void snufit_act_idle(void) { * Controls the literal shooting action, spawning three bhvSnufitBalls. */ void snufit_act_shoot(void) { - o->oSnufitBodyScalePeriod - = approach_s16_symmetric(o->oSnufitBodyScalePeriod, -0x8000, 3000); - o->oSnufitBodyBaseScale - = approach_s16_symmetric(o->oSnufitBodyBaseScale, 167, 20); + o->oSnufitBodyScalePeriod = approach_s16_symmetric(o->oSnufitBodyScalePeriod, -0x8000, 3000); + o->oSnufitBodyBaseScale = approach_s16_symmetric(o->oSnufitBodyBaseScale, 167, 20); - if ((u16) o->oSnufitBodyScalePeriod == 0x8000 && o->oSnufitBodyBaseScale == 167) { + if ((u16)o->oSnufitBodyScalePeriod == 0x8000 && o->oSnufitBodyBaseScale == 167) { o->oAction = SNUFIT_ACT_IDLE; } else if (o->oSnufitBullets < 3 && o->oTimer >= 3) { o->oSnufitBullets++; @@ -121,9 +116,9 @@ void bhv_snufit_loop(void) { if (o->oDistanceToMario < 800.0f) { obj_turn_pitch_toward_mario(120.0f, 2000); - if ((s16) o->oMoveAnglePitch > 0x2000) { + if ((s16)o->oMoveAnglePitch > 0x2000) { o->oMoveAnglePitch = 0x2000; - } else if ((s16) o->oMoveAnglePitch < -0x2000) { + } else if ((s16)o->oMoveAnglePitch < -0x2000) { o->oMoveAnglePitch = -0x2000; } @@ -153,9 +148,8 @@ void bhv_snufit_loop(void) { o->oSnufitYOffset = -0x20; o->oSnufitZOffset = o->oSnufitRecoil + 180; - o->oSnufitBodyScale - = (s16)(o->oSnufitBodyBaseScale + 666 - + o->oSnufitBodyBaseScale * coss(o->oSnufitBodyScalePeriod)); + o->oSnufitBodyScale = + (s16)(o->oSnufitBodyBaseScale + 666 + o->oSnufitBodyBaseScale * coss(o->oSnufitBodyScalePeriod)); if (o->oSnufitBodyScale > 1000) { o->oSnufitScale = (o->oSnufitBodyScale - 1000) / 1000.0f + 1.0f; @@ -174,8 +168,7 @@ void bhv_snufit_loop(void) { */ void bhv_snufit_balls_loop(void) { // If far from Mario or in a different room, despawn. - if ((o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) - || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) { + if ((o->activeFlags & ACTIVE_FLAG_IN_DIFFERENT_ROOM) || (o->oTimer != 0 && o->oDistanceToMario > 1500.0f)) { obj_mark_for_deletion(o); } @@ -193,8 +186,7 @@ void bhv_snufit_balls_loop(void) { o->oGravity = -4.0f; cur_obj_become_intangible(); - } else if (o->oAction == 1 - || (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_HIT_WALL))) { + } else if (o->oAction == 1 || (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_HIT_WALL))) { // The Snufit shot Mario and has fulfilled its lonely existance. //! The above check could theoretically be avoided by finding a geometric //! situation that does not trigger those flags (Water?). If found, diff --git a/src/game/behaviors/sparkle_spawn.inc.c b/src/game/behaviors/sparkle_spawn.inc.c index 90b1ac2e..83b77262 100644 --- a/src/game/behaviors/sparkle_spawn.inc.c +++ b/src/game/behaviors/sparkle_spawn.inc.c @@ -8,7 +8,7 @@ */ void bhv_sparkle_spawn_loop(void) { - struct Object *sparkle = try_to_spawn_object(0, 1.0f, o, MODEL_SPARKLES_ANIMATION, bhvSparkle); + struct Object* sparkle = try_to_spawn_object(0, 1.0f, o, MODEL_SPARKLES_ANIMATION, bhvSparkle); if (sparkle != NULL) { obj_translate_xyz_random(sparkle, 90.0f); obj_scale_random(sparkle, 1.0f, 0.0f); diff --git a/src/game/behaviors/sparkle_spawn_star.inc.c b/src/game/behaviors/sparkle_spawn_star.inc.c index 59ba57d3..b3b62b2c 100644 --- a/src/game/behaviors/sparkle_spawn_star.inc.c +++ b/src/game/behaviors/sparkle_spawn_star.inc.c @@ -120,7 +120,7 @@ void bhv_spawned_star_loop(void) { } void bhv_spawn_star_no_level_exit(u32 sp20) { - struct Object *sp1C = spawn_object(o, MODEL_STAR, bhvSpawnedStarNoLevelExit); + struct Object* sp1C = spawn_object(o, MODEL_STAR, bhvSpawnedStarNoLevelExit); sp1C->oBehParams = sp20 << 24; sp1C->oInteractionSubtype = INT_SUBTYPE_NO_EXIT; obj_set_angle(sp1C, 0, 0, 0); diff --git a/src/game/behaviors/spawn_star.inc.c b/src/game/behaviors/spawn_star.inc.c index 96f71a63..97ee87c5 100644 --- a/src/game/behaviors/spawn_star.inc.c +++ b/src/game/behaviors/spawn_star.inc.c @@ -111,9 +111,8 @@ void bhv_star_spawn_loop(void) { } } -struct Object *spawn_star(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C) { - sp30 = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStarSpawnCoordinates, o->oPosX, o->oPosY, - o->oPosZ, 0, 0, 0); +struct Object* spawn_star(struct Object* sp30, f32 sp34, f32 sp38, f32 sp3C) { + sp30 = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStarSpawnCoordinates, o->oPosX, o->oPosY, o->oPosZ, 0, 0, 0); sp30->oBehParams = o->oBehParams; sp30->oHomeX = sp34; sp30->oHomeY = sp38; @@ -124,17 +123,17 @@ struct Object *spawn_star(struct Object *sp30, f32 sp34, f32 sp38, f32 sp3C) { } void spawn_default_star(f32 sp20, f32 sp24, f32 sp28) { - struct Object *sp1C = spawn_star(sp1C, sp20, sp24, sp28); + struct Object* sp1C = spawn_star(sp1C, sp20, sp24, sp28); sp1C->oBehParams2ndByte = 0; } void spawn_red_coin_cutscene_star(f32 sp20, f32 sp24, f32 sp28) { - struct Object *sp1C = spawn_star(sp1C, sp20, sp24, sp28); + struct Object* sp1C = spawn_star(sp1C, sp20, sp24, sp28); sp1C->oBehParams2ndByte = 1; } void spawn_no_exit_star(f32 sp20, f32 sp24, f32 sp28) { - struct Object *sp1C = spawn_star(sp1C, sp20, sp24, sp28); + struct Object* sp1C = spawn_star(sp1C, sp20, sp24, sp28); sp1C->oBehParams2ndByte = 1; sp1C->oInteractionSubtype |= INT_SUBTYPE_NO_EXIT; } @@ -148,8 +147,8 @@ void bhv_hidden_red_coin_star_init(void) { count = count_objects_with_behavior(bhvRedCoin); if (count == 0) { - struct Object *star = spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStar, - o->oPosX, o->oPosY, o->oPosZ, 0, 0, 0); + struct Object* star = + spawn_object_abs_with_rot(o, 0, MODEL_STAR, bhvStar, o->oPosX, o->oPosY, o->oPosZ, 0, 0, 0); star->oBehParams = o->oBehParams; o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } diff --git a/src/game/behaviors/spiny.inc.c b/src/game/behaviors/spiny.inc.c index b62eda74..2947212b 100644 --- a/src/game/behaviors/spiny.inc.c +++ b/src/game/behaviors/spiny.inc.c @@ -78,16 +78,14 @@ static void spiny_act_walk(void) { } if (o->oSpinyTurningAwayFromWall) { - o->oSpinyTurningAwayFromWall = - obj_resolve_collisions_and_turn(o->oSpinyTargetYaw, 0x80); + o->oSpinyTurningAwayFromWall = obj_resolve_collisions_and_turn(o->oSpinyTargetYaw, 0x80); } else { - if (!(o->oSpinyTurningAwayFromWall = - obj_bounce_off_walls_edges_objects(&o->oSpinyTargetYaw))) { + if (!(o->oSpinyTurningAwayFromWall = obj_bounce_off_walls_edges_objects(&o->oSpinyTargetYaw))) { // Walk and occasionally randomly change direction if (o->oSpinyTimeUntilTurn != 0) { o->oSpinyTimeUntilTurn--; } else { - o->oSpinyTargetYaw = o->oMoveAngleYaw + (s16) random_sign() * 0x2000; + o->oSpinyTargetYaw = o->oMoveAngleYaw + (s16)random_sign() * 0x2000; o->oSpinyTimeUntilTurn = random_linear_offset(100, 100); } } @@ -135,8 +133,7 @@ static void spiny_act_held_by_lakitu(void) { o->oMoveAngleYaw = o->parentObj->oFaceAngleYaw; // Move more quickly if the lakitu is moving forward - o->oForwardVel = - o->parentObj->oForwardVel * coss(o->oMoveAngleYaw - o->parentObj->oMoveAngleYaw) + 10.0f; + o->oForwardVel = o->parentObj->oForwardVel * coss(o->oMoveAngleYaw - o->parentObj->oMoveAngleYaw) + 10.0f; o->oVelY = 30.0f; o->oMoveFlags = 0; // you do you, spiny diff --git a/src/game/behaviors/star_door.inc.c b/src/game/behaviors/star_door.inc.c index 23faf8b4..7f0f6bfd 100644 --- a/src/game/behaviors/star_door.inc.c +++ b/src/game/behaviors/star_door.inc.c @@ -9,7 +9,7 @@ void star_door_update_pos(void) { void bhv_star_door_loop(void) { UNUSED u8 filler[4]; - struct Object *sp18 = cur_obj_nearest_object_with_behavior(bhvStarDoor); + struct Object* sp18 = cur_obj_nearest_object_with_behavior(bhvStarDoor); switch (o->oAction) { case 0: @@ -23,7 +23,7 @@ void bhv_star_door_loop(void) { break; case 1: - if (o->oTimer == 0 && (s16) o->oMoveAngleYaw >= 0) { + if (o->oTimer == 0 && (s16)o->oMoveAngleYaw >= 0) { cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_OPEN); #if ENABLE_RUMBLE queue_rumble_data(35, 30); @@ -44,7 +44,7 @@ void bhv_star_door_loop(void) { break; case 3: - if (o->oTimer == 0 && (s16) o->oMoveAngleYaw >= 0) { + if (o->oTimer == 0 && (s16)o->oMoveAngleYaw >= 0) { cur_obj_play_sound_2(SOUND_GENERAL_STAR_DOOR_CLOSE); #if ENABLE_RUMBLE queue_rumble_data(35, 30); diff --git a/src/game/behaviors/strong_wind_particle.inc.c b/src/game/behaviors/strong_wind_particle.inc.c index 993c22a7..6e265a1a 100644 --- a/src/game/behaviors/strong_wind_particle.inc.c +++ b/src/game/behaviors/strong_wind_particle.inc.c @@ -13,7 +13,7 @@ struct ObjectHitbox sStrongWindParticleHitbox = { }; void bhv_strong_wind_particle_loop(void) { - struct Object *penguinObj; + struct Object* penguinObj; f32 distanceFromPenguin; f32 penguinXDist, penguinZDist; @@ -53,15 +53,19 @@ void bhv_strong_wind_particle_loop(void) { void cur_obj_spawn_strong_wind_particles(s32 windSpread, f32 scale, f32 relPosX, f32 relPosY, f32 relPosZ) { // Alternate between tiny particles and regular particles each frame. if (gGlobalTimer & 1) { - // Because the tiny particles are unimportant objects, invisible wind particles are spawned to provide collision. - // There was absolutely no reason to make the smaller particles unimportant, though... - spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, 0.5f, o, MODEL_WHITE_PARTICLE_DL, bhvTinyStrongWindParticle); - spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_NONE, bhvStrongWindParticle); + // Because the tiny particles are unimportant objects, invisible wind particles are spawned to provide + // collision. There was absolutely no reason to make the smaller particles unimportant, though... + spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, 0.5f, o, MODEL_WHITE_PARTICLE_DL, + bhvTinyStrongWindParticle); + spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_NONE, + bhvStrongWindParticle); } else { - spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_MIST, bhvStrongWindParticle); + spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_MIST, + bhvStrongWindParticle); } // There is also no need to spawn additional invisible wind particles here. // If the devs were worried about object overload when making small particles unimportant, why spawn these? // It isn't to ensure collision, as even 1 particle every 2 frames is enough to ensure this reliably. - spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_NONE, bhvStrongWindParticle); + spawn_object_relative_with_scale(windSpread, relPosX, relPosY, relPosZ, scale, o, MODEL_NONE, + bhvStrongWindParticle); } diff --git a/src/game/behaviors/switch_hidden_objects.inc.c b/src/game/behaviors/switch_hidden_objects.inc.c index 0dc44789..f0bc2f77 100644 --- a/src/game/behaviors/switch_hidden_objects.inc.c +++ b/src/game/behaviors/switch_hidden_objects.inc.c @@ -33,7 +33,7 @@ void breakable_box_init(void) { } void hidden_breakable_box_actions(void) { - struct Object *sp1C; + struct Object* sp1C; obj_set_hitbox(o, &sBreakableBoxHitbox); cur_obj_set_model(MODEL_BREAKABLE_BOX_SMALL); @@ -79,7 +79,7 @@ void hidden_breakable_box_actions(void) { } void hidden_unbreakable_box_actions(void) { - struct Object *sp1C; + struct Object* sp1C; obj_set_collision_data(o, wdw_seg7_collision_07018528); diff --git a/src/game/behaviors/thwomp.inc.c b/src/game/behaviors/thwomp.inc.c index 00093c9d..2ecc6ca0 100644 --- a/src/game/behaviors/thwomp.inc.c +++ b/src/game/behaviors/thwomp.inc.c @@ -50,11 +50,7 @@ void grindel_thwomp_act_0(void) { } void (*sGrindelThwompActions[])(void) = { - grindel_thwomp_act_0, - grindel_thwomp_act_1, - grindel_thwomp_act_2, - grindel_thwomp_act_3, - grindel_thwomp_act_4, + grindel_thwomp_act_0, grindel_thwomp_act_1, grindel_thwomp_act_2, grindel_thwomp_act_3, grindel_thwomp_act_4, }; void bhv_grindel_thwomp_loop(void) { diff --git a/src/game/behaviors/tilting_inverted_pyramid.inc.c b/src/game/behaviors/tilting_inverted_pyramid.inc.c index 77193dc7..38a4d166 100644 --- a/src/game/behaviors/tilting_inverted_pyramid.inc.c +++ b/src/game/behaviors/tilting_inverted_pyramid.inc.c @@ -27,7 +27,7 @@ void create_transform_from_normals(Mat4 transform, f32 xNorm, f32 yNorm, f32 zNo * Initialize the object's transform matrix with Y being up. */ void bhv_platform_normals_init(void) { - Mat4 *transform = &o->transform; + Mat4* transform = &o->transform; o->oTiltingPyramidNormalX = 0.0f; o->oTiltingPyramidNormalY = 1.0f; @@ -79,7 +79,7 @@ void bhv_tilting_inverted_pyramid_loop(void) { s32 marioOnPlatform = FALSE; UNUSED u8 filler1[4]; - Mat4 *transform = &o->transform; + Mat4* transform = &o->transform; UNUSED u8 filler2[28]; if (gMarioObject->platform == o) { @@ -94,7 +94,7 @@ void bhv_tilting_inverted_pyramid_loop(void) { dy = 500.0f; dz = gMarioObject->oPosZ - o->oPosZ; d = sqrtf(dx * dx + dy * dy + dz * dz); - + //! Always true since dy = 500, making d >= 500. if (d != 0.0f) { // Normalizing @@ -120,12 +120,13 @@ void bhv_tilting_inverted_pyramid_loop(void) { o->oTiltingPyramidMarioOnPlatform = FALSE; } - // Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object. + // Approach the normals by 0.01f towards the new goal, then create a transform matrix and orient the object. // Outside of the other conditionals since it needs to tilt regardless of whether Mario is on. o->oTiltingPyramidNormalX = approach_by_increment(dx, o->oTiltingPyramidNormalX, 0.01f); o->oTiltingPyramidNormalY = approach_by_increment(dy, o->oTiltingPyramidNormalY, 0.01f); o->oTiltingPyramidNormalZ = approach_by_increment(dz, o->oTiltingPyramidNormalZ, 0.01f); - create_transform_from_normals(*transform, o->oTiltingPyramidNormalX, o->oTiltingPyramidNormalY, o->oTiltingPyramidNormalZ); + create_transform_from_normals(*transform, o->oTiltingPyramidNormalX, o->oTiltingPyramidNormalY, + o->oTiltingPyramidNormalZ); // If Mario is on the platform, adjust his position for the platform tilt. if (marioOnPlatform) { diff --git a/src/game/behaviors/tower_platform.inc.c b/src/game/behaviors/tower_platform.inc.c index aca5c371..75d17870 100644 --- a/src/game/behaviors/tower_platform.inc.c +++ b/src/game/behaviors/tower_platform.inc.c @@ -73,9 +73,9 @@ void bhv_wf_sliding_tower_platform_loop(void) { } } -void spawn_and_init_wf_platforms(s16 a, const BehaviorScript *bhv) { +void spawn_and_init_wf_platforms(s16 a, const BehaviorScript* bhv) { s16 yaw; - struct Object *platform = spawn_object(o, a, bhv); + struct Object* platform = spawn_object(o, a, bhv); yaw = o->oPlatformSpawnerUnkF4 * o->oPlatformSpawnerUnkFC + o->oPlatformSpawnerUnkF8; diff --git a/src/game/behaviors/tox_box.inc.c b/src/game/behaviors/tox_box.inc.c index 47c25b20..9b25685d 100644 --- a/src/game/behaviors/tox_box.inc.c +++ b/src/game/behaviors/tox_box.inc.c @@ -6,7 +6,7 @@ s8 D_8032F924[] = { 4, 1, 4, 1, 7, 1, 7, 1, 7, 1, 2, 6, 1, 6, 1, 6, 1, 5, 1, 5, 1, 6, 1, 5, 1, 5, 1, 2, 4, 1, 4, 1, 7, 1, -1 }; s8 D_8032F948[] = { 4, 1, 4, 1, 4, 1, 4, 1, 4, 1, 2, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 7, 1, 2, 6, 1, 6, 1, 5, 1, 2, 4, 1, 7, 1, -1 }; -s8 *D_8032F96C[] = { D_8032F8F0, D_8032F924, D_8032F948 }; +s8* D_8032F96C[] = { D_8032F8F0, D_8032F924, D_8032F948 }; void tox_box_shake_screen(void) { if (o->oDistanceToMario < 3000.0f) { @@ -20,7 +20,7 @@ void tox_box_move(f32 forwardVel, f32 a1, s16 deltaPitch, s16 deltaRoll) { o->oUpVel = a1; o->oFaceAnglePitch += deltaPitch; - if ((s16) o->oFaceAnglePitch < 0) { + if ((s16)o->oFaceAnglePitch < 0) { deltaRoll = -deltaRoll; } @@ -76,19 +76,13 @@ void tox_box_act_3(void) { } void tox_box_act_0(void) { - s8 *sp1C = D_8032F96C[o->oBehParams2ndByte]; + s8* sp1C = D_8032F96C[o->oBehParams2ndByte]; o->oAction = cur_obj_set_direction_table(sp1C); } void (*sToxBoxActions[])(void) = { - tox_box_act_0, - tox_box_act_1, - tox_box_act_2, - tox_box_act_3, - tox_box_act_4, - tox_box_act_5, - tox_box_act_6, - tox_box_act_7, + tox_box_act_0, tox_box_act_1, tox_box_act_2, tox_box_act_3, + tox_box_act_4, tox_box_act_5, tox_box_act_6, tox_box_act_7, }; void bhv_tox_box_loop(void) { diff --git a/src/game/behaviors/treasure_chest.inc.c b/src/game/behaviors/treasure_chest.inc.c index 55a6b0cc..874ba964 100644 --- a/src/game/behaviors/treasure_chest.inc.c +++ b/src/game/behaviors/treasure_chest.inc.c @@ -16,7 +16,7 @@ static struct ObjectHitbox sTreasureChestBottomHitbox = { }; void bhv_treasure_chest_top_loop(void) { - struct Object *sp34 = o->parentObj->parentObj; + struct Object* sp34 = o->parentObj->parentObj; switch (o->oAction) { case 0: @@ -68,9 +68,10 @@ void bhv_treasure_chest_bottom_init(void) { void bhv_treasure_chest_bottom_loop(void) { switch (o->oAction) { case 0: - if (obj_check_if_facing_toward_angle(o->oMoveAngleYaw, gMarioObject->header.gfx.angle[1] + 0x8000, 0x3000) - && is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 150) - && !o->parentObj->oTreasureChestUnkF8) { + if (obj_check_if_facing_toward_angle(o->oMoveAngleYaw, gMarioObject->header.gfx.angle[1] + 0x8000, + 0x3000) && + is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, 150) && + !o->parentObj->oTreasureChestUnkF8) { if (o->parentObj->oTreasureChestUnkF4 == o->oBehParams2ndByte) { play_sound(SOUND_GENERAL2_RIGHT_ANSWER, gGlobalSoundSource); o->parentObj->oTreasureChestUnkF4++; @@ -104,8 +105,8 @@ void bhv_treasure_chest_bottom_loop(void) { } void spawn_treasure_chest(s8 sp3B, s32 x, s32 y, s32 z, s16 yaw) { - struct Object *sp34 = spawn_object_abs_with_rot(o, 0, MODEL_TREASURE_CHEST_BASE, - bhvTreasureChestBottom, x, y, z, 0, yaw, 0); + struct Object* sp34 = + spawn_object_abs_with_rot(o, 0, MODEL_TREASURE_CHEST_BASE, bhvTreasureChestBottom, x, y, z, 0, yaw, 0); sp34->oBehParams2ndByte = sp3B; } diff --git a/src/game/behaviors/tree_particles.inc.c b/src/game/behaviors/tree_particles.inc.c index 7fca3654..82cebf78 100644 --- a/src/game/behaviors/tree_particles.inc.c +++ b/src/game/behaviors/tree_particles.inc.c @@ -44,7 +44,7 @@ void bhv_tree_snow_or_leaf_loop(void) { } void bhv_snow_leaf_particle_spawn_init(void) { - struct Object *obj; // Either snow or leaf + struct Object* obj; // Either snow or leaf UNUSED u8 filler1[4]; s32 isSnow; f32 scale; diff --git a/src/game/behaviors/triplet_butterfly.inc.c b/src/game/behaviors/triplet_butterfly.inc.c index d39a3164..d271d715 100644 --- a/src/game/behaviors/triplet_butterfly.inc.c +++ b/src/game/behaviors/triplet_butterfly.inc.c @@ -2,7 +2,7 @@ struct TripletButterflyActivationData { s32 model; - const BehaviorScript *behavior; + const BehaviorScript* behavior; f32 scale; }; @@ -62,10 +62,10 @@ static void triplet_butterfly_act_wander(void) { if (o->oTimer < 60) { o->oTripletButterflyTargetYaw = cur_obj_angle_to_home(); } else { - o->oTripletButterflyTargetYaw = (s32) o->oTripletButterflyBaseYaw; + o->oTripletButterflyTargetYaw = (s32)o->oTripletButterflyBaseYaw; - if (o->oTimer > 110 && o->oDistanceToMario < 200.0f - && o->oTripletButterflyType > TRIPLET_BUTTERFLY_TYPE_NORMAL) { + if (o->oTimer > 110 && o->oDistanceToMario < 200.0f && + o->oTripletButterflyType > TRIPLET_BUTTERFLY_TYPE_NORMAL) { o->oAction = TRIPLET_BUTTERFLY_ACT_ACTIVATE; o->oTripletButterflySpeed = 0.0f; } @@ -95,8 +95,7 @@ static void triplet_butterfly_act_activate(void) { obj_set_billboard(o); o->oTripletButterflyScale = 0.0f; o->oHomeY = o->oPosY; - } else if (o->oTripletButterflyScale - >= sTripletButterflyActivationData[o->oTripletButterflyType].scale) { + } else if (o->oTripletButterflyScale >= sTripletButterflyActivationData[o->oTripletButterflyType].scale) { if (o->oTripletButterflyType != TRIPLET_BUTTERFLY_TYPE_EXPLODES) { spawn_object(o, o->oTripletButterflyModel, sTripletButterflyActivationData[o->oTripletButterflyType].behavior); @@ -107,8 +106,7 @@ static void triplet_butterfly_act_activate(void) { } } - o->oTripletButterflyScale += - sTripletButterflyActivationData[o->oTripletButterflyType].scale / 30.0f; + o->oTripletButterflyScale += sTripletButterflyActivationData[o->oTripletButterflyType].scale / 30.0f; if (o->oTripletButterflyType == TRIPLET_BUTTERFLY_TYPE_EXPLODES) { o->oGraphYOffset = 250.0f * o->oTripletButterflyScale; o->oPosY = o->oHomeY - o->oGraphYOffset; diff --git a/src/game/behaviors/ttc_2d_rotator.inc.c b/src/game/behaviors/ttc_2d_rotator.inc.c index a403381c..a15d5141 100644 --- a/src/game/behaviors/ttc_2d_rotator.inc.c +++ b/src/game/behaviors/ttc_2d_rotator.inc.c @@ -37,8 +37,7 @@ static s16 sTTC2DRotatorTimeBetweenTurns[][4] = { * Init function for bhvTTC2DRotator. */ void bhv_ttc_2d_rotator_init(void) { - o->oTTC2DRotatorMinTimeUntilNextTurn = - sTTC2DRotatorTimeBetweenTurns[o->oBehParams2ndByte][gTTCSpeedSetting]; + o->oTTC2DRotatorMinTimeUntilNextTurn = sTTC2DRotatorTimeBetweenTurns[o->oBehParams2ndByte][gTTCSpeedSetting]; o->oTTC2DRotatorIncrement = o->oTTC2DRotatorSpeed = sTTC2DRotatorSpeeds[o->oBehParams2ndByte]; } @@ -55,8 +54,7 @@ void bhv_ttc_2d_rotator_update(void) { } // Wait until rotated to target yaw - if (o->oTTC2DRotatorMinTimeUntilNextTurn != 0 - && obj_face_yaw_approach(o->oTTC2DRotatorTargetYaw, 0xC8)) { + if (o->oTTC2DRotatorMinTimeUntilNextTurn != 0 && obj_face_yaw_approach(o->oTTC2DRotatorTargetYaw, 0xC8)) { // and until MinTimeUntilNextTurn has passed. if (o->oTimer > o->oTTC2DRotatorMinTimeUntilNextTurn) { // Increment target yaw diff --git a/src/game/behaviors/ttc_cog.inc.c b/src/game/behaviors/ttc_cog.inc.c index 7d15c911..f7c4447e 100644 --- a/src/game/behaviors/ttc_cog.inc.c +++ b/src/game/behaviors/ttc_cog.inc.c @@ -7,7 +7,7 @@ /** * Collision model for hexagon and triangle, respectively. */ -static Collision const *sTTCCogCollisionModels[] = { +static Collision const* sTTCCogCollisionModels[] = { ttc_seg7_collision_07015584, ttc_seg7_collision_07015650, }; @@ -26,8 +26,8 @@ static s16 sTTCCogNormalSpeeds[] = { 200, 400 }; * Init function for bhvTTCCog. */ void bhv_ttc_cog_init(void) { - o->collisionData = segmented_to_virtual( - sTTCCogCollisionModels[(o->oBehParams2ndByte & TTC_COG_BP_SHAPE_MASK) >> 1]); + o->collisionData = + segmented_to_virtual(sTTCCogCollisionModels[(o->oBehParams2ndByte & TTC_COG_BP_SHAPE_MASK) >> 1]); o->oTTCCogDir = sTTCCogDirections[o->oBehParams2ndByte & TTC_COG_BP_DIR_MASK]; } diff --git a/src/game/behaviors/ttc_elevator.inc.c b/src/game/behaviors/ttc_elevator.inc.c index f0f4fe12..e3efd531 100644 --- a/src/game/behaviors/ttc_elevator.inc.c +++ b/src/game/behaviors/ttc_elevator.inc.c @@ -19,8 +19,7 @@ static s8 sTTCElevatorSpeeds[] = { void bhv_ttc_elevator_init(void) { // If behParam is nonzero, then move 100 * behParam units. Otherwise default // to 500 - f32 peakOffset = - ((o->oBehParams >> 16) & 0xFFFF) ? 100.0f * ((o->oBehParams >> 16) & 0xFFFF) : 500.0f; + f32 peakOffset = ((o->oBehParams >> 16) & 0xFFFF) ? 100.0f * ((o->oBehParams >> 16) & 0xFFFF) : 500.0f; o->oTTCElevatorPeakY = o->oPosY + peakOffset; } diff --git a/src/game/behaviors/ttc_moving_bar.inc.c b/src/game/behaviors/ttc_moving_bar.inc.c index fb6efe05..9e6adc63 100644 --- a/src/game/behaviors/ttc_moving_bar.inc.c +++ b/src/game/behaviors/ttc_moving_bar.inc.c @@ -95,9 +95,9 @@ static void ttc_moving_bar_reset(void) { */ static void ttc_moving_bar_act_extend(void) { // If we passed the 250 threshold and we have decelerated enough - if ((o->oTTCMovingBarOffset == 250.0f - || (250.0f - o->oTTCMovingBarOffset) * (250.0f - o->oTTCMovingBarStartOffset) < 0.0f) - && o->oTTCMovingBarSpeed > -8.0f && o->oTTCMovingBarSpeed < 8.0f) { + if ((o->oTTCMovingBarOffset == 250.0f || + (250.0f - o->oTTCMovingBarOffset) * (250.0f - o->oTTCMovingBarStartOffset) < 0.0f) && + o->oTTCMovingBarSpeed > -8.0f && o->oTTCMovingBarSpeed < 8.0f) { // Begin retracting o->oAction = TTC_MOVING_BAR_ACT_RETRACT; o->oTTCMovingBarSpeed = 0.0f; @@ -120,8 +120,8 @@ static void ttc_moving_bar_act_extend(void) { // When we pass neutral on random setting, then stop immediately with // 25% probability (fake out) - if (gTTCSpeedSetting == TTC_SPEED_RANDOM - && o->oTTCMovingBarOffset * o->oTTCMovingBarStartOffset < 0.0f && random_u16() % 4 == 0) { + if (gTTCSpeedSetting == TTC_SPEED_RANDOM && o->oTTCMovingBarOffset * o->oTTCMovingBarStartOffset < 0.0f && + random_u16() % 4 == 0) { ttc_moving_bar_reset(); } } diff --git a/src/game/behaviors/ttc_pendulum.inc.c b/src/game/behaviors/ttc_pendulum.inc.c index a492a4ce..6ae31ef5 100644 --- a/src/game/behaviors/ttc_pendulum.inc.c +++ b/src/game/behaviors/ttc_pendulum.inc.c @@ -81,6 +81,6 @@ void bhv_ttc_pendulum_update(void) { } else { } - o->oFaceAngleRoll = (s32) o->oTTCPendulumAngle; + o->oFaceAngleRoll = (s32)o->oTTCPendulumAngle; // Note: no platform displacement } diff --git a/src/game/behaviors/ttc_pit_block.inc.c b/src/game/behaviors/ttc_pit_block.inc.c index ccc45f58..af188497 100644 --- a/src/game/behaviors/ttc_pit_block.inc.c +++ b/src/game/behaviors/ttc_pit_block.inc.c @@ -7,7 +7,7 @@ /** * Collision models. The second one is unused. */ -static Collision const *sTTCPitBlockCollisionModels[] = { +static Collision const* sTTCPitBlockCollisionModels[] = { ttc_seg7_collision_07015754, ttc_seg7_collision_070157D8, }; @@ -59,8 +59,7 @@ void bhv_ttc_pit_block_update(void) { o->oTTCPitBlockDir = o->oTTCPitBlockDir ^ 0x01; if ((o->oTTCPitBlockWaitTime = - sTTCPitBlockProperties[gTTCSpeedSetting][o->oTTCPitBlockDir & 0x01].waitTime) - < 0) { + sTTCPitBlockProperties[gTTCSpeedSetting][o->oTTCPitBlockDir & 0x01].waitTime) < 0) { o->oTTCPitBlockWaitTime = random_mod_offset(10, 20, 6); } diff --git a/src/game/behaviors/ttc_rotating_solid.inc.c b/src/game/behaviors/ttc_rotating_solid.inc.c index 6a7a5a5b..21bc3b9c 100644 --- a/src/game/behaviors/ttc_rotating_solid.inc.c +++ b/src/game/behaviors/ttc_rotating_solid.inc.c @@ -7,7 +7,7 @@ /** * The collision models for cube and triangular prism, respectively. */ -static Collision const *sTTCRotatingSolidCollisionModels[] = { +static Collision const* sTTCRotatingSolidCollisionModels[] = { ttc_seg7_collision_07014F70, ttc_seg7_collision_07015008, }; @@ -47,8 +47,7 @@ void bhv_ttc_rotating_solid_update(void) { } } else if (o->oTTCRotatingSolidVelY > 0.0f && o->oPosY >= o->oHomeY) { // 4. Rotate - s32 targetRoll = - (s32)((f32) o->oTTCRotatingSolidNumTurns / o->oTTCRotatingSolidNumSides * 0x10000); + s32 targetRoll = (s32)((f32)o->oTTCRotatingSolidNumTurns / o->oTTCRotatingSolidNumSides * 0x10000); s32 startRoll = o->oFaceAngleRoll; obj_face_roll_approach(targetRoll, 1200); @@ -57,8 +56,7 @@ void bhv_ttc_rotating_solid_update(void) { if (o->oAngleVelRoll == 0) { cur_obj_play_sound_2(SOUND_GENERAL2_ROTATING_BLOCK_CLICK); - o->oTTCRotatingSolidNumTurns = - (o->oTTCRotatingSolidNumTurns + 1) % o->oTTCRotatingSolidNumSides; + o->oTTCRotatingSolidNumTurns = (o->oTTCRotatingSolidNumTurns + 1) % o->oTTCRotatingSolidNumSides; o->oTimer = 0; if (gTTCSpeedSetting == TTC_SPEED_RANDOM) { diff --git a/src/game/behaviors/ttc_treadmill.inc.c b/src/game/behaviors/ttc_treadmill.inc.c index 3b5b3cd3..e012a8e3 100644 --- a/src/game/behaviors/ttc_treadmill.inc.c +++ b/src/game/behaviors/ttc_treadmill.inc.c @@ -9,7 +9,7 @@ /** * Collision models for the different sized treadmills. */ -static Collision const *sTTCTreadmillCollisionModels[] = { +static Collision const* sTTCTreadmillCollisionModels[] = { ttc_seg7_collision_070152B4, ttc_seg7_collision_070153E0, }; diff --git a/src/game/behaviors/tumbling_bridge.inc.c b/src/game/behaviors/tumbling_bridge.inc.c index fb158197..dc7907e2 100644 --- a/src/game/behaviors/tumbling_bridge.inc.c +++ b/src/game/behaviors/tumbling_bridge.inc.c @@ -10,7 +10,7 @@ struct Struct8032F34C { s16 bridgeRelativeStartingXorZ; s16 platformWidth; s16 model; - const Collision *collision; + const Collision* collision; }; struct Struct8032F34C sTumblingBridgeParams[] = { @@ -62,7 +62,7 @@ void bhv_tumbling_bridge_platform_loop(void) { } void tumbling_bridge_act_1(void) { - struct Object *platformObj; + struct Object* platformObj; s32 i; s32 bridgeID = o->oBehParams2ndByte; s32 relativePlatformX; @@ -75,11 +75,11 @@ void tumbling_bridge_act_1(void) { relativePlatformZ = 0; if (bridgeID == 3) { - relativePlatformX = sTumblingBridgeParams[bridgeID].bridgeRelativeStartingXorZ - + sTumblingBridgeParams[bridgeID].platformWidth * i; + relativePlatformX = sTumblingBridgeParams[bridgeID].bridgeRelativeStartingXorZ + + sTumblingBridgeParams[bridgeID].platformWidth * i; } else { - relativePlatformZ = sTumblingBridgeParams[bridgeID].bridgeRelativeStartingXorZ - + sTumblingBridgeParams[bridgeID].platformWidth * i; + relativePlatformZ = sTumblingBridgeParams[bridgeID].bridgeRelativeStartingXorZ + + sTumblingBridgeParams[bridgeID].platformWidth * i; } if (cur_obj_has_behavior(bhvLllTumblingBridge)) { @@ -89,9 +89,9 @@ void tumbling_bridge_act_1(void) { relativeInitialPlatformY = 450; } - platformObj = spawn_object_relative( - 0, relativePlatformX, relativePlatformY + relativeInitialPlatformY, relativePlatformZ, o, - sTumblingBridgeParams[bridgeID].model, bhvTumblingBridgePlatform); + platformObj = + spawn_object_relative(0, relativePlatformX, relativePlatformY + relativeInitialPlatformY, relativePlatformZ, + o, sTumblingBridgeParams[bridgeID].model, bhvTumblingBridgePlatform); obj_set_collision_data(platformObj, sTumblingBridgeParams[bridgeID].collision); } diff --git a/src/game/behaviors/tuxie.inc.c b/src/game/behaviors/tuxie.inc.c index 49195f53..76a39f80 100644 --- a/src/game/behaviors/tuxie.inc.c +++ b/src/game/behaviors/tuxie.inc.c @@ -16,7 +16,7 @@ void play_penguin_walking_sound(s32 walk) { void tuxies_mother_act_2(void) { f32 sp24; UNUSED u8 filler[4]; - struct Object *sp1C = cur_obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp24); + struct Object* sp1C = cur_obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp24); if (cur_obj_find_nearby_held_actor(bhvUnused20E0, 1000.0f) != NULL) { if (o->oSubAction == 0) { @@ -59,8 +59,8 @@ void tuxies_mother_act_1(void) { } else { dialogID = DIALOG_059; } - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, dialogID)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, + CUTSCENE_DIALOG, dialogID)) { if (dialogID == DIALOG_058) { o->oSubAction = 1; } else { @@ -85,7 +85,7 @@ void tuxies_mother_act_1(void) { // or 1, which is not affected by the bitwise AND. o->prevObj->OBJECT_FIELD_S32(o->oInteractionSubtype) &= ~INT_SUBTYPE_DROP_IMMEDIATELY; obj_set_behavior(o->prevObj, bhvUnused20E0); - if(ROM_JP) { + if (ROM_JP) { spawn_default_star(3500.0f, -4300.0f, 4650.0f); } else { cur_obj_spawn_star_at_y_offset(3167.0f, -4300.0f, 5108.0f, 200.0f); @@ -108,7 +108,7 @@ void tuxies_mother_act_1(void) { void tuxies_mother_act_0(void) { s32 sp2C = FALSE; f32 sp28; - struct Object *sp24 = cur_obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp28); + struct Object* sp24 = cur_obj_find_nearest_object_with_behavior(bhvSmallPenguin, &sp28); cur_obj_scale(4.0f); cur_obj_init_animation_with_sound(3); @@ -129,8 +129,8 @@ void tuxies_mother_act_0(void) { } break; case 1: - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_057)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, + CUTSCENE_DIALOG, DIALOG_057)) { o->oSubAction++; } break; @@ -172,8 +172,7 @@ void small_penguin_dive_with_mario(void) { void small_penguin_act_2(void) { s32 sp1C = FALSE; - if (o->oTimer == 0 - && cur_obj_dist_to_nearest_object_with_behavior(bhvTuxiesMother) < 1000.0f) { + if (o->oTimer == 0 && cur_obj_dist_to_nearest_object_with_behavior(bhvTuxiesMother) < 1000.0f) { sp1C = TRUE; } cur_obj_init_animation_with_sound(0); @@ -252,7 +251,7 @@ void small_penguin_act_0(void) { void small_penguin_act_5(void) { f32 sp24; s16 sp22; - struct Object *sp1C = cur_obj_nearest_object_with_behavior(bhvTuxiesMother); + struct Object* sp1C = cur_obj_nearest_object_with_behavior(bhvTuxiesMother); if (sp1C != NULL) { if (o->oDistanceToMario < 1000.0f) { @@ -277,12 +276,8 @@ void small_penguin_act_5(void) { } void (*sSmallPenguinActions[])(void) = { - small_penguin_act_0, - small_penguin_act_1, - small_penguin_act_2, - small_penguin_act_3, - small_penguin_act_4, - small_penguin_act_5, + small_penguin_act_0, small_penguin_act_1, small_penguin_act_2, + small_penguin_act_3, small_penguin_act_4, small_penguin_act_5, }; void small_penguin_free_actions(void) { @@ -308,7 +303,7 @@ void bhv_small_penguin_loop(void) { } obj_copy_pos(o, gMarioObject); if (gGlobalTimer % 30 == 0) { - if(ROM_JP) { + if (ROM_JP) { play_sound(SOUND_OBJ2_BABY_PENGUIN_YELL, o->header.gfx.cameraToObject); } else { play_sound(SOUND_OBJ2_BABY_PENGUIN_YELL, gMarioObject->header.gfx.cameraToObject); @@ -327,10 +322,10 @@ void bhv_small_penguin_loop(void) { /** Geo switch logic for Tuxie's mother's eyes. Cases 0-4. Interestingly, case * 4 is unused, and is the eye state seen in Shoshinkai 1995 footage. */ -Gfx *geo_switch_tuxie_mother_eyes(s32 run, struct GraphNode *node, UNUSED Mat4 *mtx) { +Gfx* geo_switch_tuxie_mother_eyes(s32 run, struct GraphNode* node, UNUSED Mat4* mtx) { if (run == TRUE) { - struct Object *obj = (struct Object *) gCurGraphNodeObject; - struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node; + struct Object* obj = (struct Object*)gCurGraphNodeObject; + struct GraphNodeSwitchCase* switchCase = (struct GraphNodeSwitchCase*)node; s32 timer; switchCase->selectedCase = 0; diff --git a/src/game/behaviors/tweester.inc.c b/src/game/behaviors/tweester.inc.c index 8bd28c63..c1d491a8 100644 --- a/src/game/behaviors/tweester.inc.c +++ b/src/game/behaviors/tweester.inc.c @@ -23,15 +23,12 @@ struct ObjectHitbox sTweesterHitbox = { * its forward velocity. */ void tweester_scale_and_move(f32 preScale) { - s16 dYaw = 0x2C00; + s16 dYaw = 0x2C00; f32 scale = preScale * 0.4; - o->header.gfx.scale[0] - = (( coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale; - o->header.gfx.scale[1] - = ((-coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.5 + 0.5) * scale; - o->header.gfx.scale[2] - = (( coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale; + o->header.gfx.scale[0] = ((coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale; + o->header.gfx.scale[1] = ((-coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.5 + 0.5) * scale; + o->header.gfx.scale[2] = ((coss(o->oTweesterScaleTimer) + 1.0) * 0.5 * 0.3 + 1.0) * scale; o->oTweesterScaleTimer += 0x200; o->oForwardVel = 14.0f; @@ -77,8 +74,7 @@ void tweester_act_chase(void) { o->oAngleToHome = cur_obj_angle_to_home(); cur_obj_play_sound_1(SOUND_ENV_WIND1); - if (cur_obj_lateral_dist_from_mario_to_home() < activationRadius - && o->oSubAction == TWEESTER_SUB_ACT_CHASE) { + if (cur_obj_lateral_dist_from_mario_to_home() < activationRadius && o->oSubAction == TWEESTER_SUB_ACT_CHASE) { o->oForwardVel = 20.0f; cur_obj_rotate_yaw_toward(o->oAngleToMario, 0x200); @@ -138,7 +134,7 @@ void (*sTweesterActions[])(void) = { }; /** - * Loop behavior for Tweester. + * Loop behavior for Tweester. * Loads the hitbox and calls its relevant action. */ void bhv_tweester_loop(void) { diff --git a/src/game/behaviors/ukiki.inc.c b/src/game/behaviors/ukiki.inc.c index ffc3e2d5..4108aec9 100644 --- a/src/game/behaviors/ukiki.inc.c +++ b/src/game/behaviors/ukiki.inc.c @@ -26,8 +26,7 @@ void handle_cap_ukiki_reset(void) { * the cap ukiki. */ s32 is_cap_ukiki_and_mario_has_normal_cap_on_head(void) { - if (o->oBehParams2ndByte == UKIKI_CAP - && does_mario_have_normal_cap_on_head(gMarioState)) { + if (o->oBehParams2ndByte == UKIKI_CAP && does_mario_have_normal_cap_on_head(gMarioState)) { return TRUE; } @@ -37,12 +36,12 @@ s32 is_cap_ukiki_and_mario_has_normal_cap_on_head(void) { /** * Unused copy of geo_update_projectile_pos_from_parent. Perhaps a copy paste mistake. */ -Gfx *geo_update_projectile_pos_from_parent_copy(s32 run,UNUSED struct GraphNode *node, Mat4 mtx) { +Gfx* geo_update_projectile_pos_from_parent_copy(s32 run, UNUSED struct GraphNode* node, Mat4 mtx) { Mat4 mtx2; if (run == TRUE) { // TODO: change global type to Object pointer - struct Object *obj = (struct Object *) gCurGraphNodeObject; + struct Object* obj = (struct Object*)gCurGraphNodeObject; if (obj->prevObj != NULL) { create_transformation_from_matrices(mtx2, mtx, *gCurGraphNodeCamera->matrixPtr); @@ -270,12 +269,10 @@ void ukiki_act_run(void) { } if (fleeMario && o->oDistanceToMario < 200.0f) { - if ((o->oMoveFlags & OBJ_MOVE_HIT_WALL) - && is_mario_moving_fast_or_in_air(10)) { + if ((o->oMoveFlags & OBJ_MOVE_HIT_WALL) && is_mario_moving_fast_or_in_air(10)) { o->oAction = UKIKI_ACT_JUMP; o->oMoveAngleYaw = o->oWallAngle; - } else if ((o->oMoveFlags & OBJ_MOVE_HIT_EDGE) - && is_mario_moving_fast_or_in_air(10)) { + } else if ((o->oMoveFlags & OBJ_MOVE_HIT_EDGE) && is_mario_moving_fast_or_in_air(10)) { o->oAction = UKIKI_ACT_JUMP; o->oMoveAngleYaw += 0x8000; } @@ -293,8 +290,8 @@ void ukiki_act_jump(void) { if (o->oSubAction == 0) { if (o->oTimer == 0) { cur_obj_set_y_vel_and_animation(random_float() * 10.0f + 45.0f, UKIKI_ANIM_JUMP); - } else if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE - | OBJ_MOVE_UNDERWATER_ON_GROUND)) { + } else if (o->oMoveFlags & + (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_UNDERWATER_ON_GROUND)) { o->oSubAction++; o->oVelY = 0.0f; } @@ -313,18 +310,12 @@ void ukiki_act_jump(void) { * Waypoints that lead from the top of the mountain to the cage. */ static Trajectory sCageUkikiPath[] = { - TRAJECTORY_POS(0, /*pos*/ 1011, 2306, -285), - TRAJECTORY_POS(0, /*pos*/ 1151, 2304, -510), - TRAJECTORY_POS(0, /*pos*/ 1723, 1861, -964), - TRAJECTORY_POS(0, /*pos*/ 2082, 1775, -1128), - TRAJECTORY_POS(0, /*pos*/ 2489, 1717, -1141), - TRAJECTORY_POS(0, /*pos*/ 2662, 1694, -1140), - TRAJECTORY_POS(0, /*pos*/ 2902, 1536, -947), - TRAJECTORY_POS(0, /*pos*/ 2946, 1536, -467), - TRAJECTORY_POS(0, /*pos*/ 2924, 1536, 72), - TRAJECTORY_POS(0, /*pos*/ 2908, 1536, 536), - TRAJECTORY_POS(0, /*pos*/ 2886, 1536, 783), - TRAJECTORY_END(), + TRAJECTORY_POS(0, /*pos*/ 1011, 2306, -285), TRAJECTORY_POS(0, /*pos*/ 1151, 2304, -510), + TRAJECTORY_POS(0, /*pos*/ 1723, 1861, -964), TRAJECTORY_POS(0, /*pos*/ 2082, 1775, -1128), + TRAJECTORY_POS(0, /*pos*/ 2489, 1717, -1141), TRAJECTORY_POS(0, /*pos*/ 2662, 1694, -1140), + TRAJECTORY_POS(0, /*pos*/ 2902, 1536, -947), TRAJECTORY_POS(0, /*pos*/ 2946, 1536, -467), + TRAJECTORY_POS(0, /*pos*/ 2924, 1536, 72), TRAJECTORY_POS(0, /*pos*/ 2908, 1536, 536), + TRAJECTORY_POS(0, /*pos*/ 2886, 1536, 783), TRAJECTORY_END(), }; /** @@ -332,7 +323,7 @@ static Trajectory sCageUkikiPath[] = { * our death. Ukiki is a tad suicidal. */ void ukiki_act_go_to_cage(void) { - struct Object *obj; + struct Object* obj; f32 latDistToCage = 0.0f; s16 yawToCage = 0; obj = cur_obj_nearest_object_with_behavior(bhvUkikiCageChild); @@ -352,7 +343,7 @@ void ukiki_act_go_to_cage(void) { case UKIKI_SUB_ACT_CAGE_RUN_TO_CAGE: cur_obj_init_animation_with_sound(UKIKI_ANIM_RUN); - o->oPathedStartWaypoint = (struct Waypoint *) sCageUkikiPath; + o->oPathedStartWaypoint = (struct Waypoint*)sCageUkikiPath; if (cur_obj_follow_path(0) != PATH_REACHED_END) { o->oForwardVel = 10.0f; @@ -377,8 +368,8 @@ void ukiki_act_go_to_cage(void) { case UKIKI_SUB_ACT_CAGE_TALK_TO_MARIO: cur_obj_init_animation_with_sound(UKIKI_ANIM_HANDSTAND); - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_080)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, + DIALOG_080)) { o->oSubAction++; } break; @@ -436,19 +427,19 @@ void ukiki_act_go_to_cage(void) { * SoundState number. */ struct SoundState sUkikiSoundStates[] = { - {1, 1, 10, SOUND_OBJ_UKIKI_STEP_DEFAULT}, - {0, 0, 0, NO_SOUND}, - {0, 0, 0, NO_SOUND}, - {0, 0, 0, NO_SOUND}, - {1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_SHORT}, - {1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_LONG}, - {0, 0, 0, NO_SOUND}, - {0, 0, 0, NO_SOUND}, - {1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_LONG}, - {1, 0, -1, SOUND_OBJ_UKIKI_STEP_LEAVES}, - {1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_IDLE}, - {0, 0, 0, NO_SOUND}, - {0, 0, 0, NO_SOUND}, + { 1, 1, 10, SOUND_OBJ_UKIKI_STEP_DEFAULT }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_SHORT }, + { 1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_LONG }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, + { 1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_LONG }, + { 1, 0, -1, SOUND_OBJ_UKIKI_STEP_LEAVES }, + { 1, 0, -1, SOUND_OBJ_UKIKI_CHATTER_IDLE }, + { 0, 0, 0, NO_SOUND }, + { 0, 0, 0, NO_SOUND }, }; /** @@ -456,14 +447,9 @@ struct SoundState sUkikiSoundStates[] = { * every frame. */ void (*sUkikiActions[])(void) = { - ukiki_act_idle, - ukiki_act_run, - ukiki_act_turn_to_mario, - ukiki_act_jump, - ukiki_act_go_to_cage, - ukiki_act_wait_to_respawn, - ukiki_act_unused_turn, - ukiki_act_return_home, + ukiki_act_idle, ukiki_act_run, ukiki_act_turn_to_mario, + ukiki_act_jump, ukiki_act_go_to_cage, ukiki_act_wait_to_respawn, + ukiki_act_unused_turn, ukiki_act_return_home, }; /** @@ -573,8 +559,8 @@ void cap_ukiki_held_loop(void) { break; case UKIKI_TEXT_HAS_CAP: - if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, - (DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), DIALOG_101, 0)) { + if (cur_obj_update_dialog(MARIO_DIALOG_LOOK_UP, (DIALOG_FLAG_TEXT_DEFAULT | DIALOG_FLAG_TIME_STOP_ENABLED), + DIALOG_101, 0)) { mario_retrieve_cap(); set_mario_npc_dialog(MARIO_DIALOG_STOP); o->oUkikiHasCap &= ~UKIKI_CAP_ON; @@ -593,8 +579,7 @@ void cap_ukiki_held_loop(void) { * Initializatation for ukiki, determines if it has Mario's cap. */ void bhv_ukiki_init(void) { - if ((o->oBehParams2ndByte == UKIKI_CAP) - && (save_file_get_flags() & SAVE_FLAG_CAP_ON_UKIKI)) { + if ((o->oBehParams2ndByte == UKIKI_CAP) && (save_file_get_flags() & SAVE_FLAG_CAP_ON_UKIKI)) { o->oUkikiTextState = UKIKI_TEXT_HAS_CAP; o->oUkikiHasCap |= UKIKI_CAP_ON; } diff --git a/src/game/behaviors/ukiki_cage.inc.c b/src/game/behaviors/ukiki_cage.inc.c index 206268d1..07b5a9f4 100644 --- a/src/game/behaviors/ukiki_cage.inc.c +++ b/src/game/behaviors/ukiki_cage.inc.c @@ -18,8 +18,8 @@ void bhv_ukiki_cage_star_loop(void) { case UKIKI_CAGE_STAR_ACT_IN_CAGE: // Initialization to see if the star is collected (blue) or not (yellow). if (o->oTimer == 0) { - if (bit_shift_left(1) - & save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum))) { + if (bit_shift_left(1) & + save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum))) { cur_obj_set_model(MODEL_TRANSPARENT_STAR); } } diff --git a/src/game/behaviors/unagi.inc.c b/src/game/behaviors/unagi.inc.c index 33f37609..21211e44 100644 --- a/src/game/behaviors/unagi.inc.c +++ b/src/game/behaviors/unagi.inc.c @@ -63,8 +63,7 @@ void unagi_act_1_4(s32 arg0) { o->oAction = arg0; } - o->oMoveAnglePitch = o->oFaceAnglePitch = - approach_s16_symmetric(o->oMoveAnglePitch, o->oPathedTargetPitch, 50); + o->oMoveAnglePitch = o->oFaceAnglePitch = approach_s16_symmetric(o->oMoveAnglePitch, o->oPathedTargetPitch, 50); cur_obj_rotate_yaw_toward(o->oPathedTargetYaw, 120); obj_roll_to_match_yaw_turn(o->oPathedTargetYaw, 0x2000, 100); diff --git a/src/game/behaviors/water_bomb.inc.c b/src/game/behaviors/water_bomb.inc.c index 889ca462..1088b1d0 100644 --- a/src/game/behaviors/water_bomb.inc.c +++ b/src/game/behaviors/water_bomb.inc.c @@ -35,13 +35,11 @@ void bhv_water_bomb_spawner_update(void) { latDistToMario = lateral_dist_between_objects(o, gMarioObject); // When mario is in range and a water bomb isn't already active - if (!o->oWaterBombSpawnerBombActive && latDistToMario < spawnerRadius - && gMarioObject->oPosY - o->oPosY < 1000.0f) { + if (!o->oWaterBombSpawnerBombActive && latDistToMario < spawnerRadius && gMarioObject->oPosY - o->oPosY < 1000.0f) { if (o->oWaterBombSpawnerTimeToSpawn != 0) { o->oWaterBombSpawnerTimeToSpawn--; } else { - struct Object *waterBomb = - spawn_object_relative(0, 0, 2000, 0, o, MODEL_WATER_BOMB, bhvWaterBomb); + struct Object* waterBomb = spawn_object_relative(0, 0, 2000, 0, o, MODEL_WATER_BOMB, bhvWaterBomb); if (waterBomb != NULL) { // Drop farther ahead of mario when he is moving faster @@ -49,10 +47,8 @@ void bhv_water_bomb_spawner_update(void) { waterBomb->oAction = WATER_BOMB_ACT_INIT; - waterBomb->oPosX = - gMarioObject->oPosX + waterBombDistToMario * sins(gMarioObject->oMoveAngleYaw); - waterBomb->oPosZ = - gMarioObject->oPosZ + waterBombDistToMario * coss(gMarioObject->oMoveAngleYaw); + waterBomb->oPosX = gMarioObject->oPosX + waterBombDistToMario * sins(gMarioObject->oMoveAngleYaw); + waterBomb->oPosZ = gMarioObject->oPosZ + waterBombDistToMario * coss(gMarioObject->oMoveAngleYaw); spawn_object(waterBomb, MODEL_WATER_BOMB_SHADOW, bhvWaterBombShadow); diff --git a/src/game/behaviors/water_bomb_cannon.inc.c b/src/game/behaviors/water_bomb_cannon.inc.c index a2134821..c15eaeee 100644 --- a/src/game/behaviors/water_bomb_cannon.inc.c +++ b/src/game/behaviors/water_bomb_cannon.inc.c @@ -18,7 +18,7 @@ void bhv_bubble_cannon_barrel_loop(void) { // check this if (o->parentObj->oWaterCannonUnkF4 != 0) { if (o->oForwardVel == 0.0f) { - struct Object *waterBomb; + struct Object* waterBomb; o->oForwardVel = 35.0f; @@ -57,7 +57,7 @@ void water_bomb_cannon_act_1(void) { obj_move_pitch_approach(o->oWaterCannonUnkFC, 0x80); obj_face_yaw_approach(o->oWaterCannonUnk100, 0x100); - if ((s16) o->oFaceAngleYaw == (s16) o->oWaterCannonUnk100) { + if ((s16)o->oFaceAngleYaw == (s16)o->oWaterCannonUnk100) { if (o->oWaterCannonUnkF8 != 0) { o->oWaterCannonUnkF8--; } else { diff --git a/src/game/behaviors/water_objs.inc.c b/src/game/behaviors/water_objs.inc.c index 67128100..cfff46fb 100644 --- a/src/game/behaviors/water_objs.inc.c +++ b/src/game/behaviors/water_objs.inc.c @@ -43,7 +43,7 @@ void bhv_water_air_bubble_loop(void) { } void bhv_bubble_wave_init(void) { - o->oWaterObjUnkFC = 0x800 + (s32)(random_float() * 2048.0f); + o->oWaterObjUnkFC = 0x800 + (s32)(random_float() * 2048.0f); o->oWaterObjUnk100 = 0x800 + (s32)(random_float() * 2048.0f); cur_obj_play_sound_2(SOUND_GENERAL_QUIET_BUBBLE); } diff --git a/src/game/behaviors/water_pillar.inc.c b/src/game/behaviors/water_pillar.inc.c index 2cb9f464..9f62bb31 100644 --- a/src/game/behaviors/water_pillar.inc.c +++ b/src/game/behaviors/water_pillar.inc.c @@ -1,7 +1,7 @@ // water_pillar.inc.c void water_level_pillar_undrained(void) { - struct Object *otherWaterPillar; + struct Object* otherWaterPillar; switch (o->oAction) { case 0: @@ -42,10 +42,8 @@ void water_level_pillar_undrained(void) { case 4: cur_obj_play_sound_1(SOUND_ENV_WATER_DRAIN); if (o->oTimer < 300) { - gEnvironmentLevels[2] = - (s32) approach_f32_symmetric(gEnvironmentLevels[2], -2450.0f, 5.0f); - gEnvironmentLevels[0] = - (s32) approach_f32_symmetric(gEnvironmentLevels[0], -2450.0f, 5.0f); + gEnvironmentLevels[2] = (s32)approach_f32_symmetric(gEnvironmentLevels[2], -2450.0f, 5.0f); + gEnvironmentLevels[0] = (s32)approach_f32_symmetric(gEnvironmentLevels[0], -2450.0f, 5.0f); #if ENABLE_RUMBLE reset_rumble_timers_2(2); #endif diff --git a/src/game/behaviors/water_ring.inc.c b/src/game/behaviors/water_ring.inc.c index b1f8f1bd..b1a26735 100644 --- a/src/game/behaviors/water_ring.inc.c +++ b/src/game/behaviors/water_ring.inc.c @@ -4,8 +4,8 @@ f32 water_ring_calc_mario_dist(void) { f32 marioDistX = o->oPosX - gMarioObject->header.gfx.pos[0]; f32 marioDistY = o->oPosY - (gMarioObject->header.gfx.pos[1] + 80.0f); f32 marioDistZ = o->oPosZ - gMarioObject->header.gfx.pos[2]; - f32 marioDistInFront = marioDistX * o->oWaterRingNormalX + marioDistY * o->oWaterRingNormalY - + marioDistZ * o->oWaterRingNormalZ; + f32 marioDistInFront = + marioDistX * o->oWaterRingNormalX + marioDistY * o->oWaterRingNormalY + marioDistZ * o->oWaterRingNormalZ; return marioDistInFront; } @@ -41,26 +41,28 @@ void bhv_jet_stream_water_ring_init(void) { o->oFaceAnglePitch = 0x8000; } -void water_ring_check_collection(f32 avgScale, struct Object *ringManager) { +void water_ring_check_collection(f32 avgScale, struct Object* ringManager) { f32 marioDistInFront = water_ring_calc_mario_dist(); - if (!is_point_close_to_object(o, gMarioObject->header.gfx.pos[0], - gMarioObject->header.gfx.pos[1] + 80.0f, + if (!is_point_close_to_object(o, gMarioObject->header.gfx.pos[0], gMarioObject->header.gfx.pos[1] + 80.0f, gMarioObject->header.gfx.pos[2], (avgScale + 0.2) * 120.0)) { o->oWaterRingMarioDistInFront = marioDistInFront; return; } if (o->oWaterRingMarioDistInFront * marioDistInFront < 0.0f) { - struct Object *ringSpawner = o->parentObj; + struct Object* ringSpawner = o->parentObj; if (ringSpawner != NULL) { - if ((o->oWaterRingIndex == ringManager->oWaterRingMgrLastRingCollected + 1) - || (ringSpawner->oWaterRingSpawnerRingsCollected == 0)) { + if ((o->oWaterRingIndex == ringManager->oWaterRingMgrLastRingCollected + 1) || + (ringSpawner->oWaterRingSpawnerRingsCollected == 0)) { ringSpawner->oWaterRingSpawnerRingsCollected++; if (ringSpawner->oWaterRingSpawnerRingsCollected < 6) { spawn_orange_number(ringSpawner->oWaterRingSpawnerRingsCollected, 0, -40, 0); - play_sound(ROM_JP ? SOUND_MENU_STAR_SOUND : SOUND_MENU_COLLECT_SECRET + (((u8) ringSpawner->oWaterRingSpawnerRingsCollected - 1) << 16), gGlobalSoundSource); + play_sound(ROM_JP ? SOUND_MENU_STAR_SOUND + : SOUND_MENU_COLLECT_SECRET + + (((u8)ringSpawner->oWaterRingSpawnerRingsCollected - 1) << 16), + gGlobalSoundSource); } ringManager->oWaterRingMgrLastRingCollected = o->oWaterRingIndex; } else { @@ -84,7 +86,7 @@ void water_ring_set_scale(f32 avgScale) { } void water_ring_act_collected(void) { - f32 avgScale = (f32) o->oTimer * 0.2 + o->oWaterRingAvgScale; + f32 avgScale = (f32)o->oTimer * 0.2 + o->oWaterRingAvgScale; if (o->oTimer > 20) { o->activeFlags = ACTIVE_FLAG_DEACTIVATED; @@ -99,12 +101,12 @@ void water_ring_act_collected(void) { } void water_ring_act_not_collected(void) { - f32 avgScale = (f32) o->oTimer / 225.0 * 3.0 + 0.5; + f32 avgScale = (f32)o->oTimer / 225.0 * 3.0 + 0.5; //! In this case ringSpawner and ringManager are the same object, // because the Jet Stream Ring Spawner is its own parent object. - struct Object *ringSpawner = o->parentObj; - struct Object *ringManager = ringSpawner->parentObj; + struct Object* ringSpawner = o->parentObj; + struct Object* ringManager = ringSpawner->parentObj; if (o->oTimer > 225) { o->oOpacity -= 2; @@ -120,8 +122,8 @@ void water_ring_act_not_collected(void) { o->oFaceAngleYaw += 0x100; set_object_visibility(o, 5000); - if (ringSpawner->oWaterRingSpawnerRingsCollected == 4 - && o->oWaterRingIndex == ringManager->oWaterRingMgrLastRingCollected + 1) { + if (ringSpawner->oWaterRingSpawnerRingsCollected == 4 && + o->oWaterRingIndex == ringManager->oWaterRingMgrLastRingCollected + 1) { o->oOpacity = sins(o->oTimer * 0x1000) * 200.0f + 50.0f; } @@ -141,7 +143,7 @@ void bhv_jet_stream_water_ring_loop(void) { } void spawn_manta_ray_ring_manager(void) { - struct Object *ringManager = spawn_object(o, MODEL_NONE, bhvMantaRayRingManager); + struct Object* ringManager = spawn_object(o, MODEL_NONE, bhvMantaRayRingManager); o->parentObj = ringManager; } @@ -149,7 +151,7 @@ void water_ring_spawner_act_inactive(void) { //! The Jet Stream Ring Spawner is its own parent object. The code may have been copied // from the Manta Ray, which spawns rings but also has a Ring Manager object as its // parent. The Jet Stream Ring Spawner functions as both a spawner and a Ring Manager. - struct Object *currentObj = o->parentObj; + struct Object* currentObj = o->parentObj; //! Because the index counter overflows at 10000, it's possible to wait // for about 4 hours and 38 minutes if you miss a ring, and the index will @@ -158,9 +160,8 @@ void water_ring_spawner_act_inactive(void) { o->oTimer = 0; } - if ((o->oTimer == 0) || (o->oTimer == 50) || (o->oTimer == 150) || (o->oTimer == 200) - || (o->oTimer == 250)) { - struct Object *waterRing = spawn_object(o, MODEL_WATER_RING, bhvJetStreamWaterRing); + if ((o->oTimer == 0) || (o->oTimer == 50) || (o->oTimer == 150) || (o->oTimer == 200) || (o->oTimer == 250)) { + struct Object* waterRing = spawn_object(o, MODEL_WATER_RING, bhvJetStreamWaterRing); waterRing->oWaterRingIndex = currentObj->oWaterRingMgrNextRingIndex; currentObj->oWaterRingMgrNextRingIndex++; if (currentObj->oWaterRingMgrNextRingIndex > 10000) { @@ -192,9 +193,9 @@ void bhv_manta_ray_water_ring_init(void) { } void manta_water_ring_act_not_collected(void) { - f32 avgScale = (f32) o->oTimer / 50 * 1.3 + 0.1; - struct Object *ringSpawner = o->parentObj; - struct Object *ringManager = ringSpawner->parentObj; + f32 avgScale = (f32)o->oTimer / 50 * 1.3 + 0.1; + struct Object* ringSpawner = o->parentObj; + struct Object* ringManager = ringSpawner->parentObj; if (avgScale > 1.3) { avgScale = 1.3; @@ -211,8 +212,8 @@ void manta_water_ring_act_not_collected(void) { water_ring_set_scale(avgScale); set_object_visibility(o, 5000); - if (ringSpawner->oWaterRingSpawnerRingsCollected == 4 - && o->oWaterRingIndex == ringManager->oWaterRingMgrLastRingCollected + 1) { + if (ringSpawner->oWaterRingSpawnerRingsCollected == 4 && + o->oWaterRingIndex == ringManager->oWaterRingMgrLastRingCollected + 1) { o->oOpacity = sins(o->oTimer * 0x1000) * 200.0f + 50.0f; } diff --git a/src/game/behaviors/water_splashes_and_waves.inc.c b/src/game/behaviors/water_splashes_and_waves.inc.c index 89948910..7dfe76a7 100644 --- a/src/game/behaviors/water_splashes_and_waves.inc.c +++ b/src/game/behaviors/water_splashes_and_waves.inc.c @@ -5,10 +5,14 @@ struct WaterDropletParams sWaterSplashDropletParams = { /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE, /* Model */ MODEL_WHITE_PARTICLE_SMALL, /* Behavior */ bhvWaterDroplet, - /* Unused (flag-specific) */ 0, 0, - /* Random fvel offset, scale */ 5.0f, 3.0f, - /* Random yvel offset, scale */ 30.0f, 20.0f, - /* Random size offset, scale */ 0.5f, 1.0f + /* Unused (flag-specific) */ 0, + 0, + /* Random fvel offset, scale */ 5.0f, + 3.0f, + /* Random yvel offset, scale */ 30.0f, + 20.0f, + /* Random size offset, scale */ 0.5f, + 1.0f }; // Water droplets from Mario jumping in shallow water. @@ -16,10 +20,14 @@ struct WaterDropletParams gShallowWaterSplashDropletParams = { /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE | WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL, /* Model */ MODEL_WHITE_PARTICLE_SMALL, /* Behavior */ bhvWaterDroplet, - /* Unused (flag-specific) */ 0, 0, - /* Random fvel offset, scale */ 2.0f, 3.0f, - /* Random yvel offset, scale */ 20.0f, 20.0f, - /* Random size offset, scale */ 0.5f, 1.0f + /* Unused (flag-specific) */ 0, + 0, + /* Random fvel offset, scale */ 2.0f, + 3.0f, + /* Random yvel offset, scale */ 20.0f, + 20.0f, + /* Random size offset, scale */ 0.5f, + 1.0f }; // The fish particle easter egg from Mario jumping in shallow water. @@ -27,25 +35,32 @@ struct WaterDropletParams sWaterDropletFishParams = { /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE | WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL, /* Model */ MODEL_FISH, /* Behavior */ bhvWaterDroplet, - /* Unused (flag-specific) */ 0, 0, - /* Random fvel offset, scale */ 2.0f, 3.0f, - /* Random yvel offset, scale */ 20.0f, 20.0f, - /* Random size offset, scale */ 1.0f, 0.0f + /* Unused (flag-specific) */ 0, + 0, + /* Random fvel offset, scale */ 2.0f, + 3.0f, + /* Random yvel offset, scale */ 20.0f, + 20.0f, + /* Random size offset, scale */ 1.0f, + 0.0f }; // Water droplets from Mario running in shallow water. struct WaterDropletParams gShallowWaterWaveDropletParams = { - /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE_INCR_PLUS_8000 | WATER_DROPLET_FLAG_RAND_ANGLE | WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL, + /* Flags */ WATER_DROPLET_FLAG_RAND_ANGLE_INCR_PLUS_8000 | WATER_DROPLET_FLAG_RAND_ANGLE | + WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL, /* Model */ MODEL_WHITE_PARTICLE_SMALL, /* Behavior */ bhvWaterDroplet, /* Move angle range */ 0x6000, /* Unused (flag-specific) */ 0, - /* Random fvel offset, scale */ 2.0f, 8.0f, - /* Random yvel offset, scale */ 10.0f, 10.0f, - /* Random size offset, scale */ 0.5f, 1.0f + /* Random fvel offset, scale */ 2.0f, + 8.0f, + /* Random yvel offset, scale */ 10.0f, + 10.0f, + /* Random size offset, scale */ 0.5f, + 1.0f }; - void bhv_water_splash_spawn_droplets(void) { s32 i; if (o->oTimer == 0) { @@ -93,7 +108,7 @@ void bhv_idle_water_wave_loop(void) { obj_copy_pos(o, gMarioObject); o->oPosY = gMarioStates[0].waterLevel + 5; if (!(gMarioObject->oMarioParticleFlags & ACTIVE_PARTICLE_IDLE_WATER_WAVE)) { - gMarioObject->oActiveParticleFlags &= (u16) ~ACTIVE_PARTICLE_IDLE_WATER_WAVE; + gMarioObject->oActiveParticleFlags &= (u16)~ACTIVE_PARTICLE_IDLE_WATER_WAVE; o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } } @@ -111,7 +126,7 @@ void bhv_bubble_splash_init(void) { void bhv_shallow_water_splash_init(void) { // Have a 1 in 256 chance to spawn the fish particle easter egg. if ((random_u16() & 0xFF) <= 0) { // Strange - struct Object *fishObj = spawn_water_droplet(o, &sWaterDropletFishParams); + struct Object* fishObj = spawn_water_droplet(o, &sWaterDropletFishParams); obj_init_animation_with_sound(fishObj, blue_fish_seg3_anims_0301C2B0, 0); } } diff --git a/src/game/behaviors/wdw_water_level.inc.c b/src/game/behaviors/wdw_water_level.inc.c index 3b43a793..90065a26 100644 --- a/src/game/behaviors/wdw_water_level.inc.c +++ b/src/game/behaviors/wdw_water_level.inc.c @@ -19,7 +19,7 @@ void bhv_water_level_diamond_loop(void) { switch (o->oAction) { case WATER_LEVEL_DIAMOND_ACT_INIT: o->oFaceAngleYaw = 0; - o->oWaterLevelTriggerTargetWaterLevel = (s32) o->oPosY; + o->oWaterLevelTriggerTargetWaterLevel = (s32)o->oPosY; if (o->oTimer > 10) { o->oAction++; // Sets to WATER_LEVEL_DIAMOND_ACT_IDLE } @@ -34,10 +34,10 @@ void bhv_water_level_diamond_loop(void) { case WATER_LEVEL_DIAMOND_ACT_CHANGE_WATER_LEVEL: o->oAngleVelYaw = 0; - gEnvironmentLevels[0] = (s32) approach_f32_symmetric( - (f32) gEnvironmentLevels[0], (f32) o->oWaterLevelTriggerTargetWaterLevel, 10.0f); + gEnvironmentLevels[0] = (s32)approach_f32_symmetric((f32)gEnvironmentLevels[0], + (f32)o->oWaterLevelTriggerTargetWaterLevel, 10.0f); if (gEnvironmentLevels[0] == o->oWaterLevelTriggerTargetWaterLevel) { - if ((s16) o->oFaceAngleYaw == 0) { + if ((s16)o->oFaceAngleYaw == 0) { o->oAction++; // Sets to WATER_LEVEL_DIAMOND_ACT_IDLE_SPINNING } else { o->oAngleVelYaw = 0x800; diff --git a/src/game/behaviors/whomp.inc.c b/src/game/behaviors/whomp.inc.c index fe39da7c..c5c4a014 100644 --- a/src/game/behaviors/whomp.inc.c +++ b/src/game/behaviors/whomp.inc.c @@ -32,8 +32,8 @@ void whomp_init(void) { cur_obj_set_pos_to_home(); o->oHealth = 3; } - } else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, DIALOG_114)) { + } else if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, + DIALOG_114)) { o->oAction = 2; } } else if (o->oDistanceToMario < 500.0f) { @@ -237,8 +237,8 @@ void whomp_on_ground_general(void) { void whomp_die(void) { if (o->oBehParams2ndByte != 0) { - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, DIALOG_115)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_TEXT_DEFAULT, CUTSCENE_DIALOG, + DIALOG_115)) { obj_set_angle(o, 0, 0, 0); cur_obj_hide(); cur_obj_become_intangible(); @@ -273,7 +273,8 @@ void (*sWhompActions[])(void) = { whomp_jump, whomp_land, whomp_on_ground_general, - whomp_turn, whomp_die, + whomp_turn, + whomp_die, king_whomp_stop_music, }; diff --git a/src/game/behaviors/wiggler.inc.c b/src/game/behaviors/wiggler.inc.c index 7edd7cd5..ed5fd171 100644 --- a/src/game/behaviors/wiggler.inc.c +++ b/src/game/behaviors/wiggler.inc.c @@ -66,7 +66,7 @@ void bhv_wiggler_body_part_update(void) { f32 dy; f32 dz; f32 dxz; - struct ChainSegment *segment = &o->parentObj->oWigglerSegments[o->oBehParams2ndByte]; + struct ChainSegment* segment = &o->parentObj->oWigglerSegments[o->oBehParams2ndByte]; f32 posOffset; cur_obj_scale(o->parentObj->header.gfx.scale[0]); @@ -116,7 +116,7 @@ void bhv_wiggler_body_part_update(void) { */ void wiggler_init_segments(void) { s32 i; - struct ChainSegment *segments = mem_pool_alloc(gObjectMemoryPool, 4 * sizeof(struct ChainSegment)); + struct ChainSegment* segments = mem_pool_alloc(gObjectMemoryPool, 4 * sizeof(struct ChainSegment)); if (segments != NULL) { // Each segment represents the global position and orientation of each @@ -138,8 +138,7 @@ void wiggler_init_segments(void) { // Spawn each body part for (i = 1; i <= 3; i++) { - struct Object *bodyPart = - spawn_object_relative(i, 0, 0, 0, o, MODEL_WIGGLER_BODY, bhvWigglerBody); + struct Object* bodyPart = spawn_object_relative(i, 0, 0, 0, o, MODEL_WIGGLER_BODY, bhvWigglerBody); if (bodyPart != NULL) { obj_init_animation_with_sound(bodyPart, wiggler_seg5_anims_0500C874, 0); bodyPart->header.gfx.animInfo.animFrame = (23 * i) % 26 - 1; @@ -160,9 +159,9 @@ void wiggler_init_segments(void) { * for a body part to get stuck on geometry and separate from the rest of the * body. */ - void wiggler_update_segments(void) { - struct ChainSegment *prevBodyPart; - struct ChainSegment *bodyPart; +void wiggler_update_segments(void) { + struct ChainSegment* prevBodyPart; + struct ChainSegment* bodyPart; f32 dx; f32 dy; f32 dz; @@ -221,8 +220,8 @@ static void wiggler_act_walk(void) { // If Mario is positioned below the wiggler, assume he entered through the // lower cave entrance, so don't display text. - if (gMarioObject->oPosY < o->oPosY || cur_obj_update_dialog_with_cutscene( - MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_NONE, CUTSCENE_DIALOG, DIALOG_150)) { + if (gMarioObject->oPosY < o->oPosY || + cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_NONE, CUTSCENE_DIALOG, DIALOG_150)) { o->oWigglerTextStatus = WIGGLER_TEXT_STATUS_COMPLETED_DIALOG; } } else { @@ -251,7 +250,7 @@ static void wiggler_act_walk(void) { } else if (o->oWigglerTimeUntilRandomTurn != 0) { o->oWigglerTimeUntilRandomTurn--; } else { - o->oWigglerTargetYaw = o->oMoveAngleYaw + 0x4000 * (s16) random_sign(); + o->oWigglerTargetYaw = o->oMoveAngleYaw + 0x4000 * (s16)random_sign(); o->oWigglerTimeUntilRandomTurn = random_linear_offset(30, 50); } } @@ -298,8 +297,8 @@ static void wiggler_act_jumped_on(void) { // defeated) or go back to walking if (o->header.gfx.scale[1] >= 4.0f) { if (o->oTimer > 30) { - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - DIALOG_FLAG_NONE, CUTSCENE_DIALOG, attackText[o->oHealth - 2])) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, DIALOG_FLAG_NONE, CUTSCENE_DIALOG, + attackText[o->oHealth - 2])) { // Because we don't want the wiggler to disappear after being // defeated, we leave its health at 1 if (--o->oHealth == 1) { @@ -407,8 +406,8 @@ void bhv_wiggler_update(void) { // Walking animation and sound cur_obj_init_animation_with_accel_and_sound(0, o->oWigglerWalkAnimSpeed); if (o->oWigglerWalkAnimSpeed != 0.0f) { - cur_obj_play_sound_at_anim_range(0, 13, - o->oHealth >= 4 ? SOUND_OBJ_WIGGLER_LOW_PITCH : SOUND_OBJ_WIGGLER_HIGH_PITCH); + cur_obj_play_sound_at_anim_range( + 0, 13, o->oHealth >= 4 ? SOUND_OBJ_WIGGLER_LOW_PITCH : SOUND_OBJ_WIGGLER_HIGH_PITCH); } else { cur_obj_reverse_animation(); } diff --git a/src/game/behaviors/wind.inc.c b/src/game/behaviors/wind.inc.c index e95acffa..6bb83150 100644 --- a/src/game/behaviors/wind.inc.c +++ b/src/game/behaviors/wind.inc.c @@ -3,7 +3,7 @@ void spawn_wind_particles(s16 pitch, s16 yaw) { s32 i; for (i = 0; i < 3; i++) { - struct Object *wind = spawn_object(o, MODEL_MIST, bhvWind); + struct Object* wind = spawn_object(o, MODEL_MIST, bhvWind); wind->oMoveAngleYaw = yaw; wind->oMoveAnglePitch = pitch; } diff --git a/src/game/behaviors/yoshi.inc.c b/src/game/behaviors/yoshi.inc.c index c2b39669..53efe83a 100644 --- a/src/game/behaviors/yoshi.inc.c +++ b/src/game/behaviors/yoshi.inc.c @@ -11,8 +11,8 @@ void bhv_yoshi_init(void) { o->oBuoyancy = 1.3f; o->oInteractionSubtype = INT_SUBTYPE_NPC; - if (save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) < 120 - || sYoshiDead == TRUE) { + if (save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) < 120 || + sYoshiDead == TRUE) { o->activeFlags = ACTIVE_FLAG_DEACTIVATED; } } @@ -81,7 +81,7 @@ void yoshi_idle_loop(void) { } void yoshi_talk_loop(void) { - if ((s16) o->oMoveAngleYaw == (s16) o->oAngleToMario) { + if ((s16)o->oMoveAngleYaw == (s16)o->oAngleToMario) { cur_obj_init_animation(0); if (set_mario_npc_dialog(MARIO_DIALOG_LOOK_FRONT) == MARIO_DIALOG_STATUS_SPEAK) { o->activeFlags |= ACTIVE_FLAG_INITIATED_TIME_STOP; diff --git a/src/game/camera.c b/src/game/camera.c index ed67d0b7..45e463ed 100644 --- a/src/game/camera.c +++ b/src/game/camera.c @@ -151,7 +151,7 @@ extern f32 sCannonYOffset; extern struct ModeTransitionInfo sModeInfo; extern Vec3f sCastleEntranceOffset; extern u32 sParTrackIndex; -extern struct ParallelTrackingPoint *sParTrackPath; +extern struct ParallelTrackingPoint* sParTrackPath; extern struct CameraStoredInfo sParTrackTransOff; extern struct CameraStoredInfo sCameraStoreCUp; extern struct CameraStoredInfo sCameraStoreCutscene; @@ -167,7 +167,7 @@ extern s16 gCutsceneTimer; extern struct CutsceneVariable sCutsceneVars[10]; extern s32 gObjCutsceneDone; extern u32 gCutsceneObjSpawn; -extern struct Camera *gCamera; +extern struct Camera* gCamera; /** * Lakitu's position and focus. @@ -177,7 +177,7 @@ struct LakituState gLakituState; struct CameraFOVStatus sFOVState; struct TransitionInfo sModeTransition; struct PlayerGeometry sMarioGeometry; -struct Camera *gCamera; +struct Camera* gCamera; s16 unusedFreeRoamWallYaw; s16 sAvoidYawVel; s16 sCameraYawAfterDoorCutscene; @@ -367,7 +367,7 @@ u32 sParTrackIndex; /** * The current list of ParallelTrackingPoints used in update_parallel_tracking_camera() */ -struct ParallelTrackingPoint *sParTrackPath; +struct ParallelTrackingPoint* sParTrackPath; /** * On the first frame after the camera changes to a different parallel tracking path, this stores the @@ -390,7 +390,7 @@ struct CameraStoredInfo sCameraStoreCutscene; // first iteration of data u32 unused8032CFC0 = 0; -struct Object *gCutsceneFocus = NULL; +struct Object* gCutsceneFocus = NULL; u32 unused8032CFC8 = 0; u32 unused8032CFCC = 0; @@ -398,7 +398,7 @@ u32 unused8032CFCC = 0; /** * The information of a second focus camera used by some objects */ -struct Object *gSecondCameraFocus = NULL; +struct Object* gSecondCameraFocus = NULL; /** * How fast the camera's yaw should approach the next yaw. @@ -437,52 +437,50 @@ u8 sFramesSinceCutsceneEnded = 0; * 3 = Dialog doesn't have a response */ u8 sCutsceneDialogResponse = DIALOG_RESPONSE_NONE; -struct PlayerCameraState *sMarioCamState = &gPlayerCameraState[0]; -struct PlayerCameraState *sLuigiCamState = &gPlayerCameraState[1]; +struct PlayerCameraState* sMarioCamState = &gPlayerCameraState[0]; +struct PlayerCameraState* sLuigiCamState = &gPlayerCameraState[1]; u32 unused8032D008 = 0; -Vec3f sFixedModeBasePosition = { 646.0f, 143.0f, -1513.0f }; +Vec3f sFixedModeBasePosition = { 646.0f, 143.0f, -1513.0f }; Vec3f sUnusedModeBasePosition_2 = { 646.0f, 143.0f, -1513.0f }; Vec3f sUnusedModeBasePosition_3 = { 646.0f, 143.0f, -1513.0f }; Vec3f sUnusedModeBasePosition_4 = { 646.0f, 143.0f, -1513.0f }; Vec3f sUnusedModeBasePosition_5 = { 646.0f, 143.0f, -1513.0f }; -s32 update_radial_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_outward_radial_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_behind_mario_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_mario_camera(struct Camera *c, Vec3f, Vec3f); -s32 unused_update_mode_5_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_c_up(struct Camera *c, Vec3f, Vec3f); -s32 nop_update_water_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_slide_or_0f_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_in_cannon(struct Camera *c, Vec3f, Vec3f); -s32 update_boss_fight_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_parallel_tracking_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_fixed_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_8_directions_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_slide_or_0f_camera(struct Camera *c, Vec3f, Vec3f); -s32 update_spiral_stairs_camera(struct Camera *c, Vec3f, Vec3f); +s32 update_radial_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_outward_radial_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_behind_mario_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_mario_camera(struct Camera* c, Vec3f, Vec3f); +s32 unused_update_mode_5_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_c_up(struct Camera* c, Vec3f, Vec3f); +s32 nop_update_water_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_slide_or_0f_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_in_cannon(struct Camera* c, Vec3f, Vec3f); +s32 update_boss_fight_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_parallel_tracking_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_fixed_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_8_directions_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_slide_or_0f_camera(struct Camera* c, Vec3f, Vec3f); +s32 update_spiral_stairs_camera(struct Camera* c, Vec3f, Vec3f); -typedef s32 (*CameraTransition)(struct Camera *c, Vec3f, Vec3f); -CameraTransition sModeTransitions[] = { - NULL, - update_radial_camera, - update_outward_radial_camera, - update_behind_mario_camera, - update_mario_camera, - unused_update_mode_5_camera, - update_c_up, - update_mario_camera, - nop_update_water_camera, - update_slide_or_0f_camera, - update_in_cannon, - update_boss_fight_camera, - update_parallel_tracking_camera, - update_fixed_camera, - update_8_directions_camera, - update_slide_or_0f_camera, - update_mario_camera, - update_spiral_stairs_camera -}; +typedef s32 (*CameraTransition)(struct Camera* c, Vec3f, Vec3f); +CameraTransition sModeTransitions[] = { NULL, + update_radial_camera, + update_outward_radial_camera, + update_behind_mario_camera, + update_mario_camera, + unused_update_mode_5_camera, + update_c_up, + update_mario_camera, + nop_update_water_camera, + update_slide_or_0f_camera, + update_in_cannon, + update_boss_fight_camera, + update_parallel_tracking_camera, + update_fixed_camera, + update_8_directions_camera, + update_slide_or_0f_camera, + update_mario_camera, + update_spiral_stairs_camera }; // Move these two tables to another include file? extern u8 sDanceCutsceneIndexTable[][4]; @@ -666,7 +664,7 @@ void unused_set_camera_pitch_shake_env(s16 shake) { * posOff and focOff are sometimes the same address, which just ignores the pos calculation *! Doesn't return anything, but required to match on -O2 */ -BAD_RETURN(f32) calc_y_to_curr_floor(f32 *posOff, f32 posMul, f32 posBound, f32 *focOff, f32 focMul, f32 focBound) { +BAD_RETURN(f32) calc_y_to_curr_floor(f32* posOff, f32 posMul, f32 posBound, f32* focOff, f32 focMul, f32 focBound) { f32 floorHeight = sMarioGeometry.currFloorHeight; f32 waterHeight; UNUSED u8 filler[4]; @@ -679,8 +677,8 @@ BAD_RETURN(f32) calc_y_to_curr_floor(f32 *posOff, f32 posMul, f32 posBound, f32 } if (sMarioCamState->action & ACT_FLAG_ON_POLE) { - if (sMarioGeometry.currFloorHeight >= gMarioStates[0].usedObj->oPosY && sMarioCamState->pos[1] - < 0.7f * gMarioStates[0].usedObj->hitboxHeight + gMarioStates[0].usedObj->oPosY) { + if (sMarioGeometry.currFloorHeight >= gMarioStates[0].usedObj->oPosY && + sMarioCamState->pos[1] < 0.7f * gMarioStates[0].usedObj->hitboxHeight + gMarioStates[0].usedObj->oPosY) { posBound = 1200; } } @@ -746,8 +744,8 @@ static UNUSED void set_pos_to_mario(Vec3f foc, Vec3f pos, f32 yOff, f32 focYOff, /** * Set the camera's y coordinate to goalHeight, respecting floors and ceilings in the way */ -void set_camera_height(struct Camera *c, f32 goalHeight) { - struct Surface *surface; +void set_camera_height(struct Camera* c, f32 goalHeight) { + struct Surface* surface; f32 marioFloorHeight; f32 marioCeilHeight; f32 camFloorHeight; @@ -783,8 +781,7 @@ void set_camera_height(struct Camera *c, f32 goalHeight) { c->pos[1] = goalHeight; } // Warp camera to goalHeight if further than 1000 and Mario is stuck in the ground - if (sMarioCamState->action == ACT_BUTT_STUCK_IN_GROUND || - sMarioCamState->action == ACT_HEAD_STUCK_IN_GROUND || + if (sMarioCamState->action == ACT_BUTT_STUCK_IN_GROUND || sMarioCamState->action == ACT_HEAD_STUCK_IN_GROUND || sMarioCamState->action == ACT_FEET_STUCK_IN_GROUND) { if (ABS(c->pos[1] - goalHeight) > 1000.f) { c->pos[1] = goalHeight; @@ -793,9 +790,9 @@ void set_camera_height(struct Camera *c, f32 goalHeight) { approach_camera_height(c, goalHeight, 20.f); if (camCeilHeight != CELL_HEIGHT_LIMIT) { camCeilHeight -= baseOff; - if ((c->pos[1] > camCeilHeight && sMarioGeometry.currFloorHeight + baseOff < camCeilHeight) - || (sMarioGeometry.currCeilHeight != CELL_HEIGHT_LIMIT - && sMarioGeometry.currCeilHeight > camCeilHeight && c->pos[1] > camCeilHeight)) { + if ((c->pos[1] > camCeilHeight && sMarioGeometry.currFloorHeight + baseOff < camCeilHeight) || + (sMarioGeometry.currCeilHeight != CELL_HEIGHT_LIMIT && sMarioGeometry.currCeilHeight > camCeilHeight && + c->pos[1] > camCeilHeight)) { c->pos[1] = camCeilHeight; } } @@ -806,7 +803,7 @@ void set_camera_height(struct Camera *c, f32 goalHeight) { * Pitch the camera down when the camera is facing down a slope */ s16 look_down_slopes(s16 camYaw) { - struct Surface *floor; + struct Surface* floor; f32 floorDY; // Default pitch s16 pitch = 0x05B0; @@ -839,7 +836,7 @@ s16 look_down_slopes(s16 camYaw) { * * Since this function only affects the camera's focus, Mario's movement direction isn't affected. */ -void pan_ahead_of_player(struct Camera *c) { +void pan_ahead_of_player(struct Camera* c) { f32 dist; s16 pitch; s16 yaw; @@ -860,7 +857,7 @@ void pan_ahead_of_player(struct Camera *c) { // If Mario is long jumping, or on a flag pole (but not at the top), then pan in the opposite direction if (sMarioCamState->action == ACT_LONG_JUMP || - (sMarioCamState->action != ACT_TOP_OF_POLE && (sMarioCamState->action & ACT_FLAG_ON_POLE))) { + (sMarioCamState->action != ACT_TOP_OF_POLE && (sMarioCamState->action & ACT_FLAG_ON_POLE))) { pan[0] = -pan[0]; } @@ -900,7 +897,7 @@ s16 find_in_bounds_yaw_wdw_bob_thi(Vec3f pos, Vec3f origin, s16 yaw) { /** * Rotates the camera around the area's center point. */ -s32 update_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_radial_camera(struct Camera* c, Vec3f focus, Vec3f pos) { f32 cenDistX = sMarioCamState->pos[0] - c->areaCenX; f32 cenDistZ = sMarioCamState->pos[2] - c->areaCenZ; s16 camYaw = atan2s(cenDistZ, cenDistX) + sModeOffsetYaw; @@ -923,7 +920,7 @@ s32 update_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) { /** * Update the camera during 8 directional mode */ -s32 update_8_directions_camera(struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_8_directions_camera(struct Camera* c, Vec3f focus, Vec3f pos) { UNUSED f32 cenDistX = sMarioCamState->pos[0] - c->areaCenX; UNUSED f32 cenDistZ = sMarioCamState->pos[2] - c->areaCenZ; s16 camYaw = s8DirModeBaseYaw + s8DirModeYawOffset; @@ -950,7 +947,7 @@ s32 update_8_directions_camera(struct Camera *c, Vec3f focus, Vec3f pos) { * * If sModeOffsetYaw is 0, the camera points directly at the area center point. */ -void radial_camera_move(struct Camera *c) { +void radial_camera_move(struct Camera* c) { s16 maxAreaYaw = DEGREES(60); s16 minAreaYaw = DEGREES(-60); s16 rotateSpeed = 0x1000; @@ -975,16 +972,16 @@ void radial_camera_move(struct Camera *c) { // Check if Mario stepped on a surface that rotates the camera. For example, when Mario enters the // gate in BoB, the camera turns right to face up the hill path if (!(gCameraMovementFlags & CAM_MOVE_ROTATE)) { - if (sMarioGeometry.currFloorType == SURFACE_CAMERA_MIDDLE - && sMarioGeometry.prevFloorType != SURFACE_CAMERA_MIDDLE) { + if (sMarioGeometry.currFloorType == SURFACE_CAMERA_MIDDLE && + sMarioGeometry.prevFloorType != SURFACE_CAMERA_MIDDLE) { gCameraMovementFlags |= (CAM_MOVE_RETURN_TO_MIDDLE | CAM_MOVE_ENTERED_ROTATE_SURFACE); } - if (sMarioGeometry.currFloorType == SURFACE_CAMERA_ROTATE_RIGHT - && sMarioGeometry.prevFloorType != SURFACE_CAMERA_ROTATE_RIGHT) { + if (sMarioGeometry.currFloorType == SURFACE_CAMERA_ROTATE_RIGHT && + sMarioGeometry.prevFloorType != SURFACE_CAMERA_ROTATE_RIGHT) { gCameraMovementFlags |= (CAM_MOVE_ROTATE_RIGHT | CAM_MOVE_ENTERED_ROTATE_SURFACE); } - if (sMarioGeometry.currFloorType == SURFACE_CAMERA_ROTATE_LEFT - && sMarioGeometry.prevFloorType != SURFACE_CAMERA_ROTATE_LEFT) { + if (sMarioGeometry.currFloorType == SURFACE_CAMERA_ROTATE_LEFT && + sMarioGeometry.prevFloorType != SURFACE_CAMERA_ROTATE_LEFT) { gCameraMovementFlags |= (CAM_MOVE_ROTATE_LEFT | CAM_MOVE_ENTERED_ROTATE_SURFACE); } } @@ -1024,35 +1021,33 @@ void radial_camera_move(struct Camera *c) { } } else { // Prevent the player from rotating into obstructing walls - if ((gCameraMovementFlags & CAM_MOVE_ROTATE_RIGHT) && avoidStatus == 3 - && avoidYaw + 0x10 < sModeOffsetYaw) { + if ((gCameraMovementFlags & CAM_MOVE_ROTATE_RIGHT) && avoidStatus == 3 && avoidYaw + 0x10 < sModeOffsetYaw) { sModeOffsetYaw = avoidYaw; gCameraMovementFlags &= ~(CAM_MOVE_ROTATE_RIGHT | CAM_MOVE_ENTERED_ROTATE_SURFACE); } - if ((gCameraMovementFlags & CAM_MOVE_ROTATE_LEFT) && avoidStatus == 3 - && avoidYaw - 0x10 > sModeOffsetYaw) { + if ((gCameraMovementFlags & CAM_MOVE_ROTATE_LEFT) && avoidStatus == 3 && avoidYaw - 0x10 > sModeOffsetYaw) { sModeOffsetYaw = avoidYaw; gCameraMovementFlags &= ~(CAM_MOVE_ROTATE_LEFT | CAM_MOVE_ENTERED_ROTATE_SURFACE); } // If it's the first time rotating, just rotate to +-60 degrees - if (!(s2ndRotateFlags & CAM_MOVE_ROTATE_RIGHT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_RIGHT) - && camera_approach_s16_symmetric_bool(&sModeOffsetYaw, maxAreaYaw, rotateSpeed) == 0) { + if (!(s2ndRotateFlags & CAM_MOVE_ROTATE_RIGHT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_RIGHT) && + camera_approach_s16_symmetric_bool(&sModeOffsetYaw, maxAreaYaw, rotateSpeed) == 0) { gCameraMovementFlags &= ~(CAM_MOVE_ROTATE_RIGHT | CAM_MOVE_ENTERED_ROTATE_SURFACE); } - if (!(s2ndRotateFlags & CAM_MOVE_ROTATE_LEFT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_LEFT) - && camera_approach_s16_symmetric_bool(&sModeOffsetYaw, minAreaYaw, rotateSpeed) == 0) { + if (!(s2ndRotateFlags & CAM_MOVE_ROTATE_LEFT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_LEFT) && + camera_approach_s16_symmetric_bool(&sModeOffsetYaw, minAreaYaw, rotateSpeed) == 0) { gCameraMovementFlags &= ~(CAM_MOVE_ROTATE_LEFT | CAM_MOVE_ENTERED_ROTATE_SURFACE); } // If it's the second time rotating, rotate all the way to +-105 degrees. - if ((s2ndRotateFlags & CAM_MOVE_ROTATE_RIGHT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_RIGHT) - && camera_approach_s16_symmetric_bool(&sModeOffsetYaw, DEGREES(105), rotateSpeed) == 0) { + if ((s2ndRotateFlags & CAM_MOVE_ROTATE_RIGHT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_RIGHT) && + camera_approach_s16_symmetric_bool(&sModeOffsetYaw, DEGREES(105), rotateSpeed) == 0) { gCameraMovementFlags &= ~(CAM_MOVE_ROTATE_RIGHT | CAM_MOVE_ENTERED_ROTATE_SURFACE); s2ndRotateFlags &= ~CAM_MOVE_ROTATE_RIGHT; } - if ((s2ndRotateFlags & CAM_MOVE_ROTATE_LEFT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_LEFT) - && camera_approach_s16_symmetric_bool(&sModeOffsetYaw, DEGREES(-105), rotateSpeed) == 0) { + if ((s2ndRotateFlags & CAM_MOVE_ROTATE_LEFT) && (gCameraMovementFlags & CAM_MOVE_ROTATE_LEFT) && + camera_approach_s16_symmetric_bool(&sModeOffsetYaw, DEGREES(-105), rotateSpeed) == 0) { gCameraMovementFlags &= ~(CAM_MOVE_ROTATE_LEFT | CAM_MOVE_ENTERED_ROTATE_SURFACE); s2ndRotateFlags &= ~CAM_MOVE_ROTATE_LEFT; } @@ -1120,7 +1115,7 @@ void lakitu_zoom(f32 rangeDist, s16 rangePitch) { } } -void radial_camera_input_default(struct Camera *c) { +void radial_camera_input_default(struct Camera* c) { radial_camera_input(c, 0.f); } @@ -1128,7 +1123,7 @@ void radial_camera_input_default(struct Camera *c) { * Makes Lakitu cam's yaw match the angle turned towards in C-Up mode, and makes Lakitu slowly fly back * to the distance he was at before C-Up */ -void update_yaw_and_dist_from_c_up(UNUSED struct Camera *c) { +void update_yaw_and_dist_from_c_up(UNUSED struct Camera* c) { f32 dist = 1000.f; sModeOffsetYaw = sModeInfo.transitionStart.yaw - sAreaYaw; @@ -1140,7 +1135,7 @@ void update_yaw_and_dist_from_c_up(UNUSED struct Camera *c) { /** * Handles input and updates for the radial camera mode */ -void mode_radial_camera(struct Camera *c) { +void mode_radial_camera(struct Camera* c) { Vec3f pos; UNUSED u8 filler1[8]; s16 oldAreaYaw = sAreaYaw; @@ -1170,7 +1165,7 @@ void mode_radial_camera(struct Camera *c) { /** * A mode that only has 8 camera angles, 45 degrees apart */ -void mode_8_directions_camera(struct Camera *c) { +void mode_8_directions_camera(struct Camera* c) { Vec3f pos; UNUSED u8 filler[8]; s16 oldAreaYaw = sAreaYaw; @@ -1198,7 +1193,7 @@ void mode_8_directions_camera(struct Camera *c) { * Updates the camera in outward radial mode. * sModeOffsetYaw is calculated in radial_camera_move, which calls offset_yaw_outward_radial */ -s32 update_outward_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_outward_radial_camera(struct Camera* c, Vec3f focus, Vec3f pos) { f32 xDistFocToMario = sMarioCamState->pos[0] - c->areaCenX; f32 zDistFocToMario = sMarioCamState->pos[2] - c->areaCenZ; s16 camYaw = atan2s(zDistFocToMario, xDistFocToMario) + sModeOffsetYaw + DEGREES(180); @@ -1219,7 +1214,7 @@ s32 update_outward_radial_camera(struct Camera *c, Vec3f focus, Vec3f pos) { /** * Input and updates for the outward radial mode. */ -void mode_outward_radial_camera(struct Camera *c) { +void mode_outward_radial_camera(struct Camera* c) { Vec3f pos; s16 oldAreaYaw = sAreaYaw; @@ -1249,7 +1244,7 @@ void mode_outward_radial_camera(struct Camera *c) { * Although, annoyingly, it's not truly parallel, the function returns the yaw from the camera to Mario, * so Mario will run slightly towards the camera. */ -s32 update_parallel_tracking_camera(struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_parallel_tracking_camera(struct Camera* c, Vec3f focus, Vec3f pos) { Vec3f path[2]; Vec3f parMidPoint; Vec3f marioOffset; @@ -1398,12 +1393,14 @@ s32 update_parallel_tracking_camera(struct Camera *c, Vec3f focus, Vec3f pos) { // Check if the camera should go to the next path if (sParTrackPath[sParTrackIndex + 1].startOfPath != 0) { // get Mario's distance to the next path - calculate_angles(sParTrackPath[sParTrackIndex + 1].pos, sParTrackPath[sParTrackIndex + 2].pos, &nextPitch, &nextYaw); + calculate_angles(sParTrackPath[sParTrackIndex + 1].pos, sParTrackPath[sParTrackIndex + 2].pos, &nextPitch, + &nextYaw); vec3f_set_dist_and_angle(sParTrackPath[sParTrackIndex + 1].pos, nextPathPos, 400.f, nextPitch, nextYaw); distToPrev = calc_abs_dist(marioPos, nextPathPos); // get Mario's distance to the previous path - calculate_angles(sParTrackPath[sParTrackIndex + 1].pos, sParTrackPath[sParTrackIndex].pos, &prevPitch, &prevYaw); + calculate_angles(sParTrackPath[sParTrackIndex + 1].pos, sParTrackPath[sParTrackIndex].pos, &prevPitch, + &prevYaw); vec3f_set_dist_and_angle(sParTrackPath[sParTrackIndex + 1].pos, prevPathPos, 400.f, prevPitch, prevYaw); distToNext = calc_abs_dist(marioPos, prevPathPos); if (distToPrev < distToNext) { @@ -1415,12 +1412,14 @@ s32 update_parallel_tracking_camera(struct Camera *c, Vec3f focus, Vec3f pos) { // Check if the camera should go to the previous path if (sParTrackIndex != 0) { // get Mario's distance to the next path - calculate_angles((*(sParTrackPath + sParTrackIndex)).pos, (*(sParTrackPath + sParTrackIndex + 1)).pos, &nextPitch, &nextYaw); + calculate_angles((*(sParTrackPath + sParTrackIndex)).pos, (*(sParTrackPath + sParTrackIndex + 1)).pos, + &nextPitch, &nextYaw); vec3f_set_dist_and_angle(sParTrackPath[sParTrackIndex].pos, nextPathPos, 700.f, nextPitch, nextYaw); distToPrev = calc_abs_dist(marioPos, nextPathPos); // get Mario's distance to the previous path - calculate_angles((*(sParTrackPath + sParTrackIndex)).pos, (*(sParTrackPath + sParTrackIndex - 1)).pos, &prevPitch, &prevYaw); + calculate_angles((*(sParTrackPath + sParTrackIndex)).pos, (*(sParTrackPath + sParTrackIndex - 1)).pos, + &prevPitch, &prevYaw); vec3f_set_dist_and_angle(sParTrackPath[sParTrackIndex].pos, prevPathPos, 700.f, prevPitch, prevYaw); distToNext = calc_abs_dist(marioPos, prevPathPos); if (distToPrev > distToNext) { @@ -1438,7 +1437,7 @@ s32 update_parallel_tracking_camera(struct Camera *c, Vec3f focus, Vec3f pos) { /** * Updates the camera during fixed mode. */ -s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) { +s32 update_fixed_camera(struct Camera* c, Vec3f focus, UNUSED Vec3f pos) { f32 focusFloorOff; f32 goalHeight; f32 ceilHeight; @@ -1449,7 +1448,7 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) { s16 pitch; s16 yaw; Vec3s faceAngle; - struct Surface *ceiling; + struct Surface* ceiling; Vec3f basePos; UNUSED u8 filler[12]; @@ -1485,8 +1484,7 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) { vec3f_copy(basePos, sFixedModeBasePosition); vec3f_add(basePos, sCastleEntranceOffset); - if (sMarioGeometry.currFloorType != SURFACE_DEATH_PLANE - && sMarioGeometry.currFloorHeight != FLOOR_LOWER_LIMIT) { + if (sMarioGeometry.currFloorType != SURFACE_DEATH_PLANE && sMarioGeometry.currFloorHeight != FLOOR_LOWER_LIMIT) { goalHeight = sMarioGeometry.currFloorHeight + basePos[1] + heightOffset; } else { goalHeight = gLakituState.goalPos[1]; @@ -1529,8 +1527,8 @@ s32 update_fixed_camera(struct Camera *c, Vec3f focus, UNUSED Vec3f pos) { /** * Updates the camera during a boss fight */ -s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) { - struct Object *o; +s32 update_boss_fight_camera(struct Camera* c, Vec3f focus, Vec3f pos) { + struct Object* o; UNUSED u8 filler2[12]; f32 focusDistance; UNUSED u8 filler3[4]; @@ -1544,7 +1542,7 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) { UNUSED s16 unused; s16 yaw; s16 heldState; - struct Surface *floor; + struct Surface* floor; UNUSED u8 filler[20]; Vec3f secondFocus; Vec3f holdFocOffset = { 0.f, -150.f, -125.f }; @@ -1567,7 +1565,7 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) { object_pos_to_vec3f(secondFocus, o); heldState = o->oHeldState; } else { - // If no boss is there, just rotate around the area's center point. + // If no boss is there, just rotate around the area's center point. secondFocus[0] = c->areaCenX; secondFocus[1] = sMarioCamState->pos[1]; secondFocus[2] = c->areaCenZ; @@ -1614,7 +1612,9 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) { //! Must be same line to match on -O2 // Prevent the camera from going to the ground in the outside boss fight - if (gCurrLevelNum == LEVEL_BBH) { pos[1] = 2047.f; } + if (gCurrLevelNum == LEVEL_BBH) { + pos[1] = 2047.f; + } // Rotate from C-Button input if (sCSideButtonYaw < 0) { @@ -1632,7 +1632,7 @@ s32 update_boss_fight_camera(struct Camera *c, Vec3f focus, Vec3f pos) { focus[1] = (sMarioCamState->pos[1] + secondFocus[1]) / 2.f + 100.f; if (heldState == 1) { - focus[1] += 300.f * sins((gMarioStates[0].angleVel[1] > 0.f) ? gMarioStates[0].angleVel[1] + focus[1] += 300.f * sins((gMarioStates[0].angleVel[1] > 0.f) ? gMarioStates[0].angleVel[1] : -gMarioStates[0].angleVel[1]); } @@ -1666,8 +1666,16 @@ s16 unused8032D0B0[] = { 16, 9, 17, 0 }; * type exits the course or not. */ u8 sDanceCutsceneTable[] = { - CUTSCENE_DANCE_FLY_AWAY, CUTSCENE_DANCE_ROTATE, CUTSCENE_DANCE_CLOSEUP, CUTSCENE_KEY_DANCE, CUTSCENE_DANCE_DEFAULT, - FALSE, FALSE, FALSE, FALSE, TRUE, + CUTSCENE_DANCE_FLY_AWAY, + CUTSCENE_DANCE_ROTATE, + CUTSCENE_DANCE_CLOSEUP, + CUTSCENE_KEY_DANCE, + CUTSCENE_DANCE_DEFAULT, + FALSE, + FALSE, + FALSE, + FALSE, + TRUE, }; /** @@ -1679,15 +1687,11 @@ struct UnusedDanceInfo { f32 distMultiplier; }; -struct UnusedDanceInfo unusedDanceInfo1 = { - { -3026.0f, 912.0f, -2148.0f }, 600.0f, 0.3f -}; +struct UnusedDanceInfo unusedDanceInfo1 = { { -3026.0f, 912.0f, -2148.0f }, 600.0f, 0.3f }; u32 unusedDanceType = 0; -struct UnusedDanceInfo unusedDanceInfo2 = { - { -4676.0f, 917.0f, -3802.0f }, 600.0f, 0.3f -}; +struct UnusedDanceInfo unusedDanceInfo2 = { { -4676.0f, 917.0f, -3802.0f }, 600.0f, 0.3f }; /** * Table that dictates camera movement in bookend room. @@ -1700,14 +1704,14 @@ struct ParallelTrackingPoint sBBHLibraryParTrackPath[] = { { 0, { 0.0f, 0.0f, 0.0f }, 0.0f, 0.0f }, }; -s32 unused_update_mode_5_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) { +s32 unused_update_mode_5_camera(UNUSED struct Camera* c, UNUSED Vec3f focus, UNUSED Vec3f pos) { return 0; } UNUSED static void stub_camera_1(UNUSED s32 unused) { } -void mode_boss_fight_camera(struct Camera *c) { +void mode_boss_fight_camera(struct Camera* c) { c->nextYaw = update_boss_fight_camera(c, c->focus, c->pos); } @@ -1716,7 +1720,7 @@ void mode_boss_fight_camera(struct Camera *c) { * * @see update_parallel_tracking_camera */ -void mode_parallel_tracking_camera(struct Camera *c) { +void mode_parallel_tracking_camera(struct Camera* c) { s16 dummy; radial_camera_input(c, 0.f); @@ -1728,7 +1732,7 @@ void mode_parallel_tracking_camera(struct Camera *c) { /** * Fixed camera mode, the camera rotates around a point and looks and zooms toward Mario. */ -void mode_fixed_camera(struct Camera *c) { +void mode_fixed_camera(struct Camera* c) { UNUSED u8 filler[8]; if (gCurrLevelNum == LEVEL_BBH) { @@ -1747,7 +1751,7 @@ void mode_fixed_camera(struct Camera *c) { * * The C-Buttons rotate the camera 90 degrees left/right and 67.5 degrees up/down. */ -s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_behind_mario_camera(struct Camera* c, Vec3f focus, Vec3f pos) { UNUSED u8 filler1[12]; f32 dist; UNUSED u8 filler2[4]; @@ -1893,9 +1897,9 @@ s32 update_behind_mario_camera(struct Camera *c, Vec3f focus, Vec3f pos) { /** * "Behind Mario" mode: used when Mario is flying, on the water's surface, or shot from a cannon */ -s32 mode_behind_mario(struct Camera *c) { - struct MarioState *marioState = &gMarioStates[0]; - struct Surface *floor; +s32 mode_behind_mario(struct Camera* c) { + struct MarioState* marioState = &gMarioStates[0]; + struct Surface* floor; Vec3f newPos; //! @bug oldPos is unused, see resolve_geometry_collisions Vec3f oldPos; @@ -1946,8 +1950,8 @@ s32 mode_behind_mario(struct Camera *c) { * * In slide mode, keep the camera 800 units from Mario */ -s16 update_slide_camera(struct Camera *c) { - struct Surface *floor; +s16 update_slide_camera(struct Camera* c) { + struct Surface* floor; f32 floorHeight; Vec3f pos; f32 distCamToFocus; @@ -1955,7 +1959,7 @@ s16 update_slide_camera(struct Camera *c) { f32 pitchScale; s16 camPitch; s16 camYaw; - UNUSED struct MarioState *marioState = &gMarioStates[0]; + UNUSED struct MarioState* marioState = &gMarioStates[0]; s16 goalPitch = 0x1555; s16 goalYaw = sMarioCamState->faceAngle[1] + DEGREES(180); @@ -2000,7 +2004,7 @@ s16 update_slide_camera(struct Camera *c) { camPitch += 0x1000 * pitchScale; vec3f_set_dist_and_angle(c->pos, c->focus, distCamToFocus, camPitch, camYaw); - // Slide mode + // Slide mode } else { vec3f_set_dist_and_angle(c->focus, c->pos, maxCamDist + sLakituDist, camPitch, camYaw); sStatusFlags |= CAM_FLAG_BLOCK_SMOOTH_MOVEMENT; @@ -2022,25 +2026,25 @@ s16 update_slide_camera(struct Camera *c) { return camYaw; } -void mode_behind_mario_camera(struct Camera *c) { +void mode_behind_mario_camera(struct Camera* c) { c->nextYaw = mode_behind_mario(c); } -s32 nop_update_water_camera(UNUSED struct Camera *c, UNUSED Vec3f focus, UNUSED Vec3f pos) { +s32 nop_update_water_camera(UNUSED struct Camera* c, UNUSED Vec3f focus, UNUSED Vec3f pos) { return 0; } /** * Exactly the same as BEHIND_MARIO */ -void mode_water_surface_camera(struct Camera *c) { +void mode_water_surface_camera(struct Camera* c) { c->nextYaw = mode_behind_mario(c); } /** * Used in sModeTransitions for CLOSE and FREE_ROAM mode */ -s32 update_mario_camera(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_mario_camera(UNUSED struct Camera* c, Vec3f focus, Vec3f pos) { s16 yaw = sMarioCamState->faceAngle[1] + sModeOffsetYaw + DEGREES(180); focus_on_mario(focus, pos, 125.f, 125.f, gCameraZoomDist, 0x05B0, yaw); @@ -2052,14 +2056,14 @@ s32 update_mario_camera(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { * * The camera moves behind Mario, and can rotate all the way around */ -s16 update_default_camera(struct Camera *c) { +s16 update_default_camera(struct Camera* c) { Vec3f tempPos; Vec3f cPos; UNUSED u8 filler1[12]; - struct Surface *marioFloor; - struct Surface *cFloor; - struct Surface *tempFloor; - struct Surface *ceil; + struct Surface* marioFloor; + struct Surface* cFloor; + struct Surface* tempFloor; + struct Surface* ceil; f32 camFloorHeight; f32 tempFloorHeight; f32 marioFloorHeight; @@ -2084,9 +2088,7 @@ s16 update_default_camera(struct Camera *c) { f32 scale; s32 avoidStatus = 0; s32 closeToMario = 0; - f32 ceilHeight = find_ceil(gLakituState.goalPos[0], - gLakituState.goalPos[1], - gLakituState.goalPos[2], &ceil); + f32 ceilHeight = find_ceil(gLakituState.goalPos[0], gLakituState.goalPos[1], gLakituState.goalPos[2], &ceil); s16 yawDir; handle_c_button_movement(c); @@ -2104,8 +2106,7 @@ s16 update_default_camera(struct Camera *c) { zoomDist = gCameraZoomDist; } - if (sMarioCamState->action & ACT_FLAG_HANGING || - sMarioCamState->action == ACT_RIDING_HOOT) { + if (sMarioCamState->action & ACT_FLAG_HANGING || sMarioCamState->action == ACT_RIDING_HOOT) { zoomDist *= 0.8f; set_handheld_shake(HAND_CAM_SHAKE_HANG_OWL); } @@ -2364,8 +2365,8 @@ s16 update_default_camera(struct Camera *c) { } } if (ceilHeight != CELL_HEIGHT_LIMIT) { - if (c->pos[1] > (ceilHeight -= 150.f) - && (avoidStatus = is_range_behind_surface(c->pos, sMarioCamState->pos, ceil, 0, -1)) == 1) { + if (c->pos[1] > (ceilHeight -= 150.f) && + (avoidStatus = is_range_behind_surface(c->pos, sMarioCamState->pos, ceil, 0, -1)) == 1) { c->pos[1] = ceilHeight; } } @@ -2379,7 +2380,7 @@ s16 update_default_camera(struct Camera *c) { * The default camera mode * Used by close and free roam modes */ -void mode_default_camera(struct Camera *c) { +void mode_default_camera(struct Camera* c) { set_fov_function(CAM_FOV_DEFAULT); c->nextYaw = update_default_camera(c); pan_ahead_of_player(c); @@ -2388,7 +2389,7 @@ void mode_default_camera(struct Camera *c) { /** * The mode used by close and free roam */ -void mode_lakitu_camera(struct Camera *c) { +void mode_lakitu_camera(struct Camera* c) { gCameraZoomDist = 800.f; mode_default_camera(c); } @@ -2396,7 +2397,7 @@ void mode_lakitu_camera(struct Camera *c) { /** * When no other mode is active and the current R button mode is Mario */ -void mode_mario_camera(struct Camera *c) { +void mode_mario_camera(struct Camera* c) { gCameraZoomDist = 350.f; mode_default_camera(c); } @@ -2404,7 +2405,7 @@ void mode_mario_camera(struct Camera *c) { /** * Rotates the camera around the spiral staircase. */ -s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_spiral_stairs_camera(struct Camera* c, Vec3f focus, Vec3f pos) { UNUSED s16 unused; /// The returned yaw s16 camYaw; @@ -2419,7 +2420,7 @@ s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) { UNUSED u8 filler[4]; Vec3f cPos; Vec3f checkPos; - struct Surface *floor; + struct Surface* floor; // unused f32 dist; f32 focusHeight; @@ -2479,18 +2480,18 @@ s32 update_spiral_stairs_camera(struct Camera *c, Vec3f focus, Vec3f pos) { /** * The mode used in the spiral staircase in the castle */ -void mode_spiral_stairs_camera(struct Camera *c) { +void mode_spiral_stairs_camera(struct Camera* c) { c->nextYaw = update_spiral_stairs_camera(c, c->focus, c->pos); } -s32 update_slide_or_0f_camera(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_slide_or_0f_camera(UNUSED struct Camera* c, Vec3f focus, Vec3f pos) { s16 yaw = sMarioCamState->faceAngle[1] + sModeOffsetYaw + DEGREES(180); focus_on_mario(focus, pos, 125.f, 125.f, 800.f, 5461, yaw); return sMarioCamState->faceAngle[1]; } -static UNUSED void unused_mode_0f_camera(struct Camera *c) { +static UNUSED void unused_mode_0f_camera(struct Camera* c) { if (gPlayer1Controller->buttonPressed & U_CBUTTONS) { gCameraMovementFlags |= CAM_MOVE_C_UP_MODE; } @@ -2501,7 +2502,7 @@ static UNUSED void unused_mode_0f_camera(struct Camera *c) { * Slide/hoot mode. * In this mode, the camera is always at the back of Mario, because Mario generally only moves forward. */ -void mode_slide_camera(struct Camera *c) { +void mode_slide_camera(struct Camera* c) { if (sMarioGeometry.currFloorType == SURFACE_CLOSE_CAMERA || sMarioGeometry.currFloorType == SURFACE_NO_CAM_COL_SLIPPERY) { mode_lakitu_camera(c); @@ -2513,7 +2514,7 @@ void mode_slide_camera(struct Camera *c) { } } -void store_lakitu_cam_info_for_c_up(struct Camera *c) { +void store_lakitu_cam_info_for_c_up(struct Camera* c) { vec3f_copy(sCameraStoreCUp.pos, c->pos); vec3f_sub(sCameraStoreCUp.pos, sMarioCamState->pos); // Only store the y value, and as an offset from Mario, for some reason @@ -2525,7 +2526,7 @@ void store_lakitu_cam_info_for_c_up(struct Camera *c) { * * @see update_mario_inputs */ -s32 set_mode_c_up(struct Camera *c) { +s32 set_mode_c_up(struct Camera* c) { if (!(gCameraMovementFlags & CAM_MOVE_C_UP_MODE)) { gCameraMovementFlags |= CAM_MOVE_C_UP_MODE; store_lakitu_cam_info_for_c_up(c); @@ -2539,8 +2540,8 @@ s32 set_mode_c_up(struct Camera *c) { * Zoom the camera out of C-Up mode, avoiding moving into a wall, if possible, by searching for an open * direction. */ -s32 exit_c_up(struct Camera *c) { - struct Surface *surface; +s32 exit_c_up(struct Camera* c) { + struct Surface* surface; Vec3f checkFoc; Vec3f curPos; // Variables for searching for an open direction @@ -2573,8 +2574,8 @@ s32 exit_c_up(struct Camera *c) { // Search for an open direction to zoom out in, if the camera is changing to close, free roam, // or spiral-stairs mode - if (sModeInfo.lastMode == CAMERA_MODE_SPIRAL_STAIRS || sModeInfo.lastMode == CAMERA_MODE_CLOSE - || sModeInfo.lastMode == CAMERA_MODE_FREE_ROAM) { + if (sModeInfo.lastMode == CAMERA_MODE_SPIRAL_STAIRS || sModeInfo.lastMode == CAMERA_MODE_CLOSE || + sModeInfo.lastMode == CAMERA_MODE_FREE_ROAM) { searching = 1; // Check the whole circle around Mario for an open direction to zoom out to for (sector = 0; sector < 16 && searching == 1; sector++) { @@ -2644,7 +2645,7 @@ s32 exit_c_up(struct Camera *c) { /** * The mode used when C-Up is pressed. */ -s32 update_c_up(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { +s32 update_c_up(UNUSED struct Camera* c, Vec3f focus, Vec3f pos) { s16 pitch = sCUpCameraPitch; s16 yaw = sMarioCamState->faceAngle[1] + sModeOffsetYaw + DEGREES(180); @@ -2655,7 +2656,7 @@ s32 update_c_up(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { /** * Make Mario's head move in C-Up mode. */ -void move_mario_head_c_up(UNUSED struct Camera *c) { +void move_mario_head_c_up(UNUSED struct Camera* c) { UNUSED s16 pitch = sCUpCameraPitch; UNUSED s16 yaw = sModeOffsetYaw; @@ -2687,18 +2688,18 @@ void move_mario_head_c_up(UNUSED struct Camera *c) { /** * Zooms the camera in for C-Up mode */ -void move_into_c_up(struct Camera *c) { - struct LinearTransitionPoint *start = &sModeInfo.transitionStart; - struct LinearTransitionPoint *end = &sModeInfo.transitionEnd; +void move_into_c_up(struct Camera* c) { + struct LinearTransitionPoint* start = &sModeInfo.transitionStart; + struct LinearTransitionPoint* end = &sModeInfo.transitionEnd; - f32 dist = end->dist - start->dist; + f32 dist = end->dist - start->dist; s16 pitch = end->pitch - start->pitch; - s16 yaw = end->yaw - start->yaw; + s16 yaw = end->yaw - start->yaw; // Linearly interpolate from start to end position's polar coordinates - dist = start->dist + dist * sModeInfo.frame / sModeInfo.max; + dist = start->dist + dist * sModeInfo.frame / sModeInfo.max; pitch = start->pitch + pitch * sModeInfo.frame / sModeInfo.max; - yaw = start->yaw + yaw * sModeInfo.frame / sModeInfo.max; + yaw = start->yaw + yaw * sModeInfo.frame / sModeInfo.max; // Linearly interpolate the focus from start to end c->focus[0] = start->focus[0] + (end->focus[0] - start->focus[0]) * sModeInfo.frame / sModeInfo.max; @@ -2720,7 +2721,7 @@ void move_into_c_up(struct Camera *c) { /** * The main update function for C-Up mode */ -s32 mode_c_up_camera(struct Camera *c) { +s32 mode_c_up_camera(struct Camera* c) { UNUSED u8 filler[12]; // Play a sound when entering C-Up mode @@ -2768,9 +2769,9 @@ s32 mode_c_up_camera(struct Camera *c) { /** * Used when Mario is in a cannon. */ -s32 update_in_cannon(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { - focus_on_mario(pos, focus, 125.f + sCannonYOffset, 125.f, 800.f, - sMarioCamState->faceAngle[0], sMarioCamState->faceAngle[1]); +s32 update_in_cannon(UNUSED struct Camera* c, Vec3f focus, Vec3f pos) { + focus_on_mario(pos, focus, 125.f + sCannonYOffset, 125.f, 800.f, sMarioCamState->faceAngle[0], + sMarioCamState->faceAngle[1]); return sMarioCamState->faceAngle[1]; } @@ -2778,7 +2779,7 @@ s32 update_in_cannon(UNUSED struct Camera *c, Vec3f focus, Vec3f pos) { * Updates the camera when Mario is in a cannon. * sCannonYOffset is used to make the camera rotate down when Mario has just entered the cannon */ -void mode_cannon_camera(struct Camera *c) { +void mode_cannon_camera(struct Camera* c) { UNUSED u8 filler[24]; sLakituPitch = 0; @@ -2803,7 +2804,7 @@ void mode_cannon_camera(struct Camera *c) { * * @see next_lakitu_state() */ -void transition_next_state(UNUSED struct Camera *c, s16 frames) { +void transition_next_state(UNUSED struct Camera* c, s16 frames) { if (!(sStatusFlags & CAM_FLAG_FRAME_AFTER_CAM_INIT)) { sStatusFlags |= (CAM_FLAG_START_TRANSITION | CAM_FLAG_TRANSITION_OUT_OF_C_UP); sModeTransition.framesLeft = frames; @@ -2816,14 +2817,14 @@ void transition_next_state(UNUSED struct Camera *c, s16 frames) { * Used to change the camera mode to 'level-oriented' modes * namely: RADIAL/OUTWARD_RADIAL, 8_DIRECTIONS, FREE_ROAM, CLOSE, SPIRAL_STAIRS, and SLIDE_HOOT */ -void transition_to_camera_mode(struct Camera *c, s16 newMode, s16 numFrames) { +void transition_to_camera_mode(struct Camera* c, s16 newMode, s16 numFrames) { if (c->mode != newMode) { sModeInfo.newMode = (newMode != -1) ? newMode : sModeInfo.lastMode; sModeInfo.lastMode = c->mode; c->mode = sModeInfo.newMode; // Clear movement flags that would affect the transition - gCameraMovementFlags &= (u16)~(CAM_MOVE_RESTRICT | CAM_MOVE_ROTATE); + gCameraMovementFlags &= (u16) ~(CAM_MOVE_RESTRICT | CAM_MOVE_ROTATE); if (!(sStatusFlags & CAM_FLAG_FRAME_AFTER_CAM_INIT)) { transition_next_state(c, numFrames); sCUpCameraPitch = 0; @@ -2848,14 +2849,14 @@ void transition_to_camera_mode(struct Camera *c, s16 newMode, s16 numFrames) { * @param mode the mode to change to, or -1 to switch to the previous mode * @param frames number of frames the transition should last, only used when entering C_UP */ -void set_camera_mode(struct Camera *c, s16 mode, s16 frames) { - struct LinearTransitionPoint *start = &sModeInfo.transitionStart; - struct LinearTransitionPoint *end = &sModeInfo.transitionEnd; +void set_camera_mode(struct Camera* c, s16 mode, s16 frames) { + struct LinearTransitionPoint* start = &sModeInfo.transitionStart; + struct LinearTransitionPoint* end = &sModeInfo.transitionEnd; if (mode == CAMERA_MODE_WATER_SURFACE && gCurrLevelArea == AREA_TTM_OUTSIDE) { } else { // Clear movement flags that would affect the transition - gCameraMovementFlags &= (u16)~(CAM_MOVE_RESTRICT | CAM_MOVE_ROTATE); + gCameraMovementFlags &= (u16) ~(CAM_MOVE_RESTRICT | CAM_MOVE_ROTATE); gCameraMovementFlags |= CAM_MOVING_INTO_MODE; if (mode == CAMERA_MODE_NONE) { mode = CAMERA_MODE_CLOSE; @@ -2900,8 +2901,8 @@ void set_camera_mode(struct Camera *c, s16 mode, s16 frames) { /** * Updates Lakitu's position/focus and applies camera shakes. */ -void update_lakitu(struct Camera *c) { - struct Surface *floor = NULL; +void update_lakitu(struct Camera* c) { + struct Surface* floor = NULL; Vec3f newPos; Vec3f newFoc; UNUSED u8 filler1[12]; @@ -2911,11 +2912,9 @@ void update_lakitu(struct Camera *c) { if (gCameraMovementFlags & CAM_MOVE_PAUSE_SCREEN) { } else { - if (c->cutscene) { - } + if (c->cutscene) {} if (TRUE) { - newYaw = next_lakitu_state(newPos, newFoc, c->pos, c->focus, sOldPosition, sOldFocus, - c->nextYaw); + newYaw = next_lakitu_state(newPos, newFoc, c->pos, c->focus, sOldPosition, sOldFocus, c->nextYaw); set_or_approach_s16_symmetric(&c->yaw, newYaw, sYawSpeed); sStatusFlags &= ~CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; } else { @@ -2934,11 +2933,9 @@ void update_lakitu(struct Camera *c) { vec3f_copy(gLakituState.goalFocus, c->focus); // Simulate Lakitu flying to the new position and turning towards the new focus - set_or_approach_vec3f_asymptotic(gLakituState.curPos, newPos, - gLakituState.posHSpeed, gLakituState.posVSpeed, + set_or_approach_vec3f_asymptotic(gLakituState.curPos, newPos, gLakituState.posHSpeed, gLakituState.posVSpeed, gLakituState.posHSpeed); - set_or_approach_vec3f_asymptotic(gLakituState.curFocus, newFoc, - gLakituState.focHSpeed, gLakituState.focVSpeed, + set_or_approach_vec3f_asymptotic(gLakituState.curFocus, newFoc, gLakituState.focHSpeed, gLakituState.focVSpeed, gLakituState.focHSpeed); // Adjust Lakitu's speed back to normal set_or_approach_f32_asymptotic(&gLakituState.focHSpeed, 0.8f, 0.05f); @@ -2981,9 +2978,7 @@ void update_lakitu(struct Camera *c) { if (c->mode != CAMERA_MODE_C_UP && c->cutscene == 0) { gCheckingSurfaceCollisionsForCamera = TRUE; - distToFloor = find_floor(gLakituState.pos[0], - gLakituState.pos[1] + 20.0f, - gLakituState.pos[2], &floor); + distToFloor = find_floor(gLakituState.pos[0], gLakituState.pos[1] + 20.0f, gLakituState.pos[2], &floor); if (distToFloor != FLOOR_LOWER_LIMIT) { if (gLakituState.pos[1] < (distToFloor += 100.0f)) { gLakituState.pos[1] = distToFloor; @@ -3000,12 +2995,11 @@ void update_lakitu(struct Camera *c) { gLakituState.defMode = c->defMode; } - /** * The main camera update function. * Gets controller input, checks for cutscenes, handles mode changes, and moves the camera */ -void update_camera(struct Camera *c) { +void update_camera(struct Camera* c) { UNUSED u8 filler[24]; gCamera = c; @@ -3052,8 +3046,8 @@ void update_camera(struct Camera *c) { camera_course_processing(c); stub_camera_3(c); - sCButtonsPressed = find_c_buttons_pressed(sCButtonsPressed, gPlayer1Controller->buttonPressed, - gPlayer1Controller->buttonDown); + sCButtonsPressed = + find_c_buttons_pressed(sCButtonsPressed, gPlayer1Controller->buttonPressed, gPlayer1Controller->buttonDown); if (c->cutscene != 0) { sYawSpeed = 0; @@ -3160,14 +3154,13 @@ void update_camera(struct Camera *c) { if (gCurrLevelNum != LEVEL_CASTLE) { // If fixed camera is selected as the alternate mode, then fix the camera as long as the right // trigger is held - if ((c->cutscene == 0 && - (gPlayer1Controller->buttonDown & R_TRIG) && cam_select_alt_mode(0) == CAM_SELECTION_FIXED) - || (gCameraMovementFlags & CAM_MOVE_FIX_IN_PLACE) - || (sMarioCamState->action) == ACT_GETTING_BLOWN) { + if ((c->cutscene == 0 && (gPlayer1Controller->buttonDown & R_TRIG) && + cam_select_alt_mode(0) == CAM_SELECTION_FIXED) || + (gCameraMovementFlags & CAM_MOVE_FIX_IN_PLACE) || (sMarioCamState->action) == ACT_GETTING_BLOWN) { // If this is the first frame that R_TRIG is held, play the "click" sound - if (c->cutscene == 0 && (gPlayer1Controller->buttonPressed & R_TRIG) - && cam_select_alt_mode(0) == CAM_SELECTION_FIXED) { + if (c->cutscene == 0 && (gPlayer1Controller->buttonPressed & R_TRIG) && + cam_select_alt_mode(0) == CAM_SELECTION_FIXED) { sCameraSoundFlags |= CAM_SOUND_FIXED_ACTIVE; play_sound_rbutton_changed(); } @@ -3201,11 +3194,11 @@ void update_camera(struct Camera *c) { /** * Reset all the camera variables to their arcane defaults */ -void reset_camera(struct Camera *c) { +void reset_camera(struct Camera* c) { UNUSED s32 unused = 0; UNUSED u8 filler[16]; - UNUSED struct LinearTransitionPoint *start = &sModeInfo.transitionStart; - UNUSED struct LinearTransitionPoint *end = &sModeInfo.transitionEnd; + UNUSED struct LinearTransitionPoint* start = &sModeInfo.transitionStart; + UNUSED struct LinearTransitionPoint* end = &sModeInfo.transitionEnd; gCamera = c; gCameraMovementFlags = 0; @@ -3274,8 +3267,8 @@ void reset_camera(struct Camera *c) { unused8033B310 = 0; } -void init_camera(struct Camera *c) { - struct Surface *floor = 0; +void init_camera(struct Camera* c) { + struct Surface* floor = 0; Vec3f marioOffset; s32 i; @@ -3331,7 +3324,7 @@ void init_camera(struct Camera *c) { // Note: This replaced an "old" way to call these cutscenes using // a camEvent value: CAM_EVENT_BOWSER_INIT case LEVEL_BOWSER_1: - if(!ROM_JP) { + if (!ROM_JP) { // Since Bowser 1 has a demo entry, check for it // If it is, then set CamAct to the end to directly activate Bowser // If it isn't, then start cutscene @@ -3413,8 +3406,8 @@ void init_camera(struct Camera *c) { // Set the camera pos to marioOffset (relative to Mario), added to Mario's position offset_rotated(c->pos, sMarioCamState->pos, marioOffset, sMarioCamState->faceAngle); if (c->mode != CAMERA_MODE_BEHIND_MARIO) { - c->pos[1] = find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 100.f, - sMarioCamState->pos[2], &floor) + 125.f; + c->pos[1] = + find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 100.f, sMarioCamState->pos[2], &floor) + 125.f; } vec3f_copy(c->focus, sMarioCamState->pos); vec3f_copy(gLakituState.curPos, c->pos); @@ -3447,7 +3440,7 @@ void init_camera(struct Camera *c) { * This isolates the lower 16 'area' bits, subtracts 1 because areas are 1-indexed, and effectively * modulo-4's the result, because each 8-bit mask only has 4 area bits for each level */ -void zoom_out_if_paused_and_outside(struct GraphNodeCamera *camera) { +void zoom_out_if_paused_and_outside(struct GraphNodeCamera* camera) { UNUSED u8 filler1[8]; UNUSED f32 dist; UNUSED s16 pitch; @@ -3488,9 +3481,9 @@ void select_mario_cam_mode(void) { /** * Allocate the GraphNodeCamera's config.camera, and copy `c`'s focus to the Camera's area center point. */ -void create_camera(struct GraphNodeCamera *gc, struct AllocOnlyPool *pool) { +void create_camera(struct GraphNodeCamera* gc, struct AllocOnlyPool* pool) { s16 mode = gc->config.mode; - struct Camera *c = alloc_only_pool_alloc(pool, sizeof(struct Camera)); + struct Camera* c = alloc_only_pool_alloc(pool, sizeof(struct Camera)); gc->config.camera = c; c->mode = mode; @@ -3508,9 +3501,9 @@ void create_camera(struct GraphNodeCamera *gc, struct AllocOnlyPool *pool) { /** * Copy Lakitu's pos and foc into `gc` */ -void update_graph_node_camera(struct GraphNodeCamera *gc) { +void update_graph_node_camera(struct GraphNodeCamera* gc) { UNUSED u8 filler[8]; - UNUSED struct Camera *c = gc->config.camera; + UNUSED struct Camera* c = gc->config.camera; FrameInterpolation_ShouldInterpolateFrame(sFramesPaused == 0); gc->rollScreen = gLakituState.roll; vec3f_copy(gc->pos, gLakituState.pos); @@ -3519,9 +3512,9 @@ void update_graph_node_camera(struct GraphNodeCamera *gc) { FrameInterpolation_ShouldInterpolateFrame(true); } -Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) { - struct GraphNodeCamera *gc = (struct GraphNodeCamera *) g; - UNUSED Mat4 *unusedMat = context; +Gfx* geo_camera_main(s32 callContext, struct GraphNode* g, void* context) { + struct GraphNodeCamera* gc = (struct GraphNodeCamera*)g; + UNUSED Mat4* unusedMat = context; switch (callContext) { case GEO_CONTEXT_CREATE: @@ -3534,10 +3527,10 @@ Gfx *geo_camera_main(s32 callContext, struct GraphNode *g, void *context) { return NULL; } -void stub_camera_2(UNUSED struct Camera *c) { +void stub_camera_2(UNUSED struct Camera* c) { } -void stub_camera_3(UNUSED struct Camera *c) { +void stub_camera_3(UNUSED struct Camera* c) { } void vec3f_sub(Vec3f dst, Vec3f src) { @@ -3546,19 +3539,19 @@ void vec3f_sub(Vec3f dst, Vec3f src) { dst[2] -= src[2]; } -void object_pos_to_vec3f(Vec3f dst, struct Object *o) { +void object_pos_to_vec3f(Vec3f dst, struct Object* o) { dst[0] = o->oPosX; dst[1] = o->oPosY; dst[2] = o->oPosZ; } -void vec3f_to_object_pos(struct Object *o, Vec3f src) { +void vec3f_to_object_pos(struct Object* o, Vec3f src) { o->oPosX = src[0]; o->oPosY = src[1]; o->oPosZ = src[2]; } -void unused_object_angle_to_vec3s(Vec3s dst, struct Object *o) { +void unused_object_angle_to_vec3s(Vec3s dst, struct Object* o) { dst[0] = o->oMoveAnglePitch; dst[1] = o->oMoveAngleYaw; dst[2] = o->oMoveAngleRoll; @@ -3626,7 +3619,7 @@ void evaluate_cubic_spline(f32 u, Vec3f Q, Vec3f a0, Vec3f a1, Vec3f a2, Vec3f a * @return 1 if the point has reached the end of the spline, when `progress` reaches 1.0 or greater, and * the 4th CutsceneSplinePoint in the current segment away from spline[splineSegment] has an index of -1. */ -s32 move_point_along_spline(Vec3f p, struct CutsceneSplinePoint spline[], s16 *splineSegment, f32 *progress) { +s32 move_point_along_spline(Vec3f p, struct CutsceneSplinePoint spline[], s16* splineSegment, f32* progress) { s32 finished = 0; Vec3f controlPoints[4]; s32 i = 0; @@ -3812,8 +3805,8 @@ void shake_camera_handheld(Vec3f pos, Vec3f focus) { shakeSpline[i][1] = sHandheldShakeSpline[i].point[1]; shakeSpline[i][2] = sHandheldShakeSpline[i].point[2]; } - evaluate_cubic_spline(sHandheldShakeTimer, shakeOffset, shakeSpline[0], - shakeSpline[1], shakeSpline[2], shakeSpline[3]); + evaluate_cubic_spline(sHandheldShakeTimer, shakeOffset, shakeSpline[0], shakeSpline[1], shakeSpline[2], + shakeSpline[3]); if (1.f <= (sHandheldShakeTimer += sHandheldShakeInc)) { // The first 3 control points are always (0,0,0), so the random spline is always just a // straight line @@ -3892,11 +3885,11 @@ s32 find_c_buttons_pressed(u16 currentState, u16 buttonsPressed, u16 buttonsDown /** * Determine which icon to show on the HUD */ -s32 update_camera_hud_status(struct Camera *c) { +s32 update_camera_hud_status(struct Camera* c) { s16 status = CAM_STATUS_NONE; - if (c->cutscene != 0 - || ((gPlayer1Controller->buttonDown & R_TRIG) && cam_select_alt_mode(0) == CAM_SELECTION_FIXED)) { + if (c->cutscene != 0 || + ((gPlayer1Controller->buttonDown & R_TRIG) && cam_select_alt_mode(0) == CAM_SELECTION_FIXED)) { status |= CAM_STATUS_FIXED; } else if (set_cam_angle(0) == CAM_ANGLE_MARIO) { status |= CAM_STATUS_MARIO; @@ -3920,7 +3913,7 @@ s32 update_camera_hud_status(struct Camera *c) { */ s32 collide_with_walls(Vec3f pos, f32 offsetY, f32 radius) { struct WallCollisionData collisionData; - struct Surface *wall = NULL; + struct Surface* wall = NULL; f32 normX; f32 normY; f32 normZ; @@ -3999,7 +3992,7 @@ s32 is_within_100_units_of_mario(f32 posX, f32 posY, f32 posZ) { return isCloseToMario; } -s32 set_or_approach_f32_asymptotic(f32 *dst, f32 goal, f32 scale) { +s32 set_or_approach_f32_asymptotic(f32* dst, f32 goal, f32 scale) { if (sStatusFlags & CAM_FLAG_SMOOTH_MOVEMENT) { approach_f32_asymptotic_bool(dst, goal, scale); } else { @@ -4017,7 +4010,7 @@ s32 set_or_approach_f32_asymptotic(f32 *dst, f32 goal, f32 scale) { * and adding a fraction of that to the current value. * Edits the current value directly, returns TRUE if the target has been reached, FALSE otherwise. */ -s32 approach_f32_asymptotic_bool(f32 *current, f32 target, f32 multiplier) { +s32 approach_f32_asymptotic_bool(f32* current, f32 target, f32 multiplier) { if (multiplier > 1.f) { multiplier = 1.f; } @@ -4042,7 +4035,7 @@ f32 approach_f32_asymptotic(f32 current, f32 target, f32 multiplier) { * is reached. Note: Since this function takes integers as parameters, the last argument is the * reciprocal of what it would be in the previous two functions. */ -s32 approach_s16_asymptotic_bool(s16 *current, s16 target, s16 divisor) { +s32 approach_s16_asymptotic_bool(s16* current, s16 target, s16 divisor) { s16 temp = *current; if (divisor == 0) { @@ -4108,7 +4101,7 @@ void approach_vec3s_asymptotic(Vec3s current, Vec3s target, s16 xMul, s16 yMul, approach_s16_asymptotic_bool(¤t[2], target[2], zMul); } -s32 camera_approach_s16_symmetric_bool(s16 *current, s16 target, s16 increment) { +s32 camera_approach_s16_symmetric_bool(s16* current, s16 target, s16 increment) { s16 dist = target - *current; if (increment < 0) { @@ -4160,7 +4153,7 @@ s32 camera_approach_s16_symmetric(s16 current, s16 target, s16 increment) { return current; } -s32 set_or_approach_s16_symmetric(s16 *current, s16 target, s16 increment) { +s32 set_or_approach_s16_symmetric(s16* current, s16 target, s16 increment) { if (sStatusFlags & CAM_FLAG_SMOOTH_MOVEMENT) { camera_approach_s16_symmetric_bool(current, target, increment); } else { @@ -4178,7 +4171,7 @@ s32 set_or_approach_s16_symmetric(s16 *current, s16 target, s16 increment) { * Appears to be a strange way of implementing approach_f32_symmetric from object_helpers.c. * It could possibly be an older version of the function */ -s32 camera_approach_f32_symmetric_bool(f32 *current, f32 target, f32 increment) { +s32 camera_approach_f32_symmetric_bool(f32* current, f32 target, f32 increment) { f32 dist = target - *current; if (increment < 0) { @@ -4285,7 +4278,8 @@ s16 reduce_by_dist_from_camera(s16 value, f32 maxDist, f32 posX, f32 posY, f32 p if (dist < maxDist) { calculate_angles(gLakituState.goalPos, gLakituState.goalFocus, &goalPitch, &goalYaw); //! Must be same line to match on -O2 - pitch -= goalPitch; yaw -= goalYaw; + pitch -= goalPitch; + yaw -= goalYaw; dist -= 2000.f; if (dist < 0.f) { dist = 0.f; @@ -4295,8 +4289,7 @@ s16 reduce_by_dist_from_camera(s16 value, f32 maxDist, f32 posX, f32 posY, f32 p maxDist = 2000.f; } result = value * (1.f - dist / maxDist); - if (pitch < -0x1800 || pitch > 0x400 || - yaw < -0x1800 || yaw > 0x1800) { + if (pitch < -0x1800 || pitch > 0x400 || yaw < -0x1800 || yaw > 0x1800) { result /= 2; } } @@ -4360,7 +4353,7 @@ s32 calc_avoid_yaw(s16 yawFromMario, s16 wallYaw) { * @param yMax absolute-value max size in y, set to -1 to ignore * @param zMax absolute-value max size in z, set to -1 to ignore */ -s32 is_surf_within_bounding_box(struct Surface *surf, f32 xMax, f32 yMax, f32 zMax) { +s32 is_surf_within_bounding_box(struct Surface* surf, f32 xMax, f32 yMax, f32 zMax) { // Surface vertex coordinates Vec3s sx; Vec3s sy; @@ -4425,7 +4418,7 @@ s32 is_surf_within_bounding_box(struct Surface *surf, f32 xMax, f32 yMax, f32 zM * * Because the function only uses `surf`s first vertex, some surfaces can shadow others. */ -s32 is_behind_surface(Vec3f pos, struct Surface *surf) { +s32 is_behind_surface(Vec3f pos, struct Surface* surf) { s32 behindSurface = 0; // Surface normal f32 normX = (surf->vertex2[1] - surf->vertex1[1]) * (surf->vertex3[2] - surf->vertex2[2]) - @@ -4447,7 +4440,7 @@ s32 is_behind_surface(Vec3f pos, struct Surface *surf) { /** * Checks if the whole circular sector is behind the surface. */ -s32 is_range_behind_surface(Vec3f from, Vec3f to, struct Surface *surf, s16 range, s16 surfType) { +s32 is_range_behind_surface(Vec3f from, Vec3f to, struct Surface* surf, s16 range, s16 surfType) { s32 behindSurface = TRUE; s32 leftBehind = 0; s32 rightBehind = 0; @@ -4474,7 +4467,7 @@ s32 is_range_behind_surface(Vec3f from, Vec3f to, struct Surface *surf, s16 rang return behindSurface; } -s32 is_mario_behind_surface(UNUSED struct Camera *c, struct Surface *surf) { +s32 is_mario_behind_surface(UNUSED struct Camera* c, struct Surface* surf) { s32 behindSurface = is_behind_surface(sMarioCamState->pos, surf); return behindSurface; @@ -4506,9 +4499,8 @@ s32 is_pos_in_bounds(Vec3f pos, Vec3f center, Vec3f bounds, s16 boundsYaw) { rotate_in_xz(rel, rel, boundsYaw); - if (-bounds[0] < rel[0] && rel[0] < bounds[0] && - -bounds[1] < rel[1] && rel[1] < bounds[1] && - -bounds[2] < rel[2] && rel[2] < bounds[2]) { + if (-bounds[0] < rel[0] && rel[0] < bounds[0] && -bounds[1] < rel[1] && rel[1] < bounds[1] && -bounds[2] < rel[2] && + rel[2] < bounds[2]) { inBound = TRUE; } return inBound; @@ -4535,7 +4527,7 @@ s16 calculate_yaw(Vec3f from, Vec3f to) { /** * Calculates the pitch and yaw between two vectors. */ -void calculate_angles(Vec3f from, Vec3f to, s16 *pitch, s16 *yaw) { +void calculate_angles(Vec3f from, Vec3f to, s16* pitch, s16* yaw) { f32 dx = to[0] - from[0]; f32 dy = to[1] - from[1]; f32 dz = to[2] - from[2]; @@ -4590,8 +4582,8 @@ void rotate_in_yz(Vec3f dst, Vec3f src, s16 pitch) { vec3f_copy(tempVec, src); dst[2] = -(tempVec[2] * coss(pitch) - tempVec[1] * sins(pitch)); - dst[1] = tempVec[2] * sins(pitch) + tempVec[1] * coss(pitch); - dst[0] = tempVec[0]; + dst[1] = tempVec[2] * sins(pitch) + tempVec[1] * coss(pitch); + dst[0] = tempVec[0]; } /** @@ -4668,7 +4660,7 @@ void set_yaw_shake_from_point(s16 mag, s16 decay, s16 inc, f32 maxDist, f32 posX /** * Update the shake offset by `increment` */ -void increment_shake_offset(s16 *offset, s16 increment) { +void increment_shake_offset(s16* offset, s16 increment) { if (increment == -0x8000) { *offset = (*offset & 0x8000) + 0xC000; } else { @@ -4689,8 +4681,7 @@ void shake_camera_pitch(Vec3f pos, Vec3f focus) { pitch += gLakituState.shakeMagnitude[0] * sins(gLakituState.shakePitchPhase); vec3f_set_dist_and_angle(pos, focus, dist, pitch, yaw); increment_shake_offset(&gLakituState.shakePitchPhase, gLakituState.shakePitchVel); - if (camera_approach_s16_symmetric_bool(&gLakituState.shakeMagnitude[0], 0, - gLakituState.shakePitchDecay) == 0) { + if (camera_approach_s16_symmetric_bool(&gLakituState.shakeMagnitude[0], 0, gLakituState.shakePitchDecay) == 0) { gLakituState.shakePitchPhase = 0; } } @@ -4709,8 +4700,7 @@ void shake_camera_yaw(Vec3f pos, Vec3f focus) { yaw += gLakituState.shakeMagnitude[1] * sins(gLakituState.shakeYawPhase); vec3f_set_dist_and_angle(pos, focus, dist, pitch, yaw); increment_shake_offset(&gLakituState.shakeYawPhase, gLakituState.shakeYawVel); - if (camera_approach_s16_symmetric_bool(&gLakituState.shakeMagnitude[1], 0, - gLakituState.shakeYawDecay) == 0) { + if (camera_approach_s16_symmetric_bool(&gLakituState.shakeMagnitude[1], 0, gLakituState.shakeYawDecay) == 0) { gLakituState.shakeYawPhase = 0; } } @@ -4719,14 +4709,13 @@ void shake_camera_yaw(Vec3f pos, Vec3f focus) { /** * Apply a rotational shake to the camera by adjusting its roll */ -void shake_camera_roll(s16 *roll) { +void shake_camera_roll(s16* roll) { UNUSED u8 filler[8]; if (gLakituState.shakeMagnitude[2] != 0) { increment_shake_offset(&gLakituState.shakeRollPhase, gLakituState.shakeRollVel); *roll += gLakituState.shakeMagnitude[2] * sins(gLakituState.shakeRollPhase); - if (camera_approach_s16_symmetric_bool(&gLakituState.shakeMagnitude[2], 0, - gLakituState.shakeRollDecay) == 0) { + if (camera_approach_s16_symmetric_bool(&gLakituState.shakeMagnitude[2], 0, gLakituState.shakeRollDecay) == 0) { gLakituState.shakeRollPhase = 0; } } @@ -4736,7 +4725,7 @@ void shake_camera_roll(s16 *roll) { * Add an offset to the camera's yaw, used in levels that are inside a rectangular building, like the * pyramid or TTC. */ -s32 offset_yaw_outward_radial(struct Camera *c, s16 areaYaw) { +s32 offset_yaw_outward_radial(struct Camera* c, s16 areaYaw) { s16 yawGoal = DEGREES(60); s16 yaw = sModeOffsetYaw; f32 distFromAreaCenter; @@ -4814,8 +4803,7 @@ void play_camera_buzz_if_cbutton(void) { } void play_camera_buzz_if_c_sideways(void) { - if ((gPlayer1Controller->buttonPressed & L_CBUTTONS) - || (gPlayer1Controller->buttonPressed & R_CBUTTONS)) { + if ((gPlayer1Controller->buttonPressed & L_CBUTTONS) || (gPlayer1Controller->buttonPressed & R_CBUTTONS)) { play_sound_button_change_blocked(); } } @@ -4853,7 +4841,7 @@ void play_sound_if_cam_switched_to_lakitu_or_mario(void) { /** * Handles input for radial, outwards radial, parallel tracking, and 8 direction mode. */ -s32 radial_camera_input(struct Camera *c, UNUSED f32 unused) { +s32 radial_camera_input(struct Camera* c, UNUSED f32 unused) { s16 dummy = 0; if ((gCameraMovementFlags & CAM_MOVE_ENTERED_ROTATE_SURFACE) || !(gCameraMovementFlags & CAM_MOVE_ROTATE)) { @@ -4943,7 +4931,7 @@ s32 radial_camera_input(struct Camera *c, UNUSED f32 unused) { if (gPlayer1Controller->buttonPressed & D_CBUTTONS) { if (gCameraMovementFlags & CAM_MOVE_ZOOMED_OUT) { gCameraMovementFlags |= CAM_MOVE_ALREADY_ZOOMED_OUT; - if(!ROM_JP) { + if (!ROM_JP) { play_camera_buzz_if_cdown(); } } else { @@ -4961,20 +4949,19 @@ s32 radial_camera_input(struct Camera *c, UNUSED f32 unused) { */ s32 trigger_cutscene_dialog(s32 trigger) { s32 result = 0; - UNUSED struct Camera *c = gCamera; + UNUSED struct Camera* c = gCamera; if (trigger == 1) { start_object_cutscene_without_focus(CUTSCENE_READ_MESSAGE); } - if (trigger == 2) { - } + if (trigger == 2) {} return result; } /** * Updates the camera based on which C buttons are pressed this frame */ -void handle_c_button_movement(struct Camera *c) { +void handle_c_button_movement(struct Camera* c) { s16 cSideYaw; // Zoom in @@ -4997,7 +4984,7 @@ void handle_c_button_movement(struct Camera *c) { if (gCameraMovementFlags & CAM_MOVE_ZOOMED_OUT) { gCameraMovementFlags |= CAM_MOVE_ALREADY_ZOOMED_OUT; sZoomAmount = gCameraZoomDist + 400.f; - if(!ROM_JP) { + if (!ROM_JP) { play_camera_buzz_if_cdown(); } } else { @@ -5037,7 +5024,7 @@ void handle_c_button_movement(struct Camera *c) { /** * Zero the 10 cvars. */ -void clear_cutscene_vars(UNUSED struct Camera *c) { +void clear_cutscene_vars(UNUSED struct Camera* c) { s32 i; for (i = 0; i < 10; i++) { @@ -5052,7 +5039,7 @@ void clear_cutscene_vars(UNUSED struct Camera *c) { /** * Start the cutscene, `cutscene`, if it is not already playing. */ -void start_cutscene(struct Camera *c, u8 cutscene) { +void start_cutscene(struct Camera* c, u8 cutscene) { if (c->cutscene != cutscene) { c->cutscene = cutscene; clear_cutscene_vars(c); @@ -5068,7 +5055,7 @@ void start_cutscene(struct Camera *c, u8 cutscene) { * * @return the victory cutscene to use */ -s32 determine_dance_cutscene(UNUSED struct Camera *c) { +s32 determine_dance_cutscene(UNUSED struct Camera* c) { u8 cutscene = 0; u8 cutsceneIndex = 0; u8 starIndex = (gLastCompletedStarNum - 1) / 2; @@ -5114,7 +5101,7 @@ u8 open_door_cutscene(u8 pullResult, u8 pushResult) { * * @return the cutscene that should start, 0 if none */ -u8 get_cutscene_from_mario_status(struct Camera *c) { +u8 get_cutscene_from_mario_status(struct Camera* c) { UNUSED u8 filler1[4]; u8 cutscene = c->cutscene; UNUSED u8 filler2[12]; @@ -5129,8 +5116,8 @@ u8 get_cutscene_from_mario_status(struct Camera *c) { //! doorStatus is never DOOR_ENTER_LOBBY when cameraEvent == 6, because //! doorStatus is only used for the star door in the lobby, which uses //! ACT_ENTERING_STAR_DOOR - if (c->mode == CAMERA_MODE_SPIRAL_STAIRS || c->mode == CAMERA_MODE_CLOSE - || c->doorStatus == DOOR_ENTER_LOBBY) { + if (c->mode == CAMERA_MODE_SPIRAL_STAIRS || c->mode == CAMERA_MODE_CLOSE || + c->doorStatus == DOOR_ENTER_LOBBY) { cutscene = open_door_cutscene(CUTSCENE_DOOR_PULL_MODE, CUTSCENE_DOOR_PUSH_MODE); } else { cutscene = open_door_cutscene(CUTSCENE_DOOR_PULL, CUTSCENE_DOOR_PUSH); @@ -5166,16 +5153,14 @@ u8 get_cutscene_from_mario_status(struct Camera *c) { cutscene = CUTSCENE_EXIT_PAINTING_SUCC; break; case ACT_SPECIAL_EXIT_AIRBORNE: - if (gPrevLevel == LEVEL_BOWSER_1 || gPrevLevel == LEVEL_BOWSER_2 - || gPrevLevel == LEVEL_BOWSER_3) { + if (gPrevLevel == LEVEL_BOWSER_1 || gPrevLevel == LEVEL_BOWSER_2 || gPrevLevel == LEVEL_BOWSER_3) { cutscene = CUTSCENE_EXIT_BOWSER_SUCC; } else { cutscene = CUTSCENE_EXIT_SPECIAL_SUCC; } break; case ACT_SPECIAL_DEATH_EXIT: - if (gPrevLevel == LEVEL_BOWSER_1 || gPrevLevel == LEVEL_BOWSER_2 - || gPrevLevel == LEVEL_BOWSER_3) { + if (gPrevLevel == LEVEL_BOWSER_1 || gPrevLevel == LEVEL_BOWSER_2 || gPrevLevel == LEVEL_BOWSER_3) { cutscene = CUTSCENE_EXIT_BOWSER_DEATH; } else { cutscene = CUTSCENE_NONPAINTING_DEATH; @@ -5251,9 +5236,9 @@ u8 get_cutscene_from_mario_status(struct Camera *c) { */ void warp_camera(f32 displacementX, f32 displacementY, f32 displacementZ) { Vec3f displacement; - struct MarioState *marioStates = &gMarioStates[0]; - struct LinearTransitionPoint *start = &sModeInfo.transitionStart; - struct LinearTransitionPoint *end = &sModeInfo.transitionEnd; + struct MarioState* marioStates = &gMarioStates[0]; + struct LinearTransitionPoint* start = &sModeInfo.transitionStart; + struct LinearTransitionPoint* end = &sModeInfo.transitionEnd; gCurrLevelArea = gCurrLevelNum * 16 + gCurrentArea->index; displacement[0] = displacementX; @@ -5275,7 +5260,7 @@ void warp_camera(f32 displacementX, f32 displacementY, f32 displacementZ) { * Make the camera's y coordinate approach `goal`, * unless smooth movement is off, in which case the y coordinate is simply set to `goal` */ -void approach_camera_height(struct Camera *c, f32 goal, f32 inc) { +void approach_camera_height(struct Camera* c, f32 goal, f32 inc) { if (sStatusFlags & CAM_FLAG_SMOOTH_MOVEMENT) { if (c->pos[1] < goal) { if ((c->pos[1] += inc) > goal) { @@ -5302,7 +5287,7 @@ void stub_camera_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c, UNUSED s32 d) { * @param forwBack offset to Mario's front/back, relative to his faceAngle * @param yawOff offset to Mario's faceAngle, changes the direction of `leftRight` and `forwBack` */ -void set_focus_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) { +void set_focus_rel_mario(struct Camera* c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) { s16 yaw; UNUSED u16 unused; f32 focFloorYOff; @@ -5322,7 +5307,7 @@ void set_focus_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack * @param forwBack offset to Mario's front/back, relative to his faceAngle * @param yawOff offset to Mario's faceAngle, changes the direction of `leftRight` and `forwBack` */ -UNUSED static void unused_set_pos_rel_mario(struct Camera *c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) { +UNUSED static void unused_set_pos_rel_mario(struct Camera* c, f32 leftRight, f32 yOff, f32 forwBack, s16 yawOff) { u16 yaw = sMarioCamState->faceAngle[1] + yawOff; c->pos[0] = sMarioCamState->pos[0] + forwBack * sins(yaw) + leftRight * coss(yaw); @@ -5345,8 +5330,8 @@ void offset_rotated(Vec3f dst, Vec3f from, Vec3f to, Vec3s rotation) { // First rotate the direction by rotation's pitch //! The Z axis is flipped here. pitchRotated[2] = -(to[2] * coss(rotation[0]) - to[1] * sins(rotation[0])); - pitchRotated[1] = to[2] * sins(rotation[0]) + to[1] * coss(rotation[0]); - pitchRotated[0] = to[0]; + pitchRotated[1] = to[2] * sins(rotation[0]) + to[1] * coss(rotation[0]); + pitchRotated[0] = to[0]; // Rotate again by rotation's yaw dst[0] = from[0] + pitchRotated[2] * sins(rotation[1]) + pitchRotated[0] * coss(rotation[1]); @@ -5367,7 +5352,7 @@ void offset_rotated_coords(Vec3f dst, Vec3f from, Vec3s rotation, f32 xTo, f32 y offset_rotated(dst, from, to, rotation); } -void determine_pushing_or_pulling_door(s16 *rotation) { +void determine_pushing_or_pulling_door(s16* rotation) { if (sMarioCamState->action == ACT_PULLING_DOOR) { *rotation = 0; } else { @@ -5390,8 +5375,7 @@ void determine_pushing_or_pulling_door(s16 *rotation) { * * @return Lakitu's next yaw, which is the same as the yaw passed in if no transition happened */ -s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, - Vec3f oldPos, Vec3f oldFoc, s16 yaw) { +s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, Vec3f oldPos, Vec3f oldFoc, s16 yaw) { s16 yawVelocity; s16 pitchVelocity; f32 distVelocity; @@ -5409,7 +5393,7 @@ s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, Vec3f startFoc; s32 i; f32 floorHeight; - struct Surface *floor; + struct Surface* floor; // If not transitioning, just use gCamera's current pos and foc vec3f_copy(newPos, curPos); @@ -5423,7 +5407,6 @@ s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, startFoc[i] = oldFoc[i] + sMarioCamState->pos[i] - sModeTransition.marioPos[i]; } - vec3f_get_dist_and_angle(curFoc, startFoc, &sModeTransition.focDist, &sModeTransition.focPitch, &sModeTransition.focYaw); vec3f_get_dist_and_angle(curFoc, startPos, &sModeTransition.posDist, &sModeTransition.posPitch, @@ -5447,8 +5430,8 @@ s16 next_lakitu_state(Vec3f newPos, Vec3f newFoc, Vec3f curPos, Vec3f curFoc, sModeTransition.posYaw); vec3f_get_dist_and_angle(curPos, curFoc, &goalDist, &goalPitch, &goalYaw); - pitchVelocity = sModeTransition.focPitch / (s16) sModeTransition.framesLeft; - yawVelocity = sModeTransition.focYaw / (s16) sModeTransition.framesLeft; + pitchVelocity = sModeTransition.focPitch / (s16)sModeTransition.framesLeft; + yawVelocity = sModeTransition.focYaw / (s16)sModeTransition.framesLeft; distVelocity = sModeTransition.focDist / sModeTransition.framesLeft; camera_approach_s16_symmetric_bool(&sModeTransition.focPitch, goalPitch, pitchVelocity); @@ -5491,14 +5474,13 @@ static UNUSED void stop_transitional_movement(void) { * * @return TRUE if the base pos was updated */ -s32 set_camera_mode_fixed(struct Camera *c, s16 x, s16 y, s16 z) { +s32 set_camera_mode_fixed(struct Camera* c, s16 x, s16 y, s16 z) { s32 basePosSet = FALSE; f32 posX = x; f32 posY = y; f32 posZ = z; - if (sFixedModeBasePosition[0] != posX || sFixedModeBasePosition[1] != posY - || sFixedModeBasePosition[2] != posZ) { + if (sFixedModeBasePosition[0] != posX || sFixedModeBasePosition[1] != posY || sFixedModeBasePosition[2] != posZ) { basePosSet = TRUE; sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; } @@ -5506,13 +5488,12 @@ s32 set_camera_mode_fixed(struct Camera *c, s16 x, s16 y, s16 z) { if (c->mode != CAMERA_MODE_FIXED) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; c->mode = CAMERA_MODE_FIXED; - vec3f_set(c->pos, sFixedModeBasePosition[0], sMarioCamState->pos[1], - sFixedModeBasePosition[2]); + vec3f_set(c->pos, sFixedModeBasePosition[0], sMarioCamState->pos[1], sFixedModeBasePosition[2]); } return basePosSet; } -void set_camera_mode_8_directions(struct Camera *c) { +void set_camera_mode_8_directions(struct Camera* c) { if (c->mode != CAMERA_MODE_8_DIRECTIONS) { c->mode = CAMERA_MODE_8_DIRECTIONS; sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; @@ -5525,14 +5506,14 @@ void set_camera_mode_8_directions(struct Camera *c) { * If the camera mode is not already the boss fight camera (camera with two foci) * set it to be so. */ -void set_camera_mode_boss_fight(struct Camera *c) { +void set_camera_mode_boss_fight(struct Camera* c) { if (c->mode != CAMERA_MODE_BOSS_FIGHT) { transition_to_camera_mode(c, CAMERA_MODE_BOSS_FIGHT, 15); sModeOffsetYaw = c->nextYaw - DEGREES(45); } } -void set_camera_mode_close_cam(u8 *mode) { +void set_camera_mode_close_cam(u8* mode) { if (*mode != CAMERA_MODE_CLOSE) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; *mode = CAMERA_MODE_CLOSE; @@ -5544,7 +5525,7 @@ void set_camera_mode_close_cam(u8 *mode) { * If the difference in yaw between pos -> Mario and pos > focus is < 90 degrees, transition. * Otherwise jump to radial mode. */ -void set_camera_mode_radial(struct Camera *c, s16 transitionTime) { +void set_camera_mode_radial(struct Camera* c, s16 transitionTime) { Vec3f focus; s16 yaw; @@ -5566,7 +5547,7 @@ void set_camera_mode_radial(struct Camera *c, s16 transitionTime) { /** * Start parallel tracking mode using the path `path` */ -void parallel_tracking_init(struct Camera *c, struct ParallelTrackingPoint *path) { +void parallel_tracking_init(struct Camera* c, struct ParallelTrackingPoint* path) { if (c->mode != CAMERA_MODE_PARALLEL_TRACKING) { sParTrackPath = path; sParTrackIndex = 0; @@ -5606,9 +5587,9 @@ void set_fixed_cam_axis_sa_lobby(UNUSED s16 preset) { * Only block area mode changes if Mario is in a cannon, * or if the camera is in Mario mode and Mario is not swimming or in water with the metal cap */ -void check_blocking_area_processing(const u8 *mode) { - if (sMarioCamState->action & ACT_FLAG_METAL_WATER || - *mode == CAMERA_MODE_BEHIND_MARIO || *mode == CAMERA_MODE_WATER_SURFACE) { +void check_blocking_area_processing(const u8* mode) { + if (sMarioCamState->action & ACT_FLAG_METAL_WATER || *mode == CAMERA_MODE_BEHIND_MARIO || + *mode == CAMERA_MODE_WATER_SURFACE) { sStatusFlags |= CAM_FLAG_BLOCK_AREA_PROCESSING; } @@ -5616,19 +5597,18 @@ void check_blocking_area_processing(const u8 *mode) { sStatusFlags &= ~CAM_FLAG_BLOCK_AREA_PROCESSING; } - if ((*mode == CAMERA_MODE_BEHIND_MARIO && - !(sMarioCamState->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER))) || - *mode == CAMERA_MODE_INSIDE_CANNON) { + if ((*mode == CAMERA_MODE_BEHIND_MARIO && !(sMarioCamState->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER))) || + *mode == CAMERA_MODE_INSIDE_CANNON) { sStatusFlags |= CAM_FLAG_BLOCK_AREA_PROCESSING; } } -BAD_RETURN(s32) cam_rr_exit_building_side(struct Camera *c) { +BAD_RETURN(s32) cam_rr_exit_building_side(struct Camera* c) { set_camera_mode_8_directions(c); s8DirModeBaseYaw = DEGREES(90); } -BAD_RETURN(s32) cam_rr_exit_building_top(struct Camera *c) { +BAD_RETURN(s32) cam_rr_exit_building_top(struct Camera* c) { set_camera_mode_8_directions(c); if (c->pos[1] < 6343.f) { c->pos[1] = 7543.f; @@ -5638,13 +5618,13 @@ BAD_RETURN(s32) cam_rr_exit_building_top(struct Camera *c) { } } -BAD_RETURN(s32) cam_rr_enter_building_window(struct Camera *c) { +BAD_RETURN(s32) cam_rr_enter_building_window(struct Camera* c) { if (c->mode != CAMERA_MODE_FIXED) { set_camera_mode_fixed(c, -2974, 478, -3975); } } -BAD_RETURN(s32) cam_rr_enter_building(struct Camera *c) { +BAD_RETURN(s32) cam_rr_enter_building(struct Camera* c) { if (c->mode != CAMERA_MODE_FIXED) { set_camera_mode_fixed(c, -2953, 798, -3943); } @@ -5654,7 +5634,7 @@ BAD_RETURN(s32) cam_rr_enter_building(struct Camera *c) { } } -BAD_RETURN(s32) cam_rr_enter_building_side(struct Camera *c) { +BAD_RETURN(s32) cam_rr_enter_building_side(struct Camera* c) { if (c->mode != CAMERA_MODE_FIXED) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; c->mode = CAMERA_MODE_FIXED; @@ -5664,7 +5644,7 @@ BAD_RETURN(s32) cam_rr_enter_building_side(struct Camera *c) { /** * Fix the camera in place as Mario gets exits out the MC cave into the waterfall. */ -BAD_RETURN(s32) cam_cotmc_exit_waterfall(UNUSED struct Camera *c) { +BAD_RETURN(s32) cam_cotmc_exit_waterfall(UNUSED struct Camera* c) { gCameraMovementFlags |= CAM_MOVE_FIX_IN_PLACE; } @@ -5672,7 +5652,7 @@ BAD_RETURN(s32) cam_cotmc_exit_waterfall(UNUSED struct Camera *c) { * Sets 8 directional mode and blocks the next trigger from processing. * Activated when Mario is walking in front of the snowman's head. */ -BAD_RETURN(s32) cam_sl_snowman_head_8dir(struct Camera *c) { +BAD_RETURN(s32) cam_sl_snowman_head_8dir(struct Camera* c) { sStatusFlags |= CAM_FLAG_BLOCK_AREA_PROCESSING; transition_to_camera_mode(c, CAMERA_MODE_8_DIRECTIONS, 60); s8DirModeBaseYaw = 0x1D27; @@ -5682,25 +5662,25 @@ BAD_RETURN(s32) cam_sl_snowman_head_8dir(struct Camera *c) { * Sets free roam mode in SL, called by a trigger that covers a large area and surrounds the 8 direction * trigger. */ -BAD_RETURN(s32) cam_sl_free_roam(struct Camera *c) { +BAD_RETURN(s32) cam_sl_free_roam(struct Camera* c) { transition_to_camera_mode(c, CAMERA_MODE_FREE_ROAM, 60); } /** * Warps the camera underneath the floor, used in HMC to move under the elevator platforms */ -void move_camera_through_floor_while_descending(struct Camera *c, f32 height) { +void move_camera_through_floor_while_descending(struct Camera* c, f32 height) { UNUSED u8 filler[4]; - if ((sMarioGeometry.currFloorHeight < height - 100.f) - && (sMarioGeometry.prevFloorHeight > sMarioGeometry.currFloorHeight)) { + if ((sMarioGeometry.currFloorHeight < height - 100.f) && + (sMarioGeometry.prevFloorHeight > sMarioGeometry.currFloorHeight)) { c->pos[1] = height - 400.f; gLakituState.curPos[1] = height - 400.f; gLakituState.goalPos[1] = height - 400.f; } } -BAD_RETURN(s32) cam_hmc_enter_maze(struct Camera *c) { +BAD_RETURN(s32) cam_hmc_enter_maze(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -5708,7 +5688,7 @@ BAD_RETURN(s32) cam_hmc_enter_maze(struct Camera *c) { vec3f_get_dist_and_angle(c->focus, gLakituState.goalPos, &dist, &pitch, &yaw); vec3f_set_dist_and_angle(c->focus, gLakituState.goalPos, 300.f, pitch, yaw); gLakituState.goalPos[1] = -800.f; - if(!ROM_JP) { + if (!ROM_JP) { c->pos[1] = gLakituState.goalPos[1]; gLakituState.curPos[1] = gLakituState.goalPos[1]; } @@ -5716,26 +5696,26 @@ BAD_RETURN(s32) cam_hmc_enter_maze(struct Camera *c) { } } -BAD_RETURN(s32) cam_hmc_elevator_black_hole(struct Camera *c) { +BAD_RETURN(s32) cam_hmc_elevator_black_hole(struct Camera* c) { move_camera_through_floor_while_descending(c, 1536.f); } -BAD_RETURN(s32) cam_hmc_elevator_maze_emergency_exit(struct Camera *c) { +BAD_RETURN(s32) cam_hmc_elevator_maze_emergency_exit(struct Camera* c) { move_camera_through_floor_while_descending(c, 2355.f); } -BAD_RETURN(s32) cam_hmc_elevator_lake(struct Camera *c) { +BAD_RETURN(s32) cam_hmc_elevator_lake(struct Camera* c) { move_camera_through_floor_while_descending(c, 1843.f); } -BAD_RETURN(s32) cam_hmc_elevator_maze(struct Camera *c) { +BAD_RETURN(s32) cam_hmc_elevator_maze(struct Camera* c) { move_camera_through_floor_while_descending(c, 1843.f); } /** * Starts the "Enter Pyramid Top" cutscene. */ -BAD_RETURN(s32) cam_ssl_enter_pyramid_top(UNUSED struct Camera *c) { +BAD_RETURN(s32) cam_ssl_enter_pyramid_top(UNUSED struct Camera* c) { start_object_cutscene_without_focus(CUTSCENE_ENTER_PYRAMID_TOP); } @@ -5743,7 +5723,7 @@ BAD_RETURN(s32) cam_ssl_enter_pyramid_top(UNUSED struct Camera *c) { * Change to close mode in the center of the pyramid. Outside this trigger, the default mode is outwards * radial. */ -BAD_RETURN(s32) cam_ssl_pyramid_center(struct Camera *c) { +BAD_RETURN(s32) cam_ssl_pyramid_center(struct Camera* c) { sStatusFlags |= CAM_FLAG_BLOCK_AREA_PROCESSING; transition_to_camera_mode(c, CAMERA_MODE_CLOSE, 90); } @@ -5751,7 +5731,7 @@ BAD_RETURN(s32) cam_ssl_pyramid_center(struct Camera *c) { /** * Changes the mode back to outward radial in the boss room inside the pyramid. */ -BAD_RETURN(s32) cam_ssl_boss_room(struct Camera *c) { +BAD_RETURN(s32) cam_ssl_boss_room(struct Camera* c) { sStatusFlags |= CAM_FLAG_BLOCK_AREA_PROCESSING; transition_to_camera_mode(c, CAMERA_MODE_OUTWARD_RADIAL, 90); } @@ -5759,7 +5739,7 @@ BAD_RETURN(s32) cam_ssl_boss_room(struct Camera *c) { /** * Moves the camera to through the tunnel by forcing sModeOffsetYaw */ -BAD_RETURN(s32) cam_thi_move_cam_through_tunnel(UNUSED struct Camera *c) { +BAD_RETURN(s32) cam_thi_move_cam_through_tunnel(UNUSED struct Camera* c) { if (sModeOffsetYaw < DEGREES(60)) { sModeOffsetYaw = DEGREES(60); } @@ -5768,7 +5748,7 @@ BAD_RETURN(s32) cam_thi_move_cam_through_tunnel(UNUSED struct Camera *c) { /** * Aligns the camera to look through the tunnel */ -BAD_RETURN(s32) cam_thi_look_through_tunnel(UNUSED struct Camera *c) { +BAD_RETURN(s32) cam_thi_look_through_tunnel(UNUSED struct Camera* c) { // ~82.5 degrees if (sModeOffsetYaw > 0x3AAA) { sModeOffsetYaw = 0x3AAA; @@ -5780,7 +5760,7 @@ BAD_RETURN(s32) cam_thi_look_through_tunnel(UNUSED struct Camera *c) { * * @see sCamBOB for bounds. */ -BAD_RETURN(s32) cam_bob_tower(struct Camera *c) { +BAD_RETURN(s32) cam_bob_tower(struct Camera* c) { sStatusFlags |= CAM_FLAG_BLOCK_AREA_PROCESSING; transition_to_camera_mode(c, CAMERA_MODE_RADIAL, 90); } @@ -5793,7 +5773,7 @@ BAD_RETURN(s32) cam_bob_tower(struct Camera *c) { * * @see sCamBOB */ -BAD_RETURN(s32) cam_bob_default_free_roam(struct Camera *c) { +BAD_RETURN(s32) cam_bob_default_free_roam(struct Camera* c) { transition_to_camera_mode(c, CAMERA_MODE_FREE_ROAM, 90); } @@ -5801,9 +5781,8 @@ BAD_RETURN(s32) cam_bob_default_free_roam(struct Camera *c) { * Starts the pool entrance cutscene if Mario is not exiting the pool. * Used in both the castle and HMC. */ -BAD_RETURN(s32) cam_castle_hmc_start_pool_cutscene(struct Camera *c) { - if ((sMarioCamState->action != ACT_SPECIAL_DEATH_EXIT) - && (sMarioCamState->action != ACT_SPECIAL_EXIT_AIRBORNE)) { +BAD_RETURN(s32) cam_castle_hmc_start_pool_cutscene(struct Camera* c) { + if ((sMarioCamState->action != ACT_SPECIAL_DEATH_EXIT) && (sMarioCamState->action != ACT_SPECIAL_EXIT_AIRBORNE)) { start_cutscene(c, CUTSCENE_ENTER_POOL); } } @@ -5812,21 +5791,20 @@ BAD_RETURN(s32) cam_castle_hmc_start_pool_cutscene(struct Camera *c) { * Sets the fixed mode pos offset so that the camera faces the doorway when Mario is near the entrance * to the castle lobby */ -BAD_RETURN(s32) cam_castle_lobby_entrance(UNUSED struct Camera *c) { - vec3f_set(sCastleEntranceOffset, -813.f - sFixedModeBasePosition[0], - 378.f - sFixedModeBasePosition[1], 1103.f - sFixedModeBasePosition[2]); +BAD_RETURN(s32) cam_castle_lobby_entrance(UNUSED struct Camera* c) { + vec3f_set(sCastleEntranceOffset, -813.f - sFixedModeBasePosition[0], 378.f - sFixedModeBasePosition[1], + 1103.f - sFixedModeBasePosition[2]); } /** * Make the camera look up the stairs from the 2nd to 3rd floor of the castle */ -BAD_RETURN(s32) cam_castle_look_upstairs(struct Camera *c) { - struct Surface *floor; +BAD_RETURN(s32) cam_castle_look_upstairs(struct Camera* c) { + struct Surface* floor; f32 floorHeight = find_floor(c->pos[0], c->pos[1], c->pos[2], &floor); // If Mario is on the first few steps, fix the camera pos, making it look up - if ((sMarioGeometry.currFloorHeight > 1229.f) && (floorHeight < 1229.f) - && (sCSideButtonYaw == 0)) { + if ((sMarioGeometry.currFloorHeight > 1229.f) && (floorHeight < 1229.f) && (sCSideButtonYaw == 0)) { vec3f_set(c->pos, -227.f, 1425.f, 1533.f); } } @@ -5834,8 +5812,8 @@ BAD_RETURN(s32) cam_castle_look_upstairs(struct Camera *c) { /** * Make the camera look down the stairs towards the basement star door */ -BAD_RETURN(s32) cam_castle_basement_look_downstairs(struct Camera *c) { - struct Surface *floor; +BAD_RETURN(s32) cam_castle_basement_look_downstairs(struct Camera* c) { + struct Surface* floor; f32 floorHeight = find_floor(c->pos[0], c->pos[1], c->pos[2], &floor); // Fix the camera pos, making it look downwards. Only active on the top few steps @@ -5848,7 +5826,7 @@ BAD_RETURN(s32) cam_castle_basement_look_downstairs(struct Camera *c) { * Enter the fixed-mode castle lobby. A trigger for this is placed in every entrance so that the camera * changes to fixed mode. */ -BAD_RETURN(s32) cam_castle_enter_lobby(struct Camera *c) { +BAD_RETURN(s32) cam_castle_enter_lobby(struct Camera* c) { if (c->mode != CAMERA_MODE_FIXED) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; set_fixed_cam_axis_sa_lobby(c->mode); @@ -5859,7 +5837,7 @@ BAD_RETURN(s32) cam_castle_enter_lobby(struct Camera *c) { /** * Starts spiral stairs mode. */ -BAD_RETURN(s32) cam_castle_enter_spiral_stairs(struct Camera *c) { +BAD_RETURN(s32) cam_castle_enter_spiral_stairs(struct Camera* c) { transition_to_camera_mode(c, CAMERA_MODE_SPIRAL_STAIRS, 20); } @@ -5867,7 +5845,7 @@ BAD_RETURN(s32) cam_castle_enter_spiral_stairs(struct Camera *c) { * unused, starts close mode if the camera is in spiral stairs mode. * This was replaced with cam_castle_close_mode */ -static UNUSED BAD_RETURN(s32) cam_castle_leave_spiral_stairs(struct Camera *c) { +static UNUSED BAD_RETURN(s32) cam_castle_leave_spiral_stairs(struct Camera* c) { if (c->mode == CAMERA_MODE_SPIRAL_STAIRS) { transition_to_camera_mode(c, CAMERA_MODE_CLOSE, 30); } else { @@ -5879,7 +5857,7 @@ static UNUSED BAD_RETURN(s32) cam_castle_leave_spiral_stairs(struct Camera *c) { * The default mode when outside of the lobby and spiral staircase. A trigger for this is placed at * every door leaving the lobby and spiral staircase. */ -BAD_RETURN(s32) cam_castle_close_mode(struct Camera *c) { +BAD_RETURN(s32) cam_castle_close_mode(struct Camera* c) { set_camera_mode_close_cam(&c->mode); } @@ -5887,7 +5865,7 @@ BAD_RETURN(s32) cam_castle_close_mode(struct Camera *c) { * Functions the same as cam_castle_close_mode, but sets doorStatus so that the camera will enter * fixed-mode when Mario leaves the room. */ -BAD_RETURN(s32) cam_castle_leave_lobby_sliding_door(struct Camera *c) { +BAD_RETURN(s32) cam_castle_leave_lobby_sliding_door(struct Camera* c) { cam_castle_close_mode(c); c->doorStatus = DOOR_ENTER_LOBBY; } @@ -5895,19 +5873,19 @@ BAD_RETURN(s32) cam_castle_leave_lobby_sliding_door(struct Camera *c) { /** * Just calls cam_castle_enter_lobby */ -BAD_RETURN(s32) cam_castle_enter_lobby_sliding_door(struct Camera *c) { +BAD_RETURN(s32) cam_castle_enter_lobby_sliding_door(struct Camera* c) { cam_castle_enter_lobby(c); } -BAD_RETURN(s32) cam_bbh_room_6(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_6(struct Camera* c) { parallel_tracking_init(c, sBBHLibraryParTrackPath); } -BAD_RETURN(s32) cam_bbh_fall_off_roof(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_fall_off_roof(struct Camera* c) { set_camera_mode_close_cam(&c->mode); } -BAD_RETURN(s32) cam_bbh_fall_into_pool(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_fall_into_pool(struct Camera* c) { Vec3f dir; set_camera_mode_close_cam(&c->mode); vec3f_set(dir, 0.f, 0.f, 300.f); @@ -5917,24 +5895,24 @@ BAD_RETURN(s32) cam_bbh_fall_into_pool(struct Camera *c) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; } -BAD_RETURN(s32) cam_bbh_room_1(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_1(struct Camera* c) { set_camera_mode_fixed(c, 956, 440, 1994); } -BAD_RETURN(s32) cam_bbh_leave_front_door(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_leave_front_door(struct Camera* c) { c->doorStatus = DOOR_LEAVING_SPECIAL; cam_bbh_room_1(c); } -BAD_RETURN(s32) cam_bbh_room_2_lower(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_2_lower(struct Camera* c) { set_camera_mode_fixed(c, 2591, 400, 1284); } -BAD_RETURN(s32) cam_bbh_room_4(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_4(struct Camera* c) { set_camera_mode_fixed(c, 3529, 340, -1384); } -BAD_RETURN(s32) cam_bbh_room_8(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_8(struct Camera* c) { set_camera_mode_fixed(c, -500, 740, -1306); } @@ -5942,7 +5920,7 @@ BAD_RETURN(s32) cam_bbh_room_8(struct Camera *c) { * In BBH's room 5's library (the first floor room with the vanish cap/boo painting) * set the camera mode to fixed and position to (-2172, 200, 675) */ -BAD_RETURN(s32) cam_bbh_room_5_library(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_5_library(struct Camera* c) { set_camera_mode_fixed(c, -2172, 200, 675); } @@ -5951,53 +5929,53 @@ BAD_RETURN(s32) cam_bbh_room_5_library(struct Camera *c) { * set the camera mode to to the hidden room's position * if coming from the library. */ -BAD_RETURN(s32) cam_bbh_room_5_library_to_hidden_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_5_library_to_hidden_transition(struct Camera* c) { if (set_camera_mode_fixed(c, -2172, 200, 675) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_5_hidden_to_library_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_5_hidden_to_library_transition(struct Camera* c) { if (set_camera_mode_fixed(c, -1542, 320, -307) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_5_hidden(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_5_hidden(struct Camera* c) { c->doorStatus = DOOR_LEAVING_SPECIAL; set_camera_mode_fixed(c, -1542, 320, -307); } -BAD_RETURN(s32) cam_bbh_room_3(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_3(struct Camera* c) { set_camera_mode_fixed(c, -1893, 320, 2327); } -BAD_RETURN(s32) cam_bbh_room_7_mr_i(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_7_mr_i(struct Camera* c) { set_camera_mode_fixed(c, 1371, 360, -1302); } -BAD_RETURN(s32) cam_bbh_room_7_mr_i_to_coffins_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_7_mr_i_to_coffins_transition(struct Camera* c) { if (set_camera_mode_fixed(c, 1371, 360, -1302) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_7_coffins_to_mr_i_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_7_coffins_to_mr_i_transition(struct Camera* c) { if (set_camera_mode_fixed(c, 2115, 260, -772) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_elevator_room_lower(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_elevator_room_lower(struct Camera* c) { c->doorStatus = DOOR_LEAVING_SPECIAL; set_camera_mode_close_cam(&c->mode); } -BAD_RETURN(s32) cam_bbh_room_0_back_entrance(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_0_back_entrance(struct Camera* c) { set_camera_mode_close_cam(&c->mode); } -BAD_RETURN(s32) cam_bbh_elevator(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_elevator(struct Camera* c) { if (c->mode == CAMERA_MODE_FIXED) { set_camera_mode_close_cam(&c->mode); c->pos[1] = -405.f; @@ -6005,72 +5983,72 @@ BAD_RETURN(s32) cam_bbh_elevator(struct Camera *c) { } } -BAD_RETURN(s32) cam_bbh_room_12_upper(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_12_upper(struct Camera* c) { c->doorStatus = DOOR_LEAVING_SPECIAL; set_camera_mode_fixed(c, -2932, 296, 4429); } -BAD_RETURN(s32) cam_bbh_enter_front_door(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_enter_front_door(struct Camera* c) { set_camera_mode_close_cam(&c->mode); } -BAD_RETURN(s32) cam_bbh_room_2_library(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_2_library(struct Camera* c) { set_camera_mode_fixed(c, 3493, 440, 617); } -BAD_RETURN(s32) cam_bbh_room_2_library_to_trapdoor_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_2_library_to_trapdoor_transition(struct Camera* c) { if (set_camera_mode_fixed(c, 3493, 440, 617) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_2_trapdoor(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_2_trapdoor(struct Camera* c) { set_camera_mode_fixed(c, 3502, 440, 1217); } -BAD_RETURN(s32) cam_bbh_room_2_trapdoor_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_2_trapdoor_transition(struct Camera* c) { if (set_camera_mode_fixed(c, 3502, 440, 1217) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_9_attic(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_9_attic(struct Camera* c) { set_camera_mode_fixed(c, -670, 460, 372); } -BAD_RETURN(s32) cam_bbh_room_9_attic_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_9_attic_transition(struct Camera* c) { if (set_camera_mode_fixed(c, -670, 460, 372) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_9_mr_i_transition(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_9_mr_i_transition(struct Camera* c) { if (set_camera_mode_fixed(c, 131, 380, -263) == 1) { transition_next_state(c, 20); } } -BAD_RETURN(s32) cam_bbh_room_13_balcony(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_13_balcony(struct Camera* c) { set_camera_mode_fixed(c, 210, 420, 3109); } -BAD_RETURN(s32) cam_bbh_room_0(struct Camera *c) { +BAD_RETURN(s32) cam_bbh_room_0(struct Camera* c) { c->doorStatus = DOOR_LEAVING_SPECIAL; set_camera_mode_fixed(c, -204, 807, 204); } -BAD_RETURN(s32) cam_ccm_enter_slide_shortcut(UNUSED struct Camera *c) { +BAD_RETURN(s32) cam_ccm_enter_slide_shortcut(UNUSED struct Camera* c) { sStatusFlags |= CAM_FLAG_CCM_SLIDE_SHORTCUT; } -BAD_RETURN(s32) cam_ccm_leave_slide_shortcut(UNUSED struct Camera *c) { +BAD_RETURN(s32) cam_ccm_leave_slide_shortcut(UNUSED struct Camera* c) { sStatusFlags &= ~CAM_FLAG_CCM_SLIDE_SHORTCUT; } /** * Apply any modes that are triggered by special floor surface types */ -u32 surface_type_modes(struct Camera *c) { +u32 surface_type_modes(struct Camera* c) { u32 modeChanged = 0; switch (sMarioGeometry.currFloorType) { @@ -6095,7 +6073,7 @@ u32 surface_type_modes(struct Camera *c) { /** * Set the camera mode to `mode` if Mario is not standing on a special surface */ -u32 set_mode_if_not_set_by_surface(struct Camera *c, u8 mode) { +u32 set_mode_if_not_set_by_surface(struct Camera* c, u8 mode) { u32 modeChanged = 0; modeChanged = surface_type_modes(c); @@ -6109,7 +6087,7 @@ u32 set_mode_if_not_set_by_surface(struct Camera *c, u8 mode) { /** * Used in THI, check if Mario is standing on any of the special surfaces in that area */ -void surface_type_modes_thi(struct Camera *c) { +void surface_type_modes_thi(struct Camera* c) { switch (sMarioGeometry.currFloorType) { case SURFACE_CLOSE_CAMERA: if (c->mode != CAMERA_MODE_CLOSE) { @@ -6141,8 +6119,7 @@ void surface_type_modes_thi(struct Camera *c) { /** * Terminates a list of CameraTriggers. */ -#define NULL_TRIGGER \ - { 0, NULL, 0, 0, 0, 0, 0, 0, 0 } +#define NULL_TRIGGER { 0, NULL, 0, 0, 0, 0, 0, 0, 0 } /** * The SL triggers operate camera behavior in front of the snowman who blows air. @@ -6152,50 +6129,42 @@ void surface_type_modes_thi(struct Camera *c) { * This behavior is exploitable, since the ranges assume that Mario must pass through the latter on * exit. Using hyperspeed, the earlier area can be directly exited from, keeping the changes it applies. */ -struct CameraTrigger sCamSL[] = { - { 1, cam_sl_snowman_head_8dir, 1119, 3584, 1125, 1177, 358, 358, -0x1D27 }, - // This trigger surrounds the previous one - { 1, cam_sl_free_roam, 1119, 3584, 1125, 4096, 4096, 4096, -0x1D27 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamSL[] = { { 1, cam_sl_snowman_head_8dir, 1119, 3584, 1125, 1177, 358, 358, -0x1D27 }, + // This trigger surrounds the previous one + { 1, cam_sl_free_roam, 1119, 3584, 1125, 4096, 4096, 4096, -0x1D27 }, + NULL_TRIGGER }; /** * The THI triggers are specifically for the tunnel near the start of the Huge Island. * The first helps the camera from getting stuck on the starting side, the latter aligns with the * tunnel. Both sides achieve their effect by editing the camera yaw. */ -struct CameraTrigger sCamTHI[] = { - { 1, cam_thi_move_cam_through_tunnel, -4609, -2969, 6448, 100, 300, 300, 0 }, - { 1, cam_thi_look_through_tunnel, -4809, -2969, 6448, 100, 300, 300, 0 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamTHI[] = { { 1, cam_thi_move_cam_through_tunnel, -4609, -2969, 6448, 100, 300, 300, 0 }, + { 1, cam_thi_look_through_tunnel, -4809, -2969, 6448, 100, 300, 300, 0 }, + NULL_TRIGGER }; /** * The HMC triggers are mostly for warping the camera below platforms, but the second trigger is used to * start the cutscene for entering the CotMC pool. */ -struct CameraTrigger sCamHMC[] = { - { 1, cam_hmc_enter_maze, 1996, 102, 0, 205, 100, 205, 0 }, - { 1, cam_castle_hmc_start_pool_cutscene, 3350, -4689, 4800, 600, 50, 600, 0 }, - { 1, cam_hmc_elevator_black_hole, -3278, 1236, 1379, 358, 200, 358, 0 }, - { 1, cam_hmc_elevator_maze_emergency_exit, -2816, 2055, -2560, 358, 200, 358, 0 }, - { 1, cam_hmc_elevator_lake, -3532, 1543, -7040, 358, 200, 358, 0 }, - { 1, cam_hmc_elevator_maze, -972, 1543, -7347, 358, 200, 358, 0 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamHMC[] = { { 1, cam_hmc_enter_maze, 1996, 102, 0, 205, 100, 205, 0 }, + { 1, cam_castle_hmc_start_pool_cutscene, 3350, -4689, 4800, 600, 50, 600, 0 }, + { 1, cam_hmc_elevator_black_hole, -3278, 1236, 1379, 358, 200, 358, 0 }, + { 1, cam_hmc_elevator_maze_emergency_exit, -2816, 2055, -2560, 358, 200, 358, 0 }, + { 1, cam_hmc_elevator_lake, -3532, 1543, -7040, 358, 200, 358, 0 }, + { 1, cam_hmc_elevator_maze, -972, 1543, -7347, 358, 200, 358, 0 }, + NULL_TRIGGER }; /** * The SSL triggers are for starting the enter pyramid top cutscene, * setting close mode in the middle of the pyramid, and setting the boss fight camera mode to outward * radial. */ -struct CameraTrigger sCamSSL[] = { - { 1, cam_ssl_enter_pyramid_top, -2048, 1080, -1024, 150, 150, 150, 0 }, - { 2, cam_ssl_pyramid_center, 0, -104, -104, 1248, 1536, 2950, 0 }, - { 2, cam_ssl_pyramid_center, 0, 2500, 256, 515, 5000, 515, 0 }, - { 3, cam_ssl_boss_room, 0, -1534, -2040, 1000, 800, 1000, 0 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamSSL[] = { { 1, cam_ssl_enter_pyramid_top, -2048, 1080, -1024, 150, 150, 150, 0 }, + { 2, cam_ssl_pyramid_center, 0, -104, -104, 1248, 1536, 2950, 0 }, + { 2, cam_ssl_pyramid_center, 0, 2500, 256, 515, 5000, 515, 0 }, + { 3, cam_ssl_boss_room, 0, -1534, -2040, 1000, 800, 1000, 0 }, + NULL_TRIGGER }; /** * The RR triggers are for changing between fixed and 8 direction mode when entering / leaving the building at @@ -6218,28 +6187,22 @@ struct CameraTrigger sCamRR[] = { * This table contains the only instance of a CameraTrigger with an area set to -1, and it sets the mode * to free_roam when Mario is not walking up the tower. */ -struct CameraTrigger sCamBOB[] = { - { 1, cam_bob_tower, 2468, 2720, -4608, 3263, 1696, 3072, 0 }, - { -1, cam_bob_default_free_roam, 0, 0, 0, 0, 0, 0, 0 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamBOB[] = { { 1, cam_bob_tower, 2468, 2720, -4608, 3263, 1696, 3072, 0 }, + { -1, cam_bob_default_free_roam, 0, 0, 0, 0, 0, 0, 0 }, + NULL_TRIGGER }; /** * The CotMC trigger is only used to prevent fix Lakitu in place when Mario exits through the waterfall. */ -struct CameraTrigger sCamCotMC[] = { - { 1, cam_cotmc_exit_waterfall, 0, 1500, 3500, 550, 10000, 1500, 0 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamCotMC[] = { { 1, cam_cotmc_exit_waterfall, 0, 1500, 3500, 550, 10000, 1500, 0 }, + NULL_TRIGGER }; /** * The CCM triggers are used to set the flag that says when Mario is in the slide shortcut. */ -struct CameraTrigger sCamCCM[] = { - { 2, cam_ccm_enter_slide_shortcut, -4846, 2061, 27, 1229, 1342, 396, 0 }, - { 2, cam_ccm_leave_slide_shortcut, -6412, -3917, -6246, 307, 185, 132, 0 }, - NULL_TRIGGER -}; +struct CameraTrigger sCamCCM[] = { { 2, cam_ccm_enter_slide_shortcut, -4846, 2061, 27, 1229, 1342, 396, 0 }, + { 2, cam_ccm_leave_slide_shortcut, -6412, -3917, -6246, 307, 185, 132, 0 }, + NULL_TRIGGER }; /** * The Castle triggers are used to set the camera to fixed mode when entering the lobby, and to set it @@ -6370,9 +6333,9 @@ struct CameraTrigger sCamBBH[] = { * * Each table is terminated with NULL_TRIGGER */ -struct CameraTrigger *sCameraTriggers[LEVEL_COUNT + 1] = { +struct CameraTrigger* sCameraTriggers[LEVEL_COUNT + 1] = { NULL, - #include "levels/level_defines.h" +#include "levels/level_defines.h" }; #undef _ #undef STUB_LEVEL @@ -6390,18 +6353,14 @@ struct CutsceneSplinePoint sIntroStartToPipePosition[] = { }; struct CutsceneSplinePoint sIntroStartToPipeFocus[] = { - { 0, 50, { 1753, 29800, 8999 } }, { 0, 50, { 1753, 29800, 8999 } }, - { 1, 50, { 1753, 8580, 8999 } }, { 1, 100, { 1753, 8580, 8999 } }, - { 2, 50, { 520, 5400, 8674 } }, { 3, 50, { 122, 4437, 7875 } }, - { 4, 50, { 316, 3333, 6538 } }, { 5, 36, { -1526, 2189, 5448 } }, - { 6, 50, { -1517, 452, 1731 } }, { 7, 50, { -6659, -181, 3109 } }, - { 8, 17, { -6649, 183, 3618 } }, { 9, 20, { -6009, -214, 4395 } }, - { 0, 50, { -5258, -175, 5449 } }, { 1, 36, { -5158, -266, 7651 } }, - { 2, 26, { -3351, -192, 6222 } }, { 3, 25, { -483, -137, 6060 } }, - { 4, 100, { 1833, 2211, 5962 } }, { 5, 26, { 3022, 207, 3090 } }, - { 6, 20, { 1250, 197, 449 } }, { 7, 50, { 248, 191, 227 } }, - { 7, 0, { 48, 191, 227 } }, { 7, 0, { 48, 191, 227 } }, - { -1, 0, { 48, 191, 227 } } + { 0, 50, { 1753, 29800, 8999 } }, { 0, 50, { 1753, 29800, 8999 } }, { 1, 50, { 1753, 8580, 8999 } }, + { 1, 100, { 1753, 8580, 8999 } }, { 2, 50, { 520, 5400, 8674 } }, { 3, 50, { 122, 4437, 7875 } }, + { 4, 50, { 316, 3333, 6538 } }, { 5, 36, { -1526, 2189, 5448 } }, { 6, 50, { -1517, 452, 1731 } }, + { 7, 50, { -6659, -181, 3109 } }, { 8, 17, { -6649, 183, 3618 } }, { 9, 20, { -6009, -214, 4395 } }, + { 0, 50, { -5258, -175, 5449 } }, { 1, 36, { -5158, -266, 7651 } }, { 2, 26, { -3351, -192, 6222 } }, + { 3, 25, { -483, -137, 6060 } }, { 4, 100, { 1833, 2211, 5962 } }, { 5, 26, { 3022, 207, 3090 } }, + { 6, 20, { 1250, 197, 449 } }, { 7, 50, { 248, 191, 227 } }, { 7, 0, { 48, 191, 227 } }, + { 7, 0, { 48, 191, 227 } }, { -1, 0, { 48, 191, 227 } } }; /** @@ -6438,19 +6397,18 @@ struct CutsceneSplinePoint sIntroPipeToDialogFocus[] = { }; #endif -struct CutsceneSplinePoint sEndingFlyToWindowPos[] = { - { 0, 0, { -86, 876, 640 } }, { 1, 0, { -86, 876, 610 } }, { 2, 0, { -66, 945, 393 } }, - { 3, 0, { -80, 976, 272 } }, { 4, 0, { -66, 1306, -36 } }, { 5, 0, { -70, 1869, -149 } }, - { 6, 0, { -10, 2093, -146 } }, { 7, 0, { -10, 2530, -248 } }, { 8, 0, { -10, 2530, -263 } }, - { 9, 0, { -10, 2530, -273 } } -}; +struct CutsceneSplinePoint sEndingFlyToWindowPos[] = { { 0, 0, { -86, 876, 640 } }, { 1, 0, { -86, 876, 610 } }, + { 2, 0, { -66, 945, 393 } }, { 3, 0, { -80, 976, 272 } }, + { 4, 0, { -66, 1306, -36 } }, { 5, 0, { -70, 1869, -149 } }, + { 6, 0, { -10, 2093, -146 } }, { 7, 0, { -10, 2530, -248 } }, + { 8, 0, { -10, 2530, -263 } }, { 9, 0, { -10, 2530, -273 } } }; -struct CutsceneSplinePoint sEndingFlyToWindowFocus[] = { - { 0, 50, { -33, 889, -7 } }, { 1, 35, { -33, 889, -7 } }, { 2, 31, { -17, 1070, -193 } }, - { 3, 25, { -65, 1182, -272 } }, { 4, 20, { -64, 1559, -542 } }, { 5, 25, { -68, 2029, -677 } }, - { 6, 25, { -9, 2204, -673 } }, { 7, 25, { -8, 2529, -772 } }, { 8, 0, { -8, 2529, -772 } }, - { 9, 0, { -8, 2529, -772 } }, { -1, 0, { -8, 2529, -772 } } -}; +struct CutsceneSplinePoint sEndingFlyToWindowFocus[] = { { 0, 50, { -33, 889, -7 } }, { 1, 35, { -33, 889, -7 } }, + { 2, 31, { -17, 1070, -193 } }, { 3, 25, { -65, 1182, -272 } }, + { 4, 20, { -64, 1559, -542 } }, { 5, 25, { -68, 2029, -677 } }, + { 6, 25, { -9, 2204, -673 } }, { 7, 25, { -8, 2529, -772 } }, + { 8, 0, { -8, 2529, -772 } }, { 9, 0, { -8, 2529, -772 } }, + { -1, 0, { -8, 2529, -772 } } }; struct CutsceneSplinePoint sEndingPeachDescentCamPos[] = { { 0, 50, { 1, 120, -1150 } }, { 1, 50, { 1, 120, -1150 } }, { 2, 40, { 118, 121, -1199 } }, @@ -6497,7 +6455,7 @@ struct CutsceneSplinePoint sEndingLookAtSkyFocus[] = { * * @return the camera's mode after processing, although this is unused in the code */ -s16 camera_course_processing(struct Camera *c) { +s16 camera_course_processing(struct Camera* c) { s16 level = gCurrLevelNum; s16 mode; s8 area = gCurrentArea->index; @@ -6527,16 +6485,14 @@ s16 camera_course_processing(struct Camera *c) { // Check only the current area's triggers if (sCameraTriggers[level][b].area == area) { // Copy the bounding box into center and bounds - vec3f_set(center, sCameraTriggers[level][b].centerX, - sCameraTriggers[level][b].centerY, - sCameraTriggers[level][b].centerZ); - vec3f_set(bounds, sCameraTriggers[level][b].boundsX, - sCameraTriggers[level][b].boundsY, - sCameraTriggers[level][b].boundsZ); + vec3f_set(center, sCameraTriggers[level][b].centerX, sCameraTriggers[level][b].centerY, + sCameraTriggers[level][b].centerZ); + vec3f_set(bounds, sCameraTriggers[level][b].boundsX, sCameraTriggers[level][b].boundsY, + sCameraTriggers[level][b].boundsZ); // Check if Mario is inside the bounds - if (is_pos_in_bounds(sMarioCamState->pos, center, bounds, - sCameraTriggers[level][b].boundsYaw) == TRUE) { + if (is_pos_in_bounds(sMarioCamState->pos, center, bounds, sCameraTriggers[level][b].boundsYaw) == + TRUE) { //! This should be checked before calling is_pos_in_bounds. (It doesn't belong //! outside the while loop because some events disable area processing) if (!(sStatusFlags & CAM_FLAG_BLOCK_AREA_PROCESSING)) { @@ -6649,10 +6605,9 @@ s16 camera_course_processing(struct Camera *c) { break; case AREA_DDD_SUB: - if ((c->mode != CAMERA_MODE_BEHIND_MARIO) - && (c->mode != CAMERA_MODE_WATER_SURFACE)) { - if (((sMarioCamState->action & ACT_FLAG_ON_POLE) != 0) - || (sMarioGeometry.currFloorHeight > 800.f)) { + if ((c->mode != CAMERA_MODE_BEHIND_MARIO) && (c->mode != CAMERA_MODE_WATER_SURFACE)) { + if (((sMarioCamState->action & ACT_FLAG_ON_POLE) != 0) || + (sMarioGeometry.currFloorHeight > 800.f)) { transition_to_camera_mode(c, CAMERA_MODE_8_DIRECTIONS, 60); } else { @@ -6682,7 +6637,7 @@ s16 camera_course_processing(struct Camera *c) { */ void resolve_geometry_collisions(Vec3f pos, UNUSED Vec3f lastGood) { f32 ceilY, floorY; - struct Surface *surf; + struct Surface* surf; f32_find_wall_collision(&pos[0], &pos[1], &pos[2], 0.f, 100.f); floorY = find_floor(pos[0], pos[1] + 50.f, pos[2], &surf); @@ -6727,10 +6682,10 @@ void resolve_geometry_collisions(Vec3f pos, UNUSED Vec3f lastGood) { * * @return 3 if a wall is covering Mario, 1 if a wall is only near the camera. */ -s32 rotate_camera_around_walls(struct Camera *c, Vec3f cPos, s16 *avoidYaw, s16 yawRange) { +s32 rotate_camera_around_walls(struct Camera* c, Vec3f cPos, s16* avoidYaw, s16 yawRange) { UNUSED u8 filler1[4]; struct WallCollisionData colData; - struct Surface *wall; + struct Surface* wall; UNUSED u8 filler2[12]; f32 dummyDist, checkDist; UNUSED u8 filler3[4]; @@ -6797,8 +6752,8 @@ s32 rotate_camera_around_walls(struct Camera *c, Vec3f cPos, s16 *avoidYaw, s16 horWallNorm = atan2s(wall->normal.z, wall->normal.x); wallYaw = horWallNorm + DEGREES(90); // If Mario would be blocked by the surface, then avoid it - if ((is_range_behind_surface(sMarioCamState->pos, cPos, wall, yawRange, SURFACE_WALL_MISC) == 0) - && (is_mario_behind_surface(c, wall) == TRUE) + if ((is_range_behind_surface(sMarioCamState->pos, cPos, wall, yawRange, SURFACE_WALL_MISC) == 0) && + (is_mario_behind_surface(c, wall) == TRUE) // Also check if the wall is tall enough to cover Mario && (is_surf_within_bounding_box(wall, -1.f, 150.f, -1.f) == FALSE)) { // Calculate the avoid direction. The function returns the opposite direction so add 180 @@ -6821,32 +6776,30 @@ s32 rotate_camera_around_walls(struct Camera *c, Vec3f cPos, s16 *avoidYaw, s16 * * Note: Also finds the water level, but waterHeight is unused */ -void find_mario_floor_and_ceil(struct PlayerGeometry *pg) { - struct Surface *surf; +void find_mario_floor_and_ceil(struct PlayerGeometry* pg) { + struct Surface* surf; s16 tempCheckingSurfaceCollisionsForCamera = gCheckingSurfaceCollisionsForCamera; gCheckingSurfaceCollisionsForCamera = TRUE; - if (find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 10.f, - sMarioCamState->pos[2], &surf) != FLOOR_LOWER_LIMIT) { + if (find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 10.f, sMarioCamState->pos[2], &surf) != + FLOOR_LOWER_LIMIT) { pg->currFloorType = surf->type; } else { pg->currFloorType = 0; } - if (find_ceil(sMarioCamState->pos[0], sMarioCamState->pos[1] - 10.f, - sMarioCamState->pos[2], &surf) != CELL_HEIGHT_LIMIT) { + if (find_ceil(sMarioCamState->pos[0], sMarioCamState->pos[1] - 10.f, sMarioCamState->pos[2], &surf) != + CELL_HEIGHT_LIMIT) { pg->currCeilType = surf->type; } else { pg->currCeilType = 0; } gCheckingSurfaceCollisionsForCamera = FALSE; - pg->currFloorHeight = find_floor(sMarioCamState->pos[0], - sMarioCamState->pos[1] + 10.f, - sMarioCamState->pos[2], &pg->currFloor); - pg->currCeilHeight = find_ceil(sMarioCamState->pos[0], - sMarioCamState->pos[1] - 10.f, - sMarioCamState->pos[2], &pg->currCeil); + pg->currFloorHeight = + find_floor(sMarioCamState->pos[0], sMarioCamState->pos[1] + 10.f, sMarioCamState->pos[2], &pg->currFloor); + pg->currCeilHeight = + find_ceil(sMarioCamState->pos[0], sMarioCamState->pos[1] - 10.f, sMarioCamState->pos[2], &pg->currCeil); pg->waterHeight = find_water_level(sMarioCamState->pos[0], sMarioCamState->pos[2]); gCheckingSurfaceCollisionsForCamera = tempCheckingSurfaceCollisionsForCamera; } @@ -6855,7 +6808,7 @@ void find_mario_floor_and_ceil(struct PlayerGeometry *pg) { * Start a cutscene focusing on an object * This will play if nothing else happened in the same frame, like exiting or warping. */ -void start_object_cutscene(u8 cutscene, struct Object *o) { +void start_object_cutscene(u8 cutscene, struct Object* o) { sObjectCutscene = cutscene; gRecentCutscene = 0; gCutsceneFocus = o; @@ -6886,7 +6839,7 @@ s16 unused_dialog_cutscene_response(u8 cutscene) { } } -s16 cutscene_object_with_dialog(u8 cutscene, struct Object *o, s16 dialogID) { +s16 cutscene_object_with_dialog(u8 cutscene, struct Object* o, s16 dialogID) { s16 response = DIALOG_RESPONSE_NONE; if ((gCamera->cutscene == 0) && (sObjectCutscene == 0)) { @@ -6906,7 +6859,7 @@ s16 cutscene_object_with_dialog(u8 cutscene, struct Object *o, s16 dialogID) { return response; } -s16 cutscene_object_without_dialog(u8 cutscene, struct Object *o) { +s16 cutscene_object_without_dialog(u8 cutscene, struct Object* o) { s16 response = cutscene_object_with_dialog(cutscene, o, DIALOG_NONE); return response; } @@ -6914,7 +6867,7 @@ s16 cutscene_object_without_dialog(u8 cutscene, struct Object *o) { /** * @return 0 if not started, 1 if started, and -1 if finished */ -s16 cutscene_object(u8 cutscene, struct Object *o) { +s16 cutscene_object(u8 cutscene, struct Object* o) { s16 status = 0; if ((gCamera->cutscene == 0) && (sObjectCutscene == 0)) { @@ -6931,7 +6884,7 @@ s16 cutscene_object(u8 cutscene, struct Object *o) { /** * Update the camera's yaw and nextYaw. This is called from cutscenes to ignore the camera mode's yaw. */ -void update_camera_yaw(struct Camera *c) { +void update_camera_yaw(struct Camera* c) { c->nextYaw = calculate_yaw(c->focus, c->pos); c->yaw = c->nextYaw; } @@ -6941,7 +6894,7 @@ void cutscene_reset_spline(void) { sCutsceneSplineSegmentProgress = 0; } -void stop_cutscene_and_retrieve_stored_info(struct Camera *c) { +void stop_cutscene_and_retrieve_stored_info(struct Camera* c) { gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; vec3f_copy(c->focus, sCameraStoreCutscene.focus); @@ -6953,7 +6906,7 @@ void cap_switch_save(s16 dummy) { save_file_do_save(gCurrSaveFileNum - 1); } -void init_spline_point(struct CutsceneSplinePoint *splinePoint, s8 index, u8 speed, Vec3s point) { +void init_spline_point(struct CutsceneSplinePoint* splinePoint, s8 index, u8 speed, Vec3s point) { splinePoint->index = index; splinePoint->speed = speed; vec3s_copy(splinePoint->point, point); @@ -6976,10 +6929,18 @@ void copy_spline_segment(struct CutsceneSplinePoint dst[], struct CutsceneSpline } while (j > 16); // Create the end of the spline by duplicating the last point - do { init_spline_point(&dst[i], 0, src[j].speed, src[j].point); } while (0); - do { init_spline_point(&dst[i + 1], 0, 0, src[j].point); } while (0); - do { init_spline_point(&dst[i + 2], 0, 0, src[j].point); } while (0); - do { init_spline_point(&dst[i + 3], -1, 0, src[j].point); } while (0); + do { + init_spline_point(&dst[i], 0, src[j].speed, src[j].point); + } while (0); + do { + init_spline_point(&dst[i + 1], 0, 0, src[j].point); + } while (0); + do { + init_spline_point(&dst[i + 2], 0, 0, src[j].point); + } while (0); + do { + init_spline_point(&dst[i + 3], -1, 0, src[j].point); + } while (0); } /** @@ -6999,26 +6960,26 @@ s16 cutscene_common_set_dialog_state(s32 state) { } /// Unused SSL cutscene? -static UNUSED void unused_cutscene_mario_dialog_looking_down(UNUSED struct Camera *c) { +static UNUSED void unused_cutscene_mario_dialog_looking_down(UNUSED struct Camera* c) { gCutsceneTimer = cutscene_common_set_dialog_state(MARIO_DIALOG_LOOK_DOWN); } /** * Cause Mario to enter the normal dialog state. */ -static BAD_RETURN(s32) cutscene_mario_dialog(UNUSED struct Camera *c) { +static BAD_RETURN(s32) cutscene_mario_dialog(UNUSED struct Camera* c) { gCutsceneTimer = cutscene_common_set_dialog_state(MARIO_DIALOG_LOOK_FRONT); } /// Unused SSL cutscene? -static UNUSED void unused_cutscene_mario_dialog_looking_up(UNUSED struct Camera *c) { +static UNUSED void unused_cutscene_mario_dialog_looking_up(UNUSED struct Camera* c) { gCutsceneTimer = cutscene_common_set_dialog_state(MARIO_DIALOG_LOOK_UP); } /** * Lower the volume (US only) and start the peach letter background music */ -BAD_RETURN(s32) cutscene_intro_peach_start_letter_music(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_start_letter_music(UNUSED struct Camera* c) { #if defined(VERSION_US) || defined(VERSION_SH) seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40); #endif @@ -7028,8 +6989,8 @@ BAD_RETURN(s32) cutscene_intro_peach_start_letter_music(UNUSED struct Camera *c) /** * Raise the volume (not in JP) and start the flying music. */ -BAD_RETURN(s32) cutscene_intro_peach_start_flying_music(UNUSED struct Camera *c) {\ - if(!ROM_JP) { +BAD_RETURN(s32) cutscene_intro_peach_start_flying_music(UNUSED struct Camera* c) { + if (!ROM_JP) { seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); } else { cutscene_intro_peach_play_lakitu_flying_music(); @@ -7041,19 +7002,19 @@ BAD_RETURN(s32) cutscene_intro_peach_start_flying_music(UNUSED struct Camera *c) * Lower the volume for the letter background music. In US, this happens on the same frame as the music * starts. */ -BAD_RETURN(s32) cutscene_intro_peach_eu_lower_volume(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_eu_lower_volume(UNUSED struct Camera* c) { seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40); } #endif -void reset_pan_distance(UNUSED struct Camera *c) { +void reset_pan_distance(UNUSED struct Camera* c) { sPanDistance = 0; } /** * Easter egg: the player 2 controller can move the camera's focus in the ending and credits. */ -void player2_rotate_cam(struct Camera *c, s16 minPitch, s16 maxPitch, s16 minYaw, s16 maxYaw) { +void player2_rotate_cam(struct Camera* c, s16 minPitch, s16 maxPitch, s16 minYaw, s16 maxYaw) { f32 distCamToFocus; s16 pitch, yaw, pitchCap; @@ -7062,7 +7023,8 @@ void player2_rotate_cam(struct Camera *c, s16 minPitch, s16 maxPitch, s16 minYaw approach_s16_asymptotic_bool(&sCreditsPlayer2Pitch, -(s16)(gPlayer2Controller->stickY * 265.f), 4); vec3f_get_dist_and_angle(c->pos, c->focus, &distCamToFocus, &pitch, &yaw); - pitchCap = 0x3800 - pitch; if (pitchCap < 0) { + pitchCap = 0x3800 - pitch; + if (pitchCap < 0) { pitchCap = 0; } if (maxPitch > pitchCap) { @@ -7100,7 +7062,7 @@ void player2_rotate_cam(struct Camera *c, s16 minPitch, s16 maxPitch, s16 minYaw /** * Store camera info for the cannon opening cutscene */ -void store_info_cannon(struct Camera *c) { +void store_info_cannon(struct Camera* c) { vec3f_copy(sCameraStoreCutscene.pos, c->pos); vec3f_copy(sCameraStoreCutscene.focus, c->focus); sCameraStoreCutscene.panDist = sPanDistance; @@ -7110,7 +7072,7 @@ void store_info_cannon(struct Camera *c) { /** * Retrieve camera info for the cannon opening cutscene */ -void retrieve_info_cannon(struct Camera *c) { +void retrieve_info_cannon(struct Camera* c) { vec3f_copy(c->pos, sCameraStoreCutscene.pos); vec3f_copy(c->focus, sCameraStoreCutscene.focus); sPanDistance = sCameraStoreCutscene.panDist; @@ -7120,7 +7082,7 @@ void retrieve_info_cannon(struct Camera *c) { /** * Store camera info for the star spawn cutscene */ -void store_info_star(struct Camera *c) { +void store_info_star(struct Camera* c) { reset_pan_distance(c); vec3f_copy(sCameraStoreCutscene.pos, c->pos); sCameraStoreCutscene.focus[0] = sMarioCamState->pos[0]; @@ -7131,7 +7093,7 @@ void store_info_star(struct Camera *c) { /** * Retrieve camera info for the star spawn cutscene */ -void retrieve_info_star(struct Camera *c) { +void retrieve_info_star(struct Camera* c) { vec3f_copy(c->pos, sCameraStoreCutscene.pos); vec3f_copy(c->focus, sCameraStoreCutscene.focus); } @@ -7153,22 +7115,23 @@ static UNUSED void unused_vec3f_to_vec3s(Vec3s dst, Vec3f src) { /** * Rotate the camera's focus around the camera's position by incYaw and incPitch */ -void pan_camera(struct Camera *c, s16 incPitch, s16 incYaw) { +void pan_camera(struct Camera* c, s16 incPitch, s16 incYaw) { UNUSED u8 filler[12]; f32 distCamToFocus; s16 pitch, yaw; vec3f_get_dist_and_angle(c->pos, c->focus, &distCamToFocus, &pitch, &yaw); - pitch += incPitch; yaw += incYaw; + pitch += incPitch; + yaw += incYaw; vec3f_set_dist_and_angle(c->pos, c->focus, distCamToFocus, pitch, yaw); } -BAD_RETURN(s32) cutscene_shake_explosion(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_shake_explosion(UNUSED struct Camera* c) { set_environmental_camera_shake(SHAKE_ENV_EXPLOSION); cutscene_set_fov_shake_preset(1); } -static UNUSED void unused_start_bowser_bounce_shake(UNUSED struct Camera *c) { +static UNUSED void unused_start_bowser_bounce_shake(UNUSED struct Camera* c) { set_environmental_camera_shake(SHAKE_ENV_BOWSER_THROW_BOUNCE); } @@ -7189,32 +7152,32 @@ void rotate_and_move_vec3f(Vec3f to, Vec3f from, f32 incDist, s16 incPitch, s16 vec3f_set_dist_and_angle(from, to, dist, pitch, yaw); } -void set_flag_post_door(struct Camera *c) { +void set_flag_post_door(struct Camera* c) { sStatusFlags |= CAM_FLAG_BEHIND_MARIO_POST_DOOR; sCameraYawAfterDoorCutscene = calculate_yaw(c->focus, c->pos); } -void cutscene_soften_music(UNUSED struct Camera *c) { +void cutscene_soften_music(UNUSED struct Camera* c) { seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40); } -void cutscene_unsoften_music(UNUSED struct Camera *c) { +void cutscene_unsoften_music(UNUSED struct Camera* c) { seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); } -UNUSED static void stub_camera_5(UNUSED struct Camera *c) { +UNUSED static void stub_camera_5(UNUSED struct Camera* c) { } -BAD_RETURN(s32) cutscene_unused_start(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_unused_start(UNUSED struct Camera* c) { } -BAD_RETURN(s32) cutscene_unused_loop(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_unused_loop(UNUSED struct Camera* c) { } /** * Set the camera position and focus for when Mario falls from the sky. */ -BAD_RETURN(s32) cutscene_ending_mario_fall_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_mario_fall_start(struct Camera* c) { vec3f_set(c->focus, -26.f, 0.f, -137.f); vec3f_set(c->pos, 165.f, 4725.f, 324.f); } @@ -7222,7 +7185,7 @@ BAD_RETURN(s32) cutscene_ending_mario_fall_start(struct Camera *c) { /** * Focus on Mario when he's falling from the sky. */ -BAD_RETURN(s32) cutscene_ending_mario_fall_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_mario_fall_focus_mario(struct Camera* c) { Vec3f offset; vec3f_set(offset, 0.f, 80.f, 0.f); @@ -7237,7 +7200,7 @@ BAD_RETURN(s32) cutscene_ending_mario_fall_focus_mario(struct Camera *c) { /** * Mario falls from the sky after the grand star cutscene. */ -BAD_RETURN(s32) cutscene_ending_mario_fall(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_mario_fall(struct Camera* c) { cutscene_event(cutscene_ending_mario_fall_start, c, 0, 0); cutscene_event(cutscene_ending_mario_fall_focus_mario, c, 0, -1); player2_rotate_cam(c, -0x2000, 0x2000, -0x2000, 0x2000); @@ -7246,7 +7209,7 @@ BAD_RETURN(s32) cutscene_ending_mario_fall(struct Camera *c) { /** * Closeup of Mario as the wing cap fades and Mario looks up. */ -BAD_RETURN(s32) cutscene_ending_mario_land_closeup(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_mario_land_closeup(struct Camera* c) { vec3f_set(c->focus, 85.f, 826.f, 250.f); vec3f_set(c->pos, -51.f, 988.f, -202.f); player2_rotate_cam(c, -0x2000, 0x2000, -0x2000, 0x2000); @@ -7255,7 +7218,7 @@ BAD_RETURN(s32) cutscene_ending_mario_land_closeup(struct Camera *c) { /** * Reset the spline progress and cvar9. */ -BAD_RETURN(s32) cutscene_ending_reset_spline(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_reset_spline(UNUSED struct Camera* c) { sCutsceneVars[9].point[0] = 0.f; cutscene_reset_spline(); } @@ -7263,15 +7226,16 @@ BAD_RETURN(s32) cutscene_ending_reset_spline(UNUSED struct Camera *c) { /** * Follow sEndingFlyToWindowPos/Focus up to the window. */ -BAD_RETURN(s32) cutscene_ending_fly_up_to_window(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_fly_up_to_window(struct Camera* c) { move_point_along_spline(c->pos, sEndingFlyToWindowPos, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); - move_point_along_spline(c->focus, sEndingFlyToWindowFocus, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); + move_point_along_spline(c->focus, sEndingFlyToWindowFocus, &sCutsceneSplineSegment, + &sCutsceneSplineSegmentProgress); } /** * Move the camera up to the window as the star power frees peach. */ -BAD_RETURN(s32) cutscene_ending_stars_free_peach(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_stars_free_peach(struct Camera* c) { cutscene_event(cutscene_ending_reset_spline, c, 0, 0); cutscene_event(cutscene_ending_fly_up_to_window, c, 0, -1); player2_rotate_cam(c, -0x2000, 0x2000, -0x2000, 0x2000); @@ -7280,16 +7244,18 @@ BAD_RETURN(s32) cutscene_ending_stars_free_peach(struct Camera *c) { /** * Move the camera to the ground as Mario lands. */ -BAD_RETURN(s32) cutscene_ending_mario_land(struct Camera *c) { - vec3f_set(c->focus, sEndingFlyToWindowFocus[0].point[0], sEndingFlyToWindowFocus[0].point[1] + 80.f, sEndingFlyToWindowFocus[0].point[2]); - vec3f_set(c->pos, sEndingFlyToWindowPos[0].point[0], sEndingFlyToWindowPos[0].point[1], sEndingFlyToWindowPos[0].point[2] + 150.f); +BAD_RETURN(s32) cutscene_ending_mario_land(struct Camera* c) { + vec3f_set(c->focus, sEndingFlyToWindowFocus[0].point[0], sEndingFlyToWindowFocus[0].point[1] + 80.f, + sEndingFlyToWindowFocus[0].point[2]); + vec3f_set(c->pos, sEndingFlyToWindowPos[0].point[0], sEndingFlyToWindowPos[0].point[1], + sEndingFlyToWindowPos[0].point[2] + 150.f); player2_rotate_cam(c, -0x800, 0x2000, -0x2000, 0x2000); } /** * Move the camera closer to peach appearing. */ -BAD_RETURN(s32) cutscene_ending_peach_appear_closeup(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_appear_closeup(struct Camera* c) { vec3f_set(c->pos, 179.f, 2463.f, -1216.f); c->pos[1] = gCutsceneFocus->oPosY + 35.f; vec3f_set(c->focus, gCutsceneFocus->oPosX, gCutsceneFocus->oPosY + 125.f, gCutsceneFocus->oPosZ); @@ -7298,7 +7264,7 @@ BAD_RETURN(s32) cutscene_ending_peach_appear_closeup(struct Camera *c) { /** * Peach fades in, the camera focuses on her. */ -BAD_RETURN(s32) cutscene_ending_peach_appears(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_appears(struct Camera* c) { cutscene_event(cutscene_ending_peach_appear_closeup, c, 0, 0); approach_f32_asymptotic_bool(&c->pos[1], gCutsceneFocus->oPosY + 35.f, 0.02f); approach_f32_asymptotic_bool(&c->focus[1], gCutsceneFocus->oPosY + 125.f, 0.15f); @@ -7308,7 +7274,7 @@ BAD_RETURN(s32) cutscene_ending_peach_appears(struct Camera *c) { /** * Reset spline progress, set cvar2 y offset. */ -BAD_RETURN(s32) cutscene_ending_peach_descends_start(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_descends_start(UNUSED struct Camera* c) { cutscene_reset_spline(); sCutsceneVars[2].point[1] = 150.f; } @@ -7316,22 +7282,23 @@ BAD_RETURN(s32) cutscene_ending_peach_descends_start(UNUSED struct Camera *c) { /** * Follow the sEndingPeachDescentCamPos spline, which rotates around peach. */ -BAD_RETURN(s32) cutscene_ending_follow_peach_descent(struct Camera *c) { - move_point_along_spline(c->pos, sEndingPeachDescentCamPos, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); +BAD_RETURN(s32) cutscene_ending_follow_peach_descent(struct Camera* c) { + move_point_along_spline(c->pos, sEndingPeachDescentCamPos, &sCutsceneSplineSegment, + &sCutsceneSplineSegmentProgress); c->pos[1] += gCutsceneFocus->oPosY + sCutsceneVars[3].point[1]; } /** * Decrease cvar2's y offset while the camera flies backwards to Mario. */ -BAD_RETURN(s32) cutscene_ending_peach_descent_lower_focus(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_descent_lower_focus(UNUSED struct Camera* c) { camera_approach_f32_symmetric_bool(&(sCutsceneVars[2].point[1]), 90.f, 0.5f); } /** * Keep following the sEndingPeachDescentCamPos spline, which leads back to Mario. */ -BAD_RETURN(s32) cutscene_ending_peach_descent_back_to_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_descent_back_to_mario(struct Camera* c) { Vec3f pos; move_point_along_spline(pos, sEndingPeachDescentCamPos, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); @@ -7344,7 +7311,7 @@ BAD_RETURN(s32) cutscene_ending_peach_descent_back_to_mario(struct Camera *c) { * Peach starts floating to the ground. Rotate the camera around her, then fly backwards to Mario when * she lands. */ -BAD_RETURN(s32) cutscene_ending_peach_descends(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_descends(struct Camera* c) { cutscene_event(cutscene_ending_peach_descends_start, c, 0, 0); cutscene_event(cutscene_ending_follow_peach_descent, c, 0, 299); cutscene_event(cutscene_ending_peach_descent_back_to_mario, c, 300, -1); @@ -7358,24 +7325,25 @@ BAD_RETURN(s32) cutscene_ending_peach_descends(struct Camera *c) { * Mario runs across the bridge to peach, and takes off his cap. * Follow the sEndingMarioToPeach* splines while Mario runs across. */ -BAD_RETURN(s32) cutscene_ending_mario_to_peach(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_mario_to_peach(struct Camera* c) { cutscene_event(cutscene_ending_reset_spline, c, 0, 0); move_point_along_spline(c->pos, sEndingMarioToPeachPos, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); - move_point_along_spline(c->focus, sEndingMarioToPeachFocus, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); + move_point_along_spline(c->focus, sEndingMarioToPeachFocus, &sCutsceneSplineSegment, + &sCutsceneSplineSegmentProgress); player2_rotate_cam(c, -0x2000, 0x2000, -0x2000, 0x2000); } /** * Make the focus follow the sEndingLookUpAtCastle spline. */ -BAD_RETURN(s32) cutscene_ending_look_up_at_castle(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_look_up_at_castle(UNUSED struct Camera* c) { move_point_along_spline(c->focus, sEndingLookUpAtCastle, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); } /** * Peach opens her eyes and the camera looks at the castle window again. */ -BAD_RETURN(s32) cutscene_ending_peach_wakeup(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_peach_wakeup(struct Camera* c) { cutscene_event(cutscene_ending_reset_spline, c, 0, 0); cutscene_event(cutscene_ending_look_up_at_castle, c, 0, 0); #ifdef VERSION_EU @@ -7394,7 +7362,7 @@ BAD_RETURN(s32) cutscene_ending_peach_wakeup(struct Camera *c) { /** * Side view of peach and Mario. Peach thanks Mario for saving her. */ -BAD_RETURN(s32) cutscene_ending_dialog(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_dialog(struct Camera* c) { vec3f_set(c->focus, 11.f, 983.f, -1273.f); vec3f_set(c->pos, -473.f, 970.f, -1152.f); player2_rotate_cam(c, -0x800, 0x2000, -0x2000, 0x2000); @@ -7403,7 +7371,7 @@ BAD_RETURN(s32) cutscene_ending_dialog(struct Camera *c) { /** * Zoom in and move the camera close to Mario and peach. */ -BAD_RETURN(s32) cutscene_ending_kiss_closeup(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_kiss_closeup(struct Camera* c) { set_fov_function(CAM_FOV_SET_29); vec3f_set(c->focus, 350.f, 1034.f, -1216.f); vec3f_set(c->pos, -149.f, 1021.f, -1216.f); @@ -7412,7 +7380,7 @@ BAD_RETURN(s32) cutscene_ending_kiss_closeup(struct Camera *c) { /** * Fly back and zoom out for Mario's spin after the kiss. */ -BAD_RETURN(s32) cutscene_ending_kiss_here_we_go(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_kiss_here_we_go(struct Camera* c) { Vec3f pos, foc; set_fov_function(CAM_FOV_DEFAULT); @@ -7426,7 +7394,7 @@ BAD_RETURN(s32) cutscene_ending_kiss_here_we_go(struct Camera *c) { /** * Peach kisses Mario on the nose. */ -BAD_RETURN(s32) cutscene_ending_kiss(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_kiss(struct Camera* c) { cutscene_event(cutscene_ending_kiss_closeup, c, 0, 0); #ifdef VERSION_EU cutscene_event(cutscene_ending_kiss_here_we_go, c, 185, -1); @@ -7439,7 +7407,7 @@ BAD_RETURN(s32) cutscene_ending_kiss(struct Camera *c) { /** * Make the focus follow sEndingLookAtSkyFocus. */ -BAD_RETURN(s32) cutscene_ending_look_at_sky(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_look_at_sky(struct Camera* c) { move_point_along_spline(c->focus, sEndingLookAtSkyFocus, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); vec3f_set(c->pos, 699.f, 1680.f, -703.f); } @@ -7448,14 +7416,14 @@ BAD_RETURN(s32) cutscene_ending_look_at_sky(struct Camera *c) { * Zoom in the fov. The fovFunc was just set to default, so it wants to approach 45. But while this is * called, it will stay at about 37.26f */ -BAD_RETURN(s32) cutscene_ending_zoom_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_zoom_fov(UNUSED struct Camera* c) { sFOVState.fov = 37.f; } /** * Peach suggests baking a cake for Mario. Mario looks back at the camera before going inside the castle. */ -BAD_RETURN(s32) cutscene_ending_cake_for_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_cake_for_mario(struct Camera* c) { cutscene_event(cutscene_ending_reset_spline, c, 0, 0); cutscene_event(cutscene_ending_look_at_sky, c, 0, 0); cutscene_event(cutscene_ending_zoom_fov, c, 0, 499); @@ -7469,7 +7437,7 @@ BAD_RETURN(s32) cutscene_ending_cake_for_mario(struct Camera *c) { /** * Stop the ending cutscene, reset the fov. */ -BAD_RETURN(s32) cutscene_ending_stop(struct Camera *c) { +BAD_RETURN(s32) cutscene_ending_stop(struct Camera* c) { set_fov_function(CAM_FOV_SET_45); c->cutscene = 0; gCutsceneTimer = CUTSCENE_STOP; @@ -7480,7 +7448,7 @@ BAD_RETURN(s32) cutscene_ending_stop(struct Camera *c) { * cvar0 is a relative offset from Mario. * cvar1 is the is the camera's goal position. */ -BAD_RETURN(s32) cutscene_grand_star_start(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_start(UNUSED struct Camera* c) { vec3f_set(sCutsceneVars[0].point, 0.f, 150.f, -600.f); offset_rotated(sCutsceneVars[1].point, sMarioCamState->pos, sCutsceneVars[0].point, sMarioCamState->faceAngle); sCutsceneVars[1].point[1] = 457.f; @@ -7489,7 +7457,7 @@ BAD_RETURN(s32) cutscene_grand_star_start(UNUSED struct Camera *c) { /** * Make the camera fly to the front of Mario. */ -BAD_RETURN(s32) cutscene_grand_star_front_of_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_front_of_mario(struct Camera* c) { f32 goalDist; s16 goalPitch, goalYaw; f32 dist; @@ -7506,7 +7474,7 @@ BAD_RETURN(s32) cutscene_grand_star_front_of_mario(struct Camera *c) { /** * Started shortly after Mario starts the triple jump. Stores Mario's face angle and zeros cvar2. */ -BAD_RETURN(s32) cutscene_grand_star_mario_jump(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_mario_jump(UNUSED struct Camera* c) { vec3s_set(sCutsceneVars[0].angle, 0, sMarioCamState->faceAngle[1], 0); vec3f_set(sCutsceneVars[2].point, 0.f, 0.f, 0.f); } @@ -7514,7 +7482,7 @@ BAD_RETURN(s32) cutscene_grand_star_mario_jump(UNUSED struct Camera *c) { /** * Accelerate cvar2 to point back and to the left (relative to the camera). */ -BAD_RETURN(s32) cutscene_grand_star_accel_cvar2(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_accel_cvar2(UNUSED struct Camera* c) { camera_approach_f32_symmetric_bool(&sCutsceneVars[2].point[2], -40.f, 2.0f); sCutsceneVars[2].point[0] = 5.0f; } @@ -7522,7 +7490,7 @@ BAD_RETURN(s32) cutscene_grand_star_accel_cvar2(UNUSED struct Camera *c) { /** * Decrease cvar2 offset, follow Mario by directly updating the camera's pos. */ -BAD_RETURN(s32) cutscene_grand_star_approach_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_approach_mario(struct Camera* c) { camera_approach_f32_symmetric_bool(&sCutsceneVars[2].point[2], 0.f, 2.f); sCutsceneVars[2].point[0] = 0.f; approach_f32_asymptotic_bool(&c->pos[0], sMarioCamState->pos[0], 0.01f); @@ -7533,11 +7501,11 @@ BAD_RETURN(s32) cutscene_grand_star_approach_mario(struct Camera *c) { * Offset the camera's position by cvar2. Before Mario triple jumps, this moves back and to the left. * After the triple jump, cvar2 decelerates to 0. */ -BAD_RETURN(s32) cutscene_grand_star_move_cvar2(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_move_cvar2(struct Camera* c) { offset_rotated(c->pos, c->pos, sCutsceneVars[2].point, sCutsceneVars[0].angle); } -BAD_RETURN(s32) cutscene_grand_star_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_focus_mario(struct Camera* c) { Vec3f foc; vec3f_set(foc, sMarioCamState->pos[0], (sMarioCamState->pos[1] - 307.f) * 0.5f + 407.f, sMarioCamState->pos[2]); @@ -7547,7 +7515,7 @@ BAD_RETURN(s32) cutscene_grand_star_focus_mario(struct Camera *c) { /** * The first part of the grand star cutscene, after Mario has collected the grand star. */ -BAD_RETURN(s32) cutscene_grand_star(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; cutscene_event(cutscene_grand_star_start, c, 0, 0); cutscene_event(cutscene_grand_star_front_of_mario, c, 0, 109); @@ -7561,7 +7529,7 @@ BAD_RETURN(s32) cutscene_grand_star(struct Camera *c) { /** * Zero the cvars that are used when Mario is flying. */ -BAD_RETURN(s32) cutscene_grand_star_fly_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_fly_start(struct Camera* c) { //! cvar7 is unused in grand star vec3f_set(sCutsceneVars[7].point, 0.5f, 0.5f, 0.5f); //! cvar6 is unused in grand star @@ -7575,7 +7543,7 @@ BAD_RETURN(s32) cutscene_grand_star_fly_start(struct Camera *c) { /** * Decrease the cvar offsets so that Lakitu flies closer to Mario. */ -BAD_RETURN(s32) cutscene_grand_star_fly_move_to_mario(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_fly_move_to_mario(UNUSED struct Camera* c) { Vec3f posOff; vec3f_set(posOff, -600.f, 0.f, -400.f); @@ -7591,7 +7559,7 @@ BAD_RETURN(s32) cutscene_grand_star_fly_move_to_mario(UNUSED struct Camera *c) { * cvar5 is the focus offset from Mario. * cvar8.point[0] is the approach velocity. */ -BAD_RETURN(s32) cutscene_grand_star_fly_mario_offscreen(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_fly_mario_offscreen(UNUSED struct Camera* c) { camera_approach_f32_symmetric_bool(&sCutsceneVars[8].point[0], 15.f, 0.1f); camera_approach_f32_symmetric_bool(&sCutsceneVars[4].point[0], -2000.f, sCutsceneVars[8].point[0]); @@ -7608,7 +7576,7 @@ BAD_RETURN(s32) cutscene_grand_star_fly_mario_offscreen(UNUSED struct Camera *c) * cvar4 is the position offset. * cvar5 is the focus offset. */ -BAD_RETURN(s32) cutscene_grand_star_fly_app_cvars(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_fly_app_cvars(struct Camera* c) { Vec3f goalPos, goalFoc; f32 dist; s16 pitch, yaw; @@ -7635,7 +7603,7 @@ BAD_RETURN(s32) cutscene_grand_star_fly_app_cvars(struct Camera *c) { * * cvar8.point[2] is Lakitu's speed. */ -BAD_RETURN(s32) cutscene_grand_star_fly(struct Camera *c) { +BAD_RETURN(s32) cutscene_grand_star_fly(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; cutscene_event(cutscene_grand_star_fly_start, c, 0, 0); cutscene_event(cutscene_grand_star_fly_move_to_mario, c, 0, 140); @@ -7648,7 +7616,7 @@ BAD_RETURN(s32) cutscene_grand_star_fly(struct Camera *c) { * @param dist distance in Mario's forward direction. Note that this is relative to Mario, so a negative * distance will focus in front of Mario, and a positive distance will focus behind him. */ -void focus_in_front_of_mario(struct Camera *c, f32 dist, f32 speed) { +void focus_in_front_of_mario(struct Camera* c, f32 dist, f32 speed) { Vec3f goalFocus, offset; offset[0] = 0.f; @@ -7663,7 +7631,7 @@ void focus_in_front_of_mario(struct Camera *c, f32 dist, f32 speed) { * Approach Mario and look up. Since Mario faces the camera when he collects the star, there's no need * to worry about the camera's yaw. */ -BAD_RETURN(s32) cutscene_dance_move_to_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_move_to_mario(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -7673,39 +7641,39 @@ BAD_RETURN(s32) cutscene_dance_move_to_mario(struct Camera *c) { vec3f_set_dist_and_angle(sMarioCamState->pos, c->pos, dist, pitch, yaw); } -BAD_RETURN(s32) cutscene_dance_rotate(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_rotate(struct Camera* c) { rotate_and_move_vec3f(c->pos, sMarioCamState->pos, 0, 0, 0x200); } -BAD_RETURN(s32) cutscene_dance_rotate_move_back(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_rotate_move_back(struct Camera* c) { rotate_and_move_vec3f(c->pos, sMarioCamState->pos, -15.f, 0, 0); } -BAD_RETURN(s32) cutscene_dance_rotate_move_towards_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_rotate_move_towards_mario(struct Camera* c) { rotate_and_move_vec3f(c->pos, sMarioCamState->pos, 20.f, 0, 0); } /** * Speculated to be dance-related due to its proximity to the other dance functions */ -UNUSED static BAD_RETURN(s32) cutscene_dance_unused(UNUSED struct Camera *c) { +UNUSED static BAD_RETURN(s32) cutscene_dance_unused(UNUSED struct Camera* c) { } /** * Slowly turn to the point 100 units in front of Mario */ -BAD_RETURN(s32) cutscene_dance_default_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_default_focus_mario(struct Camera* c) { focus_in_front_of_mario(c, -100.f, 0.2f); } /** * Focus twice as far away as default dance, and move faster. */ -BAD_RETURN(s32) cutscene_dance_rotate_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_rotate_focus_mario(struct Camera* c) { focus_in_front_of_mario(c, -200.f, 0.03f); } -BAD_RETURN(s32) cutscene_dance_shake_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_shake_fov(UNUSED struct Camera* c) { set_fov_shake(0x200, 0x28, 0x8000); } @@ -7714,7 +7682,7 @@ BAD_RETURN(s32) cutscene_dance_shake_fov(UNUSED struct Camera *c) { * In the default dance: the camera moves closer to Mario, then stays in place. * In the rotate dance: the camera moves closer and rotates clockwise around Mario. */ -BAD_RETURN(s32) cutscene_dance_default_rotate(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_default_rotate(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; sYawSpeed = 0; set_fov_function(CAM_FOV_DEFAULT); @@ -7731,9 +7699,8 @@ BAD_RETURN(s32) cutscene_dance_default_rotate(struct Camera *c) { cutscene_event(cutscene_dance_rotate_move_towards_mario, c, 70, 90); } else { // secret star, 100 coin star, or bowser red coin star. - if ((sMarioCamState->action != ACT_STAR_DANCE_NO_EXIT) - && (sMarioCamState->action != ACT_STAR_DANCE_WATER) - && (sMarioCamState->action != ACT_STAR_DANCE_EXIT)) { + if ((sMarioCamState->action != ACT_STAR_DANCE_NO_EXIT) && (sMarioCamState->action != ACT_STAR_DANCE_WATER) && + (sMarioCamState->action != ACT_STAR_DANCE_EXIT)) { gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; transition_next_state(c, 20); @@ -7745,7 +7712,7 @@ BAD_RETURN(s32) cutscene_dance_default_rotate(struct Camera *c) { /** * If the camera's yaw is out of the range of `absYaw` +- `yawMax`, then set the yaw to `absYaw` */ -BAD_RETURN(s32) star_dance_bound_yaw(struct Camera *c, s16 absYaw, s16 yawMax) { +BAD_RETURN(s32) star_dance_bound_yaw(struct Camera* c, s16 absYaw, s16 yawMax) { s16 dummyPitch, yaw; f32 distCamToMario; s16 yawFromAbs; @@ -7768,7 +7735,7 @@ BAD_RETURN(s32) star_dance_bound_yaw(struct Camera *c, s16 absYaw, s16 yawMax) { * Start the closeup dance cutscene by restricting the camera's yaw in certain areas. * Store the camera's focus in cvar9. */ -BAD_RETURN(s32) cutscene_dance_closeup_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup_start(struct Camera* c) { UNUSED u8 filler[8]; if ((gLastCompletedStarNum == 4) && (gCurrCourseNum == COURSE_JRB)) { @@ -7789,7 +7756,7 @@ BAD_RETURN(s32) cutscene_dance_closeup_start(struct Camera *c) { /** * Focus the camera on Mario eye height. */ -BAD_RETURN(s32) cutscene_dance_closeup_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup_focus_mario(struct Camera* c) { Vec3f marioPos; vec3f_set(marioPos, sMarioCamState->pos[0], sMarioCamState->pos[1] + 125.f, sMarioCamState->pos[2]); @@ -7800,7 +7767,7 @@ BAD_RETURN(s32) cutscene_dance_closeup_focus_mario(struct Camera *c) { /** * Fly above Mario, looking down. */ -BAD_RETURN(s32) cutscene_dance_closeup_fly_above(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup_fly_above(struct Camera* c) { s16 pitch, yaw; f32 dist; s16 goalPitch = 0x1800; @@ -7820,7 +7787,7 @@ BAD_RETURN(s32) cutscene_dance_closeup_fly_above(struct Camera *c) { /** * Fly closer right when Mario gives the peace sign. */ -BAD_RETURN(s32) cutscene_dance_closeup_fly_closer(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup_fly_closer(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -7834,21 +7801,21 @@ BAD_RETURN(s32) cutscene_dance_closeup_fly_closer(struct Camera *c) { /** * Zoom in by increasing fov to 80 degrees. Most dramatic zoom in the game. */ -BAD_RETURN(s32) cutscene_dance_closeup_zoom(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup_zoom(UNUSED struct Camera* c) { set_fov_function(CAM_FOV_APP_80); } /** * Shake fov, starts on the first frame Mario has the peace sign up. */ -BAD_RETURN(s32) cutscene_dance_closeup_shake_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup_shake_fov(UNUSED struct Camera* c) { set_fov_shake(0x300, 0x30, 0x8000); } /** * The camera moves in for a closeup on Mario. Used for stars that are underwater or in tight places. */ -BAD_RETURN(s32) cutscene_dance_closeup(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_closeup(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; if (sMarioCamState->action == ACT_STAR_DANCE_WATER) { @@ -7873,7 +7840,7 @@ BAD_RETURN(s32) cutscene_dance_closeup(struct Camera *c) { /** * cvar8.point[2] is the amount to increase distance from Mario */ -BAD_RETURN(s32) cutscene_dance_fly_away_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_away_start(struct Camera* c) { Vec3f areaCenter; vec3f_copy(sCutsceneVars[9].point, c->focus); @@ -7890,17 +7857,17 @@ BAD_RETURN(s32) cutscene_dance_fly_away_start(struct Camera *c) { star_dance_bound_yaw(c, 0x5600, 0x800); } if ((gLastCompletedStarNum == 2) && (gCurrCourseNum == COURSE_TTM)) { - star_dance_bound_yaw(c, 0x0, 0x800); + star_dance_bound_yaw(c, 0x0, 0x800); } if ((gLastCompletedStarNum == 1) && (gCurrCourseNum == COURSE_SL)) { star_dance_bound_yaw(c, 0x2000, 0x800); } if ((gLastCompletedStarNum == 3) && (gCurrCourseNum == COURSE_RR)) { - star_dance_bound_yaw(c, 0x0, 0x800); + star_dance_bound_yaw(c, 0x0, 0x800); } } -BAD_RETURN(s32) cutscene_dance_fly_away_approach_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_away_approach_mario(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -7911,7 +7878,7 @@ BAD_RETURN(s32) cutscene_dance_fly_away_approach_mario(struct Camera *c) { vec3f_set_dist_and_angle(sMarioCamState->pos, c->pos, dist, pitch, yaw); } -BAD_RETURN(s32) cutscene_dance_fly_away_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_away_focus_mario(struct Camera* c) { Vec3f marioPos; vec3f_set(marioPos, sMarioCamState->pos[0], sMarioCamState->pos[1] + 125.f, sMarioCamState->pos[2]); @@ -7922,7 +7889,7 @@ BAD_RETURN(s32) cutscene_dance_fly_away_focus_mario(struct Camera *c) { /** * Slowly pan the camera downwards and to the camera's right, using cvar9's angle. */ -void cutscene_pan_cvar9(struct Camera *c) { +void cutscene_pan_cvar9(struct Camera* c) { vec3f_copy(c->focus, sCutsceneVars[9].point); sCutsceneVars[9].angle[0] -= 29; sCutsceneVars[9].angle[1] += 29; @@ -7932,7 +7899,7 @@ void cutscene_pan_cvar9(struct Camera *c) { /** * Move backwards and rotate slowly around Mario. */ -BAD_RETURN(s32) cutscene_dance_fly_rotate_around_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_rotate_around_mario(struct Camera* c) { cutscene_pan_cvar9(c); rotate_and_move_vec3f(c->pos, sMarioCamState->pos, sCutsceneVars[8].point[2], 0, 0); } @@ -7940,18 +7907,18 @@ BAD_RETURN(s32) cutscene_dance_fly_rotate_around_mario(struct Camera *c) { /** * Rotate quickly while Lakitu flies up. */ -BAD_RETURN(s32) cutscene_dance_fly_away_rotate_while_flying(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_away_rotate_while_flying(struct Camera* c) { rotate_and_move_vec3f(c->pos, sMarioCamState->pos, 0, 0, 0x80); } -BAD_RETURN(s32) cutscene_dance_fly_away_shake_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_away_shake_fov(UNUSED struct Camera* c) { set_fov_shake(0x400, 0x30, 0x8000); } /** * After collecting the star, Lakitu flies upwards out of the course. */ -BAD_RETURN(s32) cutscene_dance_fly_away(struct Camera *c) { +BAD_RETURN(s32) cutscene_dance_fly_away(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; cutscene_event(cutscene_dance_fly_away_start, c, 0, 0); cutscene_event(cutscene_dance_fly_away_focus_mario, c, 0, 30); @@ -7967,7 +7934,7 @@ BAD_RETURN(s32) cutscene_dance_fly_away(struct Camera *c) { * Jump the camera pos and focus to cvar 8 and 7. * Called every frame, starting after 10, so when these cvars are updated, the camera will jump. */ -BAD_RETURN(s32) cutscene_key_dance_jump_cvar(struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_jump_cvar(struct Camera* c) { offset_rotated(c->pos, sMarioCamState->pos, sCutsceneVars[8].point, sMarioCamState->faceAngle); offset_rotated(c->focus, sMarioCamState->pos, sCutsceneVars[7].point, sMarioCamState->faceAngle); } @@ -7975,7 +7942,7 @@ BAD_RETURN(s32) cutscene_key_dance_jump_cvar(struct Camera *c) { /** * Jump to a closeup view of Mario and the key. */ -BAD_RETURN(s32) cutscene_key_dance_jump_closeup(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_jump_closeup(UNUSED struct Camera* c) { vec3f_set(sCutsceneVars[8].point, 38.f, 171.f, -248.f); vec3f_set(sCutsceneVars[7].point, -57.f, 51.f, 187.f); } @@ -7983,7 +7950,7 @@ BAD_RETURN(s32) cutscene_key_dance_jump_closeup(UNUSED struct Camera *c) { /** * Jump to a view from the lower left (Mario's right). */ -BAD_RETURN(s32) cutscene_key_dance_jump_lower_left(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_jump_lower_left(UNUSED struct Camera* c) { vec3f_set(sCutsceneVars[8].point, -178.f, 62.f, -132.f); vec3f_set(sCutsceneVars[7].point, 299.f, 91.f, 58.f); } @@ -7991,7 +7958,7 @@ BAD_RETURN(s32) cutscene_key_dance_jump_lower_left(UNUSED struct Camera *c) { /** * Jump to a rotated view from above. */ -BAD_RETURN(s32) cutscene_key_dance_jump_above(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_jump_above(UNUSED struct Camera* c) { gLakituState.keyDanceRoll = 0x2800; vec3f_set(sCutsceneVars[8].point, 89.f, 373.f, -304.f); vec3f_set(sCutsceneVars[7].point, 0.f, 127.f, 0.f); @@ -8000,21 +7967,21 @@ BAD_RETURN(s32) cutscene_key_dance_jump_above(UNUSED struct Camera *c) { /** * Finally, jump to a further view, slightly to Mario's left. */ -BAD_RETURN(s32) cutscene_key_dance_jump_last(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_jump_last(UNUSED struct Camera* c) { gLakituState.keyDanceRoll = 0; vec3f_set(sCutsceneVars[8].point, 135.f, 158.f, -673.f); vec3f_set(sCutsceneVars[7].point, -20.f, 135.f, -198.f); } -BAD_RETURN(s32) cutscene_key_dance_shake_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_shake_fov(UNUSED struct Camera* c) { set_fov_shake(0x180, 0x30, 0x8000); } -BAD_RETURN(s32) cutscene_key_dance_handheld_shake(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_handheld_shake(UNUSED struct Camera* c) { set_handheld_shake(HAND_CAM_SHAKE_CUTSCENE); } -BAD_RETURN(s32) cutscene_key_dance_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance_focus_mario(struct Camera* c) { focus_in_front_of_mario(c, 0, 0.2f); } @@ -8022,7 +7989,7 @@ BAD_RETURN(s32) cutscene_key_dance_focus_mario(struct Camera *c) { * Cutscene that plays when Mario collects a key from bowser. It's basically a sequence of four jump * cuts. */ -BAD_RETURN(s32) cutscene_key_dance(struct Camera *c) { +BAD_RETURN(s32) cutscene_key_dance(struct Camera* c) { cutscene_event(cutscene_dance_move_to_mario, c, 0, 10); cutscene_event(cutscene_key_dance_focus_mario, c, 0, 10); cutscene_event(cutscene_key_dance_jump_closeup, c, 0, 0); @@ -8034,14 +8001,14 @@ BAD_RETURN(s32) cutscene_key_dance(struct Camera *c) { cutscene_event(cutscene_key_dance_handheld_shake, c, 52, -1); } -BAD_RETURN(s32) cutscene_bowser_area_shake_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_area_shake_fov(UNUSED struct Camera* c) { cutscene_set_fov_shake_preset(2); } /** * Set oBowserCamAct to 1, which causes bowser to start walking. */ -BAD_RETURN(s32) cutscene_bowser_area_start_bowser_walking(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_area_start_bowser_walking(UNUSED struct Camera* c) { gSecondCameraFocus->oBowserCamAct = BOWSER_CAM_ACT_WALK; } @@ -8050,18 +8017,17 @@ BAD_RETURN(s32) cutscene_bowser_area_start_bowser_walking(UNUSED struct Camera * * @bug cvar2.point is (0,0,0) on the first frame, but because of the warp transition, this behavior * isn't seen. After the first frame, cvar2.point is bowser's position. */ -BAD_RETURN(s32) cutscene_bowser_arena_set_pos(struct Camera *c) { - vec3f_set_dist_and_angle(sCutsceneVars[2].point, c->pos, sCutsceneVars[3].point[2], - sCutsceneVars[3].angle[0], sCutsceneVars[3].angle[1]); - vec3f_set(sCutsceneVars[2].point, gSecondCameraFocus->oPosX, gSecondCameraFocus->oPosY, - gSecondCameraFocus->oPosZ); +BAD_RETURN(s32) cutscene_bowser_arena_set_pos(struct Camera* c) { + vec3f_set_dist_and_angle(sCutsceneVars[2].point, c->pos, sCutsceneVars[3].point[2], sCutsceneVars[3].angle[0], + sCutsceneVars[3].angle[1]); + vec3f_set(sCutsceneVars[2].point, gSecondCameraFocus->oPosX, gSecondCameraFocus->oPosY, gSecondCameraFocus->oPosZ); } /** * Apply a sine wave to the focus's y coordinate. * The y offset starts at 120, then decreases to 0 before reaching ~240 on the last frame. */ -BAD_RETURN(s32) cutscene_bowser_arena_focus_sine(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_focus_sine(UNUSED struct Camera* c) { //! unused initialization f32 yOff = 150.0f; @@ -8074,7 +8040,7 @@ BAD_RETURN(s32) cutscene_bowser_arena_focus_sine(UNUSED struct Camera *c) { /** * Set the camera focus according to cvar0 and cvar2. */ -BAD_RETURN(s32) cutscene_bowser_arena_set_focus(struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_set_focus(struct Camera* c) { offset_rotated(c->focus, sCutsceneVars[2].point, sCutsceneVars[0].point, sCutsceneVars[2].angle); } @@ -8082,7 +8048,7 @@ BAD_RETURN(s32) cutscene_bowser_arena_set_focus(struct Camera *c) { * Adjust the cvar offsets, making the camera look up, move slightly further back, and focus a little * further in front of bowser. */ -BAD_RETURN(s32) cutscene_bowser_arena_adjust_offsets(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_adjust_offsets(UNUSED struct Camera* c) { approach_s16_asymptotic_bool(&sCutsceneVars[3].angle[0], 0x6C8, 30); approach_f32_asymptotic_bool(&sCutsceneVars[0].point[2], -200.f, 0.02f); approach_f32_asymptotic_bool(&sCutsceneVars[3].point[2], 550.f, 0.02f); @@ -8091,18 +8057,18 @@ BAD_RETURN(s32) cutscene_bowser_arena_adjust_offsets(UNUSED struct Camera *c) { /** * Decrease cvar0's z offset, making the camera focus pan left towards bowser. */ -BAD_RETURN(s32) cutscene_bowser_arena_pan_left(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_pan_left(UNUSED struct Camera* c) { approach_f32_asymptotic_bool(&sCutsceneVars[0].point[2], 0.f, 0.05f); } /** * Duplicate of cutscene_mario_dialog(). */ -BAD_RETURN(s32) cutscene_bowser_arena_mario_dialog(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_mario_dialog(UNUSED struct Camera* c) { cutscene_common_set_dialog_state(MARIO_DIALOG_LOOK_FRONT); } -void cutscene_stop_dialog(UNUSED struct Camera *c) { +void cutscene_stop_dialog(UNUSED struct Camera* c) { cutscene_common_set_dialog_state(MARIO_DIALOG_STOP); } @@ -8113,7 +8079,7 @@ void cutscene_stop_dialog(UNUSED struct Camera *c) { * * cvar0 is the focus offset from bowser */ -BAD_RETURN(s32) cutscene_bowser_arena_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_start(struct Camera* c) { sCutsceneVars[3].point[2] = 430.f; sCutsceneVars[3].angle[1] = gSecondCameraFocus->oMoveAngleYaw - DEGREES(45); sCutsceneVars[3].angle[0] = 0xD90; @@ -8123,8 +8089,8 @@ BAD_RETURN(s32) cutscene_bowser_arena_start(struct Camera *c) { //! BUT because offset_rotated() flips the Z direction (to match sm64's coordinate system), this //! offset actually moves the focus to (0, 427, -200) vec3f_set(sCutsceneVars[0].point, 0.f, 120.f, -800.f); - vec3s_set(sCutsceneVars[2].angle, gSecondCameraFocus->oMoveAnglePitch, - gSecondCameraFocus->oMoveAngleYaw, gSecondCameraFocus->oMoveAngleRoll); + vec3s_set(sCutsceneVars[2].angle, gSecondCameraFocus->oMoveAnglePitch, gSecondCameraFocus->oMoveAngleYaw, + gSecondCameraFocus->oMoveAngleRoll); // Set the camera's position and focus. cutscene_bowser_arena_set_pos(c); @@ -8134,7 +8100,7 @@ BAD_RETURN(s32) cutscene_bowser_arena_start(struct Camera *c) { /** * Create the dialog box depending on which bowser fight Mario is in. */ -BAD_RETURN(s32) bowser_fight_intro_dialog(UNUSED struct Camera *c) { +BAD_RETURN(s32) bowser_fight_intro_dialog(UNUSED struct Camera* c) { s16 dialog; switch (gCurrLevelNum) { @@ -8154,7 +8120,7 @@ BAD_RETURN(s32) bowser_fight_intro_dialog(UNUSED struct Camera *c) { /** * Create the dialog box and wait until it's gone. */ -BAD_RETURN(s32) cutscene_bowser_arena_dialog(struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_dialog(struct Camera* c) { cutscene_event(bowser_fight_intro_dialog, c, 0, 0); if (get_dialog_id() == DIALOG_NONE) { @@ -8165,7 +8131,7 @@ BAD_RETURN(s32) cutscene_bowser_arena_dialog(struct Camera *c) { /** * End the bowser arena cutscene. */ -BAD_RETURN(s32) cutscene_bowser_arena_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena_end(struct Camera* c) { cutscene_stop_dialog(c); c->cutscene = 0; transition_next_state(c, 20); @@ -8177,7 +8143,7 @@ BAD_RETURN(s32) cutscene_bowser_arena_end(struct Camera *c) { /** * Cutscene that plays when Mario enters a bowser fight. */ -BAD_RETURN(s32) cutscene_bowser_arena(struct Camera *c) { +BAD_RETURN(s32) cutscene_bowser_arena(struct Camera* c) { //! This does nothing, but may have been used in development cutscene_spawn_obj(2, 0); @@ -8198,14 +8164,14 @@ BAD_RETURN(s32) cutscene_bowser_arena(struct Camera *c) { } } -BAD_RETURN(s32) cutscene_star_spawn_store_info(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn_store_info(struct Camera* c) { store_info_star(c); } /** * Focus on the top of the star. */ -BAD_RETURN(s32) cutscene_star_spawn_focus_star(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn_focus_star(struct Camera* c) { UNUSED u8 filler1[4]; // hMul? Vec3f starPos; UNUSED u8 filler2[4]; // vMul? @@ -8220,7 +8186,7 @@ BAD_RETURN(s32) cutscene_star_spawn_focus_star(struct Camera *c) { /** * Use boss fight mode's update function to move the focus back. */ -BAD_RETURN(s32) cutscene_star_spawn_update_boss_fight(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn_update_boss_fight(struct Camera* c) { Vec3f pos, focus; update_boss_fight_camera(c, focus, pos); @@ -8231,7 +8197,7 @@ BAD_RETURN(s32) cutscene_star_spawn_update_boss_fight(struct Camera *c) { /** * Fly back to the camera's previous pos and focus. */ -BAD_RETURN(s32) cutscene_star_spawn_fly_back(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn_fly_back(struct Camera* c) { retrieve_info_star(c); transition_next_state(c, 15); } @@ -8239,7 +8205,7 @@ BAD_RETURN(s32) cutscene_star_spawn_fly_back(struct Camera *c) { /** * Plays when a star spawns (ie from a box). */ -BAD_RETURN(s32) cutscene_star_spawn(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn(struct Camera* c) { cutscene_event(cutscene_star_spawn_store_info, c, 0, 0); cutscene_event(cutscene_star_spawn_focus_star, c, 0, -1); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; @@ -8253,7 +8219,7 @@ BAD_RETURN(s32) cutscene_star_spawn(struct Camera *c) { /** * Move the camera back to Mario. */ -BAD_RETURN(s32) cutscene_star_spawn_back(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn_back(struct Camera* c) { if ((c->mode == CAMERA_MODE_BOSS_FIGHT) && (set_cam_angle(0) == CAM_ANGLE_LAKITU)) { cutscene_event(cutscene_star_spawn_update_boss_fight, c, 0, -1); } else { @@ -8264,13 +8230,13 @@ BAD_RETURN(s32) cutscene_star_spawn_back(struct Camera *c) { sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; } -BAD_RETURN(s32) cutscene_star_spawn_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_star_spawn_end(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; } -BAD_RETURN(s32) cutscene_exit_waterfall_warp(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_waterfall_warp(struct Camera* c) { //! hardcoded position vec3f_set(c->pos, -3899.f, 39.f, -5671.f); } @@ -8278,7 +8244,7 @@ BAD_RETURN(s32) cutscene_exit_waterfall_warp(struct Camera *c) { /** * Look at Mario, used by cutscenes that play when Mario exits a course to castle grounds. */ -BAD_RETURN(s32) cutscene_exit_to_castle_grounds_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_to_castle_grounds_focus_mario(struct Camera* c) { vec3f_copy(c->focus, sMarioCamState->pos); c->focus[1] = c->pos[1] + (sMarioCamState->pos[1] + 125.f - c->pos[1]) * 0.5f; approach_vec3f_asymptotic(c->focus, sMarioCamState->pos, 0.05f, 0.4f, 0.05f); @@ -8287,7 +8253,7 @@ BAD_RETURN(s32) cutscene_exit_to_castle_grounds_focus_mario(struct Camera *c) { /** * Cutscene that plays when Mario leaves CotMC through the waterfall. */ -BAD_RETURN(s32) cutscene_exit_waterfall(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_waterfall(struct Camera* c) { cutscene_event(cutscene_exit_waterfall_warp, c, 0, 0); cutscene_event(cutscene_exit_to_castle_grounds_focus_mario, c, 0, -1); update_camera_yaw(c); @@ -8296,14 +8262,14 @@ BAD_RETURN(s32) cutscene_exit_waterfall(struct Camera *c) { /** * End the cutscene, used by cutscenes that play when Mario exits a course to castle grounds. */ -BAD_RETURN(s32) cutscene_exit_to_castle_grounds_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_to_castle_grounds_end(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; update_camera_yaw(c); } -BAD_RETURN(s32) cutscene_exit_fall_to_castle_grounds_warp(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_fall_to_castle_grounds_warp(struct Camera* c) { //! hardcoded position vec3f_set(c->pos, 5830.f, 32.f, 3985.f); } @@ -8311,7 +8277,7 @@ BAD_RETURN(s32) cutscene_exit_fall_to_castle_grounds_warp(struct Camera *c) { /** * Cutscene that plays when Mario falls from WMOTR. */ -BAD_RETURN(s32) cutscene_exit_fall_to_castle_grounds(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_fall_to_castle_grounds(struct Camera* c) { cutscene_event(cutscene_exit_fall_to_castle_grounds_warp, c, 0, 0); cutscene_event(cutscene_exit_to_castle_grounds_focus_mario, c, 0, -1); update_camera_yaw(c); @@ -8320,7 +8286,7 @@ BAD_RETURN(s32) cutscene_exit_fall_to_castle_grounds(struct Camera *c) { /** * Start the red coin star spawning cutscene. */ -BAD_RETURN(s32) cutscene_red_coin_star_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_start(struct Camera* c) { object_pos_to_vec3f(sCutsceneVars[1].point, gCutsceneFocus); store_info_star(c); // Store the default fov for after the cutscene @@ -8330,7 +8296,7 @@ BAD_RETURN(s32) cutscene_red_coin_star_start(struct Camera *c) { /** * Look towards the star's x and z position */ -BAD_RETURN(s32) cutscene_red_coin_star_focus_xz(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_focus_xz(struct Camera* c) { approach_f32_asymptotic_bool(&c->focus[0], gCutsceneFocus->oPosX, 0.15f); approach_f32_asymptotic_bool(&c->focus[2], gCutsceneFocus->oPosZ, 0.15f); } @@ -8338,24 +8304,24 @@ BAD_RETURN(s32) cutscene_red_coin_star_focus_xz(struct Camera *c) { /** * Look towards the star's y position. Only active before the camera warp. */ -BAD_RETURN(s32) cutscene_red_coin_star_focus_y(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_focus_y(struct Camera* c) { approach_f32_asymptotic_bool(&c->focus[1], gCutsceneFocus->oPosY, 0.1f); } /** * Look 80% up towards the star. Only active after the camera warp. */ -BAD_RETURN(s32) cutscene_red_coin_star_look_up_at_star(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_look_up_at_star(struct Camera* c) { c->focus[1] = sCutsceneVars[1].point[1] + (gCutsceneFocus->oPosY - sCutsceneVars[1].point[1]) * 0.8f; } /** * Warp the camera near the star's spawn point */ -BAD_RETURN(s32) cutscene_red_coin_star_warp(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_warp(struct Camera* c) { f32 dist; s16 pitch, yaw, posYaw; - struct Object *o = gCutsceneFocus; + struct Object* o = gCutsceneFocus; vec3f_set(sCutsceneVars[1].point, o->oHomeX, o->oHomeY, o->oHomeZ); vec3f_get_dist_and_angle(sCutsceneVars[1].point, c->pos, &dist, &pitch, &yaw); @@ -8375,11 +8341,11 @@ BAD_RETURN(s32) cutscene_red_coin_star_warp(struct Camera *c) { /** * Zoom out while looking at the star. */ -BAD_RETURN(s32) cutscene_red_coin_star_set_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_set_fov(UNUSED struct Camera* c) { sFOVState.fov = 60.f; } -BAD_RETURN(s32) cutscene_red_coin_star(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; cutscene_event(cutscene_red_coin_star_start, c, 0, 0); cutscene_event(cutscene_red_coin_star_warp, c, 30, 30); @@ -8397,7 +8363,7 @@ BAD_RETURN(s32) cutscene_red_coin_star(struct Camera *c) { /** * End the red coin star spawning cutscene */ -BAD_RETURN(s32) cutscene_red_coin_star_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_red_coin_star_end(struct Camera* c) { retrieve_info_star(c); gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; @@ -8414,7 +8380,7 @@ BAD_RETURN(s32) cutscene_red_coin_star_end(struct Camera *c) { * @param rotPitch constant pitch offset to add to the camera's focus * @param rotYaw constant yaw offset to add to the camera's focus */ -void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 rotPitch, s16 rotYaw) { +void cutscene_goto_cvar_pos(struct Camera* c, f32 goalDist, s16 goalPitch, s16 rotPitch, s16 rotYaw) { UNUSED u8 filler[4]; f32 nextDist; s16 nextPitch, nextYaw; @@ -8435,8 +8401,7 @@ void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 r sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; if (gCurrLevelNum == LEVEL_TTM) { - nextYaw = atan2s(sCutsceneVars[3].point[2] - c->areaCenZ, - sCutsceneVars[3].point[0] - c->areaCenX); + nextYaw = atan2s(sCutsceneVars[3].point[2] - c->areaCenZ, sCutsceneVars[3].point[0] - c->areaCenX); } } else { if (c->cutscene == CUTSCENE_PREPARE_CANNON) { @@ -8475,7 +8440,7 @@ void cutscene_goto_cvar_pos(struct Camera *c, f32 goalDist, s16 goalPitch, s16 r /** * Store the camera's pos and focus, and copy the cannon's position to cvars. */ -BAD_RETURN(s32) cutscene_prepare_cannon_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_prepare_cannon_start(struct Camera* c) { store_info_cannon(c); vec3f_copy(sCutsceneVars[0].point, c->focus); sCutsceneVars[2].point[0] = 30.f; @@ -8487,7 +8452,7 @@ BAD_RETURN(s32) cutscene_prepare_cannon_start(struct Camera *c) { /** * Fly towards the cannon door. */ -BAD_RETURN(s32) cutscene_prepare_cannon_fly_to_cannon(struct Camera *c) { +BAD_RETURN(s32) cutscene_prepare_cannon_fly_to_cannon(struct Camera* c) { cutscene_goto_cvar_pos(c, 300.f, 0x2000, 0, sCutsceneVars[5].angle[1]); camera_approach_s16_symmetric_bool(&sCutsceneVars[5].angle[1], 0x400, 17); set_handheld_shake(HAND_CAM_SHAKE_CUTSCENE); @@ -8496,7 +8461,7 @@ BAD_RETURN(s32) cutscene_prepare_cannon_fly_to_cannon(struct Camera *c) { /** * Used in the cannon opening cutscene to fly back to the camera's last position and focus */ -void cannon_approach_prev(f32 *value, f32 target) { +void cannon_approach_prev(f32* value, f32 target) { f32 inc = ABS(target - *value) / sCutsceneVars[2].point[0]; camera_approach_f32_symmetric_bool(value, target, inc); } @@ -8504,7 +8469,7 @@ void cannon_approach_prev(f32 *value, f32 target) { /** * Fly or warp back to the previous pos and focus, stored in sCameraStoreCutscene. */ -BAD_RETURN(s32) cutscene_prepare_cannon_fly_back(struct Camera *c) { +BAD_RETURN(s32) cutscene_prepare_cannon_fly_back(struct Camera* c) { f32 distToPrevPos = calc_abs_dist(c->pos, sCameraStoreCutscene.pos); if (distToPrevPos < 8000.f) { @@ -8528,7 +8493,7 @@ BAD_RETURN(s32) cutscene_prepare_cannon_fly_back(struct Camera *c) { /** * Cutscene that plays when the cannon is opened. */ -BAD_RETURN(s32) cutscene_prepare_cannon(struct Camera *c) { +BAD_RETURN(s32) cutscene_prepare_cannon(struct Camera* c) { sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; cutscene_event(cutscene_prepare_cannon_start, c, 0, 0); cutscene_event(cutscene_prepare_cannon_fly_to_cannon, c, 0, 140); @@ -8538,7 +8503,7 @@ BAD_RETURN(s32) cutscene_prepare_cannon(struct Camera *c) { /** * Stop the cannon opening cutscene. */ -BAD_RETURN(s32) cutscene_prepare_cannon_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_prepare_cannon_end(struct Camera* c) { gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; retrieve_info_cannon(c); @@ -8550,7 +8515,7 @@ BAD_RETURN(s32) cutscene_prepare_cannon_end(struct Camera *c) { * Note that ACT_WATER_DEATH only starts when Mario gets hit by an enemy under water. It does not start * when Mario drowns. */ -void water_death_move_to_mario_side(struct Camera *c) { +void water_death_move_to_mario_side(struct Camera* c) { f32 dist; s16 pitch, yaw; @@ -8562,11 +8527,11 @@ void water_death_move_to_mario_side(struct Camera *c) { /** * Unnecessary, only used in cutscene_death_standing_goto_mario() */ -void death_goto_mario(struct Camera *c) { +void death_goto_mario(struct Camera* c) { cutscene_goto_cvar_pos(c, 400.f, 0x1000, 0x300, 0); } -BAD_RETURN(s32) cutscene_death_standing_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_death_standing_start(struct Camera* c) { vec3f_copy(sCutsceneVars[0].point, c->focus); vec3f_copy(sCutsceneVars[3].point, sMarioCamState->pos); sCutsceneVars[3].point[1] += 70.f; @@ -8575,7 +8540,7 @@ BAD_RETURN(s32) cutscene_death_standing_start(struct Camera *c) { /** * Fly to Mario and turn on handheld shake. */ -BAD_RETURN(s32) cutscene_death_standing_goto_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_death_standing_goto_mario(struct Camera* c) { death_goto_mario(c); set_handheld_shake(HAND_CAM_SHAKE_HIGH); } @@ -8583,55 +8548,55 @@ BAD_RETURN(s32) cutscene_death_standing_goto_mario(struct Camera *c) { /** * Cutscene that plays when Mario dies while standing. */ -BAD_RETURN(s32) cutscene_death_standing(struct Camera *c) { +BAD_RETURN(s32) cutscene_death_standing(struct Camera* c) { cutscene_event(cutscene_death_standing_start, c, 0, 0); cutscene_event(cutscene_death_standing_goto_mario, c, 0, -1); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; } -BAD_RETURN(s32) cutscene_death_stomach_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_death_stomach_start(struct Camera* c) { Vec3f offset = { 0, 40.f, -60.f }; offset_rotated(sCutsceneVars[3].point, sMarioCamState->pos, offset, sMarioCamState->faceAngle); vec3f_copy(sCutsceneVars[0].point, c->focus); } -BAD_RETURN(s32) cutscene_death_stomach_goto_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_death_stomach_goto_mario(struct Camera* c) { cutscene_goto_cvar_pos(c, 400.f, 0x1800, 0, -0x400); } /** * Ah, yes */ -UNUSED static void unused_water_death_move_to_side_of_mario(struct Camera *c) { +UNUSED static void unused_water_death_move_to_side_of_mario(struct Camera* c) { water_death_move_to_mario_side(c); } /** * Cutscene that plays when Mario dies on his stomach. */ -BAD_RETURN(s32) cutscene_death_stomach(struct Camera *c) { +BAD_RETURN(s32) cutscene_death_stomach(struct Camera* c) { cutscene_event(cutscene_death_stomach_start, c, 0, 0); cutscene_event(cutscene_death_stomach_goto_mario, c, 0, -1); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; set_handheld_shake(HAND_CAM_SHAKE_CUTSCENE); } -BAD_RETURN(s32) cutscene_bbh_death_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_bbh_death_start(struct Camera* c) { Vec3f dir = { 0, 40.f, 60.f }; offset_rotated(sCutsceneVars[3].point, sMarioCamState->pos, dir, sMarioCamState->faceAngle); vec3f_copy(sCutsceneVars[0].point, c->focus); } -BAD_RETURN(s32) cutscene_bbh_death_goto_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_bbh_death_goto_mario(struct Camera* c) { cutscene_goto_cvar_pos(c, 400.f, 0x1800, 0, 0x400); } /** * Cutscene that plays when Mario dies in BBH. */ -BAD_RETURN(s32) cutscene_bbh_death(struct Camera *c) { +BAD_RETURN(s32) cutscene_bbh_death(struct Camera* c) { cutscene_event(cutscene_bbh_death_start, c, 0, 0); cutscene_event(cutscene_bbh_death_goto_mario, c, 0, -1); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; @@ -8641,14 +8606,14 @@ BAD_RETURN(s32) cutscene_bbh_death(struct Camera *c) { /** * Copy the camera's focus to cvar0 */ -BAD_RETURN(s32) cutscene_quicksand_death_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_quicksand_death_start(struct Camera* c) { vec3f_copy(sCutsceneVars[0].point, c->focus); } /** * Fly closer to Mario. In WATER_DEATH, move to Mario's side. */ -BAD_RETURN(s32) cutscene_quicksand_death_goto_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_quicksand_death_goto_mario(struct Camera* c) { cutscene_goto_cvar_pos(c, 400.f, 0x2800, 0x200, 0); if (c->cutscene == CUTSCENE_WATER_DEATH) { @@ -8659,7 +8624,7 @@ BAD_RETURN(s32) cutscene_quicksand_death_goto_mario(struct Camera *c) { /** * Cutscene that plays when Mario dies in quicksand. */ -BAD_RETURN(s32) cutscene_quicksand_death(struct Camera *c) { +BAD_RETURN(s32) cutscene_quicksand_death(struct Camera* c) { sCutsceneVars[3].point[0] = sMarioCamState->pos[0]; sCutsceneVars[3].point[1] = sMarioCamState->pos[1] + 20.f; sCutsceneVars[3].point[2] = sMarioCamState->pos[2]; @@ -8673,7 +8638,7 @@ BAD_RETURN(s32) cutscene_quicksand_death(struct Camera *c) { /** * Fly away from Mario near the end of the cutscene. */ -BAD_RETURN(s32) cutscene_suffocation_fly_away(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_suffocation_fly_away(UNUSED struct Camera* c) { Vec3f target; Vec3f offset = { 0, 20.f, 120.f }; @@ -8684,7 +8649,7 @@ BAD_RETURN(s32) cutscene_suffocation_fly_away(UNUSED struct Camera *c) { /** * Keep Lakitu above the gas level. */ -BAD_RETURN(s32) cutscene_suffocation_stay_above_gas(struct Camera *c) { +BAD_RETURN(s32) cutscene_suffocation_stay_above_gas(struct Camera* c) { UNUSED u8 filler1[4]; f32 gasLevel; UNUSED u8 filler2[4]; @@ -8702,7 +8667,7 @@ BAD_RETURN(s32) cutscene_suffocation_stay_above_gas(struct Camera *c) { /** * Quickly rotate around Mario. */ -BAD_RETURN(s32) cutscene_suffocation_rotate(struct Camera *c) { +BAD_RETURN(s32) cutscene_suffocation_rotate(struct Camera* c) { f32 dist; s16 pitch, yaw; @@ -8714,7 +8679,7 @@ BAD_RETURN(s32) cutscene_suffocation_rotate(struct Camera *c) { /** * Cutscene that plays when Mario dies from suffocation (ie due to HMC gas). */ -BAD_RETURN(s32) cutscene_suffocation(struct Camera *c) { +BAD_RETURN(s32) cutscene_suffocation(struct Camera* c) { cutscene_event(cutscene_death_stomach_start, c, 0, 0); cutscene_event(cutscene_suffocation_rotate, c, 0, -1); cutscene_event(cutscene_suffocation_stay_above_gas, c, 0, -1); @@ -8723,7 +8688,7 @@ BAD_RETURN(s32) cutscene_suffocation(struct Camera *c) { set_handheld_shake(HAND_CAM_SHAKE_HIGH); } -BAD_RETURN(s32) cutscene_enter_pool_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_pool_start(struct Camera* c) { vec3f_copy(sCutsceneVars[3].point, sMarioCamState->pos); if (gCurrLevelNum == LEVEL_CASTLE) { // entering HMC @@ -8736,13 +8701,13 @@ BAD_RETURN(s32) cutscene_enter_pool_start(struct Camera *c) { vec3f_copy(sCutsceneVars[0].point, c->focus); } -BAD_RETURN(s32) cutscene_enter_pool_loop(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_pool_loop(struct Camera* c) { UNUSED u8 filler[8]; cutscene_goto_cvar_pos(c, 1200.f, 0x2000, 0x200, 0); } -BAD_RETURN(s32) cutscene_enter_pool(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_pool(struct Camera* c) { cutscene_event(cutscene_enter_pool_start, c, 0, 0); cutscene_event(cutscene_enter_pool_loop, c, 0, -1); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; @@ -8752,7 +8717,7 @@ BAD_RETURN(s32) cutscene_enter_pool(struct Camera *c) { * Store the camera focus in cvar1. * Store the area's center position (which happens to be the pyramid, in SSL) in cvar3. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_start(struct Camera* c) { reset_pan_distance(c); store_info_cannon(c); @@ -8763,14 +8728,14 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode_start(struct Camera *c) { /** * Zoom in on the pyramid. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_zoom_in(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_zoom_in(UNUSED struct Camera* c) { set_fov_function(CAM_FOV_APP_30); } /** * Look at the pyramid top. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_focus(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_focus(struct Camera* c) { approach_vec3f_asymptotic(c->focus, sCutsceneVars[3].point, 0.02f, 0.02f, 0.02f); sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; } @@ -8778,7 +8743,7 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode_focus(struct Camera *c) { /** * Store the old pos and focus, then warp to the pyramid top. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_warp(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_warp(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -8797,7 +8762,7 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode_warp(struct Camera *c) { /** * Close up view of the spinning pyramid top as it rises. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_closeup(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_closeup(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -8814,14 +8779,14 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode_closeup(struct Camera *c) { /** * Shake the camera during the closeup. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_cam_shake(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_cam_shake(UNUSED struct Camera* c) { set_environmental_camera_shake(SHAKE_ENV_PYRAMID_EXPLODE); } /** * Warp back to the old position, and start a heavy camera shake. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_warp_back(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_warp_back(struct Camera* c) { UNUSED u8 filler[8]; vec3f_copy(c->pos, sCutsceneVars[4].point); @@ -8832,7 +8797,7 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode_warp_back(struct Camera *c) { /** * An unused cutscene for when the pyramid explodes. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode(struct Camera* c) { cutscene_event(cutscene_pyramid_top_explode_start, c, 0, 0); cutscene_event(cutscene_pyramid_top_explode_focus, c, 0, 30); cutscene_event(cutscene_pyramid_top_explode_warp, c, 31, 31); @@ -8845,7 +8810,7 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode(struct Camera *c) { /** * End the pyramid top explosion cutscene. */ -BAD_RETURN(s32) cutscene_pyramid_top_explode_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_pyramid_top_explode_end(struct Camera* c) { cutscene_stop_dialog(c); stop_cutscene_and_retrieve_stored_info(c); // Move the camera back to Mario @@ -8855,7 +8820,7 @@ BAD_RETURN(s32) cutscene_pyramid_top_explode_end(struct Camera *c) { /** * Store the camera focus in cvar0, and store the top of the pyramid in cvar3. */ -BAD_RETURN(s32) cutscene_enter_pyramid_top_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_pyramid_top_start(struct Camera* c) { vec3f_copy(sCutsceneVars[0].point, c->focus); vec3f_set(sCutsceneVars[3].point, c->areaCenX, 1280.f, c->areaCenZ); } @@ -8863,7 +8828,7 @@ BAD_RETURN(s32) cutscene_enter_pyramid_top_start(struct Camera *c) { /** * Cutscene that plays when Mario enters the top of the pyramid. */ -BAD_RETURN(s32) cutscene_enter_pyramid_top(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_pyramid_top(struct Camera* c) { cutscene_event(cutscene_enter_pyramid_top_start, c, 0, 0); // Move to cvar3 cutscene_goto_cvar_pos(c, 200.f, 0x3000, 0, 0); @@ -8877,7 +8842,7 @@ BAD_RETURN(s32) cutscene_enter_pyramid_top(struct Camera *c) { } } -UNUSED static void unused_cutscene_goto_cvar(struct Camera *c) { +UNUSED static void unused_cutscene_goto_cvar(struct Camera* c) { f32 dist; dist = calc_abs_dist(sCutsceneVars[3].point, sMarioCamState->pos); @@ -8891,7 +8856,7 @@ UNUSED static void unused_cutscene_goto_cvar(struct Camera *c) { * cvar9.point is gCutsceneFocus's position * cvar9.angle[1] is the yaw between Mario and the gCutsceneFocus */ -BAD_RETURN(s32) cutscene_dialog_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_dialog_start(struct Camera* c) { UNUSED u8 filler[4]; UNUSED s16 unused; s16 yaw; @@ -8899,7 +8864,7 @@ BAD_RETURN(s32) cutscene_dialog_start(struct Camera *c) { cutscene_soften_music(c); set_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG); - if(!ROM_JP && c->mode == CAMERA_MODE_BOSS_FIGHT) { + if (!ROM_JP && c->mode == CAMERA_MODE_BOSS_FIGHT) { vec3f_copy(sCameraStoreCutscene.focus, c->focus); vec3f_copy(sCameraStoreCutscene.pos, c->pos); } else { @@ -8928,7 +8893,7 @@ BAD_RETURN(s32) cutscene_dialog_start(struct Camera *c) { * Move closer to Mario and the object, adjusting to their difference in height. * The camera's generally ends up looking over Mario's shoulder. */ -BAD_RETURN(s32) cutscene_dialog_move_mario_shoulder(struct Camera *c) { +BAD_RETURN(s32) cutscene_dialog_move_mario_shoulder(struct Camera* c) { f32 dist; s16 pitch, yaw; Vec3f focus, pos; @@ -8951,8 +8916,7 @@ BAD_RETURN(s32) cutscene_dialog_move_mario_shoulder(struct Camera *c) { vec3f_set_dist_and_angle(sCutsceneVars[8].point, pos, dist, pitch, yaw); // Move up if Mario is below the focus object, down is Mario is above - pos[1] = sCutsceneVars[8].point[1] - + sins(calculate_pitch(sCutsceneVars[9].point, sCutsceneVars[8].point)) * 100.f; + pos[1] = sCutsceneVars[8].point[1] + sins(calculate_pitch(sCutsceneVars[9].point, sCutsceneVars[8].point)) * 100.f; approach_f32_asymptotic_bool(&c->pos[1], pos[1], 0.05f); c->pos[0] = pos[0]; @@ -8962,7 +8926,7 @@ BAD_RETURN(s32) cutscene_dialog_move_mario_shoulder(struct Camera *c) { /** * Create the dialog with sCutsceneDialogID */ -BAD_RETURN(s32) cutscene_dialog_create_dialog_box(struct Camera *c) { +BAD_RETURN(s32) cutscene_dialog_create_dialog_box(struct Camera* c) { if (c->cutscene == CUTSCENE_RACE_DIALOG) { create_dialog_box_with_response(sCutsceneDialogID); } else { @@ -8976,7 +8940,7 @@ BAD_RETURN(s32) cutscene_dialog_create_dialog_box(struct Camera *c) { /** * Cutscene that plays when Mario talks to an object. */ -BAD_RETURN(s32) cutscene_dialog(struct Camera *c) { +BAD_RETURN(s32) cutscene_dialog(struct Camera* c) { cutscene_event(cutscene_dialog_start, c, 0, 0); cutscene_event(cutscene_dialog_move_mario_shoulder, c, 0, -1); cutscene_event(cutscene_dialog_create_dialog_box, c, 10, 10); @@ -9002,14 +8966,14 @@ BAD_RETURN(s32) cutscene_dialog(struct Camera *c) { /** * Sets the CAM_FLAG_UNUSED_CUTSCENE_ACTIVE flag, which does nothing. */ -BAD_RETURN(s32) cutscene_dialog_set_flag(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_dialog_set_flag(UNUSED struct Camera* c) { sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; } /** * Ends the dialog cutscene. */ -BAD_RETURN(s32) cutscene_dialog_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_dialog_end(struct Camera* c) { sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; c->cutscene = 0; clear_time_stop_flags(TIME_STOP_ENABLED | TIME_STOP_DIALOG); @@ -9020,7 +8984,7 @@ BAD_RETURN(s32) cutscene_dialog_end(struct Camera *c) { * * In this cutscene, cvar0.angle[0] is used as a state variable. */ -BAD_RETURN(s32) cutscene_read_message_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_read_message_start(struct Camera* c) { cutscene_soften_music(c); transition_next_state(c, 30); reset_pan_distance(c); @@ -9033,7 +8997,7 @@ BAD_RETURN(s32) cutscene_read_message_start(struct Camera *c) { sCutsceneVars[0].angle[0] = 0; } -UNUSED static void unused_cam_to_mario(struct Camera *c) { +UNUSED static void unused_cam_to_mario(struct Camera* c) { Vec3s dir; vec3s_set(dir, 0, sMarioCamState->faceAngle[1], 0); @@ -9044,7 +9008,7 @@ UNUSED static void unused_cam_to_mario(struct Camera *c) { /** * Cutscene that plays when Mario is reading a message (a sign or message on the wall) */ -BAD_RETURN(s32) cutscene_read_message(struct Camera *c) { +BAD_RETURN(s32) cutscene_read_message(struct Camera* c) { UNUSED u8 filler[8]; cutscene_event(cutscene_read_message_start, c, 0, 0); @@ -9083,14 +9047,14 @@ BAD_RETURN(s32) cutscene_read_message(struct Camera *c) { /** * Set CAM_FLAG_UNUSED_CUTSCENE_ACTIVE, which does nothing. */ -BAD_RETURN(s32) cutscene_read_message_set_flag(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_read_message_set_flag(UNUSED struct Camera* c) { sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; } /** * End the message cutscene. */ -BAD_RETURN(s32) cutscene_read_message_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_read_message_end(struct Camera* c) { sStatusFlags |= CAM_FLAG_UNUSED_CUTSCENE_ACTIVE; c->cutscene = 0; } @@ -9101,7 +9065,7 @@ BAD_RETURN(s32) cutscene_read_message_end(struct Camera *c) { * cvar6 is the focus offset * cvar5 is the position offset */ -BAD_RETURN(s32) cutscene_exit_succ_start(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_succ_start(UNUSED struct Camera* c) { vec3f_copy(sCutsceneVars[7].point, sMarioCamState->pos); vec3s_copy(sCutsceneVars[7].angle, sMarioCamState->faceAngle); vec3f_set(sCutsceneVars[6].point, 6.f, 363.f, 543.f); @@ -9111,9 +9075,9 @@ BAD_RETURN(s32) cutscene_exit_succ_start(UNUSED struct Camera *c) { /** * Set the camera pos depending on which level Mario exited. */ -BAD_RETURN(s32) cutscene_non_painting_set_cam_pos(struct Camera *c) { +BAD_RETURN(s32) cutscene_non_painting_set_cam_pos(struct Camera* c) { UNUSED u8 filler1[4]; - struct Surface *floor; + struct Surface* floor; UNUSED u8 filler2[12]; switch (gPrevLevel) { @@ -9143,11 +9107,11 @@ BAD_RETURN(s32) cutscene_non_painting_set_cam_pos(struct Camera *c) { /** * Update the camera focus depending on which level Mario exited. */ -BAD_RETURN(s32) cutscene_non_painting_set_cam_focus(struct Camera *c) { +BAD_RETURN(s32) cutscene_non_painting_set_cam_focus(struct Camera* c) { offset_rotated(c->focus, sCutsceneVars[7].point, sCutsceneVars[6].point, sCutsceneVars[7].angle); - if ((gPrevLevel == LEVEL_COTMC) || (gPrevLevel == LEVEL_HMC) || (gPrevLevel == LEVEL_RR) - || (gPrevLevel == LEVEL_WMOTR)) { + if ((gPrevLevel == LEVEL_COTMC) || (gPrevLevel == LEVEL_HMC) || (gPrevLevel == LEVEL_RR) || + (gPrevLevel == LEVEL_WMOTR)) { c->focus[0] = c->pos[0] + (sMarioCamState->pos[0] - c->pos[0]) * 0.7f; c->focus[1] = c->pos[1] + (sMarioCamState->pos[1] - c->pos[1]) * 0.4f; c->focus[2] = c->pos[2] + (sMarioCamState->pos[2] - c->pos[2]) * 0.7f; @@ -9159,7 +9123,7 @@ BAD_RETURN(s32) cutscene_non_painting_set_cam_focus(struct Camera *c) { /** * Focus slightly left of Mario. Perhaps to keep the bowser painting in view? */ -BAD_RETURN(s32) cutscene_exit_bowser_succ_focus_left(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_bowser_succ_focus_left(UNUSED struct Camera* c) { approach_f32_asymptotic_bool(&sCutsceneVars[6].point[0], -24.f, 0.05f); } @@ -9167,7 +9131,7 @@ BAD_RETURN(s32) cutscene_exit_bowser_succ_focus_left(UNUSED struct Camera *c) { * Instead of focusing on the key, just start a pitch shake. Clever! * The shake lasts 32 frames. */ -BAD_RETURN(s32) cutscene_exit_bowser_key_toss_shake(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_bowser_key_toss_shake(struct Camera* c) { //! Unnecessary check. if (c->cutscene == CUTSCENE_EXIT_BOWSER_SUCC) { set_camera_pitch_shake(0x800, 0x40, 0x800); @@ -9177,14 +9141,14 @@ BAD_RETURN(s32) cutscene_exit_bowser_key_toss_shake(struct Camera *c) { /** * Start a camera shake when Mario lands on the ground. */ -BAD_RETURN(s32) cutscene_exit_succ_shake_landing(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_succ_shake_landing(UNUSED struct Camera* c) { set_environmental_camera_shake(SHAKE_ENV_EXPLOSION); } /** * Cutscene that plays when Mario beats bowser and exits the level. */ -BAD_RETURN(s32) cutscene_exit_bowser_succ(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_bowser_succ(struct Camera* c) { cutscene_event(cutscene_exit_succ_start, c, 0, 0); cutscene_event(cutscene_non_painting_set_cam_pos, c, 0, -1); cutscene_event(cutscene_exit_bowser_succ_focus_left, c, 18, -1); @@ -9196,7 +9160,7 @@ BAD_RETURN(s32) cutscene_exit_bowser_succ(struct Camera *c) { /** * End a non-painting exit cutscene. Used by BBH and bowser courses. */ -BAD_RETURN(s32) cutscene_non_painting_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_non_painting_end(struct Camera* c) { c->cutscene = 0; if (c->defMode == CAMERA_MODE_CLOSE) { @@ -9214,14 +9178,14 @@ BAD_RETURN(s32) cutscene_non_painting_end(struct Camera *c) { /** * Override the position offset. */ -BAD_RETURN(s32) cutscene_exit_non_painting_succ_override_cvar(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_non_painting_succ_override_cvar(UNUSED struct Camera* c) { vec3f_set(sCutsceneVars[5].point, 137.f, 246.f, 1115.f); } /** * Cutscene that plays when Mario collects a star and leaves a non-painting course, like HMC or BBH. */ -BAD_RETURN(s32) cutscene_exit_non_painting_succ(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_non_painting_succ(struct Camera* c) { cutscene_event(cutscene_exit_succ_start, c, 0, 0); cutscene_event(cutscene_exit_non_painting_succ_override_cvar, c, 0, 0); cutscene_event(cutscene_non_painting_set_cam_pos, c, 0, -1); @@ -9236,7 +9200,7 @@ BAD_RETURN(s32) cutscene_exit_non_painting_succ(struct Camera *c) { * Set cvar6 to the focus offset from Mario. * set cvar5 to the pos offset from Mario. (This is always overwritten) */ -BAD_RETURN(s32) cutscene_non_painting_death_start(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_non_painting_death_start(UNUSED struct Camera* c) { vec3f_copy(sCutsceneVars[7].point, sMarioCamState->pos); vec3s_copy(sCutsceneVars[7].angle, sMarioCamState->faceAngle); vec3f_set(sCutsceneVars[6].point, -42.f, 350.f, 727.f); @@ -9252,7 +9216,7 @@ BAD_RETURN(s32) cutscene_non_painting_death_start(UNUSED struct Camera *c) { * This cutscene is unused, dying in bowser's arena spawns Mario near the warp pipe, not back in the * hub. */ -BAD_RETURN(s32) cutscene_exit_bowser_death(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_bowser_death(struct Camera* c) { cutscene_event(cutscene_non_painting_death_start, c, 0, 0); cutscene_event(cutscene_non_painting_set_cam_pos, c, 0, -1); cutscene_event(cutscene_non_painting_set_cam_focus, c, 0, -1); @@ -9262,7 +9226,7 @@ BAD_RETURN(s32) cutscene_exit_bowser_death(struct Camera *c) { * Set the offset from Mario depending on the course Mario exited. * This overrides cutscene_non_painting_death_start() */ -BAD_RETURN(s32) cutscene_non_painting_death_override_offset(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_non_painting_death_override_offset(UNUSED struct Camera* c) { switch (gPrevLevel) { case LEVEL_HMC: vec3f_set(sCutsceneVars[5].point, 187.f, 369.f, -197.f); @@ -9279,7 +9243,7 @@ BAD_RETURN(s32) cutscene_non_painting_death_override_offset(UNUSED struct Camera /** * Cutscene played when Mario dies in a non-painting course, like HMC or BBH. */ -BAD_RETURN(s32) cutscene_non_painting_death(struct Camera *c) { +BAD_RETURN(s32) cutscene_non_painting_death(struct Camera* c) { cutscene_event(cutscene_non_painting_death_start, c, 0, 0); cutscene_event(cutscene_non_painting_death_override_offset, c, 0, 0); cutscene_event(cutscene_non_painting_set_cam_pos, c, 0, -1); @@ -9295,7 +9259,7 @@ BAD_RETURN(s32) cutscene_non_painting_death(struct Camera *c) { * between that yaw and Mario's faceAngle plus 0x1200. The reason for taking the high byte is * because cvar1 rotates until is reaches 0, so it's important that it's a multiple of 0x100. */ -BAD_RETURN(s32) cutscene_cap_switch_press_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press_start(struct Camera* c) { UNUSED s16 unused; s16 yaw; UNUSED u8 filler[8]; @@ -9311,7 +9275,7 @@ BAD_RETURN(s32) cutscene_cap_switch_press_start(struct Camera *c) { * Rotate around Mario. As each cvar stops updating, the rotation slows until the camera ends up in * front of Mario. */ -BAD_RETURN(s32) cutscene_cap_switch_press_rotate_around_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press_rotate_around_mario(struct Camera* c) { f32 dist; s16 pitch, yaw; UNUSED s16 unusedYaw = sMarioCamState->faceAngle[1] + 0x1000; @@ -9337,14 +9301,14 @@ BAD_RETURN(s32) cutscene_cap_switch_press_rotate_around_mario(struct Camera *c) /** * Move the camera slightly downwards. */ -BAD_RETURN(s32) cutscene_cap_switch_press_lower_cam(struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press_lower_cam(struct Camera* c) { rotate_and_move_vec3f(c->pos, sMarioCamState->pos, 0, -0x20, 0); } /** * Move the camera closer to Mario. */ -BAD_RETURN(s32) cutscene_cap_switch_press_approach_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press_approach_mario(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -9361,7 +9325,7 @@ BAD_RETURN(s32) cutscene_cap_switch_press_approach_mario(struct Camera *c) { /** * Pan the camera left so that Mario is on the right side of the screen when the camera stops spinning. */ -BAD_RETURN(s32) cutscene_cap_switch_press_pan_left(struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press_pan_left(struct Camera* c) { vec3f_copy(c->focus, sMarioCamState->pos); c->focus[1] += 110.f; camera_approach_s16_symmetric_bool(&sCutsceneVars[0].angle[1], 0x800, 0x20); @@ -9371,11 +9335,11 @@ BAD_RETURN(s32) cutscene_cap_switch_press_pan_left(struct Camera *c) { /** * Create a dialog box with the cap switch's text. */ -BAD_RETURN(s32) cutscene_cap_switch_press_create_dialog(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press_create_dialog(UNUSED struct Camera* c) { create_dialog_box_with_response(gCutsceneFocus->oBehParams2ndByte + DIALOG_010); } -static UNUSED BAD_RETURN(s32) unused_cap_switch_retrieve_info(struct Camera *c) { +static UNUSED BAD_RETURN(s32) unused_cap_switch_retrieve_info(struct Camera* c) { retrieve_info_star(c); transition_next_state(c, 30); } @@ -9383,7 +9347,7 @@ static UNUSED BAD_RETURN(s32) unused_cap_switch_retrieve_info(struct Camera *c) /** * Cutscene that plays when Mario presses a cap switch. */ -BAD_RETURN(s32) cutscene_cap_switch_press(struct Camera *c) { +BAD_RETURN(s32) cutscene_cap_switch_press(struct Camera* c) { f32 dist; s16 pitch, yaw; @@ -9419,7 +9383,7 @@ BAD_RETURN(s32) cutscene_cap_switch_press(struct Camera *c) { * cvar2 is the goal position * cvar3 is the goal focus */ -BAD_RETURN(s32) cutscene_unlock_key_door_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door_start(struct Camera* c) { Vec3f posOff, focusOff; vec3f_copy(sCutsceneVars[0].point, c->pos); @@ -9434,7 +9398,7 @@ BAD_RETURN(s32) cutscene_unlock_key_door_start(struct Camera *c) { * Move the camera to the cvars position and focus, closer to Mario. * Gives a better view of the key. */ -BAD_RETURN(s32) cutscene_unlock_key_door_approach_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door_approach_mario(struct Camera* c) { approach_vec3f_asymptotic(c->pos, sCutsceneVars[2].point, 0.1f, 0.1f, 0.1f); approach_vec3f_asymptotic(c->focus, sCutsceneVars[3].point, 0.1f, 0.1f, 0.1f); } @@ -9442,17 +9406,17 @@ BAD_RETURN(s32) cutscene_unlock_key_door_approach_mario(struct Camera *c) { /** * Move the camera focus up a bit, focusing on the key in the lock. */ -BAD_RETURN(s32) cutscene_unlock_key_door_focus_lock(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door_focus_lock(UNUSED struct Camera* c) { approach_f32_asymptotic_bool(&sCutsceneVars[3].point[1], sMarioCamState->pos[1] + 140.f, 0.07f); } -BAD_RETURN(s32) cutscene_unlock_key_door_stub(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door_stub(UNUSED struct Camera* c) { } /** * Move back to the previous pos and focus, stored in cvar0 and cvar1. */ -BAD_RETURN(s32) cutscene_unlock_key_door_fly_back(struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door_fly_back(struct Camera* c) { approach_vec3f_asymptotic(c->pos, sCutsceneVars[0].point, 0.1f, 0.1f, 0.1f); approach_vec3f_asymptotic(c->focus, sCutsceneVars[1].point, 0.1f, 0.1f, 0.1f); } @@ -9460,14 +9424,14 @@ BAD_RETURN(s32) cutscene_unlock_key_door_fly_back(struct Camera *c) { /** * Shake the camera's fov when the key is put in the lock. */ -BAD_RETURN(s32) cutscene_unlock_key_door_fov_shake(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door_fov_shake(UNUSED struct Camera* c) { cutscene_set_fov_shake_preset(1); } /** * Cutscene that plays when Mario unlocks a key door. */ -BAD_RETURN(s32) cutscene_unlock_key_door(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_unlock_key_door(UNUSED struct Camera* c) { cutscene_event(cutscene_unlock_key_door_start, c, 0, 0); cutscene_event(cutscene_unlock_key_door_approach_mario, c, 0, 123); cutscene_event(cutscene_unlock_key_door_fly_back, c, 124, -1); @@ -9480,8 +9444,8 @@ BAD_RETURN(s32) cutscene_unlock_key_door(UNUSED struct Camera *c) { * Move the camera along `positionSpline` and point its focus at the corresponding point along * `focusSpline`. sCutsceneSplineSegmentProgress is updated after pos and focus are calculated. */ -s32 intro_peach_move_camera_start_to_pipe(struct Camera *c, struct CutsceneSplinePoint positionSpline[], - struct CutsceneSplinePoint focusSpline[]) { +s32 intro_peach_move_camera_start_to_pipe(struct Camera* c, struct CutsceneSplinePoint positionSpline[], + struct CutsceneSplinePoint focusSpline[]) { Vec3f offset; s32 posReturn = 0; s32 focusReturn = 0; @@ -9491,8 +9455,10 @@ s32 intro_peach_move_camera_start_to_pipe(struct Camera *c, struct CutsceneSplin * updated. Otherwise position would move two frames ahead, and c->focus would always be one frame * further along the spline than c->pos. */ - posReturn = move_point_along_spline(c->pos, positionSpline, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); - focusReturn = move_point_along_spline(c->focus, focusSpline, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); + posReturn = + move_point_along_spline(c->pos, positionSpline, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); + focusReturn = + move_point_along_spline(c->focus, focusSpline, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); // The two splines used by this function are reflected in the horizontal plane for some reason, // so they are rotated every frame. Why do this, Nintendo? @@ -9510,12 +9476,12 @@ s32 intro_peach_move_camera_start_to_pipe(struct Camera *c, struct CutsceneSplin /** * Create a dialog box with the letter text */ -BAD_RETURN(s32) peach_letter_text(UNUSED struct Camera *c) { +BAD_RETURN(s32) peach_letter_text(UNUSED struct Camera* c) { create_dialog_box(DIALOG_020); } -BAD_RETURN(s32) play_sound_peach_reading_letter(UNUSED struct Camera *c) { - if(!ROM_JP) { +BAD_RETURN(s32) play_sound_peach_reading_letter(UNUSED struct Camera* c) { + if (!ROM_JP) { play_sound(SOUND_PEACH_DEAR_MARIO, gGlobalSoundSource); } } @@ -9524,7 +9490,7 @@ BAD_RETURN(s32) play_sound_peach_reading_letter(UNUSED struct Camera *c) { * Move the camera from peach reading the letter all the way to Mario's warp pipe. Follow the * sIntroStartToPipe splines. */ -BAD_RETURN(s32) cutscene_intro_peach_start_to_pipe_spline(struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_start_to_pipe_spline(struct Camera* c) { if (intro_peach_move_camera_start_to_pipe(c, sIntroStartToPipePosition, sIntroStartToPipeFocus) != 0) { gCameraMovementFlags &= ~CAM_MOVE_C_UP_MODE; gCutsceneTimer = CUTSCENE_LOOP; @@ -9534,7 +9500,7 @@ BAD_RETURN(s32) cutscene_intro_peach_start_to_pipe_spline(struct Camera *c) { /** * Loop the cutscene until Mario exits the dialog. */ -BAD_RETURN(s32) cutscene_intro_peach_dialog(struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_dialog(struct Camera* c) { if (get_dialog_id() == DIALOG_NONE) { vec3f_copy(gLakituState.goalPos, c->pos); vec3f_copy(gLakituState.goalFocus, c->focus); @@ -9544,19 +9510,21 @@ BAD_RETURN(s32) cutscene_intro_peach_dialog(struct Camera *c) { } } -BAD_RETURN(s32) cutscene_intro_peach_follow_pipe_spline(struct Camera *c) { - move_point_along_spline(c->pos, sIntroPipeToDialogPosition, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); - move_point_along_spline(c->focus, sIntroPipeToDialogFocus, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); +BAD_RETURN(s32) cutscene_intro_peach_follow_pipe_spline(struct Camera* c) { + move_point_along_spline(c->pos, sIntroPipeToDialogPosition, &sCutsceneSplineSegment, + &sCutsceneSplineSegmentProgress); + move_point_along_spline(c->focus, sIntroPipeToDialogFocus, &sCutsceneSplineSegment, + &sCutsceneSplineSegmentProgress); } -BAD_RETURN(s32) cutscene_intro_peach_clear_cutscene_status(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_clear_cutscene_status(UNUSED struct Camera* c) { sMarioCamState->cameraEvent = 0; } /** * Set fov to 8 degrees, then zoom out to 30. */ -BAD_RETURN(s32) cutscene_intro_peach_zoom_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_zoom_fov(UNUSED struct Camera* c) { sFOVState.fov = 8.f; set_fov_function(CAM_FOV_ZOOM_30); } @@ -9564,7 +9532,7 @@ BAD_RETURN(s32) cutscene_intro_peach_zoom_fov(UNUSED struct Camera *c) { /** * Reset the spline progress, turn on handheld shake. */ -BAD_RETURN(s32) cutscene_intro_peach_reset_spline(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_reset_spline(UNUSED struct Camera* c) { sCutsceneSplineSegment = 0; sCutsceneSplineSegmentProgress = 0.1f; //! @bug since this event is only called for one frame, this handheld shake is turned off on the @@ -9576,16 +9544,16 @@ BAD_RETURN(s32) cutscene_intro_peach_reset_spline(UNUSED struct Camera *c) { * Turn off handheld shake. This was likely written before handheld shake was changed to turn off every * frame, as it's the only instance of HAND_CAM_SHAKE_OFF. */ -BAD_RETURN(s32) cutscene_intro_peach_handheld_shake_off(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_handheld_shake_off(UNUSED struct Camera* c) { set_handheld_shake(HAND_CAM_SHAKE_OFF); } -BAD_RETURN(s32) intro_pipe_exit_text(UNUSED struct Camera *c) { +BAD_RETURN(s32) intro_pipe_exit_text(UNUSED struct Camera* c) { create_dialog_box(DIALOG_033); } -BAD_RETURN(s32) play_sound_intro_turn_on_hud(UNUSED struct Camera *c) { - if(!ROM_JP) { +BAD_RETURN(s32) play_sound_intro_turn_on_hud(UNUSED struct Camera* c) { + if (!ROM_JP) { play_sound_rbutton_changed(); } } @@ -9593,7 +9561,7 @@ BAD_RETURN(s32) play_sound_intro_turn_on_hud(UNUSED struct Camera *c) { /** * Fly to the pipe. Near the end, the camera jumps to Lakitu's position and the hud turns on. */ -BAD_RETURN(s32) cutscene_intro_peach_fly_to_pipe(struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_fly_to_pipe(struct Camera* c) { #if defined(VERSION_US) || defined(VERSION_SH) cutscene_event(play_sound_intro_turn_on_hud, c, 818, 818); #elif defined(VERSION_EU) @@ -9614,7 +9582,7 @@ BAD_RETURN(s32) cutscene_intro_peach_fly_to_pipe(struct Camera *c) { /** * Lakitu flies around the warp pipe, then Mario jumps out. */ -BAD_RETURN(s32) cutscene_intro_peach_mario_appears(struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_mario_appears(struct Camera* c) { UNUSED u8 filler[8]; sMarioCamState->cameraEvent = 0; @@ -9623,8 +9591,9 @@ BAD_RETURN(s32) cutscene_intro_peach_mario_appears(struct Camera *c) { cutscene_event(cutscene_intro_peach_handheld_shake_off, c, 70, 70); cutscene_event(intro_pipe_exit_text, c, 250, 250); - approach_f32_asymptotic_bool(&sCutsceneVars[1].point[1], 80.f + sMarioGeometry.currFloorHeight + - (sMarioCamState->pos[1] - sMarioGeometry.currFloorHeight) * 1.1f, 0.4f); + approach_f32_asymptotic_bool( + &sCutsceneVars[1].point[1], + 80.f + sMarioGeometry.currFloorHeight + (sMarioCamState->pos[1] - sMarioGeometry.currFloorHeight) * 1.1f, 0.4f); // Make the camera look up as Mario jumps out of the pipe if (c->focus[1] < sCutsceneVars[1].point[1]) { @@ -9637,14 +9606,14 @@ BAD_RETURN(s32) cutscene_intro_peach_mario_appears(struct Camera *c) { /** * Reset the fov. This gives the effect of peach zooming out as she fades. */ -BAD_RETURN(s32) cutscene_intro_peach_reset_fov(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_reset_fov(UNUSED struct Camera* c) { set_fov_function(CAM_FOV_DEFAULT); } /** * Peach reads the letter to Mario. */ -BAD_RETURN(s32) cutscene_intro_peach_letter(struct Camera *c) { +BAD_RETURN(s32) cutscene_intro_peach_letter(struct Camera* c) { cutscene_spawn_obj(5, 0); cutscene_event(cutscene_intro_peach_zoom_fov, c, 0, 0); cutscene_event(cutscene_intro_peach_start_letter_music, c, 65, 65); @@ -9654,7 +9623,7 @@ BAD_RETURN(s32) cutscene_intro_peach_letter(struct Camera *c) { cutscene_event(cutscene_intro_peach_start_to_pipe_spline, c, 0, 0); cutscene_event(peach_letter_text, c, 65, 65); - if(!ROM_JP){ + if (!ROM_JP) { cutscene_event(play_sound_peach_reading_letter, c, 83, 83); } @@ -9669,7 +9638,7 @@ BAD_RETURN(s32) cutscene_intro_peach_letter(struct Camera *c) { /** * Reset the spline progress. */ -BAD_RETURN(s32) cutscene_end_waving_start(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_end_waving_start(UNUSED struct Camera* c) { cutscene_reset_spline(); } @@ -9704,19 +9673,19 @@ struct CutsceneSplinePoint gIntroLakituStartToPipeOffsetFromCamera[] = { { 33, 0, { 51, -11, 84 } }, { -1, 0, { 51, -11, 84 } } }; -struct CutsceneSplinePoint gEndWavingPos[] = { - { 0, 0, { -5, 975, -917 } }, { 0, 0, { -5, 975, -917 } }, { 0, 0, { -5, 975, -917 } }, - { 0, 0, { -76, 1067, 742 } }, { 0, 0, { -105, 1576, 3240 } }, { 0, 0, { -177, 1709, 5586 } }, - { 0, 0, { -177, 1709, 5586 } }, { 0, 0, { -177, 1709, 5586 } }, { 0, 0, { -177, 1709, 5586 } } -}; +struct CutsceneSplinePoint gEndWavingPos[] = { { 0, 0, { -5, 975, -917 } }, { 0, 0, { -5, 975, -917 } }, + { 0, 0, { -5, 975, -917 } }, { 0, 0, { -76, 1067, 742 } }, + { 0, 0, { -105, 1576, 3240 } }, { 0, 0, { -177, 1709, 5586 } }, + { 0, 0, { -177, 1709, 5586 } }, { 0, 0, { -177, 1709, 5586 } }, + { 0, 0, { -177, 1709, 5586 } } }; -struct CutsceneSplinePoint gEndWavingFocus[] = { - { 0, 50, { 18, 1013, -1415 } }, { 0, 100, { 17, 1037, -1412 } }, { 0, 100, { 16, 1061, -1408 } }, - { 0, 100, { -54, 1053, 243 } }, { 0, 100, { -84, 1575, 2740 } }, { 0, 50, { -156, 1718, 5086 } }, - { 0, 0, { -156, 1718, 5086 } }, { 0, 0, { -156, 1718, 5086 } }, { 0, 0, { -156, 1718, 5086 } } -}; +struct CutsceneSplinePoint gEndWavingFocus[] = { { 0, 50, { 18, 1013, -1415 } }, { 0, 100, { 17, 1037, -1412 } }, + { 0, 100, { 16, 1061, -1408 } }, { 0, 100, { -54, 1053, 243 } }, + { 0, 100, { -84, 1575, 2740 } }, { 0, 50, { -156, 1718, 5086 } }, + { 0, 0, { -156, 1718, 5086 } }, { 0, 0, { -156, 1718, 5086 } }, + { 0, 0, { -156, 1718, 5086 } } }; -BAD_RETURN(s32) cutscene_end_waving(struct Camera *c) { +BAD_RETURN(s32) cutscene_end_waving(struct Camera* c) { cutscene_event(cutscene_end_waving_start, c, 0, 0); move_point_along_spline(c->pos, gEndWavingPos, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); move_point_along_spline(c->focus, gEndWavingFocus, &sCutsceneSplineSegment, &sCutsceneSplineSegmentProgress); @@ -9726,7 +9695,7 @@ BAD_RETURN(s32) cutscene_end_waving(struct Camera *c) { /** * Called on the first frame of the credits. Resets the spline progress. */ -BAD_RETURN(s32) cutscene_credits_reset_spline(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_credits_reset_spline(UNUSED struct Camera* c) { cutscene_reset_spline(); } @@ -9774,7 +9743,7 @@ extern struct CutsceneSplinePoint sCcmOutsideCreditsSplineFocus[]; /** * Follow splines through the courses of the game. */ -BAD_RETURN(s32) cutscene_credits(struct Camera *c) { +BAD_RETURN(s32) cutscene_credits(struct Camera* c) { struct CutsceneSplinePoint *focus, *pos; cutscene_event(cutscene_credits_reset_spline, c, 0, 0); @@ -9883,7 +9852,7 @@ BAD_RETURN(s32) cutscene_credits(struct Camera *c) { /** * Set the camera pos relative to Mario. */ -BAD_RETURN(s32) cutscene_sliding_doors_open_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_sliding_doors_open_start(struct Camera* c) { f32 dist; s16 pitch, yaw; @@ -9904,7 +9873,7 @@ BAD_RETURN(s32) cutscene_sliding_doors_open_start(struct Camera *c) { * cvar0.angle: Mario's angle * cvar0.point: offset from Mario */ -BAD_RETURN(s32) cutscene_sliding_doors_open_set_cvars(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_sliding_doors_open_set_cvars(UNUSED struct Camera* c) { vec3f_copy(sCutsceneVars[1].point, sMarioCamState->pos); vec3s_copy(sCutsceneVars[0].angle, sMarioCamState->faceAngle); vec3f_set(sCutsceneVars[0].point, 80.f, 325.f, 200.f); @@ -9914,21 +9883,21 @@ BAD_RETURN(s32) cutscene_sliding_doors_open_set_cvars(UNUSED struct Camera *c) { * Decrease the cvar0 y offset to 75, which would simulate Lakitu flying under the doorway. * However, the initial y offset is too high for Lakitu to reach 75 in time. */ -BAD_RETURN(s32) cutscene_sliding_doors_go_under_doorway(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_sliding_doors_go_under_doorway(UNUSED struct Camera* c) { camera_approach_f32_symmetric_bool(&sCutsceneVars[0].point[1], 75.f, 10.f); } /** * Approach a y offset of 125 again. */ -BAD_RETURN(s32) cutscene_sliding_doors_fly_back_up(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_sliding_doors_fly_back_up(UNUSED struct Camera* c) { camera_approach_f32_symmetric_bool(&sCutsceneVars[0].point[1], 125.f, 10.f); } /** * Follow Mario through the door, by approaching cvar1.point. */ -BAD_RETURN(s32) cutscene_sliding_doors_follow_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_sliding_doors_follow_mario(struct Camera* c) { Vec3f pos; UNUSED u8 filler[20]; @@ -9955,7 +9924,7 @@ BAD_RETURN(s32) cutscene_sliding_doors_follow_mario(struct Camera *c) { * Plays when Mario opens the sliding doors. * Note: the star door unlocking event is not a cutscene, it's handled by Mario separately. */ -BAD_RETURN(s32) cutscene_sliding_doors_open(struct Camera *c) { +BAD_RETURN(s32) cutscene_sliding_doors_open(struct Camera* c) { UNUSED u8 filler[8]; reset_pan_distance(c); @@ -9969,20 +9938,20 @@ BAD_RETURN(s32) cutscene_sliding_doors_open(struct Camera *c) { /** * Ends the double door cutscene. */ -BAD_RETURN(s32) cutscene_double_doors_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_double_doors_end(struct Camera* c) { set_flag_post_door(c); c->cutscene = 0; sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; } -BAD_RETURN(s32) cutscene_enter_painting_stub(UNUSED struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_painting_stub(UNUSED struct Camera* c) { } /** * Plays when Mario enters a painting. The camera flies up to the painting's center, then it slowly * zooms in until the star select screen appears. */ -BAD_RETURN(s32) cutscene_enter_painting(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_painting(struct Camera* c) { struct Surface *floor, *highFloor; Vec3f paintingPos, focus, focusOffset; Vec3s paintingAngle; @@ -10042,8 +10011,8 @@ BAD_RETURN(s32) cutscene_enter_painting(struct Camera *c) { * cvar1 is the camera's position relative to Mario * cvar2 is the camera's focus relative to Mario */ -BAD_RETURN(s32) cutscene_exit_painting_start(struct Camera *c) { - struct Surface *floor; +BAD_RETURN(s32) cutscene_exit_painting_start(struct Camera* c) { + struct Surface* floor; f32 floorHeight; vec3f_set(sCutsceneVars[2].point, 258.f, -352.f, 1189.f); @@ -10071,7 +10040,7 @@ BAD_RETURN(s32) cutscene_exit_painting_start(struct Camera *c) { /** * Decrease cvar2's x and z offset, moving closer to Mario. */ -BAD_RETURN(s32) cutscene_exit_painting_move_to_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_painting_move_to_mario(struct Camera* c) { Vec3f pos; //! Tricky math: Since offset_rotated() flips Z offsets, you'd expect a positive Z offset to move @@ -10090,8 +10059,8 @@ BAD_RETURN(s32) cutscene_exit_painting_move_to_mario(struct Camera *c) { /** * Move the camera down to the floor Mario lands on. */ -BAD_RETURN(s32) cutscene_exit_painting_move_to_floor(struct Camera *c) { - struct Surface *floor; +BAD_RETURN(s32) cutscene_exit_painting_move_to_floor(struct Camera* c) { + struct Surface* floor; Vec3f floorHeight; vec3f_copy(floorHeight, sMarioCamState->pos); @@ -10110,7 +10079,7 @@ BAD_RETURN(s32) cutscene_exit_painting_move_to_floor(struct Camera *c) { /** * Cutscene played when Mario leaves a painting, either due to death or collecting a star. */ -BAD_RETURN(s32) cutscene_exit_painting(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_painting(struct Camera* c) { cutscene_event(cutscene_exit_painting_start, c, 0, 0); cutscene_event(cutscene_exit_painting_move_to_mario, c, 5, -1); cutscene_event(cutscene_exit_painting_move_to_floor, c, 5, -1); @@ -10126,7 +10095,7 @@ BAD_RETURN(s32) cutscene_exit_painting(struct Camera *c) { /** * Unused. Warp the camera to Mario. */ -BAD_RETURN(s32) cutscene_unused_exit_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_unused_exit_start(struct Camera* c) { UNUSED u8 filler[18]; Vec3f offset; Vec3s marioAngle; @@ -10140,7 +10109,7 @@ BAD_RETURN(s32) cutscene_unused_exit_start(struct Camera *c) { /** * Unused. Focus on Mario as he exits. */ -BAD_RETURN(s32) cutscene_unused_exit_focus_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_unused_exit_focus_mario(struct Camera* c) { Vec3f focus; vec3f_set(focus, sMarioCamState->pos[0], sMarioCamState->pos[1] + 125.f, sMarioCamState->pos[2]); @@ -10152,7 +10121,7 @@ BAD_RETURN(s32) cutscene_unused_exit_focus_mario(struct Camera *c) { /** * Give control back to the player. */ -BAD_RETURN(s32) cutscene_exit_painting_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_exit_painting_end(struct Camera* c) { c->mode = CAMERA_MODE_CLOSE; c->cutscene = 0; gCutsceneTimer = CUTSCENE_STOP; @@ -10164,7 +10133,7 @@ BAD_RETURN(s32) cutscene_exit_painting_end(struct Camera *c) { /** * End the cutscene, starting cannon mode. */ -BAD_RETURN(s32) cutscene_enter_cannon_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_cannon_end(struct Camera* c) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; sStatusFlags |= CAM_FLAG_BLOCK_SMOOTH_MOVEMENT; c->mode = CAMERA_MODE_INSIDE_CANNON; @@ -10175,11 +10144,11 @@ BAD_RETURN(s32) cutscene_enter_cannon_end(struct Camera *c) { /** * Rotate around the cannon as it rises out of the hole. */ -BAD_RETURN(s32) cutscene_enter_cannon_raise(struct Camera *c) { - struct Object *o; +BAD_RETURN(s32) cutscene_enter_cannon_raise(struct Camera* c) { + struct Object* o; UNUSED u8 filler[8]; f32 floorHeight; - struct Surface *floor; + struct Surface* floor; Vec3f cannonFocus; Vec3s cannonAngle; @@ -10220,9 +10189,9 @@ BAD_RETURN(s32) cutscene_enter_cannon_raise(struct Camera *c) { /** * Start the cannon entering cutscene */ -BAD_RETURN(s32) cutscene_enter_cannon_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_enter_cannon_start(struct Camera* c) { UNUSED u8 filler[8]; // cvar3Start, cvar4Start? - struct Object *o; + struct Object* o; sStatusFlags |= CAM_FLAG_SMOOTH_MOVEMENT; sMarioCamState->cameraEvent = 0; @@ -10238,8 +10207,8 @@ BAD_RETURN(s32) cutscene_enter_cannon_start(struct Camera *c) { } // Store the camera's polar offset from the cannon in cvar1 - vec3f_get_dist_and_angle(sCutsceneVars[0].point, c->pos, &sCutsceneVars[1].point[2], - &sCutsceneVars[1].angle[0], &sCutsceneVars[1].angle[1]); + vec3f_get_dist_and_angle(sCutsceneVars[0].point, c->pos, &sCutsceneVars[1].point[2], &sCutsceneVars[1].angle[0], + &sCutsceneVars[1].angle[1]); sCutsceneVars[3].point[1] = 0.f; //! cvar4 is unused in this cutscene sCutsceneVars[4].point[1] = 0.f; @@ -10248,7 +10217,7 @@ BAD_RETURN(s32) cutscene_enter_cannon_start(struct Camera *c) { /** * Store the camera's pos and focus for the door cutscene */ -BAD_RETURN(s32) cutscene_door_start(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_start(struct Camera* c) { vec3f_copy(sCutsceneVars[0].point, c->pos); vec3f_copy(sCutsceneVars[1].point, c->focus); } @@ -10256,7 +10225,7 @@ BAD_RETURN(s32) cutscene_door_start(struct Camera *c) { /** * Fix the camera in place while the door opens. */ -BAD_RETURN(s32) cutscene_door_fix_cam(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_fix_cam(struct Camera* c) { vec3f_copy(c->pos, sCutsceneVars[0].point); vec3f_copy(c->focus, sCutsceneVars[1].point); } @@ -10264,7 +10233,7 @@ BAD_RETURN(s32) cutscene_door_fix_cam(struct Camera *c) { /** * Loop until Mario is no longer using the door. */ -BAD_RETURN(s32) cutscene_door_loop(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_loop(struct Camera* c) { //! bitwise AND instead of boolean if ((sMarioCamState->action != ACT_PULLING_DOOR) & (sMarioCamState->action != ACT_PUSHING_DOOR)) { gCutsceneTimer = CUTSCENE_STOP; @@ -10275,7 +10244,7 @@ BAD_RETURN(s32) cutscene_door_loop(struct Camera *c) { /** * Warp the camera behind Mario. */ -BAD_RETURN(s32) cutscene_door_move_behind_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_move_behind_mario(struct Camera* c) { Vec3f camOffset; s16 doorRotation; @@ -10297,7 +10266,7 @@ BAD_RETURN(s32) cutscene_door_move_behind_mario(struct Camera *c) { /** * Follow Mario through the door. */ -BAD_RETURN(s32) cutscene_door_follow_mario(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_follow_mario(struct Camera* c) { s16 pitch, yaw; f32 dist; @@ -10311,7 +10280,7 @@ BAD_RETURN(s32) cutscene_door_follow_mario(struct Camera *c) { /** * Ends the door cutscene. Sets the camera mode to close mode unless the default is free roam. */ -BAD_RETURN(s32) cutscene_door_end(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_end(struct Camera* c) { if (c->defMode == CAMERA_MODE_FREE_ROAM) { c->mode = CAMERA_MODE_FREE_ROAM; } else { @@ -10329,7 +10298,7 @@ BAD_RETURN(s32) cutscene_door_end(struct Camera *c) { /** * Used for entering a room that uses a specific camera mode, like the castle lobby or BBH */ -BAD_RETURN(s32) cutscene_door_mode(struct Camera *c) { +BAD_RETURN(s32) cutscene_door_mode(struct Camera* c) { UNUSED u8 filler[8]; reset_pan_distance(c); @@ -10345,8 +10314,7 @@ BAD_RETURN(s32) cutscene_door_mode(struct Camera *c) { c->yaw = c->nextYaw; // Loop until Mario is no longer using the door - if (sMarioCamState->action != ACT_ENTERING_STAR_DOOR && - sMarioCamState->action != ACT_PULLING_DOOR && + if (sMarioCamState->action != ACT_ENTERING_STAR_DOOR && sMarioCamState->action != ACT_PULLING_DOOR && sMarioCamState->action != ACT_PUSHING_DOOR) { gCutsceneTimer = CUTSCENE_STOP; c->cutscene = 0; @@ -10360,258 +10328,197 @@ BAD_RETURN(s32) cutscene_door_mode(struct Camera *c) { /** * Cutscene that plays when Mario beats the game. */ -struct Cutscene sCutsceneEnding[] = { - { cutscene_ending_mario_fall, 170 }, - { cutscene_ending_mario_land, 70 }, +struct Cutscene sCutsceneEnding[] = { { cutscene_ending_mario_fall, 170 }, + { cutscene_ending_mario_land, 70 }, #ifdef VERSION_EU - { cutscene_ending_mario_land_closeup, 0x44 }, - { cutscene_ending_stars_free_peach, 0x15c }, - { cutscene_ending_peach_appears, 0x6d }, - { cutscene_ending_peach_descends, 0x212 }, - { cutscene_ending_mario_to_peach, 0x69 }, - { cutscene_ending_peach_wakeup, 0x1a4 }, - { cutscene_ending_dialog, 0x114 }, - { cutscene_ending_kiss, 0x10b }, + { cutscene_ending_mario_land_closeup, 0x44 }, + { cutscene_ending_stars_free_peach, 0x15c }, + { cutscene_ending_peach_appears, 0x6d }, + { cutscene_ending_peach_descends, 0x212 }, + { cutscene_ending_mario_to_peach, 0x69 }, + { cutscene_ending_peach_wakeup, 0x1a4 }, + { cutscene_ending_dialog, 0x114 }, + { cutscene_ending_kiss, 0x10b }, #else - { cutscene_ending_mario_land_closeup, 75 }, + { cutscene_ending_mario_land_closeup, 75 }, #ifdef VERSION_SH - { cutscene_ending_stars_free_peach, 431 }, + { cutscene_ending_stars_free_peach, 431 }, #else - { cutscene_ending_stars_free_peach, 386 }, + { cutscene_ending_stars_free_peach, 386 }, #endif - { cutscene_ending_peach_appears, 139 }, - { cutscene_ending_peach_descends, 590 }, - { cutscene_ending_mario_to_peach, 95 }, + { cutscene_ending_peach_appears, 139 }, + { cutscene_ending_peach_descends, 590 }, + { cutscene_ending_mario_to_peach, 95 }, #ifdef VERSION_SH - { cutscene_ending_peach_wakeup, 455 }, - { cutscene_ending_dialog, 286 }, + { cutscene_ending_peach_wakeup, 455 }, + { cutscene_ending_dialog, 286 }, #else - { cutscene_ending_peach_wakeup, 425 }, - { cutscene_ending_dialog, 236 }, + { cutscene_ending_peach_wakeup, 425 }, + { cutscene_ending_dialog, 236 }, #endif - { cutscene_ending_kiss, 245 }, + { cutscene_ending_kiss, 245 }, #endif - { cutscene_ending_cake_for_mario, CUTSCENE_LOOP }, - { cutscene_ending_stop, 0 } -}; + { cutscene_ending_cake_for_mario, CUTSCENE_LOOP }, + { cutscene_ending_stop, 0 } }; /** * Cutscene that plays when Mario collects the grand star from bowser. */ -struct Cutscene sCutsceneGrandStar[] = { - { cutscene_grand_star, 360 }, - { cutscene_grand_star_fly, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneGrandStar[] = { { cutscene_grand_star, 360 }, { cutscene_grand_star_fly, CUTSCENE_LOOP } }; -struct Cutscene sCutsceneUnused[] = { - { cutscene_unused_start, 1 }, - { cutscene_unused_loop, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneUnused[] = { { cutscene_unused_start, 1 }, { cutscene_unused_loop, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario enters a door that warps to another area. */ -struct Cutscene sCutsceneDoorWarp[] = { - { cutscene_door_start, 1 }, - { cutscene_door_loop, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDoorWarp[] = { { cutscene_door_start, 1 }, { cutscene_door_loop, CUTSCENE_LOOP } }; /** * Cutscene that plays after the credits, when Lakitu is flying away from the castle. */ -struct Cutscene sCutsceneEndWaving[] = { - { cutscene_end_waving, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneEndWaving[] = { { cutscene_end_waving, CUTSCENE_LOOP } }; /** * The game's credits. */ -struct Cutscene sCutsceneCredits[] = { - { cutscene_credits, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneCredits[] = { { cutscene_credits, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario pulls open a door. */ -struct Cutscene sCutsceneDoorPull[] = { - { cutscene_door_start, 1 }, - { cutscene_door_fix_cam, 30 }, - { cutscene_door_move_behind_mario, 1 }, - { cutscene_door_follow_mario, 50 }, - { cutscene_door_end, 0 } -}; +struct Cutscene sCutsceneDoorPull[] = { { cutscene_door_start, 1 }, + { cutscene_door_fix_cam, 30 }, + { cutscene_door_move_behind_mario, 1 }, + { cutscene_door_follow_mario, 50 }, + { cutscene_door_end, 0 } }; /** * Cutscene that plays when Mario pushes open a door. */ -struct Cutscene sCutsceneDoorPush[] = { - { cutscene_door_start, 1 }, - { cutscene_door_fix_cam, 20 }, - { cutscene_door_move_behind_mario, 1 }, - { cutscene_door_follow_mario, 50 }, - { cutscene_door_end, 0 } -}; +struct Cutscene sCutsceneDoorPush[] = { { cutscene_door_start, 1 }, + { cutscene_door_fix_cam, 20 }, + { cutscene_door_move_behind_mario, 1 }, + { cutscene_door_follow_mario, 50 }, + { cutscene_door_end, 0 } }; /** * Cutscene that plays when Mario pulls open a door that has some special mode requirement on the other * side. */ -struct Cutscene sCutsceneDoorPullMode[] = { - { cutscene_door_start, 1 }, - { cutscene_door_fix_cam, 30 }, - { cutscene_door_mode, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDoorPullMode[] = { { cutscene_door_start, 1 }, + { cutscene_door_fix_cam, 30 }, + { cutscene_door_mode, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario pushes open a door that has some special mode requirement on the other * side. */ -struct Cutscene sCutsceneDoorPushMode[] = { - { cutscene_door_start, 1 }, - { cutscene_door_fix_cam, 20 }, - { cutscene_door_mode, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDoorPushMode[] = { { cutscene_door_start, 1 }, + { cutscene_door_fix_cam, 20 }, + { cutscene_door_mode, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario enters the cannon and it rises out of the hole. */ -struct Cutscene sCutsceneEnterCannon[] = { - { cutscene_enter_cannon_start, 1 }, - { cutscene_enter_cannon_raise, 121 }, - { cutscene_enter_cannon_end, 0 } -}; +struct Cutscene sCutsceneEnterCannon[] = { { cutscene_enter_cannon_start, 1 }, + { cutscene_enter_cannon_raise, 121 }, + { cutscene_enter_cannon_end, 0 } }; /** * Cutscene that plays when a star spawns from ie a box or after a boss fight. */ -struct Cutscene sCutsceneStarSpawn[] = { - { cutscene_star_spawn, CUTSCENE_LOOP }, - { cutscene_star_spawn_back, 15 }, - { cutscene_star_spawn_end, 0 } -}; +struct Cutscene sCutsceneStarSpawn[] = { { cutscene_star_spawn, CUTSCENE_LOOP }, + { cutscene_star_spawn_back, 15 }, + { cutscene_star_spawn_end, 0 } }; /** * Cutscene for the red coin star spawning. Compared to a regular star, this cutscene can warp long * distances. */ -struct Cutscene sCutsceneRedCoinStarSpawn[] = { - { cutscene_red_coin_star, CUTSCENE_LOOP }, - { cutscene_red_coin_star_end, 0 } -}; +struct Cutscene sCutsceneRedCoinStarSpawn[] = { { cutscene_red_coin_star, CUTSCENE_LOOP }, + { cutscene_red_coin_star_end, 0 } }; /** * Cutscene that plays when Mario enters a course painting. */ -struct Cutscene sCutsceneEnterPainting[] = { - { cutscene_enter_painting, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneEnterPainting[] = { { cutscene_enter_painting, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario dies and warps back to the castle. */ -struct Cutscene sCutsceneDeathExit[] = { - { cutscene_exit_painting, 118 }, - { cutscene_exit_painting_end, 0 } -}; +struct Cutscene sCutsceneDeathExit[] = { { cutscene_exit_painting, 118 }, { cutscene_exit_painting_end, 0 } }; /** * Cutscene that plays when Mario warps to the castle after collecting a star. */ -struct Cutscene sCutsceneExitPaintingSuccess[] = { - { cutscene_exit_painting, 180 }, - { cutscene_exit_painting_end, 0 } -}; +struct Cutscene sCutsceneExitPaintingSuccess[] = { { cutscene_exit_painting, 180 }, { cutscene_exit_painting_end, 0 } }; -struct Cutscene sCutsceneUnusedExit[] = { - { cutscene_unused_exit_start, 1 }, - { cutscene_unused_exit_focus_mario, 60 }, - { cutscene_exit_painting_end, 0 } -}; +struct Cutscene sCutsceneUnusedExit[] = { { cutscene_unused_exit_start, 1 }, + { cutscene_unused_exit_focus_mario, 60 }, + { cutscene_exit_painting_end, 0 } }; /** * The intro of the game. Peach reads her letter and Lakitu flies down to Mario's warp pipe. */ -struct Cutscene sCutsceneIntroPeach[] = { - { cutscene_intro_peach_letter, CUTSCENE_LOOP }, - { cutscene_intro_peach_reset_fov, 35 }, +struct Cutscene sCutsceneIntroPeach[] = { { cutscene_intro_peach_letter, CUTSCENE_LOOP }, + { cutscene_intro_peach_reset_fov, 35 }, #ifdef VERSION_EU - { cutscene_intro_peach_fly_to_pipe, 675 }, + { cutscene_intro_peach_fly_to_pipe, 675 }, #else - { cutscene_intro_peach_fly_to_pipe, 820 }, + { cutscene_intro_peach_fly_to_pipe, 820 }, #endif - { cutscene_intro_peach_mario_appears, 270 }, - { cutscene_intro_peach_dialog, CUTSCENE_LOOP } -}; + { cutscene_intro_peach_mario_appears, 270 }, + { cutscene_intro_peach_dialog, CUTSCENE_LOOP } }; /** * Cutscene that plays when a cannon door is opened. */ -struct Cutscene sCutscenePrepareCannon[] = { - { cutscene_prepare_cannon, 170 }, - { cutscene_prepare_cannon_end, 0 } -}; +struct Cutscene sCutscenePrepareCannon[] = { { cutscene_prepare_cannon, 170 }, { cutscene_prepare_cannon_end, 0 } }; /** * Cutscene that plays when Mario enters the castle grounds after leaving CotMC through the waterfall. */ -struct Cutscene sCutsceneExitWaterfall[] = { - { cutscene_exit_waterfall, 52 }, - { cutscene_exit_to_castle_grounds_end, 0 } -}; +struct Cutscene sCutsceneExitWaterfall[] = { { cutscene_exit_waterfall, 52 }, + { cutscene_exit_to_castle_grounds_end, 0 } }; /** * Cutscene that plays when Mario falls from WMOTR. */ -struct Cutscene sCutsceneFallToCastleGrounds[] = { - { cutscene_exit_fall_to_castle_grounds, 73 }, - { cutscene_exit_to_castle_grounds_end, 0 } -}; +struct Cutscene sCutsceneFallToCastleGrounds[] = { { cutscene_exit_fall_to_castle_grounds, 73 }, + { cutscene_exit_to_castle_grounds_end, 0 } }; /** * Cutscene that plays when Mario enters the pyramid through the hole at the top. */ -struct Cutscene sCutsceneEnterPyramidTop[] = { - { cutscene_enter_pyramid_top, 90 }, - { cutscene_exit_to_castle_grounds_end, 0 } -}; +struct Cutscene sCutsceneEnterPyramidTop[] = { { cutscene_enter_pyramid_top, 90 }, + { cutscene_exit_to_castle_grounds_end, 0 } }; /** * Unused cutscene for when the pyramid explodes. */ -struct Cutscene sCutscenePyramidTopExplode[] = { - { cutscene_mario_dialog, CUTSCENE_LOOP }, - { cutscene_pyramid_top_explode, 150 }, - { cutscene_pyramid_top_explode_end, 0 } -}; +struct Cutscene sCutscenePyramidTopExplode[] = { { cutscene_mario_dialog, CUTSCENE_LOOP }, + { cutscene_pyramid_top_explode, 150 }, + { cutscene_pyramid_top_explode_end, 0 } }; /** * Cutscene that plays when Mario dies while standing, or from electrocution. */ -struct Cutscene sCutsceneStandingDeath[] = { - { cutscene_death_standing, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneStandingDeath[] = { { cutscene_death_standing, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario enters HMC or CotMC. */ -struct Cutscene sCutsceneEnterPool[] = { - { cutscene_enter_pool, 100 }, - { cutscene_exit_to_castle_grounds_end, 0 } -}; +struct Cutscene sCutsceneEnterPool[] = { { cutscene_enter_pool, 100 }, { cutscene_exit_to_castle_grounds_end, 0 } }; /** * Cutscene that plays when Mario dies on his stomach. */ -struct Cutscene sCutsceneDeathStomach[] = { - { cutscene_death_stomach, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDeathStomach[] = { { cutscene_death_stomach, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario dies on his back. */ -struct Cutscene sCutsceneDeathOnBack[] = { - { cutscene_bbh_death, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDeathOnBack[] = { { cutscene_bbh_death, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario dies in quicksand. @@ -10623,25 +10530,19 @@ struct Cutscene sCutsceneQuicksandDeath[] = { /** * Unused cutscene for ACT_WATER_DEATH, which happens when Mario gets hit by an enemy under water. */ -struct Cutscene sCutsceneWaterDeath[] = { - { cutscene_quicksand_death, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneWaterDeath[] = { { cutscene_quicksand_death, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario suffocates. */ -struct Cutscene sCutsceneSuffocation[] = { - { cutscene_suffocation, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneSuffocation[] = { { cutscene_suffocation, CUTSCENE_LOOP } }; /** * Cutscene that plays when entering bowser's arenas. */ -struct Cutscene sCutsceneEnterBowserArena[] = { - { cutscene_bowser_arena, 180 }, - { cutscene_bowser_arena_dialog, CUTSCENE_LOOP }, - { cutscene_bowser_arena_end, 0 } -}; +struct Cutscene sCutsceneEnterBowserArena[] = { { cutscene_bowser_arena, 180 }, + { cutscene_bowser_arena_dialog, CUTSCENE_LOOP }, + { cutscene_bowser_arena_end, 0 } }; // The dance cutscenes are automatically stopped since reset_camera() is called after Mario warps. @@ -10650,106 +10551,76 @@ struct Cutscene sCutsceneEnterBowserArena[] = { * For the default dance, the camera moves closer to Mario, then stays in place. * For the rotate dance, the camera moves closer and rotates clockwise around Mario. */ -struct Cutscene sCutsceneDanceDefaultRotate[] = { - { cutscene_dance_default_rotate, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDanceDefaultRotate[] = { { cutscene_dance_default_rotate, CUTSCENE_LOOP } }; /** * Star dance cutscene. * The camera moves closer and rotates clockwise around Mario. */ -struct Cutscene sCutsceneDanceFlyAway[] = { - { cutscene_dance_fly_away, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDanceFlyAway[] = { { cutscene_dance_fly_away, CUTSCENE_LOOP } }; /** * Star dance cutscene. * The camera moves in for a closeup on Mario. Used in tight spaces and underwater. */ -struct Cutscene sCutsceneDanceCloseup[] = { - { cutscene_dance_closeup, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneDanceCloseup[] = { { cutscene_dance_closeup, CUTSCENE_LOOP } }; /** * Star dance cutscene. * The camera moves closer and rotates clockwise around Mario. */ -struct Cutscene sCutsceneKeyDance[] = { - { cutscene_key_dance, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneKeyDance[] = { { cutscene_key_dance, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario presses a cap switch. */ -struct Cutscene sCutsceneCapSwitchPress[] = { - { cutscene_cap_switch_press, CUTSCENE_LOOP } -}; +struct Cutscene sCutsceneCapSwitchPress[] = { { cutscene_cap_switch_press, CUTSCENE_LOOP } }; /** * Cutscene that plays when Mario opens a sliding star door. */ -struct Cutscene sCutsceneSlidingDoorsOpen[] = { - { cutscene_sliding_doors_open, 50 }, - { cutscene_double_doors_end, 0 } -}; +struct Cutscene sCutsceneSlidingDoorsOpen[] = { { cutscene_sliding_doors_open, 50 }, { cutscene_double_doors_end, 0 } }; /** * Cutscene that plays when Mario unlocks the basement or upstairs key door. */ -struct Cutscene sCutsceneUnlockKeyDoor[] = { - { cutscene_unlock_key_door, 200 }, - { cutscene_double_doors_end, 0 } -}; +struct Cutscene sCutsceneUnlockKeyDoor[] = { { cutscene_unlock_key_door, 200 }, { cutscene_double_doors_end, 0 } }; /** * Cutscene that plays when Mario exits bowser's arena after getting the key. */ -struct Cutscene sCutsceneExitBowserSuccess[] = { - { cutscene_exit_bowser_succ, 190 }, - { cutscene_non_painting_end, 0 } -}; +struct Cutscene sCutsceneExitBowserSuccess[] = { { cutscene_exit_bowser_succ, 190 }, { cutscene_non_painting_end, 0 } }; /** * Unused cutscene for when Mario dies in bowser's arena. Instead, Mario just respawns at the warp pipe. */ -struct Cutscene sCutsceneExitBowserDeath[] = { - { cutscene_exit_bowser_death, 120 }, - { cutscene_non_painting_end, 0 } -}; +struct Cutscene sCutsceneExitBowserDeath[] = { { cutscene_exit_bowser_death, 120 }, { cutscene_non_painting_end, 0 } }; /** * Cutscene that plays when Mario exits a non-painting course, like HMC. */ -struct Cutscene sCutsceneExitSpecialSuccess[] = { - { cutscene_exit_non_painting_succ, 163 }, - { cutscene_non_painting_end, 0 } -}; +struct Cutscene sCutsceneExitSpecialSuccess[] = { { cutscene_exit_non_painting_succ, 163 }, + { cutscene_non_painting_end, 0 } }; /** * Cutscene that plays when Mario exits from dying in a non-painting course, like HMC. */ -struct Cutscene sCutsceneNonPaintingDeath[] = { - { cutscene_non_painting_death, 120 }, - { cutscene_non_painting_end, 0 } -}; +struct Cutscene sCutsceneNonPaintingDeath[] = { { cutscene_non_painting_death, 120 }, + { cutscene_non_painting_end, 0 } }; /** * Cutscene that plays when Mario talks to a creature. */ -struct Cutscene sCutsceneDialog[] = { - { cutscene_dialog, CUTSCENE_LOOP }, - { cutscene_dialog_set_flag, 12 }, - { cutscene_dialog_end, 0 } -}; +struct Cutscene sCutsceneDialog[] = { { cutscene_dialog, CUTSCENE_LOOP }, + { cutscene_dialog_set_flag, 12 }, + { cutscene_dialog_end, 0 } }; /** * Cutscene that plays when Mario reads a sign or message. */ -struct Cutscene sCutsceneReadMessage[] = { - { cutscene_read_message, CUTSCENE_LOOP }, - { cutscene_read_message_set_flag, 15 }, - { cutscene_read_message_end, 0 } -}; +struct Cutscene sCutsceneReadMessage[] = { { cutscene_read_message, CUTSCENE_LOOP }, + { cutscene_read_message_set_flag, 15 }, + { cutscene_read_message_end, 0 } }; /* TODO: * The next two arrays are both related to levels, and they look generated. @@ -10760,8 +10631,8 @@ struct Cutscene sCutsceneReadMessage[] = { * Converts the u32 given in DEFINE_COURSE to a u8 with the odd and even digits rotated into the right * order for sDanceCutsceneIndexTable */ -#define DROT(value, index) ((value >> (32 - (index + 1) * 8)) & 0xF0) >> 4 | \ - ((value >> (32 - (index + 1) * 8)) & 0x0F) << 4 +#define DROT(value, index) \ + ((value >> (32 - (index + 1) * 8)) & 0xF0) >> 4 | ((value >> (32 - (index + 1) * 8)) & 0x0F) << 4 #define DANCE_ENTRY(c) { DROT(c, 0), DROT(c, 1), DROT(c, 2), DROT(c, 3) }, @@ -10779,7 +10650,7 @@ struct Cutscene sCutsceneReadMessage[] = { * 4: Default, used for 100 coin stars, 8 red coin stars in bowser levels, and secret stars */ u8 sDanceCutsceneIndexTable[][4] = { - #include "levels/course_defines.h" +#include "levels/course_defines.h" { 0x44, 0x44, 0x44, 0x04 }, // (26) Why go to all this trouble to save bytes and do this?! }; #undef DEFINE_COURSE @@ -10800,352 +10671,253 @@ u8 sDanceCutsceneIndexTable[][4] = { * and if the result is non-zero, the camera will zoom out. */ u8 sZoomOutAreaMasks[] = { - ZOOMOUT_AREA_MASK(0,0,0,0, 0,0,0,0), // Unused | Unused - ZOOMOUT_AREA_MASK(0,0,0,0, 0,0,0,0), // Unused | Unused - ZOOMOUT_AREA_MASK(0,0,0,0, 1,0,0,0), // BBH | CCM - ZOOMOUT_AREA_MASK(0,0,0,0, 0,0,0,0), // CASTLE_INSIDE | HMC - ZOOMOUT_AREA_MASK(1,0,0,0, 1,0,0,0), // SSL | BOB - ZOOMOUT_AREA_MASK(1,0,0,0, 1,0,0,0), // SL | WDW - ZOOMOUT_AREA_MASK(0,0,0,0, 1,1,0,0), // JRB | THI - ZOOMOUT_AREA_MASK(0,0,0,0, 1,0,0,0), // TTC | RR - ZOOMOUT_AREA_MASK(1,0,0,0, 1,0,0,0), // CASTLE_GROUNDS | BITDW - ZOOMOUT_AREA_MASK(0,0,0,0, 1,0,0,0), // VCUTM | BITFS - ZOOMOUT_AREA_MASK(0,0,0,0, 1,0,0,0), // SA | BITS - ZOOMOUT_AREA_MASK(1,0,0,0, 0,0,0,0), // LLL | DDD - ZOOMOUT_AREA_MASK(1,0,0,0, 0,0,0,0), // WF | ENDING - ZOOMOUT_AREA_MASK(0,0,0,0, 0,0,0,0), // COURTYARD | PSS - ZOOMOUT_AREA_MASK(0,0,0,0, 1,0,0,0), // COTMC | TOTWC - ZOOMOUT_AREA_MASK(1,0,0,0, 1,0,0,0), // BOWSER_1 | WMOTR - ZOOMOUT_AREA_MASK(0,0,0,0, 1,0,0,0), // Unused | BOWSER_2 - ZOOMOUT_AREA_MASK(1,0,0,0, 0,0,0,0), // BOWSER_3 | Unused - ZOOMOUT_AREA_MASK(1,0,0,0, 0,0,0,0), // TTM | Unused - ZOOMOUT_AREA_MASK(0,0,0,0, 0,0,0,0), // Unused | Unused + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 0, 0, 0, 0), // Unused | Unused + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 0, 0, 0, 0), // Unused | Unused + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 0, 0, 0), // BBH | CCM + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 0, 0, 0, 0), // CASTLE_INSIDE | HMC + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 1, 0, 0, 0), // SSL | BOB + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 1, 0, 0, 0), // SL | WDW + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 1, 0, 0), // JRB | THI + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 0, 0, 0), // TTC | RR + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 1, 0, 0, 0), // CASTLE_GROUNDS | BITDW + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 0, 0, 0), // VCUTM | BITFS + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 0, 0, 0), // SA | BITS + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 0, 0, 0, 0), // LLL | DDD + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 0, 0, 0, 0), // WF | ENDING + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 0, 0, 0, 0), // COURTYARD | PSS + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 0, 0, 0), // COTMC | TOTWC + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 1, 0, 0, 0), // BOWSER_1 | WMOTR + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 1, 0, 0, 0), // Unused | BOWSER_2 + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 0, 0, 0, 0), // BOWSER_3 | Unused + ZOOMOUT_AREA_MASK(1, 0, 0, 0, 0, 0, 0, 0), // TTM | Unused + ZOOMOUT_AREA_MASK(0, 0, 0, 0, 0, 0, 0, 0), // Unused | Unused }; -STATIC_ASSERT(ARRAY_COUNT(sZoomOutAreaMasks) - 1 == LEVEL_MAX / 2, "Make sure you edit sZoomOutAreaMasks when adding / removing courses."); +STATIC_ASSERT(ARRAY_COUNT(sZoomOutAreaMasks) - 1 == LEVEL_MAX / 2, + "Make sure you edit sZoomOutAreaMasks when adding / removing courses."); /* * credits spline paths. * TODO: Separate these into their own file(s) */ -struct CutsceneSplinePoint sBobCreditsSplinePositions[] = { - { 1, 0, { 5984, 3255, 4975 } }, - { 2, 0, { 4423, 3315, 1888 } }, - { 3, 0, { 776, 2740, -1825 } }, - { 4, 0, { -146, 3894, -3167 } }, - { -1, 0, { 741, 4387, -5474 } } -}; +struct CutsceneSplinePoint sBobCreditsSplinePositions[] = { { 1, 0, { 5984, 3255, 4975 } }, + { 2, 0, { 4423, 3315, 1888 } }, + { 3, 0, { 776, 2740, -1825 } }, + { 4, 0, { -146, 3894, -3167 } }, + { -1, 0, { 741, 4387, -5474 } } }; -struct CutsceneSplinePoint sBobCreditsSplineFocus[] = { - { 0, 30, { 5817, 3306, 4507 } }, - { 0, 40, { 4025, 3378, 1593 } }, - { 0, 50, { 1088, 2652, -2205 } }, - { 0, 60, { 205, 3959, -3517 } }, - { -1, 60, { 1231, 4400, -5649 } } -}; +struct CutsceneSplinePoint sBobCreditsSplineFocus[] = { { 0, 30, { 5817, 3306, 4507 } }, + { 0, 40, { 4025, 3378, 1593 } }, + { 0, 50, { 1088, 2652, -2205 } }, + { 0, 60, { 205, 3959, -3517 } }, + { -1, 60, { 1231, 4400, -5649 } } }; -struct CutsceneSplinePoint sWfCreditsSplinePositions[] = { - { 0, 0, { -301, 1399, 2643 } }, - { 0, 0, { -182, 2374, 4572 } }, - { 0, 0, { 4696, 3864, 413 } }, - { 0, 0, { 1738, 4891, -1516 } }, - { -1, 0, { 1783, 4891, -1516 } } -}; +struct CutsceneSplinePoint sWfCreditsSplinePositions[] = { { 0, 0, { -301, 1399, 2643 } }, + { 0, 0, { -182, 2374, 4572 } }, + { 0, 0, { 4696, 3864, 413 } }, + { 0, 0, { 1738, 4891, -1516 } }, + { -1, 0, { 1783, 4891, -1516 } } }; -struct CutsceneSplinePoint sWfCreditsSplineFocus[] = { - { 1, 30, { -249, 1484, 2153 } }, - { 2, 40, { -200, 2470, 4082 } }, - { 3, 40, { 4200, 3916, 370 } }, - { 4, 40, { 1523, 4976, -1072 } }, - { -1, 40, { 1523, 4976, -1072 } } -}; +struct CutsceneSplinePoint sWfCreditsSplineFocus[] = { { 1, 30, { -249, 1484, 2153 } }, + { 2, 40, { -200, 2470, 4082 } }, + { 3, 40, { 4200, 3916, 370 } }, + { 4, 40, { 1523, 4976, -1072 } }, + { -1, 40, { 1523, 4976, -1072 } } }; -struct CutsceneSplinePoint sJrbCreditsSplinePositions[] = { - { 0, 0, { 5538, -4272, 2376 } }, - { 0, 0, { 5997, -3303, 2261 } }, - { 0, 0, { 6345, -3255, 2179 } }, - { 0, 0, { 6345, -3255, 2179 } }, - { -1, 0, { 6694, -3203, 2116 } } -}; +struct CutsceneSplinePoint sJrbCreditsSplinePositions[] = { { 0, 0, { 5538, -4272, 2376 } }, + { 0, 0, { 5997, -3303, 2261 } }, + { 0, 0, { 6345, -3255, 2179 } }, + { 0, 0, { 6345, -3255, 2179 } }, + { -1, 0, { 6694, -3203, 2116 } } }; -struct CutsceneSplinePoint sJrbCreditsSplineFocus[] = { - { 0, 50, { 5261, -4683, 2443 } }, - { 0, 50, { 5726, -3675, 2456 } }, - { 0, 50, { 6268, -2817, 2409 } }, - { 0, 50, { 6596, -2866, 2369 } }, - { -1, 50, { 7186, -3153, 2041 } } -}; +struct CutsceneSplinePoint sJrbCreditsSplineFocus[] = { { 0, 50, { 5261, -4683, 2443 } }, + { 0, 50, { 5726, -3675, 2456 } }, + { 0, 50, { 6268, -2817, 2409 } }, + { 0, 50, { 6596, -2866, 2369 } }, + { -1, 50, { 7186, -3153, 2041 } } }; -struct CutsceneSplinePoint sCcmSlideCreditsSplinePositions[] = { - { 0, 0, { -6324, 6745, -5626 } }, - { 1, 0, { -6324, 6745, -5626 } }, - { 2, 0, { -6108, 6762, -5770 } }, - { 3, 0, { -5771, 6787, -5962 } }, - { -1, 0, { -5672, 6790, -5979 } } -}; +struct CutsceneSplinePoint sCcmSlideCreditsSplinePositions[] = { { 0, 0, { -6324, 6745, -5626 } }, + { 1, 0, { -6324, 6745, -5626 } }, + { 2, 0, { -6108, 6762, -5770 } }, + { 3, 0, { -5771, 6787, -5962 } }, + { -1, 0, { -5672, 6790, -5979 } } }; -struct CutsceneSplinePoint sCcmSlideCreditsSplineFocus[] = { - { 0, 50, { -5911, 6758, -5908 } }, - { 1, 50, { -5911, 6758, -5908 } }, - { 2, 50, { -5652, 6814, -5968 } }, - { 3, 50, { -5277, 6801, -6043 } }, - { -1, 50, { -5179, 6804, -6060 } } -}; +struct CutsceneSplinePoint sCcmSlideCreditsSplineFocus[] = { { 0, 50, { -5911, 6758, -5908 } }, + { 1, 50, { -5911, 6758, -5908 } }, + { 2, 50, { -5652, 6814, -5968 } }, + { 3, 50, { -5277, 6801, -6043 } }, + { -1, 50, { -5179, 6804, -6060 } } }; -struct CutsceneSplinePoint sBbhCreditsSplinePositions[] = { - { 1, 0, { 1088, 341, 2447 } }, - { 2, 0, { 1338, 610, 2808 } }, - { 3, 0, { 2267, 1612, 2966 } }, - { -1, 0, { 2296, 1913, 2990 } } -}; +struct CutsceneSplinePoint sBbhCreditsSplinePositions[] = { { 1, 0, { 1088, 341, 2447 } }, + { 2, 0, { 1338, 610, 2808 } }, + { 3, 0, { 2267, 1612, 2966 } }, + { -1, 0, { 2296, 1913, 2990 } } }; -struct CutsceneSplinePoint sBbhCreditsSplineFocus[] = { - { 1, 50, { 1160, 263, 1958 } }, - { 2, 50, { 1034, 472, 2436 } }, - { 3, 50, { 1915, 1833, 2688 } }, - { -1, 50, { 2134, 2316, 2742 } } -}; +struct CutsceneSplinePoint sBbhCreditsSplineFocus[] = { { 1, 50, { 1160, 263, 1958 } }, + { 2, 50, { 1034, 472, 2436 } }, + { 3, 50, { 1915, 1833, 2688 } }, + { -1, 50, { 2134, 2316, 2742 } } }; -struct CutsceneSplinePoint sHmcCreditsSplinePositions[] = { - { 1, 0, { -5952, 1807, -5882 } }, - { 2, 0, { -5623, 1749, -4863 } }, - { 3, 0, { -5472, 1955, -2520 } }, - { 4, 0, { -5544, 1187, -1085 } }, - { -1, 0, { -5547, 391, -721 } } -}; +struct CutsceneSplinePoint sHmcCreditsSplinePositions[] = { { 1, 0, { -5952, 1807, -5882 } }, + { 2, 0, { -5623, 1749, -4863 } }, + { 3, 0, { -5472, 1955, -2520 } }, + { 4, 0, { -5544, 1187, -1085 } }, + { -1, 0, { -5547, 391, -721 } } }; -struct CutsceneSplinePoint sHmcCreditsSplineFocus[] = { - { 1, 210, { -5952, 1884, -6376 } }, - { 2, 58, { -5891, 1711, -5283 } }, - { 3, 30, { -5595, 1699, -2108 } }, - { 4, 31, { -5546, 794, -777 } }, - { -1, 31, { -5548, -85, -572 } } -}; +struct CutsceneSplinePoint sHmcCreditsSplineFocus[] = { { 1, 210, { -5952, 1884, -6376 } }, + { 2, 58, { -5891, 1711, -5283 } }, + { 3, 30, { -5595, 1699, -2108 } }, + { 4, 31, { -5546, 794, -777 } }, + { -1, 31, { -5548, -85, -572 } } }; -struct CutsceneSplinePoint sThiWigglerCreditsSplinePositions[] = { - { 1, 0, { -1411, 2474, -1276 } }, - { 2, 0, { -1606, 2479, -434 } }, - { -1, 0, { -1170, 2122, 1337 } } -}; +struct CutsceneSplinePoint sThiWigglerCreditsSplinePositions[] = { { 1, 0, { -1411, 2474, -1276 } }, + { 2, 0, { -1606, 2479, -434 } }, + { -1, 0, { -1170, 2122, 1337 } } }; -struct CutsceneSplinePoint sThiWigglerCreditsSplineFocus[] = { - { 1, 50, { -1053, 2512, -928 } }, - { 2, 50, { -1234, 2377, -114 } }, - { -1, 50, { -758, 2147, 1054 } } -}; +struct CutsceneSplinePoint sThiWigglerCreditsSplineFocus[] = { { 1, 50, { -1053, 2512, -928 } }, + { 2, 50, { -1234, 2377, -114 } }, + { -1, 50, { -758, 2147, 1054 } } }; struct CutsceneSplinePoint sVolcanoCreditsSplinePositions[] = { - { 0, 0, { -1445, 1094, 1617 } }, - { 0, 0, { -1509, 649, 871 } }, - { 0, 0, { -1133, 420, -248 } }, - { 0, 0, { -778, 359, -1052 } }, - { 0, 0, { -565, 260, -1730 } }, - { -1, 0, { 1274, 473, -275 } } + { 0, 0, { -1445, 1094, 1617 } }, { 0, 0, { -1509, 649, 871 } }, { 0, 0, { -1133, 420, -248 } }, + { 0, 0, { -778, 359, -1052 } }, { 0, 0, { -565, 260, -1730 } }, { -1, 0, { 1274, 473, -275 } } }; struct CutsceneSplinePoint sVolcanoCreditsSplineFocus[] = { - { 0, 50, { -1500, 757, 1251 } }, - { 0, 50, { -1401, 439, 431 } }, - { 0, 50, { -749, 270, -532 } }, - { 0, 50, { -396, 270, -1363 } }, - { 0, 50, { -321, 143, -2151 } }, - { -1, 50, { 1002, 460, -694 } } + { 0, 50, { -1500, 757, 1251 } }, { 0, 50, { -1401, 439, 431 } }, { 0, 50, { -749, 270, -532 } }, + { 0, 50, { -396, 270, -1363 } }, { 0, 50, { -321, 143, -2151 } }, { -1, 50, { 1002, 460, -694 } } }; struct CutsceneSplinePoint sSslCreditsSplinePositions[] = { - { 0, 0, { -4262, 4658, -5015 } }, - { 0, 0, { -3274, 2963, -4661 } }, - { 0, 0, { -2568, 812, -6528 } }, - { 0, 0, { -414, 660, -7232 } }, - { 0, 0, { 1466, 660, -6898 } }, - { -1, 0, { 2724, 660, -6298 } } + { 0, 0, { -4262, 4658, -5015 } }, { 0, 0, { -3274, 2963, -4661 } }, { 0, 0, { -2568, 812, -6528 } }, + { 0, 0, { -414, 660, -7232 } }, { 0, 0, { 1466, 660, -6898 } }, { -1, 0, { 2724, 660, -6298 } } }; struct CutsceneSplinePoint sSslCreditsSplineFocus[] = { - { 0, 50, { -4083, 4277, -4745 } }, - { 0, 50, { -2975, 2574, -4759 } }, - { 0, 50, { -2343, 736, -6088 } }, - { 0, 50, { -535, 572, -6755 } }, - { 0, 50, { 1311, 597, -6427 } }, - { -1, 50, { 2448, 612, -5884 } } + { 0, 50, { -4083, 4277, -4745 } }, { 0, 50, { -2975, 2574, -4759 } }, { 0, 50, { -2343, 736, -6088 } }, + { 0, 50, { -535, 572, -6755 } }, { 0, 50, { 1311, 597, -6427 } }, { -1, 50, { 2448, 612, -5884 } } }; struct CutsceneSplinePoint sDddCreditsSplinePositions[] = { - { 0, 0, { -874, -4933, 366 } }, - { 0, 0, { -1463, -4782, 963 } }, - { 0, 0, { -1893, -4684, 1303 } }, - { 0, 0, { -2818, -4503, 1583 } }, - { 0, 0, { -4095, -2924, 730 } }, - { 0, 0, { -4737, -1594, -63 } }, + { 0, 0, { -874, -4933, 366 } }, { 0, 0, { -1463, -4782, 963 } }, { 0, 0, { -1893, -4684, 1303 } }, + { 0, 0, { -2818, -4503, 1583 } }, { 0, 0, { -4095, -2924, 730 } }, { 0, 0, { -4737, -1594, -63 } }, { -1, 0, { -4681, -1084, -623 } } }; struct CutsceneSplinePoint sDddCreditsSplineFocus[] = { - { 0, 50, { -1276, -4683, 622 } }, - { 0, 50, { -1858, -4407, 1097 } }, - { 0, 50, { -2324, -4332, 1318 } }, - { 0, 50, { -3138, -4048, 1434 } }, - { 0, 50, { -4353, -2444, 533 } }, - { 0, 50, { -4807, -1169, -436 } }, + { 0, 50, { -1276, -4683, 622 } }, { 0, 50, { -1858, -4407, 1097 } }, { 0, 50, { -2324, -4332, 1318 } }, + { 0, 50, { -3138, -4048, 1434 } }, { 0, 50, { -4353, -2444, 533 } }, { 0, 50, { -4807, -1169, -436 } }, { -1, 50, { -4665, -664, -1007 } } }; -struct CutsceneSplinePoint sSlCreditsSplinePositions[] = { - { 0, 0, { 939, 6654, 6196 } }, - { 0, 0, { 1873, 5160, 3714 } }, - { 0, 0, { 3120, 3564, 1314 } }, - { -1, 0, { 2881, 4231, 573 } } -}; +struct CutsceneSplinePoint sSlCreditsSplinePositions[] = { { 0, 0, { 939, 6654, 6196 } }, + { 0, 0, { 1873, 5160, 3714 } }, + { 0, 0, { 3120, 3564, 1314 } }, + { -1, 0, { 2881, 4231, 573 } } }; -struct CutsceneSplinePoint sSlCreditsSplineFocus[] = { - { 0, 50, { 875, 6411, 5763 } }, - { 0, 50, { 1659, 4951, 3313 } }, - { 0, 50, { 2630, 3565, 1215 } }, - { -1, 50, { 2417, 4056, 639 } } -}; +struct CutsceneSplinePoint sSlCreditsSplineFocus[] = { { 0, 50, { 875, 6411, 5763 } }, + { 0, 50, { 1659, 4951, 3313 } }, + { 0, 50, { 2630, 3565, 1215 } }, + { -1, 50, { 2417, 4056, 639 } } }; -struct CutsceneSplinePoint sWdwCreditsSplinePositions[] = { - { 0, 0, { 3927, 2573, 3685 } }, - { 0, 0, { 2389, 2054, 1210 } }, - { 0, 0, { 2309, 2069, 22 } }, - { -1, 0, { 2122, 2271, -979 } } -}; +struct CutsceneSplinePoint sWdwCreditsSplinePositions[] = { { 0, 0, { 3927, 2573, 3685 } }, + { 0, 0, { 2389, 2054, 1210 } }, + { 0, 0, { 2309, 2069, 22 } }, + { -1, 0, { 2122, 2271, -979 } } }; -struct CutsceneSplinePoint sWdwCreditsSplineFocus[] = { - { 0, 50, { 3637, 2460, 3294 } }, - { 0, 50, { 1984, 2067, 918 } }, - { 0, 50, { 1941, 2255, -261 } }, - { -1, 50, { 1779, 2587, -1158 } } -}; +struct CutsceneSplinePoint sWdwCreditsSplineFocus[] = { { 0, 50, { 3637, 2460, 3294 } }, + { 0, 50, { 1984, 2067, 918 } }, + { 0, 50, { 1941, 2255, -261 } }, + { -1, 50, { 1779, 2587, -1158 } } }; struct CutsceneSplinePoint sTtmCreditsSplinePositions[] = { - { 0, 0, { 386, 2535, 644 } }, - { 0, 0, { 1105, 2576, 918 } }, - { 0, 0, { 3565, 2261, 2098 } }, - { 0, 0, { 6715, -2791, 4554 } }, - { 0, 0, { 3917, -3130, 3656 } }, - { -1, 0, { 3917, -3130, 3656 } } + { 0, 0, { 386, 2535, 644 } }, { 0, 0, { 1105, 2576, 918 } }, { 0, 0, { 3565, 2261, 2098 } }, + { 0, 0, { 6715, -2791, 4554 } }, { 0, 0, { 3917, -3130, 3656 } }, { -1, 0, { 3917, -3130, 3656 } } }; struct CutsceneSplinePoint sTtmCreditsSplineFocus[] = { - { 1, 50, { 751, 2434, 318 } }, - { 2, 50, { 768, 2382, 603 } }, - { 3, 60, { 3115, 2086, 1969 } }, - { 4, 30, { 6370, -3108, 4727 } }, - { 5, 50, { 4172, -3385, 4001 } }, - { -1, 50, { 4172, -3385, 4001 } } + { 1, 50, { 751, 2434, 318 } }, { 2, 50, { 768, 2382, 603 } }, { 3, 60, { 3115, 2086, 1969 } }, + { 4, 30, { 6370, -3108, 4727 } }, { 5, 50, { 4172, -3385, 4001 } }, { -1, 50, { 4172, -3385, 4001 } } }; struct CutsceneSplinePoint sThiHugeCreditsSplinePositions[] = { - { 0, 0, { 6990, -1000, -4858 } }, - { 0, 0, { 7886, -1055, 2878 } }, - { 0, 0, { 1952, -1481, 10920 } }, - { 0, 0, { -1684, -219, 2819 } }, - { 0, 0, { -2427, -131, 2755 } }, - { 0, 0, { -3246, 416, 3286 } }, + { 0, 0, { 6990, -1000, -4858 } }, { 0, 0, { 7886, -1055, 2878 } }, { 0, 0, { 1952, -1481, 10920 } }, + { 0, 0, { -1684, -219, 2819 } }, { 0, 0, { -2427, -131, 2755 } }, { 0, 0, { -3246, 416, 3286 } }, { -1, 0, { -3246, 416, 3286 } } }; struct CutsceneSplinePoint sThiHugeCreditsSplineFocus[] = { - { 1, 70, { 7022, -965, -5356 } }, - { 2, 40, { 7799, -915, 2405 } }, - { 3, 60, { 1878, -1137, 10568 } }, - { 4, 50, { -1931, -308, 2394 } }, - { 5, 50, { -2066, -386, 2521 } }, - { 6, 50, { -2875, 182, 3045 } }, + { 1, 70, { 7022, -965, -5356 } }, { 2, 40, { 7799, -915, 2405 } }, { 3, 60, { 1878, -1137, 10568 } }, + { 4, 50, { -1931, -308, 2394 } }, { 5, 50, { -2066, -386, 2521 } }, { 6, 50, { -2875, 182, 3045 } }, { -1, 50, { -2875, 182, 3045 } } }; -struct CutsceneSplinePoint sTtcCreditsSplinePositions[] = { - { 1, 0, { -1724, 277, -994 } }, - { 2, 0, { -1720, 456, -995 } }, - { 3, 0, { -1655, 810, -1014 } }, - { -1, 0, { -1753, 883, -1009 } } -}; +struct CutsceneSplinePoint sTtcCreditsSplinePositions[] = { { 1, 0, { -1724, 277, -994 } }, + { 2, 0, { -1720, 456, -995 } }, + { 3, 0, { -1655, 810, -1014 } }, + { -1, 0, { -1753, 883, -1009 } } }; -struct CutsceneSplinePoint sTtcCreditsSplineFocus[] = { - { 1, 50, { -1554, 742, -1063 } }, - { 2, 50, { -1245, 571, -1102 } }, - { 3, 50, { -1220, 603, -1151 } }, - { -1, 50, { -1412, 520, -1053 } } -}; +struct CutsceneSplinePoint sTtcCreditsSplineFocus[] = { { 1, 50, { -1554, 742, -1063 } }, + { 2, 50, { -1245, 571, -1102 } }, + { 3, 50, { -1220, 603, -1151 } }, + { -1, 50, { -1412, 520, -1053 } } }; -struct CutsceneSplinePoint sRrCreditsSplinePositions[] = { - { 0, 0, { -1818, 4036, 97 } }, - { 0, 0, { -575, 3460, -505 } }, - { 0, 0, { 1191, 3611, -1134 } }, - { -1, 0, { 2701, 3777, -3686 } } -}; +struct CutsceneSplinePoint sRrCreditsSplinePositions[] = { { 0, 0, { -1818, 4036, 97 } }, + { 0, 0, { -575, 3460, -505 } }, + { 0, 0, { 1191, 3611, -1134 } }, + { -1, 0, { 2701, 3777, -3686 } } }; -struct CutsceneSplinePoint sRrCreditsSplineFocus[] = { - { 0, 50, { -1376, 3885, -81 } }, - { 0, 50, { -146, 3343, -734 } }, - { 0, 50, { 1570, 3446, -1415 } }, - { -1, 50, { 2794, 3627, -3218 } } -}; +struct CutsceneSplinePoint sRrCreditsSplineFocus[] = { { 0, 50, { -1376, 3885, -81 } }, + { 0, 50, { -146, 3343, -734 } }, + { 0, 50, { 1570, 3446, -1415 } }, + { -1, 50, { 2794, 3627, -3218 } } }; -struct CutsceneSplinePoint sSaCreditsSplinePositions[] = { - { 0, 0, { -295, -396, -585 } }, - { 1, 0, { -295, -396, -585 } }, - { 2, 0, { -292, -856, -573 } }, - { 3, 0, { -312, -856, -541 } }, - { -1, 0, { 175, -856, -654 } } -}; +struct CutsceneSplinePoint sSaCreditsSplinePositions[] = { { 0, 0, { -295, -396, -585 } }, + { 1, 0, { -295, -396, -585 } }, + { 2, 0, { -292, -856, -573 } }, + { 3, 0, { -312, -856, -541 } }, + { -1, 0, { 175, -856, -654 } } }; -struct CutsceneSplinePoint sSaCreditsSplineFocus[] = { - { 0, 50, { -175, -594, -142 } }, - { 1, 50, { -175, -594, -142 } }, - { 2, 50, { -195, -956, -92 } }, - { 3, 50, { -572, -956, -150 } }, - { -1, 50, { -307, -956, -537 } } -}; +struct CutsceneSplinePoint sSaCreditsSplineFocus[] = { { 0, 50, { -175, -594, -142 } }, + { 1, 50, { -175, -594, -142 } }, + { 2, 50, { -195, -956, -92 } }, + { 3, 50, { -572, -956, -150 } }, + { -1, 50, { -307, -956, -537 } } }; -struct CutsceneSplinePoint sCotmcCreditsSplinePositions[] = { - { 0, 0, { -296, 495, 1607 } }, - { 0, 0, { -430, 541, 654 } }, - { 0, 0, { -466, 601, -359 } }, - { 0, 0, { -217, 433, -1549 } }, - { -1, 0, { -95, 366, -2922 } } -}; +struct CutsceneSplinePoint sCotmcCreditsSplinePositions[] = { { 0, 0, { -296, 495, 1607 } }, + { 0, 0, { -430, 541, 654 } }, + { 0, 0, { -466, 601, -359 } }, + { 0, 0, { -217, 433, -1549 } }, + { -1, 0, { -95, 366, -2922 } } }; -struct CutsceneSplinePoint sCotmcCreditsSplineFocus[] = { - { 0, 50, { -176, 483, 2092 } }, - { 0, 50, { -122, 392, 1019 } }, - { 0, 50, { -268, 450, -792 } }, - { 0, 50, { -172, 399, -2046 } }, - { -1, 50, { -51, 355, -3420 } } -}; +struct CutsceneSplinePoint sCotmcCreditsSplineFocus[] = { { 0, 50, { -176, 483, 2092 } }, + { 0, 50, { -122, 392, 1019 } }, + { 0, 50, { -268, 450, -792 } }, + { 0, 50, { -172, 399, -2046 } }, + { -1, 50, { -51, 355, -3420 } } }; -struct CutsceneSplinePoint sDddSubCreditsSplinePositions[] = { - { 0, 0, { 4656, 2171, 5028 } }, - { 0, 0, { 4548, 1182, 4596 } }, - { 0, 0, { 5007, 813, 3257 } }, - { 0, 0, { 5681, 648, 1060 } }, - { -1, 0, { 4644, 774, 113 } } -}; +struct CutsceneSplinePoint sDddSubCreditsSplinePositions[] = { { 0, 0, { 4656, 2171, 5028 } }, + { 0, 0, { 4548, 1182, 4596 } }, + { 0, 0, { 5007, 813, 3257 } }, + { 0, 0, { 5681, 648, 1060 } }, + { -1, 0, { 4644, 774, 113 } } }; -struct CutsceneSplinePoint sDddSubCreditsSplineFocus[] = { - { 0, 50, { 4512, 2183, 4549 } }, - { 0, 50, { 4327, 838, 4308 } }, - { 0, 50, { 4774, 749, 2819 } }, - { 0, 50, { 5279, 660, 763 } }, - { -1, 50, { 4194, 885, -75 } } -}; +struct CutsceneSplinePoint sDddSubCreditsSplineFocus[] = { { 0, 50, { 4512, 2183, 4549 } }, + { 0, 50, { 4327, 838, 4308 } }, + { 0, 50, { 4774, 749, 2819 } }, + { 0, 50, { 5279, 660, 763 } }, + { -1, 50, { 4194, 885, -75 } } }; -struct CutsceneSplinePoint sCcmOutsideCreditsSplinePositions[] = { - { 1, 0, { 1427, -1387, 5409 } }, - { 2, 0, { -1646, -1536, 4526 } }, - { 3, 0, { -3852, -1448, 3913 } }, - { -1, 0, { -5199, -1366, 1886 } } -}; +struct CutsceneSplinePoint sCcmOutsideCreditsSplinePositions[] = { { 1, 0, { 1427, -1387, 5409 } }, + { 2, 0, { -1646, -1536, 4526 } }, + { 3, 0, { -3852, -1448, 3913 } }, + { -1, 0, { -5199, -1366, 1886 } } }; -struct CutsceneSplinePoint sCcmOutsideCreditsSplineFocus[] = { - { 1, 50, { 958, -1481, 5262 } }, - { 2, 50, { -2123, -1600, 4391 } }, - { 3, 50, { -3957, -1401, 3426 } }, - { -1, 50, { -4730, -1215, 1795 } } -}; +struct CutsceneSplinePoint sCcmOutsideCreditsSplineFocus[] = { { 1, 50, { 958, -1481, 5262 } }, + { 2, 50, { -2123, -1600, 4391 } }, + { 3, 50, { -3957, -1401, 3426 } }, + { -1, 50, { -4730, -1215, 1795 } } }; /** * Play the current cutscene until either gCutsceneTimer reaches the max time, or c->cutscene is set to 0 @@ -11153,7 +10925,7 @@ struct CutsceneSplinePoint sCcmOutsideCreditsSplineFocus[] = { * Note that CAM_FLAG_SMOOTH_MOVEMENT is cleared while a cutscene is playing, so cutscenes set it for * the duration they want the flag to be active. */ -void play_cutscene(struct Camera *c) { +void play_cutscene(struct Camera* c) { UNUSED u8 filler[12]; UNUSED s16 unusedYawFocToMario; s16 cutsceneDuration; @@ -11164,10 +10936,10 @@ void play_cutscene(struct Camera *c) { sStatusFlags &= ~CAM_FLAG_SMOOTH_MOVEMENT; gCameraMovementFlags &= ~CAM_MOVING_INTO_MODE; -#define CUTSCENE(id, cutscene) \ - case id: \ - cutsceneDuration = cutscene[sCutsceneShot].duration; \ - cutscene[sCutsceneShot].shot(c); \ +#define CUTSCENE(id, cutscene) \ + case id: \ + cutsceneDuration = cutscene[sCutsceneShot].duration; \ + cutscene[sCutsceneShot].shot(c); \ break; switch (c->cutscene) { @@ -11250,7 +11022,7 @@ void play_cutscene(struct Camera *c) { * Call the event while `start` <= gCutsceneTimer <= `end` * If `end` is -1, call for the rest of the shot. */ -s32 cutscene_event(CameraEvent event, struct Camera *c, s16 start, s16 end) { +s32 cutscene_event(CameraEvent event, struct Camera* c, s16 start, s16 end) { if (start <= gCutsceneTimer) { if (end == -1 || end >= gCutsceneTimer) { event(c); @@ -11303,7 +11075,7 @@ void set_fov_shake_from_point(s16 amplitude, s16 decay, s16 shakeSpeed, f32 maxD /** * Add a cyclic offset to the camera's field of view based on a cosine wave */ -void shake_camera_fov(struct GraphNodePerspective *perspective) { +void shake_camera_fov(struct GraphNodePerspective* perspective) { if (sFOVState.shakeAmplitude != 0.f) { sFOVState.fovOffset = coss(sFOVState.shakePhase) * sFOVState.shakeAmplitude / 0x100; sFOVState.shakePhase += sFOVState.shakeSpeed; @@ -11314,27 +11086,27 @@ void shake_camera_fov(struct GraphNodePerspective *perspective) { } } -static UNUSED void unused_deactivate_sleeping_camera(UNUSED struct MarioState *m) { +static UNUSED void unused_deactivate_sleeping_camera(UNUSED struct MarioState* m) { sStatusFlags &= ~CAM_FLAG_SLEEPING; } -void set_fov_30(UNUSED struct MarioState *m) { +void set_fov_30(UNUSED struct MarioState* m) { sFOVState.fov = 30.f; } -void approach_fov_20(UNUSED struct MarioState *m) { +void approach_fov_20(UNUSED struct MarioState* m) { camera_approach_f32_symmetric_bool(&sFOVState.fov, 20.f, 0.3f); } -void set_fov_45(UNUSED struct MarioState *m) { +void set_fov_45(UNUSED struct MarioState* m) { sFOVState.fov = 45.f; } -void set_fov_29(UNUSED struct MarioState *m) { +void set_fov_29(UNUSED struct MarioState* m) { sFOVState.fov = 29.f; } -void zoom_fov_30(UNUSED struct MarioState *m) { +void zoom_fov_30(UNUSED struct MarioState* m) { // Pretty sure approach_f32_asymptotic_bool would do a much nicer job here, but you do you, // Nintendo. camera_approach_f32_symmetric_bool(&sFOVState.fov, 30.f, (30.f - sFOVState.fov) / 60.f); @@ -11344,7 +11116,7 @@ void zoom_fov_30(UNUSED struct MarioState *m) { * This is the default fov function. It makes fov approach 45 degrees, and it handles zooming in when * Mario falls a sleep. */ -void fov_default(struct MarioState *m) { +void fov_default(struct MarioState* m) { sStatusFlags &= ~CAM_FLAG_SLEEPING; if ((m->action == ACT_SLEEPING) || (m->action == ACT_START_SLEEPING)) { @@ -11360,19 +11132,19 @@ void fov_default(struct MarioState *m) { } //??! Literally the exact same as below -static UNUSED void unused_approach_fov_30(UNUSED struct MarioState *m) { +static UNUSED void unused_approach_fov_30(UNUSED struct MarioState* m) { camera_approach_f32_symmetric_bool(&sFOVState.fov, 30.f, 1.f); } -void approach_fov_30(UNUSED struct MarioState *m) { +void approach_fov_30(UNUSED struct MarioState* m) { camera_approach_f32_symmetric_bool(&sFOVState.fov, 30.f, 1.f); } -void approach_fov_60(UNUSED struct MarioState *m) { +void approach_fov_60(UNUSED struct MarioState* m) { camera_approach_f32_symmetric_bool(&sFOVState.fov, 60.f, 1.f); } -void approach_fov_45(struct MarioState *m) { +void approach_fov_45(struct MarioState* m) { f32 targetFoV = sFOVState.fov; if (m->area->camera->mode == CAMERA_MODE_FIXED && m->area->camera->cutscene == 0) { @@ -11384,7 +11156,7 @@ void approach_fov_45(struct MarioState *m) { sFOVState.fov = approach_f32(sFOVState.fov, targetFoV, 2.f, 2.f); } -void approach_fov_80(UNUSED struct MarioState *m) { +void approach_fov_80(UNUSED struct MarioState* m) { camera_approach_f32_symmetric_bool(&sFOVState.fov, 80.f, 3.5f); } @@ -11392,7 +11164,7 @@ void approach_fov_80(UNUSED struct MarioState *m) { * Sets the fov in BBH. * If there's a cutscene, sets fov to 45. Otherwise sets fov to 60. */ -void set_fov_bbh(struct MarioState *m) { +void set_fov_bbh(struct MarioState* m) { f32 targetFoV = sFOVState.fov; if (m->area->camera->mode == CAMERA_MODE_FIXED && m->area->camera->cutscene == 0) { @@ -11407,9 +11179,9 @@ void set_fov_bbh(struct MarioState *m) { /** * Sets the field of view for the GraphNodeCamera */ -Gfx *geo_camera_fov(s32 callContext, struct GraphNode *g, UNUSED void *context) { - struct GraphNodePerspective *perspective = (struct GraphNodePerspective *) g; - struct MarioState *marioState = &gMarioStates[0]; +Gfx* geo_camera_fov(s32 callContext, struct GraphNode* g, UNUSED void* context) { + struct GraphNodePerspective* perspective = (struct GraphNodePerspective*)g; + struct MarioState* marioState = &gMarioStates[0]; u8 fovFunc = sFOVState.fovFunc; if (callContext == GEO_CONTEXT_RENDER) { @@ -11447,7 +11219,7 @@ Gfx *geo_camera_fov(s32 callContext, struct GraphNode *g, UNUSED void *context) case CAM_FOV_APP_60: approach_fov_60(marioState); break; - //! No default case + //! No default case } } @@ -11505,7 +11277,7 @@ void set_fov_shake_from_point_preset(u8 preset, f32 posX, f32 posY, f32 posZ) { /** * Offset an object's position in a random direction within the given bounds. */ -static UNUSED void unused_displace_obj_randomly(struct Object *o, f32 xRange, f32 yRange, f32 zRange) { +static UNUSED void unused_displace_obj_randomly(struct Object* o, f32 xRange, f32 yRange, f32 zRange) { f32 rnd = random_float(); o->oPosX += (rnd * xRange - xRange / 2.f); @@ -11516,7 +11288,7 @@ static UNUSED void unused_displace_obj_randomly(struct Object *o, f32 xRange, f3 /** * Rotate an object in a random direction within the given bounds. */ -static UNUSED void unused_rotate_obj_randomly(struct Object *o, f32 pitchRange, f32 yawRange) { +static UNUSED void unused_rotate_obj_randomly(struct Object* o, f32 pitchRange, f32 yawRange) { f32 rnd = random_float(); o->oMoveAnglePitch += (s16)(rnd * pitchRange - pitchRange / 2.f); @@ -11526,7 +11298,7 @@ static UNUSED void unused_rotate_obj_randomly(struct Object *o, f32 pitchRange, /** * Rotate the object towards the point `point`. */ -void obj_rotate_towards_point(struct Object *o, Vec3f point, s16 pitchOff, s16 yawOff, s16 pitchDiv, s16 yawDiv) { +void obj_rotate_towards_point(struct Object* o, Vec3f point, s16 pitchOff, s16 yawOff, s16 pitchDiv, s16 yawDiv) { f32 dist; s16 pitch, yaw; Vec3f oPos; diff --git a/src/game/crash_screen.c b/src/game/crash_screen.c index 4b701c03..68556b35 100644 --- a/src/game/crash_screen.c +++ b/src/game/crash_screen.c @@ -9,21 +9,19 @@ #include "lib/src/printf.h" u8 gCrashScreenCharToGlyph[128] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, 43, -1, -1, 37, 38, -1, 42, - -1, 39, 44, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 36, -1, -1, -1, -1, 40, -1, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - 33, 34, 35, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 41, -1, -1, -1, 43, -1, -1, 37, 38, -1, 42, -1, 39, 44, -1, 0, 1, 2, 3, + 4, 5, 6, 7, 8, 9, 36, -1, -1, -1, -1, 40, -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, -1, 10, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, }; // A height of seven pixels for each Character * nine rows of characters + one row unused. u32 gCrashScreenFont[7 * 9 + 1] = { - #include "textures/crash_screen/crash_screen_font.ia1.inc.c" +#include "textures/crash_screen/crash_screen_font.ia1.inc.c" }; - -char *gCauseDesc[18] = { +char* gCauseDesc[18] = { "Interrupt", "TLB modification", "TLB exception on load", @@ -44,13 +42,10 @@ char *gCauseDesc[18] = { "Virtual coherency on data", }; -char *gFpcsrDesc[6] = { - "Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", - "Inexact operation", +char* gFpcsrDesc[6] = { + "Unimplemented operation", "Invalid operation", "Division by zero", "Overflow", "Underflow", "Inexact operation", }; - - extern u64 osClockRate; struct { @@ -58,13 +53,13 @@ struct { u64 stack[0x800 / sizeof(u64)]; OSMesgQueue mesgQueue; OSMesg mesg; - u16 *framebuffer; + u16* framebuffer; u16 width; u16 height; } gCrashScreen; void crash_screen_draw_rect(s32 x, s32 y, s32 w, s32 h) { - u16 *ptr; + u16* ptr; s32 i, j; ptr = gCrashScreen.framebuffer + gCrashScreen.width * y + x; @@ -79,8 +74,8 @@ void crash_screen_draw_rect(s32 x, s32 y, s32 w, s32 h) { } void crash_screen_draw_glyph(s32 x, s32 y, s32 glyph) { - const u32 *data; - u16 *ptr; + const u32* data; + u16* ptr; u32 bit; u32 rowMask; s32 i, j; @@ -100,12 +95,12 @@ void crash_screen_draw_glyph(s32 x, s32 y, s32 glyph) { } } -static char *write_to_buf(char *buffer, const char *data, size_t size) { - return (char *) memcpy(buffer, data, size) + size; +static char* write_to_buf(char* buffer, const char* data, size_t size) { + return (char*)memcpy(buffer, data, size) + size; } -void crash_screen_print(s32 x, s32 y, const char *fmt, ...) { - char *ptr; +void crash_screen_print(s32 x, s32 y, const char* fmt, ...) { + char* ptr; u32 glyph; s32 size; char buf[0x100]; @@ -145,18 +140,17 @@ void crash_screen_print(s32 x, s32 y, const char *fmt, ...) { void crash_screen_sleep(s32 ms) { u64 cycles = ms * 1000LL * osClockRate / 1000000ULL; osSetTime(0); - while (osGetTime() < cycles) { - } + while (osGetTime() < cycles) {} } -void crash_screen_print_float_reg(s32 x, s32 y, s32 regNum, void *addr) { +void crash_screen_print_float_reg(s32 x, s32 y, s32 regNum, void* addr) { u32 bits; s32 exponent; - bits = *(u32 *) addr; + bits = *(u32*)addr; exponent = ((bits & 0x7f800000U) >> 0x17) - 0x7f; if ((exponent >= -0x7e && exponent <= 0x7f) || bits == 0) { - crash_screen_print(x, y, "F%02d:%.3e", regNum, *(f32 *) addr); + crash_screen_print(x, y, "F%02d:%.3e", regNum, *(f32*)addr); } else { crash_screen_print(x, y, "F%02d:---------", regNum); } @@ -177,9 +171,9 @@ void crash_screen_print_fpcsr(u32 fpcsr) { } } -void draw_crash_screen(OSThread *thread) { +void draw_crash_screen(OSThread* thread) { s16 cause; - __OSThreadContext *tc = &thread->context; + __OSThreadContext* tc = &thread->context; cause = (tc->cause >> 2) & 0x1f; if (cause == 23) { // EXC_WATCH @@ -201,25 +195,16 @@ void draw_crash_screen(OSThread *thread) { #endif crash_screen_sleep(2000); crash_screen_draw_rect(25, 45, 270, 185); - crash_screen_print(30, 50, "AT:%08XH V0:%08XH V1:%08XH", (u32) tc->at, (u32) tc->v0, - (u32) tc->v1); - crash_screen_print(30, 60, "A0:%08XH A1:%08XH A2:%08XH", (u32) tc->a0, (u32) tc->a1, - (u32) tc->a2); - crash_screen_print(30, 70, "A3:%08XH T0:%08XH T1:%08XH", (u32) tc->a3, (u32) tc->t0, - (u32) tc->t1); - crash_screen_print(30, 80, "T2:%08XH T3:%08XH T4:%08XH", (u32) tc->t2, (u32) tc->t3, - (u32) tc->t4); - crash_screen_print(30, 90, "T5:%08XH T6:%08XH T7:%08XH", (u32) tc->t5, (u32) tc->t6, - (u32) tc->t7); - crash_screen_print(30, 100, "S0:%08XH S1:%08XH S2:%08XH", (u32) tc->s0, (u32) tc->s1, - (u32) tc->s2); - crash_screen_print(30, 110, "S3:%08XH S4:%08XH S5:%08XH", (u32) tc->s3, (u32) tc->s4, - (u32) tc->s5); - crash_screen_print(30, 120, "S6:%08XH S7:%08XH T8:%08XH", (u32) tc->s6, (u32) tc->s7, - (u32) tc->t8); - crash_screen_print(30, 130, "T9:%08XH GP:%08XH SP:%08XH", (u32) tc->t9, (u32) tc->gp, - (u32) tc->sp); - crash_screen_print(30, 140, "S8:%08XH RA:%08XH", (u32) tc->s8, (u32) tc->ra); + crash_screen_print(30, 50, "AT:%08XH V0:%08XH V1:%08XH", (u32)tc->at, (u32)tc->v0, (u32)tc->v1); + crash_screen_print(30, 60, "A0:%08XH A1:%08XH A2:%08XH", (u32)tc->a0, (u32)tc->a1, (u32)tc->a2); + crash_screen_print(30, 70, "A3:%08XH T0:%08XH T1:%08XH", (u32)tc->a3, (u32)tc->t0, (u32)tc->t1); + crash_screen_print(30, 80, "T2:%08XH T3:%08XH T4:%08XH", (u32)tc->t2, (u32)tc->t3, (u32)tc->t4); + crash_screen_print(30, 90, "T5:%08XH T6:%08XH T7:%08XH", (u32)tc->t5, (u32)tc->t6, (u32)tc->t7); + crash_screen_print(30, 100, "S0:%08XH S1:%08XH S2:%08XH", (u32)tc->s0, (u32)tc->s1, (u32)tc->s2); + crash_screen_print(30, 110, "S3:%08XH S4:%08XH S5:%08XH", (u32)tc->s3, (u32)tc->s4, (u32)tc->s5); + crash_screen_print(30, 120, "S6:%08XH S7:%08XH T8:%08XH", (u32)tc->s6, (u32)tc->s7, (u32)tc->t8); + crash_screen_print(30, 130, "T9:%08XH GP:%08XH SP:%08XH", (u32)tc->t9, (u32)tc->gp, (u32)tc->sp); + crash_screen_print(30, 140, "S8:%08XH RA:%08XH", (u32)tc->s8, (u32)tc->ra); crash_screen_print_fpcsr(tc->fpcsr); #ifdef VERSION_EU osWritebackDCacheAll(); @@ -247,13 +232,12 @@ void draw_crash_screen(OSThread *thread) { osViSwapBuffer(gCrashScreen.framebuffer); } -OSThread *get_crashed_thread(void) { - OSThread *thread; +OSThread* get_crashed_thread(void) { + OSThread* thread; thread = __osGetCurrFaultedThread(); while (thread->priority != -1) { - if (thread->priority > OS_PRIORITY_IDLE && thread->priority < OS_PRIORITY_APPMAX - && (thread->flags & 3) != 0) { + if (thread->priority > OS_PRIORITY_IDLE && thread->priority < OS_PRIORITY_APPMAX && (thread->flags & 3) != 0) { return thread; } thread = thread->tlnext; @@ -261,26 +245,25 @@ OSThread *get_crashed_thread(void) { return NULL; } -void thread2_crash_screen(UNUSED void *arg) { +void thread2_crash_screen(UNUSED void* arg) { OSMesg mesg; - OSThread *thread; + OSThread* thread; - osSetEventMesg(OS_EVENT_CPU_BREAK, &gCrashScreen.mesgQueue, (OSMesg) 1); - osSetEventMesg(OS_EVENT_FAULT, &gCrashScreen.mesgQueue, (OSMesg) 2); + osSetEventMesg(OS_EVENT_CPU_BREAK, &gCrashScreen.mesgQueue, (OSMesg)1); + osSetEventMesg(OS_EVENT_FAULT, &gCrashScreen.mesgQueue, (OSMesg)2); do { osRecvMesg(&gCrashScreen.mesgQueue, &mesg, 1); thread = get_crashed_thread(); } while (thread == NULL); draw_crash_screen(thread); - for (;;) { - } + for (;;) {} } -void crash_screen_set_framebuffer(u16 *framebuffer, u16 width, u16 height) { +void crash_screen_set_framebuffer(u16* framebuffer, u16 width, u16 height) { #ifdef VERSION_EU gCrashScreen.framebuffer = framebuffer; #else - gCrashScreen.framebuffer = (u16 *)((uintptr_t)framebuffer | 0xa0000000); + gCrashScreen.framebuffer = (u16*)((uintptr_t)framebuffer | 0xa0000000); #endif gCrashScreen.width = width; gCrashScreen.height = height; @@ -288,9 +271,9 @@ void crash_screen_set_framebuffer(u16 *framebuffer, u16 width, u16 height) { void crash_screen_init(void) { #ifdef VERSION_EU - gCrashScreen.framebuffer = (u16 *) (osMemSize | 0x80000000) - SCREEN_WIDTH * SCREEN_HEIGHT; + gCrashScreen.framebuffer = (u16*)(osMemSize | 0x80000000) - SCREEN_WIDTH * SCREEN_HEIGHT; #else - gCrashScreen.framebuffer = (u16 *) (osMemSize | 0xA0000000) - SCREEN_WIDTH * SCREEN_HEIGHT; + gCrashScreen.framebuffer = (u16*)(osMemSize | 0xA0000000) - SCREEN_WIDTH * SCREEN_HEIGHT; #endif gCrashScreen.width = SCREEN_WIDTH; #ifdef VERSION_EU @@ -299,13 +282,12 @@ void crash_screen_init(void) { gCrashScreen.height = 0x10; #endif osCreateMesgQueue(&gCrashScreen.mesgQueue, &gCrashScreen.mesg, 1); - osCreateThread( - &gCrashScreen.thread, 2, thread2_crash_screen, NULL, - (u8 *) gCrashScreen.stack + sizeof(gCrashScreen.stack), + osCreateThread(&gCrashScreen.thread, 2, thread2_crash_screen, NULL, + (u8*)gCrashScreen.stack + sizeof(gCrashScreen.stack), #ifdef VERSION_EU - OS_PRIORITY_APPMAX + OS_PRIORITY_APPMAX #else - OS_PRIORITY_RMON + OS_PRIORITY_RMON #endif ); osStartThread(&gCrashScreen.thread); diff --git a/src/game/debug.c b/src/game/debug.c index 6705a155..0729db92 100644 --- a/src/game/debug.c +++ b/src/game/debug.c @@ -32,13 +32,13 @@ enum DebugPrintStateInfo { }; // DEBUG_SYS_EFFECTINFO -const char *sDebugEffectStringInfo[] = { +const char* sDebugEffectStringInfo[] = { " a0 %d", " a1 %d", " a2 %d", " a3 %d", " a4 %d", " a5 %d", " a6 %d", " a7 %d", "A" // cursor }; // DEBUG_SYS_ENEMYINFO -const char *sDebugEnemyStringInfo[] = { +const char* sDebugEnemyStringInfo[] = { " b0 %d", " b1 %d", " b2 %d", " b3 %d", " b4 %d", " b5 %d", " b6 %d", " b7 %d", "B" // cursor }; @@ -95,8 +95,7 @@ s64 get_clock_difference(UNUSED s64 cycles) { * information. Note the reset of the printing boolean. For all intenses and * purposes this creates/formats a new print state. */ -void set_print_state_info(s16 *printState, s16 xCursor, s16 yCursor, s16 minYCursor, s16 maxXCursor, - s16 lineYOffset) { +void set_print_state_info(s16* printState, s16 xCursor, s16 yCursor, s16 minYCursor, s16 maxXCursor, s16 lineYOffset) { printState[DEBUG_PSTATE_DISABLED] = FALSE; printState[DEBUG_PSTATE_X_CURSOR] = xCursor; printState[DEBUG_PSTATE_Y_CURSOR] = yCursor; @@ -110,23 +109,21 @@ void set_print_state_info(s16 *printState, s16 xCursor, s16 yCursor, s16 minYCur * the next entry in the list. If the current print state array is too far down the list, this * will print "DPRINT OVER" instead, signaling that the print state overflowed. */ -void print_text_array_info(s16 *printState, const char *str, s32 number) { +void print_text_array_info(s16* printState, const char* str, s32 number) { if (!printState[DEBUG_PSTATE_DISABLED]) { - if ((printState[DEBUG_PSTATE_Y_CURSOR] < printState[DEBUG_PSTATE_MIN_Y_CURSOR]) - || (printState[DEBUG_PSTATE_MAX_X_CURSOR] < printState[DEBUG_PSTATE_Y_CURSOR])) { - print_text(printState[DEBUG_PSTATE_X_CURSOR], printState[DEBUG_PSTATE_Y_CURSOR], - "DPRINT OVER"); + if ((printState[DEBUG_PSTATE_Y_CURSOR] < printState[DEBUG_PSTATE_MIN_Y_CURSOR]) || + (printState[DEBUG_PSTATE_MAX_X_CURSOR] < printState[DEBUG_PSTATE_Y_CURSOR])) { + print_text(printState[DEBUG_PSTATE_X_CURSOR], printState[DEBUG_PSTATE_Y_CURSOR], "DPRINT OVER"); printState[DEBUG_PSTATE_DISABLED]++; // why not just = TRUE... } else { - print_text_fmt_int(printState[DEBUG_PSTATE_X_CURSOR], printState[DEBUG_PSTATE_Y_CURSOR], - str, number); + print_text_fmt_int(printState[DEBUG_PSTATE_X_CURSOR], printState[DEBUG_PSTATE_Y_CURSOR], str, number); printState[DEBUG_PSTATE_Y_CURSOR] += printState[DEBUG_PSTATE_LINE_Y_OFFSET]; } } } void set_text_array_x_y(s32 xOffset, s32 yOffset) { - s16 *printState = gDebugPrintState1; + s16* printState = gDebugPrintState1; printState[DEBUG_PSTATE_X_CURSOR] += xOffset; printState[DEBUG_PSTATE_Y_CURSOR] = @@ -137,20 +134,22 @@ void set_text_array_x_y(s32 xOffset, s32 yOffset) { * These series of dprint functions print methods depending on the context of the * current debug mode as well as the printer array (down to up vs up to down). */ -void print_debug_bottom_up(const char *str, s32 number) { +void print_debug_bottom_up(const char* str, s32 number) { if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT || CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) { print_text_array_info(gDebugPrintState2, str, number); } } -void print_debug_top_down_objectinfo(const char *str, s32 number) { - if ((gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT || CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) && sDebugPage == DEBUG_PAGE_OBJECTINFO) { +void print_debug_top_down_objectinfo(const char* str, s32 number) { + if ((gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT || CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) && + sDebugPage == DEBUG_PAGE_OBJECTINFO) { print_text_array_info(gDebugPrintState1, str, number); } } -void print_debug_top_down_mapinfo(const char *str, s32 number) { - if (sNoExtraDebug && !CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) { // how come this is the only instance of the sNoExtraDebug check? +void print_debug_top_down_mapinfo(const char* str, s32 number) { + if (sNoExtraDebug && !CVarGetInteger("gDeveloper.DrawDebugInfo", + 0)) { // how come this is the only instance of the sNoExtraDebug check? return; } @@ -159,7 +158,7 @@ void print_debug_top_down_mapinfo(const char *str, s32 number) { } } -void print_debug_top_down_normal(const char *str, s32 number) { +void print_debug_top_down_normal(const char* str, s32 number) { if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT || CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) { print_text_array_info(gDebugPrintState1, str, number); } @@ -167,15 +166,14 @@ void print_debug_top_down_normal(const char *str, s32 number) { void print_mapinfo(void) { // EU mostly stubbed this function out. - struct Surface *pfloor; + struct Surface* pfloor; UNUSED f32 bgY; // unused in EU UNUSED f32 water; // unused in EU UNUSED s32 area; // unused in EU UNUSED s32 angY; // unused in EU angY = gCurrentObject->oMoveAngleYaw / 182.044000; - area = ((s32) gCurrentObject->oPosX + 0x2000) / 1024 - + ((s32) gCurrentObject->oPosZ + 0x2000) / 1024 * 16; + area = ((s32)gCurrentObject->oPosX + 0x2000) / 1024 + ((s32)gCurrentObject->oPosZ + 0x2000) / 1024 * 16; bgY = find_floor(gCurrentObject->oPosX, gCurrentObject->oPosY, gCurrentObject->oPosZ, &pfloor); water = find_water_level(gCurrentObject->oPosX, gCurrentObject->oPosZ); @@ -222,7 +220,7 @@ void print_stageinfo(void) { * also prints the cursor functionality intended to be used with modifying * gDebugInfo to set enemy/effect behaviors. */ -void print_string_array_info(const char **strArr) { +void print_string_array_info(const char** strArr) { s32 i; if (!sDebugStringArrPrinted) { @@ -307,7 +305,7 @@ void reset_debug_objectinfo(void) { * despite so this has no effect, being called. (unused) */ UNUSED static void check_debug_button_seq(void) { - s16 *buttonArr = sDebugInfoButtonSeq; + s16* buttonArr = sDebugInfoButtonSeq; s16 cButtonMask; if (!(gPlayer1Controller->buttonDown & L_TRIG)) { @@ -336,12 +334,10 @@ UNUSED static void check_debug_button_seq(void) { */ UNUSED static void try_change_debug_page(void) { if (gDebugInfoFlags & DEBUG_INFO_FLAG_DPRINT || CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) { - if ((gPlayer1Controller->buttonPressed & L_JPAD) - && (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) { + if ((gPlayer1Controller->buttonPressed & L_JPAD) && (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) { CVarSetInteger("gDeveloper.DebugInfoPage", sDebugPage + 1); } - if ((gPlayer1Controller->buttonPressed & R_JPAD) - && (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) { + if ((gPlayer1Controller->buttonPressed & R_JPAD) && (gPlayer1Controller->buttonDown & (L_TRIG | R_TRIG))) { CVarSetInteger("gDeveloper.DebugInfoPage", sDebugPage - 1); } if (sDebugPage >= (DEBUG_PAGE_MAX + 1)) { @@ -362,7 +358,7 @@ UNUSED static void try_change_debug_page(void) { #ifdef VERSION_EU UNUSED static #endif -void try_modify_debug_controls(void) { + void try_modify_debug_controls(void) { s32 sp4; if (gPlayer1Controller->buttonPressed & Z_TRIG) { @@ -393,8 +389,7 @@ void try_modify_debug_controls(void) { // so the playtester can adjust enemy behavior and parameters on the fly, since // various behaviors try to update their behaviors from gDebugInfo[4] and [5]. if (gPlayer1Controller->buttonDown & A_BUTTON) { - gDebugInfo[sDebugPage][sDebugSysCursor] = - gDebugInfoOverwrite[sDebugPage][sDebugSysCursor]; + gDebugInfo[sDebugPage][sDebugSysCursor] = gDebugInfoOverwrite[sDebugPage][sDebugSysCursor]; } else { gDebugInfo[sDebugPage][sDebugSysCursor] = gDebugInfo[sDebugPage][sDebugSysCursor] - sp4; } @@ -481,12 +476,10 @@ void try_do_mario_debug_object_spawn(void) { spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_KOOPA_SHELL, bhvKoopaShell); } if (gPlayer1Controller->buttonPressed & L_JPAD) { - spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_BREAKABLE_BOX_SMALL, - bhvJumpingBox); + spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_BREAKABLE_BOX_SMALL, bhvJumpingBox); } if (gPlayer1Controller->buttonPressed & D_JPAD) { - spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_KOOPA_SHELL, - bhvKoopaShellUnderwater); + spawn_object_relative(0, 0, 100, 200, gCurrentObject, MODEL_KOOPA_SHELL, bhvKoopaShellUnderwater); } } } @@ -525,7 +518,7 @@ void debug_print_obj_move_flags(void) { } // unused, what is this? -void debug_enemy_unknown(s16 *enemyArr) { +void debug_enemy_unknown(s16* enemyArr) { // copy b1-b4 over to an unknown s16 array enemyArr[4] = gDebugInfo[DEBUG_PAGE_ENEMYINFO][1]; enemyArr[5] = gDebugInfo[DEBUG_PAGE_ENEMYINFO][2]; diff --git a/src/game/envfx_bubbles.c b/src/game/envfx_bubbles.c index 8ee78687..37429cf7 100644 --- a/src/game/envfx_bubbles.c +++ b/src/game/envfx_bubbles.c @@ -22,7 +22,7 @@ */ s16 gEnvFxBubbleConfig[10]; -static Gfx *sGfxCursor; // points to end of display list for bubble particles +static Gfx* sGfxCursor; // points to end of display list for bubble particles static s32 sBubbleParticleCount; static s32 sBubbleParticleMaxCount; @@ -73,7 +73,7 @@ s32 random_flower_offset(void) { */ void envfx_update_flower(Vec3s centerPos) { s32 i; - struct FloorGeometry *floorGeo; // unused + struct FloorGeometry* floorGeo; // unused s32 globalTimer = gGlobalTimer; s16 centerX = centerPos[0]; @@ -85,8 +85,8 @@ void envfx_update_flower(Vec3s centerPos) { if (!(gEnvFxBuffer + i)->isAlive) { (gEnvFxBuffer + i)->xPos = random_flower_offset() + centerX; (gEnvFxBuffer + i)->zPos = random_flower_offset() + centerZ; - (gEnvFxBuffer + i)->yPos = find_floor_height_and_data((gEnvFxBuffer + i)->xPos, 10000.0f, - (gEnvFxBuffer + i)->zPos, &floorGeo); + (gEnvFxBuffer + i)->yPos = + find_floor_height_and_data((gEnvFxBuffer + i)->xPos, 10000.0f, (gEnvFxBuffer + i)->zPos, &floorGeo); (gEnvFxBuffer + i)->isAlive = TRUE; (gEnvFxBuffer + i)->animFrame = random_float() * 5.0f; } else if (!(globalTimer & 3)) { @@ -108,7 +108,7 @@ void envfx_update_flower(Vec3s centerPos) { * camera below the lava plane. */ void envfx_set_lava_bubble_position(s32 index, Vec3s centerPos) { - struct Surface *surface; + struct Surface* surface; s16 floorY; s16 centerX = centerPos[0]; @@ -132,8 +132,7 @@ void envfx_set_lava_bubble_position(s32 index, Vec3s centerPos) { (gEnvFxBuffer + index)->zPos = -16000 - (gEnvFxBuffer + index)->zPos; } - floorY = - find_floor((gEnvFxBuffer + index)->xPos, centerY + 500, (gEnvFxBuffer + index)->zPos, &surface); + floorY = find_floor((gEnvFxBuffer + index)->xPos, centerY + 500, (gEnvFxBuffer + index)->zPos, &surface); if (surface == NULL) { (gEnvFxBuffer + index)->yPos = FLOOR_LOWER_LIMIT_MISC; return; @@ -181,7 +180,7 @@ void envfx_update_lava(Vec3s centerPos) { * Rotate the input x, y and z around the rotation origin of the whirlpool * according to the pitch and yaw of the whirlpool. */ -void envfx_rotate_around_whirlpool(f32 *x, f32 *y, f32 *z) { +void envfx_rotate_around_whirlpool(f32* x, f32* y, f32* z) { f32 vecX = *x - gEnvFxBubbleConfig[ENVFX_STATE_DEST_X]; f32 vecY = *y - gEnvFxBubbleConfig[ENVFX_STATE_DEST_Y]; f32 vecZ = *z - gEnvFxBubbleConfig[ENVFX_STATE_DEST_Z]; @@ -229,14 +228,11 @@ void envfx_update_whirlpool(void) { if (!(gEnvFxBuffer + i)->isAlive) { (gEnvFxBuffer + i)->angleAndDist[1] = random_float() * 1000.0f; (gEnvFxBuffer + i)->angleAndDist[0] = random_float() * 65536.0f; - (gEnvFxBuffer + i)->xPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_X] - + sins((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; - (gEnvFxBuffer + i)->zPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z] - + coss((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; - (gEnvFxBuffer + i)->bubbleY = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + (random_float() * 100.0f - 50.0f); + (gEnvFxBuffer + i)->xPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_X] + + sins((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; + (gEnvFxBuffer + i)->zPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z] + + coss((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; + (gEnvFxBuffer + i)->bubbleY = gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + (random_float() * 100.0f - 50.0f); (gEnvFxBuffer + i)->yPos = (i + gEnvFxBuffer)->bubbleY; (gEnvFxBuffer + i)->unusedBubbleVar = 0; (gEnvFxBuffer + i)->isAlive = TRUE; @@ -245,14 +241,11 @@ void envfx_update_whirlpool(void) { &(gEnvFxBuffer + i)->zPos); } else { (gEnvFxBuffer + i)->angleAndDist[1] -= 40; - (gEnvFxBuffer + i)->angleAndDist[0] += - (s16)(3000 - (gEnvFxBuffer + i)->angleAndDist[1] * 2) + 0x400; - (gEnvFxBuffer + i)->xPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_X] - + sins((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; - (gEnvFxBuffer + i)->zPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z] - + coss((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; + (gEnvFxBuffer + i)->angleAndDist[0] += (s16)(3000 - (gEnvFxBuffer + i)->angleAndDist[1] * 2) + 0x400; + (gEnvFxBuffer + i)->xPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_X] + + sins((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; + (gEnvFxBuffer + i)->zPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z] + + coss((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; (gEnvFxBuffer + i)->bubbleY -= 40 - ((s16)(gEnvFxBuffer + i)->angleAndDist[1] / 100); (gEnvFxBuffer + i)->yPos = (i + gEnvFxBuffer)->bubbleY; @@ -270,8 +263,8 @@ s32 envfx_is_jestream_bubble_alive(s32 index) { UNUSED u8 filler[4]; if (!particle_is_laterally_close(index, gEnvFxBubbleConfig[ENVFX_STATE_SRC_X], - gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z], 1000) - || gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + 1500 < (gEnvFxBuffer + index)->yPos) { + gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z], 1000) || + gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + 1500 < (gEnvFxBuffer + index)->yPos) { return FALSE; } @@ -290,14 +283,11 @@ void envfx_update_jetstream(void) { if (!(gEnvFxBuffer + i)->isAlive) { (gEnvFxBuffer + i)->angleAndDist[1] = random_float() * 300.0f; (gEnvFxBuffer + i)->angleAndDist[0] = random_u16(); - (gEnvFxBuffer + i)->xPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_X] - + sins((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; - (gEnvFxBuffer + i)->zPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z] - + coss((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; - (gEnvFxBuffer + i)->yPos = - gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + (random_float() * 400.0f - 200.0f); + (gEnvFxBuffer + i)->xPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_X] + + sins((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; + (gEnvFxBuffer + i)->zPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_Z] + + coss((gEnvFxBuffer + i)->angleAndDist[0]) * (gEnvFxBuffer + i)->angleAndDist[1]; + (gEnvFxBuffer + i)->yPos = gEnvFxBubbleConfig[ENVFX_STATE_SRC_Y] + (random_float() * 400.0f - 200.0f); } else { (gEnvFxBuffer + i)->angleAndDist[1] += 10; (gEnvFxBuffer + i)->xPos += sins((gEnvFxBuffer + i)->angleAndDist[0]) * 10.0f; @@ -338,8 +328,7 @@ s32 envfx_init_bubble(s32 mode) { break; } - gEnvFxBuffer = mem_pool_alloc(gEffectsMemoryPool, - sBubbleParticleCount * sizeof(struct EnvFxParticle)); + gEnvFxBuffer = mem_pool_alloc(gEffectsMemoryPool, sBubbleParticleCount * sizeof(struct EnvFxParticle)); if (gEnvFxBuffer == NULL) { return FALSE; } @@ -368,30 +357,54 @@ void envfx_bubbles_update_switch(s32 mode, Vec3s camTo, Vec3f vertex1, Vec3f ver switch (mode) { case ENVFX_FLOWERS: envfx_update_flower(camTo); - vertex1[0] = 50; vertex1[1] = 0; vertex1[2] = 0; - vertex2[0] = 0; vertex2[1] = 75; vertex2[2] = 0; - vertex3[0] = -50; vertex3[1] = 0; vertex3[2] = 0; + vertex1[0] = 50; + vertex1[1] = 0; + vertex1[2] = 0; + vertex2[0] = 0; + vertex2[1] = 75; + vertex2[2] = 0; + vertex3[0] = -50; + vertex3[1] = 0; + vertex3[2] = 0; break; case ENVFX_LAVA_BUBBLES: envfx_update_lava(camTo); - vertex1[0] = 100; vertex1[1] = 0; vertex1[2] = 0; - vertex2[0] = 0; vertex2[1] = 150; vertex2[2] = 0; - vertex3[0] = -100; vertex3[1] = 0; vertex3[2] = 0; + vertex1[0] = 100; + vertex1[1] = 0; + vertex1[2] = 0; + vertex2[0] = 0; + vertex2[1] = 150; + vertex2[2] = 0; + vertex3[0] = -100; + vertex3[1] = 0; + vertex3[2] = 0; break; case ENVFX_WHIRLPOOL_BUBBLES: envfx_update_whirlpool(); - vertex1[0] = 40; vertex1[1] = 0; vertex1[2] = 0; - vertex2[0] = 0; vertex2[1] = 60; vertex2[2] = 0; - vertex3[0] = -40; vertex3[1] = 0; vertex3[2] = 0; + vertex1[0] = 40; + vertex1[1] = 0; + vertex1[2] = 0; + vertex2[0] = 0; + vertex2[1] = 60; + vertex2[2] = 0; + vertex3[0] = -40; + vertex3[1] = 0; + vertex3[2] = 0; break; case ENVFX_JETSTREAM_BUBBLES: envfx_update_jetstream(); - vertex1[0] = 40; vertex1[1] = 0; vertex1[2] = 0; - vertex2[0] = 0; vertex2[1] = 60; vertex2[2] = 0; - vertex3[0] = -40; vertex3[1] = 0; vertex3[2] = 0; + vertex1[0] = 40; + vertex1[1] = 0; + vertex1[2] = 0; + vertex2[0] = 0; + vertex2[1] = 60; + vertex2[2] = 0; + vertex3[0] = -40; + vertex3[1] = 0; + vertex3[2] = 0; break; } } @@ -401,10 +414,9 @@ void envfx_bubbles_update_switch(s32 mode, Vec3s camTo, Vec3f vertex1, Vec3f ver * 'index'. The 3 input vertices represent the rotated triangle around (0,0,0) * that will be translated to bubble positions to draw the bubble image */ -void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3f vertex1, Vec3f vertex2, Vec3f vertex3, - Vtx *template) { +void append_bubble_vertex_buffer(Gfx* gfx, s32 index, Vec3f vertex1, Vec3f vertex2, Vec3f vertex3, Vtx* template) { s32 i = 0; - Vtx *vertBuf = alloc_display_list(15 * sizeof(Vtx)); + Vtx* vertBuf = alloc_display_list(15 * sizeof(Vtx)); if (vertBuf == NULL) { return; @@ -436,7 +448,7 @@ void append_bubble_vertex_buffer(Gfx *gfx, s32 index, Vec3f vertex1, Vec3f verte * the global sGfxCursor instead. */ void envfx_set_bubble_texture(s32 mode, s16 index) { - void **imageArr; + void** imageArr; s16 frame = (gEnvFxBuffer + index)->animFrame; switch (mode) { @@ -465,7 +477,7 @@ void envfx_set_bubble_texture(s32 mode, s16 index) { * Updates the bubble particle positions, then generates and returns a display * list drawing them. */ -Gfx *envfx_update_bubble_particles(s32 mode, UNUSED Vec3s marioPos, Vec3s camFrom, Vec3s camTo) { +Gfx* envfx_update_bubble_particles(s32 mode, UNUSED Vec3s marioPos, Vec3s camFrom, Vec3s camTo) { s32 i; s16 radius, pitch, yaw; @@ -473,8 +485,8 @@ Gfx *envfx_update_bubble_particles(s32 mode, UNUSED Vec3s marioPos, Vec3s camFro Vec3f vertex2; Vec3f vertex3; - Gfx *gfxStart = alloc_display_list(((sBubbleParticleMaxCount / 5) * 10 + sBubbleParticleMaxCount + 3) - * sizeof(Gfx)); + Gfx* gfxStart = + alloc_display_list(((sBubbleParticleMaxCount / 5) * 10 + sBubbleParticleMaxCount + 3) * sizeof(Gfx)); if (gfxStart == NULL) { return NULL; } @@ -490,7 +502,7 @@ Gfx *envfx_update_bubble_particles(s32 mode, UNUSED Vec3s marioPos, Vec3s camFro for (i = 0; i < sBubbleParticleMaxCount; i += 5) { gDPPipeSync(sGfxCursor++); envfx_set_bubble_texture(mode, i); - append_bubble_vertex_buffer(sGfxCursor++, i, vertex1, vertex2, vertex3, (Vtx *) gBubbleTempVtx); + append_bubble_vertex_buffer(sGfxCursor++, i, vertex1, vertex2, vertex3, (Vtx*)gBubbleTempVtx); gSP1Triangle(sGfxCursor++, 0, 1, 2, 0); gSP1Triangle(sGfxCursor++, 3, 4, 5, 0); gSP1Triangle(sGfxCursor++, 6, 7, 8, 0); @@ -524,8 +536,8 @@ void envfx_set_max_bubble_particles(s32 mode) { * lower modes are snow effects which are updated in a different function. * Returns a display list drawing the particles. */ -Gfx *envfx_update_bubbles(s32 mode, Vec3s marioPos, Vec3s camTo, Vec3s camFrom) { - Gfx *gfx; +Gfx* envfx_update_bubbles(s32 mode, Vec3s marioPos, Vec3s camTo, Vec3s camFrom) { + Gfx* gfx; if (gEnvFxMode == ENVFX_MODE_NONE && !envfx_init_bubble(mode)) { return NULL; diff --git a/src/game/envfx_snow.c b/src/game/envfx_snow.c index 1c0ba2d1..0934d124 100644 --- a/src/game/envfx_snow.c +++ b/src/game/envfx_snow.c @@ -33,7 +33,7 @@ struct SnowFlakeVertex { f32 z; }; -struct EnvFxParticle *gEnvFxBuffer; +struct EnvFxParticle* gEnvFxBuffer; Vec3f gSnowCylinderLastPos; s16 gSnowParticleCount; s16 gSnowParticleMaxCount; @@ -77,8 +77,7 @@ s32 envfx_init_snow(s32 mode) { break; } - gEnvFxBuffer = mem_pool_alloc(gEffectsMemoryPool, - gSnowParticleMaxCount * sizeof(struct EnvFxParticle)); + gEnvFxBuffer = mem_pool_alloc(gEffectsMemoryPool, gSnowParticleMaxCount * sizeof(struct EnvFxParticle)); if (gEnvFxBuffer == NULL) { return FALSE; } @@ -111,8 +110,7 @@ void envfx_update_snowflake_count(s32 mode, Vec3s marioPos) { case ENVFX_SNOW_WATER: waterLevel = find_water_level(marioPos[0], marioPos[2]); - gSnowParticleCount = - (((s32)((waterLevel - 400.0f - (f32) marioPos[1]) * 0.001) << 0x10) >> 0x10) * 5; + gSnowParticleCount = (((s32)((waterLevel - 400.0f - (f32)marioPos[1]) * 0.001) << 0x10) >> 0x10) * 5; if (gSnowParticleCount < 0) { gSnowParticleCount = 0; @@ -133,7 +131,7 @@ void envfx_update_snowflake_count(s32 mode, Vec3s marioPos) { * Deallocate the buffer storing snow particles and set the environment effect * to none. */ -void envfx_cleanup_snow(void *snowParticleArray) { +void envfx_cleanup_snow(void* snowParticleArray) { if (gEnvFxMode != ENVFX_MODE_NONE) { if (snowParticleArray) { mem_pool_free(gEffectsMemoryPool, snowParticleArray); @@ -146,12 +144,12 @@ void envfx_cleanup_snow(void *snowParticleArray) { * Given two points, return the vector from one to the other represented * as Euler angles and a length */ -void orbit_from_positions(Vec3s from, Vec3s to, s16 *radius, s16 *pitch, s16 *yaw) { +void orbit_from_positions(Vec3s from, Vec3s to, s16* radius, s16* pitch, s16* yaw) { f32 dx = to[0] - from[0]; f32 dy = to[1] - from[1]; f32 dz = to[2] - from[2]; - *radius = (s16) sqrtf(dx * dx + dy * dy + dz * dz); + *radius = (s16)sqrtf(dx * dx + dy * dy + dz * dz); *pitch = atan2s(sqrtf(dx * dx + dz * dz), dy); *yaw = atan2s(dz, dx); } @@ -208,19 +206,16 @@ void envfx_update_snow_normal(f32 snowCylinderX, f32 snowCylinderY, f32 snowCyli f32 deltaZ = snowCylinderZ - gSnowCylinderLastPos[2]; for (i = 0; i < gSnowParticleCount; i++) { - (gEnvFxBuffer + i)->isAlive = - envfx_is_snowflake_alive(i, snowCylinderX, snowCylinderY, snowCylinderZ); + (gEnvFxBuffer + i)->isAlive = envfx_is_snowflake_alive(i, snowCylinderX, snowCylinderY, snowCylinderZ); if (!(gEnvFxBuffer + i)->isAlive) { - (gEnvFxBuffer + i)->xPos = - 400.0f * random_float() - 200.0f + snowCylinderX + (deltaX * 2); - (gEnvFxBuffer + i)->zPos = - 400.0f * random_float() - 200.0f + snowCylinderZ + (deltaZ * 2); + (gEnvFxBuffer + i)->xPos = 400.0f * random_float() - 200.0f + snowCylinderX + (deltaX * 2); + (gEnvFxBuffer + i)->zPos = 400.0f * random_float() - 200.0f + snowCylinderZ + (deltaZ * 2); (gEnvFxBuffer + i)->yPos = 200.0f * random_float() + snowCylinderY; (gEnvFxBuffer + i)->isAlive = TRUE; (gEnvFxBuffer + i)->spawnTimestamp = gGlobalTimer; } else { (gEnvFxBuffer + i)->xPos += random_float() * 2 - 1.0f + (deltaX / 1.2); - (gEnvFxBuffer + i)->yPos -= 2 -(deltaY * 0.8); + (gEnvFxBuffer + i)->yPos -= 2 - (deltaY * 0.8); (gEnvFxBuffer + i)->zPos += random_float() * 2 - 1.0f + (deltaZ / 1.2); } } @@ -243,19 +238,16 @@ void envfx_update_snow_blizzard(f32 snowCylinderX, f32 snowCylinderY, f32 snowCy f32 deltaZ = snowCylinderZ - gSnowCylinderLastPos[2]; for (i = 0; i < gSnowParticleCount; i++) { - (gEnvFxBuffer + i)->isAlive = - envfx_is_snowflake_alive(i, snowCylinderX, snowCylinderY, snowCylinderZ); + (gEnvFxBuffer + i)->isAlive = envfx_is_snowflake_alive(i, snowCylinderX, snowCylinderY, snowCylinderZ); if (!(gEnvFxBuffer + i)->isAlive) { - (gEnvFxBuffer + i)->xPos = - 400.0f * random_float() - 200.0f + snowCylinderX + (deltaX * 2); - (gEnvFxBuffer + i)->zPos = - 400.0f * random_float() - 200.0f + snowCylinderZ + (deltaZ * 2); + (gEnvFxBuffer + i)->xPos = 400.0f * random_float() - 200.0f + snowCylinderX + (deltaX * 2); + (gEnvFxBuffer + i)->zPos = 400.0f * random_float() - 200.0f + snowCylinderZ + (deltaZ * 2); (gEnvFxBuffer + i)->yPos = 400.0f * random_float() - 200.0f + snowCylinderY; (gEnvFxBuffer + i)->isAlive = TRUE; (gEnvFxBuffer + i)->spawnTimestamp = gGlobalTimer; } else { (gEnvFxBuffer + i)->xPos += random_float() * 2 - 1.0f + (deltaX / 1.2) + 20.0f; - (gEnvFxBuffer + i)->yPos -= 5 -(deltaY * 0.8); + (gEnvFxBuffer + i)->yPos -= 5 - (deltaY * 0.8); (gEnvFxBuffer + i)->zPos += random_float() * 2 - 1.0f + (deltaZ / 1.2); } } @@ -289,8 +281,7 @@ void envfx_update_snow_water(f32 snowCylinderX, f32 snowCylinderY, f32 snowCylin s32 i; for (i = 0; i < gSnowParticleCount; i++) { - (gEnvFxBuffer + i)->isAlive = - envfx_is_snowflake_alive(i, snowCylinderX, snowCylinderY, snowCylinderZ); + (gEnvFxBuffer + i)->isAlive = envfx_is_snowflake_alive(i, snowCylinderX, snowCylinderY, snowCylinderZ); if (!(gEnvFxBuffer + i)->isAlive) { (gEnvFxBuffer + i)->xPos = 400.0f * random_float() - 200.0f + snowCylinderX; (gEnvFxBuffer + i)->zPos = 400.0f * random_float() - 200.0f + snowCylinderZ; @@ -344,9 +335,9 @@ void rotate_triangle_vertices(Vec3f vertex1, Vec3f vertex2, Vec3f vertex3, s16 p * around (0,0,0) that will be translated to snowflake positions to draw the * snowflake image. */ -void append_snowflake_vertex_buffer(Gfx *gfx, s32 index, Vec3f vertex1, Vec3f vertex2, Vec3f vertex3) { +void append_snowflake_vertex_buffer(Gfx* gfx, s32 index, Vec3f vertex1, Vec3f vertex2, Vec3f vertex3) { s32 i = 0; - Vtx *vertBuf = (Vtx *) alloc_display_list(15 * sizeof(Vtx)); + Vtx* vertBuf = (Vtx*)alloc_display_list(15 * sizeof(Vtx)); if (vertBuf == NULL) { return; @@ -376,19 +367,19 @@ void append_snowflake_vertex_buffer(Gfx *gfx, s32 index, Vec3f vertex1, Vec3f ve * Updates positions of snow particles and returns a pointer to a display list * drawing all snowflakes. */ -Gfx *envfx_update_snow(s32 snowMode, Vec3s marioPos, Vec3s camFrom, Vec3s camTo) { +Gfx* envfx_update_snow(s32 snowMode, Vec3s marioPos, Vec3s camFrom, Vec3s camTo) { s32 i; s16 radius, pitch, yaw; Vec3s snowCylinderPos; struct SnowFlakeVertex vertex1, vertex2, vertex3; - Gfx *gfxStart; - Gfx *gfx; + Gfx* gfxStart; + Gfx* gfx; vertex1 = gSnowFlakeVertex1; vertex2 = gSnowFlakeVertex2; vertex3 = gSnowFlakeVertex3; - gfxStart = (Gfx *) alloc_display_list((gSnowParticleCount * 6 + 3) * sizeof(Gfx)); + gfxStart = (Gfx*)alloc_display_list((gSnowParticleCount * 6 + 3) * sizeof(Gfx)); gfx = gfxStart; if (gfxStart == NULL) { @@ -436,7 +427,7 @@ Gfx *envfx_update_snow(s32 snowMode, Vec3s marioPos, Vec3s camFrom, Vec3s camTo) break; } - rotate_triangle_vertices((f32 *) &vertex1, (f32 *) &vertex2, (f32 *) &vertex3, pitch, yaw); + rotate_triangle_vertices((f32*)&vertex1, (f32*)&vertex2, (f32*)&vertex3, pitch, yaw); if (snowMode == ENVFX_SNOW_NORMAL || snowMode == ENVFX_SNOW_BLIZZARD) { gSPDisplayList(gfx++, tiny_bubble_dl_0B006A50); // snowflake with gray edge @@ -445,7 +436,7 @@ Gfx *envfx_update_snow(s32 snowMode, Vec3s marioPos, Vec3s camFrom, Vec3s camTo) } for (i = 0; i < gSnowParticleCount; i += 5) { - append_snowflake_vertex_buffer(gfx++, i, (f32 *) &vertex1, (f32 *) &vertex2, (f32 *) &vertex3); + append_snowflake_vertex_buffer(gfx++, i, (f32*)&vertex1, (f32*)&vertex2, (f32*)&vertex3); gSP1Triangle(gfx++, 0, 1, 2, 0); gSP1Triangle(gfx++, 3, 4, 5, 0); @@ -464,8 +455,8 @@ Gfx *envfx_update_snow(s32 snowMode, Vec3s marioPos, Vec3s camFrom, Vec3s camTo) * Updates the environment effects (snow, flowers, bubbles) * and returns a display list drawing them. */ -Gfx *envfx_update_particles(s32 mode, Vec3s marioPos, Vec3s camTo, Vec3s camFrom) { - Gfx *gfx; +Gfx* envfx_update_particles(s32 mode, Vec3s marioPos, Vec3s camTo, Vec3s camFrom) { + Gfx* gfx; if (get_dialog_id() != DIALOG_NONE) { return NULL; diff --git a/src/game/game_init.c b/src/game/game_init.c index 9591e15f..3a4c9738 100644 --- a/src/game/game_init.c +++ b/src/game/game_init.c @@ -25,10 +25,10 @@ struct Controller gControllers[3]; // Gfx handlers -struct SPTask *gGfxSPTask; -Gfx *gDisplayListHead; -u8 *gGfxPoolEnd; -struct GfxPool *gGfxPool; +struct SPTask* gGfxSPTask; +Gfx* gDisplayListHead; +u8* gGfxPoolEnd; +struct GfxPool* gGfxPool; // OS Controllers OSContStatus gControllerStatuses[4]; @@ -50,7 +50,7 @@ uintptr_t gPhysicalFramebuffers[3]; uintptr_t gPhysicalZBuffer; // Mario Anims and Demo allocation -void *gMarioAnimsMemAlloc; +void* gMarioAnimsMemAlloc; struct DmaHandlerList gMarioAnimsBuf; // fillers @@ -68,12 +68,12 @@ u16 sRenderingFramebuffer = 0; void (*gGoddardVblankCallback)(void) = NULL; // Defined controller slots -struct Controller *gPlayer1Controller = &gControllers[0]; -struct Controller *gPlayer2Controller = &gControllers[1]; -struct Controller *gPlayer3Controller = &gControllers[2]; // Probably debug only, see note below +struct Controller* gPlayer1Controller = &gControllers[0]; +struct Controller* gPlayer2Controller = &gControllers[1]; +struct Controller* gPlayer3Controller = &gControllers[2]; // Probably debug only, see note below // Title Screen Demo Handler -struct DemoInput *gCurrDemoInput = NULL; +struct DemoInput* gCurrDemoInput = NULL; u16 gDemoInputListID = 0; struct DemoInput gRecordedDemoInput = { 0 }; @@ -113,8 +113,8 @@ void init_rdp(void) { * Sets the initial RSP (Reality Signal Processor) settings. */ void init_rsp(void) { - gSPClearGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CULL_BOTH | G_FOG - | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD); + gSPClearGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CULL_BOTH | G_FOG | G_LIGHTING | + G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD); gSPSetGeometryMode(gDisplayListHead++, G_SHADE | G_SHADING_SMOOTH | G_CULL_BACK | G_LIGHTING); @@ -138,11 +138,9 @@ void init_z_buffer(void) { gDPSetDepthImage(gDisplayListHead++, gPhysicalZBuffer); gDPSetColorImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, SCREEN_WIDTH, gPhysicalZBuffer); - gDPSetFillColor(gDisplayListHead++, - GPACK_ZDZ(G_MAXFBZ, 0) << 16 | GPACK_ZDZ(G_MAXFBZ, 0)); + gDPSetFillColor(gDisplayListHead++, GPACK_ZDZ(G_MAXFBZ, 0) << 16 | GPACK_ZDZ(G_MAXFBZ, 0)); - gDPFillRectangle(gDisplayListHead++, 0, BORDER_HEIGHT, SCREEN_WIDTH - 1, - SCREEN_HEIGHT - 1 - BORDER_HEIGHT); + gDPFillRectangle(gDisplayListHead++, 0, BORDER_HEIGHT, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1 - BORDER_HEIGHT); } /** @@ -169,8 +167,7 @@ void clear_framebuffer(s32 color) { gDPSetCycleType(gDisplayListHead++, G_CYC_FILL); gDPSetFillColor(gDisplayListHead++, color); - gDPFillRectangle(gDisplayListHead++, - GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), BORDER_HEIGHT, + gDPFillRectangle(gDisplayListHead++, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), BORDER_HEIGHT, GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(0) - 1, SCREEN_HEIGHT - BORDER_HEIGHT - 1); gDPPipeSync(gDisplayListHead++); @@ -181,7 +178,7 @@ void clear_framebuffer(s32 color) { /** * Resets the viewport, readying it for the final image. */ -void clear_viewport(Vp *viewport, s32 color) { +void clear_viewport(Vp* viewport, s32 color) { s16 vpUlx = (viewport->vp.vtrans[0] - viewport->vp.vscale[0]) / 4 + 1; s16 vpUly = (viewport->vp.vtrans[1] - viewport->vp.vscale[1]) / 4 + 1; s16 vpLrx = (viewport->vp.vtrans[0] + viewport->vp.vscale[0]) / 4 - 2; @@ -218,8 +215,7 @@ void draw_screen_borders(void) { #if BORDER_HEIGHT != 0 gDPFillRectangle(gDisplayListHead++, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), 0, GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(0) - 1, BORDER_HEIGHT - 1); - gDPFillRectangle(gDisplayListHead++, - GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), SCREEN_HEIGHT - BORDER_HEIGHT, + gDPFillRectangle(gDisplayListHead++, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), SCREEN_HEIGHT - BORDER_HEIGHT, GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(0) - 1, SCREEN_HEIGHT - 1); #endif } @@ -228,7 +224,7 @@ void draw_screen_borders(void) { * Defines the viewport scissoring rectangle. * Scissoring: https://jrra.zone/n64/doc/pro-man/pro12/12-03.htm#01 */ -void make_viewport_clip_rect(Vp *viewport) { +void make_viewport_clip_rect(Vp* viewport) { s16 vpUlx = (viewport->vp.vtrans[0] - viewport->vp.vscale[0]) / 4 + 1; s16 vpPly = (viewport->vp.vtrans[1] - viewport->vp.vscale[1]) / 4 + 1; s16 vpLrx = (viewport->vp.vtrans[0] + viewport->vp.vscale[0]) / 4 - 1; @@ -249,14 +245,13 @@ void create_gfx_task_structure(void) { gGfxSPTask->task.t.type = M_GFXTASK; gGfxSPTask->task.t.ucode_size = SP_UCODE_SIZE; // (this size is ignored) gGfxSPTask->task.t.ucode_data_size = SP_UCODE_DATA_SIZE; - gGfxSPTask->task.t.dram_stack = (u64 *) gGfxSPTaskStack; + gGfxSPTask->task.t.dram_stack = (u64*)gGfxSPTaskStack; gGfxSPTask->task.t.dram_stack_size = SP_DRAM_STACK_SIZE8; gGfxSPTask->task.t.output_buff = gGfxSPTaskOutputBuffer; - gGfxSPTask->task.t.output_buff_size = - (u64 *)((u8 *) gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)); - gGfxSPTask->task.t.data_ptr = (u64 *) &gGfxPool->buffer; + gGfxSPTask->task.t.output_buff_size = (u64*)((u8*)gGfxSPTaskOutputBuffer + sizeof(gGfxSPTaskOutputBuffer)); + gGfxSPTask->task.t.data_ptr = (u64*)&gGfxPool->buffer; gGfxSPTask->task.t.data_size = entries * sizeof(Gfx); - gGfxSPTask->task.t.yield_data_ptr = (u64 *) gGfxSPTaskYieldBuffer; + gGfxSPTask->task.t.yield_data_ptr = (u64*)gGfxSPTaskYieldBuffer; gGfxSPTask->task.t.yield_data_size = OS_YIELD_DATA_SIZE; } @@ -303,7 +298,7 @@ void end_master_display_list(void) { void draw_reset_bars(void) { s32 width, height; s32 fbNum; - u64 *fbPtr; + u64* fbPtr; return; @@ -314,12 +309,13 @@ void draw_reset_bars(void) { fbNum = sRenderedFramebuffer - 1; } - fbPtr = (u64 *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[fbNum]); + fbPtr = (u64*)PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[fbNum]); fbPtr += gNmiResetBarsTimer++ * (SCREEN_WIDTH / 4); for (width = 0; width < ((SCREEN_HEIGHT / 16) + 1); width++) { // Loop must be one line to match on -O2 - for (height = 0; height < (SCREEN_WIDTH / 4); height++) *fbPtr++ = 0; + for (height = 0; height < (SCREEN_WIDTH / 4); height++) + *fbPtr++ = 0; fbPtr += ((SCREEN_WIDTH / 4) * 14); } } @@ -337,7 +333,7 @@ void render_init(void) { set_segment_base_addr(1, gGfxPool->buffer); gGfxSPTask = &gGfxPool->spTask; gDisplayListHead = gGfxPool->buffer; - gGfxPoolEnd = (u8 *)(gGfxPool->buffer + GFX_POOL_SIZE); + gGfxPoolEnd = (u8*)(gGfxPool->buffer + GFX_POOL_SIZE); init_rcp(); clear_framebuffer(0); end_master_display_list(); @@ -356,7 +352,7 @@ void select_gfx_pool(void) { set_segment_base_addr(1, gGfxPool->buffer); gGfxSPTask = &gGfxPool->spTask; gDisplayListHead = gGfxPool->buffer; - gGfxPoolEnd = (u8 *) (gGfxPool->buffer + GFX_POOL_SIZE); + gGfxPoolEnd = (u8*)(gGfxPool->buffer + GFX_POOL_SIZE); } /** @@ -373,13 +369,13 @@ void display_and_vsync(void) { gGoddardVblankCallback(); gGoddardVblankCallback = NULL; } - if(GfxDebuggerIsDebuggingRequested()) { + if (GfxDebuggerIsDebuggingRequested()) { GfxDebuggerDebugDisplayList(gGfxPool->spTask.task.t.data_ptr); } exec_display_list(&gGfxPool->spTask); profiler_log_thread5_time(AFTER_DISPLAY_LISTS); osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_NOBLOCK); - osViSwapBuffer((void *) PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[sRenderedFramebuffer])); + osViSwapBuffer((void*)PHYSICAL_TO_VIRTUAL(gPhysicalFramebuffers[sRenderedFramebuffer])); profiler_log_thread5_time(THREAD5_END); osRecvMesg(&gGameVblankQueue, &gMainReceivedMesg, OS_MESG_NOBLOCK); if (++sRenderedFramebuffer == 3) { @@ -400,9 +396,8 @@ void display_and_vsync(void) { */ UNUSED static void record_demo(void) { // Record the player's button mask and current rawStickX and rawStickY. - u8 buttonMask = - ((gPlayer1Controller->buttonDown & (A_BUTTON | B_BUTTON | Z_TRIG | START_BUTTON)) >> 8) - | (gPlayer1Controller->buttonDown & (U_CBUTTONS | D_CBUTTONS | L_CBUTTONS | R_CBUTTONS)); + u8 buttonMask = ((gPlayer1Controller->buttonDown & (A_BUTTON | B_BUTTON | Z_TRIG | START_BUTTON)) >> 8) | + (gPlayer1Controller->buttonDown & (U_CBUTTONS | D_CBUTTONS | L_CBUTTONS | R_CBUTTONS)); s8 rawStickX = gPlayer1Controller->rawStickX; s8 rawStickY = gPlayer1Controller->rawStickY; @@ -418,8 +413,8 @@ UNUSED static void record_demo(void) { // Rrecord the distinct input and timer so long as they are unique. // If the timer hits 0xFF, reset the timer for the next demo input. - if (gRecordedDemoInput.timer == 0xFF || buttonMask != gRecordedDemoInput.buttonMask - || rawStickX != gRecordedDemoInput.rawStickX || rawStickY != gRecordedDemoInput.rawStickY) { + if (gRecordedDemoInput.timer == 0xFF || buttonMask != gRecordedDemoInput.buttonMask || + rawStickX != gRecordedDemoInput.rawStickX || rawStickY != gRecordedDemoInput.rawStickY) { gRecordedDemoInput.timer = 0; gRecordedDemoInput.buttonMask = buttonMask; gRecordedDemoInput.rawStickX = rawStickX; @@ -431,7 +426,7 @@ UNUSED static void record_demo(void) { /** * Take the updated controller struct and calculate the new x, y, and distance floats. */ -void adjust_analog_stick(struct Controller *controller) { +void adjust_analog_stick(struct Controller* controller) { UNUSED u8 filler[8]; // Reset the controller's x and y floats. @@ -456,8 +451,7 @@ void adjust_analog_stick(struct Controller *controller) { } // Calculate f32 magnitude from the center by vector length. - controller->stickMag = - sqrtf(controller->stickX * controller->stickX + controller->stickY * controller->stickY); + controller->stickMag = sqrtf(controller->stickX * controller->stickX + controller->stickY * controller->stickY); // Magnitude cannot exceed 64.0f: if it does, modify the values // appropriately to flatten the values down to the allowed maximum value. @@ -542,14 +536,14 @@ void read_controller_inputs(void) { run_demo_inputs(); for (i = 0; i < 2; i++) { - struct Controller *controller = &gControllers[i]; + struct Controller* controller = &gControllers[i]; // if we're receiving inputs, update the controller struct with the new button info. if (controller->controllerData != NULL) { controller->rawStickX = controller->controllerData->stick_x; controller->rawStickY = controller->controllerData->stick_y; - controller->buttonPressed = controller->controllerData->button - & (controller->controllerData->button ^ controller->buttonDown); + controller->buttonPressed = + controller->controllerData->button & (controller->controllerData->button ^ controller->buttonDown); // 0.5x A presses are a good meme controller->buttonDown = controller->controllerData->button; adjust_analog_stick(controller); @@ -623,7 +617,7 @@ void setup_game_memory(void) { UNUSED u8 filler[8]; // Setup general Segment 0 - set_segment_base_addr(0, (void *) (uintptr_t) 0x80000000); + set_segment_base_addr(0, (void*)(uintptr_t)0x80000000); // Create Mesg Queues osCreateMesgQueue(&gGfxVblankQueue, gGfxMesgBuf, ARRAY_COUNT(gGfxMesgBuf)); osCreateMesgQueue(&gGameVblankQueue, gGameMesgBuf, ARRAY_COUNT(gGameMesgBuf)); @@ -642,7 +636,7 @@ void setup_game_memory(void) { * Main game loop thread. Runs forever as long as the game continues. */ -static struct LevelCommand *addr; +static struct LevelCommand* addr; void thread5_game_loop(void) { @@ -674,7 +668,7 @@ void update_vblank_reset(void) { #endif } -void thread5_iteration(void){ +void thread5_iteration(void) { if (GfxDebuggerIsDebugging()) { exec_display_list(&gGfxPool->spTask); return; @@ -710,7 +704,7 @@ void thread5_iteration(void){ if (gShowDebugText) { // subtract the end of the gfx pool with the display list to obtain the // amount of free space remaining. - print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8 *) gDisplayListHead); + print_text_fmt_int(180, 20, "BUF %d", gGfxPoolEnd - (u8*)gDisplayListHead); } FrameInterpolation_StopRecord(); diff --git a/src/game/geo_misc.c b/src/game/geo_misc.c index c0518d06..4c410b65 100644 --- a/src/game/geo_misc.c +++ b/src/game/geo_misc.c @@ -43,9 +43,9 @@ s8 gFlyingCarpetState; * Texture coordinates are s10.5 fixed-point, which means you should left-shift the actual coordinates by 5. */ #ifndef GBI_FLOATS -void make_vertex(Vtx *vtx, s32 n, s16 x, s16 y, s16 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a) { +void make_vertex(Vtx* vtx, s32 n, s16 x, s16 y, s16 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a) { #else -void make_vertex(Vtx *vtx, s32 n, f32 x, f32 y, f32 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a) { +void make_vertex(Vtx* vtx, s32 n, f32 x, f32 y, f32 z, s16 tx, s16 ty, u8 r, u8 g, u8 b, u8 a) { #endif vtx[n].v.ob[0] = x; vtx[n].v.ob[1] = y; @@ -78,11 +78,11 @@ s16 round_float(f32 num) { * Create a display list for the light in the castle lobby that shows the * player where to look to enter Tower of the Wing Cap. */ -Gfx *geo_exec_inside_castle_light(s32 callContext, struct GraphNode *node, UNUSED f32 mtx[4][4]) { +Gfx* geo_exec_inside_castle_light(s32 callContext, struct GraphNode* node, UNUSED f32 mtx[4][4]) { s32 flags; - struct GraphNodeGenerated *generatedNode; - Gfx *displayListHead = NULL; - Gfx *displayList = NULL; + struct GraphNodeGenerated* generatedNode; + Gfx* displayListHead = NULL; + Gfx* displayList = NULL; if (callContext == GEO_CONTEXT_RENDER) { flags = save_file_get_flags(); @@ -95,7 +95,7 @@ Gfx *geo_exec_inside_castle_light(s32 callContext, struct GraphNode *node, UNUSE displayListHead = displayList; } - generatedNode = (struct GraphNodeGenerated *) node; + generatedNode = (struct GraphNodeGenerated*)node; generatedNode->fnNode.node.flags = (generatedNode->fnNode.node.flags & 0xFF) | 0x500; gSPDisplayList(displayListHead++, dl_castle_lobby_wing_cap_light); @@ -109,8 +109,7 @@ Gfx *geo_exec_inside_castle_light(s32 callContext, struct GraphNode *node, UNUSE /** * Update static timer variables that control the flying carpets' ripple effect. */ -Gfx *geo_exec_flying_carpet_timer_update(s32 callContext, UNUSED struct GraphNode *node, - UNUSED f32 mtx[4][4]) { +Gfx* geo_exec_flying_carpet_timer_update(s32 callContext, UNUSED struct GraphNode* node, UNUSED f32 mtx[4][4]) { if (callContext != GEO_CONTEXT_RENDER) { sFlyingCarpetRippleTimer = 0; sPrevAreaTimer = gAreaUpdateCounter - 1; @@ -130,16 +129,16 @@ Gfx *geo_exec_flying_carpet_timer_update(s32 callContext, UNUSED struct GraphNod /** * Create a display list for a flying carpet with dynamic ripples. */ -Gfx *geo_exec_flying_carpet_create(s32 callContext, struct GraphNode *node, UNUSED f32 mtx[4][4]) { +Gfx* geo_exec_flying_carpet_create(s32 callContext, struct GraphNode* node, UNUSED f32 mtx[4][4]) { f32 x, y, z; s16 n, row, col, tx, ty; - Vtx *verts; - struct GraphNodeGenerated *generatedNode = (struct GraphNodeGenerated *) node; + Vtx* verts; + struct GraphNodeGenerated* generatedNode = (struct GraphNodeGenerated*)node; - s16 *sp64 = segmented_to_virtual(flying_carpet_static_vertex_data); - Gfx *displayList = NULL; - Gfx *displayListHead = NULL; - struct Object *curGraphNodeObject; + s16* sp64 = segmented_to_virtual(flying_carpet_static_vertex_data); + Gfx* displayList = NULL; + Gfx* displayListHead = NULL; + struct Object* curGraphNodeObject; if (callContext == GEO_CONTEXT_RENDER) { verts = alloc_display_list(NUM_FLYING_CARPET_VERTICES * sizeof(*verts)); @@ -178,7 +177,7 @@ Gfx *geo_exec_flying_carpet_create(s32 callContext, struct GraphNode *node, UNUS gSPDisplayList(displayListHead++, dl_flying_carpet_end); gSPEndDisplayList(displayListHead); - curGraphNodeObject = (struct Object *) gCurGraphNodeObject; + curGraphNodeObject = (struct Object*)gCurGraphNodeObject; if (gMarioObject->platform == curGraphNodeObject) { gFlyingCarpetState = FLYING_CARPET_MOVING_WITH_MARIO; } else if (curGraphNodeObject->oForwardVel != 0.0) { @@ -196,10 +195,10 @@ static char** gCakeSlices; /** * Create a display list for the end screen with Peach's delicious cake. */ -Gfx *geo_exec_cake_end_screen(s32 callContext, struct GraphNode *node, UNUSED f32 mtx[4][4]) { - struct GraphNodeGenerated *generatedNode = (struct GraphNodeGenerated *) node; - Gfx *displayList = NULL; - Gfx *displayListHead = NULL; +Gfx* geo_exec_cake_end_screen(s32 callContext, struct GraphNode* node, UNUSED f32 mtx[4][4]) { + struct GraphNodeGenerated* generatedNode = (struct GraphNodeGenerated*)node; + Gfx* displayList = NULL; + Gfx* displayListHead = NULL; if (callContext == GEO_CONTEXT_RENDER) { displayList = alloc_display_list(3 * sizeof(*displayList)); diff --git a/src/game/hud.c b/src/game/hud.c index a5d58467..1a3c6028 100644 --- a/src/game/hud.c +++ b/src/game/hud.c @@ -61,41 +61,41 @@ static struct CameraHUD sCameraHUD = { CAM_STATUS_NONE }; /** * Renders a rgba16 16x16 glyph texture from a table list. */ -void render_hud_tex_lut(s32 x, s32 y, u8 *texture) { +void render_hud_tex_lut(s32 x, s32 y, u8* texture) { gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture); gSPDisplayList(gDisplayListHead++, dl_hud_img_load_tex_block); - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 15) << 2, (y + 15) << 2, - G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 15) << 2, (y + 15) << 2, G_TX_RENDERTILE, 0, 0, + 4 << 10, 1 << 10); } /** * Renders a rgba16 8x8 glyph texture from a table list. */ -void render_hud_small_tex_lut(s32 x, s32 y, u8 *texture) { - gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); +void render_hud_small_tex_lut(s32 x, s32 y, u8* texture) { + gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, + G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); gDPTileSync(gDisplayListHead++); - gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, G_TX_RENDERTILE, 0, - G_TX_CLAMP, 3, G_TX_NOLOD, G_TX_CLAMP, 3, G_TX_NOLOD); - gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, (8 - 1) << G_TEXTURE_IMAGE_FRAC, (8 - 1) << G_TEXTURE_IMAGE_FRAC); + gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 3, G_TX_NOLOD, + G_TX_CLAMP, 3, G_TX_NOLOD); + gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, (8 - 1) << G_TEXTURE_IMAGE_FRAC, + (8 - 1) << G_TEXTURE_IMAGE_FRAC); gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_16b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 7) << 2, (y + 7) << 2, G_TX_RENDERTILE, - 0, 0, 4 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 7) << 2, (y + 7) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, + 1 << 10); } /** * Renders power meter health segment texture using a table list. */ void render_power_meter_health_segment(s16 numHealthWedges) { - u8 *(*healthLUT)[] = ResourceGetDataByName(power_meter_health_segments_lut); + u8*(*healthLUT)[] = ResourceGetDataByName(power_meter_health_segments_lut); gDPPipeSync(gDisplayListHead++); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, - (*healthLUT)[numHealthWedges - 1]); + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, (*healthLUT)[numHealthWedges - 1]); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)); gSP1Triangle(gDisplayListHead++, 0, 1, 2, 0); @@ -107,17 +107,15 @@ void render_power_meter_health_segment(s16 numHealthWedges) { * That includes the "POWER" base and the colored health segment textures. */ void render_dl_power_meter(s16 numHealthWedges) { - Mtx *mtx = alloc_display_list(sizeof(Mtx)); - + Mtx* mtx = alloc_display_list(sizeof(Mtx)); if (mtx == NULL) { return; } - guTranslate(mtx, (f32) sPowerMeterHUD.x, (f32) sPowerMeterHUD.y, 0); + guTranslate(mtx, (f32)sPowerMeterHUD.x, (f32)sPowerMeterHUD.y, 0); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx++), - G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx++), G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); gSPDisplayList(gDisplayListHead++, dl_power_meter_base); if (numHealthWedges != 0) { @@ -189,8 +187,7 @@ static void animate_power_meter_hiding(void) { */ void handle_power_meter_actions(s16 numHealthWedges) { // Show power meter if health is not full, less than 8 - if (numHealthWedges < 8 && sPowerMeterStoredHealth == 8 - && sPowerMeterHUD.animation == POWER_METER_HIDDEN) { + if (numHealthWedges < 8 && sPowerMeterStoredHealth == 8 && sPowerMeterHUD.animation == POWER_METER_HIDDEN) { sPowerMeterHUD.animation = POWER_METER_EMPHASIZED; sPowerMeterHUD.y = 166; } @@ -210,8 +207,7 @@ void handle_power_meter_actions(s16 numHealthWedges) { // If Mario is swimming, keep power meter visible if (gPlayerCameraState->action & ACT_FLAG_SWIMMING) { - if (sPowerMeterHUD.animation == POWER_METER_HIDDEN - || sPowerMeterHUD.animation == POWER_METER_EMPHASIZED) { + if (sPowerMeterHUD.animation == POWER_METER_HIDDEN || sPowerMeterHUD.animation == POWER_METER_EMPHASIZED) { sPowerMeterHUD.animation = POWER_METER_DEEMPHASIZING; sPowerMeterHUD.y = 166; } @@ -295,8 +291,8 @@ void render_hud_stars(void) { if (showX == 1) { print_text(GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X) + 16, HUD_TOP_Y, "*"); // 'X' glyph } - print_text_fmt_int((showX * 14) + GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X - 16), - HUD_TOP_Y, "%d", gHudDisplay.stars); + print_text_fmt_int((showX * 14) + GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(HUD_STARS_X - 16), HUD_TOP_Y, "%d", + gHudDisplay.stars); } /** @@ -315,7 +311,7 @@ void render_hud_keys(void) { * Renders the timer when Mario start sliding in PSS. */ void render_hud_timer(void) { - u8 *(*hudLUT)[58] = segmented_to_virtual(main_hud_lut); + u8*(*hudLUT)[58] = segmented_to_virtual(main_hud_lut); u16 timerValFrames = gHudDisplay.timer; u16 timerMins = timerValFrames / (30 * 60); u16 timerSecs = (timerValFrames - (timerMins * 1800)) / 30; @@ -360,7 +356,7 @@ void set_hud_camera_status(s16 status) { * the camera status called, a defined glyph is rendered. */ void render_hud_camera_status(void) { - u8 *(*cameraLUT)[6] = segmented_to_virtual(main_hud_camera_lut); + u8*(*cameraLUT)[6] = segmented_to_virtual(main_hud_camera_lut); s32 x = GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(54); s32 y = 205; @@ -409,7 +405,7 @@ void render_hud(void) { FrameInterpolation_RecordOpenChild("render_hud", (uintptr_t)&hudDisplayFlags); #ifdef VERSION_EU // basically create_dl_ortho_matrix but guOrtho screen width is different - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); if (mtx == NULL) { return; @@ -418,8 +414,7 @@ void render_hud(void) { create_dl_identity_matrix(); guOrtho(mtx, -16.0f, SCREEN_WIDTH + 16, 0, SCREEN_HEIGHT, -10.0f, 10.0f, 1.0f); gSPPerspNormalize(gDisplayListHead++, 0xFFFF); - gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), - G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); + gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); #else create_dl_ortho_matrix(); #endif diff --git a/src/game/ingame_menu.c b/src/game/ingame_menu.c index 1505930a..686679c9 100644 --- a/src/game/ingame_menu.c +++ b/src/game/ingame_menu.c @@ -33,8 +33,9 @@ #define LANGUAGE_FUNCTION gInGameLanguage #endif -static unsigned char textPause[] = { 0x19,0x0A,0x1E,0x1C,0x0E,0xFF }; -static unsigned char textHudCongratulations[] = { 0x0C,0x18,0x17,0x10,0x1B,0x0A,0x1D,0x1E,0x15,0x0A,0x1D,0x12,0x18,0x17,0x1C,0xFF }; +static unsigned char textPause[] = { 0x19, 0x0A, 0x1E, 0x1C, 0x0E, 0xFF }; +static unsigned char textHudCongratulations[] = { 0x0C, 0x18, 0x17, 0x10, 0x1B, 0x0A, 0x1D, 0x1E, + 0x15, 0x0A, 0x1D, 0x12, 0x18, 0x17, 0x1C, 0xFF }; u16 gDialogColorFadeTimer; s8 gLastDialogLineNum; @@ -51,18 +52,9 @@ s8 gRedCoinsCollected; extern u8 gLastCompletedCourseNum; extern u8 gLastCompletedStarNum; -enum DialogBoxState { - DIALOG_STATE_OPENING, - DIALOG_STATE_VERTICAL, - DIALOG_STATE_HORIZONTAL, - DIALOG_STATE_CLOSING -}; +enum DialogBoxState { DIALOG_STATE_OPENING, DIALOG_STATE_VERTICAL, DIALOG_STATE_HORIZONTAL, DIALOG_STATE_CLOSING }; -enum DialogBoxPageState { - DIALOG_PAGE_STATE_NONE, - DIALOG_PAGE_STATE_SCROLL, - DIALOG_PAGE_STATE_END -}; +enum DialogBoxPageState { DIALOG_PAGE_STATE_NONE, DIALOG_PAGE_STATE_SCROLL, DIALOG_PAGE_STATE_END }; enum DialogBoxType { DIALOG_TYPE_ROTATE, // used in NPCs and level messages @@ -74,34 +66,26 @@ enum DialogBoxType { #if defined(VERSION_US) || defined(VERSION_EU) u8 gDialogCharWidths[256] = { // TODO: Is there a way to auto generate this? - 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, - 6, 6, 5, 6, 6, 5, 8, 8, 6, 6, 6, 6, 6, 5, 6, 6, - 8, 7, 6, 6, 6, 5, 5, 6, 5, 5, 6, 5, 4, 5, 5, 3, - 7, 5, 5, 5, 6, 5, 5, 5, 5, 5, 7, 7, 5, 5, 4, 4, - 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 8, 8, 8, 8, 7, 7, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0, + 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 6, 5, 6, 6, 5, 8, 8, 6, 6, 6, 6, 6, 5, 6, 6, + 8, 7, 6, 6, 6, 5, 5, 6, 5, 5, 6, 5, 4, 5, 5, 3, 7, 5, 5, 5, 6, 5, 5, 5, 5, 5, 7, 7, 5, 5, 4, 4, + 8, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 8, 8, 8, 7, 7, 6, 7, 7, 0, 0, 0, 0, 0, 0, 0, #ifdef VERSION_EU - 6, 6, 6, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 5, 5, 5, 5, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, - 5, 5, 5, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 5, 5, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 5, 6, - 0, 4, 4, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 6, 6, 6, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 4, 5, 5, 5, 5, 6, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, + 5, 5, 5, 0, 6, 6, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 5, 0, 0, 6, 6, 0, 0, 0, 0, 0, 0, 0, 5, 6, + 0, 4, 4, 0, 0, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, #else - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4, - 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, 5, 6, - 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, 4, 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, 5, 6, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, #endif - 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, 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, #ifdef VERSION_EU - 7, 5, 10, 5, 9, 8, 4, 0, 0, 0, 0, 5, 5, 6, 5, 0, + 7, 5, 10, 5, 9, 8, 4, 0, 0, 0, 0, 5, 5, 6, 5, 0, #else - 7, 5, 10, 5, 9, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 7, 5, 10, 5, 9, 8, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, #endif - 0, 0, 5, 7, 7, 6, 6, 8, 0, 8, 10, 6, 4, 10, 0, 0 + 0, 0, 5, 7, 7, 6, 6, 8, 0, 8, 10, 6, 4, 10, 0, 0 }; #endif @@ -123,17 +107,29 @@ u8 gMenuHoldKeyTimer = 0; s32 gDialogResponse = DIALOG_RESPONSE_NONE; void create_dl_identity_matrix(void) { - Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); + Mtx* matrix = (Mtx*)alloc_display_list(sizeof(Mtx)); if (matrix == NULL) { return; } #ifndef GBI_FLOATS - matrix->m[0][0] = 0x00010000; matrix->m[1][0] = 0x00000000; matrix->m[2][0] = 0x00000000; matrix->m[3][0] = 0x00000000; - matrix->m[0][1] = 0x00000000; matrix->m[1][1] = 0x00010000; matrix->m[2][1] = 0x00000000; matrix->m[3][1] = 0x00000000; - matrix->m[0][2] = 0x00000001; matrix->m[1][2] = 0x00000000; matrix->m[2][2] = 0x00000000; matrix->m[3][2] = 0x00000000; - matrix->m[0][3] = 0x00000000; matrix->m[1][3] = 0x00000001; matrix->m[2][3] = 0x00000000; matrix->m[3][3] = 0x00000000; + matrix->m[0][0] = 0x00010000; + matrix->m[1][0] = 0x00000000; + matrix->m[2][0] = 0x00000000; + matrix->m[3][0] = 0x00000000; + matrix->m[0][1] = 0x00000000; + matrix->m[1][1] = 0x00010000; + matrix->m[2][1] = 0x00000000; + matrix->m[3][1] = 0x00000000; + matrix->m[0][2] = 0x00000001; + matrix->m[1][2] = 0x00000000; + matrix->m[2][2] = 0x00000000; + matrix->m[3][2] = 0x00000000; + matrix->m[0][3] = 0x00000000; + matrix->m[1][3] = 0x00000001; + matrix->m[2][3] = 0x00000000; + matrix->m[3][3] = 0x00000000; #else guMtxIdent(matrix); #endif @@ -143,7 +139,7 @@ void create_dl_identity_matrix(void) { } void create_dl_translation_matrix(s8 pushOp, f32 x, f32 y, f32 z) { - Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); + Mtx* matrix = (Mtx*)alloc_display_list(sizeof(Mtx)); if (matrix == NULL) { return; @@ -161,7 +157,7 @@ void create_dl_translation_matrix(s8 pushOp, f32 x, f32 y, f32 z) { } void create_dl_rotation_matrix(s8 pushOp, f32 a, f32 x, f32 y, f32 z) { - Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); + Mtx* matrix = (Mtx*)alloc_display_list(sizeof(Mtx)); if (matrix == NULL) { return; @@ -179,7 +175,7 @@ void create_dl_rotation_matrix(s8 pushOp, f32 a, f32 x, f32 y, f32 z) { } void create_dl_scale_matrix(s8 pushOp, f32 x, f32 y, f32 z) { - Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); + Mtx* matrix = (Mtx*)alloc_display_list(sizeof(Mtx)); if (matrix == NULL) { return; @@ -197,7 +193,7 @@ void create_dl_scale_matrix(s8 pushOp, f32 x, f32 y, f32 z) { } void create_dl_ortho_matrix(void) { - Mtx *matrix = (Mtx *) alloc_display_list(sizeof(Mtx)); + Mtx* matrix = (Mtx*)alloc_display_list(sizeof(Mtx)); if (matrix == NULL) { return; @@ -213,14 +209,14 @@ void create_dl_ortho_matrix(void) { gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(matrix), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); } -static u8 *alloc_ia8_text_from_i1(u16 *in, s16 width, s16 height) { +static u8* alloc_ia8_text_from_i1(u16* in, s16 width, s16 height) { s32 inPos; u16 bitMask; - u8 *out; + u8* out; s16 outPos = 0; // u16* in = ResourceGetDataByName(path); - out = alloc_display_list((u32) width * (u32) height); + out = alloc_display_list((u32)width * (u32)height); if (out == NULL) { return NULL; @@ -245,7 +241,7 @@ static u8 *alloc_ia8_text_from_i1(u16 *in, s16 width, s16 height) { } void render_generic_char(u8 c) { - void **fontLUT = segmented_to_virtual(main_font_lut); + void** fontLUT = segmented_to_virtual(main_font_lut); char* packedTexture = segmented_to_virtual(fontLUT[c]); if (packedTexture == NULL) { @@ -253,7 +249,7 @@ void render_generic_char(u8 c) { } gDPPipeSync(gDisplayListHead++); - if(ROM_JP) { + if (ROM_JP) { gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, VIRTUAL_TO_PHYSICAL(packedTexture)); } else { gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, VIRTUAL_TO_PHYSICAL(packedTexture)); @@ -261,20 +257,20 @@ void render_generic_char(u8 c) { gSPDisplayList(gDisplayListHead++, dl_ia_text_tex_settings); #ifdef VERSION_EU - gSPTextureRectangleFlip(gDisplayListHead++, gDialogX << 2, (gDialogY - 16) << 2, - (gDialogX + 8) << 2, gDialogY << 2, G_TX_RENDERTILE, 8 << 6, 4 << 6, 1 << 10, 1 << 10); + gSPTextureRectangleFlip(gDisplayListHead++, gDialogX << 2, (gDialogY - 16) << 2, (gDialogX + 8) << 2, gDialogY << 2, + G_TX_RENDERTILE, 8 << 6, 4 << 6, 1 << 10, 1 << 10); #endif } #ifdef VERSION_EU -u8 *alloc_ia4_tex_from_i1(u8 *in, s16 width, s16 height) { - u32 size = (u32) width * (u32) height; - u8 *out; +u8* alloc_ia4_tex_from_i1(u8* in, s16 width, s16 height) { + u32 size = (u32)width * (u32)height; + u8* out; s32 inPos; s16 outPos = 0; u8 bitMask; - out = (u8 *) alloc_display_list(size); + out = (u8*)alloc_display_list(size); if (out == NULL) { return NULL; @@ -296,9 +292,9 @@ u8 *alloc_ia4_tex_from_i1(u8 *in, s16 width, s16 height) { } void render_generic_char_at_pos(s16 xPos, s16 yPos, u8 c) { - void **fontLUT = segmented_to_virtual(main_font_lut); - void *packedTexture = segmented_to_virtual(fontLUT[c]); - void *unpackedTexture = alloc_ia4_tex_from_i1(packedTexture, 8, 8); + void** fontLUT = segmented_to_virtual(main_font_lut); + void* packedTexture = segmented_to_virtual(fontLUT[c]); + void* unpackedTexture = alloc_ia4_tex_from_i1(packedTexture, 8, 8); gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, VIRTUAL_TO_PHYSICAL(unpackedTexture)); @@ -307,13 +303,13 @@ void render_generic_char_at_pos(s16 xPos, s16 yPos, u8 c) { G_TX_RENDERTILE, 8 << 6, 4 << 6, 1 << 10, 1 << 10); } -void render_lowercase_diacritic(s16 *xPos, s16 *yPos, u8 letter, u8 diacritic) { +void render_lowercase_diacritic(s16* xPos, s16* yPos, u8 letter, u8 diacritic) { render_generic_char_at_pos(*xPos, *yPos, letter); render_generic_char_at_pos(*xPos, *yPos, diacritic + 0xE7); *xPos += gDialogCharWidths[letter]; } -void render_uppercase_diacritic(s16 *xPos, s16 *yPos, u8 letter, u8 diacritic) { +void render_uppercase_diacritic(s16* xPos, s16* yPos, u8 letter, u8 diacritic) { render_generic_char_at_pos(*xPos, *yPos, letter); render_generic_char_at_pos(*xPos, *yPos - 4, diacritic + 0xE3); *xPos += gDialogCharWidths[letter]; @@ -339,20 +335,20 @@ enum MultiStringIDs { STRING_THE, STRING_YOU }; #if defined(VERSION_US) void render_multi_text_string(s8 multiTextID) #elif defined(VERSION_EU) -void render_multi_text_string(s16 *xPos, s16 *yPos, s8 multiTextID) +void render_multi_text_string(s16* xPos, s16* yPos, s8 multiTextID) #endif { s8 i; struct MultiTextEntry textLengths[2] = { - { 3, { TEXT_THE_RAW } }, - { 3, { TEXT_YOU_RAW } }, + { 3, { TEXT_THE_RAW } }, + { 3, { TEXT_YOU_RAW } }, }; for (i = 0; i < textLengths[multiTextID].length; i++) { #if defined(VERSION_US) render_generic_char(textLengths[multiTextID].str[i]); - create_dl_translation_matrix( - MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[textLengths[multiTextID].str[i]]), 0.0f, 0.0f); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[textLengths[multiTextID].str[i]]), 0.0f, + 0.0f); #elif defined(VERSION_EU) render_generic_char_at_pos(*xPos, *yPos, textLengths[multiTextID].str[i]); *xPos += gDialogCharWidths[textLengths[multiTextID].str[i]]; @@ -369,7 +365,7 @@ void render_multi_text_string(s16 *xPos, s16 *yPos, s8 multiTextID) * Prints a generic white string. * In JP/EU a IA1 texture is used but in US a IA4 texture is used. */ -void print_generic_string(s16 x, s16 y, const u8 *str) { +void print_generic_string(s16 x, s16 y, const u8* str) { UNUSED s8 mark = DIALOG_MARK_NONE; // unused in EU s32 strPos = 0; u8 lineNum = 1; @@ -406,8 +402,8 @@ void print_generic_string(s16 x, s16 y, const u8 *str) { #ifdef VERSION_EU xCoord += gDialogCharWidths[DIALOG_CHAR_SPACE] * 2; #else - create_dl_translation_matrix( - MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * 2), 0.0f, 0.0f); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * 2), 0.0f, + 0.0f); #endif break; case DIALOG_CHAR_MULTI_THE: @@ -459,26 +455,28 @@ void print_generic_string(s16 x, s16 y, const u8 *str) { #ifdef VERSION_EU void print_hud_char_umlaut(s16 x, s16 y, u8 chr) { - void **fontLUT = segmented_to_virtual(main_hud_lut); + void** fontLUT = segmented_to_virtual(main_hud_lut); gDPPipeSync(gDisplayListHead++); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, fontLUT[chr]); gSPDisplayList(gDisplayListHead++, dl_rgba16_load_tex_block); - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 16) << 2, (y + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 16) << 2, (y + 16) << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, fontLUT[GLYPH_UMLAUT]); gSPDisplayList(gDisplayListHead++, dl_rgba16_load_tex_block); - gSPTextureRectangle(gDisplayListHead++, x << 2, (y - 4) << 2, (x + 16) << 2, (y + 12) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, x << 2, (y - 4) << 2, (x + 16) << 2, (y + 12) << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); } #endif /** * Prints a hud string depending of the hud table list defined. */ -void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { +void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8* str) { s32 strPos = 0; - void **hudLUT1 = segmented_to_virtual(menu_hud_lut); // Japanese Menu HUD Color font - void **hudLUT2 = segmented_to_virtual(main_hud_lut); // 0-9 A-Z HUD Color Font + void** hudLUT1 = segmented_to_virtual(menu_hud_lut); // Japanese Menu HUD Color font + void** hudLUT2 = segmented_to_virtual(main_hud_lut); // 0-9 A-Z HUD Color Font u32 curX = x; u32 curY = y; @@ -491,9 +489,9 @@ void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { } while (str[strPos] != GLOBAR_CHAR_TERMINATOR) { - if(!ROM_JP){ + if (!ROM_JP) { switch (str[strPos]) { - #ifdef VERSION_EU +#ifdef VERSION_EU case GLOBAL_CHAR_SPACE: curX += xStride / 2; break; @@ -509,11 +507,11 @@ void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { print_hud_char_umlaut(curX, curY, ASCII_TO_DIALOG('U')); curX += xStride; break; - #else +#else case GLOBAL_CHAR_SPACE: curX += 8; break; - #endif +#endif default: gDPPipeSync(gDisplayListHead++); @@ -522,13 +520,14 @@ void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { } if (hudLUT == HUD_LUT_GLOBAL) { - const u8 *texture = hudLUT2[str[strPos]]; - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture == NULL ? hudLUT2[COLOR_CHAR_STAR] : texture); + const u8* texture = hudLUT2[str[strPos]]; + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, + texture == NULL ? hudLUT2[COLOR_CHAR_STAR] : texture); } gSPDisplayList(gDisplayListHead++, dl_rgba16_load_tex_block); - gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 16) << 2, - (curY + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 16) << 2, (curY + 16) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); curX += xStride; } @@ -540,13 +539,14 @@ void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { } if (hudLUT == HUD_LUT_GLOBAL) { - const u8 *texture = hudLUT2[str[strPos]]; - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture == NULL ? hudLUT2[COLOR_CHAR_STAR] : texture); + const u8* texture = hudLUT2[str[strPos]]; + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, + texture == NULL ? hudLUT2[COLOR_CHAR_STAR] : texture); } gSPDisplayList(gDisplayListHead++, dl_rgba16_load_tex_block); - gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 16) << 2, - (curY + 16) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 16) << 2, (curY + 16) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); curX += xStride; } @@ -556,26 +556,28 @@ void print_hud_lut_string(s8 hudLUT, s16 x, s16 y, const u8 *str) { #ifdef VERSION_EU void print_menu_char_umlaut(s16 x, s16 y, u8 chr) { - void **fontLUT = segmented_to_virtual(menu_font_lut); + void** fontLUT = segmented_to_virtual(menu_font_lut); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, fontLUT[chr]); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_8b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 8) << 2, (y + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, x << 2, y << 2, (x + 8) << 2, (y + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, + 1 << 10); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, fontLUT[DIALOG_CHAR_UMLAUT]); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_8b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, x << 2, (y - 4) << 2, (x + 8) << 2, (y + 4) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, x << 2, (y - 4) << 2, (x + 8) << 2, (y + 4) << 2, G_TX_RENDERTILE, 0, 0, + 1 << 10, 1 << 10); } #endif -void print_menu_generic_string(s16 x, s16 y, const u8 *str) { +void print_menu_generic_string(s16 x, s16 y, const u8* str) { UNUSED s8 mark = DIALOG_MARK_NONE; // unused in EU s32 strPos = 0; u32 curX = x; u32 curY = y; - void **fontLUT = segmented_to_virtual(menu_font_lut); + void** fontLUT = segmented_to_virtual(menu_font_lut); while (str[strPos] != DIALOG_CHAR_TERMINATOR) { switch (str[strPos]) { @@ -607,16 +609,17 @@ void print_menu_generic_string(s16 x, s16 y, const u8 *str) { gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, fontLUT[str[strPos]]); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_8b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 8) << 2, - (curY + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 8) << 2, (curY + 8) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); #ifndef VERSION_EU if (mark != DIALOG_MARK_NONE) { - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, fontLUT[DIALOG_CHAR_MARK_START + mark]); + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_8b, 1, + fontLUT[DIALOG_CHAR_MARK_START + mark]); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_8b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, (curX + 6) << 2, (curY - 7) << 2, - (curX + 6 + 8) << 2, (curY - 7 + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, (curX + 6) << 2, (curY - 7) << 2, (curX + 6 + 8) << 2, + (curY - 7 + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); mark = DIALOG_MARK_NONE; } @@ -625,21 +628,21 @@ void print_menu_generic_string(s16 x, s16 y, const u8 *str) { } strPos++; } - } -void print_credits_string(s16 x, s16 y, const u8 *str) { +void print_credits_string(s16 x, s16 y, const u8* str) { s32 strPos = 0; - void **fontLUT = segmented_to_virtual(main_credits_font_lut); + void** fontLUT = segmented_to_virtual(main_credits_font_lut); u32 curX = x; u32 curY = y; - gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); + gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, + G_TX_NOMASK, G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD); gDPTileSync(gDisplayListHead++); - gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, G_TX_RENDERTILE, 0, - G_TX_CLAMP, 3, G_TX_NOLOD, G_TX_CLAMP, 3, G_TX_NOLOD); - gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, (8 - 1) << G_TEXTURE_IMAGE_FRAC, (8 - 1) << G_TEXTURE_IMAGE_FRAC); + gDPSetTile(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 2, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 3, G_TX_NOLOD, + G_TX_CLAMP, 3, G_TX_NOLOD); + gDPSetTileSize(gDisplayListHead++, G_TX_RENDERTILE, 0, 0, (8 - 1) << G_TEXTURE_IMAGE_FRAC, + (8 - 1) << G_TEXTURE_IMAGE_FRAC); while (str[strPos] != GLOBAR_CHAR_TERMINATOR) { switch (str[strPos]) { @@ -651,8 +654,8 @@ void print_credits_string(s16 x, s16 y, const u8 *str) { gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, fontLUT[str[strPos]]); gDPLoadSync(gDisplayListHead++); gDPLoadBlock(gDisplayListHead++, G_TX_LOADTILE, 0, 0, 8 * 8 - 1, CALC_DXT(8, G_IM_SIZ_16b_BYTES)); - gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 8) << 2, - (curY + 8) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gSPTextureRectangle(gDisplayListHead++, curX << 2, curY << 2, (curX + 8) << 2, (curY + 8) << 2, + G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); curX += 7; break; } @@ -660,7 +663,7 @@ void print_credits_string(s16 x, s16 y, const u8 *str) { } } -void handle_menu_scrolling(s8 scrollDirection, s8 *currentIndex, s8 minIndex, s8 maxIndex) { +void handle_menu_scrolling(s8 scrollDirection, s8* currentIndex, s8 minIndex, s8 maxIndex) { u8 index = 0; if (scrollDirection == MENU_SCROLL_VERTICAL) { @@ -716,8 +719,8 @@ void handle_menu_scrolling(s8 scrollDirection, s8 *currentIndex, s8 minIndex, s8 // EU has both get_str_x_pos_from_center and get_str_x_pos_from_center_scale // JP, US and Shindou only implement one or the other #if defined(VERSION_US) || defined(VERSION_EU) -s16 get_str_x_pos_from_center(s16 centerPos, u8 *str, UNUSED f32 scale) { - if(ROM_JP){ +s16 get_str_x_pos_from_center(s16 centerPos, u8* str, UNUSED f32 scale) { + if (ROM_JP) { return get_str_x_pos_from_center_scale(centerPos, str, scale); } s16 strPos = 0; @@ -733,7 +736,7 @@ s16 get_str_x_pos_from_center(s16 centerPos, u8 *str, UNUSED f32 scale) { } #endif -s16 get_str_x_pos_from_center_scale(s16 centerPos, u8 *str, f32 scale) { +s16 get_str_x_pos_from_center_scale(s16 centerPos, u8* str, f32 scale) { s16 strPos = 0; f32 charsWidth = 0.0f; f32 spacesWidth = 0.0f; @@ -742,19 +745,18 @@ s16 get_str_x_pos_from_center_scale(s16 centerPos, u8 *str, f32 scale) { //! EU checks for dakuten and handakuten despite dialog code unable to handle it if (str[strPos] == DIALOG_CHAR_SPACE) { spacesWidth += 1.0; - } else if (str[strPos] != DIALOG_CHAR_DAKUTEN - && str[strPos] != DIALOG_CHAR_PERIOD_OR_HANDAKUTEN) { + } else if (str[strPos] != DIALOG_CHAR_DAKUTEN && str[strPos] != DIALOG_CHAR_PERIOD_OR_HANDAKUTEN) { charsWidth += 1.0; } strPos++; } // return the x position of where the string starts as half the string's // length from the position of the provided center. - return (f32) centerPos - (scale * (charsWidth / 2.0)) - ((scale / 2.0) * (spacesWidth / 2.0)); + return (f32)centerPos - (scale * (charsWidth / 2.0)) - ((scale / 2.0) * (spacesWidth / 2.0)); } #if defined(VERSION_US) || defined(VERSION_EU) -s16 get_string_width(u8 *str) { +s16 get_string_width(u8* str) { s16 strPos = 0; s16 width = 0; @@ -804,7 +806,7 @@ void print_hud_my_score_stars(s8 fileIndex, s8 courseIndex, s16 x, s16 y) { } } -void int_to_str(s32 num, u8 *dst) { +void int_to_str(s32 num, u8* dst) { s32 digit1; s32 digit2; s32 digit3; @@ -812,7 +814,8 @@ void int_to_str(s32 num, u8 *dst) { s8 pos = 0; if (num > 999) { - dst[0] = 0x00; dst[1] = DIALOG_CHAR_TERMINATOR; + dst[0] = 0x00; + dst[1] = DIALOG_CHAR_TERMINATOR; return; } @@ -887,7 +890,7 @@ void reset_dialog_render_state(void) { #define Y_VAL1 (ROM_JP ? 2.0 : 5.0) #define Y_VAL2 (ROM_JP ? 4 : 5.0f) -void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { +void render_dialog_box_type(struct DialogEntry* dialog, s8 linesPerBox) { UNUSED s32 unused; create_dl_translation_matrix(MENU_MTX_NOPUSH, dialog->leftOffset, dialog->width, 0); @@ -904,7 +907,7 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { case DIALOG_TYPE_ZOOM: // Renders a dialog white box with zoom if (gDialogBoxState == DIALOG_STATE_OPENING || gDialogBoxState == DIALOG_STATE_CLOSING) { create_dl_translation_matrix(MENU_MTX_NOPUSH, 65.0 - (65.0 / gDialogBoxScale), - (40.0 / gDialogBoxScale) - 40, 0); + (40.0 / gDialogBoxScale) - 40, 0); create_dl_scale_matrix(MENU_MTX_NOPUSH, 1.0 / gDialogBoxScale, 1.0 / gDialogBoxScale, 1.0f); } gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 150); @@ -912,7 +915,7 @@ void render_dialog_box_type(struct DialogEntry *dialog, s8 linesPerBox) { } create_dl_translation_matrix(MENU_MTX_PUSH, X_VAL1, Y_VAL1, 0); - create_dl_scale_matrix(MENU_MTX_NOPUSH, 1.1f, ((f32) linesPerBox / Y_VAL2) + 0.1, 1.0f); + create_dl_scale_matrix(MENU_MTX_NOPUSH, 1.1f, ((f32)linesPerBox / Y_VAL2) + 0.1, 1.0f); gSPDisplayList(gDisplayListHead++, dl_draw_text_bg_box); gSPPopMatrix(gDisplayListHead++, G_MTX_MODELVIEW); @@ -944,7 +947,7 @@ void change_and_flash_dialog_text_color_lines(s8 colorMode, s8 lineNum) { } #ifdef VERSION_EU -void render_generic_dialog_char_at_pos(struct DialogEntry *dialog, s16 x, s16 y, u8 c) { +void render_generic_dialog_char_at_pos(struct DialogEntry* dialog, s16 x, s16 y, u8 c) { s16 width = (8.0 - (gDialogBoxScale * 0.8)); s16 height = (16.0 - (gDialogBoxScale * 0.8)); s16 tmpX = (dialog->leftOffset + (65.0 - (65.0 / gDialogBoxScale))); @@ -952,14 +955,14 @@ void render_generic_dialog_char_at_pos(struct DialogEntry *dialog, s16 x, s16 y, s16 xCoord = (tmpX + (x / gDialogBoxScale)); s16 yCoord = (tmpY + (y / gDialogBoxScale)); - void **fontLUT = segmented_to_virtual(main_font_lut); - void *packedTexture = segmented_to_virtual(fontLUT[c]); - void *unpackedTexture = alloc_ia4_tex_from_i1(packedTexture, 8, 8); + void** fontLUT = segmented_to_virtual(main_font_lut); + void* packedTexture = segmented_to_virtual(fontLUT[c]); + void* unpackedTexture = alloc_ia4_tex_from_i1(packedTexture, 8, 8); gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_IA, G_IM_SIZ_16b, 1, VIRTUAL_TO_PHYSICAL(unpackedTexture)); gSPDisplayList(gDisplayListHead++, dl_ia_text_tex_settings); - gSPTextureRectangleFlip(gDisplayListHead++, xCoord << 2, (yCoord - height) << 2, - (xCoord + width) << 2, yCoord << 2, G_TX_RENDERTILE, 8 << 6, 4 << 6, 1 << 10, 1 << 10); + gSPTextureRectangleFlip(gDisplayListHead++, xCoord << 2, (yCoord - height) << 2, (xCoord + width) << 2, yCoord << 2, + G_TX_RENDERTILE, 8 << 6, 4 << 6, 1 << 10, 1 << 10); } #endif @@ -967,9 +970,9 @@ void render_generic_dialog_char_at_pos(struct DialogEntry *dialog, s16 x, s16 y, #define Y_VAL3 (ROM_JP ? 20 : 16) #ifdef VERSION_EU -void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s8 *xMatrix) +void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8* pageState, s8* xMatrix) #else -void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s8 *xMatrix, s16 *linePos) +void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8* pageState, s8* xMatrix, s16* linePos) #endif { #ifndef VERSION_EU @@ -990,7 +993,7 @@ void handle_dialog_scroll_page_state(s8 lineNum, s8 totalLines, s8 *pageState, s *xMatrix = 1; } -void adjust_pos_and_print_period_char(s8 *xMatrix, s16 *linePos) { +void adjust_pos_and_print_period_char(s8* xMatrix, s16* linePos) { if (*linePos != 0) { create_dl_translation_matrix(MENU_MTX_NOPUSH, 10 * *xMatrix, 0, 0); } @@ -1005,9 +1008,9 @@ void adjust_pos_and_print_period_char(s8 *xMatrix, s16 *linePos) { } #ifdef VERSION_EU -void render_star_count_dialog_text(struct DialogEntry *dialog, s8 *linePos) +void render_star_count_dialog_text(struct DialogEntry* dialog, s8* linePos) #else -void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) +void render_star_count_dialog_text(s8* xMatrix, s16* linePos) #endif { s8 tensDigit = gDialogVariable / 10; @@ -1015,17 +1018,17 @@ void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) if (tensDigit != 0) { #if !defined(VERSION_EU) - if(ROM_JP) { + if (ROM_JP) { create_dl_translation_matrix(MENU_MTX_NOPUSH, 10 * *xMatrix, 0, 0); render_generic_char(tensDigit); } else { if (*xMatrix != 1) { - create_dl_translation_matrix( - MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * *xMatrix), 0, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * *xMatrix), 0, + 0); } render_generic_char(tensDigit); - create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32) gDialogCharWidths[tensDigit], 0, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)gDialogCharWidths[tensDigit], 0, 0); *xMatrix = 1; (*linePos)++; } @@ -1036,23 +1039,23 @@ void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) #endif } #ifndef VERSION_EU - else if(ROM_JP) { + else if (ROM_JP) { (*xMatrix)++; } #endif #ifndef VERSION_EU - if(ROM_JP) { + if (ROM_JP) { create_dl_translation_matrix(MENU_MTX_NOPUSH, 10 * *xMatrix, 0, 0); render_generic_char(onesDigit); } else { if (*xMatrix != 1) { - create_dl_translation_matrix( - MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * (*xMatrix - 1)), 0, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * (*xMatrix - 1)), + 0, 0); } render_generic_char(onesDigit); - create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32) gDialogCharWidths[onesDigit], 0, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (f32)gDialogCharWidths[onesDigit], 0, 0); } (*linePos)++; *xMatrix = 1; @@ -1065,22 +1068,22 @@ void render_star_count_dialog_text(s8 *xMatrix, s16 *linePos) #if defined(VERSION_US) || defined(VERSION_EU) #ifdef VERSION_EU -void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s8 linesPerBox, UNUSED s8 xMatrix, s8 lowerBound, struct DialogEntry *dialog) +void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s8 linesPerBox, UNUSED s8 xMatrix, s8 lowerBound, + struct DialogEntry* dialog) #else -void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s16 *linePos, s8 linesPerBox, s8 xMatrix, s8 lowerBound) +void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s16* linePos, s8 linesPerBox, s8 xMatrix, s8 lowerBound) #endif { s8 i; struct MultiTextEntry textLengths[2] = { - { 3, { TEXT_THE_RAW } }, - { 3, { TEXT_YOU_RAW } }, + { 3, { TEXT_THE_RAW } }, + { 3, { TEXT_YOU_RAW } }, }; if (lineNum >= lowerBound && lineNum <= (lowerBound + linesPerBox)) { #ifdef VERSION_US if (*linePos != 0 || xMatrix != 1) { - create_dl_translation_matrix( - MENU_MTX_NOPUSH, (gDialogCharWidths[DIALOG_CHAR_SPACE] * (xMatrix - 1)), 0, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (gDialogCharWidths[DIALOG_CHAR_SPACE] * (xMatrix - 1)), 0, 0); } #endif for (i = 0; i < textLengths[multiTextId].length; i++) { @@ -1089,8 +1092,7 @@ void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s16 *linePos, s8 gDialogX += gDialogCharWidths[textLengths[multiTextId].str[i]]; #else render_generic_char(textLengths[multiTextId].str[i]); - create_dl_translation_matrix( - MENU_MTX_NOPUSH, (gDialogCharWidths[textLengths[multiTextId].str[i]]), 0, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (gDialogCharWidths[textLengths[multiTextId].str[i]]), 0, 0); #endif } } @@ -1102,13 +1104,13 @@ void render_multi_text_string_lines(s8 multiTextId, s8 lineNum, s16 *linePos, s8 #endif #ifdef VERSION_EU -void render_dialog_lowercase_diacritic(struct DialogEntry *dialog, u8 chr, u8 diacritic) { +void render_dialog_lowercase_diacritic(struct DialogEntry* dialog, u8 chr, u8 diacritic) { render_generic_dialog_char_at_pos(dialog, gDialogX, gDialogY, chr); render_generic_dialog_char_at_pos(dialog, gDialogX, gDialogY, diacritic + 0xE7); gDialogX += gDialogCharWidths[chr]; } -void render_dialog_uppercase_diacritic(struct DialogEntry *dialog, u8 chr, u8 diacritic) { +void render_dialog_uppercase_diacritic(struct DialogEntry* dialog, u8 chr, u8 diacritic) { render_generic_dialog_char_at_pos(dialog, gDialogX, gDialogY, chr); render_generic_dialog_char_at_pos(dialog, gDialogX, gDialogY - 4, diacritic + 0xE3); gDialogX += gDialogCharWidths[chr]; @@ -1123,10 +1125,10 @@ u32 ensure_nonnegative(s16 value) { return value; } -void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 lowerBound) { +void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry* dialog, s8 lowerBound) { UNUSED u8 filler[8]; u8 strChar; - u8 *str = segmented_to_virtual(dialog->str); + u8* str = segmented_to_virtual(dialog->str); s8 lineNum = 1; s8 totalLines; s8 pageState = DIALOG_PAGE_STATE_NONE; @@ -1149,7 +1151,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l strIdx = gDialogTextPos; if (gDialogBoxState == DIALOG_STATE_HORIZONTAL) { - create_dl_translation_matrix(MENU_MTX_NOPUSH, 0, (f32) gDialogScrollOffsetY, 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, 0, (f32)gDialogScrollOffsetY, 0); } create_dl_translation_matrix(MENU_MTX_PUSH, X_VAL3, 2 - lineNum * Y_VAL3, 0); @@ -1174,7 +1176,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l break; case DIALOG_CHAR_SPACE: - if(!ROM_JP || linePos != 0){ + if (!ROM_JP || linePos != 0) { xMatrix++; } linePos++; @@ -1183,31 +1185,31 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l render_star_count_dialog_text(&xMatrix, &linePos); break; case DIALOG_CHAR_PERIOD: - if(ROM_JP) { + if (ROM_JP) { adjust_pos_and_print_period_char(&xMatrix, &linePos); break; } case DIALOG_CHAR_SLASH: - if(!ROM_JP) { + if (!ROM_JP) { xMatrix += 2; linePos += 2; break; } case DIALOG_CHAR_MULTI_THE: - if(!ROM_JP) { + if (!ROM_JP) { render_multi_text_string_lines(STRING_THE, lineNum, &linePos, linesPerBox, xMatrix, lowerBound); xMatrix = 1; break; } case DIALOG_CHAR_MULTI_YOU: - if(!ROM_JP) { + if (!ROM_JP) { render_multi_text_string_lines(STRING_YOU, lineNum, &linePos, linesPerBox, xMatrix, lowerBound); xMatrix = 1; break; } default: FrameInterpolation_RecordOpenChild("render_dialog_text_and_pages:render_char", TAG_LETTER(strChar)); - if(ROM_JP) { + if (ROM_JP) { if (linePos != 0) { create_dl_translation_matrix(MENU_MTX_NOPUSH, 10 * xMatrix, 0, 0); } @@ -1226,7 +1228,7 @@ void handle_dialog_text_and_pages(s8 colorMode, struct DialogEntry *dialog, s8 l if (lineNum >= lowerBound && lineNum <= (lowerBound + linesPerBox)) { if (linePos != 0 || xMatrix != 1) { create_dl_translation_matrix( - MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * (xMatrix - 1)), 0, 0); + MENU_MTX_NOPUSH, (f32)(gDialogCharWidths[DIALOG_CHAR_SPACE] * (xMatrix - 1)), 0, 0); } render_generic_char(strChar); @@ -1291,7 +1293,8 @@ void render_dialog_triangle_choice(void) { handle_menu_scrolling(MENU_SCROLL_HORIZONTAL, &gDialogLineNum, 1, 2); } - create_dl_translation_matrix(MENU_MTX_NOPUSH, (gDialogLineNum * X_VAL4_1) - X_VAL4_2, Y_VAL4_1 - (gLastDialogLineNum * Y_VAL4_2), 0); + create_dl_translation_matrix(MENU_MTX_NOPUSH, (gDialogLineNum * X_VAL4_1) - X_VAL4_2, + Y_VAL4_1 - (gLastDialogLineNum * Y_VAL4_2), 0); if (gDialogBoxType == DIALOG_TYPE_ROTATE) { gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); @@ -1309,9 +1312,9 @@ void render_dialog_triangle_choice(void) { #define X_Y_VAL6 0.8f #elif defined(VERSION_EU) #define X_VAL5 122.0f - #define Y_VAL5_1 -16 - #define Y_VAL5_2 3 - #define X_Y_VAL6 0.5f +#define Y_VAL5_1 -16 +#define Y_VAL5_2 3 +#define X_Y_VAL6 0.5f #endif void render_dialog_triangle_next(s8 linesPerBox) { @@ -1342,7 +1345,8 @@ void handle_special_dialog_text(s16 dialogID) { // dialog ID tables, in order s16 dialogRaceSound[] = { DIALOG_005, DIALOG_009, DIALOG_055, DIALOG_164 }; // Red Switch, Green Switch, Blue Switch, 100 coins star, Bowser Red Coin Star s16 dialogStarSound[] = { DIALOG_010, DIALOG_011, DIALOG_012, DIALOG_013, DIALOG_014 }; - // King Bob-omb (Start), Whomp (Defeated), King Bob-omb (Defeated, missing in JP), Eyerock (Defeated), Wiggler (Defeated) + // King Bob-omb (Start), Whomp (Defeated), King Bob-omb (Defeated, missing in JP), Eyerock (Defeated), Wiggler + // (Defeated) #if BUGFIX_KING_BOB_OMB_FADE_MUSIC s16 dialogBossStop[] = { DIALOG_017, DIALOG_115, DIALOG_116, DIALOG_118, DIALOG_152 }; #else @@ -1352,7 +1356,7 @@ void handle_special_dialog_text(s16 dialogID) { // dialog ID tables, in order #endif s16 i; - for (i = 0; i < (s16) ARRAY_COUNT(dialogBossStart); i++) { + for (i = 0; i < (s16)ARRAY_COUNT(dialogBossStart); i++) { if (dialogBossStart[i] == dialogID) { seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); play_music(SEQ_PLAYER_LEVEL, SEQUENCE_ARGS(4, SEQ_EVENT_BOSS), 0); @@ -1360,21 +1364,21 @@ void handle_special_dialog_text(s16 dialogID) { // dialog ID tables, in order } } - for (i = 0; i < (s16) ARRAY_COUNT(dialogRaceSound); i++) { + for (i = 0; i < (s16)ARRAY_COUNT(dialogRaceSound); i++) { if (dialogRaceSound[i] == dialogID && gDialogLineNum == 1) { play_race_fanfare(); return; } } - for (i = 0; i < (s16) ARRAY_COUNT(dialogStarSound); i++) { + for (i = 0; i < (s16)ARRAY_COUNT(dialogStarSound); i++) { if (dialogStarSound[i] == dialogID && gDialogLineNum == 1) { play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource); return; } } - for (i = 0; i < (s16) ARRAY_COUNT(dialogBossStop); i++) { + for (i = 0; i < (s16)ARRAY_COUNT(dialogBossStop); i++) { if (dialogBossStop[i] == dialogID) { seq_player_fade_out(SEQ_PLAYER_LEVEL, 1); return; @@ -1384,23 +1388,15 @@ void handle_special_dialog_text(s16 dialogID) { // dialog ID tables, in order s16 gMenuMode = MENU_MODE_NONE; -char *gEndCutsceneStringsEn[] = { - "TEXT_FILE_MARIO_EXCLAMATION", - "TEXT_POWER_STARS_RESTORED", - "TEXT_THANKS_TO_YOU", - "TEXT_THANK_YOU_MARIO", - "TEXT_SOMETHING_SPECIAL", - "TEXT_LISTEN_EVERYBODY", - "TEXT_LETS_HAVE_CAKE", - "TEXT_FOR_MARIO", - // This [8] string is actually unused. In the cutscene handler, the developers do not - // set the 8th one, but use the first string again at the very end, so Peach ends up - // saying "Mario!" twice. It is likely that she was originally meant to say "Mario?" at - // the end but the developers changed their mind, possibly because the line recorded - // sounded more like an exclamation than a question. - "TEXT_FILE_MARIO_QUESTION", - NULL -}; +char* gEndCutsceneStringsEn[] = { "TEXT_FILE_MARIO_EXCLAMATION", "TEXT_POWER_STARS_RESTORED", "TEXT_THANKS_TO_YOU", + "TEXT_THANK_YOU_MARIO", "TEXT_SOMETHING_SPECIAL", "TEXT_LISTEN_EVERYBODY", + "TEXT_LETS_HAVE_CAKE", "TEXT_FOR_MARIO", + // This [8] string is actually unused. In the cutscene handler, the developers do not + // set the 8th one, but use the first string again at the very end, so Peach ends up + // saying "Mario!" twice. It is likely that she was originally meant to say "Mario?" + // at the end but the developers changed their mind, possibly because the line + // recorded sounded more like an exclamation than a question. + "TEXT_FILE_MARIO_QUESTION", NULL }; #ifdef VERSION_EU u8 gEndCutsceneStrFr0[] = { TEXT_FILE_MARIO_EXCLAMATION }; @@ -1413,17 +1409,9 @@ u8 gEndCutsceneStrFr6[] = { TEXT_LETS_HAVE_CAKE_FR }; u8 gEndCutsceneStrFr7[] = { TEXT_FOR_MARIO_FR }; u8 gEndCutsceneStrFr8[] = { TEXT_FILE_MARIO_QUESTION }; -u8 *gEndCutsceneStringsFr[] = { - gEndCutsceneStrFr0, - gEndCutsceneStrFr1, - gEndCutsceneStrFr2, - gEndCutsceneStrFr3, - gEndCutsceneStrFr4, - gEndCutsceneStrFr5, - gEndCutsceneStrFr6, - gEndCutsceneStrFr7, - gEndCutsceneStrFr8, - NULL +u8* gEndCutsceneStringsFr[] = { + gEndCutsceneStrFr0, gEndCutsceneStrFr1, gEndCutsceneStrFr2, gEndCutsceneStrFr3, gEndCutsceneStrFr4, + gEndCutsceneStrFr5, gEndCutsceneStrFr6, gEndCutsceneStrFr7, gEndCutsceneStrFr8, NULL }; u8 gEndCutsceneStrDe0[] = { TEXT_FILE_MARIO_EXCLAMATION }; @@ -1436,17 +1424,9 @@ u8 gEndCutsceneStrDe6[] = { TEXT_LETS_HAVE_CAKE_DE }; u8 gEndCutsceneStrDe7[] = { TEXT_FOR_MARIO_DE }; u8 gEndCutsceneStrDe8[] = { TEXT_FILE_MARIO_QUESTION }; -u8 *gEndCutsceneStringsDe[] = { - gEndCutsceneStrDe0, - gEndCutsceneStrDe1, - gEndCutsceneStrDe2, - gEndCutsceneStrDe3, - gEndCutsceneStrDe4, - gEndCutsceneStrDe5, - gEndCutsceneStrDe6, - gEndCutsceneStrDe7, - gEndCutsceneStrDe8, - NULL +u8* gEndCutsceneStringsDe[] = { + gEndCutsceneStrDe0, gEndCutsceneStrDe1, gEndCutsceneStrDe2, gEndCutsceneStrDe3, gEndCutsceneStrDe4, + gEndCutsceneStrDe5, gEndCutsceneStrDe6, gEndCutsceneStrDe7, gEndCutsceneStrDe8, NULL }; #endif @@ -1466,7 +1446,7 @@ void render_dialog_entries(void) { #ifdef VERSION_EU s8 lowerBound; #endif - struct DialogEntry *dialog; + struct DialogEntry* dialog; #if defined(VERSION_US) || defined(VERSION_SH) s8 lowerBound; #endif @@ -1523,8 +1503,7 @@ void render_dialog_entries(void) { case DIALOG_STATE_VERTICAL: gDialogBoxOpenTimer = 0.0f; - if ((gPlayer3Controller->buttonPressed & A_BUTTON) - || (gPlayer3Controller->buttonPressed & B_BUTTON)) { + if ((gPlayer3Controller->buttonPressed & A_BUTTON) || (gPlayer3Controller->buttonPressed & B_BUTTON)) { if (gLastDialogPageStrPos == -1) { handle_special_dialog_text(gDialogID); gDialogBoxState = DIALOG_STATE_CLOSING; @@ -1576,14 +1555,10 @@ void render_dialog_entries(void) { render_dialog_box_type(dialog, dialog->linesPerBox); - gDPSetScissor( - gDisplayListHead++, G_SC_NON_INTERLACE, - // Horizontal scissoring isn't really required and can potentially mess up widescreen enhancements. - 0, - ensure_nonnegative(DIAG_VAL2 - dialog->width), - SCREEN_WIDTH, - ensure_nonnegative((240 - dialog->width) + (dialog->linesPerBox * 80 / DIAG_VAL4)) - ); + gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, + // Horizontal scissoring isn't really required and can potentially mess up widescreen enhancements. + 0, ensure_nonnegative(DIAG_VAL2 - dialog->width), SCREEN_WIDTH, + ensure_nonnegative((240 - dialog->width) + (dialog->linesPerBox * 80 / DIAG_VAL4))); bool shouldInterpolate = gDialogScrollOffsetY != 0; FrameInterpolation_ShouldInterpolateFrame(shouldInterpolate); @@ -1595,13 +1570,14 @@ void render_dialog_entries(void) { } #ifdef VERSION_EU - #undef BORDER_HEIGHT - #define BORDER_HEIGHT 8 +#undef BORDER_HEIGHT +#define BORDER_HEIGHT 8 #endif - gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 2, 2, SCREEN_WIDTH - BORDER_HEIGHT / 2, SCREEN_HEIGHT - BORDER_HEIGHT / 2); + gDPSetScissor(gDisplayListHead++, G_SC_NON_INTERLACE, 2, 2, SCREEN_WIDTH - BORDER_HEIGHT / 2, + SCREEN_HEIGHT - BORDER_HEIGHT / 2); #ifdef VERSION_EU - #undef BORDER_HEIGHT - #define BORDER_HEIGHT 1 +#undef BORDER_HEIGHT +#define BORDER_HEIGHT 1 #endif if (gLastDialogPageStrPos != -1 && gDialogBoxState == DIALOG_STATE_VERTICAL) { @@ -1667,7 +1643,7 @@ u8 ascii_to_credits_char(u8 c) { return GLOBAL_CHAR_SPACE; } -void print_credits_str_ascii(s16 x, s16 y, const char *str) { +void print_credits_str_ascii(s16 x, s16 y, const char* str) { s32 pos = 0; u8 c = str[pos]; u8 creditStr[100]; @@ -1766,8 +1742,8 @@ void do_cutscene_handler(void) { // "Dear Mario" message handler void print_peach_letter_message(void) { - struct DialogEntry *dialog; - u8 *str; + struct DialogEntry* dialog; + u8* str; #ifdef VERSION_EU gInGameLanguage = eu_get_language(); @@ -1795,7 +1771,7 @@ void print_peach_letter_message(void) { gDPSetEnvColor(gDisplayListHead++, 20, 20, 20, gCutsceneMsgFade); print_generic_string(STR_X, STR_Y, str); - if(ROM_JP) { + if (ROM_JP) { gSPDisplayList(gDisplayListHead++, dl_ia_text_end); gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, 255); } else { @@ -1880,8 +1856,7 @@ void shade_screen(void) { // This is a bit weird. It reuses the dialog text box (width 130, height -80), // so scale to at least fit the screen. - create_dl_scale_matrix(MENU_MTX_NOPUSH, - GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT / 130.0f, 3.0f, 1.0f); + create_dl_scale_matrix(MENU_MTX_NOPUSH, GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT / 130.0f, 3.0f, 1.0f); gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 110); gSPDisplayList(gDisplayListHead++, dl_draw_text_bg_box); @@ -1923,11 +1898,7 @@ void render_pause_red_coins(void) { } #ifdef VERSION_EU -u8 gTextCourse[][7] = { - { TEXT_COURSE }, - { TEXT_COURSE_FR }, - { TEXT_COURSE_DE } -}; +u8 gTextCourse[][7] = { { TEXT_COURSE }, { TEXT_COURSE_FR }, { TEXT_COURSE_DE } }; #define textCourse gTextCourse #endif @@ -1938,30 +1909,30 @@ u8 gTextCourse[][7] = { #endif #ifdef VERSION_EU -#define TXT_COURSE_X 48 -#define TXT_STAR_X 89 -#define ACT_NAME_X 107 -#define LVL_NAME_X 108 +#define TXT_COURSE_X 48 +#define TXT_STAR_X 89 +#define ACT_NAME_X 107 +#define LVL_NAME_X 108 #define SECRET_LVL_NAME_X get_str_x_pos_from_center(159, &courseName[3], 10.0f) -#define MYSCORE_X 48 +#define MYSCORE_X 48 #else -#define TXT_COURSE_X 63 -#define TXT_STAR_X 98 -#define ACT_NAME_X 116 -#define LVL_NAME_X 117 +#define TXT_COURSE_X 63 +#define TXT_STAR_X 98 +#define ACT_NAME_X 116 +#define LVL_NAME_X 117 #define SECRET_LVL_NAME_X 94 -#define MYSCORE_X 62 +#define MYSCORE_X 62 #endif void render_pause_my_score_coins(void) { -// u8* textCourse = GameEngine_LoadTranslation(""); -// u8* textMyScore = GameEngine_LoadTranslation("TEXT_MY_SCORE"); -// u8* textStar = GameEngine_LoadTranslation("TEXT_STAR"); -// u8* textUnfilledStar = GameEngine_LoadTranslation("TEXT_UNFILLED_STAR"); + // u8* textCourse = GameEngine_LoadTranslation(""); + // u8* textMyScore = GameEngine_LoadTranslation("TEXT_MY_SCORE"); + // u8* textStar = GameEngine_LoadTranslation("TEXT_STAR"); + // u8* textUnfilledStar = GameEngine_LoadTranslation("TEXT_UNFILLED_STAR"); u8 strCourseNum[4]; - u8 *courseName; - u8 *actName; + u8* courseName; + u8* actName; u8 courseIndex; u8 starFlags; @@ -1998,8 +1969,8 @@ void render_pause_my_score_coins(void) { gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); - if (courseIndex <= COURSE_NUM_TO_INDEX(COURSE_STAGES_MAX) - && save_file_get_course_star_count(gCurrSaveFileNum - 1, courseIndex) != 0) { + if (courseIndex <= COURSE_NUM_TO_INDEX(COURSE_STAGES_MAX) && + save_file_get_course_star_count(gCurrSaveFileNum - 1, courseIndex) != 0) { print_generic_string(MYSCORE_X, 121, GameEngine_LoadTranslation("TEXT_MY_SCORE")); } @@ -2019,14 +1990,14 @@ void render_pause_my_score_coins(void) { } print_generic_string(ACT_NAME_X, 140, actName); - if(!ROM_JP) { + if (!ROM_JP) { print_generic_string(LVL_NAME_X, 157, &courseName[3]); } - } else if(!ROM_JP) { + } else if (!ROM_JP) { print_generic_string(SECRET_LVL_NAME_X, 157, &courseName[3]); } // TODO: JPTODO This could be cleaner - if(ROM_JP){ + if (ROM_JP) { print_generic_string(LVL_NAME_X, 157, &courseName[3]); } @@ -2037,7 +2008,7 @@ void render_pause_my_score_coins(void) { #define TXT2_X (ROM_JP ? 116 : 119) #define Y_VAL7 (ROM_JP ? 0 : 2) -void render_pause_camera_options(s16 x, s16 y, s8 *index, s16 xIndex) { +void render_pause_camera_options(s16 x, s16 y, s8* index, s16 xIndex) { handle_menu_scrolling(MENU_SCROLL_HORIZONTAL, index, 1, 2); gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); @@ -2067,7 +2038,7 @@ void render_pause_camera_options(s16 x, s16 y, s8 *index, s16 xIndex) { #define X_VAL8 (ROM_JP ? 0 : 4) #define Y_VAL8 (ROM_JP ? 4 : 2) -void render_pause_course_options(s16 x, s16 y, s8 *index, s16 yIndex) { +void render_pause_course_options(s16 x, s16 y, s8* index, s16 yIndex) { handle_menu_scrolling(MENU_SCROLL_VERTICAL, index, 1, 3); @@ -2182,7 +2153,7 @@ void render_pause_castle_course_stars(s16 x, s16 y, s16 fileIndex, s16 courseInd void render_pause_castle_main_strings(s16 x, s16 y) { #ifdef VERSION_EU - void **courseNameTbl; + void** courseNameTbl; #endif #ifdef VERSION_EU @@ -2191,7 +2162,7 @@ void render_pause_castle_main_strings(s16 x, s16 y) { #else #endif - void *courseName; + void* courseName; u8 strVal[8]; s16 prevCourseIndex = gDialogLineNum; @@ -2210,10 +2181,8 @@ void render_pause_castle_main_strings(s16 x, s16 y) { } #endif - handle_menu_scrolling( - MENU_SCROLL_VERTICAL, &gDialogLineNum, - COURSE_NUM_TO_INDEX(COURSE_MIN) - 1, COURSE_NUM_TO_INDEX(COURSE_BONUS_STAGES) + 1 - ); + handle_menu_scrolling(MENU_SCROLL_VERTICAL, &gDialogLineNum, COURSE_NUM_TO_INDEX(COURSE_MIN) - 1, + COURSE_NUM_TO_INDEX(COURSE_BONUS_STAGES) + 1); if (gDialogLineNum == COURSE_NUM_TO_INDEX(COURSE_BONUS_STAGES) + 1) { gDialogLineNum = COURSE_NUM_TO_INDEX(COURSE_MIN); // Exceeded max, set to min @@ -2231,8 +2200,8 @@ void render_pause_castle_main_strings(s16 x, s16 y) { gDialogLineNum--; } - if (gDialogLineNum == COURSE_NUM_TO_INDEX(COURSE_STAGES_MAX) + 1 - || gDialogLineNum == COURSE_NUM_TO_INDEX(COURSE_MIN) - 1) { + if (gDialogLineNum == COURSE_NUM_TO_INDEX(COURSE_STAGES_MAX) + 1 || + gDialogLineNum == COURSE_NUM_TO_INDEX(COURSE_MIN) - 1) { gDialogLineNum = COURSE_NUM_TO_INDEX(COURSE_BONUS_STAGES); break; } @@ -2257,7 +2226,8 @@ void render_pause_castle_main_strings(s16 x, s16 y) { } else { // Castle secret stars courseName = GameEngine_LoadLevelName(COURSE_MAX); print_generic_string(x + 40, y + 13, GameEngine_LoadTranslation("TEXT_STAR_X")); - int_to_str(save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_BONUS_STAGES - 1, COURSE_MAX - 1), strVal); + int_to_str(save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_BONUS_STAGES - 1, COURSE_MAX - 1), + strVal); print_generic_string(x + 60, y + 13, strVal); #ifdef VERSION_EU print_generic_string(get_str_x_pos_from_center(x + 51, courseName, 10.0f), y + 30, courseName); @@ -2314,8 +2284,7 @@ s16 render_pause_courses_and_castle(void) { #ifdef VERSION_EU if (gPlayer3Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON)) #else - if (gPlayer3Controller->buttonPressed & A_BUTTON - || gPlayer3Controller->buttonPressed & START_BUTTON) + if (gPlayer3Controller->buttonPressed & A_BUTTON || gPlayer3Controller->buttonPressed & START_BUTTON) #endif { level_set_transition(0, NULL); @@ -2342,8 +2311,7 @@ s16 render_pause_courses_and_castle(void) { #ifdef VERSION_EU if (gPlayer3Controller->buttonPressed & (A_BUTTON | Z_TRIG | START_BUTTON)) #else - if (gPlayer3Controller->buttonPressed & A_BUTTON - || gPlayer3Controller->buttonPressed & START_BUTTON) + if (gPlayer3Controller->buttonPressed & A_BUTTON || gPlayer3Controller->buttonPressed & START_BUTTON) #endif { level_set_transition(0, NULL); @@ -2369,15 +2337,15 @@ s16 render_pause_courses_and_castle(void) { #define TXT_CONGRATS_X (ROM_JP ? 60 : 70) #elif defined(VERSION_EU) #define TXT_HISCORE_X get_str_x_pos_from_center_scale(160, GameEngine_LoadTranslation(textHiScore), 12.0f) - #define TXT_HISCORE_Y 36 - #define TXT_CONGRATS_X get_str_x_pos_from_center_scale(160, GameEngine_LoadTranslation(textCongratulations), 12.0f) +#define TXT_HISCORE_Y 36 +#define TXT_CONGRATS_X get_str_x_pos_from_center_scale(160, GameEngine_LoadTranslation(textCongratulations), 12.0f) #elif defined(VERSION_SH) - #define TXT_HISCORE_X 118 - #define TXT_HISCORE_Y 48 - #define TXT_CONGRATS_X 70 +#define TXT_HISCORE_X 118 +#define TXT_HISCORE_Y 48 +#define TXT_CONGRATS_X 70 #endif -#define HUD_PRINT_HISCORE 0 +#define HUD_PRINT_HISCORE 0 #define HUD_PRINT_CONGRATULATIONS 1 void print_hud_course_complete_string(s8 str) { @@ -2387,7 +2355,8 @@ void print_hud_course_complete_string(s8 str) { gDPSetEnvColor(gDisplayListHead++, colorFade, colorFade, colorFade, 255); if (str == HUD_PRINT_HISCORE) { - print_hud_lut_string(HUD_LUT_GLOBAL, TXT_HISCORE_X, TXT_HISCORE_Y, GameEngine_LoadTranslation("TEXT_HUD_HI_SCORE")); + print_hud_lut_string(HUD_LUT_GLOBAL, TXT_HISCORE_X, TXT_HISCORE_Y, + GameEngine_LoadTranslation("TEXT_HUD_HI_SCORE")); } else { // HUD_PRINT_CONGRATULATIONS print_hud_lut_string(HUD_LUT_GLOBAL, TXT_CONGRATS_X, 67, textHudCongratulations); } @@ -2456,7 +2425,7 @@ void play_star_fanfare_and_flash_hud(s32 arg, u8 starNum) { #define TXT_CLEAR_X2 TXT_CLEAR_X1 - 2 void render_course_complete_lvl_info_and_hud_str(void) { - u8 *name; + u8* name; u8 strCourseNum[4]; u8 textSymStar[] = { GLYPH_STAR, GLYPH_SPACE }; @@ -2552,13 +2521,13 @@ void render_course_complete_lvl_info_and_hud_str(void) { gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, gDialogTextAlpha); print_generic_string(76, 145, name); - if(ROM_JP) { + if (ROM_JP) { print_generic_string(220, 145, GameEngine_LoadTranslation("TEXT_CATCH")); } gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, gDialogTextAlpha); print_generic_string(74, 147, name); - if(ROM_JP) { + if (ROM_JP) { print_generic_string(218, 147, GameEngine_LoadTranslation("TEXT_CATCH")); } @@ -2585,27 +2554,19 @@ void render_course_complete_lvl_info_and_hud_str(void) { #endif #ifdef VERSION_EU -void render_save_confirmation(s16 y, s8 *index, s16 sp6e) +void render_save_confirmation(s16 y, s8* index, s16 sp6e) #else -void render_save_confirmation(s16 x, s16 y, s8 *index, s16 sp6e) +void render_save_confirmation(s16 x, s16 y, s8* index, s16 sp6e) #endif { #ifdef VERSION_EU - u8 textSaveAndContinue[][24] = { - { TEXT_SAVE_AND_CONTINUE }, - { TEXT_SAVE_AND_CONTINUE_FR }, - { TEXT_SAVE_AND_CONTINUE_DE } - }; - u8 textSaveAndQuit[][22] = { - { TEXT_SAVE_AND_QUIT }, - { TEXT_SAVE_AND_QUIT_FR }, - { TEXT_SAVE_AND_QUIT_DE } - }; - u8 textContinueWithoutSave[][27] = { - { TEXT_CONTINUE_WITHOUT_SAVING }, - { TEXT_CONTINUE_WITHOUT_SAVING_FR }, - { TEXT_CONTINUE_WITHOUT_SAVING_DE } - }; + u8 textSaveAndContinue[][24] = { { TEXT_SAVE_AND_CONTINUE }, + { TEXT_SAVE_AND_CONTINUE_FR }, + { TEXT_SAVE_AND_CONTINUE_DE } }; + u8 textSaveAndQuit[][22] = { { TEXT_SAVE_AND_QUIT }, { TEXT_SAVE_AND_QUIT_FR }, { TEXT_SAVE_AND_QUIT_DE } }; + u8 textContinueWithoutSave[][27] = { { TEXT_CONTINUE_WITHOUT_SAVING }, + { TEXT_CONTINUE_WITHOUT_SAVING_FR }, + { TEXT_CONTINUE_WITHOUT_SAVING_DE } }; s16 xOffset = get_str_x_pos_from_center(160, GameEngine_LoadTranslation(textContinueWithoutSave), 12.0f); #endif @@ -2616,7 +2577,8 @@ void render_save_confirmation(s16 x, s16 y, s8 *index, s16 sp6e) print_generic_string(TXT_SAVEOPTIONS_X, y + TXT_SAVECONT_Y, GameEngine_LoadTranslation("TEXT_SAVE_AND_CONTINUE")); print_generic_string(TXT_SAVEOPTIONS_X, y - TXT_SAVEQUIT_Y, GameEngine_LoadTranslation("TEXT_SAVE_AND_QUIT")); - print_generic_string(TXT_SAVEOPTIONS_X, y - TXT_CONTNOSAVE_Y, GameEngine_LoadTranslation("TEXT_CONTINUE_WITHOUT_SAVING")); + print_generic_string(TXT_SAVEOPTIONS_X, y - TXT_CONTNOSAVE_Y, + GameEngine_LoadTranslation("TEXT_CONTINUE_WITHOUT_SAVING")); gSPDisplayList(gDisplayListHead++, dl_ia_text_end); @@ -2654,13 +2616,12 @@ s16 render_course_complete_screen(void) { render_save_confirmation(100, 86, &gDialogLineNum, 20); #endif - if (gCourseDoneMenuTimer > 110 - && (gPlayer3Controller->buttonPressed & A_BUTTON - || gPlayer3Controller->buttonPressed & START_BUTTON + if (gCourseDoneMenuTimer > 110 && + (gPlayer3Controller->buttonPressed & A_BUTTON || gPlayer3Controller->buttonPressed & START_BUTTON #ifdef VERSION_EU - || gPlayer3Controller->buttonPressed & Z_TRIG + || gPlayer3Controller->buttonPressed & Z_TRIG #endif - )) { + )) { level_set_transition(0, NULL); play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource); gDialogBoxState = DIALOG_STATE_OPENING; @@ -2707,7 +2668,7 @@ s16 render_menus_and_dialogs(void) { break; } - gDialogColorFadeTimer = (s16) gDialogColorFadeTimer + 0x1000; + gDialogColorFadeTimer = (s16)gDialogColorFadeTimer + 0x1000; } else if (gDialogID != DIALOG_NONE) { // The Peach "Dear Mario" message needs to be repositioned separately if (gDialogID == DIALOG_020) { @@ -2716,7 +2677,7 @@ s16 render_menus_and_dialogs(void) { } render_dialog_entries(); - gDialogColorFadeTimer = (s16) gDialogColorFadeTimer + 0x1000; + gDialogColorFadeTimer = (s16)gDialogColorFadeTimer + 0x1000; } FrameInterpolation_RecordCloseChild(); return index; diff --git a/src/game/interaction.c b/src/game/interaction.c index 51cfff04..ec01d88b 100644 --- a/src/game/interaction.c +++ b/src/game/interaction.c @@ -25,106 +25,106 @@ #include "rumble_init.h" #define INT_GROUND_POUND_OR_TWIRL (1 << 0) // 0x01 -#define INT_PUNCH (1 << 1) // 0x02 -#define INT_KICK (1 << 2) // 0x04 -#define INT_TRIP (1 << 3) // 0x08 -#define INT_SLIDE_KICK (1 << 4) // 0x10 -#define INT_FAST_ATTACK_OR_SHELL (1 << 5) // 0x20 -#define INT_HIT_FROM_ABOVE (1 << 6) // 0x40 -#define INT_HIT_FROM_BELOW (1 << 7) // 0x80 +#define INT_PUNCH (1 << 1) // 0x02 +#define INT_KICK (1 << 2) // 0x04 +#define INT_TRIP (1 << 3) // 0x08 +#define INT_SLIDE_KICK (1 << 4) // 0x10 +#define INT_FAST_ATTACK_OR_SHELL (1 << 5) // 0x20 +#define INT_HIT_FROM_ABOVE (1 << 6) // 0x40 +#define INT_HIT_FROM_BELOW (1 << 7) // 0x80 -#define INT_ATTACK_NOT_FROM_BELOW \ - (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK \ - | INT_FAST_ATTACK_OR_SHELL | INT_HIT_FROM_ABOVE) +#define INT_ATTACK_NOT_FROM_BELOW \ + (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK | INT_FAST_ATTACK_OR_SHELL | \ + INT_HIT_FROM_ABOVE) -#define INT_ANY_ATTACK \ - (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK \ - | INT_FAST_ATTACK_OR_SHELL | INT_HIT_FROM_ABOVE | INT_HIT_FROM_BELOW) +#define INT_ANY_ATTACK \ + (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_SLIDE_KICK | INT_FAST_ATTACK_OR_SHELL | \ + INT_HIT_FROM_ABOVE | INT_HIT_FROM_BELOW) -#define INT_ATTACK_NOT_WEAK_FROM_ABOVE \ +#define INT_ATTACK_NOT_WEAK_FROM_ABOVE \ (INT_GROUND_POUND_OR_TWIRL | INT_PUNCH | INT_KICK | INT_TRIP | INT_HIT_FROM_BELOW) u8 sDelayInvincTimer; s16 sInvulnerable; -u32 interact_coin(struct MarioState *, u32, struct Object *); -u32 interact_water_ring(struct MarioState *, u32, struct Object *); -u32 interact_star_or_key(struct MarioState *, u32, struct Object *); -u32 interact_bbh_entrance(struct MarioState *, u32, struct Object *); -u32 interact_warp(struct MarioState *, u32, struct Object *); -u32 interact_warp_door(struct MarioState *, u32, struct Object *); -u32 interact_door(struct MarioState *, u32, struct Object *); -u32 interact_cannon_base(struct MarioState *, u32, struct Object *); -u32 interact_igloo_barrier(struct MarioState *, u32, struct Object *); -u32 interact_tornado(struct MarioState *, u32, struct Object *); -u32 interact_whirlpool(struct MarioState *, u32, struct Object *); -u32 interact_strong_wind(struct MarioState *, u32, struct Object *); -u32 interact_flame(struct MarioState *, u32, struct Object *); -u32 interact_snufit_bullet(struct MarioState *, u32, struct Object *); -u32 interact_clam_or_bubba(struct MarioState *, u32, struct Object *); -u32 interact_bully(struct MarioState *, u32, struct Object *); -u32 interact_shock(struct MarioState *, u32, struct Object *); -u32 interact_mr_blizzard(struct MarioState *, u32, struct Object *); -u32 interact_hit_from_below(struct MarioState *, u32, struct Object *); -u32 interact_bounce_top(struct MarioState *, u32, struct Object *); -u32 interact_unknown_08(struct MarioState *, u32, struct Object *); -u32 interact_damage(struct MarioState *, u32, struct Object *); -u32 interact_breakable(struct MarioState *, u32, struct Object *); -u32 interact_koopa_shell(struct MarioState *, u32, struct Object *); -u32 interact_pole(struct MarioState *, u32, struct Object *); -u32 interact_hoot(struct MarioState *, u32, struct Object *); -u32 interact_cap(struct MarioState *, u32, struct Object *); -u32 interact_grabbable(struct MarioState *, u32, struct Object *); -u32 interact_text(struct MarioState *, u32, struct Object *); +u32 interact_coin(struct MarioState*, u32, struct Object*); +u32 interact_water_ring(struct MarioState*, u32, struct Object*); +u32 interact_star_or_key(struct MarioState*, u32, struct Object*); +u32 interact_bbh_entrance(struct MarioState*, u32, struct Object*); +u32 interact_warp(struct MarioState*, u32, struct Object*); +u32 interact_warp_door(struct MarioState*, u32, struct Object*); +u32 interact_door(struct MarioState*, u32, struct Object*); +u32 interact_cannon_base(struct MarioState*, u32, struct Object*); +u32 interact_igloo_barrier(struct MarioState*, u32, struct Object*); +u32 interact_tornado(struct MarioState*, u32, struct Object*); +u32 interact_whirlpool(struct MarioState*, u32, struct Object*); +u32 interact_strong_wind(struct MarioState*, u32, struct Object*); +u32 interact_flame(struct MarioState*, u32, struct Object*); +u32 interact_snufit_bullet(struct MarioState*, u32, struct Object*); +u32 interact_clam_or_bubba(struct MarioState*, u32, struct Object*); +u32 interact_bully(struct MarioState*, u32, struct Object*); +u32 interact_shock(struct MarioState*, u32, struct Object*); +u32 interact_mr_blizzard(struct MarioState*, u32, struct Object*); +u32 interact_hit_from_below(struct MarioState*, u32, struct Object*); +u32 interact_bounce_top(struct MarioState*, u32, struct Object*); +u32 interact_unknown_08(struct MarioState*, u32, struct Object*); +u32 interact_damage(struct MarioState*, u32, struct Object*); +u32 interact_breakable(struct MarioState*, u32, struct Object*); +u32 interact_koopa_shell(struct MarioState*, u32, struct Object*); +u32 interact_pole(struct MarioState*, u32, struct Object*); +u32 interact_hoot(struct MarioState*, u32, struct Object*); +u32 interact_cap(struct MarioState*, u32, struct Object*); +u32 interact_grabbable(struct MarioState*, u32, struct Object*); +u32 interact_text(struct MarioState*, u32, struct Object*); struct InteractionHandler { u32 interactType; - u32 (*handler)(struct MarioState *, u32, struct Object *); + u32 (*handler)(struct MarioState*, u32, struct Object*); }; static struct InteractionHandler sInteractionHandlers[] = { - { INTERACT_COIN, interact_coin }, - { INTERACT_WATER_RING, interact_water_ring }, - { INTERACT_STAR_OR_KEY, interact_star_or_key }, - { INTERACT_BBH_ENTRANCE, interact_bbh_entrance }, - { INTERACT_WARP, interact_warp }, - { INTERACT_WARP_DOOR, interact_warp_door }, - { INTERACT_DOOR, interact_door }, - { INTERACT_CANNON_BASE, interact_cannon_base }, - { INTERACT_IGLOO_BARRIER, interact_igloo_barrier }, - { INTERACT_TORNADO, interact_tornado }, - { INTERACT_WHIRLPOOL, interact_whirlpool }, - { INTERACT_STRONG_WIND, interact_strong_wind }, - { INTERACT_FLAME, interact_flame }, - { INTERACT_SNUFIT_BULLET, interact_snufit_bullet }, - { INTERACT_CLAM_OR_BUBBA, interact_clam_or_bubba }, - { INTERACT_BULLY, interact_bully }, - { INTERACT_SHOCK, interact_shock }, - { INTERACT_BOUNCE_TOP2, interact_bounce_top }, - { INTERACT_MR_BLIZZARD, interact_mr_blizzard }, + { INTERACT_COIN, interact_coin }, + { INTERACT_WATER_RING, interact_water_ring }, + { INTERACT_STAR_OR_KEY, interact_star_or_key }, + { INTERACT_BBH_ENTRANCE, interact_bbh_entrance }, + { INTERACT_WARP, interact_warp }, + { INTERACT_WARP_DOOR, interact_warp_door }, + { INTERACT_DOOR, interact_door }, + { INTERACT_CANNON_BASE, interact_cannon_base }, + { INTERACT_IGLOO_BARRIER, interact_igloo_barrier }, + { INTERACT_TORNADO, interact_tornado }, + { INTERACT_WHIRLPOOL, interact_whirlpool }, + { INTERACT_STRONG_WIND, interact_strong_wind }, + { INTERACT_FLAME, interact_flame }, + { INTERACT_SNUFIT_BULLET, interact_snufit_bullet }, + { INTERACT_CLAM_OR_BUBBA, interact_clam_or_bubba }, + { INTERACT_BULLY, interact_bully }, + { INTERACT_SHOCK, interact_shock }, + { INTERACT_BOUNCE_TOP2, interact_bounce_top }, + { INTERACT_MR_BLIZZARD, interact_mr_blizzard }, { INTERACT_HIT_FROM_BELOW, interact_hit_from_below }, - { INTERACT_BOUNCE_TOP, interact_bounce_top }, - { INTERACT_DAMAGE, interact_damage }, - { INTERACT_POLE, interact_pole }, - { INTERACT_HOOT, interact_hoot }, - { INTERACT_BREAKABLE, interact_breakable }, - { INTERACT_KOOPA, interact_bounce_top }, - { INTERACT_KOOPA_SHELL, interact_koopa_shell }, - { INTERACT_UNKNOWN_08, interact_unknown_08 }, - { INTERACT_CAP, interact_cap }, - { INTERACT_GRABBABLE, interact_grabbable }, - { INTERACT_TEXT, interact_text }, + { INTERACT_BOUNCE_TOP, interact_bounce_top }, + { INTERACT_DAMAGE, interact_damage }, + { INTERACT_POLE, interact_pole }, + { INTERACT_HOOT, interact_hoot }, + { INTERACT_BREAKABLE, interact_breakable }, + { INTERACT_KOOPA, interact_bounce_top }, + { INTERACT_KOOPA_SHELL, interact_koopa_shell }, + { INTERACT_UNKNOWN_08, interact_unknown_08 }, + { INTERACT_CAP, interact_cap }, + { INTERACT_GRABBABLE, interact_grabbable }, + { INTERACT_TEXT, interact_text }, }; static u32 sForwardKnockbackActions[][3] = { { ACT_SOFT_FORWARD_GROUND_KB, ACT_FORWARD_GROUND_KB, ACT_HARD_FORWARD_GROUND_KB }, - { ACT_FORWARD_AIR_KB, ACT_FORWARD_AIR_KB, ACT_HARD_FORWARD_AIR_KB }, - { ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB }, + { ACT_FORWARD_AIR_KB, ACT_FORWARD_AIR_KB, ACT_HARD_FORWARD_AIR_KB }, + { ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB, ACT_FORWARD_WATER_KB }, }; static u32 sBackwardKnockbackActions[][3] = { { ACT_SOFT_BACKWARD_GROUND_KB, ACT_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB }, - { ACT_BACKWARD_AIR_KB, ACT_BACKWARD_AIR_KB, ACT_HARD_BACKWARD_AIR_KB }, - { ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB }, + { ACT_BACKWARD_AIR_KB, ACT_BACKWARD_AIR_KB, ACT_HARD_BACKWARD_AIR_KB }, + { ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB, ACT_BACKWARD_WATER_KB }, }; static u8 sDisplayingDoorText = FALSE; @@ -134,8 +134,8 @@ static u8 sPssSlideStarted = FALSE; /** * Returns the type of cap Mario is wearing. */ -u32 get_mario_cap_flag(struct Object *capObject) { - const BehaviorScript *script = virtual_to_segmented(0x13, capObject->behavior); +u32 get_mario_cap_flag(struct Object* capObject) { + const BehaviorScript* script = virtual_to_segmented(0x13, capObject->behavior); if (script == bhvNormalCap) { return MARIO_NORMAL_CAP; @@ -154,7 +154,7 @@ u32 get_mario_cap_flag(struct Object *capObject) { * Returns true if the passed in object has a moving angle yaw * in the angular range given towards Mario. */ -u32 object_facing_mario(struct MarioState *m, struct Object *o, s16 angleRange) { +u32 object_facing_mario(struct MarioState* m, struct Object* o, s16 angleRange) { f32 dx = m->pos[0] - o->oPosX; f32 dz = m->pos[2] - o->oPosZ; @@ -168,7 +168,7 @@ u32 object_facing_mario(struct MarioState *m, struct Object *o, s16 angleRange) return FALSE; } -s16 mario_obj_angle_to_object(struct MarioState *m, struct Object *o) { +s16 mario_obj_angle_to_object(struct MarioState* m, struct Object* o) { f32 dx = o->oPosX - m->pos[0]; f32 dz = o->oPosZ - m->pos[2]; @@ -179,7 +179,7 @@ s16 mario_obj_angle_to_object(struct MarioState *m, struct Object *o) { * Determines Mario's interaction with a given object depending on their proximity, * action, speed, and position. */ -u32 determine_interaction(struct MarioState *m, struct Object *o) { +u32 determine_interaction(struct MarioState* m, struct Object* o) { u32 interaction = 0; u32 action = m->action; @@ -247,7 +247,7 @@ u32 determine_interaction(struct MarioState *m, struct Object *o) { /** * Sets the interaction types for INT_STATUS_INTERACTED, INT_STATUS_WAS_ATTACKED */ -u32 attack_object(struct Object *o, s32 interaction) { +u32 attack_object(struct Object* o, s32 interaction) { u32 attackType = 0; switch (interaction) { @@ -277,7 +277,7 @@ u32 attack_object(struct Object *o, s32 interaction) { return attackType; } -void mario_stop_riding_object(struct MarioState *m) { +void mario_stop_riding_object(struct MarioState* m) { if (m->riddenObj != NULL) { m->riddenObj->oInteractStatus = INT_STATUS_STOP_RIDING; stop_shell_music(); @@ -285,14 +285,14 @@ void mario_stop_riding_object(struct MarioState *m) { } } -void mario_grab_used_object(struct MarioState *m) { +void mario_grab_used_object(struct MarioState* m) { if (m->heldObj == NULL) { m->heldObj = m->usedObj; obj_set_held_state(m->heldObj, bhvCarrySomething3); } } -void mario_drop_held_object(struct MarioState *m) { +void mario_drop_held_object(struct MarioState* m) { if (m->heldObj != NULL) { if (m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { stop_shell_music(); @@ -313,7 +313,7 @@ void mario_drop_held_object(struct MarioState *m) { } } -void mario_throw_held_object(struct MarioState *m) { +void mario_throw_held_object(struct MarioState* m) { if (m->heldObj != NULL) { if (m->heldObj->behavior == segmented_to_virtual(bhvKoopaShellUnderwater)) { stop_shell_music(); @@ -331,7 +331,7 @@ void mario_throw_held_object(struct MarioState *m) { } } -void mario_stop_riding_and_holding(struct MarioState *m) { +void mario_stop_riding_and_holding(struct MarioState* m) { mario_drop_held_object(m); mario_stop_riding_object(m); @@ -341,12 +341,12 @@ void mario_stop_riding_and_holding(struct MarioState *m) { } } -u32 does_mario_have_normal_cap_on_head(struct MarioState *m) { +u32 does_mario_have_normal_cap_on_head(struct MarioState* m) { return (m->flags & (MARIO_CAPS | MARIO_CAP_ON_HEAD)) == (MARIO_NORMAL_CAP | MARIO_CAP_ON_HEAD); } -void mario_blow_off_cap(struct MarioState *m, f32 capSpeed) { - struct Object *capObject; +void mario_blow_off_cap(struct MarioState* m, f32 capSpeed) { + struct Object* capObject; if (does_mario_have_normal_cap_on_head(m)) { save_file_set_cap_pos(m->pos[0], m->pos[1], m->pos[2]); @@ -384,7 +384,7 @@ void mario_retrieve_cap(void) { gMarioState->flags |= MARIO_NORMAL_CAP | MARIO_CAP_IN_HAND; } -u32 able_to_grab_object(struct MarioState *m, UNUSED struct Object *o) { +u32 able_to_grab_object(struct MarioState* m, UNUSED struct Object* o) { u32 action = m->action; if (action == ACT_DIVE_SLIDE || action == ACT_DIVE) { @@ -400,9 +400,9 @@ u32 able_to_grab_object(struct MarioState *m, UNUSED struct Object *o) { return FALSE; } -struct Object *mario_get_collided_object(struct MarioState *m, u32 interactType) { +struct Object* mario_get_collided_object(struct MarioState* m, u32 interactType) { s32 i; - struct Object *object; + struct Object* object; for (i = 0; i < m->marioObj->numCollidedObjs; i++) { object = m->marioObj->collidedObjs[i]; @@ -415,9 +415,9 @@ struct Object *mario_get_collided_object(struct MarioState *m, u32 interactType) return NULL; } -u32 mario_check_object_grab(struct MarioState *m) { +u32 mario_check_object_grab(struct MarioState* m) { u32 result = FALSE; - const BehaviorScript *script; + const BehaviorScript* script; if (m->input & INPUT_INTERACT_OBJ_GRABBABLE) { script = virtual_to_segmented(0x13, m->interactObj->behavior); @@ -435,8 +435,7 @@ u32 mario_check_object_grab(struct MarioState *m) { m->usedObj = m->interactObj; if (!(m->action & ACT_FLAG_AIR)) { - set_mario_action( - m, (m->action & ACT_FLAG_DIVING) ? ACT_DIVE_PICKING_UP : ACT_PICKING_UP, 0); + set_mario_action(m, (m->action & ACT_FLAG_DIVING) ? ACT_DIVE_PICKING_UP : ACT_PICKING_UP, 0); } result = TRUE; @@ -447,7 +446,7 @@ u32 mario_check_object_grab(struct MarioState *m) { return result; } -u32 bully_knock_back_mario(struct MarioState *mario) { +u32 bully_knock_back_mario(struct MarioState* mario) { struct BullyCollisionData marioData; struct BullyCollisionData bullyData; s16 newMarioYaw; @@ -457,18 +456,18 @@ u32 bully_knock_back_mario(struct MarioState *mario) { u32 bonkAction = 0; - struct Object *bully = mario->interactObj; + struct Object* bully = mario->interactObj; //! Conversion ratios multiply to more than 1 (could allow unbounded speed // with bonk cancel - but this isn't important for regular bully battery) f32 bullyToMarioRatio = bully->hitboxRadius * 3 / 53; f32 marioToBullyRatio = 53.0f / bully->hitboxRadius; - init_bully_collision_data(&marioData, mario->pos[0], mario->pos[2], mario->forwardVel, - mario->faceAngle[1], bullyToMarioRatio, 52.0f); + init_bully_collision_data(&marioData, mario->pos[0], mario->pos[2], mario->forwardVel, mario->faceAngle[1], + bullyToMarioRatio, 52.0f); - init_bully_collision_data(&bullyData, bully->oPosX, bully->oPosZ, bully->oForwardVel, - bully->oMoveAngleYaw, marioToBullyRatio, bully->hitboxRadius + 2.0f); + init_bully_collision_data(&bullyData, bully->oPosX, bully->oPosZ, bully->oForwardVel, bully->oMoveAngleYaw, + marioToBullyRatio, bully->hitboxRadius + 2.0f); if (mario->forwardVel != 0.0f) { transfer_bully_speed(&marioData, &bullyData); @@ -512,7 +511,7 @@ u32 bully_knock_back_mario(struct MarioState *mario) { return bonkAction; } -void bounce_off_object(struct MarioState *m, struct Object *o, f32 velY) { +void bounce_off_object(struct MarioState* m, struct Object* o, f32 velY) { m->pos[1] = o->oPosY + o->hitboxHeight; m->vel[1] = velY; @@ -521,12 +520,12 @@ void bounce_off_object(struct MarioState *m, struct Object *o, f32 velY) { play_sound(SOUND_ACTION_BOUNCE_OFF_OBJECT, m->marioObj->header.gfx.cameraToObject); } -void hit_object_from_below(struct MarioState *m, UNUSED struct Object *o) { +void hit_object_from_below(struct MarioState* m, UNUSED struct Object* o) { m->vel[1] = 0.0f; set_camera_shake_from_hit(SHAKE_HIT_FROM_BELOW); } -UNUSED static u32 unused_determine_knockback_action(struct MarioState *m) { +UNUSED static u32 unused_determine_knockback_action(struct MarioState* m) { u32 bonkAction; s16 angleToObject = mario_obj_angle_to_object(m, m->interactObj); s16 facingDYaw = angleToObject - m->faceAngle[1]; @@ -556,7 +555,7 @@ UNUSED static u32 unused_determine_knockback_action(struct MarioState *m) { return bonkAction; } -u32 determine_knockback_action(struct MarioState *m, UNUSED s32 arg) { +u32 determine_knockback_action(struct MarioState* m, UNUSED s32 arg) { u32 bonkAction; s16 terrainIndex = 0; // 1 = air, 2 = water, 0 = default @@ -613,7 +612,7 @@ u32 determine_knockback_action(struct MarioState *m, UNUSED s32 arg) { return bonkAction; } -void push_mario_out_of_object(struct MarioState *m, struct Object *o, f32 padding) { +void push_mario_out_of_object(struct MarioState* m, struct Object* o, f32 padding) { f32 minDistance = o->hitboxRadius + m->marioObj->hitboxRadius + padding; f32 offsetX = m->pos[0] - o->oPosX; @@ -621,7 +620,7 @@ void push_mario_out_of_object(struct MarioState *m, struct Object *o, f32 paddin f32 distance = sqrtf(offsetX * offsetX + offsetZ * offsetZ); if (distance < minDistance) { - struct Surface *floor; + struct Surface* floor; s16 pushAngle; f32 newMarioX; f32 newMarioZ; @@ -647,7 +646,7 @@ void push_mario_out_of_object(struct MarioState *m, struct Object *o, f32 paddin } } -void bounce_back_from_attack(struct MarioState *m, u32 interaction) { +void bounce_back_from_attack(struct MarioState* m, u32 interaction) { if (interaction & (INT_PUNCH | INT_KICK | INT_TRIP)) { if (m->action == ACT_PUNCHING) { m->action = ACT_MOVE_PUNCHING; @@ -668,7 +667,7 @@ void bounce_back_from_attack(struct MarioState *m, u32 interaction) { } } -u32 should_push_or_pull_door(struct MarioState *m, struct Object *o) { +u32 should_push_or_pull_door(struct MarioState* m, struct Object* o) { f32 dx = o->oPosX - m->pos[0]; f32 dz = o->oPosZ - m->pos[2]; @@ -677,7 +676,7 @@ u32 should_push_or_pull_door(struct MarioState *m, struct Object *o) { return (dYaw >= -0x4000 && dYaw <= 0x4000) ? 0x00000001 : 0x00000002; } -u32 take_damage_from_interact_object(struct MarioState *m) { +u32 take_damage_from_interact_object(struct MarioState* m) { s32 shake; s32 damage = m->interactObj->oDamageOrCoinValue; @@ -707,11 +706,11 @@ u32 take_damage_from_interact_object(struct MarioState *m) { return damage; } -u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o) { +u32 take_damage_and_knock_back(struct MarioState* m, struct Object* o) { u32 damage; - if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP) - && !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { + if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP) && + !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { o->oInteractStatus = INT_STATUS_INTERACTED | INT_STATUS_ATTACKED_MARIO; m->interactObj = o; @@ -726,28 +725,26 @@ u32 take_damage_and_knock_back(struct MarioState *m, struct Object *o) { } update_mario_sound_and_camera(m); - return drop_and_set_mario_action(m, determine_knockback_action(m, o->oDamageOrCoinValue), - damage); + return drop_and_set_mario_action(m, determine_knockback_action(m, o->oDamageOrCoinValue), damage); } return FALSE; } -void reset_mario_pitch(struct MarioState *m) { +void reset_mario_pitch(struct MarioState* m) { if (m->action == ACT_WATER_JUMP || m->action == ACT_SHOT_FROM_CANNON || m->action == ACT_FLYING) { set_camera_mode(m->area->camera, m->area->camera->defMode, 1); m->faceAngle[0] = 0; } } -u32 interact_coin(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_coin(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { m->numCoins += o->oDamageOrCoinValue; m->healCounter += 4 * o->oDamageOrCoinValue; o->oInteractStatus = INT_STATUS_INTERACTED; - if (COURSE_IS_MAIN_COURSE(gCurrCourseNum) && m->numCoins - o->oDamageOrCoinValue < 100 - && m->numCoins >= 100) { + if (COURSE_IS_MAIN_COURSE(gCurrCourseNum) && m->numCoins - o->oDamageOrCoinValue < 100 && m->numCoins >= 100) { bhv_spawn_star_no_level_exit(6); } #if ENABLE_RUMBLE @@ -759,13 +756,13 @@ u32 interact_coin(struct MarioState *m, UNUSED u32 interactType, struct Object * return FALSE; } -u32 interact_water_ring(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_water_ring(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { m->healCounter += 4 * o->oDamageOrCoinValue; o->oInteractStatus = INT_STATUS_INTERACTED; return FALSE; } -u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_star_or_key(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 starIndex; u32 starGrabAction = ACT_STAR_DANCE_EXIT; u32 noExit = (o->oInteractionSubtype & INT_SUBTYPE_NO_EXIT) != 0 || CVarGetInteger("gStarNoExit", 0); @@ -810,8 +807,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O starIndex = (o->oBehParams >> 24) & 0x1F; save_file_collect_star_or_key(m->numCoins, starIndex); - m->numStars = - save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1); + m->numStars = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1); if (!noExit) { drop_queued_background_music(); @@ -819,7 +815,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O } play_sound(SOUND_MENU_STAR_SOUND, m->marioObj->header.gfx.cameraToObject); - if(!ROM_JP) { + if (!ROM_JP) { update_mario_sound_and_camera(m); } @@ -833,7 +829,7 @@ u32 interact_star_or_key(struct MarioState *m, UNUSED u32 interactType, struct O return FALSE; } -u32 interact_bbh_entrance(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_bbh_entrance(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (m->action != ACT_BBH_ENTER_SPIN && m->action != ACT_BBH_ENTER_JUMP) { mario_stop_riding_and_holding(m); @@ -851,7 +847,7 @@ u32 interact_bbh_entrance(struct MarioState *m, UNUSED u32 interactType, struct return FALSE; } -u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_warp(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 action; if (o->oInteractionSubtype & INT_SUBTYPE_FADING_WARP) { @@ -861,8 +857,8 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object * sJustTeleported = TRUE; } else if (!sJustTeleported) { - if (action == ACT_IDLE || action == ACT_PANTING || action == ACT_STANDING_AGAINST_WALL - || action == ACT_CROUCHING) { + if (action == ACT_IDLE || action == ACT_PANTING || action == ACT_STANDING_AGAINST_WALL || + action == ACT_CROUCHING) { m->interactObj = o; m->usedObj = o; @@ -899,7 +895,7 @@ u32 interact_warp(struct MarioState *m, UNUSED u32 interactType, struct Object * return FALSE; } -u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_warp_door(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 doorAction = 0; u32 saveFlags = save_file_get_flags(); s16 warpDoorId = o->oBehParams >> 24; @@ -955,7 +951,7 @@ u32 interact_warp_door(struct MarioState *m, UNUSED u32 interactType, struct Obj return FALSE; } -u32 get_door_save_file_flag(struct Object *door) { +u32 get_door_save_file_flag(struct Object* door) { u32 saveFileFlag = 0; s16 requiredNumStars = door->oBehParams >> 24; @@ -995,7 +991,7 @@ u32 get_door_save_file_flag(struct Object *door) { return saveFileFlag; } -u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_door(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { s16 requiredNumStars = o->oBehParams >> 24; s16 numStars = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1); @@ -1062,7 +1058,7 @@ u32 interact_door(struct MarioState *m, UNUSED u32 interactType, struct Object * return FALSE; } -u32 interact_cannon_base(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_cannon_base(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (m->action != ACT_IN_CANNON) { mario_stop_riding_and_holding(m); o->oInteractStatus = INT_STATUS_INTERACTED; @@ -1074,7 +1070,7 @@ u32 interact_cannon_base(struct MarioState *m, UNUSED u32 interactType, struct O return FALSE; } -u32 interact_igloo_barrier(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_igloo_barrier(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { //! Sets used object without changing action (LOTS of interesting glitches, // but unfortunately the igloo barrier is the only object with this interaction // type) @@ -1084,8 +1080,8 @@ u32 interact_igloo_barrier(struct MarioState *m, UNUSED u32 interactType, struct return FALSE; } -u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { - struct Object *marioObj = m->marioObj; +u32 interact_tornado(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { + struct Object* marioObj = m->marioObj; if (m->action != ACT_TORNADO_TWIRLING && m->action != ACT_SQUISHED) { mario_stop_riding_and_holding(m); @@ -1109,8 +1105,8 @@ u32 interact_tornado(struct MarioState *m, UNUSED u32 interactType, struct Objec return FALSE; } -u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { - struct Object *marioObj = m->marioObj; +u32 interact_whirlpool(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { + struct Object* marioObj = m->marioObj; if (m->action != ACT_CAUGHT_IN_WHIRLPOOL) { mario_stop_riding_and_holding(m); @@ -1132,8 +1128,8 @@ u32 interact_whirlpool(struct MarioState *m, UNUSED u32 interactType, struct Obj return FALSE; } -u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { - UNUSED struct Object *marioObj = m->marioObj; +u32 interact_strong_wind(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { + UNUSED struct Object* marioObj = m->marioObj; if (m->action != ACT_GETTING_BLOWN) { mario_stop_riding_and_holding(m); @@ -1154,19 +1150,18 @@ u32 interact_strong_wind(struct MarioState *m, UNUSED u32 interactType, struct O return FALSE; } -u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_flame(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 burningAction = ACT_BURNING_JUMP; - if (!sInvulnerable && !(m->flags & MARIO_METAL_CAP) && !(m->flags & MARIO_VANISH_CAP) - && !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { + if (!sInvulnerable && !(m->flags & MARIO_METAL_CAP) && !(m->flags & MARIO_VANISH_CAP) && + !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif o->oInteractStatus = INT_STATUS_INTERACTED; m->interactObj = o; - if ((m->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) - || m->waterLevel - m->pos[1] > 50.0f) { + if ((m->action & (ACT_FLAG_SWIMMING | ACT_FLAG_METAL_WATER)) || m->waterLevel - m->pos[1] > 50.0f) { play_sound(SOUND_GENERAL_FLAME_OUT, m->marioObj->header.gfx.cameraToObject); } else { m->marioObj->oMarioBurnTimer = 0; @@ -1184,7 +1179,7 @@ u32 interact_flame(struct MarioState *m, UNUSED u32 interactType, struct Object return FALSE; } -u32 interact_snufit_bullet(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_snufit_bullet(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP)) { if (m->flags & MARIO_METAL_CAP) { o->oInteractStatus = INT_STATUS_INTERACTED | INT_STATUS_WAS_ATTACKED; @@ -1209,7 +1204,7 @@ u32 interact_snufit_bullet(struct MarioState *m, UNUSED u32 interactType, struct return FALSE; } -u32 interact_clam_or_bubba(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_clam_or_bubba(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (o->oInteractionSubtype & INT_SUBTYPE_EATS_MARIO) { o->oInteractStatus = INT_STATUS_INTERACTED; m->interactObj = o; @@ -1225,7 +1220,7 @@ u32 interact_clam_or_bubba(struct MarioState *m, UNUSED u32 interactType, struct return TRUE; } -u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_bully(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { UNUSED u8 filler[4]; u32 interaction; @@ -1252,8 +1247,8 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object return TRUE; } - else if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP) - && !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { + else if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP) && + !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { o->oInteractStatus = INT_STATUS_INTERACTED; m->invincTimer = 2; @@ -1272,9 +1267,9 @@ u32 interact_bully(struct MarioState *m, UNUSED u32 interactType, struct Object return FALSE; } -u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { - if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP) - && !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { +u32 interact_shock(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { + if (!sInvulnerable && !(m->flags & MARIO_VANISH_CAP) && + !(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { u32 actionArg = (m->action & (ACT_FLAG_AIR | ACT_FLAG_ON_POLE | ACT_FLAG_HANGING)) == 0; o->oInteractStatus = INT_STATUS_INTERACTED | INT_STATUS_ATTACKED_MARIO; @@ -1301,14 +1296,14 @@ u32 interact_shock(struct MarioState *m, UNUSED u32 interactType, struct Object return FALSE; } -UNUSED static u32 interact_stub(UNUSED struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +UNUSED static u32 interact_stub(UNUSED struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (!(o->oInteractionSubtype & INT_SUBTYPE_DELAY_INVINCIBILITY)) { sDelayInvincTimer = TRUE; } return FALSE; } -u32 interact_mr_blizzard(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_mr_blizzard(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (take_damage_and_knock_back(m, o)) { return TRUE; } @@ -1320,7 +1315,7 @@ u32 interact_mr_blizzard(struct MarioState *m, UNUSED u32 interactType, struct O return FALSE; } -u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_hit_from_below(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { UNUSED u8 filler[4]; u32 interaction; @@ -1345,7 +1340,7 @@ u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struc if (o->oInteractionSubtype & INT_SUBTYPE_TWIRL_BOUNCE) { bounce_off_object(m, o, 80.0f); reset_mario_pitch(m); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject); } return drop_and_set_mario_action(m, ACT_TWIRLING, 0); @@ -1364,7 +1359,7 @@ u32 interact_hit_from_below(struct MarioState *m, UNUSED u32 interactType, struc return FALSE; } -u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_bounce_top(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 interaction; if (m->flags & MARIO_METAL_CAP) { interaction = INT_FAST_ATTACK_OR_SHELL; @@ -1383,7 +1378,7 @@ u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Ob if (o->oInteractionSubtype & INT_SUBTYPE_TWIRL_BOUNCE) { bounce_off_object(m, o, 80.0f); reset_mario_pitch(m); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_MARIO_TWIRL_BOUNCE, m->marioObj->header.gfx.cameraToObject); } return drop_and_set_mario_action(m, ACT_TWIRLING, 0); @@ -1402,7 +1397,7 @@ u32 interact_bounce_top(struct MarioState *m, UNUSED u32 interactType, struct Ob return FALSE; } -u32 interact_unknown_08(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_unknown_08(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 interaction = determine_interaction(m, o); if (interaction & INT_PUNCH) { @@ -1419,7 +1414,7 @@ u32 interact_unknown_08(struct MarioState *m, UNUSED u32 interactType, struct Ob return FALSE; } -u32 interact_damage(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_damage(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (take_damage_and_knock_back(m, o)) { return TRUE; } @@ -1431,7 +1426,7 @@ u32 interact_damage(struct MarioState *m, UNUSED u32 interactType, struct Object return FALSE; } -u32 interact_breakable(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_breakable(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 interaction = determine_interaction(m, o); if (interaction & INT_ATTACK_NOT_WEAK_FROM_ABOVE) { @@ -1456,12 +1451,11 @@ u32 interact_breakable(struct MarioState *m, UNUSED u32 interactType, struct Obj return FALSE; } -u32 interact_koopa_shell(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_koopa_shell(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { if (!(m->action & ACT_FLAG_RIDING_SHELL)) { u32 interaction = determine_interaction(m, o); - if (interaction == INT_HIT_FROM_ABOVE || m->action == ACT_WALKING - || m->action == ACT_HOLD_WALKING) { + if (interaction == INT_HIT_FROM_ABOVE || m->action == ACT_WALKING || m->action == ACT_HOLD_WALKING) { m->interactObj = o; m->usedObj = o; m->riddenObj = o; @@ -1482,9 +1476,9 @@ u32 interact_koopa_shell(struct MarioState *m, UNUSED u32 interactType, struct O return FALSE; } -u32 check_object_grab_mario(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { - if ((!(m->action & (ACT_FLAG_AIR | ACT_FLAG_INVULNERABLE | ACT_FLAG_ATTACKING)) || !sInvulnerable) - && (o->oInteractionSubtype & INT_SUBTYPE_GRABS_MARIO)) { +u32 check_object_grab_mario(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { + if ((!(m->action & (ACT_FLAG_AIR | ACT_FLAG_INVULNERABLE | ACT_FLAG_ATTACKING)) || !sInvulnerable) && + (o->oInteractionSubtype & INT_SUBTYPE_GRABS_MARIO)) { if (object_facing_mario(m, o, 0x2AAA)) { mario_stop_riding_and_holding(m); o->oInteractStatus = INT_STATUS_INTERACTED | INT_STATUS_GRABBED_MARIO; @@ -1506,17 +1500,17 @@ u32 check_object_grab_mario(struct MarioState *m, UNUSED u32 interactType, struc return FALSE; } -u32 interact_pole(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_pole(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { s32 actionId = m->action & ACT_ID_MASK; if (actionId >= 0x080 && actionId < 0x0A0) { if (!(m->prevAction & ACT_FLAG_ON_POLE) || m->usedObj != o) { #ifdef VERSION_SH f32 velConv = m->forwardVel; // conserve the velocity. - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; u32 lowSpeed; #else u32 lowSpeed = (m->forwardVel <= 10.0f); - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; #endif mario_stop_riding_and_holding(m); @@ -1556,13 +1550,12 @@ u32 interact_pole(struct MarioState *m, UNUSED u32 interactType, struct Object * return FALSE; } -u32 interact_hoot(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_hoot(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { s32 actionId = m->action & ACT_ID_MASK; //! Can pause to advance the global timer without falling too far, allowing // you to regrab after letting go. - if (actionId >= 0x080 && actionId < 0x098 - && (gGlobalTimer - m->usedObj->oHootMarioReleaseTime > 30)) { + if (actionId >= 0x080 && actionId < 0x098 && (gGlobalTimer - m->usedObj->oHootMarioReleaseTime > 30)) { mario_stop_riding_and_holding(m); o->oInteractStatus = TRUE; //! Note: Not a flag, treated as a TRUE/FALSE statement @@ -1579,7 +1572,7 @@ u32 interact_hoot(struct MarioState *m, UNUSED u32 interactType, struct Object * return FALSE; } -u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_cap(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 capFlag = get_mario_cap_flag(o); u16 capMusic = 0; u16 capTime = 0; @@ -1632,8 +1625,8 @@ u32 interact_cap(struct MarioState *m, UNUSED u32 interactType, struct Object *o return FALSE; } -u32 interact_grabbable(struct MarioState *m, u32 interactType, struct Object *o) { - const BehaviorScript *script = virtual_to_segmented(0x13, o->behavior); +u32 interact_grabbable(struct MarioState* m, u32 interactType, struct Object* o) { + const BehaviorScript* script = virtual_to_segmented(0x13, o->behavior); if (o->oInteractionSubtype & INT_SUBTYPE_KICKABLE) { u32 interaction = determine_interaction(m, o); @@ -1665,7 +1658,7 @@ u32 interact_grabbable(struct MarioState *m, u32 interactType, struct Object *o) return FALSE; } -u32 mario_can_talk(struct MarioState *m, u32 arg) { +u32 mario_can_talk(struct MarioState* m, u32 arg) { s16 val6; if ((m->action & ACT_FLAG_IDLE) != 0x00000000) { @@ -1690,7 +1683,7 @@ u32 mario_can_talk(struct MarioState *m, u32 arg) { #define READ_MASK (INPUT_B_PRESSED | INPUT_A_PRESSED) #define SIGN_RANGE 0x4000 -u32 check_read_sign(struct MarioState *m, struct Object *o) { +u32 check_read_sign(struct MarioState* m, struct Object* o) { if ((m->input & READ_MASK) && mario_can_talk(m, 0) && object_facing_mario(m, o, SIGN_RANGE)) { s16 facingDYaw = (s16)(o->oMoveAngleYaw + 0x8000) - m->faceAngle[1]; if (facingDYaw >= -SIGN_RANGE && facingDYaw <= SIGN_RANGE) { @@ -1710,7 +1703,7 @@ u32 check_read_sign(struct MarioState *m, struct Object *o) { return FALSE; } -u32 check_npc_talk(struct MarioState *m, struct Object *o) { +u32 check_npc_talk(struct MarioState* m, struct Object* o) { if ((m->input & READ_MASK) && mario_can_talk(m, 1)) { s16 facingDYaw = mario_obj_angle_to_object(m, o) - m->faceAngle[1]; if (facingDYaw >= -0x4000 && facingDYaw <= 0x4000) { @@ -1728,7 +1721,7 @@ u32 check_npc_talk(struct MarioState *m, struct Object *o) { return FALSE; } -u32 interact_text(struct MarioState *m, UNUSED u32 interactType, struct Object *o) { +u32 interact_text(struct MarioState* m, UNUSED u32 interactType, struct Object* o) { u32 interact = FALSE; if (o->oInteractionSubtype & INT_SUBTYPE_SIGN) { @@ -1742,7 +1735,7 @@ u32 interact_text(struct MarioState *m, UNUSED u32 interactType, struct Object * return interact; } -void check_kick_or_punch_wall(struct MarioState *m) { +void check_kick_or_punch_wall(struct MarioState* m) { if (m->flags & (MARIO_PUNCHING | MARIO_KICKING | MARIO_TRIPPING)) { Vec3f detector; detector[0] = m->pos[0] + 50.0f * sins(m->faceAngle[1]); @@ -1767,7 +1760,7 @@ void check_kick_or_punch_wall(struct MarioState *m) { } } -void mario_process_interactions(struct MarioState *m) { +void mario_process_interactions(struct MarioState* m) { sDelayInvincTimer = FALSE; sInvulnerable = (m->action & ACT_FLAG_INVULNERABLE) || m->invincTimer != 0; @@ -1776,7 +1769,7 @@ void mario_process_interactions(struct MarioState *m) { for (i = 0; i < ARRAY_COUNT(sInteractionHandlers); i++) { u32 interactType = sInteractionHandlers[i].interactType; if (m->collidedObjInteractTypes & interactType) { - struct Object *object = mario_get_collided_object(m, interactType); + struct Object* object = mario_get_collided_object(m, interactType); m->collidedObjInteractTypes &= ~interactType; @@ -1806,7 +1799,7 @@ void mario_process_interactions(struct MarioState *m) { } } -void check_death_barrier(struct MarioState *m) { +void check_death_barrier(struct MarioState* m) { if (m->pos[1] < m->floorHeight + 2048.0f) { if (level_trigger_warp(m, WARP_OP_WARP_FLOOR) == 20 && !(m->flags & MARIO_UNKNOWN_18)) { play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject); @@ -1814,7 +1807,7 @@ void check_death_barrier(struct MarioState *m) { } } -void check_lava_boost(struct MarioState *m) { +void check_lava_boost(struct MarioState* m) { if (!(m->action & ACT_FLAG_RIDING_SHELL) && m->pos[1] < m->floorHeight + 10.0f) { if (!(m->flags & MARIO_METAL_CAP)) { m->hurtCounter += (m->flags & MARIO_CAP_ON_HEAD) ? 12 : 18; @@ -1825,7 +1818,7 @@ void check_lava_boost(struct MarioState *m) { } } -void pss_begin_slide(UNUSED struct MarioState *m) { +void pss_begin_slide(UNUSED struct MarioState* m) { if (!(gHudDisplay.flags & HUD_DISPLAY_FLAG_TIMER)) { level_control_timer(TIMER_CONTROL_SHOW); level_control_timer(TIMER_CONTROL_START); @@ -1833,7 +1826,7 @@ void pss_begin_slide(UNUSED struct MarioState *m) { } } -void pss_end_slide(struct MarioState *m) { +void pss_end_slide(struct MarioState* m) { //! This flag isn't set on death or level entry, allowing double star spawn if (sPssSlideStarted) { u16 slideTime = level_control_timer(TIMER_CONTROL_STOP); @@ -1845,7 +1838,7 @@ void pss_end_slide(struct MarioState *m) { } } -void mario_handle_special_floors(struct MarioState *m) { +void mario_handle_special_floors(struct MarioState* m) { if ((m->action & ACT_GROUP_MASK) == ACT_GROUP_CUTSCENE) { return; } diff --git a/src/game/level_geo.c b/src/game/level_geo.c index e3946700..521d2847 100644 --- a/src/game/level_geo.c +++ b/src/game/level_geo.c @@ -13,20 +13,20 @@ * Geo function that generates a displaylist for environment effects such as * snow or jet stream bubbles. */ -Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) { +Gfx* geo_envfx_main(s32 callContext, struct GraphNode* node, Mat4 mtxf) { Vec3s marioPos; Vec3s camFrom; Vec3s camTo; - void *particleList; - Gfx *gfx = NULL; + void* particleList; + Gfx* gfx = NULL; if (callContext == GEO_CONTEXT_RENDER && gCurGraphNodeCamera != NULL) { - struct GraphNodeGenerated *execNode = (struct GraphNodeGenerated *) node; - u32 *params = &execNode->parameter; // accessed a s32 as 2 u16s by pointing to the variable and + struct GraphNodeGenerated* execNode = (struct GraphNodeGenerated*)node; + u32* params = &execNode->parameter; // accessed a s32 as 2 u16s by pointing to the variable and // casting to a local struct as necessary. if (GET_HIGH_U16_OF_32(*params) != gAreaUpdateCounter) { - UNUSED struct Camera *sp2C = gCurGraphNodeCamera->config.camera; + UNUSED struct Camera* sp2C = gCurGraphNodeCamera->config.camera; s32 snowMode = GET_LOW_U16_OF_32(*params); vec3f_to_vec3s(camTo, gCurGraphNodeCamera->focus); @@ -35,7 +35,7 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) { particleList = envfx_update_particles(snowMode, marioPos, camTo, camFrom); if (particleList != NULL) { #if FALSE - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); gfx = alloc_display_list(2 * sizeof(*gfx)); mtxf_to_mtx(mtx, mtxf); @@ -63,20 +63,19 @@ Gfx *geo_envfx_main(s32 callContext, struct GraphNode *node, Mat4 mtxf) { * Geo function that generates a displaylist for the skybox. Can be assigned * as the function of a GraphNodeBackground. */ -Gfx *geo_skybox_main(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) { - Gfx *gfx = NULL; - struct GraphNodeBackground *backgroundNode = (struct GraphNodeBackground *) node; +Gfx* geo_skybox_main(s32 callContext, struct GraphNode* node, UNUSED Mat4* mtx) { + Gfx* gfx = NULL; + struct GraphNodeBackground* backgroundNode = (struct GraphNodeBackground*)node; if (callContext == GEO_CONTEXT_AREA_LOAD) { backgroundNode->unused = 0; } else if (callContext == GEO_CONTEXT_RENDER) { - struct GraphNodeCamera *camNode = (struct GraphNodeCamera *) gCurGraphNodeRoot->views[0]; - struct GraphNodePerspective *camFrustum = - (struct GraphNodePerspective *) camNode->fnNode.node.parent; + struct GraphNodeCamera* camNode = (struct GraphNodeCamera*)gCurGraphNodeRoot->views[0]; + struct GraphNodePerspective* camFrustum = (struct GraphNodePerspective*)camNode->fnNode.node.parent; gfx = create_skybox_facing_camera(0, backgroundNode->background, camFrustum->fov, gLakituState.pos[0], - gLakituState.pos[1], gLakituState.pos[2], gLakituState.focus[0], - gLakituState.focus[1], gLakituState.focus[2]); + gLakituState.pos[1], gLakituState.pos[2], gLakituState.focus[0], + gLakituState.focus[1], gLakituState.focus[2]); } return gfx; diff --git a/src/game/level_update.c b/src/game/level_update.c index 280646ee..008c8f7e 100644 --- a/src/game/level_update.c +++ b/src/game/level_update.c @@ -54,86 +54,88 @@ #define WARP_NODE_CREDITS_MIN 0xF8 // TODO: Make these ifdefs better -const char *credits01[] = { "1GAME DIRECTOR", "SHIGERU MIYAMOTO" }; -const char *credits02[] = { "2ASSISTANT DIRECTORS", "YOSHIAKI KOIZUMI", "TAKASHI TEZUKA" }; -const char *credits03[] = { "2SYSTEM PROGRAMMERS", "YASUNARI NISHIDA", "YOSHINORI TANIMOTO" }; -const char *credits04[] = { "3PROGRAMMERS", "HAJIME YAJIMA", "DAIKI IWAMOTO", "TOSHIO IWAWAKI" }; +const char* credits01[] = { "1GAME DIRECTOR", "SHIGERU MIYAMOTO" }; +const char* credits02[] = { "2ASSISTANT DIRECTORS", "YOSHIAKI KOIZUMI", "TAKASHI TEZUKA" }; +const char* credits03[] = { "2SYSTEM PROGRAMMERS", "YASUNARI NISHIDA", "YOSHINORI TANIMOTO" }; +const char* credits04[] = { "3PROGRAMMERS", "HAJIME YAJIMA", "DAIKI IWAMOTO", "TOSHIO IWAWAKI" }; #if defined(VERSION_JP) || defined(VERSION_SH) -const char *credits05[] = { "1CAMERA PROGRAMMER", "TAKUMI KAWAGOE" }; -const char *credits06[] = { "1MARIO FACE PROGRAMMER", "GILES GODDARD" }; -const char *credits07[] = { "2COURSE DIRECTORS", "YOICHI YAMADA", "YASUHISA YAMAMURA" }; -const char *credits08[] = { "2COURSE DESIGNERS", "KENTA USUI", "NAOKI MORI" }; -const char *credits09[] = { "3COURSE DESIGNERS", "YOSHIKI HARUHANA", "MAKOTO MIYANAGA", "KATSUHIKO KANNO" }; -const char *credits10[] = { "1SOUND COMPOSER", "KOJI KONDO" }; +const char* credits05[] = { "1CAMERA PROGRAMMER", "TAKUMI KAWAGOE" }; +const char* credits06[] = { "1MARIO FACE PROGRAMMER", "GILES GODDARD" }; +const char* credits07[] = { "2COURSE DIRECTORS", "YOICHI YAMADA", "YASUHISA YAMAMURA" }; +const char* credits08[] = { "2COURSE DESIGNERS", "KENTA USUI", "NAOKI MORI" }; +const char* credits09[] = { "3COURSE DESIGNERS", "YOSHIKI HARUHANA", "MAKOTO MIYANAGA", "KATSUHIKO KANNO" }; +const char* credits10[] = { "1SOUND COMPOSER", "KOJI KONDO" }; #ifdef VERSION_JP -const char *credits11[] = { "1SOUND EFFECTS", "YOJI INAGAKI" }; -const char *credits12[] = { "1SOUND PROGRAMMER", "HIDEAKI SHIMIZU" }; -const char *credits13[] = { "23D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" }; -const char *credits14[] = { "1CG DESIGNER", "MASANAO ARIMOTO" }; -const char *credits15[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; -const char *credits16[] = { "1TECHNICAL SUPPORT", "SGI. 64PROJECT STAFF" }; -const char *credits17[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; +const char* credits11[] = { "1SOUND EFFECTS", "YOJI INAGAKI" }; +const char* credits12[] = { "1SOUND PROGRAMMER", "HIDEAKI SHIMIZU" }; +const char* credits13[] = { "23D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" }; +const char* credits14[] = { "1CG DESIGNER", "MASANAO ARIMOTO" }; +const char* credits15[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; +const char* credits16[] = { "1TECHNICAL SUPPORT", "SGI. 64PROJECT STAFF" }; +const char* credits17[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; #else // VERSION_SH // Shindou combines sound effects and sound programmer in order to make room for Mario voice and Peach voice -const char *credits11[] = { "4SOUND EFFECTS", "SOUND PROGRAMMER", "YOJI INAGAKI", "HIDEAKI SHIMIZU" }; -const char *credits12[] = { "23D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" }; -const char *credits13[] = { "1CG DESIGNER", "MASANAO ARIMOTO" }; -const char *credits14[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; -const char *credits15[] = { "1TECHNICAL SUPPORT", "SGI. 64PROJECT STAFF" }; -const char *credits16[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; +const char* credits11[] = { "4SOUND EFFECTS", "SOUND PROGRAMMER", "YOJI INAGAKI", "HIDEAKI SHIMIZU" }; +const char* credits12[] = { "23D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" }; +const char* credits13[] = { "1CG DESIGNER", "MASANAO ARIMOTO" }; +const char* credits14[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; +const char* credits15[] = { "1TECHNICAL SUPPORT", "SGI. 64PROJECT STAFF" }; +const char* credits16[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; #endif #else // VERSION_US || VERSION_EU // US and EU combine camera programmer and Mario face programmer... -const char *credits05[] = { "4CAMERA PROGRAMMER", "MARIO FACE PROGRAMMER", "TAKUMI KAWAGOE", "GILES GODDARD" }; -const char *credits06[] = { "2COURSE DIRECTORS", "YOICHI YAMADA", "YASUHISA YAMAMURA" }; -const char *credits07[] = { "2COURSE DESIGNERS", "KENTA USUI", "NAOKI MORI" }; -const char *credits08[] = { "3COURSE DESIGNERS", "YOSHIKI HARUHANA", "MAKOTO MIYANAGA", "KATSUHIKO KANNO" }; +const char* credits05[] = { "4CAMERA PROGRAMMER", "MARIO FACE PROGRAMMER", "TAKUMI KAWAGOE", "GILES GODDARD" }; +const char* credits06[] = { "2COURSE DIRECTORS", "YOICHI YAMADA", "YASUHISA YAMAMURA" }; +const char* credits07[] = { "2COURSE DESIGNERS", "KENTA USUI", "NAOKI MORI" }; +const char* credits08[] = { "3COURSE DESIGNERS", "YOSHIKI HARUHANA", "MAKOTO MIYANAGA", "KATSUHIKO KANNO" }; #ifdef VERSION_US -const char *credits09[] = { "1SOUND COMPOSER", "KOJI KONDO" }; -// ...as well as sound effects and sound programmer in order to make room for screen text writer, Mario voice, and Peach voice -const char *credits10[] = { "4SOUND EFFECTS", "SOUND PROGRAMMER", "YOJI INAGAKI", "HIDEAKI SHIMIZU" }; -const char *credits11[] = { "23-D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" }; -const char *credits12[] = { "1ADDITIONAL GRAPHICS", "MASANAO ARIMOTO" }; -const char *credits13[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; -const char *credits14[] = { "1TECHNICAL SUPPORT", "SGI N64 PROJECT STAFF" }; -const char *credits15[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; -const char *credits16[] = { "5SCREEN TEXT WRITER", "TRANSLATION", "LESLIE SWAN", "MINA AKINO", "HIRO YAMADA" }; +const char* credits09[] = { "1SOUND COMPOSER", "KOJI KONDO" }; +// ...as well as sound effects and sound programmer in order to make room for screen text writer, Mario voice, and Peach +// voice +const char* credits10[] = { "4SOUND EFFECTS", "SOUND PROGRAMMER", "YOJI INAGAKI", "HIDEAKI SHIMIZU" }; +const char* credits11[] = { "23-D ANIMATORS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA" }; +const char* credits12[] = { "1ADDITIONAL GRAPHICS", "MASANAO ARIMOTO" }; +const char* credits13[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; +const char* credits14[] = { "1TECHNICAL SUPPORT", "SGI N64 PROJECT STAFF" }; +const char* credits15[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; +const char* credits16[] = { "5SCREEN TEXT WRITER", "TRANSLATION", "LESLIE SWAN", "MINA AKINO", "HIRO YAMADA" }; #else // VERSION_EU // ...as well as sound composer, sound effects, and sound programmer, and... -const char *credits09[] = { "7SOUND COMPOSER", "SOUND EFFECTS", "SOUND PROGRAMMER", "KOJI KONDO", "YOJI INAGAKI", "HIDEAKI SHIMIZU" }; +const char* credits09[] = { "7SOUND COMPOSER", "SOUND EFFECTS", "SOUND PROGRAMMER", + "KOJI KONDO", "YOJI INAGAKI", "HIDEAKI SHIMIZU" }; // ...3D animators and additional graphics in order to make room for screen text writer(s), Mario voice, and Peach voice -const char *credits10[] = { "63-D ANIMATORS", "ADDITIONAL GRAPHICS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA", "MASANAO ARIMOTO" }; -const char *credits11[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; -const char *credits12[] = { "1TECHNICAL SUPPORT", "SGI N64 PROJECT STAFF" }; -const char *credits13[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; -const char *credits14[] = { "5SCREEN TEXT WRITER", "ENGLISH TRANSLATION", "LESLIE SWAN", "MINA AKINO", "HIRO YAMADA" }; -const char *credits15[] = { "4SCREEN TEXT WRITER", "FRENCH TRANSLATION", "JULIEN BARDAKOFF", "KENJI HARAGUCHI" }; -const char *credits16[] = { "4SCREEN TEXT WRITER", "GERMAN TRANSLATION", "THOMAS GOERG", "THOMAS SPINDLER" }; +const char* credits10[] = { "63-D ANIMATORS", "ADDITIONAL GRAPHICS", "YOSHIAKI KOIZUMI", "SATORU TAKIZAWA", + "MASANAO ARIMOTO" }; +const char* credits11[] = { "3TECHNICAL SUPPORT", "TAKAO SAWANO", "HIROHITO YOSHIMOTO", "HIROTO YADA" }; +const char* credits12[] = { "1TECHNICAL SUPPORT", "SGI N64 PROJECT STAFF" }; +const char* credits13[] = { "2PROGRESS MANAGEMENT", "KIMIYOSHI FUKUI", "KEIZO KATO" }; +const char* credits14[] = { "5SCREEN TEXT WRITER", "ENGLISH TRANSLATION", "LESLIE SWAN", "MINA AKINO", "HIRO YAMADA" }; +const char* credits15[] = { "4SCREEN TEXT WRITER", "FRENCH TRANSLATION", "JULIEN BARDAKOFF", "KENJI HARAGUCHI" }; +const char* credits16[] = { "4SCREEN TEXT WRITER", "GERMAN TRANSLATION", "THOMAS GOERG", "THOMAS SPINDLER" }; #endif #endif #ifndef VERSION_JP -const char *credits17[] = { "4MARIO VOICE", "PEACH VOICE", "CHARLES MARTINET", "LESLIE SWAN" }; +const char* credits17[] = { "4MARIO VOICE", "PEACH VOICE", "CHARLES MARTINET", "LESLIE SWAN" }; #endif #if defined(VERSION_JP) || defined(VERSION_SH) -const char *credits18[] = { "3SPECIAL THANKS TO", "JYOHO KAIHATUBU", "ALL NINTENDO", "MARIO CLUB STAFF" }; +const char* credits18[] = { "3SPECIAL THANKS TO", "JYOHO KAIHATUBU", "ALL NINTENDO", "MARIO CLUB STAFF" }; #elif defined(VERSION_US) -const char *credits18[] = { "3SPECIAL THANKS TO", "EAD STAFF", "ALL NINTENDO PERSONNEL", "MARIO CLUB STAFF" }; +const char* credits18[] = { "3SPECIAL THANKS TO", "EAD STAFF", "ALL NINTENDO PERSONNEL", "MARIO CLUB STAFF" }; #else // VERSION_EU -const char *credits18[] = { "3SPECIAL THANKS TO", "EAD STAFF", "ALL NINTENDO PERSONNEL", "SUPER MARIO CLUB STAFF" }; +const char* credits18[] = { "3SPECIAL THANKS TO", "EAD STAFF", "ALL NINTENDO PERSONNEL", "SUPER MARIO CLUB STAFF" }; #endif -const char *credits19[] = { "1PRODUCER", "SHIGERU MIYAMOTO" }; -const char *credits20[] = { "1EXECUTIVE PRODUCER", "HIROSHI YAMAUCHI" }; - +const char* credits19[] = { "1PRODUCER", "SHIGERU MIYAMOTO" }; +const char* credits20[] = { "1EXECUTIVE PRODUCER", "HIROSHI YAMAUCHI" }; struct CreditsEntry sCreditsSequence[] = { { LEVEL_CASTLE_GROUNDS, 1, 1, -128, { 0, 8000, 0 }, NULL }, @@ -166,7 +168,7 @@ struct HudDisplay gHudDisplay; s16 sCurrPlayMode; u16 D_80339ECA; s16 sTransitionTimer; -void (*sTransitionUpdate)(s16 *); +void (*sTransitionUpdate)(s16*); struct WarpDest sWarpDest; s16 D_80339EE0; s16 sDelayedWarpOp; @@ -179,7 +181,7 @@ s16 unusedEULevelUpdateBss1; s8 sTimerRunning; s8 gNeverEnteredCastle; -struct MarioState *gMarioState = &gMarioStates[0]; +struct MarioState* gMarioState = &gMarioStates[0]; u8 unused1[4] = { 0 }; s8 sWarpCheckpointActive = FALSE; u8 unused2[4]; @@ -215,8 +217,8 @@ u32 pressed_pause(void) { u32 dialogActive = get_dialog_id() >= 0; u32 intangible = (gMarioState->action & ACT_FLAG_INTANGIBLE) != 0; - if (!intangible && !dialogActive && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE - && (gPlayer1Controller->buttonPressed & START_BUTTON)) { + if (!intangible && !dialogActive && !gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE && + (gPlayer1Controller->buttonPressed & START_BUTTON)) { return TRUE; } @@ -271,8 +273,7 @@ void load_level_init_text(u32 arg) { break; default: - gotAchievement = - save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum)); + gotAchievement = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum)); break; } @@ -282,7 +283,7 @@ void load_level_init_text(u32 arg) { } } -void init_door_warp(struct SpawnInfo *spawnInfo, u32 arg1) { +void init_door_warp(struct SpawnInfo* spawnInfo, u32 arg1) { if (arg1 & 0x00000002) { spawnInfo->startAngle[1] += 0x8000; } @@ -291,7 +292,7 @@ void init_door_warp(struct SpawnInfo *spawnInfo, u32 arg1) { spawnInfo->startPos[2] += 300.0f * coss(spawnInfo->startAngle[1]); } -void set_mario_initial_cap_powerup(struct MarioState *m) { +void set_mario_initial_cap_powerup(struct MarioState* m) { u32 capCourseIndex = gCurrCourseNum - COURSE_CAP_COURSES; switch (capCourseIndex) { @@ -312,7 +313,7 @@ void set_mario_initial_cap_powerup(struct MarioState *m) { } } -void set_mario_initial_action(struct MarioState *m, u32 spawnType, u32 actionArg) { +void set_mario_initial_action(struct MarioState* m, u32 spawnType, u32 actionArg) { switch (spawnType) { case MARIO_SPAWN_DOOR_WARP: set_mario_action(m, ACT_WARP_DOOR_SPAWN, actionArg); @@ -374,13 +375,13 @@ void set_mario_initial_action(struct MarioState *m, u32 spawnType, u32 actionArg } void init_mario_after_warp(void) { - struct ObjectWarpNode *spawnNode = area_get_warp_node(sWarpDest.nodeId); + struct ObjectWarpNode* spawnNode = area_get_warp_node(sWarpDest.nodeId); u32 marioSpawnType = get_mario_spawn_type(spawnNode->object); if (gMarioState->action != ACT_UNINITIALIZED) { - gPlayerSpawnInfos[0].startPos[0] = (s16) spawnNode->object->oPosX; - gPlayerSpawnInfos[0].startPos[1] = (s16) spawnNode->object->oPosY; - gPlayerSpawnInfos[0].startPos[2] = (s16) spawnNode->object->oPosZ; + gPlayerSpawnInfos[0].startPos[0] = (s16)spawnNode->object->oPosX; + gPlayerSpawnInfos[0].startPos[1] = (s16)spawnNode->object->oPosY; + gPlayerSpawnInfos[0].startPos[2] = (s16)spawnNode->object->oPosZ; gPlayerSpawnInfos[0].startAngle[0] = 0; gPlayerSpawnInfos[0].startAngle[1] = spawnNode->object->oMoveAngleYaw; @@ -441,20 +442,18 @@ void init_mario_after_warp(void) { play_cap_music(SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP)); } - if (CVarGetInteger("gFixKoopaRaceMusic", 0) == 1 && gCurrLevelNum == LEVEL_BOB - && get_current_background_music() != SEQUENCE_ARGS(4, SEQ_LEVEL_SLIDE) && sTimerRunning) { + if (CVarGetInteger("gFixKoopaRaceMusic", 0) == 1 && gCurrLevelNum == LEVEL_BOB && + get_current_background_music() != SEQUENCE_ARGS(4, SEQ_LEVEL_SLIDE) && sTimerRunning) { play_music(SEQ_PLAYER_LEVEL, SEQUENCE_ARGS(4, SEQ_LEVEL_SLIDE), 0); } - if (sWarpDest.levelNum == LEVEL_CASTLE && sWarpDest.areaIdx == 1 - && ( ROM_JP ? sWarpDest.nodeId == 31 : (sWarpDest.nodeId == 31 || sWarpDest.nodeId == 32)) - ) { + if (sWarpDest.levelNum == LEVEL_CASTLE && sWarpDest.areaIdx == 1 && + (ROM_JP ? sWarpDest.nodeId == 31 : (sWarpDest.nodeId == 31 || sWarpDest.nodeId == 32))) { play_sound(SOUND_MENU_MARIO_CASTLE_WARP, gGlobalSoundSource); } - if (!ROM_JP && sWarpDest.levelNum == LEVEL_CASTLE_GROUNDS && sWarpDest.areaIdx == 1 - && (sWarpDest.nodeId == 7 || sWarpDest.nodeId == 10 || sWarpDest.nodeId == 20 - || sWarpDest.nodeId == 30)) { + if (!ROM_JP && sWarpDest.levelNum == LEVEL_CASTLE_GROUNDS && sWarpDest.areaIdx == 1 && + (sWarpDest.nodeId == 7 || sWarpDest.nodeId == 10 || sWarpDest.nodeId == 20 || sWarpDest.nodeId == 30)) { play_sound(SOUND_MENU_MARIO_CASTLE_WARP, gGlobalSoundSource); } } @@ -504,8 +503,8 @@ void warp_credits(void) { load_area(sWarpDest.areaIdx); - vec3s_set(gPlayerSpawnInfos[0].startPos, gCurrCreditsEntry->marioPos[0], - gCurrCreditsEntry->marioPos[1], gCurrCreditsEntry->marioPos[2]); + vec3s_set(gPlayerSpawnInfos[0].startPos, gCurrCreditsEntry->marioPos[0], gCurrCreditsEntry->marioPos[1], + gCurrCreditsEntry->marioPos[2]); vec3s_set(gPlayerSpawnInfos[0].startAngle, 0, 0x100 * gCurrCreditsEntry->marioAngle, 0); @@ -530,18 +529,18 @@ void warp_credits(void) { void check_instant_warp(void) { s16 cameraAngle; - struct Surface *floor; + struct Surface* floor; - if (gCurrLevelNum == LEVEL_CASTLE - && save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 70) { + if (gCurrLevelNum == LEVEL_CASTLE && + save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 70) { return; } if ((floor = gMarioState->floor) != NULL) { s32 index = floor->type - SURFACE_INSTANT_WARP_1B; - if (index >= INSTANT_WARP_INDEX_START && index < INSTANT_WARP_INDEX_STOP - && gCurrentArea->instantWarps != NULL) { - struct InstantWarp *warp = &gCurrentArea->instantWarps[index]; + if (index >= INSTANT_WARP_INDEX_START && index < INSTANT_WARP_INDEX_STOP && + gCurrentArea->instantWarps != NULL) { + struct InstantWarp* warp = &gCurrentArea->instantWarps[index]; if (warp->id != 0) { gMarioState->pos[0] += warp->displacement[0]; @@ -566,26 +565,25 @@ void check_instant_warp(void) { } s16 music_changed_through_warp(s16 arg) { - struct ObjectWarpNode *warpNode = area_get_warp_node(arg); + struct ObjectWarpNode* warpNode = area_get_warp_node(arg); s16 levelNum = warpNode->node.destLevel & 0x7F; - if(CVarGetInteger("gFixKoopaRaceMusic", 0) == 1) { + if (CVarGetInteger("gFixKoopaRaceMusic", 0) == 1) { s16 destArea = warpNode->node.destArea; s16 val4 = TRUE; s16 sp2C; if (levelNum == LEVEL_BOB && levelNum == gCurrLevelNum && destArea == gCurrAreaIndex) { sp2C = get_current_background_music(); - if (sp2C == SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP | SEQ_VARIATION) - || sp2C == SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP)) { + if (sp2C == SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP | SEQ_VARIATION) || + sp2C == SEQUENCE_ARGS(4, SEQ_EVENT_POWERUP)) { val4 = FALSE; } } else { u16 val8 = gAreas[destArea].musicParam; u16 val6 = gAreas[destArea].musicParam2; - val4 = levelNum == gCurrLevelNum && val8 == gCurrentArea->musicParam - && val6 == gCurrentArea->musicParam2; + val4 = levelNum == gCurrLevelNum && val8 == gCurrentArea->musicParam && val6 == gCurrentArea->musicParam2; if (get_current_background_music() != val6) { val4 = FALSE; @@ -597,8 +595,7 @@ s16 music_changed_through_warp(s16 arg) { u16 val8 = gAreas[warpNode->node.destArea].musicParam; u16 val6 = gAreas[warpNode->node.destArea].musicParam2; - s16 val4 = levelNum == gCurrLevelNum && val8 == gCurrentArea->musicParam - && val6 == gCurrentArea->musicParam2; + s16 val4 = levelNum == gCurrLevelNum && val8 == gCurrentArea->musicParam && val6 == gCurrentArea->musicParam2; if (get_current_background_music() != val6) { val4 = FALSE; @@ -635,13 +632,12 @@ void initiate_warp(s16 destLevel, s16 destArea, s16 destWarpNode, s32 arg3) { * Check if Mario is above and close to a painting warp floor, and return the * corresponding warp node. */ -struct WarpNode *get_painting_warp_node(void) { - struct WarpNode *warpNode = NULL; +struct WarpNode* get_painting_warp_node(void) { + struct WarpNode* warpNode = NULL; s32 paintingIndex = gMarioState->floor->type - SURFACE_PAINTING_WARP_D3; if (paintingIndex >= PAINTING_WARP_INDEX_START && paintingIndex < PAINTING_WARP_INDEX_END) { - if (paintingIndex < PAINTING_WARP_INDEX_FA - || gMarioState->pos[1] - gMarioState->floorHeight < 80.0f) { + if (paintingIndex < PAINTING_WARP_INDEX_FA || gMarioState->pos[1] - gMarioState->floorHeight < 80.0f) { warpNode = &gCurrentArea->paintingWarpNodes[paintingIndex]; } } @@ -655,7 +651,7 @@ struct WarpNode *get_painting_warp_node(void) { void initiate_painting_warp(void) { if (gCurrentArea->paintingWarpNodes != NULL && gMarioState->floor != NULL) { struct WarpNode warpNode; - struct WarpNode *pWarpNode = get_painting_warp_node(); + struct WarpNode* pWarpNode = get_painting_warp_node(); if (pWarpNode != NULL) { if (gMarioState->action & ACT_FLAG_INTANGIBLE) { @@ -693,7 +689,7 @@ void initiate_painting_warp(void) { * based on the warp operation and sometimes Mario's used object. * Return the time left until the delayed warp is initiated. */ -s16 level_trigger_warp(struct MarioState *m, s32 warpOp) { +s16 level_trigger_warp(struct MarioState* m, s32 warpOp) { s32 val04 = TRUE; if (sDelayedWarpOp == WARP_OP_NONE) { @@ -703,7 +699,8 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) { switch (warpOp) { case WARP_OP_DEMO_NEXT: - case WARP_OP_DEMO_END: sDelayedWarpTimer = 20; // Must be one line to match on -O2 + case WARP_OP_DEMO_END: + sDelayedWarpTimer = 20; // Must be one line to match on -O2 sSourceWarpNodeId = WARP_NODE_F0; gSavedCourseNum = COURSE_NONE; val04 = FALSE; @@ -752,7 +749,7 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) { sDelayedWarpTimer = 30; sSourceWarpNodeId = WARP_NODE_F2; play_transition(WARP_TRANSITION_FADE_INTO_COLOR, 0x1E, 0xFF, 0xFF, 0xFF); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_MENU_STAR_SOUND, gGlobalSoundSource); } break; @@ -814,7 +811,7 @@ s16 level_trigger_warp(struct MarioState *m, s32 warpOp) { * If a delayed warp is ready, initiate it. */ void initiate_delayed_warp(void) { - struct ObjectWarpNode *warpNode; + struct ObjectWarpNode* warpNode; s32 destWarpNode; if (sDelayedWarpOp != WARP_OP_NONE && --sDelayedWarpTimer == 0) { @@ -837,8 +834,7 @@ void initiate_delayed_warp(void) { case WARP_OP_CREDITS_END: warp_special(-1); - sound_banks_enable(SEQ_PLAYER_SFX, - SOUND_BANKS_ALL & ~SOUND_BANKS_DISABLED_AFTER_CREDITS); + sound_banks_enable(SEQ_PLAYER_SFX, SOUND_BANKS_ALL & ~SOUND_BANKS_DISABLED_AFTER_CREDITS); break; case WARP_OP_DEMO_NEXT: @@ -847,8 +843,8 @@ void initiate_delayed_warp(void) { case WARP_OP_CREDITS_START: gCurrCreditsEntry = &sCreditsSequence[0]; - initiate_warp(gCurrCreditsEntry->levelNum, gCurrCreditsEntry->areaIndex, - WARP_NODE_CREDITS_START, 0); + initiate_warp(gCurrCreditsEntry->levelNum, gCurrCreditsEntry->areaIndex, WARP_NODE_CREDITS_START, + 0); break; case WARP_OP_CREDITS_NEXT: @@ -862,15 +858,14 @@ void initiate_delayed_warp(void) { destWarpNode = WARP_NODE_CREDITS_NEXT; } - initiate_warp(gCurrCreditsEntry->levelNum, gCurrCreditsEntry->areaIndex, - destWarpNode, 0); + initiate_warp(gCurrCreditsEntry->levelNum, gCurrCreditsEntry->areaIndex, destWarpNode, 0); break; default: warpNode = area_get_warp_node(sSourceWarpNodeId); - initiate_warp(warpNode->node.destLevel & 0x7F, warpNode->node.destArea, - warpNode->node.destNode, sDelayedWarpArg); + initiate_warp(warpNode->node.destLevel & 0x7F, warpNode->node.destArea, warpNode->node.destNode, + sDelayedWarpArg); check_if_should_set_warp_checkpoint(&warpNode->node); if (sWarpDest.type != WARP_TYPE_CHANGE_LEVEL) { @@ -920,7 +915,7 @@ void update_hud_values(void) { } #else if (gMarioState->numCoins > 999) { - gMarioState->numLives = (s8) 999; //! Wrong variable + gMarioState->numLives = (s8)999; //! Wrong variable } #endif @@ -947,7 +942,7 @@ void update_hud_values(void) { * presumably to allow painting and camera updating while avoiding triggering the * warp twice. */ -void basic_update(UNUSED s16 *arg) { +void basic_update(UNUSED s16* arg) { area_update_objects(); update_hud_values(); @@ -960,10 +955,9 @@ s32 play_mode_normal(void) { if (gCurrDemoInput != NULL) { print_intro_text(); if (gPlayer1Controller->buttonPressed & END_DEMO) { - level_trigger_warp(gMarioState, - gCurrLevelNum == LEVEL_PSS ? WARP_OP_DEMO_END : WARP_OP_DEMO_NEXT); - } else if (!gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE - && (gPlayer1Controller->buttonPressed & START_BUTTON)) { + level_trigger_warp(gMarioState, gCurrLevelNum == LEVEL_PSS ? WARP_OP_DEMO_END : WARP_OP_DEMO_NEXT); + } else if (!gWarpTransition.isActive && sDelayedWarpOp == WARP_OP_NONE && + (gPlayer1Controller->buttonPressed & START_BUTTON)) { level_trigger_warp(gMarioState, WARP_OP_DEMO_NEXT); } } @@ -1051,7 +1045,7 @@ s32 play_mode_frame_advance(void) { * but before it actually occurs. If updateFunction is not NULL, it will be * called each frame during the transition. */ -void level_set_transition(s16 length, void (*updateFunction)(s16 *)) { +void level_set_transition(s16 length, void (*updateFunction)(s16*)) { sTransitionTimer = length; sTransitionUpdate = updateFunction; } @@ -1062,7 +1056,7 @@ void level_set_transition(s16 length, void (*updateFunction)(s16 *)) { s32 play_mode_change_area(void) { //! This maybe was supposed to be sTransitionTimer == -1? sTransitionUpdate // is never set to -1. - if (sTransitionUpdate == (void (*)(s16 *)) -1) { + if (sTransitionUpdate == (void (*)(s16*))-1) { update_camera(gCurrentArea->camera); } else if (sTransitionUpdate != NULL) { sTransitionUpdate(&sTransitionTimer); @@ -1190,7 +1184,7 @@ s32 init_level(void) { if (gMarioState->action != ACT_UNINITIALIZED) { if (save_file_exists(gCurrSaveFileNum - 1)) { set_mario_action(gMarioState, ACT_IDLE, 0); - } else if (CVarGetInteger("gDisablePeachCutscene", 0) == 0){ + } else if (CVarGetInteger("gDisablePeachCutscene", 0) == 0) { set_mario_action(gMarioState, ACT_INTRO_CUTSCENE, 0); val4 = TRUE; } @@ -1244,16 +1238,13 @@ s32 lvl_init_from_save_file(UNUSED s16 arg0, s32 levelNum) { s16 language = eu_get_language(); switch (language) { case LANGUAGE_ENGLISH: - load_segment_decompress(0x19, _translation_en_mio0SegmentRomStart, - _translation_en_mio0SegmentRomEnd); + load_segment_decompress(0x19, _translation_en_mio0SegmentRomStart, _translation_en_mio0SegmentRomEnd); break; case LANGUAGE_FRENCH: - load_segment_decompress(0x19, _translation_fr_mio0SegmentRomStart, - _translation_fr_mio0SegmentRomEnd); + load_segment_decompress(0x19, _translation_fr_mio0SegmentRomStart, _translation_fr_mio0SegmentRomEnd); break; case LANGUAGE_GERMAN: - load_segment_decompress(0x19, _translation_de_mio0SegmentRomStart, - _translation_de_mio0SegmentRomEnd); + load_segment_decompress(0x19, _translation_de_mio0SegmentRomStart, _translation_de_mio0SegmentRomEnd); break; } #endif @@ -1287,12 +1278,10 @@ s32 lvl_set_current_level(UNUSED s16 arg0, s32 levelNum) { return 0; } - if (gCurrLevelNum != LEVEL_BOWSER_1 && gCurrLevelNum != LEVEL_BOWSER_2 - && gCurrLevelNum != LEVEL_BOWSER_3) { + if (gCurrLevelNum != LEVEL_BOWSER_1 && gCurrLevelNum != LEVEL_BOWSER_2 && gCurrLevelNum != LEVEL_BOWSER_3) { gMarioState->numCoins = 0; gHudDisplay.coins = 0; - gCurrCourseStarFlags = - save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum)); + gCurrCourseStarFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum)); } if (gSavedCourseNum != gCurrCourseNum) { diff --git a/src/game/macro_special_objects.c b/src/game/macro_special_objects.c index f4884d83..5fabb7c0 100644 --- a/src/game/macro_special_objects.c +++ b/src/game/macro_special_objects.c @@ -35,7 +35,7 @@ s16 convert_rotation(s16 inRotation) { rotation = 0x0000; } - return (s16) rotation; + return (s16)rotation; } /* @@ -43,11 +43,11 @@ s16 convert_rotation(s16 inRotation) { * parameters filling up the upper 2 bytes of newObj->oBehParams. * The object will not spawn if 'behavior' is NULL. */ -void spawn_macro_abs_yrot_2params(s32 model, const BehaviorScript *behavior, s16 x, s16 y, s16 z, s16 ry, s16 params) { +void spawn_macro_abs_yrot_2params(s32 model, const BehaviorScript* behavior, s16 x, s16 y, s16 z, s16 ry, s16 params) { if (behavior != NULL) { - struct Object *newObj = spawn_object_abs_with_rot( - &gMacroObjectDefaultParent, 0, model, behavior, x, y, z, 0, convert_rotation(ry), 0); - newObj->oBehParams = ((u32) params) << 16; + struct Object* newObj = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, x, y, z, 0, + convert_rotation(ry), 0); + newObj->oBehParams = ((u32)params) << 16; } } @@ -56,11 +56,11 @@ void spawn_macro_abs_yrot_2params(s32 model, const BehaviorScript *behavior, s16 * a single parameter filling up the upper byte of newObj->oBehParams. * The object will not spawn if 'behavior' is NULL. */ -void spawn_macro_abs_yrot_param1(s32 model, const BehaviorScript *behavior, s16 x, s16 y, s16 z, s16 ry, s16 param) { +void spawn_macro_abs_yrot_param1(s32 model, const BehaviorScript* behavior, s16 x, s16 y, s16 z, s16 ry, s16 param) { if (behavior != NULL) { - struct Object *newObj = spawn_object_abs_with_rot( - &gMacroObjectDefaultParent, 0, model, behavior, x, y, z, 0, convert_rotation(ry), 0); - newObj->oBehParams = ((u32) param) << 24; + struct Object* newObj = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, x, y, z, 0, + convert_rotation(ry), 0); + newObj->oBehParams = ((u32)param) << 24; } } @@ -68,32 +68,31 @@ void spawn_macro_abs_yrot_param1(s32 model, const BehaviorScript *behavior, s16 * Spawns an object at an absolute location with currently 3 unknown variables that get converted to * floats. Oddly enough, this function doesn't care if 'behavior' is NULL or not. */ -void spawn_macro_abs_special(s32 model, const BehaviorScript *behavior, s16 x, s16 y, s16 z, s16 unkA, s16 unkB, +void spawn_macro_abs_special(s32 model, const BehaviorScript* behavior, s16 x, s16 y, s16 z, s16 unkA, s16 unkB, s16 unkC) { - struct Object *newObj = - spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, x, y, z, 0, 0, 0); + struct Object* newObj = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, x, y, z, 0, 0, 0); // Are all three of these values unused? - newObj->oMacroUnk108 = (f32) unkA; - newObj->oMacroUnk10C = (f32) unkB; - newObj->oMacroUnk110 = (f32) unkC; + newObj->oMacroUnk108 = (f32)unkA; + newObj->oMacroUnk10C = (f32)unkB; + newObj->oMacroUnk110 = (f32)unkC; } -UNUSED static void spawn_macro_coin_unknown(const BehaviorScript *behavior, s16 a1[]) { - struct Object *sp3C; +UNUSED static void spawn_macro_coin_unknown(const BehaviorScript* behavior, s16 a1[]) { + struct Object* sp3C; s16 model; model = bhvYellowCoin == behavior ? MODEL_YELLOW_COIN : MODEL_NONE; - sp3C = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, - a1[1], a1[2], a1[3], 0, convert_rotation(a1[0]), 0); + sp3C = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, 0, model, behavior, a1[1], a1[2], a1[3], 0, + convert_rotation(a1[0]), 0); sp3C->oUnk1A8 = a1[4]; sp3C->oBehParams = (a1[4] & 0xFF) >> 16; } struct LoadedPreset { - /*0x00*/ const BehaviorScript *behavior; + /*0x00*/ const BehaviorScript* behavior; /*0x04*/ s16 param; // huh? why does the below function swap these.. just use the struct.. /*0x06*/ s16 model; }; @@ -104,12 +103,12 @@ struct LoadedPreset { #define MACRO_OBJ_Z 3 #define MACRO_OBJ_PARAMS 4 -void spawn_macro_objects(s16 areaIndex, s16 *macroObjList) { +void spawn_macro_objects(s16 areaIndex, s16* macroObjList) { UNUSED u8 filler[4]; s32 presetID; s16 macroObject[5]; // see the 5 #define statements above - struct Object *newObj; + struct Object* newObj; struct LoadedPreset preset; gMacroObjectDefaultParent.header.gfx.areaIndex = areaIndex; @@ -139,30 +138,27 @@ void spawn_macro_objects(s16 areaIndex, s16 *macroObjList) { preset.param = MacroObjectPresets[presetID].param; if (preset.param != 0) { - macroObject[MACRO_OBJ_PARAMS] = - (macroObject[MACRO_OBJ_PARAMS] & 0xFF00) + (preset.param & 0x00FF); + macroObject[MACRO_OBJ_PARAMS] = (macroObject[MACRO_OBJ_PARAMS] & 0xFF00) + (preset.param & 0x00FF); } // If object has been killed, prevent it from respawning - if (((macroObject[MACRO_OBJ_PARAMS] >> 8) & RESPAWN_INFO_DONT_RESPAWN) - != RESPAWN_INFO_DONT_RESPAWN) { + if (((macroObject[MACRO_OBJ_PARAMS] >> 8) & RESPAWN_INFO_DONT_RESPAWN) != RESPAWN_INFO_DONT_RESPAWN) { // Spawn the new macro object. - newObj = spawn_object_abs_with_rot( - &gMacroObjectDefaultParent, // Parent object - 0, // Unused - preset.model, // Model ID - preset.behavior, // Behavior address - macroObject[MACRO_OBJ_X], // X-position - macroObject[MACRO_OBJ_Y], // Y-position - macroObject[MACRO_OBJ_Z], // Z-position - 0, // X-rotation - convert_rotation(macroObject[MACRO_OBJ_Y_ROT]), // Y-rotation - 0 // Z-rotation - ); + newObj = spawn_object_abs_with_rot(&gMacroObjectDefaultParent, // Parent object + 0, // Unused + preset.model, // Model ID + preset.behavior, // Behavior address + macroObject[MACRO_OBJ_X], // X-position + macroObject[MACRO_OBJ_Y], // Y-position + macroObject[MACRO_OBJ_Z], // Z-position + 0, // X-rotation + convert_rotation(macroObject[MACRO_OBJ_Y_ROT]), // Y-rotation + 0 // Z-rotation + ); newObj->oUnk1A8 = macroObject[MACRO_OBJ_PARAMS]; - newObj->oBehParams = ((macroObject[MACRO_OBJ_PARAMS] & 0x00FF) << 16) - + (macroObject[MACRO_OBJ_PARAMS] & 0xFF00); + newObj->oBehParams = + ((macroObject[MACRO_OBJ_PARAMS] & 0x00FF) << 16) + (macroObject[MACRO_OBJ_PARAMS] & 0xFF00); newObj->oBehParams2ndByte = macroObject[MACRO_OBJ_PARAMS] & 0x00FF; newObj->respawnInfoType = RESPAWN_INFO_TYPE_16; newObj->respawnInfo = macroObjList - 1; @@ -171,7 +167,7 @@ void spawn_macro_objects(s16 areaIndex, s16 *macroObjList) { } } -void spawn_macro_objects_hardcoded(s16 areaIndex, s16 *macroObjList) { +void spawn_macro_objects_hardcoded(s16 areaIndex, s16* macroObjList) { UNUSED u8 filler1[8]; // This version of macroObjList has the preset and Y-Rotation separated, @@ -203,33 +199,32 @@ void spawn_macro_objects_hardcoded(s16 areaIndex, s16 *macroObjList) { // However, BBH doesn't use this function so this might just be an early test? switch (macroObjPreset) { case 0: - spawn_macro_abs_yrot_2params(MODEL_NONE, bhvBooStaircase, macroObjX, macroObjY, - macroObjZ, macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_NONE, bhvBooStaircase, macroObjX, macroObjY, macroObjZ, macroObjRY, + 0); break; case 1: - spawn_macro_abs_yrot_2params(MODEL_BBH_TILTING_FLOOR_PLATFORM, - bhvBbhTiltingTrapPlatform, macroObjX, macroObjY, macroObjZ, - macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_BBH_TILTING_FLOOR_PLATFORM, bhvBbhTiltingTrapPlatform, macroObjX, + macroObjY, macroObjZ, macroObjRY, 0); break; case 2: - spawn_macro_abs_yrot_2params(MODEL_BBH_TUMBLING_PLATFORM, bhvBbhTumblingBridge, - macroObjX, macroObjY, macroObjZ, macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_BBH_TUMBLING_PLATFORM, bhvBbhTumblingBridge, macroObjX, macroObjY, + macroObjZ, macroObjRY, 0); break; case 3: - spawn_macro_abs_yrot_2params(MODEL_BBH_MOVING_BOOKSHELF, bhvHauntedBookshelf, macroObjX, - macroObjY, macroObjZ, macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_BBH_MOVING_BOOKSHELF, bhvHauntedBookshelf, macroObjX, macroObjY, + macroObjZ, macroObjRY, 0); break; case 4: - spawn_macro_abs_yrot_2params(MODEL_BBH_MESH_ELEVATOR, bhvMeshElevator, macroObjX, - macroObjY, macroObjZ, macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_BBH_MESH_ELEVATOR, bhvMeshElevator, macroObjX, macroObjY, macroObjZ, + macroObjRY, 0); break; case 20: - spawn_macro_abs_yrot_2params(MODEL_YELLOW_COIN, bhvYellowCoin, macroObjX, macroObjY, - macroObjZ, macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_YELLOW_COIN, bhvYellowCoin, macroObjX, macroObjY, macroObjZ, + macroObjRY, 0); break; case 21: - spawn_macro_abs_yrot_2params(MODEL_YELLOW_COIN, bhvYellowCoin, macroObjX, macroObjY, - macroObjZ, macroObjRY, 0); + spawn_macro_abs_yrot_2params(MODEL_YELLOW_COIN, bhvYellowCoin, macroObjX, macroObjY, macroObjZ, + macroObjRY, 0); break; default: break; @@ -237,7 +232,7 @@ void spawn_macro_objects_hardcoded(s16 areaIndex, s16 *macroObjList) { } } -void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { +void spawn_special_objects(s16 areaIndex, s16** specialObjList) { s32 numOfSpecialObjects; s32 i; s32 offset; @@ -249,7 +244,7 @@ void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { u8 type; u8 presetID; u8 defaultParam; - const BehaviorScript *behavior; + const BehaviorScript* behavior; numOfSpecialObjects = **specialObjList; (*specialObjList)++; @@ -258,7 +253,7 @@ void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { gMacroObjectDefaultParent.header.gfx.activeAreaIndex = areaIndex; for (i = 0; i < numOfSpecialObjects; i++) { - presetID = (u8) **specialObjList; + presetID = (u8) * *specialObjList; (*specialObjList)++; x = **specialObjList; (*specialObjList)++; @@ -273,8 +268,7 @@ void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { break; } - if (SpecialObjectPresets[offset].preset_id == 0xFF) { - } + if (SpecialObjectPresets[offset].preset_id == 0xFF) {} offset++; } @@ -301,17 +295,13 @@ void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { spawn_macro_abs_yrot_2params(model, behavior, x, y, z, extraParams[0], extraParams[1]); break; case SPTYPE_UNKNOWN: - extraParams[0] = - **specialObjList; // Unknown, gets put into obj->oMacroUnk108 as a float + extraParams[0] = **specialObjList; // Unknown, gets put into obj->oMacroUnk108 as a float (*specialObjList)++; - extraParams[1] = - **specialObjList; // Unknown, gets put into obj->oMacroUnk10C as a float + extraParams[1] = **specialObjList; // Unknown, gets put into obj->oMacroUnk10C as a float (*specialObjList)++; - extraParams[2] = - **specialObjList; // Unknown, gets put into obj->oMacroUnk110 as a float + extraParams[2] = **specialObjList; // Unknown, gets put into obj->oMacroUnk110 as a float (*specialObjList)++; - spawn_macro_abs_special(model, behavior, x, y, z, extraParams[0], extraParams[1], - extraParams[2]); + spawn_macro_abs_special(model, behavior, x, y, z, extraParams[0], extraParams[1], extraParams[2]); break; case SPTYPE_DEF_PARAM_AND_YROT: extraParams[0] = **specialObjList; // Y-rotation @@ -324,8 +314,8 @@ void spawn_special_objects(s16 areaIndex, s16 **specialObjList) { } } -u32 get_special_objects_size(s16 *data) { - s16 *startPos = data; +u32 get_special_objects_size(s16* data) { + s16* startPos = data; s32 numOfSpecialObjects; s32 i; u8 presetID; @@ -334,7 +324,7 @@ u32 get_special_objects_size(s16 *data) { numOfSpecialObjects = *data++; for (i = 0; i < numOfSpecialObjects; i++) { - presetID = (u8) *data++; + presetID = (u8)*data++; data += 3; offset = 0; diff --git a/src/game/main.c b/src/game/main.c index e8e73ec3..66f7555c 100644 --- a/src/game/main.c +++ b/src/game/main.c @@ -40,13 +40,13 @@ OSMesg gSIEventMesgBuf[1]; OSMesg gIntrMesgBuf[16]; OSMesg gUnknownMesgBuf[16]; -struct VblankHandler *gVblankHandler1 = NULL; -struct VblankHandler *gVblankHandler2 = NULL; -struct SPTask *gActiveSPTask = NULL; -struct SPTask *sCurrentAudioSPTask = NULL; -struct SPTask *sCurrentDisplaySPTask = NULL; -struct SPTask *sNextAudioSPTask = NULL; -struct SPTask *sNextDisplaySPTask = NULL; +struct VblankHandler* gVblankHandler1 = NULL; +struct VblankHandler* gVblankHandler2 = NULL; +struct SPTask* gActiveSPTask = NULL; +struct SPTask* sCurrentAudioSPTask = NULL; +struct SPTask* sCurrentDisplaySPTask = NULL; +struct SPTask* sNextAudioSPTask = NULL; +struct SPTask* sNextDisplaySPTask = NULL; s8 sAudioEnabled = TRUE; u32 gNumVblanks = 0; s8 gResetTimer = 0; @@ -59,11 +59,8 @@ s8 gShowDebugText = FALSE; // unused void handle_debug_key_sequences(void) { - static u16 sProfilerKeySequence[] = { - U_JPAD, U_JPAD, D_JPAD, D_JPAD, L_JPAD, R_JPAD, L_JPAD, R_JPAD - }; - static u16 sDebugTextKeySequence[] = { D_JPAD, D_JPAD, U_JPAD, U_JPAD, - L_JPAD, R_JPAD, L_JPAD, R_JPAD }; + static u16 sProfilerKeySequence[] = { U_JPAD, U_JPAD, D_JPAD, D_JPAD, L_JPAD, R_JPAD, L_JPAD, R_JPAD }; + static u16 sDebugTextKeySequence[] = { D_JPAD, D_JPAD, U_JPAD, U_JPAD, L_JPAD, R_JPAD, L_JPAD, R_JPAD }; static s16 sProfilerKey = 0; static s16 sDebugTextKey = 0; if (gPlayer3Controller->buttonPressed != 0) { @@ -118,22 +115,22 @@ void setup_mesg_queues(void) { osCreateMesgQueue(&gSPTaskMesgQueue, gUnknownMesgBuf, ARRAY_COUNT(gUnknownMesgBuf)); osCreateMesgQueue(&gIntrMesgQueue, gIntrMesgBuf, ARRAY_COUNT(gIntrMesgBuf)); - osViSetEvent(&gIntrMesgQueue, (OSMesg) MESG_VI_VBLANK, 1); + osViSetEvent(&gIntrMesgQueue, (OSMesg)MESG_VI_VBLANK, 1); - osSetEventMesg(OS_EVENT_SP, &gIntrMesgQueue, (OSMesg) MESG_SP_COMPLETE); - osSetEventMesg(OS_EVENT_DP, &gIntrMesgQueue, (OSMesg) MESG_DP_COMPLETE); - osSetEventMesg(OS_EVENT_PRENMI, &gIntrMesgQueue, (OSMesg) MESG_NMI_REQUEST); + osSetEventMesg(OS_EVENT_SP, &gIntrMesgQueue, (OSMesg)MESG_SP_COMPLETE); + osSetEventMesg(OS_EVENT_DP, &gIntrMesgQueue, (OSMesg)MESG_DP_COMPLETE); + osSetEventMesg(OS_EVENT_PRENMI, &gIntrMesgQueue, (OSMesg)MESG_NMI_REQUEST); } void alloc_pool(void) { - void *start = (void *) SEG_POOL_START; - void *end = (void *) SEG_POOL_END; + void* start = (void*)SEG_POOL_START; + void* end = (void*)SEG_POOL_END; main_pool_init(start, end); gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT); } -void create_thread(OSThread *thread, OSId id, void (*entry)(void *), void *arg, void *sp, OSPri pri) { +void create_thread(OSThread* thread, OSId id, void (*entry)(void*), void* arg, void* sp, OSPri pri) { thread->next = NULL; thread->queue = NULL; osCreateThread(thread, id, entry, arg, sp, pri); @@ -155,9 +152,9 @@ void handle_nmi_request(void) { } void receive_new_tasks(void) { - struct SPTask *spTask; + struct SPTask* spTask; - while (osRecvMesg(&gSPTaskMesgQueue, (OSMesg *) &spTask, OS_MESG_NOBLOCK) != -1) { + while (osRecvMesg(&gSPTaskMesgQueue, (OSMesg*)&spTask, OS_MESG_NOBLOCK) != -1) { spTask->state = SPTASK_STATE_NOT_STARTED; switch (spTask->task.t.type) { case 2: @@ -202,8 +199,8 @@ void interrupt_gfx_sptask(void) { } void start_gfx_sptask(void) { - if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL - && sCurrentDisplaySPTask->state == SPTASK_STATE_NOT_STARTED) { + if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL && + sCurrentDisplaySPTask->state == SPTASK_STATE_NOT_STARTED) { profiler_log_gfx_time(TASKS_QUEUED); start_sptask(M_GFXTASK); } @@ -212,7 +209,7 @@ void start_gfx_sptask(void) { void pretend_audio_sptask_done(void) { gActiveSPTask = sCurrentAudioSPTask; gActiveSPTask->state = SPTASK_STATE_RUNNING; - osSendMesg(&gIntrMesgQueue, (OSMesg) MESG_SP_COMPLETE, OS_MESG_NOBLOCK); + osSendMesg(&gIntrMesgQueue, (OSMesg)MESG_SP_COMPLETE, OS_MESG_NOBLOCK); } void handle_vblank(void) { @@ -249,8 +246,8 @@ void handle_vblank(void) { } } } else { - if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL - && sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) { + if (gActiveSPTask == NULL && sCurrentDisplaySPTask != NULL && + sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) { profiler_log_gfx_time(TASKS_QUEUED); start_sptask(M_GFXTASK); } @@ -269,7 +266,7 @@ void handle_vblank(void) { } void handle_sp_complete(void) { - struct SPTask *curSPTask = gActiveSPTask; + struct SPTask* curSPTask = gActiveSPTask; gActiveSPTask = NULL; @@ -296,8 +293,7 @@ void handle_sp_complete(void) { if (curSPTask->task.t.type == M_AUDTASK) { // After audio tasks come gfx tasks. profiler_log_vblank_time(); - if (sCurrentDisplaySPTask != NULL - && sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) { + if (sCurrentDisplaySPTask != NULL && sCurrentDisplaySPTask->state != SPTASK_STATE_FINISHED) { if (sCurrentDisplaySPTask->state != SPTASK_STATE_INTERRUPTED) { profiler_log_gfx_time(TASKS_QUEUED); } @@ -326,7 +322,7 @@ void handle_dp_complete(void) { sCurrentDisplaySPTask = NULL; } -void thread3_main(UNUSED void *arg) { +void thread3_main(UNUSED void* arg) { setup_mesg_queues(); alloc_pool(); load_engine_code_segment(); @@ -341,7 +337,7 @@ void thread3_main(UNUSED void *arg) { OSMesg msg; osRecvMesg(&gIntrMesgQueue, &msg, OS_MESG_BLOCK); - switch ((uintptr_t) msg) { + switch ((uintptr_t)msg) { case MESG_VI_VBLANK: handle_vblank(); break; @@ -362,7 +358,7 @@ void thread3_main(UNUSED void *arg) { } } -void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *queue, OSMesg msg) { +void set_vblank_handler(s32 index, struct VblankHandler* handler, OSMesgQueue* queue, OSMesg msg) { handler->queue = queue; handler->msg = msg; @@ -376,26 +372,26 @@ void set_vblank_handler(s32 index, struct VblankHandler *handler, OSMesgQueue *q } } -void send_sp_task_message(OSMesg *msg) { +void send_sp_task_message(OSMesg* msg) { osWritebackDCacheAll(); osSendMesg(&gSPTaskMesgQueue, msg, OS_MESG_NOBLOCK); } -void dispatch_audio_sptask(struct SPTask *spTask) { +void dispatch_audio_sptask(struct SPTask* spTask) { if (sAudioEnabled && spTask != NULL) { osWritebackDCacheAll(); osSendMesg(&gSPTaskMesgQueue, spTask, OS_MESG_NOBLOCK); } } -void exec_display_list(struct SPTask *spTask) { +void exec_display_list(struct SPTask* spTask) { if (spTask != NULL) { osWritebackDCacheAll(); spTask->state = SPTASK_STATE_NOT_STARTED; if (sCurrentDisplaySPTask == NULL) { sCurrentDisplaySPTask = spTask; sNextDisplaySPTask = NULL; - osSendMesg(&gIntrMesgQueue, (OSMesg) MESG_START_GFX_SPTASK, OS_MESG_NOBLOCK); + osSendMesg(&gIntrMesgQueue, (OSMesg)MESG_START_GFX_SPTASK, OS_MESG_NOBLOCK); } else { sNextDisplaySPTask = spTask; } @@ -416,7 +412,7 @@ void turn_off_audio(void) { /** * Initialize hardware, start main thread, then idle. */ -void thread1_idle(UNUSED void *arg) { +void thread1_idle(UNUSED void* arg) { #if defined(VERSION_US) || defined(VERSION_SH) s32 sp24 = osTvType; #endif diff --git a/src/game/mario.c b/src/game/mario.c index ae6e6767..4b3b1135 100644 --- a/src/game/mario.c +++ b/src/game/mario.c @@ -47,8 +47,8 @@ u8 unused80339F1C[20]; /** * Checks if Mario's animation has reached its end point. */ -s32 is_anim_at_end(struct MarioState *m) { - struct Object *o = m->marioObj; +s32 is_anim_at_end(struct MarioState* m) { + struct Object* o = m->marioObj; return (o->header.gfx.animInfo.animFrame + 1) == o->header.gfx.animInfo.curAnim->loopEnd; } @@ -56,8 +56,8 @@ s32 is_anim_at_end(struct MarioState *m) { /** * Checks if Mario's animation has surpassed 2 frames before its end point. */ -s32 is_anim_past_end(struct MarioState *m) { - struct Object *o = m->marioObj; +s32 is_anim_past_end(struct MarioState* m) { + struct Object* o = m->marioObj; return o->header.gfx.animInfo.animFrame >= (o->header.gfx.animInfo.curAnim->loopEnd - 2); } @@ -65,10 +65,10 @@ s32 is_anim_past_end(struct MarioState *m) { /** * Sets Mario's animation without any acceleration, running at its default rate. */ -s16 set_mario_animation(struct MarioState *m, s32 targetAnimID) { - struct Object *o = m->marioObj; +s16 set_mario_animation(struct MarioState* m, s32 targetAnimID) { + struct Object* o = m->marioObj; - struct Animation *targetAnim = GameEngine_LoadAnimation(targetAnimID); + struct Animation* targetAnim = GameEngine_LoadAnimation(targetAnimID); if (o->header.gfx.animInfo.animID != targetAnimID) { o->header.gfx.animInfo.animID = targetAnimID; @@ -94,9 +94,9 @@ s16 set_mario_animation(struct MarioState *m, s32 targetAnimID) { * Sets Mario's animation where the animation is sped up or * slowed down via acceleration. */ -s16 set_mario_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel) { - struct Object *o = m->marioObj; - struct Animation *targetAnim = GameEngine_LoadAnimation(targetAnimID); +s16 set_mario_anim_with_accel(struct MarioState* m, s32 targetAnimID, s32 accel) { + struct Object* o = m->marioObj; + struct Animation* targetAnim = GameEngine_LoadAnimation(targetAnimID); if (o->header.gfx.animInfo.animID != targetAnimID) { o->header.gfx.animInfo.animID = targetAnimID; @@ -124,9 +124,9 @@ s16 set_mario_anim_with_accel(struct MarioState *m, s32 targetAnimID, s32 accel) /** * Sets the animation to a specific "next" frame from the frame given. */ -void set_anim_to_frame(struct MarioState *m, s16 animFrame) { - struct AnimInfo *animInfo = &m->marioObj->header.gfx.animInfo; - struct Animation *curAnim = animInfo->curAnim; +void set_anim_to_frame(struct MarioState* m, s16 animFrame) { + struct AnimInfo* animInfo = &m->marioObj->header.gfx.animInfo; + struct Animation* curAnim = animInfo->curAnim; if (animInfo->animAccel != 0) { if (curAnim->flags & ANIM_FLAG_FORWARD) { @@ -143,21 +143,19 @@ void set_anim_to_frame(struct MarioState *m, s16 animFrame) { } } -s32 is_anim_past_frame(struct MarioState *m, s16 animFrame) { +s32 is_anim_past_frame(struct MarioState* m, s16 animFrame) { s32 isPastFrame; s32 acceleratedFrame = animFrame << 0x10; - struct AnimInfo *animInfo = &m->marioObj->header.gfx.animInfo; - struct Animation *curAnim = animInfo->curAnim; + struct AnimInfo* animInfo = &m->marioObj->header.gfx.animInfo; + struct Animation* curAnim = animInfo->curAnim; if (animInfo->animAccel != 0) { if (curAnim->flags & ANIM_FLAG_FORWARD) { - isPastFrame = - (animInfo->animFrameAccelAssist > acceleratedFrame) - && (acceleratedFrame >= (animInfo->animFrameAccelAssist - animInfo->animAccel)); + isPastFrame = (animInfo->animFrameAccelAssist > acceleratedFrame) && + (acceleratedFrame >= (animInfo->animFrameAccelAssist - animInfo->animAccel)); } else { - isPastFrame = - (animInfo->animFrameAccelAssist < acceleratedFrame) - && (acceleratedFrame <= (animInfo->animFrameAccelAssist + animInfo->animAccel)); + isPastFrame = (animInfo->animFrameAccelAssist < acceleratedFrame) && + (acceleratedFrame <= (animInfo->animFrameAccelAssist + animInfo->animAccel)); } } else { if (curAnim->flags & ANIM_FLAG_FORWARD) { @@ -174,17 +172,17 @@ s32 is_anim_past_frame(struct MarioState *m, s16 animFrame) { * Rotates the animation's translation into the global coordinate system * and returns the animation's flags. */ -s16 find_mario_anim_flags_and_translation(struct Object *obj, s32 yaw, Vec3s translation) { +s16 find_mario_anim_flags_and_translation(struct Object* obj, s32 yaw, Vec3s translation) { f32 dx; f32 dz; - struct Animation *curAnim = (void *) obj->header.gfx.animInfo.curAnim; + struct Animation* curAnim = (void*)obj->header.gfx.animInfo.curAnim; s16 animFrame = geo_update_animation_frame(&obj->header.gfx.animInfo, NULL); - u16 *animIndex = segmented_to_virtual((void *) curAnim->index); - s16 *animValues = segmented_to_virtual((void *) curAnim->values); + u16* animIndex = segmented_to_virtual((void*)curAnim->index); + s16* animValues = segmented_to_virtual((void*)curAnim->values); - f32 s = (f32) sins(yaw); - f32 c = (f32) coss(yaw); + f32 s = (f32)sins(yaw); + f32 c = (f32)coss(yaw); dx = *(animValues + (retrieve_animation_index(animFrame, &animIndex))) / 4.0f; translation[1] = *(animValues + (retrieve_animation_index(animFrame, &animIndex))) / 4.0f; @@ -199,26 +197,26 @@ s16 find_mario_anim_flags_and_translation(struct Object *obj, s32 yaw, Vec3s tra /** * Updates Mario's position from his animation's translation. */ -void update_mario_pos_for_anim(struct MarioState *m) { +void update_mario_pos_for_anim(struct MarioState* m) { Vec3s translation; s16 flags; flags = find_mario_anim_flags_and_translation(m->marioObj, m->faceAngle[1], translation); if (flags & (ANIM_FLAG_HOR_TRANS | ANIM_FLAG_6)) { - m->pos[0] += (f32) translation[0]; - m->pos[2] += (f32) translation[2]; + m->pos[0] += (f32)translation[0]; + m->pos[2] += (f32)translation[2]; } if (flags & (ANIM_FLAG_VERT_TRANS | ANIM_FLAG_6)) { - m->pos[1] += (f32) translation[1]; + m->pos[1] += (f32)translation[1]; } } /** * Finds the vertical translation from Mario's animation. */ -s16 return_mario_anim_y_translation(struct MarioState *m) { +s16 return_mario_anim_y_translation(struct MarioState* m) { Vec3s translation; find_mario_anim_flags_and_translation(m->marioObj, 0, translation); @@ -232,7 +230,7 @@ s16 return_mario_anim_y_translation(struct MarioState *m) { /** * Plays a sound if if Mario doesn't have the flag being checked. */ -void play_sound_if_no_flag(struct MarioState *m, u32 soundBits, u32 flags) { +void play_sound_if_no_flag(struct MarioState* m, u32 soundBits, u32 flags) { if (!(m->flags & flags)) { play_sound(soundBits, m->marioObj->header.gfx.cameraToObject); m->flags |= flags; @@ -242,14 +240,13 @@ void play_sound_if_no_flag(struct MarioState *m, u32 soundBits, u32 flags) { /** * Plays a jump sound if one has not been played since the last action change. */ -void play_mario_jump_sound(struct MarioState *m) { +void play_mario_jump_sound(struct MarioState* m) { if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) { if (!ROM_JP && m->action == ACT_TRIPLE_JUMP) { play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16), m->marioObj->header.gfx.cameraToObject); } else { - play_sound(SOUND_MARIO_YAH_WAH_HOO + ((gAudioRandom % 3) << 16), - m->marioObj->header.gfx.cameraToObject); + play_sound(SOUND_MARIO_YAH_WAH_HOO + ((gAudioRandom % 3) << 16), m->marioObj->header.gfx.cameraToObject); } m->flags |= MARIO_MARIO_SOUND_PLAYED; } @@ -258,7 +255,7 @@ void play_mario_jump_sound(struct MarioState *m) { /** * Adjusts the volume/pitch of sounds from Mario's speed. */ -void adjust_sound_for_speed(struct MarioState *m) { +void adjust_sound_for_speed(struct MarioState* m) { s32 absForwardVel = (m->forwardVel > 0.0f) ? m->forwardVel : -m->forwardVel; set_sound_moving_speed(SOUND_BANK_MOVING, (absForwardVel > 100) ? 100 : absForwardVel); } @@ -266,7 +263,7 @@ void adjust_sound_for_speed(struct MarioState *m) { /** * Spawns particles if the step sound says to, then either plays a step sound or relevant other sound. */ -void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 waveParticleType) { +void play_sound_and_spawn_particles(struct MarioState* m, u32 soundBits, u32 waveParticleType) { if (m->terrainSoundAddend == (SOUND_TERRAIN_WATER << 16)) { if (waveParticleType != 0) { m->particleFlags |= PARTICLE_SHALLOW_WATER_SPLASH; @@ -281,8 +278,8 @@ void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 wav } } - if ((m->flags & MARIO_METAL_CAP) || soundBits == SOUND_ACTION_UNSTUCK_FROM_GROUND - || soundBits == SOUND_MARIO_PUNCH_HOO) { + if ((m->flags & MARIO_METAL_CAP) || soundBits == SOUND_ACTION_UNSTUCK_FROM_GROUND || + soundBits == SOUND_MARIO_PUNCH_HOO) { play_sound(soundBits, m->marioObj->header.gfx.cameraToObject); } else { play_sound(m->terrainSoundAddend + soundBits, m->marioObj->header.gfx.cameraToObject); @@ -292,7 +289,7 @@ void play_sound_and_spawn_particles(struct MarioState *m, u32 soundBits, u32 wav /** * Plays an environmental sound if one has not been played since the last action change. */ -void play_mario_action_sound(struct MarioState *m, u32 soundBits, u32 waveParticleType) { +void play_mario_action_sound(struct MarioState* m, u32 soundBits, u32 waveParticleType) { if (!(m->flags & MARIO_ACTION_SOUND_PLAYED)) { play_sound_and_spawn_particles(m, soundBits, waveParticleType); m->flags |= MARIO_ACTION_SOUND_PLAYED; @@ -302,9 +299,8 @@ void play_mario_action_sound(struct MarioState *m, u32 soundBits, u32 wavePartic /** * Plays a landing sound, accounting for metal cap. */ -void play_mario_landing_sound(struct MarioState *m, u32 soundBits) { - play_sound_and_spawn_particles( - m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_LANDING : soundBits, 1); +void play_mario_landing_sound(struct MarioState* m, u32 soundBits) { + play_sound_and_spawn_particles(m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_LANDING : soundBits, 1); } /** @@ -312,17 +308,15 @@ void play_mario_landing_sound(struct MarioState *m, u32 soundBits) { * this function uses play_mario_action_sound, making sure the sound is only * played once per action. */ -void play_mario_landing_sound_once(struct MarioState *m, u32 soundBits) { - play_mario_action_sound( - m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_LANDING : soundBits, 1); +void play_mario_landing_sound_once(struct MarioState* m, u32 soundBits) { + play_mario_action_sound(m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_LANDING : soundBits, 1); } /** * Plays a heavy landing (ground pound, etc.) sound, accounting for metal cap. */ -void play_mario_heavy_landing_sound(struct MarioState *m, u32 soundBits) { - play_sound_and_spawn_particles( - m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_HEAVY_LANDING : soundBits, 1); +void play_mario_heavy_landing_sound(struct MarioState* m, u32 soundBits) { + play_sound_and_spawn_particles(m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_HEAVY_LANDING : soundBits, 1); } /** @@ -330,18 +324,17 @@ void play_mario_heavy_landing_sound(struct MarioState *m, u32 soundBits) { * Unlike play_mario_heavy_landing_sound, this function uses play_mario_action_sound, * making sure the sound is only played once per action. */ -void play_mario_heavy_landing_sound_once(struct MarioState *m, u32 soundBits) { - play_mario_action_sound( - m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_HEAVY_LANDING : soundBits, 1); +void play_mario_heavy_landing_sound_once(struct MarioState* m, u32 soundBits) { + play_mario_action_sound(m, (m->flags & MARIO_METAL_CAP) ? SOUND_ACTION_METAL_HEAVY_LANDING : soundBits, 1); } /** * Plays action and Mario sounds relevant to what was passed into the function. */ -void play_mario_sound(struct MarioState *m, s32 actionSound, s32 marioSound) { +void play_mario_sound(struct MarioState* m, s32 actionSound, s32 marioSound) { if (actionSound == SOUND_ACTION_TERRAIN_JUMP) { - play_mario_action_sound(m, (m->flags & MARIO_METAL_CAP) ? (s32) SOUND_ACTION_METAL_JUMP - : (s32) SOUND_ACTION_TERRAIN_JUMP, 1); + play_mario_action_sound( + m, (m->flags & MARIO_METAL_CAP) ? (s32)SOUND_ACTION_METAL_JUMP : (s32)SOUND_ACTION_TERRAIN_JUMP, 1); } else { play_sound_if_no_flag(m, actionSound, MARIO_ACTION_SOUND_PLAYED); } @@ -362,20 +355,20 @@ void play_mario_sound(struct MarioState *m, s32 actionSound, s32 marioSound) { /** * Sets Mario's other velocities from his forward speed. */ -void mario_set_forward_vel(struct MarioState *m, f32 forwardVel) { +void mario_set_forward_vel(struct MarioState* m, f32 forwardVel) { m->forwardVel = forwardVel; m->slideVelX = sins(m->faceAngle[1]) * m->forwardVel; m->slideVelZ = coss(m->faceAngle[1]) * m->forwardVel; - m->vel[0] = (f32) m->slideVelX; - m->vel[2] = (f32) m->slideVelZ; + m->vel[0] = (f32)m->slideVelX; + m->vel[2] = (f32)m->slideVelZ; } /** * Returns the slipperiness class of Mario's floor. */ -s32 mario_get_floor_class(struct MarioState *m) { +s32 mario_get_floor_class(struct MarioState* m) { s32 floorClass; // The slide terrain type defaults to slide slipperiness. @@ -447,7 +440,7 @@ s8 sTerrainSounds[7][6] = { * Computes a value that should be added to terrain sounds before playing them. * This depends on surfaces and terrain. */ -u32 mario_get_terrain_sound_addend(struct MarioState *m) { +u32 mario_get_terrain_sound_addend(struct MarioState* m) { s16 floorSoundType; s16 terrainType = m->area->terrainType & TERRAIN_MASK; s32 ret = SOUND_TERRAIN_DEFAULT << 16; @@ -509,9 +502,9 @@ u32 mario_get_terrain_sound_addend(struct MarioState *m) { /** * Collides with walls and returns the most recent wall. */ -struct Surface *resolve_and_return_wall_collisions(Vec3f pos, f32 offset, f32 radius) { +struct Surface* resolve_and_return_wall_collisions(Vec3f pos, f32 offset, f32 radius) { struct WallCollisionData collisionData; - struct Surface *wall = NULL; + struct Surface* wall = NULL; collisionData.x = pos[0]; collisionData.y = pos[1]; @@ -535,7 +528,7 @@ struct Surface *resolve_and_return_wall_collisions(Vec3f pos, f32 offset, f32 ra /** * Finds the ceiling from a vec3f horizontally and a height (with 80 vertical buffer). */ -f32 vec3f_find_ceil(Vec3f pos, f32 height, struct Surface **ceil) { +f32 vec3f_find_ceil(Vec3f pos, f32 height, struct Surface** ceil) { UNUSED u8 filler[4]; return find_ceil(pos[0], height + 80.0f, pos[2], ceil); @@ -544,7 +537,7 @@ f32 vec3f_find_ceil(Vec3f pos, f32 height, struct Surface **ceil) { /** * Determines if Mario is facing "downhill." */ -s32 mario_facing_downhill(struct MarioState *m, s32 turnYaw) { +s32 mario_facing_downhill(struct MarioState* m, s32 turnYaw) { s16 faceAngleYaw = m->faceAngle[1]; // This is never used in practice, as turnYaw is @@ -561,11 +554,10 @@ s32 mario_facing_downhill(struct MarioState *m, s32 turnYaw) { /** * Determines if a surface is slippery based on the surface class. */ -u32 mario_floor_is_slippery(struct MarioState *m) { +u32 mario_floor_is_slippery(struct MarioState* m) { f32 normY; - if ((m->area->terrainType & TERRAIN_MASK) == TERRAIN_SLIDE - && m->floor->normal.y < 0.9998477f //~cos(1 deg) + if ((m->area->terrainType & TERRAIN_MASK) == TERRAIN_SLIDE && m->floor->normal.y < 0.9998477f //~cos(1 deg) ) { return TRUE; } @@ -594,11 +586,10 @@ u32 mario_floor_is_slippery(struct MarioState *m) { /** * Determines if a surface is a slope based on the surface class. */ -s32 mario_floor_is_slope(struct MarioState *m) { +s32 mario_floor_is_slope(struct MarioState* m) { f32 normY; - if ((m->area->terrainType & TERRAIN_MASK) == TERRAIN_SLIDE - && m->floor->normal.y < 0.9998477f) { // ~cos(1 deg) + if ((m->area->terrainType & TERRAIN_MASK) == TERRAIN_SLIDE && m->floor->normal.y < 0.9998477f) { // ~cos(1 deg) return TRUE; } @@ -626,7 +617,7 @@ s32 mario_floor_is_slope(struct MarioState *m) { /** * Determines if a surface is steep based on the surface class. */ -s32 mario_floor_is_steep(struct MarioState *m) { +s32 mario_floor_is_steep(struct MarioState* m) { f32 normY; s32 result = FALSE; @@ -662,8 +653,8 @@ s32 mario_floor_is_steep(struct MarioState *m) { /** * Finds the floor height relative from Mario given polar displacement. */ -f32 find_floor_height_relative_polar(struct MarioState *m, s16 angleFromMario, f32 distFromMario) { - struct Surface *floor; +f32 find_floor_height_relative_polar(struct MarioState* m, s16 angleFromMario, f32 distFromMario) { + struct Surface* floor; f32 floorY; f32 y = sins(m->faceAngle[1] + angleFromMario) * distFromMario; @@ -677,8 +668,8 @@ f32 find_floor_height_relative_polar(struct MarioState *m, s16 angleFromMario, f /** * Returns the slope of the floor based off points around Mario. */ -s16 find_floor_slope(struct MarioState *m, s16 yawOffset) { - struct Surface *floor; +s16 find_floor_slope(struct MarioState* m, s16 yawOffset) { + struct Surface* floor; f32 forwardFloorY, backwardFloorY; f32 forwardYDelta, backwardYDelta; s16 result; @@ -706,7 +697,7 @@ s16 find_floor_slope(struct MarioState *m, s16 yawOffset) { /** * Adjusts Mario's camera and sound based on his action status. */ -void update_mario_sound_and_camera(struct MarioState *m) { +void update_mario_sound_and_camera(struct MarioState* m) { u32 action = m->action; s32 camPreset = m->area->camera->mode; @@ -729,7 +720,7 @@ void update_mario_sound_and_camera(struct MarioState *m) { /** * Transitions Mario to a steep jump action. */ -void set_steep_jump_action(struct MarioState *m) { +void set_steep_jump_action(struct MarioState* m) { m->marioObj->oMarioSteepJumpYaw = m->faceAngle[1]; if (m->forwardVel > 0.0f) { @@ -751,7 +742,7 @@ void set_steep_jump_action(struct MarioState *m) { /** * Sets Mario's vertical speed from his forward speed. */ -static void set_mario_y_vel_based_on_fspeed(struct MarioState *m, f32 initialVelY, f32 multiplier) { +static void set_mario_y_vel_based_on_fspeed(struct MarioState* m, f32 initialVelY, f32 multiplier) { // get_additive_y_vel_for_jumps is always 0 and a stubbed function. // It was likely trampoline related based on code location. m->vel[1] = initialVelY + get_additive_y_vel_for_jumps() + m->forwardVel * multiplier; @@ -764,11 +755,10 @@ static void set_mario_y_vel_based_on_fspeed(struct MarioState *m, f32 initialVel /** * Transitions for a variety of airborne actions. */ -static u32 set_mario_action_airborne(struct MarioState *m, u32 action, u32 actionArg) { +static u32 set_mario_action_airborne(struct MarioState* m, u32 action, u32 actionArg) { f32 forwardVel; - if ((m->squishTimer != 0 || m->quicksandDepth >= 1.0f) - && (action == ACT_DOUBLE_JUMP || action == ACT_TWIRLING)) { + if ((m->squishTimer != 0 || m->quicksandDepth >= 1.0f) && (action == ACT_DOUBLE_JUMP || action == ACT_TWIRLING)) { action = ACT_JUMP; } @@ -884,7 +874,7 @@ static u32 set_mario_action_airborne(struct MarioState *m, u32 action, u32 actio /** * Transitions for a variety of moving actions. */ -static u32 set_mario_action_moving(struct MarioState *m, u32 action, UNUSED u32 actionArg) { +static u32 set_mario_action_moving(struct MarioState* m, u32 action, UNUSED u32 actionArg) { s16 floorClass = mario_get_floor_class(m); f32 forwardVel = m->forwardVel; f32 mag = min(m->intendedMag, 8.0f); @@ -929,7 +919,7 @@ static u32 set_mario_action_moving(struct MarioState *m, u32 action, UNUSED u32 /** * Transition for certain submerged actions, which is actually just the metal jump actions. */ -static u32 set_mario_action_submerged(struct MarioState *m, u32 action, UNUSED u32 actionArg) { +static u32 set_mario_action_submerged(struct MarioState* m, u32 action, UNUSED u32 actionArg) { if (action == ACT_METAL_WATER_JUMP || action == ACT_HOLD_METAL_WATER_JUMP) { m->vel[1] = 32.0f; } @@ -940,7 +930,7 @@ static u32 set_mario_action_submerged(struct MarioState *m, u32 action, UNUSED u /** * Transitions for a variety of cutscene actions. */ -static u32 set_mario_action_cutscene(struct MarioState *m, u32 action, UNUSED u32 actionArg) { +static u32 set_mario_action_cutscene(struct MarioState* m, u32 action, UNUSED u32 actionArg) { switch (action) { case ACT_EMERGE_FROM_PIPE: m->vel[1] = 52.0f; @@ -967,7 +957,7 @@ static u32 set_mario_action_cutscene(struct MarioState *m, u32 action, UNUSED u3 * Puts Mario into a given action, putting Mario through the appropriate * specific function if needed. */ -u32 set_mario_action(struct MarioState *m, u32 action, u32 actionArg) { +u32 set_mario_action(struct MarioState* m, u32 action, u32 actionArg) { switch (action & ACT_GROUP_MASK) { case ACT_GROUP_MOVING: action = set_mario_action_moving(m, action, actionArg); @@ -1006,7 +996,7 @@ u32 set_mario_action(struct MarioState *m, u32 action, u32 actionArg) { /** * Puts Mario into a specific jumping action from a landing action. */ -s32 set_jump_from_landing(struct MarioState *m) { +s32 set_jump_from_landing(struct MarioState* m) { if (m->quicksandDepth >= 11.0f) { if (m->heldObj == NULL) { return set_mario_action(m, ACT_QUICKSAND_JUMP_LAND, 0); @@ -1062,7 +1052,7 @@ s32 set_jump_from_landing(struct MarioState *m) { * Puts Mario in a given action, as long as it is not overruled by * either a quicksand or steep jump. */ -s32 set_jumping_action(struct MarioState *m, u32 action, u32 actionArg) { +s32 set_jumping_action(struct MarioState* m, u32 action, u32 actionArg) { UNUSED u32 currAction = m->action; if (m->quicksandDepth >= 11.0f) { @@ -1086,7 +1076,7 @@ s32 set_jumping_action(struct MarioState *m, u32 action, u32 actionArg) { /** * Drop anything Mario is holding and set a new action. */ -s32 drop_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg) { +s32 drop_and_set_mario_action(struct MarioState* m, u32 action, u32 actionArg) { mario_stop_riding_and_holding(m); return set_mario_action(m, action, actionArg); @@ -1095,7 +1085,7 @@ s32 drop_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg) { /** * Increment Mario's hurt counter and set a new action. */ -s32 hurt_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg, s16 hurtCounter) { +s32 hurt_and_set_mario_action(struct MarioState* m, u32 action, u32 actionArg, s16 hurtCounter) { m->hurtCounter = hurtCounter; return set_mario_action(m, action, actionArg); @@ -1105,7 +1095,7 @@ s32 hurt_and_set_mario_action(struct MarioState *m, u32 action, u32 actionArg, s * Checks a variety of inputs for common transitions between many different * actions. A common variant of the below function. */ -s32 check_common_action_exits(struct MarioState *m) { +s32 check_common_action_exits(struct MarioState* m) { if (m->input & INPUT_A_PRESSED) { return set_mario_action(m, ACT_JUMP, 0); } @@ -1126,7 +1116,7 @@ s32 check_common_action_exits(struct MarioState *m) { * Checks a variety of inputs for common transitions between many different * object holding actions. A holding variant of the above function. */ -s32 check_common_hold_action_exits(struct MarioState *m) { +s32 check_common_hold_action_exits(struct MarioState* m) { if (m->input & INPUT_A_PRESSED) { return set_mario_action(m, ACT_HOLD_JUMP, 0); } @@ -1146,7 +1136,7 @@ s32 check_common_hold_action_exits(struct MarioState *m) { /** * Transitions Mario from a submerged action to a walking action. */ -s32 transition_submerged_to_walking(struct MarioState *m) { +s32 transition_submerged_to_walking(struct MarioState* m) { set_camera_mode(m->area->camera, m->area->camera->defMode, 1); vec3s_set(m->angleVel, 0, 0, 0); @@ -1162,7 +1152,7 @@ s32 transition_submerged_to_walking(struct MarioState *m) { * This is the transition function typically for entering a submerged action for a * non-submerged action. This also applies the water surface camera preset. */ -s32 set_water_plunge_action(struct MarioState *m) { +s32 set_water_plunge_action(struct MarioState* m) { m->forwardVel = m->forwardVel / 4.0f; m->vel[1] = m->vel[1] / 2.0f; @@ -1193,7 +1183,7 @@ u8 sSquishScaleOverTime[16] = { 0x46, 0x32, 0x32, 0x3C, 0x46, 0x50, 0x50, 0x3C, /** * Applies the squish to Mario's model via scaling. */ -void squish_mario_model(struct MarioState *m) { +void squish_mario_model(struct MarioState* m) { if (m->squishTimer != 0xFF) { // If no longer squished, scale back to default. if (m->squishTimer == 0) { @@ -1203,10 +1193,8 @@ void squish_mario_model(struct MarioState *m) { else if (m->squishTimer <= 16) { m->squishTimer -= 1; - m->marioObj->header.gfx.scale[1] = - 1.0f - ((sSquishScaleOverTime[15 - m->squishTimer] * 0.6f) / 100.0f); - m->marioObj->header.gfx.scale[0] = - ((sSquishScaleOverTime[15 - m->squishTimer] * 0.4f) / 100.0f) + 1.0f; + m->marioObj->header.gfx.scale[1] = 1.0f - ((sSquishScaleOverTime[15 - m->squishTimer] * 0.6f) / 100.0f); + m->marioObj->header.gfx.scale[0] = ((sSquishScaleOverTime[15 - m->squishTimer] * 0.4f) / 100.0f) + 1.0f; m->marioObj->header.gfx.scale[2] = m->marioObj->header.gfx.scale[0]; } else { @@ -1220,13 +1208,12 @@ void squish_mario_model(struct MarioState *m) { /** * Debug function that prints floor normal, velocity, and action information. */ -void debug_print_speed_action_normal(struct MarioState *m) { +void debug_print_speed_action_normal(struct MarioState* m) { f32 steepness; f32 floor_nY; if (gShowDebugText) { - steepness = sqrtf( - ((m->floor->normal.x * m->floor->normal.x) + (m->floor->normal.z * m->floor->normal.z))); + steepness = sqrtf(((m->floor->normal.x * m->floor->normal.x) + (m->floor->normal.z * m->floor->normal.z))); floor_nY = m->floor->normal.y; print_text_fmt_int(210, 88, "ANG %d", (atan2s(floor_nY, steepness) * 180.0f) / 32768.0f); @@ -1241,7 +1228,7 @@ void debug_print_speed_action_normal(struct MarioState *m) { /** * Update the button inputs for Mario. */ -void update_mario_button_inputs(struct MarioState *m) { +void update_mario_button_inputs(struct MarioState* m) { if (m->controller->buttonPressed & A_BUTTON) { m->input |= INPUT_A_PRESSED; } @@ -1281,8 +1268,8 @@ void update_mario_button_inputs(struct MarioState *m) { /** * Updates the joystick intended magnitude. */ -void update_mario_joystick_inputs(struct MarioState *m) { - struct Controller *controller = m->controller; +void update_mario_joystick_inputs(struct MarioState* m) { + struct Controller* controller = m->controller; f32 mag = ((controller->stickMag / 64.0f) * (controller->stickMag / 64.0f)) * 64.0f; if (m->squishTimer == 0) { @@ -1302,7 +1289,7 @@ void update_mario_joystick_inputs(struct MarioState *m) { /** * Resolves wall collisions, and updates a variety of inputs. */ -void update_mario_geometry_inputs(struct MarioState *m) { +void update_mario_geometry_inputs(struct MarioState* m) { f32 gasLevel; f32 ceilToFloorDist; @@ -1332,8 +1319,7 @@ void update_mario_geometry_inputs(struct MarioState *m) { m->input |= INPUT_ABOVE_SLIDE; } - if ((m->floor->flags & SURFACE_FLAG_DYNAMIC) - || (m->ceil && m->ceil->flags & SURFACE_FLAG_DYNAMIC)) { + if ((m->floor->flags & SURFACE_FLAG_DYNAMIC) || (m->ceil && m->ceil->flags & SURFACE_FLAG_DYNAMIC)) { ceilToFloorDist = m->ceilHeight - m->floorHeight; if ((0.0f <= ceilToFloorDist) && (ceilToFloorDist <= 150.0f)) { @@ -1361,7 +1347,7 @@ void update_mario_geometry_inputs(struct MarioState *m) { /** * Handles Mario's input flags as well as a couple timers. */ -void update_mario_inputs(struct MarioState *m) { +void update_mario_inputs(struct MarioState* m) { m->particleFlags = 0; m->input = 0; m->collidedObjInteractTypes = m->marioObj->collidedObjInteractTypes; @@ -1386,8 +1372,8 @@ void update_mario_inputs(struct MarioState *m) { } // These 3 flags are defined by Bowser stomping attacks - if (m->marioObj->oInteractStatus - & (INT_STATUS_MARIO_STUNNED | INT_STATUS_MARIO_KNOCKBACK_DMG | INT_STATUS_MARIO_SHOCKWAVE)) { + if (m->marioObj->oInteractStatus & + (INT_STATUS_MARIO_STUNNED | INT_STATUS_MARIO_KNOCKBACK_DMG | INT_STATUS_MARIO_SHOCKWAVE)) { m->input |= INPUT_STOMPED; } @@ -1407,7 +1393,7 @@ void update_mario_inputs(struct MarioState *m) { /** * Set's the camera preset for submerged action behaviors. */ -void set_submerged_cam_preset_and_spawn_bubbles(struct MarioState *m) { +void set_submerged_cam_preset_and_spawn_bubbles(struct MarioState* m) { f32 heightBelowWater; s16 camPreset; @@ -1442,12 +1428,12 @@ void set_submerged_cam_preset_and_spawn_bubbles(struct MarioState *m) { /** * Both increments and decrements Mario's HP. */ -void update_mario_health(struct MarioState *m) { +void update_mario_health(struct MarioState* m) { s32 terrainIsSnow; if (m->health >= 0x100) { // When already healing or hurting Mario, Mario's HP is not changed any more here. - if (((u32) m->healCounter | (u32) m->hurtCounter) == 0) { + if (((u32)m->healCounter | (u32)m->hurtCounter) == 0) { if ((m->input & INPUT_IN_POISON_GAS) && !(m->action & ACT_FLAG_INTANGIBLE)) { if (!(m->flags & MARIO_METAL_CAP) && !gDebugLevelSelect) { s32 amount = -4; @@ -1519,7 +1505,7 @@ void update_mario_health(struct MarioState *m) { /** * Updates some basic info for camera usage. */ -void update_mario_info_for_cam(struct MarioState *m) { +void update_mario_info_for_cam(struct MarioState* m) { m->marioBodyState->action = m->action; m->statusForCamera->action = m->action; @@ -1533,8 +1519,8 @@ void update_mario_info_for_cam(struct MarioState *m) { /** * Resets Mario's model, done every time an action is executed. */ -void mario_reset_bodystate(struct MarioState *m) { - struct MarioBodyState *bodyState = m->marioBodyState; +void mario_reset_bodystate(struct MarioState* m) { + struct MarioBodyState* bodyState = m->marioBodyState; bodyState->capState = MARIO_HAS_DEFAULT_CAP_OFF; bodyState->eyeState = MARIO_EYES_BLINK; @@ -1548,8 +1534,8 @@ void mario_reset_bodystate(struct MarioState *m) { /** * Adjusts Mario's graphical height for quicksand. */ -void sink_mario_in_quicksand(struct MarioState *m) { - struct Object *o = m->marioObj; +void sink_mario_in_quicksand(struct MarioState* m) { + struct Object* o = m->marioObj; if (o->header.gfx.throwMatrix) { (*o->header.gfx.throwMatrix)[3][1] -= m->quicksandDepth; @@ -1570,16 +1556,15 @@ u64 sCapFlickerFrames = 0x4444449249255555; /** * Updates the cap flags mainly based on the cap timer. */ -u32 update_and_return_cap_flags(struct MarioState *m) { +u32 update_and_return_cap_flags(struct MarioState* m) { u32 flags = m->flags; u32 action; if (m->capTimer > 0) { action = m->action; - if ((m->capTimer <= 60) - || ((action != ACT_READING_AUTOMATIC_DIALOG) && (action != ACT_READING_NPC_DIALOG) - && (action != ACT_READING_SIGN) && (action != ACT_IN_CANNON))) { + if ((m->capTimer <= 60) || ((action != ACT_READING_AUTOMATIC_DIALOG) && (action != ACT_READING_NPC_DIALOG) && + (action != ACT_READING_SIGN) && (action != ACT_IN_CANNON))) { m->capTimer -= 1; } @@ -1612,8 +1597,8 @@ u32 update_and_return_cap_flags(struct MarioState *m) { /** * Updates the Mario's cap, rendering, and hitbox. */ -void mario_update_hitbox_and_cap_model(struct MarioState *m) { - struct MarioBodyState *bodyState = m->marioBodyState; +void mario_update_hitbox_and_cap_model(struct MarioState* m) { + struct MarioBodyState* bodyState = m->marioBodyState; s32 flags = update_and_return_cap_flags(m); if (flags & MARIO_VANISH_CAP) { @@ -1672,8 +1657,8 @@ UNUSED static void debug_update_mario_cap(u16 button, s32 flags, u16 capTimer, u // This checks for Z_TRIG instead of Z_DOWN flag // (which is also what other debug functions do), // so likely debug behavior rather than unused behavior. - if ((gPlayer1Controller->buttonDown & Z_TRIG) && (gPlayer1Controller->buttonPressed & button) - && !(gMarioState->flags & flags)) { + if ((gPlayer1Controller->buttonDown & Z_TRIG) && (gPlayer1Controller->buttonPressed & button) && + !(gMarioState->flags & flags)) { gMarioState->flags |= (flags + MARIO_CAP_ON_HEAD); if (capTimer > gMarioState->capTimer) { @@ -1702,7 +1687,7 @@ void func_sh_8025574C(void) { /** * Main function for executing Mario's behavior. */ -s32 execute_mario_action(UNUSED struct Object *o) { +s32 execute_mario_action(UNUSED struct Object* o) { s32 inLoop = TRUE; if (gMarioState->action) { @@ -1763,14 +1748,14 @@ s32 execute_mario_action(UNUSED struct Object *o) { // non-Japanese releases. if (gMarioState->floor->type == SURFACE_HORIZONTAL_WIND) { spawn_wind_particles(0, (gMarioState->floor->force << 8)); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_ENV_WIND2, gMarioState->marioObj->header.gfx.cameraToObject); } } if (gMarioState->floor->type == SURFACE_VERTICAL_WIND) { spawn_wind_particles(1, 0); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_ENV_WIND2, gMarioState->marioObj->header.gfx.cameraToObject); } } @@ -1793,7 +1778,7 @@ s32 execute_mario_action(UNUSED struct Object *o) { void init_mario(void) { Vec3s capPos; - struct Object *capObject; + struct Object* capObject; unused80339F10 = 0; @@ -1803,9 +1788,8 @@ void init_mario(void) { gMarioState->invincTimer = 0; - if (save_file_get_flags() - & (SAVE_FLAG_CAP_ON_GROUND | SAVE_FLAG_CAP_ON_KLEPTO | SAVE_FLAG_CAP_ON_UKIKI - | SAVE_FLAG_CAP_ON_MR_BLIZZARD)) { + if (save_file_get_flags() & + (SAVE_FLAG_CAP_ON_GROUND | SAVE_FLAG_CAP_ON_KLEPTO | SAVE_FLAG_CAP_ON_UKIKI | SAVE_FLAG_CAP_ON_MR_BLIZZARD)) { gMarioState->flags = 0; } else { gMarioState->flags = (MARIO_NORMAL_CAP | MARIO_CAP_ON_HEAD); @@ -1824,8 +1808,7 @@ void init_mario(void) { gMarioState->riddenObj = NULL; gMarioState->usedObj = NULL; - gMarioState->waterLevel = - find_water_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]); + gMarioState->waterLevel = find_water_level(gMarioSpawnInfo->startPos[0], gMarioSpawnInfo->startPos[2]); gMarioState->area = gCurrentArea; gMarioState->marioObj = gMarioObject; @@ -1843,8 +1826,7 @@ void init_mario(void) { gMarioState->marioObj->header.gfx.pos[1] = gMarioState->pos[1]; - gMarioState->action = - (gMarioState->pos[1] <= (gMarioState->waterLevel - 100)) ? ACT_WATER_IDLE : ACT_IDLE; + gMarioState->action = (gMarioState->pos[1] <= (gMarioState->waterLevel - 100)) ? ACT_WATER_IDLE : ACT_IDLE; mario_reset_bodystate(gMarioState); update_mario_info_for_cam(gMarioState); @@ -1884,8 +1866,7 @@ void init_mario_from_save_file(void) { gMarioState->controller = &gControllers[0]; gMarioState->numCoins = 0; - gMarioState->numStars = - save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1); + gMarioState->numStars = save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1); gMarioState->numKeys = 0; gMarioState->numLives = 4; diff --git a/src/game/mario_actions_airborne.c b/src/game/mario_actions_airborne.c index a2865694..ba770d13 100644 --- a/src/game/mario_actions_airborne.c +++ b/src/game/mario_actions_airborne.c @@ -14,17 +14,17 @@ #include "save_file.h" #include "rumble_init.h" -void play_flip_sounds(struct MarioState *m, s16 frame1, s16 frame2, s16 frame3) { +void play_flip_sounds(struct MarioState* m, s16 frame1, s16 frame2, s16 frame3) { s32 animFrame = m->marioObj->header.gfx.animInfo.animFrame; if (animFrame == frame1 || animFrame == frame2 || animFrame == frame3) { play_sound(SOUND_ACTION_SPIN, m->marioObj->header.gfx.cameraToObject); } } -void play_far_fall_sound(struct MarioState *m) { +void play_far_fall_sound(struct MarioState* m) { u32 action = m->action; - if (!(action & ACT_FLAG_INVULNERABLE) && action != ACT_TWIRLING && action != ACT_FLYING - && !(m->flags & MARIO_UNKNOWN_18)) { + if (!(action & ACT_FLAG_INVULNERABLE) && action != ACT_TWIRLING && action != ACT_FLYING && + !(m->flags & MARIO_UNKNOWN_18)) { if (m->peakHeight - m->pos[1] > 1150.0f) { play_sound(SOUND_MARIO_WAAAOOOW, m->marioObj->header.gfx.cameraToObject); m->flags |= MARIO_UNKNOWN_18; @@ -32,7 +32,7 @@ void play_far_fall_sound(struct MarioState *m) { } } -void play_knockback_sound(struct MarioState *m) { +void play_knockback_sound(struct MarioState* m) { if (m->actionArg == 0 && (m->forwardVel <= -28.0f || m->forwardVel >= 28.0f)) { play_sound_if_no_flag(m, SOUND_MARIO_DOH, MARIO_MARIO_SOUND_PLAYED); } else { @@ -40,7 +40,7 @@ void play_knockback_sound(struct MarioState *m) { } } -s32 lava_boost_on_wall(struct MarioState *m) { +s32 lava_boost_on_wall(struct MarioState* m) { m->faceAngle[1] = atan2s(m->wall->normal.z, m->wall->normal.x); if (m->forwardVel < 24.0f) { @@ -56,7 +56,7 @@ s32 lava_boost_on_wall(struct MarioState *m) { return drop_and_set_mario_action(m, ACT_LAVA_BOOST, 1); } -s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) { +s32 check_fall_damage(struct MarioState* m, u32 hardFallAction) { f32 fallHeight; f32 damageHeight; @@ -103,21 +103,21 @@ s32 check_fall_damage(struct MarioState *m, u32 hardFallAction) { return FALSE; } -s32 check_kick_or_dive_in_air(struct MarioState *m) { +s32 check_kick_or_dive_in_air(struct MarioState* m) { if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, m->forwardVel > 28.0f ? ACT_DIVE : ACT_JUMP_KICK, 0); } return FALSE; } -s32 should_get_stuck_in_ground(struct MarioState *m) { +s32 should_get_stuck_in_ground(struct MarioState* m) { u32 terrainType = m->area->terrainType & TERRAIN_MASK; - struct Surface *floor = m->floor; + struct Surface* floor = m->floor; s32 flags = floor->flags; s32 type = floor->type; - if (floor != NULL && (terrainType == TERRAIN_SNOW || terrainType == TERRAIN_SAND) - && type != SURFACE_BURNING && SURFACE_IS_NOT_HARD(type)) { + if (floor != NULL && (terrainType == TERRAIN_SNOW || terrainType == TERRAIN_SAND) && type != SURFACE_BURNING && + SURFACE_IS_NOT_HARD(type)) { if (!(flags & 0x01) && m->peakHeight - m->pos[1] > 1000.0f && floor->normal.y >= 0.8660254f) { return TRUE; } @@ -126,7 +126,7 @@ s32 should_get_stuck_in_ground(struct MarioState *m) { return FALSE; } -s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) { +s32 check_fall_damage_or_get_stuck(struct MarioState* m, u32 hardFallAction) { if (should_get_stuck_in_ground(m)) { play_sound(ROM_JP ? SOUND_MARIO_OOOF : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject); m->particleFlags |= PARTICLE_MIST_CIRCLE; @@ -140,8 +140,8 @@ s32 check_fall_damage_or_get_stuck(struct MarioState *m, u32 hardFallAction) { return check_fall_damage(m, hardFallAction); } -s32 check_horizontal_wind(struct MarioState *m) { - struct Surface *floor; +s32 check_horizontal_wind(struct MarioState* m) { + struct Surface* floor; f32 speed; s16 pushAngle; @@ -168,7 +168,7 @@ s32 check_horizontal_wind(struct MarioState *m) { m->slideYaw = atan2s(m->slideVelZ, m->slideVelX); m->forwardVel = speed * coss(m->faceAngle[1] - m->slideYaw); - if(ROM_JP) { + if (ROM_JP) { play_sound(SOUND_ENV_WIND2, m->marioObj->header.gfx.cameraToObject); } return TRUE; @@ -177,7 +177,7 @@ s32 check_horizontal_wind(struct MarioState *m) { return FALSE; } -void update_air_with_turn(struct MarioState *m) { +void update_air_with_turn(struct MarioState* m) { f32 dragThreshold; s16 intendedDYaw; f32 intendedMag; @@ -207,7 +207,7 @@ void update_air_with_turn(struct MarioState *m) { } } -void update_air_without_turn(struct MarioState *m) { +void update_air_without_turn(struct MarioState* m) { f32 sidewaysSpeed = 0.0f; f32 dragThreshold; s16 intendedDYaw; @@ -244,7 +244,7 @@ void update_air_without_turn(struct MarioState *m) { } } -void update_lava_boost_or_twirling(struct MarioState *m) { +void update_lava_boost_or_twirling(struct MarioState* m) { s16 intendedDYaw; f32 intendedMag; @@ -269,7 +269,7 @@ void update_lava_boost_or_twirling(struct MarioState *m) { m->vel[2] = m->slideVelZ = m->forwardVel * coss(m->faceAngle[1]); } -void update_flying_yaw(struct MarioState *m) { +void update_flying_yaw(struct MarioState* m) { s16 targetYawVel = -(s16)(m->controller->stickX * (m->forwardVel / 4.0f)); if (targetYawVel > 0) { @@ -298,7 +298,7 @@ void update_flying_yaw(struct MarioState *m) { m->faceAngle[2] = 20 * -m->angleVel[1]; } -void update_flying_pitch(struct MarioState *m) { +void update_flying_pitch(struct MarioState* m) { s16 targetPitchVel = -(s16)(m->controller->stickY * (m->forwardVel / 5.0f)); if (targetPitchVel > 0) { @@ -324,13 +324,13 @@ void update_flying_pitch(struct MarioState *m) { } } -void update_flying(struct MarioState *m) { +void update_flying(struct MarioState* m) { UNUSED u8 filler[4]; update_flying_pitch(m); update_flying_yaw(m); - m->forwardVel -= 2.0f * ((f32) m->faceAngle[0] / 0x4000) + 0.1f; + m->forwardVel -= 2.0f * ((f32)m->faceAngle[0] / 0x4000) + 0.1f; m->forwardVel -= 0.5f * (1.0f - coss(m->angleVel[1])); if (m->forwardVel < 0.0f) { @@ -362,7 +362,7 @@ void update_flying(struct MarioState *m) { m->slideVelZ = m->vel[2]; } -u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, u32 stepArg) { +u32 common_air_action_step(struct MarioState* m, u32 landAction, s32 animation, u32 stepArg) { u32 stepResult; update_air_without_turn(m); @@ -437,7 +437,7 @@ u32 common_air_action_step(struct MarioState *m, u32 landAction, s32 animation, return stepResult; } -s32 act_jump(struct MarioState *m) { +s32 act_jump(struct MarioState* m) { if (check_kick_or_dive_in_air(m)) { return TRUE; } @@ -447,15 +447,12 @@ s32 act_jump(struct MarioState *m) { } play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0); - common_air_action_step(m, ACT_JUMP_LAND, MARIO_ANIM_SINGLE_JUMP, - AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG); + common_air_action_step(m, ACT_JUMP_LAND, MARIO_ANIM_SINGLE_JUMP, AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG); return FALSE; } -s32 act_double_jump(struct MarioState *m) { - s32 animation = (m->vel[1] >= 0.0f) - ? MARIO_ANIM_DOUBLE_JUMP_RISE - : MARIO_ANIM_DOUBLE_JUMP_FALL; +s32 act_double_jump(struct MarioState* m) { + s32 animation = (m->vel[1] >= 0.0f) ? MARIO_ANIM_DOUBLE_JUMP_RISE : MARIO_ANIM_DOUBLE_JUMP_FALL; if (check_kick_or_dive_in_air(m)) { return TRUE; @@ -466,12 +463,11 @@ s32 act_double_jump(struct MarioState *m) { } play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO); - common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, animation, - AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG); + common_air_action_step(m, ACT_DOUBLE_JUMP_LAND, animation, AIR_STEP_CHECK_LEDGE_GRAB | AIR_STEP_CHECK_HANG); return FALSE; } -s32 act_triple_jump(struct MarioState *m) { +s32 act_triple_jump(struct MarioState* m) { if (gSpecialTripleJump) { return set_mario_action(m, ACT_SPECIAL_TRIPLE_JUMP, 0); } @@ -496,7 +492,7 @@ s32 act_triple_jump(struct MarioState *m) { return FALSE; } -s32 act_backflip(struct MarioState *m) { +s32 act_backflip(struct MarioState* m) { if (m->input & INPUT_Z_PRESSED) { return set_mario_action(m, ACT_GROUND_POUND, 0); } @@ -512,7 +508,7 @@ s32 act_backflip(struct MarioState *m) { return FALSE; } -s32 act_freefall(struct MarioState *m) { +s32 act_freefall(struct MarioState* m) { s32 animation; if (m->input & INPUT_B_PRESSED) { @@ -539,7 +535,7 @@ s32 act_freefall(struct MarioState *m) { return FALSE; } -s32 act_hold_jump(struct MarioState *m) { +s32 act_hold_jump(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_FREEFALL, 0); } @@ -553,12 +549,11 @@ s32 act_hold_jump(struct MarioState *m) { } play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0); - common_air_action_step(m, ACT_HOLD_JUMP_LAND, MARIO_ANIM_JUMP_WITH_LIGHT_OBJ, - AIR_STEP_CHECK_LEDGE_GRAB); + common_air_action_step(m, ACT_HOLD_JUMP_LAND, MARIO_ANIM_JUMP_WITH_LIGHT_OBJ, AIR_STEP_CHECK_LEDGE_GRAB); return FALSE; } -s32 act_hold_freefall(struct MarioState *m) { +s32 act_hold_freefall(struct MarioState* m) { s32 animation; if (m->actionArg == 0) { animation = MARIO_ANIM_FALL_WITH_LIGHT_OBJ; @@ -582,7 +577,7 @@ s32 act_hold_freefall(struct MarioState *m) { return FALSE; } -s32 act_side_flip(struct MarioState *m) { +s32 act_side_flip(struct MarioState* m) { if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, ACT_DIVE, 0); } @@ -593,8 +588,8 @@ s32 act_side_flip(struct MarioState *m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0); - if (common_air_action_step(m, ACT_SIDE_FLIP_LAND, MARIO_ANIM_SLIDEFLIP, AIR_STEP_CHECK_LEDGE_GRAB) - != AIR_STEP_GRABBED_LEDGE) { + if (common_air_action_step(m, ACT_SIDE_FLIP_LAND, MARIO_ANIM_SLIDEFLIP, AIR_STEP_CHECK_LEDGE_GRAB) != + AIR_STEP_GRABBED_LEDGE) { m->marioObj->header.gfx.angle[1] += 0x8000; } @@ -605,7 +600,7 @@ s32 act_side_flip(struct MarioState *m) { return FALSE; } -s32 act_wall_kick_air(struct MarioState *m) { +s32 act_wall_kick_air(struct MarioState* m) { if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, ACT_DIVE, 0); } @@ -619,7 +614,7 @@ s32 act_wall_kick_air(struct MarioState *m) { return FALSE; } -s32 act_long_jump(struct MarioState *m) { +s32 act_long_jump(struct MarioState* m) { s32 animation; if (!m->marioObj->oMarioLongJumpIsSlow) { animation = MARIO_ANIM_FAST_LONGJUMP; @@ -643,7 +638,7 @@ s32 act_long_jump(struct MarioState *m) { return FALSE; } -s32 act_riding_shell_air(struct MarioState *m) { +s32 act_riding_shell_air(struct MarioState* m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, 0); set_mario_animation(m, MARIO_ANIM_JUMP_RIDING_SHELL); @@ -667,7 +662,7 @@ s32 act_riding_shell_air(struct MarioState *m) { return FALSE; } -s32 act_twirling(struct MarioState *m) { +s32 act_twirling(struct MarioState* m) { s16 startTwirlYaw = m->twirlYaw; s16 yawVelTarget; @@ -712,7 +707,7 @@ s32 act_twirling(struct MarioState *m) { return FALSE; } -s32 act_dive(struct MarioState *m) { +s32 act_dive(struct MarioState* m) { if (m->actionArg == 0) { play_mario_sound(m, SOUND_ACTION_THROW, SOUND_MARIO_HOOHOO); } else { @@ -779,7 +774,7 @@ s32 act_dive(struct MarioState *m) { return FALSE; } -s32 act_air_throw(struct MarioState *m) { +s32 act_air_throw(struct MarioState* m) { if (++(m->actionTimer) == 4) { mario_throw_held_object(m); } @@ -807,7 +802,7 @@ s32 act_air_throw(struct MarioState *m) { return FALSE; } -s32 act_water_jump(struct MarioState *m) { +s32 act_water_jump(struct MarioState* m) { if (m->forwardVel < 15.0f) { mario_set_forward_vel(m, 15.0f); } @@ -826,7 +821,7 @@ s32 act_water_jump(struct MarioState *m) { break; case AIR_STEP_GRABBED_LEDGE: - if(!ROM_JP) { + if (!ROM_JP) { set_mario_animation(m, MARIO_ANIM_IDLE_ON_LEDGE); } set_mario_action(m, ACT_LEDGE_GRAB, 0); @@ -841,7 +836,7 @@ s32 act_water_jump(struct MarioState *m) { return FALSE; } -s32 act_hold_water_jump(struct MarioState *m) { +s32 act_hold_water_jump(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_FREEFALL, 0); } @@ -871,7 +866,7 @@ s32 act_hold_water_jump(struct MarioState *m) { return FALSE; } -s32 act_steep_jump(struct MarioState *m) { +s32 act_steep_jump(struct MarioState* m) { if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, ACT_DIVE, 0); } @@ -901,7 +896,7 @@ s32 act_steep_jump(struct MarioState *m) { return FALSE; } -s32 act_ground_pound(struct MarioState *m) { +s32 act_ground_pound(struct MarioState* m) { u32 stepResult; f32 yOffset; @@ -920,8 +915,7 @@ s32 act_ground_pound(struct MarioState *m) { m->vel[1] = -50.0f; mario_set_forward_vel(m, 0.0f); - set_mario_animation(m, m->actionArg == 0 ? MARIO_ANIM_START_GROUND_POUND - : MARIO_ANIM_TRIPLE_JUMP_GROUND_POUND); + set_mario_animation(m, m->actionArg == 0 ? MARIO_ANIM_START_GROUND_POUND : MARIO_ANIM_TRIPLE_JUMP_GROUND_POUND); if (m->actionTimer == 0) { play_sound(SOUND_ACTION_SPIN, m->marioObj->header.gfx.cameraToObject); } @@ -965,7 +959,7 @@ s32 act_ground_pound(struct MarioState *m) { return FALSE; } -s32 act_burning_jump(struct MarioState *m) { +s32 act_burning_jump(struct MarioState* m) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, m->actionArg == 0 ? 0 : -1); mario_set_forward_vel(m, m->forwardVel); @@ -990,7 +984,7 @@ s32 act_burning_jump(struct MarioState *m) { return FALSE; } -s32 act_burning_fall(struct MarioState *m) { +s32 act_burning_fall(struct MarioState* m) { mario_set_forward_vel(m, m->forwardVel); if (perform_air_step(m, 0) == AIR_STEP_LANDED) { @@ -1012,7 +1006,7 @@ s32 act_burning_fall(struct MarioState *m) { return FALSE; } -s32 act_crazy_box_bounce(struct MarioState *m) { +s32 act_crazy_box_bounce(struct MarioState* m) { f32 minSpeed; if (m->actionTimer == 0) { @@ -1076,8 +1070,7 @@ s32 act_crazy_box_bounce(struct MarioState *m) { return FALSE; } -u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFallAction, s32 animation, - f32 speed) { +u32 common_air_knockback_step(struct MarioState* m, u32 landAction, u32 hardFallAction, s32 animation, f32 speed) { u32 stepResult; mario_set_forward_vel(m, speed); @@ -1095,7 +1088,7 @@ u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFall } #endif if (!check_fall_damage_or_get_stuck(m, hardFallAction)) { - if(!ROM_JP) { + if (!ROM_JP) { if (m->action == ACT_THROWN_FORWARD || m->action == ACT_THROWN_BACKWARD) { set_mario_action(m, landAction, m->hurtCounter); } else { @@ -1126,7 +1119,7 @@ u32 common_air_knockback_step(struct MarioState *m, u32 landAction, u32 hardFall return stepResult; } -s32 check_wall_kick(struct MarioState *m) { +s32 check_wall_kick(struct MarioState* m) { if ((m->input & INPUT_A_PRESSED) && m->wallKickTimer != 0 && m->prevAction == ACT_AIR_HIT_WALL) { m->faceAngle[1] += 0x8000; return set_mario_action(m, ACT_WALL_KICK_AIR, 0); @@ -1135,12 +1128,12 @@ s32 check_wall_kick(struct MarioState *m) { return FALSE; } -s32 act_backward_air_kb(struct MarioState *m) { +s32 act_backward_air_kb(struct MarioState* m) { if (check_wall_kick(m)) { return TRUE; } - if(!ROM_JP) { + if (!ROM_JP) { play_knockback_sound(m); } else { play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); @@ -1149,12 +1142,12 @@ s32 act_backward_air_kb(struct MarioState *m) { return FALSE; } -s32 act_forward_air_kb(struct MarioState *m) { +s32 act_forward_air_kb(struct MarioState* m) { if (check_wall_kick(m)) { return TRUE; } - if(!ROM_JP) { + if (!ROM_JP) { play_knockback_sound(m); } else { play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); @@ -1163,19 +1156,18 @@ s32 act_forward_air_kb(struct MarioState *m) { return FALSE; } -s32 act_hard_backward_air_kb(struct MarioState *m) { - if(!ROM_JP) { +s32 act_hard_backward_air_kb(struct MarioState* m) { + if (!ROM_JP) { play_knockback_sound(m); } else { play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); } - common_air_knockback_step(m, ACT_HARD_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, 0x0002, - -16.0f); + common_air_knockback_step(m, ACT_HARD_BACKWARD_GROUND_KB, ACT_HARD_BACKWARD_GROUND_KB, 0x0002, -16.0f); return FALSE; } -s32 act_hard_forward_air_kb(struct MarioState *m) { - if(!ROM_JP) { +s32 act_hard_forward_air_kb(struct MarioState* m) { + if (!ROM_JP) { play_knockback_sound(m); } else { play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); @@ -1184,7 +1176,7 @@ s32 act_hard_forward_air_kb(struct MarioState *m) { return FALSE; } -s32 act_thrown_backward(struct MarioState *m) { +s32 act_thrown_backward(struct MarioState* m) { u32 landAction; if (m->actionArg != 0) { landAction = ACT_HARD_BACKWARD_GROUND_KB; @@ -1200,7 +1192,7 @@ s32 act_thrown_backward(struct MarioState *m) { return FALSE; } -s32 act_thrown_forward(struct MarioState *m) { +s32 act_thrown_forward(struct MarioState* m) { s16 pitch; u32 landAction; @@ -1212,8 +1204,7 @@ s32 act_thrown_forward(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_MARIO_SOUND_PLAYED); - if (common_air_knockback_step(m, landAction, ACT_HARD_FORWARD_GROUND_KB, 0x002D, m->forwardVel) - == AIR_STEP_NONE) { + if (common_air_knockback_step(m, landAction, ACT_HARD_FORWARD_GROUND_KB, 0x002D, m->forwardVel) == AIR_STEP_NONE) { pitch = atan2s(m->forwardVel, -m->vel[1]); if (pitch > 0x1800) { pitch = 0x1800; @@ -1226,12 +1217,12 @@ s32 act_thrown_forward(struct MarioState *m) { return FALSE; } -s32 act_soft_bonk(struct MarioState *m) { +s32 act_soft_bonk(struct MarioState* m) { if (check_wall_kick(m)) { return TRUE; } - if(!ROM_JP) { + if (!ROM_JP) { play_knockback_sound(m); } else { play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); @@ -1241,7 +1232,7 @@ s32 act_soft_bonk(struct MarioState *m) { return FALSE; } -s32 act_getting_blown(struct MarioState *m) { +s32 act_getting_blown(struct MarioState* m) { if (m->actionState == 0) { if (m->forwardVel > -60.0f) { m->forwardVel -= 6.0f; @@ -1263,7 +1254,7 @@ s32 act_getting_blown(struct MarioState *m) { } mario_set_forward_vel(m, m->forwardVel); - if(ROM_JP) { + if (ROM_JP) { play_sound_if_no_flag(m, SOUND_MARIO_UH, MARIO_MARIO_SOUND_PLAYED); } set_mario_animation(m, MARIO_ANIM_BACKWARD_AIR_KB); @@ -1288,7 +1279,7 @@ s32 act_getting_blown(struct MarioState *m) { return FALSE; } -s32 act_air_hit_wall(struct MarioState *m) { +s32 act_air_hit_wall(struct MarioState* m) { if (m->heldObj != NULL) { mario_drop_held_object(m); } @@ -1322,7 +1313,7 @@ s32 act_air_hit_wall(struct MarioState *m) { return set_mario_animation(m, MARIO_ANIM_START_WALLKICK); } -s32 act_forward_rollout(struct MarioState *m) { +s32 act_forward_rollout(struct MarioState* m) { if (m->actionState == 0) { m->vel[1] = 30.0f; m->actionState = 1; @@ -1363,7 +1354,7 @@ s32 act_forward_rollout(struct MarioState *m) { return FALSE; } -s32 act_backward_rollout(struct MarioState *m) { +s32 act_backward_rollout(struct MarioState* m) { if (m->actionState == 0) { m->vel[1] = 30.0f; m->actionState = 1; @@ -1404,7 +1395,7 @@ s32 act_backward_rollout(struct MarioState *m) { return FALSE; } -s32 act_butt_slide_air(struct MarioState *m) { +s32 act_butt_slide_air(struct MarioState* m) { if (++(m->actionTimer) > 30 && m->pos[1] - m->floorHeight > 500.0f) { return set_mario_action(m, ACT_FREEFALL, 1); } @@ -1439,7 +1430,7 @@ s32 act_butt_slide_air(struct MarioState *m) { return FALSE; } -s32 act_hold_butt_slide_air(struct MarioState *m) { +s32 act_hold_butt_slide_air(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_HOLD_FREEFALL, 1); } @@ -1480,7 +1471,7 @@ s32 act_hold_butt_slide_air(struct MarioState *m) { return FALSE; } -s32 act_lava_boost(struct MarioState *m) { +s32 act_lava_boost(struct MarioState* m) { #if ENABLE_RUMBLE if (!(m->flags & MARIO_MARIO_SOUND_PLAYED)) { #endif @@ -1530,8 +1521,7 @@ s32 act_lava_boost(struct MarioState *m) { } set_mario_animation(m, MARIO_ANIM_FIRE_LAVA_BURN); - if ((m->area->terrainType & TERRAIN_MASK) != TERRAIN_SNOW && !(m->flags & MARIO_METAL_CAP) - && m->vel[1] > 0.0f) { + if ((m->area->terrainType & TERRAIN_MASK) != TERRAIN_SNOW && !(m->flags & MARIO_METAL_CAP) && m->vel[1] > 0.0f) { m->particleFlags |= PARTICLE_FIRE; if (m->actionState == 0) { play_sound(SOUND_MOVING_LAVA_BURN, m->marioObj->header.gfx.cameraToObject); @@ -1549,7 +1539,7 @@ s32 act_lava_boost(struct MarioState *m) { return FALSE; } -s32 act_slide_kick(struct MarioState *m) { +s32 act_slide_kick(struct MarioState* m) { if (m->actionState == 0 && m->actionTimer == 0) { play_mario_sound(m, SOUND_ACTION_TERRAIN_JUMP, SOUND_MARIO_HOOHOO); set_mario_animation(m, MARIO_ANIM_SLIDE_KICK); @@ -1600,7 +1590,7 @@ s32 act_slide_kick(struct MarioState *m) { return FALSE; } -s32 act_jump_kick(struct MarioState *m) { +s32 act_jump_kick(struct MarioState* m) { s32 animFrame; if (m->actionState == 0) { @@ -1635,7 +1625,7 @@ s32 act_jump_kick(struct MarioState *m) { return FALSE; } -s32 act_shot_from_cannon(struct MarioState *m) { +s32 act_shot_from_cannon(struct MarioState* m) { if (m->area->camera->mode != CAMERA_MODE_BEHIND_MARIO) { m->statusForCamera->cameraEvent = CAM_EVENT_SHOT_FROM_CANNON; } @@ -1695,7 +1685,7 @@ s32 act_shot_from_cannon(struct MarioState *m) { return FALSE; } -s32 act_flying(struct MarioState *m) { +s32 act_flying(struct MarioState* m) { s16 startPitch = m->faceAngle[0]; if (m->input & INPUT_Z_PRESSED) { @@ -1768,8 +1758,7 @@ s32 act_flying(struct MarioState *m) { m->vel[1] = 0.0f; } - 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); m->particleFlags |= PARTICLE_VERTICAL_STAR; @@ -1805,9 +1794,9 @@ s32 act_flying(struct MarioState *m) { if (startPitch <= 0 && m->faceAngle[0] > 0 && m->forwardVel >= 48.0f) { play_sound(SOUND_ACTION_FLYING_FAST, m->marioObj->header.gfx.cameraToObject); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_MARIO_YAHOO_WAHA_YIPPEE + ((gAudioRandom % 5) << 16), - m->marioObj->header.gfx.cameraToObject); + m->marioObj->header.gfx.cameraToObject); } #if ENABLE_RUMBLE queue_rumble_data(50, 40); @@ -1819,7 +1808,7 @@ s32 act_flying(struct MarioState *m) { return FALSE; } -s32 act_riding_hoot(struct MarioState *m) { +s32 act_riding_hoot(struct MarioState* m) { if (!(m->input & INPUT_A_DOWN) || (m->marioObj->oInteractStatus & INT_STATUS_MARIO_UNK7)) { m->usedObj->oInteractStatus = 0; m->usedObj->oHootMarioReleaseTime = gGlobalTimer; @@ -1851,8 +1840,8 @@ s32 act_riding_hoot(struct MarioState *m) { return FALSE; } -s32 act_flying_triple_jump(struct MarioState *m) { - if(!ROM_JP) { +s32 act_flying_triple_jump(struct MarioState* m) { + if (!ROM_JP) { if (m->input & (INPUT_B_PRESSED | INPUT_Z_PRESSED)) { if (m->area->camera->mode == CAMERA_MODE_BEHIND_MARIO) { set_camera_mode(m->area->camera, m->area->camera->defMode, 1); @@ -1931,13 +1920,13 @@ s32 act_flying_triple_jump(struct MarioState *m) { return FALSE; } -s32 act_top_of_pole_jump(struct MarioState *m) { +s32 act_top_of_pole_jump(struct MarioState* m) { play_mario_jump_sound(m); common_air_action_step(m, ACT_FREEFALL_LAND, MARIO_ANIM_HANDSTAND_JUMP, AIR_STEP_CHECK_LEDGE_GRAB); return FALSE; } -s32 act_vertical_wind(struct MarioState *m) { +s32 act_vertical_wind(struct MarioState* m) { s16 intendedDYaw = m->intendedYaw - m->faceAngle[1]; f32 intendedMag = m->intendedMag / 32.0f; @@ -1975,7 +1964,7 @@ s32 act_vertical_wind(struct MarioState *m) { return FALSE; } -s32 act_special_triple_jump(struct MarioState *m) { +s32 act_special_triple_jump(struct MarioState* m) { if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, ACT_DIVE, 0); } @@ -2015,7 +2004,7 @@ s32 act_special_triple_jump(struct MarioState *m) { return FALSE; } -s32 check_common_airborne_cancels(struct MarioState *m) { +s32 check_common_airborne_cancels(struct MarioState* m) { if (m->pos[1] < m->waterLevel - 100) { return set_water_plunge_action(m); } @@ -2032,7 +2021,7 @@ s32 check_common_airborne_cancels(struct MarioState *m) { return FALSE; } -s32 mario_execute_airborne_action(struct MarioState *m) { +s32 mario_execute_airborne_action(struct MarioState* m) { u32 cancel; if (check_common_airborne_cancels(m)) { diff --git a/src/game/mario_actions_automatic.c b/src/game/mario_actions_automatic.c index b8bf6cd2..86bb3cda 100644 --- a/src/game/mario_actions_automatic.c +++ b/src/game/mario_actions_automatic.c @@ -17,15 +17,15 @@ #include "level_table.h" #include "rumble_init.h" -#define POLE_NONE 0 +#define POLE_NONE 0 #define POLE_TOUCHED_FLOOR 1 -#define POLE_FELL_OFF 2 +#define POLE_FELL_OFF 2 -#define HANG_NONE 0 +#define HANG_NONE 0 #define HANG_HIT_CEIL_OR_OOB 1 -#define HANG_LEFT_CEIL 2 +#define HANG_LEFT_CEIL 2 -void add_tree_leaf_particles(struct MarioState *m) { +void add_tree_leaf_particles(struct MarioState* m) { f32 leafHeight; if (m->usedObj->behavior == segmented_to_virtual(bhvTree)) { @@ -41,7 +41,7 @@ void add_tree_leaf_particles(struct MarioState *m) { } } -void play_climbing_sounds(struct MarioState *m, s32 b) { +void play_climbing_sounds(struct MarioState* m, s32 b) { s32 isOnTree = (m->usedObj->behavior == segmented_to_virtual(bhvTree)); if (b == 1) { @@ -55,16 +55,16 @@ void play_climbing_sounds(struct MarioState *m, s32 b) { } } -s32 set_pole_position(struct MarioState *m, f32 offsetY) { +s32 set_pole_position(struct MarioState* m, f32 offsetY) { UNUSED u8 filler[12]; - struct Surface *floor; - struct Surface *ceil; + struct Surface* floor; + struct Surface* ceil; f32 floorHeight; f32 ceilHeight; s32 collided; s32 result = POLE_NONE; f32 poleTop = m->usedObj->hitboxHeight - 100.0f; - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; if (marioObj->oMarioPolePos > poleTop) { marioObj->oMarioPolePos = poleTop; @@ -104,16 +104,15 @@ s32 set_pole_position(struct MarioState *m, f32 offsetY) { } vec3f_copy(m->marioObj->header.gfx.pos, m->pos); - vec3s_set(m->marioObj->header.gfx.angle, m->usedObj->oMoveAnglePitch, m->faceAngle[1], - m->usedObj->oMoveAngleRoll); + vec3s_set(m->marioObj->header.gfx.angle, m->usedObj->oMoveAnglePitch, m->faceAngle[1], m->usedObj->oMoveAngleRoll); return result; } -s32 act_holding_pole(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_holding_pole(struct MarioState* m) { + struct Object* marioObj = m->marioObj; - if(ROM_JP) { + if (ROM_JP) { if (m->input & INPUT_A_PRESSED) { add_tree_leaf_particles(m); m->faceAngle[1] += 0x8000; @@ -141,7 +140,7 @@ s32 act_holding_pole(struct MarioState *m) { if (m->controller->stickY > 16.0f) { f32 poleTop = m->usedObj->hitboxHeight - 100.0f; - const BehaviorScript *poleBehavior = virtual_to_segmented(0x13, m->usedObj->behavior); + const BehaviorScript* poleBehavior = virtual_to_segmented(0x13, m->usedObj->behavior); if (marioObj->oMarioPolePos < poleTop - 0.4f) { return set_mario_action(m, ACT_CLIMBING_POLE, 0); @@ -185,9 +184,9 @@ s32 act_holding_pole(struct MarioState *m) { return FALSE; } -s32 act_climbing_pole(struct MarioState *m) { +s32 act_climbing_pole(struct MarioState* m) { s32 sp24; - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; s16 cameraAngle = m->area->camera->yaw; if (!ROM_JP && m->health < 0x100) { @@ -220,7 +219,7 @@ s32 act_climbing_pole(struct MarioState *m) { return FALSE; } -s32 act_grab_pole_slow(struct MarioState *m) { +s32 act_grab_pole_slow(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED); if (set_pole_position(m, 0.0f) == POLE_NONE) { @@ -234,8 +233,8 @@ s32 act_grab_pole_slow(struct MarioState *m) { return FALSE; } -s32 act_grab_pole_fast(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_grab_pole_fast(struct MarioState* m) { + struct Object* marioObj = m->marioObj; play_sound_if_no_flag(m, SOUND_MARIO_WHOA, MARIO_MARIO_SOUND_PLAYED); m->faceAngle[1] += marioObj->oMarioPoleYawVel; @@ -257,8 +256,8 @@ s32 act_grab_pole_fast(struct MarioState *m) { return FALSE; } -s32 act_top_of_pole_transition(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_top_of_pole_transition(struct MarioState* m) { + struct Object* marioObj = m->marioObj; marioObj->oMarioPoleYawVel = 0; if (m->actionArg == 0) { @@ -277,8 +276,8 @@ s32 act_top_of_pole_transition(struct MarioState *m) { return FALSE; } -s32 act_top_of_pole(struct MarioState *m) { - UNUSED struct Object *marioObj = m->marioObj; +s32 act_top_of_pole(struct MarioState* m) { + UNUSED struct Object* marioObj = m->marioObj; if (m->input & INPUT_A_PRESSED) { return set_mario_action(m, ACT_TOP_OF_POLE_JUMP, 0); @@ -294,10 +293,10 @@ s32 act_top_of_pole(struct MarioState *m) { return FALSE; } -s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos) { +s32 perform_hanging_step(struct MarioState* m, Vec3f nextPos) { UNUSED u8 filler[4]; - struct Surface *ceil; - struct Surface *floor; + struct Surface* ceil; + struct Surface* floor; f32 ceilHeight; f32 floorHeight; f32 ceilOffset; @@ -338,7 +337,7 @@ s32 perform_hanging_step(struct MarioState *m, Vec3f nextPos) { return HANG_NONE; } -s32 update_hang_moving(struct MarioState *m) { +s32 update_hang_moving(struct MarioState* m) { s32 stepResult; Vec3f nextPos; f32 maxSpeed = 4.0f; @@ -348,8 +347,7 @@ s32 update_hang_moving(struct MarioState *m) { m->forwardVel = maxSpeed; } - m->faceAngle[1] = - m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); m->slideYaw = m->faceAngle[1]; m->slideVelX = m->forwardVel * sins(m->faceAngle[1]); @@ -370,7 +368,7 @@ s32 update_hang_moving(struct MarioState *m) { return stepResult; } -void update_hang_stationary(struct MarioState *m) { +void update_hang_stationary(struct MarioState* m) { m->forwardVel = 0.0f; m->slideVelX = 0.0f; m->slideVelZ = 0.0f; @@ -380,7 +378,7 @@ void update_hang_stationary(struct MarioState *m) { vec3f_copy(m->marioObj->header.gfx.pos, m->pos); } -s32 act_start_hanging(struct MarioState *m) { +s32 act_start_hanging(struct MarioState* m) { #if ENABLE_RUMBLE if (m->actionTimer++ == 0) { queue_rumble_data(5, 80); @@ -417,7 +415,7 @@ s32 act_start_hanging(struct MarioState *m) { return FALSE; } -s32 act_hanging(struct MarioState *m) { +s32 act_hanging(struct MarioState* m) { if (m->input & INPUT_NONZERO_ANALOG) { return set_mario_action(m, ACT_HANG_MOVING, m->actionArg); } @@ -445,7 +443,7 @@ s32 act_hanging(struct MarioState *m) { return FALSE; } -s32 act_hang_moving(struct MarioState *m) { +s32 act_hang_moving(struct MarioState* m) { if (!(m->input & INPUT_A_DOWN)) { return set_mario_action(m, ACT_FREEFALL, 0); } @@ -485,9 +483,9 @@ s32 act_hang_moving(struct MarioState *m) { return FALSE; } -s32 let_go_of_ledge(struct MarioState *m) { +s32 let_go_of_ledge(struct MarioState* m) { f32 floorHeight; - struct Surface *floor; + struct Surface* floor; m->vel[1] = 0.0f; m->forwardVel = -8.0f; @@ -504,14 +502,14 @@ s32 let_go_of_ledge(struct MarioState *m) { return set_mario_action(m, ACT_SOFT_BONK, 0); } -void climb_up_ledge(struct MarioState *m) { +void climb_up_ledge(struct MarioState* m) { set_mario_animation(m, MARIO_ANIM_IDLE_HEAD_LEFT); m->pos[0] += 14.0f * sins(m->faceAngle[1]); m->pos[2] += 14.0f * coss(m->faceAngle[1]); vec3f_copy(m->marioObj->header.gfx.pos, m->pos); } -void update_ledge_climb_camera(struct MarioState *m) { +void update_ledge_climb_camera(struct MarioState* m) { f32 sp4; if (m->actionTimer < 14) { @@ -526,7 +524,7 @@ void update_ledge_climb_camera(struct MarioState *m) { m->flags |= MARIO_UNKNOWN_25; } -void update_ledge_climb(struct MarioState *m, s32 animation, u32 endAction) { +void update_ledge_climb(struct MarioState* m, s32 animation, u32 endAction) { stop_and_set_height_to_floor(m); set_mario_animation(m, animation); @@ -538,7 +536,7 @@ void update_ledge_climb(struct MarioState *m, s32 animation, u32 endAction) { } } -s32 act_ledge_grab(struct MarioState *m) { +s32 act_ledge_grab(struct MarioState* m) { f32 heightAboveFloor; s16 intendedDYaw = m->intendedYaw - m->faceAngle[1]; s32 hasSpaceForMario = (m->ceilHeight - m->floorHeight >= 160.0f); @@ -596,14 +594,13 @@ s32 act_ledge_grab(struct MarioState *m) { return FALSE; } -s32 act_ledge_climb_slow(struct MarioState *m) { +s32 act_ledge_climb_slow(struct MarioState* m) { if (m->input & INPUT_OFF_FLOOR) { return let_go_of_ledge(m); } - if (m->actionTimer >= 28 - && (m->input - & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE))) { + if (m->actionTimer >= 28 && + (m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE))) { climb_up_ledge(m); return check_common_action_exits(m); } @@ -622,7 +619,7 @@ s32 act_ledge_climb_slow(struct MarioState *m) { return FALSE; } -s32 act_ledge_climb_down(struct MarioState *m) { +s32 act_ledge_climb_down(struct MarioState* m) { if (m->input & INPUT_OFF_FLOOR) { return let_go_of_ledge(m); } @@ -635,7 +632,7 @@ s32 act_ledge_climb_down(struct MarioState *m) { return FALSE; } -s32 act_ledge_climb_fast(struct MarioState *m) { +s32 act_ledge_climb_fast(struct MarioState* m) { if (m->input & INPUT_OFF_FLOOR) { return let_go_of_ledge(m); } @@ -652,7 +649,7 @@ s32 act_ledge_climb_fast(struct MarioState *m) { return FALSE; } -s32 act_grabbed(struct MarioState *m) { +s32 act_grabbed(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_UNK2) { s32 thrown = (m->marioObj->oInteractStatus & INT_STATUS_MARIO_UNK6) == 0; @@ -662,16 +659,15 @@ s32 act_grabbed(struct MarioState *m) { queue_rumble_data(5, 60); #endif - return set_mario_action(m, (m->forwardVel >= 0.0f) ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD, - thrown); + return set_mario_action(m, (m->forwardVel >= 0.0f) ? ACT_THROWN_FORWARD : ACT_THROWN_BACKWARD, thrown); } set_mario_animation(m, MARIO_ANIM_BEING_GRABBED); return FALSE; } -s32 act_in_cannon(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_in_cannon(struct MarioState* m) { + struct Object* marioObj = m->marioObj; s16 startFacePitch = m->faceAngle[0]; s16 startFaceYaw = m->faceAngle[1]; @@ -760,14 +756,14 @@ s32 act_in_cannon(struct MarioState *m) { return FALSE; } -s32 act_tornado_twirling(struct MarioState *m) { - struct Surface *floor; +s32 act_tornado_twirling(struct MarioState* m) { + struct Surface* floor; Vec3f nextPos; f32 sinAngleVel; f32 cosAngleVel; f32 floorHeight; - struct Object *marioObj = m->marioObj; - struct Object *usedObj = m->usedObj; + struct Object* marioObj = m->marioObj; + struct Object* usedObj = m->usedObj; s16 prevTwirlYaw = m->twirlYaw; f32 dx = (m->pos[0] - usedObj->oPosX) * 0.95f; @@ -841,7 +837,7 @@ s32 act_tornado_twirling(struct MarioState *m) { return FALSE; } -s32 check_common_automatic_cancels(struct MarioState *m) { +s32 check_common_automatic_cancels(struct MarioState* m) { if (m->pos[1] < m->waterLevel - 100) { return set_water_plunge_action(m); } @@ -849,7 +845,7 @@ s32 check_common_automatic_cancels(struct MarioState *m) { return FALSE; } -s32 mario_execute_automatic_action(struct MarioState *m) { +s32 mario_execute_automatic_action(struct MarioState* m) { s32 cancel; if (check_common_automatic_cancels(m)) { diff --git a/src/game/mario_actions_cutscene.c b/src/game/mario_actions_cutscene.c index e4a91735..c0e8ac84 100644 --- a/src/game/mario_actions_cutscene.c +++ b/src/game/mario_actions_cutscene.c @@ -32,17 +32,17 @@ #include "port/hooks/list/PlayerEvent.h" #include "port/mods/PortEnhancements.h" -static struct Object *sIntroWarpPipeObj; -static struct Object *sEndPeachObj; -static struct Object *sEndRightToadObj; -static struct Object *sEndLeftToadObj; -static struct Object *sEndJumboStarObj; +static struct Object* sIntroWarpPipeObj; +static struct Object* sEndPeachObj; +static struct Object* sEndRightToadObj; +static struct Object* sEndLeftToadObj; +static struct Object* sEndJumboStarObj; static UNUSED s32 sUnused; static s16 sEndPeachAnimation; static s16 sEndToadAnims[2]; static Vp sEndCutsceneVp = { { { 640, 480, 511, 0 }, { 640, 480, 511, 0 } } }; -static struct CreditsEntry *sDispCreditsEntry = NULL; +static struct CreditsEntry* sDispCreditsEntry = NULL; // related to peach gfx? static s8 D_8032CBE4 = 0; @@ -62,14 +62,12 @@ static u8 sStarsNeededForDialog[] = { 1, 3, 8, 30, 50, 70 }; * that define the curve. */ static Vec4s sJumboStarKeyframes[27] = { - { 20, 0, 678, -2916 }, { 30, 0, 680, -3500 }, { 40, 1000, 700, -4000 }, - { 50, 2500, 750, -3500 }, { 50, 3500, 800, -2000 }, { 50, 4000, 850, 0 }, - { 50, 3500, 900, 2000 }, { 50, 2000, 950, 3500 }, { 50, 0, 1000, 4000 }, - { 50, -2000, 1050, 3500 }, { 50, -3500, 1100, 2000 }, { 50, -4000, 1150, 0 }, - { 50, -3500, 1200, -2000 }, { 50, -2000, 1250, -3500 }, { 50, 0, 1300, -4000 }, - { 50, 2000, 1350, -3500 }, { 50, 3500, 1400, -2000 }, { 50, 4000, 1450, 0 }, - { 50, 3500, 1500, 2000 }, { 50, 2000, 1600, 3500 }, { 50, 0, 1700, 4000 }, - { 50, -2000, 1800, 3500 }, { 50, -3500, 1900, 2000 }, { 30, -4000, 2000, 0 }, + { 20, 0, 678, -2916 }, { 30, 0, 680, -3500 }, { 40, 1000, 700, -4000 }, { 50, 2500, 750, -3500 }, + { 50, 3500, 800, -2000 }, { 50, 4000, 850, 0 }, { 50, 3500, 900, 2000 }, { 50, 2000, 950, 3500 }, + { 50, 0, 1000, 4000 }, { 50, -2000, 1050, 3500 }, { 50, -3500, 1100, 2000 }, { 50, -4000, 1150, 0 }, + { 50, -3500, 1200, -2000 }, { 50, -2000, 1250, -3500 }, { 50, 0, 1300, -4000 }, { 50, 2000, 1350, -3500 }, + { 50, 3500, 1400, -2000 }, { 50, 4000, 1450, 0 }, { 50, 3500, 1500, 2000 }, { 50, 2000, 1600, 3500 }, + { 50, 0, 1700, 4000 }, { 50, -2000, 1800, 3500 }, { 50, -3500, 1900, 2000 }, { 30, -4000, 2000, 0 }, { 0, -3500, 2100, -2000 }, { 0, -2000, 2200, -3500 }, { 0, 0, 2300, -4000 }, }; @@ -80,7 +78,7 @@ static Vec4s sJumboStarKeyframes[27] = { * character is a null character (equal to 0), stop counting the length since * that's the end of the string. */ -s32 get_credits_str_width(char *str) { +s32 get_credits_str_width(char* str) { u32 c; s32 length = 0; @@ -110,26 +108,26 @@ s32 get_credits_str_width(char *str) { * by the value of lineHeight. */ void print_displaying_credits_entry(void) { - char **currStrPtr; - char *titleStr; + char** currStrPtr; + char* titleStr; s16 numLines; s16 strY; s16 lineHeight; if (sDispCreditsEntry != NULL) { - currStrPtr = (char **) sDispCreditsEntry->unk0C; + currStrPtr = (char**)sDispCreditsEntry->unk0C; titleStr = *currStrPtr++; numLines = *titleStr++ - '0'; strY = (sDispCreditsEntry->unk02 & 0x20 ? 28 : 172) + (numLines == 1) * 16; - if(!ROM_JP) { + if (!ROM_JP) { lineHeight = 16; } dl_rgba16_begin_cutscene_msg_fade(); print_credits_str_ascii(CREDIT_TEXT_X_LEFT, strY, titleStr); - if(!ROM_JP) { + if (!ROM_JP) { switch (numLines) { case 4: print_credits_str_ascii(CREDIT_TEXT_X_LEFT, strY + 24, *currStrPtr++); @@ -140,7 +138,7 @@ void print_displaying_credits_entry(void) { print_credits_str_ascii(CREDIT_TEXT_X_LEFT, strY + 16, *currStrPtr++); numLines = 3; break; - #ifdef VERSION_EU +#ifdef VERSION_EU case 6: print_credits_str_ascii(CREDIT_TEXT_X_LEFT, strY + 32, *currStrPtr++); numLines = 3; @@ -150,7 +148,7 @@ void print_displaying_credits_entry(void) { print_credits_str_ascii(CREDIT_TEXT_X_LEFT, strY + 32, *currStrPtr++); numLines = 3; break; - #endif +#endif } } @@ -188,8 +186,8 @@ void bhv_end_toad_loop(void) { } // Geo switch case function for controlling Peach's eye state. -s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2) { - struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node; +s32 geo_switch_peach_eyes(s32 run, struct GraphNode* node, UNUSED s32 a2) { + struct GraphNodeSwitchCase* switchCase = (struct GraphNodeSwitchCase*)node; s16 timer; if (run == TRUE) { @@ -209,7 +207,7 @@ s32 geo_switch_peach_eyes(s32 run, struct GraphNode *node, UNUSED s32 a2) { } // unused -UNUSED static void stub_is_textbox_active(u16 *arg) { +UNUSED static void stub_is_textbox_active(u16* arg) { if (get_dialog_id() == DIALOG_NONE) { *arg = 0; } @@ -222,7 +220,7 @@ UNUSED static void stub_is_textbox_active(u16 *arg) { * if so, return the dialog ID. Otherwise, return 0. A dialog is returned if * numStars has reached a milestone and prevNumStarsForDialog has not reached it. */ -s32 get_star_collection_dialog(struct MarioState *m) { +s32 get_star_collection_dialog(struct MarioState* m) { s32 i; s32 dialogID = 0; s32 numStarsRequired; @@ -240,7 +238,7 @@ s32 get_star_collection_dialog(struct MarioState *m) { } // save menu handler -void handle_save_menu(struct MarioState *m) { +void handle_save_menu(struct MarioState* m) { s32 dialogID; // wait for the menu to show up if (is_anim_past_end(m) && gSaveOptSelectIndex != MENU_OPT_NONE) { @@ -275,8 +273,8 @@ void handle_save_menu(struct MarioState *m) { * Spawns object with given behavior and model and copies over Mario's position * and yaw plus relative yaw. */ -struct Object *spawn_obj_at_mario_rel_yaw(struct MarioState *m, s32 model, const BehaviorScript *behavior, s16 relYaw) { - struct Object *o = spawn_object(m->marioObj, model, behavior); +struct Object* spawn_obj_at_mario_rel_yaw(struct MarioState* m, s32 model, const BehaviorScript* behavior, s16 relYaw) { + struct Object* o = spawn_object(m->marioObj, model, behavior); o->oFaceAngleYaw = m->faceAngle[1] + relYaw; o->oPosX = m->pos[0]; @@ -291,7 +289,7 @@ struct Object *spawn_obj_at_mario_rel_yaw(struct MarioState *m, s32 model, const * Clears "cap on head" flag, sets "cap in hand" flag, plays sound * SOUND_ACTION_UNKNOWN43D. */ -void cutscene_take_cap_off(struct MarioState *m) { +void cutscene_take_cap_off(struct MarioState* m) { m->flags &= ~MARIO_CAP_ON_HEAD; m->flags |= MARIO_CAP_IN_HAND; play_sound(SOUND_ACTION_UNKNOWN43D, m->marioObj->header.gfx.cameraToObject); @@ -302,7 +300,7 @@ void cutscene_take_cap_off(struct MarioState *m) { * Clears "cap in hand" flag, sets "cap on head" flag, plays sound * SOUND_ACTION_UNKNOWN43E. */ -void cutscene_put_cap_on(struct MarioState *m) { +void cutscene_put_cap_on(struct MarioState* m) { m->flags &= ~MARIO_CAP_IN_HAND; m->flags |= MARIO_CAP_ON_HEAD; play_sound(SOUND_ACTION_UNKNOWN43E, m->marioObj->header.gfx.cameraToObject); @@ -321,10 +319,10 @@ s32 mario_ready_to_speak(void) { u32 actionGroup = gMarioState->action & ACT_GROUP_MASK; s32 isReadyToSpeak = FALSE; - if ((gMarioState->action == ACT_WAITING_FOR_DIALOG || actionGroup == ACT_GROUP_STATIONARY - || actionGroup == ACT_GROUP_MOVING) - && (!(gMarioState->action & (ACT_FLAG_RIDING_SHELL | ACT_FLAG_INVULNERABLE)) - && gMarioState->action != ACT_FIRST_PERSON)) { + if ((gMarioState->action == ACT_WAITING_FOR_DIALOG || actionGroup == ACT_GROUP_STATIONARY || + actionGroup == ACT_GROUP_MOVING) && + (!(gMarioState->action & (ACT_FLAG_RIDING_SHELL | ACT_FLAG_INVULNERABLE)) && + gMarioState->action != ACT_FIRST_PERSON)) { isReadyToSpeak = TRUE; } @@ -370,7 +368,7 @@ s32 set_mario_npc_dialog(s32 actionArg) { // 8: in dialog // 9 - 22: looking away from npc // 23: end -s32 act_reading_npc_dialog(struct MarioState *m) { +s32 act_reading_npc_dialog(struct MarioState* m) { s32 headTurnAmount = 0; s16 angleToNPC; @@ -384,13 +382,11 @@ s32 act_reading_npc_dialog(struct MarioState *m) { if (m->actionState < 8) { // turn to NPC angleToNPC = mario_obj_angle_to_object(m, m->usedObj); - m->faceAngle[1] = - angleToNPC - approach_s32((angleToNPC - m->faceAngle[1]) << 16 >> 16, 0, 2048, 2048); + m->faceAngle[1] = angleToNPC - approach_s32((angleToNPC - m->faceAngle[1]) << 16 >> 16, 0, 2048, 2048); // turn head to npc m->actionTimer += headTurnAmount; // set animation - set_mario_animation(m, m->heldObj == NULL ? MARIO_ANIM_FIRST_PERSON - : MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); + set_mario_animation(m, m->heldObj == NULL ? MARIO_ANIM_FIRST_PERSON : MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); } else if (m->actionState >= 9 && m->actionState < 17) { // look back from facing NPC m->actionTimer -= headTurnAmount; @@ -413,16 +409,15 @@ s32 act_reading_npc_dialog(struct MarioState *m) { } // puts Mario in a state where he's waiting for (npc) dialog; doesn't do much -s32 act_waiting_for_dialog(struct MarioState *m) { - set_mario_animation(m, m->heldObj == NULL ? MARIO_ANIM_FIRST_PERSON - : MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); +s32 act_waiting_for_dialog(struct MarioState* m) { + set_mario_animation(m, m->heldObj == NULL ? MARIO_ANIM_FIRST_PERSON : MARIO_ANIM_IDLE_WITH_LIGHT_OBJ); vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); return FALSE; } // makes Mario disappear and triggers warp -s32 act_disappeared(struct MarioState *m) { +s32 act_disappeared(struct MarioState* m) { set_mario_animation(m, MARIO_ANIM_A_POSE); stop_and_set_height_to_floor(m); m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; @@ -435,7 +430,7 @@ s32 act_disappeared(struct MarioState *m) { return FALSE; } -s32 act_reading_automatic_dialog(struct MarioState *m) { +s32 act_reading_automatic_dialog(struct MarioState* m) { u32 actionArg; m->actionState++; @@ -443,8 +438,7 @@ s32 act_reading_automatic_dialog(struct MarioState *m) { enable_time_stop(); } if (m->actionState < 9) { - set_mario_animation(m, m->prevAction == ACT_STAR_DANCE_WATER ? MARIO_ANIM_WATER_IDLE - : MARIO_ANIM_FIRST_PERSON); + set_mario_animation(m, m->prevAction == ACT_STAR_DANCE_WATER ? MARIO_ANIM_WATER_IDLE : MARIO_ANIM_FIRST_PERSON); // always look up for automatic dialogs m->actionTimer -= 1024; } else { @@ -478,8 +472,7 @@ s32 act_reading_automatic_dialog(struct MarioState *m) { set_mario_action(m, ACT_WATER_IDLE, 0); // 100c star? } else { // make Mario walk into door after star dialog - set_mario_action(m, m->prevAction == ACT_UNLOCKING_STAR_DOOR ? ACT_WALKING : ACT_IDLE, - 0); + set_mario_action(m, m->prevAction == ACT_UNLOCKING_STAR_DOOR ? ACT_WALKING : ACT_IDLE, 0); } } } @@ -488,8 +481,8 @@ s32 act_reading_automatic_dialog(struct MarioState *m) { return FALSE; } -s32 act_reading_sign(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_reading_sign(struct MarioState* m) { + struct Object* marioObj = m->marioObj; play_sound_if_no_flag(m, SOUND_ACTION_READ_SIGN, MARIO_ACTION_SOUND_PLAYED); @@ -528,8 +521,8 @@ s32 act_reading_sign(struct MarioState *m) { return FALSE; } -s32 act_debug_free_move(struct MarioState *m) { - struct Surface *surf; +s32 act_debug_free_move(struct MarioState* m) { + struct Surface* surf; f32 floorHeight; Vec3f pos; f32 speed; @@ -582,7 +575,7 @@ s32 act_debug_free_move(struct MarioState *m) { return FALSE; } -void general_star_dance_handler(struct MarioState *m, s32 isInWater) { +void general_star_dance_handler(struct MarioState* m, s32 isInWater) { s32 dialogID; if (m->actionState == 0) { switch (++m->actionTimer) { @@ -632,10 +625,9 @@ void general_star_dance_handler(struct MarioState *m, s32 isInWater) { } } -s32 act_star_dance(struct MarioState *m) { +s32 act_star_dance(struct MarioState* m) { m->faceAngle[1] = m->area->camera->yaw; - set_mario_animation(m, m->actionState == 2 ? MARIO_ANIM_RETURN_FROM_STAR_DANCE - : MARIO_ANIM_STAR_DANCE); + set_mario_animation(m, m->actionState == 2 ? MARIO_ANIM_RETURN_FROM_STAR_DANCE : MARIO_ANIM_STAR_DANCE); general_star_dance_handler(m, 0); if (m->actionState != 2 && m->actionTimer >= 40) { m->marioBodyState->handState = MARIO_HAND_PEACE_SIGN; @@ -644,10 +636,9 @@ s32 act_star_dance(struct MarioState *m) { return FALSE; } -s32 act_star_dance_water(struct MarioState *m) { +s32 act_star_dance_water(struct MarioState* m) { m->faceAngle[1] = m->area->camera->yaw; - set_mario_animation(m, m->actionState == 2 ? MARIO_ANIM_RETURN_FROM_WATER_STAR_DANCE - : MARIO_ANIM_WATER_STAR_DANCE); + set_mario_animation(m, m->actionState == 2 ? MARIO_ANIM_RETURN_FROM_WATER_STAR_DANCE : MARIO_ANIM_WATER_STAR_DANCE); vec3f_copy(m->marioObj->header.gfx.pos, m->pos); vec3s_set(m->marioObj->header.gfx.angle, 0, m->faceAngle[1], 0); general_star_dance_handler(m, 1); @@ -657,7 +648,7 @@ s32 act_star_dance_water(struct MarioState *m) { return FALSE; } -s32 act_fall_after_star_grab(struct MarioState *m) { +s32 act_fall_after_star_grab(struct MarioState* m) { if (m->pos[1] < m->waterLevel - 130) { play_sound(SOUND_ACTION_UNKNOWN430, m->marioObj->header.gfx.cameraToObject); m->particleFlags |= PARTICLE_WATER_SPLASH; @@ -665,14 +656,13 @@ s32 act_fall_after_star_grab(struct MarioState *m) { } if (perform_air_step(m, 1) == AIR_STEP_LANDED) { play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); - set_mario_action(m, m->actionArg & 1 ? ACT_STAR_DANCE_NO_EXIT : ACT_STAR_DANCE_EXIT, - m->actionArg); + set_mario_action(m, m->actionArg & 1 ? ACT_STAR_DANCE_NO_EXIT : ACT_STAR_DANCE_EXIT, m->actionArg); } set_mario_animation(m, MARIO_ANIM_GENERAL_FALL); return FALSE; } -s32 common_death_handler(struct MarioState *m, s32 animation, s32 frameToDeathWarp) { +s32 common_death_handler(struct MarioState* m, s32 animation, s32 frameToDeathWarp) { s32 animFrame = set_mario_animation(m, animation); if (animFrame == frameToDeathWarp) { level_trigger_warp(m, WARP_OP_DEATH); @@ -682,7 +672,7 @@ s32 common_death_handler(struct MarioState *m, s32 animation, s32 frameToDeathWa return animFrame; } -s32 act_standing_death(struct MarioState *m) { +s32 act_standing_death(struct MarioState* m) { if (m->input & INPUT_IN_POISON_GAS) { return set_mario_action(m, ACT_SUFFOCATION, 0); } @@ -695,19 +685,19 @@ s32 act_standing_death(struct MarioState *m) { return FALSE; } -s32 act_electrocution(struct MarioState *m) { +s32 act_electrocution(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); common_death_handler(m, MARIO_ANIM_ELECTROCUTION, 43); return FALSE; } -s32 act_suffocation(struct MarioState *m) { +s32 act_suffocation(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); common_death_handler(m, MARIO_ANIM_SUFFOCATING, 86); return FALSE; } -s32 act_death_on_back(struct MarioState *m) { +s32 act_death_on_back(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); if (common_death_handler(m, MARIO_ANIM_DYING_ON_BACK, 54) == 40) { play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); @@ -715,7 +705,7 @@ s32 act_death_on_back(struct MarioState *m) { return FALSE; } -s32 act_death_on_stomach(struct MarioState *m) { +s32 act_death_on_stomach(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); if (common_death_handler(m, MARIO_ANIM_DYING_ON_STOMACH, 37) == 37) { play_mario_heavy_landing_sound(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); @@ -723,7 +713,7 @@ s32 act_death_on_stomach(struct MarioState *m) { return FALSE; } -s32 act_quicksand_death(struct MarioState *m) { +s32 act_quicksand_death(struct MarioState* m) { if (m->actionState == 0) { set_mario_animation(m, MARIO_ANIM_DYING_IN_QUICKSAND); set_anim_to_frame(m, 60); @@ -743,7 +733,7 @@ s32 act_quicksand_death(struct MarioState *m) { return FALSE; } -s32 act_eaten_by_bubba(struct MarioState *m) { +s32 act_eaten_by_bubba(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_DYING, MARIO_ACTION_SOUND_PLAYED); set_mario_animation(m, MARIO_ANIM_A_POSE); m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; @@ -756,7 +746,7 @@ s32 act_eaten_by_bubba(struct MarioState *m) { // set animation and forwardVel; when perform_air_step returns AIR_STEP_LANDED, // set the new action -s32 launch_mario_until_land(struct MarioState *m, s32 endAction, s32 animation, f32 forwardVel) { +s32 launch_mario_until_land(struct MarioState* m, s32 endAction, s32 animation, f32 forwardVel) { s32 airStepLanded; mario_set_forward_vel(m, forwardVel); set_mario_animation(m, animation); @@ -767,7 +757,7 @@ s32 launch_mario_until_land(struct MarioState *m, s32 endAction, s32 animation, return airStepLanded; } -s32 act_unlocking_key_door(struct MarioState *m) { +s32 act_unlocking_key_door(struct MarioState* m) { m->faceAngle[1] = m->usedObj->oMoveAngleYaw; m->pos[0] = m->usedObj->oPosX + coss(m->faceAngle[1]) * 75.0f; @@ -809,7 +799,7 @@ s32 act_unlocking_key_door(struct MarioState *m) { return FALSE; } -s32 act_unlocking_star_door(struct MarioState *m) { +s32 act_unlocking_star_door(struct MarioState* m) { switch (m->actionState) { case 0: m->faceAngle[1] = m->usedObj->oMoveAngleYaw; @@ -850,7 +840,7 @@ s32 act_unlocking_star_door(struct MarioState *m) { return FALSE; } -s32 act_entering_star_door(struct MarioState *m) { +s32 act_entering_star_door(struct MarioState* m) { f32 targetDX; f32 targetDZ; s16 targetAngle; @@ -911,7 +901,7 @@ s32 act_entering_star_door(struct MarioState *m) { return FALSE; } -s32 act_going_through_door(struct MarioState *m) { +s32 act_going_through_door(struct MarioState* m) { if (m->actionTimer == 0) { if (m->actionArg & 1) { m->interactObj->oInteractStatus = INT_STATUS_UNK16; @@ -943,7 +933,7 @@ s32 act_going_through_door(struct MarioState *m) { return FALSE; } -s32 act_warp_door_spawn(struct MarioState *m) { +s32 act_warp_door_spawn(struct MarioState* m) { if (m->actionState == 0) { m->actionState = 1; if (m->actionArg & 1) { @@ -963,8 +953,8 @@ s32 act_warp_door_spawn(struct MarioState *m) { return FALSE; } -s32 act_emerge_from_pipe(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_emerge_from_pipe(struct MarioState* m) { + struct Object* marioObj = m->marioObj; if (m->actionTimer++ < 11) { marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; @@ -990,7 +980,7 @@ s32 act_emerge_from_pipe(struct MarioState *m) { return FALSE; } -s32 act_spawn_spin_airborne(struct MarioState *m) { +s32 act_spawn_spin_airborne(struct MarioState* m) { // entered water, exit action if (m->pos[1] < m->waterLevel - 100) { load_level_init_text(0); @@ -1022,7 +1012,7 @@ s32 act_spawn_spin_airborne(struct MarioState *m) { return FALSE; } -s32 act_spawn_spin_landing(struct MarioState *m) { +s32 act_spawn_spin_landing(struct MarioState* m) { stop_and_set_height_to_floor(m); set_mario_animation(m, MARIO_ANIM_GENERAL_LAND); if (is_anim_at_end(m)) { @@ -1042,9 +1032,9 @@ s32 act_spawn_spin_landing(struct MarioState *m) { * his heal counter to 31 to restore 7.75 units of his health, and enable the * particle flag that generates sparkles. */ -s32 act_exit_airborne(struct MarioState *m) { - if (15 < m->actionTimer++ - && launch_mario_until_land(m, ACT_EXIT_LAND_SAVE_DIALOG, MARIO_ANIM_GENERAL_FALL, -32.0f)) { +s32 act_exit_airborne(struct MarioState* m) { + if (15 < m->actionTimer++ && + launch_mario_until_land(m, ACT_EXIT_LAND_SAVE_DIALOG, MARIO_ANIM_GENERAL_FALL, -32.0f)) { // heal Mario m->healCounter = 31; } @@ -1054,7 +1044,7 @@ s32 act_exit_airborne(struct MarioState *m) { return FALSE; } -s32 act_falling_exit_airborne(struct MarioState *m) { +s32 act_falling_exit_airborne(struct MarioState* m) { if (launch_mario_until_land(m, ACT_EXIT_LAND_SAVE_DIALOG, MARIO_ANIM_GENERAL_FALL, 0.0f)) { // heal Mario m->healCounter = 31; @@ -1065,18 +1055,16 @@ s32 act_falling_exit_airborne(struct MarioState *m) { return FALSE; } -s32 act_exit_land_save_dialog(struct MarioState *m) { +s32 act_exit_land_save_dialog(struct MarioState* m) { s32 animFrame; stationary_ground_step(m); play_mario_landing_sound_once(m, SOUND_ACTION_TERRAIN_LANDING); switch (m->actionState) { // determine type of exit case 0: - set_mario_animation(m, m->actionArg == 0 ? MARIO_ANIM_GENERAL_LAND - : MARIO_ANIM_LAND_FROM_SINGLE_JUMP); + set_mario_animation(m, m->actionArg == 0 ? MARIO_ANIM_GENERAL_LAND : MARIO_ANIM_LAND_FROM_SINGLE_JUMP); if (is_anim_past_end(m)) { - if (gLastCompletedCourseNum != COURSE_BITDW - && gLastCompletedCourseNum != COURSE_BITFS) { + if (gLastCompletedCourseNum != COURSE_BITDW && gLastCompletedCourseNum != COURSE_BITFS) { enable_time_stop(); } @@ -1087,8 +1075,7 @@ s32 act_exit_land_save_dialog(struct MarioState *m) { if (!(m->flags & MARIO_CAP_ON_HEAD)) { m->actionState = 2; // star exit without cap } - if (gLastCompletedCourseNum == COURSE_BITDW - || gLastCompletedCourseNum == COURSE_BITFS) { + if (gLastCompletedCourseNum == COURSE_BITDW || gLastCompletedCourseNum == COURSE_BITFS) { m->actionState = 1; // key exit } } @@ -1148,9 +1135,8 @@ s32 act_exit_land_save_dialog(struct MarioState *m) { return FALSE; } -s32 act_death_exit(struct MarioState *m) { - if (15 < m->actionTimer++ - && launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, -32.0f)) { +s32 act_death_exit(struct MarioState* m) { + if (15 < m->actionTimer++ && launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, -32.0f)) { play_sound(ROM_JP ? SOUND_MARIO_OOOF : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject); #if ENABLE_RUMBLE queue_rumble_data(5, 80); @@ -1166,7 +1152,7 @@ s32 act_death_exit(struct MarioState *m) { return FALSE; } -s32 act_unused_death_exit(struct MarioState *m) { +s32 act_unused_death_exit(struct MarioState* m) { if (launch_mario_until_land(m, ACT_FREEFALL_LAND_STOP, MARIO_ANIM_GENERAL_FALL, 0.0f)) { play_sound(ROM_JP ? SOUND_MARIO_OOOF : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject); CALL_CANCELLABLE_EVENT(PlayerLivesChange, m, -1) { @@ -1180,7 +1166,7 @@ s32 act_unused_death_exit(struct MarioState *m) { return FALSE; } -s32 act_falling_death_exit(struct MarioState *m) { +s32 act_falling_death_exit(struct MarioState* m) { if (launch_mario_until_land(m, ACT_DEATH_EXIT_LAND, MARIO_ANIM_GENERAL_FALL, 0.0f)) { play_sound(ROM_JP ? SOUND_MARIO_OOOF : SOUND_MARIO_OOOF2, m->marioObj->header.gfx.cameraToObject); #if ENABLE_RUMBLE @@ -1198,8 +1184,8 @@ s32 act_falling_death_exit(struct MarioState *m) { } // waits 11 frames before actually executing, also has reduced fvel -s32 act_special_exit_airborne(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_special_exit_airborne(struct MarioState* m) { + struct Object* marioObj = m->marioObj; play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED); @@ -1223,8 +1209,8 @@ s32 act_special_exit_airborne(struct MarioState *m) { return FALSE; } -s32 act_special_death_exit(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +s32 act_special_death_exit(struct MarioState* m) { + struct Object* marioObj = m->marioObj; if (m->actionTimer++ < 11) { marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; @@ -1248,7 +1234,7 @@ s32 act_special_death_exit(struct MarioState *m) { return FALSE; } -s32 act_spawn_no_spin_airborne(struct MarioState *m) { +s32 act_spawn_no_spin_airborne(struct MarioState* m) { launch_mario_until_land(m, ACT_SPAWN_NO_SPIN_LANDING, MARIO_ANIM_GENERAL_FALL, 0.0f); if (m->pos[1] < m->waterLevel - 100) { set_water_plunge_action(m); @@ -1256,7 +1242,7 @@ s32 act_spawn_no_spin_airborne(struct MarioState *m) { return FALSE; } -s32 act_spawn_no_spin_landing(struct MarioState *m) { +s32 act_spawn_no_spin_landing(struct MarioState* m) { play_mario_landing_sound_once(m, SOUND_ACTION_TERRAIN_LANDING); set_mario_animation(m, MARIO_ANIM_GENERAL_LAND); stop_and_set_height_to_floor(m); @@ -1267,7 +1253,7 @@ s32 act_spawn_no_spin_landing(struct MarioState *m) { return FALSE; } -s32 act_bbh_enter_spin(struct MarioState *m) { +s32 act_bbh_enter_spin(struct MarioState* m) { f32 floorDist; f32 scale; f32 cageDX; @@ -1351,13 +1337,12 @@ s32 act_bbh_enter_spin(struct MarioState *m) { return FALSE; } -s32 act_bbh_enter_jump(struct MarioState *m) { +s32 act_bbh_enter_jump(struct MarioState* m) { f32 cageDX; f32 cageDZ; f32 cageDist; - play_mario_action_sound( - m, m->flags & MARIO_METAL_CAP ? SOUND_ACTION_METAL_JUMP : SOUND_ACTION_TERRAIN_JUMP, 1); + play_mario_action_sound(m, m->flags & MARIO_METAL_CAP ? SOUND_ACTION_METAL_JUMP : SOUND_ACTION_TERRAIN_JUMP, 1); play_mario_jump_sound(m); if (m->actionState == 0) { @@ -1383,10 +1368,9 @@ s32 act_bbh_enter_jump(struct MarioState *m) { return FALSE; } -s32 act_teleport_fade_out(struct MarioState *m) { +s32 act_teleport_fade_out(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_ACTION_TELEPORT, MARIO_ACTION_SOUND_PLAYED); - set_mario_animation(m, m->prevAction == ACT_CROUCHING ? MARIO_ANIM_CROUCHING - : MARIO_ANIM_FIRST_PERSON); + set_mario_animation(m, m->prevAction == ACT_CROUCHING ? MARIO_ANIM_CROUCHING : MARIO_ANIM_FIRST_PERSON); #if ENABLE_RUMBLE if (m->actionTimer == 0) { @@ -1410,7 +1394,7 @@ s32 act_teleport_fade_out(struct MarioState *m) { return FALSE; } -s32 act_teleport_fade_in(struct MarioState *m) { +s32 act_teleport_fade_in(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_ACTION_TELEPORT, MARIO_ACTION_SOUND_PLAYED); set_mario_animation(m, MARIO_ANIM_FIRST_PERSON); @@ -1445,7 +1429,7 @@ s32 act_teleport_fade_in(struct MarioState *m) { return FALSE; } -s32 act_shocked(struct MarioState *m) { +s32 act_shocked(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED); play_sound(SOUND_MOVING_SHOCKED, m->marioObj->header.gfx.cameraToObject); set_camera_shake_from_hit(SHAKE_SHOCK); @@ -1472,7 +1456,7 @@ s32 act_shocked(struct MarioState *m) { return FALSE; } -s32 act_squished(struct MarioState *m) { +s32 act_squished(struct MarioState* m) { UNUSED u8 filler[4]; f32 squishAmount; f32 spaceUnderCeil; @@ -1495,8 +1479,7 @@ s32 act_squished(struct MarioState *m) { if (spaceUnderCeil >= 10.1f) { // Mario becomes a pancake squishAmount = spaceUnderCeil / 160.0f; - vec3f_set(m->marioObj->header.gfx.scale, 2.0f - squishAmount, squishAmount, - 2.0f - squishAmount); + vec3f_set(m->marioObj->header.gfx.scale, 2.0f - squishAmount, squishAmount, 2.0f - squishAmount); } else { if (!(m->flags & MARIO_METAL_CAP) && m->invincTimer == 0) { // cap on: 3 units; cap off: 4.5 units @@ -1574,7 +1557,7 @@ s32 act_squished(struct MarioState *m) { return FALSE; } -s32 act_putting_on_cap(struct MarioState *m) { +s32 act_putting_on_cap(struct MarioState* m) { s32 animFrame = set_mario_animation(m, MARIO_ANIM_PUT_CAP_ON); if (animFrame == 0) { @@ -1594,8 +1577,8 @@ s32 act_putting_on_cap(struct MarioState *m) { return FALSE; } -void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFrame, s32 target2, - s32 target3, s32 endAction) { +void stuck_in_ground_handler(struct MarioState* m, s32 animation, s32 unstuckFrame, s32 target2, s32 target3, + s32 endAction) { s32 animFrame = set_mario_animation(m, animation); if (m->input & INPUT_A_PRESSED) { @@ -1624,17 +1607,17 @@ void stuck_in_ground_handler(struct MarioState *m, s32 animation, s32 unstuckFra } } -s32 act_head_stuck_in_ground(struct MarioState *m) { +s32 act_head_stuck_in_ground(struct MarioState* m) { stuck_in_ground_handler(m, MARIO_ANIM_HEAD_STUCK_IN_GROUND, 96, 105, 135, ACT_IDLE); return FALSE; } -s32 act_butt_stuck_in_ground(struct MarioState *m) { +s32 act_butt_stuck_in_ground(struct MarioState* m) { stuck_in_ground_handler(m, MARIO_ANIM_BOTTOM_STUCK_IN_GROUND, 127, 136, -2, ACT_GROUND_POUND_LAND); return FALSE; } -s32 act_feet_stuck_in_ground(struct MarioState *m) { +s32 act_feet_stuck_in_ground(struct MarioState* m) { stuck_in_ground_handler(m, MARIO_ANIM_LEGS_STUCK_IN_GROUND, 116, 129, -2, ACT_IDLE); return FALSE; } @@ -1644,13 +1627,13 @@ s32 act_feet_stuck_in_ground(struct MarioState *m) { * Resets action state and action timer, adds 1 to the action arg (responsible * for keeping track of what step of the cutscene Mario is in.) */ -static void advance_cutscene_step(struct MarioState *m) { +static void advance_cutscene_step(struct MarioState* m) { m->actionState = 0; m->actionTimer = 0; m->actionArg++; } -static void intro_cutscene_hide_hud_and_mario(struct MarioState *m) { +static void intro_cutscene_hide_hud_and_mario(struct MarioState* m) { gHudDisplay.flags = HUD_DISPLAY_NONE; m->statusForCamera->cameraEvent = CAM_EVENT_START_INTRO; m->marioObj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; @@ -1658,17 +1641,16 @@ static void intro_cutscene_hide_hud_and_mario(struct MarioState *m) { } #ifdef VERSION_EU - #define TIMER_SPAWN_PIPE 47 +#define TIMER_SPAWN_PIPE 47 #else - #define TIMER_SPAWN_PIPE 37 +#define TIMER_SPAWN_PIPE 37 #endif -static void intro_cutscene_peach_lakitu_scene(struct MarioState *m) { - if ((s16) m->statusForCamera->cameraEvent != CAM_EVENT_START_INTRO) { +static void intro_cutscene_peach_lakitu_scene(struct MarioState* m) { + if ((s16)m->statusForCamera->cameraEvent != CAM_EVENT_START_INTRO) { if (m->actionTimer++ == TIMER_SPAWN_PIPE) { - sIntroWarpPipeObj = - spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_CASTLE_GROUNDS_WARP_PIPE, - bhvStaticObject, -1328, 60, 4664, 0, 180, 0); + sIntroWarpPipeObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_CASTLE_GROUNDS_WARP_PIPE, + bhvStaticObject, -1328, 60, 4664, 0, 180, 0); advance_cutscene_step(m); } } @@ -1676,12 +1658,12 @@ static void intro_cutscene_peach_lakitu_scene(struct MarioState *m) { #undef TIMER_SPAWN_PIPE #ifdef VERSION_EU - #define TIMER_RAISE_PIPE 28 +#define TIMER_RAISE_PIPE 28 #else - #define TIMER_RAISE_PIPE 38 +#define TIMER_RAISE_PIPE 38 #endif -static void intro_cutscene_raise_pipe(struct MarioState *m) { +static void intro_cutscene_raise_pipe(struct MarioState* m) { sIntroWarpPipeObj->oPosY = camera_approach_f32_symmetric(sIntroWarpPipeObj->oPosY, 260.0f, 10.0f); if (m->actionTimer == 0) { @@ -1695,7 +1677,7 @@ static void intro_cutscene_raise_pipe(struct MarioState *m) { } #undef TIMER_RAISE_PIPE -static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) { +static void intro_cutscene_jump_out_of_pipe(struct MarioState* m) { if (m->actionTimer == 25) { gHudDisplay.flags = HUD_DISPLAY_DEFAULT; } @@ -1709,7 +1691,7 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) { play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED); #else play_sound_if_no_flag(m, SOUND_MARIO_YAHOO, MARIO_MARIO_SOUND_PLAYED); - if(!ROM_JP) { + if (!ROM_JP) { play_sound_if_no_flag(m, SOUND_ACTION_HIT_3, MARIO_ACTION_SOUND_PLAYED); } #endif @@ -1719,7 +1701,7 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) { if (perform_air_step(m, 0) == AIR_STEP_LANDED) { sound_banks_enable(SEQ_PLAYER_SFX, SOUND_BANKS_DISABLED_DURING_INTRO_CUTSCENE); play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_MARIO_HAHA, m->marioObj->header.gfx.cameraToObject); } advance_cutscene_step(m); @@ -1727,7 +1709,7 @@ static void intro_cutscene_jump_out_of_pipe(struct MarioState *m) { } } -static void intro_cutscene_land_outside_pipe(struct MarioState *m) { +static void intro_cutscene_land_outside_pipe(struct MarioState* m) { set_mario_animation(m, MARIO_ANIM_LAND_FROM_SINGLE_JUMP); if (is_anim_at_end(m)) { @@ -1737,7 +1719,7 @@ static void intro_cutscene_land_outside_pipe(struct MarioState *m) { stop_and_set_height_to_floor(m); } -static void intro_cutscene_lower_pipe(struct MarioState *m) { +static void intro_cutscene_lower_pipe(struct MarioState* m) { if (m->actionTimer++ == 0) { play_sound(SOUND_MENU_ENTER_PIPE, sIntroWarpPipeObj->header.gfx.cameraToObject); set_mario_animation(m, MARIO_ANIM_FIRST_PERSON); @@ -1752,7 +1734,7 @@ static void intro_cutscene_lower_pipe(struct MarioState *m) { stop_and_set_height_to_floor(m); } -static void intro_cutscene_set_mario_to_idle(struct MarioState *m) { +static void intro_cutscene_set_mario_to_idle(struct MarioState* m) { if (gCamera->cutscene == 0) { gCameraMovementFlags &= ~CAM_MOVE_C_UP_MODE; set_mario_action(m, ACT_IDLE, 0); @@ -1771,7 +1753,7 @@ enum { INTRO_CUTSCENE_SET_MARIO_TO_IDLE }; -static s32 act_intro_cutscene(struct MarioState *m) { +static s32 act_intro_cutscene(struct MarioState* m) { switch (m->actionArg) { case INTRO_CUTSCENE_HIDE_HUD_AND_MARIO: intro_cutscene_hide_hud_and_mario(m); @@ -1799,7 +1781,7 @@ static s32 act_intro_cutscene(struct MarioState *m) { } // jumbo star cutscene: Mario lands after grabbing the jumbo star -static void jumbo_star_cutscene_falling(struct MarioState *m) { +static void jumbo_star_cutscene_falling(struct MarioState* m) { if (m->actionState == 0) { m->input |= INPUT_A_DOWN; m->flags |= (MARIO_WING_CAP | MARIO_CAP_ON_HEAD); @@ -1826,8 +1808,8 @@ static void jumbo_star_cutscene_falling(struct MarioState *m) { } // jumbo star cutscene: Mario takes off -static s32 jumbo_star_cutscene_taking_off(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +static s32 jumbo_star_cutscene_taking_off(struct MarioState* m) { + struct Object* marioObj = m->marioObj; s32 animFrame; if (m->actionState == 0) { @@ -1849,8 +1831,7 @@ static s32 jumbo_star_cutscene_taking_off(struct MarioState *m) { switch (animFrame) { case 3: - play_sound(SOUND_MARIO_YAH_WAH_HOO + (gAudioRandom % 3 << 16), - m->marioObj->header.gfx.cameraToObject); + play_sound(SOUND_MARIO_YAH_WAH_HOO + (gAudioRandom % 3 << 16), m->marioObj->header.gfx.cameraToObject); break; case 28: @@ -1879,9 +1860,9 @@ static s32 jumbo_star_cutscene_taking_off(struct MarioState *m) { } // jumbo star cutscene: Mario flying -static s32 jumbo_star_cutscene_flying(struct MarioState *m) { +static s32 jumbo_star_cutscene_flying(struct MarioState* m) { Vec3f targetPos; - UNUSED struct Object *marioObj = m->marioObj; + UNUSED struct Object* marioObj = m->marioObj; f32 targetDX; f32 targetDY; f32 targetDZ; @@ -1931,7 +1912,7 @@ static s32 jumbo_star_cutscene_flying(struct MarioState *m) { enum { JUMBO_STAR_CUTSCENE_FALLING, JUMBO_STAR_CUTSCENE_TAKING_OFF, JUMBO_STAR_CUTSCENE_FLYING }; -static s32 act_jumbo_star_cutscene(struct MarioState *m) { +static s32 act_jumbo_star_cutscene(struct MarioState* m) { switch (m->actionArg) { case JUMBO_STAR_CUTSCENE_FALLING: jumbo_star_cutscene_falling(m); @@ -1954,16 +1935,16 @@ void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius) { s16 offsetY = radius * sins(sSparkleGenTheta); s16 offsetZ = radius * coss(sSparkleGenTheta) * coss(sSparkleGenPhi); - spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_NONE, bhvSparkleSpawn, x + offsetX, y + offsetY, - z + offsetZ, 0, 0, 0); + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_NONE, bhvSparkleSpawn, x + offsetX, y + offsetY, z + offsetZ, 0, + 0, 0); //! copy paste error offsetX = offsetX * 4 / 3; offsetX = offsetY * 4 / 3; offsetX = offsetZ * 4 / 3; - spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_NONE, bhvSparkleSpawn, x - offsetX, y - offsetY, - z - offsetZ, 0, 0, 0); + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_NONE, bhvSparkleSpawn, x - offsetX, y - offsetY, z - offsetZ, 0, + 0, 0); sSparkleGenTheta += 0x3800; sSparkleGenPhi += 0x6000; @@ -1971,8 +1952,8 @@ void generate_yellow_sparkles(s16 x, s16 y, s16 z, f32 radius) { // not sure what this does, returns the height of the floor. // (animation related?) -static f32 end_obj_set_visual_pos(struct Object *o) { - struct Surface *surf; +static f32 end_obj_set_visual_pos(struct Object* o) { + struct Surface* surf; Vec3s sp24; f32 sp20; f32 sp1C; @@ -1988,7 +1969,7 @@ static f32 end_obj_set_visual_pos(struct Object *o) { } // make Mario fall and soften wing cap gravity -static void end_peach_cutscene_mario_falling(struct MarioState *m) { +static void end_peach_cutscene_mario_falling(struct MarioState* m) { if (m->actionTimer == 1) { m->statusForCamera->cameraEvent = CAM_EVENT_START_ENDING; } @@ -2006,7 +1987,7 @@ static void end_peach_cutscene_mario_falling(struct MarioState *m) { } // set Mario on the ground, wait and spawn the jumbo star outside the castle. -static void end_peach_cutscene_mario_landing(struct MarioState *m) { +static void end_peach_cutscene_mario_landing(struct MarioState* m) { set_mario_animation(m, MARIO_ANIM_GENERAL_LAND); stop_and_set_height_to_floor(m); @@ -2014,17 +1995,16 @@ static void end_peach_cutscene_mario_landing(struct MarioState *m) { // make wing cap run out m->capTimer = 60; - sEndJumboStarObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, bhvStaticObject, 0, - 2528, -1800, 0, 0, 0); + sEndJumboStarObj = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, bhvStaticObject, 0, 2528, -1800, 0, 0, 0); obj_scale(sEndJumboStarObj, 3.0); advance_cutscene_step(m); } } // raise hand animation, lower hand animation, do some special effects -static void end_peach_cutscene_summon_jumbo_star(struct MarioState *m) { - set_mario_animation(m, m->actionState == 0 ? MARIO_ANIM_CREDITS_RAISE_HAND - : MARIO_ANIM_CREDITS_LOWER_HAND); +static void end_peach_cutscene_summon_jumbo_star(struct MarioState* m) { + set_mario_animation(m, m->actionState == 0 ? MARIO_ANIM_CREDITS_RAISE_HAND : MARIO_ANIM_CREDITS_LOWER_HAND); if (m->actionState == 0 && is_anim_past_end(m)) { m->actionState++; @@ -2042,18 +2022,18 @@ static void end_peach_cutscene_summon_jumbo_star(struct MarioState *m) { } #if defined(VERSION_EU) - #define TIMER_FADE_IN_PEACH 201 - #define TIMER_DESCEND_PEACH 280 +#define TIMER_FADE_IN_PEACH 201 +#define TIMER_DESCEND_PEACH 280 #elif defined(VERSION_SH) - #define TIMER_FADE_IN_PEACH 276 - #define TIMER_DESCEND_PEACH 400 +#define TIMER_FADE_IN_PEACH 276 +#define TIMER_DESCEND_PEACH 400 #else - #define TIMER_FADE_IN_PEACH 276 - #define TIMER_DESCEND_PEACH 355 +#define TIMER_FADE_IN_PEACH 276 +#define TIMER_DESCEND_PEACH 355 #endif // free peach from the stained glass window -static void end_peach_cutscene_spawn_peach(struct MarioState *m) { +static void end_peach_cutscene_spawn_peach(struct MarioState* m) { if (m->actionTimer == 1) { play_transition(WARP_TRANSITION_FADE_INTO_COLOR, 14, 255, 255, 255); } @@ -2066,15 +2046,14 @@ static void end_peach_cutscene_spawn_peach(struct MarioState *m) { if (m->actionTimer == 40) { obj_mark_for_deletion(sEndJumboStarObj); - sEndPeachObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_PEACH, bhvEndPeach, 0, 2428, - -1300, 0, 0, 0); + sEndPeachObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_PEACH, bhvEndPeach, 0, 2428, -1300, 0, 0, 0); gCutsceneFocus = sEndPeachObj; - sEndRightToadObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, 200, - 906, -1290, 0, 0, 0); + sEndRightToadObj = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, 200, 906, -1290, 0, 0, 0); - sEndLeftToadObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, -200, - 906, -1290, 0, 0, 0); + sEndLeftToadObj = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, -200, 906, -1290, 0, 0, 0); sEndPeachObj->oOpacity = 127; sEndRightToadObj->oOpacity = 255; @@ -2104,13 +2083,13 @@ static void end_peach_cutscene_spawn_peach(struct MarioState *m) { } #ifdef VERSION_EU - #define TIMER_RUN_TO_PEACH 531 +#define TIMER_RUN_TO_PEACH 531 #else - #define TIMER_RUN_TO_PEACH 584 +#define TIMER_RUN_TO_PEACH 584 #endif // descend peach -static void end_peach_cutscene_descend_peach(struct MarioState *m) { +static void end_peach_cutscene_descend_peach(struct MarioState* m) { generate_yellow_sparkles(0, sEndPeachObj->oPosY, -1300, 150.0f); if (sEndPeachObj->oPosY >= 1300.0f) { @@ -2138,8 +2117,8 @@ static void end_peach_cutscene_descend_peach(struct MarioState *m) { #undef TIMER_RUN_TO_PEACH // Mario runs to peach -static void end_peach_cutscene_run_to_peach(struct MarioState *m) { - struct Surface *surf; +static void end_peach_cutscene_run_to_peach(struct MarioState* m) { + struct Surface* surf; if (m->actionTimer == 22) { sEndPeachAnimation = 5; @@ -2162,9 +2141,9 @@ static void end_peach_cutscene_run_to_peach(struct MarioState *m) { // dialog 1 // "Mario!" // "The power of the Stars is restored to the castle..." -static void end_peach_cutscene_dialog_1(struct MarioState *m) { - s32 animFrame = set_mario_animation(m, m->actionState == 0 ? MARIO_ANIM_CREDITS_TAKE_OFF_CAP - : MARIO_ANIM_CREDITS_LOOK_UP); +static void end_peach_cutscene_dialog_1(struct MarioState* m) { + s32 animFrame = + set_mario_animation(m, m->actionState == 0 ? MARIO_ANIM_CREDITS_TAKE_OFF_CAP : MARIO_ANIM_CREDITS_LOOK_UP); if (m->actionState == 0) { if (animFrame == 8) { @@ -2216,7 +2195,7 @@ static void end_peach_cutscene_dialog_1(struct MarioState *m) { case 230: #endif set_cutscene_message(160, 227, 0, 30); - if(!ROM_JP) { + if (!ROM_JP) { seq_player_lower_volume(SEQ_PLAYER_LEVEL, 60, 40); play_sound(SOUND_PEACH_MARIO, sEndPeachObj->header.gfx.cameraToObject); } @@ -2237,7 +2216,7 @@ static void end_peach_cutscene_dialog_1(struct MarioState *m) { case 290: #endif set_cutscene_message(160, 227, 1, 60); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_POWER_OF_THE_STARS, sEndPeachObj->header.gfx.cameraToObject); } break; @@ -2253,21 +2232,21 @@ static void end_peach_cutscene_dialog_1(struct MarioState *m) { } #if defined(VERSION_EU) - #define TIMER_SOMETHING_SPECIAL 150 - #define TIMER_PEACH_KISS 260 +#define TIMER_SOMETHING_SPECIAL 150 +#define TIMER_PEACH_KISS 260 #elif defined(VERSION_SH) - #define TIMER_SOMETHING_SPECIAL 170 - #define TIMER_PEACH_KISS 250 +#define TIMER_SOMETHING_SPECIAL 170 +#define TIMER_PEACH_KISS 250 #else - #define TIMER_SOMETHING_SPECIAL 130 - #define TIMER_PEACH_KISS 200 +#define TIMER_SOMETHING_SPECIAL 130 +#define TIMER_PEACH_KISS 200 #endif // dialog 2 // "...and it's all thanks to you!" // "Thank you Mario!" // "We have to do something special for you..." -static void end_peach_cutscene_dialog_2(struct MarioState *m) { +static void end_peach_cutscene_dialog_2(struct MarioState* m) { sEndPeachAnimation = 9; switch (m->actionTimer) { @@ -2277,7 +2256,7 @@ static void end_peach_cutscene_dialog_2(struct MarioState *m) { case 29: #endif set_cutscene_message(160, 227, 2, 30); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_THANKS_TO_YOU, sEndPeachObj->header.gfx.cameraToObject); } break; @@ -2296,14 +2275,14 @@ static void end_peach_cutscene_dialog_2(struct MarioState *m) { case 75: #endif set_cutscene_message(160, 227, 3, 30); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_THANK_YOU_MARIO, sEndPeachObj->header.gfx.cameraToObject); } break; case TIMER_SOMETHING_SPECIAL: set_cutscene_message(160, 227, 4, 40); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_SOMETHING_SPECIAL, sEndPeachObj->header.gfx.cameraToObject); } break; @@ -2326,7 +2305,7 @@ static u8 sMarioBlinkOverride[20] = { MARIO_EYES_HALF_CLOSED, MARIO_EYES_HALF_CLOSED, MARIO_EYES_CLOSED, MARIO_EYES_CLOSED, }; -static void end_peach_cutscene_kiss_from_peach(struct MarioState *m) { +static void end_peach_cutscene_kiss_from_peach(struct MarioState* m) { sEndPeachAnimation = 10; if (m->actionTimer >= 90) { @@ -2369,7 +2348,7 @@ static void end_peach_cutscene_kiss_from_peach(struct MarioState *m) { } } -static void end_peach_cutscene_star_dance(struct MarioState *m) { +static void end_peach_cutscene_star_dance(struct MarioState* m) { s32 animFrame = set_mario_animation(m, MARIO_ANIM_CREDITS_PEACE_SIGN); if (animFrame == 77) { @@ -2404,7 +2383,7 @@ static void end_peach_cutscene_star_dance(struct MarioState *m) { break; case 140: - if(!ROM_JP) { + if (!ROM_JP) { seq_player_unlower_volume(SEQ_PLAYER_LEVEL, 60); } play_cutscene_music(SEQUENCE_ARGS(15, SEQ_EVENT_CUTSCENE_CREDITS)); @@ -2420,7 +2399,7 @@ static void end_peach_cutscene_star_dance(struct MarioState *m) { // "Listen everybody" // "let's bake a delicious cake..." // "...for Mario..." -static void end_peach_cutscene_dialog_3(struct MarioState *m) { +static void end_peach_cutscene_dialog_3(struct MarioState* m) { set_mario_animation(m, MARIO_ANIM_FIRST_PERSON); sEndPeachObj->oPosY = end_obj_set_visual_pos(sEndPeachObj); @@ -2434,7 +2413,7 @@ static void end_peach_cutscene_dialog_3(struct MarioState *m) { sEndToadAnims[1] = 2; D_8032CBE8 = 1; set_cutscene_message(160, 227, 5, 30); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_BAKE_A_CAKE, sEndPeachObj->header.gfx.cameraToObject); } break; @@ -2445,7 +2424,7 @@ static void end_peach_cutscene_dialog_3(struct MarioState *m) { case 130: set_cutscene_message(160, 227, 7, 50); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_FOR_MARIO, sEndPeachObj->header.gfx.cameraToObject); } break; @@ -2457,7 +2436,7 @@ static void end_peach_cutscene_dialog_3(struct MarioState *m) { } // "Mario!" -static void end_peach_cutscene_run_to_castle(struct MarioState *m) { +static void end_peach_cutscene_run_to_castle(struct MarioState* m) { set_mario_animation(m, m->actionState == 0 ? MARIO_ANIM_CREDITS_START_WALK_LOOK_UP : MARIO_ANIM_CREDITS_LOOK_BACK_THEN_RUN); @@ -2469,7 +2448,7 @@ static void end_peach_cutscene_run_to_castle(struct MarioState *m) { if (m->actionTimer == 95) { set_cutscene_message(160, 227, 0, 40); - if(!ROM_JP) { + if (!ROM_JP) { play_sound(SOUND_PEACH_MARIO2, sEndPeachObj->header.gfx.cameraToObject); } } @@ -2478,7 +2457,7 @@ static void end_peach_cutscene_run_to_castle(struct MarioState *m) { } } -static void end_peach_cutscene_fade_out(struct MarioState *m) { +static void end_peach_cutscene_fade_out(struct MarioState* m) { if (m->actionState == 0) { level_trigger_warp(m, WARP_OP_CREDITS_NEXT); gPaintingMarioYEntry = 1500.0f; // ensure medium water level in WDW credits cutscene @@ -2502,7 +2481,7 @@ enum { END_PEACH_CUTSCENE_FADE_OUT }; -static s32 act_end_peach_cutscene(struct MarioState *m) { +static s32 act_end_peach_cutscene(struct MarioState* m) { switch (m->actionArg) { case END_PEACH_CUTSCENE_MARIO_FALLING: end_peach_cutscene_mario_falling(m); @@ -2557,20 +2536,20 @@ static s32 act_end_peach_cutscene(struct MarioState *m) { } #if defined(VERSION_EU) - #define TIMER_CREDITS_SHOW 51 - #define TIMER_CREDITS_PROGRESS 80 - #define TIMER_CREDITS_WARP 160 +#define TIMER_CREDITS_SHOW 51 +#define TIMER_CREDITS_PROGRESS 80 +#define TIMER_CREDITS_WARP 160 #elif defined(VERSION_SH) - #define TIMER_CREDITS_SHOW 61 - #define TIMER_CREDITS_PROGRESS 90 - #define TIMER_CREDITS_WARP 204 +#define TIMER_CREDITS_SHOW 61 +#define TIMER_CREDITS_PROGRESS 90 +#define TIMER_CREDITS_WARP 204 #else - #define TIMER_CREDITS_SHOW 61 - #define TIMER_CREDITS_PROGRESS 90 - #define TIMER_CREDITS_WARP 200 +#define TIMER_CREDITS_SHOW 61 +#define TIMER_CREDITS_PROGRESS 90 +#define TIMER_CREDITS_WARP 200 #endif -static s32 act_credits_cutscene(struct MarioState *m) { +static s32 act_credits_cutscene(struct MarioState* m) { s32 width; s32 height; @@ -2602,10 +2581,8 @@ static s32 act_credits_cutscene(struct MarioState *m) { sEndCutsceneVp.vp.vscale[0] = 640 - width; sEndCutsceneVp.vp.vscale[1] = 480 - height; - sEndCutsceneVp.vp.vtrans[0] = - (gCurrCreditsEntry->unk02 & 0x10 ? width : -width) * 56 / 100 + 640; - sEndCutsceneVp.vp.vtrans[1] = - (gCurrCreditsEntry->unk02 & 0x20 ? height : -height) * 66 / 100 + 480; + sEndCutsceneVp.vp.vtrans[0] = (gCurrCreditsEntry->unk02 & 0x10 ? width : -width) * 56 / 100 + 640; + sEndCutsceneVp.vp.vtrans[1] = (gCurrCreditsEntry->unk02 & 0x20 ? height : -height) * 66 / 100 + 480; override_viewport_and_clip(&sEndCutsceneVp, 0, 0, 0, 0); } @@ -2627,18 +2604,17 @@ static s32 act_credits_cutscene(struct MarioState *m) { return FALSE; } -static s32 act_end_waving_cutscene(struct MarioState *m) { +static s32 act_end_waving_cutscene(struct MarioState* m) { if (m->actionState == 0) { m->statusForCamera->cameraEvent = CAM_EVENT_START_END_WAVING; - sEndPeachObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_PEACH, bhvEndPeach, 60, 906, - -1180, 0, 0, 0); + sEndPeachObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_PEACH, bhvEndPeach, 60, 906, -1180, 0, 0, 0); - sEndRightToadObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, 180, - 906, -1170, 0, 0, 0); + sEndRightToadObj = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, 180, 906, -1170, 0, 0, 0); - sEndLeftToadObj = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, -180, - 906, -1170, 0, 0, 0); + sEndLeftToadObj = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_TOAD, bhvEndToad, -180, 906, -1170, 0, 0, 0); sEndPeachObj->oOpacity = 255; sEndRightToadObj->oOpacity = 255; @@ -2665,16 +2641,16 @@ static s32 act_end_waving_cutscene(struct MarioState *m) { return FALSE; } -static s32 check_for_instant_quicksand(struct MarioState *m) { - if (m->floor->type == SURFACE_INSTANT_QUICKSAND && m->action & ACT_FLAG_INVULNERABLE - && m->action != ACT_QUICKSAND_DEATH) { +static s32 check_for_instant_quicksand(struct MarioState* m) { + if (m->floor->type == SURFACE_INSTANT_QUICKSAND && m->action & ACT_FLAG_INVULNERABLE && + m->action != ACT_QUICKSAND_DEATH) { update_mario_sound_and_camera(m); return drop_and_set_mario_action(m, ACT_QUICKSAND_DEATH, 0); } return FALSE; } -s32 mario_execute_cutscene_action(struct MarioState *m) { +s32 mario_execute_cutscene_action(struct MarioState* m) { s32 cancel; if (check_for_instant_quicksand(m)) { diff --git a/src/game/mario_actions_moving.c b/src/game/mario_actions_moving.c index 0c0fe4db..b131b551 100644 --- a/src/game/mario_actions_moving.c +++ b/src/game/mario_actions_moving.c @@ -61,13 +61,13 @@ struct LandingAction sBackflipLandAction = { Mat4 sFloorAlignMatrix[2]; -s16 tilt_body_running(struct MarioState *m) { +s16 tilt_body_running(struct MarioState* m) { s16 pitch = find_floor_slope(m, 0); pitch = pitch * m->forwardVel / 40.0f; return -pitch; } -void play_step_sound(struct MarioState *m, s16 frame1, s16 frame2) { +void play_step_sound(struct MarioState* m, s16 frame1, s16 frame2) { if (is_anim_past_frame(m, frame1) || is_anim_past_frame(m, frame2)) { if (m->flags & MARIO_METAL_CAP) { if (m->marioObj->header.gfx.animInfo.animID == MARIO_ANIM_TIPTOE) { @@ -85,23 +85,23 @@ void play_step_sound(struct MarioState *m, s16 frame1, s16 frame2) { } } -void align_with_floor(struct MarioState *m) { +void align_with_floor(struct MarioState* m) { m->pos[1] = m->floorHeight; mtxf_align_terrain_triangle(sFloorAlignMatrix[m->unk00], m->pos, m->faceAngle[1], 40.0f); m->marioObj->header.gfx.throwMatrix = &sFloorAlignMatrix[m->unk00]; } -s32 begin_walking_action(struct MarioState *m, f32 forwardVel, u32 action, u32 actionArg) { +s32 begin_walking_action(struct MarioState* m, f32 forwardVel, u32 action, u32 actionArg) { m->faceAngle[1] = m->intendedYaw; mario_set_forward_vel(m, forwardVel); return set_mario_action(m, action, actionArg); } -void check_ledge_climb_down(struct MarioState *m) { +void check_ledge_climb_down(struct MarioState* m) { struct WallCollisionData wallCols; - struct Surface *floor; + struct Surface* floor; f32 floorHeight; - struct Surface *wall; + struct Surface* wall; s16 wallAngle; s16 wallDYaw; @@ -134,7 +134,7 @@ void check_ledge_climb_down(struct MarioState *m) { } } -void slide_bonk(struct MarioState *m, u32 fastAction, u32 slowAction) { +void slide_bonk(struct MarioState* m, u32 fastAction, u32 slowAction) { if (m->forwardVel > 16.0f) { mario_bonk_reflection(m, TRUE); drop_and_set_mario_action(m, fastAction, 0); @@ -144,7 +144,7 @@ void slide_bonk(struct MarioState *m, u32 fastAction, u32 slowAction) { } } -s32 set_triple_jump_action(struct MarioState *m, UNUSED u32 action, UNUSED u32 actionArg) { +s32 set_triple_jump_action(struct MarioState* m, UNUSED u32 action, UNUSED u32 actionArg) { if (m->flags & MARIO_WING_CAP) { return set_mario_action(m, ACT_FLYING_TRIPLE_JUMP, 0); } else if (m->forwardVel > 20.0f) { @@ -156,11 +156,11 @@ s32 set_triple_jump_action(struct MarioState *m, UNUSED u32 action, UNUSED u32 a return FALSE; } -void update_sliding_angle(struct MarioState *m, f32 accel, f32 lossFactor) { +void update_sliding_angle(struct MarioState* m, f32 accel, f32 lossFactor) { s32 newFacingDYaw; s16 facingDYaw; - struct Surface *floor = m->floor; + struct Surface* floor = m->floor; s16 slopeAngle = atan2s(floor->normal.z, floor->normal.x); f32 steepness = sqrtf(floor->normal.x * floor->normal.x + floor->normal.z * floor->normal.z); UNUSED f32 normalY = floor->normal.y; @@ -216,7 +216,7 @@ void update_sliding_angle(struct MarioState *m, f32 accel, f32 lossFactor) { } } -s32 update_sliding(struct MarioState *m, f32 stopSpeed) { +s32 update_sliding(struct MarioState* m, f32 stopSpeed) { f32 lossFactor; f32 accel; f32 oldSpeed; @@ -280,10 +280,10 @@ s32 update_sliding(struct MarioState *m, f32 stopSpeed) { return stopped; } -void apply_slope_accel(struct MarioState *m) { +void apply_slope_accel(struct MarioState* m) { f32 slopeAccel; - struct Surface *floor = m->floor; + struct Surface* floor = m->floor; f32 steepness = sqrtf(floor->normal.x * floor->normal.x + floor->normal.z * floor->normal.z); UNUSED f32 normalY = floor->normal.y; @@ -331,7 +331,7 @@ void apply_slope_accel(struct MarioState *m) { mario_update_windy_ground(m); } -s32 apply_landing_accel(struct MarioState *m, f32 frictionFactor) { +s32 apply_landing_accel(struct MarioState* m, f32 frictionFactor) { s32 stopped = FALSE; apply_slope_accel(m); @@ -347,7 +347,7 @@ s32 apply_landing_accel(struct MarioState *m, f32 frictionFactor) { return stopped; } -void update_shell_speed(struct MarioState *m) { +void update_shell_speed(struct MarioState* m) { f32 maxTargetSpeed; f32 targetSpeed; @@ -384,13 +384,12 @@ void update_shell_speed(struct MarioState *m) { m->forwardVel = 64.0f; } - m->faceAngle[1] = - m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); apply_slope_accel(m); } -s32 apply_slope_decel(struct MarioState *m, f32 decelCoef) { +s32 apply_slope_decel(struct MarioState* m, f32 decelCoef) { f32 decel; s32 stopped = FALSE; @@ -417,7 +416,7 @@ s32 apply_slope_decel(struct MarioState *m, f32 decelCoef) { return stopped; } -s32 update_decelerating_speed(struct MarioState *m) { +s32 update_decelerating_speed(struct MarioState* m) { s32 stopped = FALSE; if ((m->forwardVel = approach_f32(m->forwardVel, 0.0f, 1.0f, 1.0f)) == 0.0f) { @@ -431,7 +430,7 @@ s32 update_decelerating_speed(struct MarioState *m) { return stopped; } -void update_walking_speed(struct MarioState *m) { +void update_walking_speed(struct MarioState* m) { f32 maxTargetSpeed; f32 targetSpeed; @@ -459,12 +458,11 @@ void update_walking_speed(struct MarioState *m) { m->forwardVel = 48.0f; } - m->faceAngle[1] = - m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); apply_slope_accel(m); } -s32 should_begin_sliding(struct MarioState *m) { +s32 should_begin_sliding(struct MarioState* m) { if (m->input & INPUT_ABOVE_SLIDE) { s32 slideLevel = (m->area->terrainType & TERRAIN_MASK) == TERRAIN_SLIDE; s32 movingBackward = m->forwardVel <= -1.0f; @@ -477,12 +475,12 @@ s32 should_begin_sliding(struct MarioState *m) { return FALSE; } -s32 analog_stick_held_back(struct MarioState *m) { +s32 analog_stick_held_back(struct MarioState* m) { s16 intendedDYaw = m->intendedYaw - m->faceAngle[1]; return intendedDYaw < -0x471C || intendedDYaw > 0x471C; } -s32 check_ground_dive_or_punch(struct MarioState *m) { +s32 check_ground_dive_or_punch(struct MarioState* m) { UNUSED u8 filler[4]; if (m->input & INPUT_B_PRESSED) { @@ -498,7 +496,7 @@ s32 check_ground_dive_or_punch(struct MarioState *m) { return FALSE; } -s32 begin_braking_action(struct MarioState *m) { +s32 begin_braking_action(struct MarioState* m) { mario_drop_held_object(m); if (m->actionState == 1) { @@ -513,9 +511,9 @@ s32 begin_braking_action(struct MarioState *m) { return set_mario_action(m, ACT_DECELERATING, 0); } -void anim_and_audio_for_walk(struct MarioState *m) { +void anim_and_audio_for_walk(struct MarioState* m) { s32 val14; - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; s32 val0C = TRUE; s16 targetPitch = 0; f32 val04; @@ -599,12 +597,11 @@ void anim_and_audio_for_walk(struct MarioState *m) { } } - marioObj->oMarioWalkingPitch = - (s16) approach_s32(marioObj->oMarioWalkingPitch, targetPitch, 0x800, 0x800); + marioObj->oMarioWalkingPitch = (s16)approach_s32(marioObj->oMarioWalkingPitch, targetPitch, 0x800, 0x800); marioObj->header.gfx.angle[0] = marioObj->oMarioWalkingPitch; } -void anim_and_audio_for_hold_walk(struct MarioState *m) { +void anim_and_audio_for_hold_walk(struct MarioState* m) { s32 val0C; s32 val08 = TRUE; f32 val04; @@ -661,13 +658,13 @@ void anim_and_audio_for_hold_walk(struct MarioState *m) { } } -void anim_and_audio_for_heavy_walk(struct MarioState *m) { +void anim_and_audio_for_heavy_walk(struct MarioState* m) { s32 val04 = (s32)(m->intendedMag * 0x10000); set_mario_anim_with_accel(m, MARIO_ANIM_WALK_WITH_HEAVY_OBJ, val04); play_step_sound(m, 26, 79); } -void push_or_sidle_wall(struct MarioState *m, Vec3f startPos) { +void push_or_sidle_wall(struct MarioState* m, Vec3f startPos) { s16 wallAngle; s16 dWallAngle; f32 dx = m->pos[0] - startPos[0]; @@ -708,9 +705,9 @@ void push_or_sidle_wall(struct MarioState *m, Vec3f startPos) { } } -void tilt_body_walking(struct MarioState *m, s16 startYaw) { - struct MarioBodyState *val0C = m->marioBodyState; - UNUSED struct Object *marioObj = m->marioObj; +void tilt_body_walking(struct MarioState* m, s16 startYaw) { + struct MarioBodyState* val0C = m->marioBodyState; + UNUSED struct Object* marioObj = m->marioObj; s16 animID = m->marioObj->header.gfx.animInfo.animID; if (animID == MARIO_ANIM_WALKING || animID == MARIO_ANIM_RUNNING) { @@ -742,9 +739,9 @@ void tilt_body_walking(struct MarioState *m, s16 startYaw) { } } -void tilt_body_ground_shell(struct MarioState *m, s16 startYaw) { - struct MarioBodyState *val0C = m->marioBodyState; - struct Object *marioObj = m->marioObj; +void tilt_body_ground_shell(struct MarioState* m, s16 startYaw) { + struct MarioBodyState* val0C = m->marioBodyState; + struct Object* marioObj = m->marioObj; s16 dYaw = m->faceAngle[1] - startYaw; //! (Speed Crash) These casts can cause a crash if (dYaw * forwardVel / 12) or //! (forwardVel * 170) exceed or equal 2^31. Harder (if not impossible to do) @@ -774,7 +771,7 @@ void tilt_body_ground_shell(struct MarioState *m, s16 startYaw) { marioObj->header.gfx.pos[1] += 45.0f; } -s32 act_walking(struct MarioState *m) { +s32 act_walking(struct MarioState* m) { Vec3f startPos; s16 startYaw = m->faceAngle[1]; @@ -837,7 +834,7 @@ s32 act_walking(struct MarioState *m) { return FALSE; } -s32 act_move_punching(struct MarioState *m) { +s32 act_move_punching(struct MarioState* m) { if (should_begin_sliding(m)) { return set_mario_action(m, ACT_BEGIN_SLIDING, 0); } @@ -872,7 +869,7 @@ s32 act_move_punching(struct MarioState *m) { return FALSE; } -s32 act_hold_walking(struct MarioState *m) { +s32 act_hold_walking(struct MarioState* m) { if (m->heldObj->behavior == segmented_to_virtual(bhvJumpingBox)) { return set_mario_action(m, ACT_CRAZY_BOX_BOUNCE, 0); } @@ -926,7 +923,7 @@ s32 act_hold_walking(struct MarioState *m) { return FALSE; } -s32 act_hold_heavy_walking(struct MarioState *m) { +s32 act_hold_heavy_walking(struct MarioState* m) { if (m->input & INPUT_B_PRESSED) { return set_mario_action(m, ACT_HEAVY_THROW, 0); } @@ -959,7 +956,7 @@ s32 act_hold_heavy_walking(struct MarioState *m) { return FALSE; } -s32 act_turning_around(struct MarioState *m) { +s32 act_turning_around(struct MarioState* m) { if (m->input & INPUT_ABOVE_SLIDE) { return set_mario_action(m, ACT_BEGIN_SLIDING, 0); } @@ -1010,7 +1007,7 @@ s32 act_turning_around(struct MarioState *m) { return FALSE; } -s32 act_finish_turning_around(struct MarioState *m) { +s32 act_finish_turning_around(struct MarioState* m) { if (m->input & INPUT_ABOVE_SLIDE) { return set_mario_action(m, ACT_BEGIN_SLIDING, 0); } @@ -1034,10 +1031,9 @@ s32 act_finish_turning_around(struct MarioState *m) { return FALSE; } -s32 act_braking(struct MarioState *m) { - if (!(m->input & INPUT_FIRST_PERSON) - && (m->input - & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE))) { +s32 act_braking(struct MarioState* m) { + if (!(m->input & INPUT_FIRST_PERSON) && + (m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE))) { return check_common_action_exits(m); } @@ -1069,7 +1065,7 @@ s32 act_braking(struct MarioState *m) { return FALSE; } -s32 act_decelerating(struct MarioState *m) { +s32 act_decelerating(struct MarioState* m) { s32 val0C; s16 slopeClass = mario_get_floor_class(m); @@ -1131,7 +1127,7 @@ s32 act_decelerating(struct MarioState *m) { return FALSE; } -s32 act_hold_decelerating(struct MarioState *m) { +s32 act_hold_decelerating(struct MarioState* m) { s32 val0C; s16 slopeClass = mario_get_floor_class(m); @@ -1197,7 +1193,7 @@ s32 act_hold_decelerating(struct MarioState *m) { return FALSE; } -s32 act_riding_shell_ground(struct MarioState *m) { +s32 act_riding_shell_ground(struct MarioState* m) { s16 startYaw = m->faceAngle[1]; if (m->input & INPUT_A_PRESSED) { @@ -1233,8 +1229,7 @@ s32 act_riding_shell_ground(struct MarioState *m) { if (m->floor->type == SURFACE_BURNING) { play_sound(SOUND_MOVING_RIDING_SHELL_LAVA, m->marioObj->header.gfx.cameraToObject); } else { - play_sound(SOUND_MOVING_TERRAIN_RIDING_SHELL + m->terrainSoundAddend, - m->marioObj->header.gfx.cameraToObject); + play_sound(SOUND_MOVING_TERRAIN_RIDING_SHELL + m->terrainSoundAddend, m->marioObj->header.gfx.cameraToObject); } adjust_sound_for_speed(m); @@ -1244,7 +1239,7 @@ s32 act_riding_shell_ground(struct MarioState *m) { return FALSE; } -s32 act_crawling(struct MarioState *m) { +s32 act_crawling(struct MarioState* m) { s32 val04; if (should_begin_sliding(m)) { @@ -1297,7 +1292,7 @@ s32 act_crawling(struct MarioState *m) { return FALSE; } -s32 act_burning_ground(struct MarioState *m) { +s32 act_burning_ground(struct MarioState* m) { if (m->input & INPUT_A_PRESSED) { return set_mario_action(m, ACT_BURNING_JUMP, 0); } @@ -1322,8 +1317,7 @@ s32 act_burning_ground(struct MarioState *m) { m->forwardVel = approach_f32(m->forwardVel, 32.0f, 4.0f, 1.0f); if (m->input & INPUT_NONZERO_ANALOG) { - m->faceAngle[1] = - m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x600, 0x600); + m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x600, 0x600); } apply_slope_accel(m); @@ -1350,13 +1344,13 @@ s32 act_burning_ground(struct MarioState *m) { return FALSE; } -void tilt_body_butt_slide(struct MarioState *m) { +void tilt_body_butt_slide(struct MarioState* m) { s16 intendedDYaw = m->intendedYaw - m->faceAngle[1]; m->marioBodyState->torsoAngle[0] = (s32)(5461.3335f * m->intendedMag / 32.0f * coss(intendedDYaw)); m->marioBodyState->torsoAngle[2] = (s32)(-(5461.3335f * m->intendedMag / 32.0f * sins(intendedDYaw))); } -void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 animation) { +void common_slide_action(struct MarioState* m, u32 endAction, u32 airAction, s32 animation) { Vec3f pos; vec3f_copy(pos, m->pos); @@ -1407,8 +1401,7 @@ void common_slide_action(struct MarioState *m, u32 endAction, u32 airAction, s32 } } -s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jumpAction, u32 airAction, - s32 animation) { +s32 common_slide_action_with_jump(struct MarioState* m, u32 stopAction, u32 jumpAction, u32 airAction, s32 animation) { if (m->actionTimer == 5) { if (m->input & INPUT_A_PRESSED) { return set_jumping_action(m, jumpAction, 0); @@ -1425,14 +1418,13 @@ s32 common_slide_action_with_jump(struct MarioState *m, u32 stopAction, u32 jump return FALSE; } -s32 act_butt_slide(struct MarioState *m) { - s32 cancel = common_slide_action_with_jump(m, ACT_BUTT_SLIDE_STOP, ACT_JUMP, ACT_BUTT_SLIDE_AIR, - MARIO_ANIM_SLIDE); +s32 act_butt_slide(struct MarioState* m) { + s32 cancel = common_slide_action_with_jump(m, ACT_BUTT_SLIDE_STOP, ACT_JUMP, ACT_BUTT_SLIDE_AIR, MARIO_ANIM_SLIDE); tilt_body_butt_slide(m); return cancel; } -s32 act_hold_butt_slide(struct MarioState *m) { +s32 act_hold_butt_slide(struct MarioState* m) { s32 cancel; if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { @@ -1445,7 +1437,7 @@ s32 act_hold_butt_slide(struct MarioState *m) { return cancel; } -s32 act_crouch_slide(struct MarioState *m) { +s32 act_crouch_slide(struct MarioState* m) { s32 cancel; if (m->input & INPUT_ABOVE_SLIDE) { @@ -1477,12 +1469,11 @@ s32 act_crouch_slide(struct MarioState *m) { return set_mario_action(m, ACT_BRAKING, 0); } - cancel = common_slide_action_with_jump(m, ACT_CROUCHING, ACT_JUMP, ACT_FREEFALL, - MARIO_ANIM_START_CROUCHING); + cancel = common_slide_action_with_jump(m, ACT_CROUCHING, ACT_JUMP, ACT_FREEFALL, MARIO_ANIM_START_CROUCHING); return cancel; } -s32 act_slide_kick_slide(struct MarioState *m) { +s32 act_slide_kick_slide(struct MarioState* m) { if (m->input & INPUT_A_PRESSED) { #if ENABLE_RUMBLE queue_rumble_data(5, 80); @@ -1513,14 +1504,13 @@ s32 act_slide_kick_slide(struct MarioState *m) { return FALSE; } -s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s32 animation) { +s32 stomach_slide_action(struct MarioState* m, u32 stopAction, u32 airAction, s32 animation) { if (m->actionTimer == 5) { if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) { #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif - return drop_and_set_mario_action( - m, m->forwardVel >= 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0); + return drop_and_set_mario_action(m, m->forwardVel >= 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0); } } else { m->actionTimer++; @@ -1534,12 +1524,12 @@ s32 stomach_slide_action(struct MarioState *m, u32 stopAction, u32 airAction, s3 return FALSE; } -s32 act_stomach_slide(struct MarioState *m) { +s32 act_stomach_slide(struct MarioState* m) { s32 cancel = stomach_slide_action(m, ACT_STOMACH_SLIDE_STOP, ACT_FREEFALL, MARIO_ANIM_SLIDE_DIVE); return cancel; } -s32 act_hold_stomach_slide(struct MarioState *m) { +s32 act_hold_stomach_slide(struct MarioState* m) { s32 cancel; if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { @@ -1550,13 +1540,12 @@ s32 act_hold_stomach_slide(struct MarioState *m) { return cancel; } -s32 act_dive_slide(struct MarioState *m) { +s32 act_dive_slide(struct MarioState* m) { if (!(m->input & INPUT_ABOVE_SLIDE) && (m->input & (INPUT_A_PRESSED | INPUT_B_PRESSED))) { #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif - return set_mario_action(m, m->forwardVel > 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, - 0); + return set_mario_action(m, m->forwardVel > 0.0f ? ACT_FORWARD_ROLLOUT : ACT_BACKWARD_ROLLOUT, 0); } play_mario_landing_sound_once(m, SOUND_ACTION_TERRAIN_BODY_HIT_GROUND); @@ -1581,7 +1570,7 @@ s32 act_dive_slide(struct MarioState *m) { return FALSE; } -s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 arg2, s32 arg3, s32 arg4) { +s32 common_ground_knockback_action(struct MarioState* m, s32 animation, s32 arg2, s32 arg3, s32 arg4) { s32 animFrame; if (arg3) { @@ -1630,9 +1619,8 @@ s32 common_ground_knockback_action(struct MarioState *m, s32 animation, s32 arg2 return animFrame; } -s32 act_hard_backward_ground_kb(struct MarioState *m) { - s32 animFrame = - common_ground_knockback_action(m, MARIO_ANIM_FALL_OVER_BACKWARDS, 43, TRUE, m->actionArg); +s32 act_hard_backward_ground_kb(struct MarioState* m) { + s32 animFrame = common_ground_knockback_action(m, MARIO_ANIM_FALL_OVER_BACKWARDS, 43, TRUE, m->actionArg); if (animFrame == 43 && m->health < 0x100) { set_mario_action(m, ACT_DEATH_ON_BACK, 0); } @@ -1648,9 +1636,8 @@ s32 act_hard_backward_ground_kb(struct MarioState *m) { return FALSE; } -s32 act_hard_forward_ground_kb(struct MarioState *m) { - s32 animFrame = - common_ground_knockback_action(m, MARIO_ANIM_LAND_ON_STOMACH, 21, TRUE, m->actionArg); +s32 act_hard_forward_ground_kb(struct MarioState* m) { + s32 animFrame = common_ground_knockback_action(m, MARIO_ANIM_LAND_ON_STOMACH, 21, TRUE, m->actionArg); if (animFrame == 23 && m->health < 0x100) { set_mario_action(m, ACT_DEATH_ON_STOMACH, 0); } @@ -1658,36 +1645,35 @@ s32 act_hard_forward_ground_kb(struct MarioState *m) { return FALSE; } -s32 act_backward_ground_kb(struct MarioState *m) { +s32 act_backward_ground_kb(struct MarioState* m) { common_ground_knockback_action(m, MARIO_ANIM_BACKWARD_KB, 22, TRUE, m->actionArg); return FALSE; } -s32 act_forward_ground_kb(struct MarioState *m) { +s32 act_forward_ground_kb(struct MarioState* m) { common_ground_knockback_action(m, MARIO_ANIM_FORWARD_KB, 20, TRUE, m->actionArg); return FALSE; } -s32 act_soft_backward_ground_kb(struct MarioState *m) { +s32 act_soft_backward_ground_kb(struct MarioState* m) { common_ground_knockback_action(m, MARIO_ANIM_SOFT_BACK_KB, 100, FALSE, m->actionArg); return FALSE; } -s32 act_soft_forward_ground_kb(struct MarioState *m) { +s32 act_soft_forward_ground_kb(struct MarioState* m) { common_ground_knockback_action(m, MARIO_ANIM_SOFT_FRONT_KB, 100, FALSE, m->actionArg); return FALSE; } -s32 act_ground_bonk(struct MarioState *m) { - s32 animFrame = - common_ground_knockback_action(m, MARIO_ANIM_GROUND_BONK, 32, TRUE, m->actionArg); +s32 act_ground_bonk(struct MarioState* m) { + s32 animFrame = common_ground_knockback_action(m, MARIO_ANIM_GROUND_BONK, 32, TRUE, m->actionArg); if (animFrame == 32) { play_mario_landing_sound(m, SOUND_ACTION_TERRAIN_LANDING); } return FALSE; } -s32 act_death_exit_land(struct MarioState *m) { +s32 act_death_exit_land(struct MarioState* m) { s32 animFrame; apply_landing_accel(m, 0.9f); @@ -1709,7 +1695,7 @@ s32 act_death_exit_land(struct MarioState *m) { return FALSE; } -u32 common_landing_action(struct MarioState *m, s16 animation, u32 airAction) { +u32 common_landing_action(struct MarioState* m, s16 animation, u32 airAction) { u32 stepResult; if (m->input & INPUT_NONZERO_ANALOG) { @@ -1745,8 +1731,8 @@ u32 common_landing_action(struct MarioState *m, s16 animation, u32 airAction) { return stepResult; } -s32 common_landing_cancels(struct MarioState *m, struct LandingAction *landingAction, - s32 (*setAPressAction)(struct MarioState *, u32, u32)) { +s32 common_landing_cancels(struct MarioState* m, struct LandingAction* landingAction, + s32 (*setAPressAction)(struct MarioState*, u32, u32)) { //! Everything here, including floor steepness, is checked before checking // if Mario is actually on the floor. This leads to e.g. remote sliding. @@ -1779,7 +1765,7 @@ s32 common_landing_cancels(struct MarioState *m, struct LandingAction *landingAc return FALSE; } -s32 act_jump_land(struct MarioState *m) { +s32 act_jump_land(struct MarioState* m) { if (common_landing_cancels(m, &sJumpLandAction, set_jumping_action)) { return TRUE; } @@ -1788,7 +1774,7 @@ s32 act_jump_land(struct MarioState *m) { return FALSE; } -s32 act_freefall_land(struct MarioState *m) { +s32 act_freefall_land(struct MarioState* m) { if (common_landing_cancels(m, &sFreefallLandAction, set_jumping_action)) { return TRUE; } @@ -1797,7 +1783,7 @@ s32 act_freefall_land(struct MarioState *m) { return FALSE; } -s32 act_side_flip_land(struct MarioState *m) { +s32 act_side_flip_land(struct MarioState* m) { if (common_landing_cancels(m, &sSideFlipLandAction, set_jumping_action)) { return TRUE; } @@ -1808,7 +1794,7 @@ s32 act_side_flip_land(struct MarioState *m) { return FALSE; } -s32 act_hold_jump_land(struct MarioState *m) { +s32 act_hold_jump_land(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_JUMP_LAND_STOP, 0); } @@ -1821,7 +1807,7 @@ s32 act_hold_jump_land(struct MarioState *m) { return FALSE; } -s32 act_hold_freefall_land(struct MarioState *m) { +s32 act_hold_freefall_land(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_FREEFALL_LAND_STOP, 0); } @@ -1834,7 +1820,7 @@ s32 act_hold_freefall_land(struct MarioState *m) { return FALSE; } -s32 act_long_jump_land(struct MarioState *m) { +s32 act_long_jump_land(struct MarioState* m) { #ifdef VERSION_SH // BLJ (Backwards Long Jump) speed build up fix, crushing SimpleFlips's dreams since July 1997 if (m->forwardVel < 0.0f) { @@ -1861,7 +1847,7 @@ s32 act_long_jump_land(struct MarioState *m) { return FALSE; } -s32 act_double_jump_land(struct MarioState *m) { +s32 act_double_jump_land(struct MarioState* m) { if (common_landing_cancels(m, &sDoubleJumpLandAction, set_triple_jump_action)) { return TRUE; } @@ -1869,7 +1855,7 @@ s32 act_double_jump_land(struct MarioState *m) { return FALSE; } -s32 act_triple_jump_land(struct MarioState *m) { +s32 act_triple_jump_land(struct MarioState* m) { m->input &= ~INPUT_A_PRESSED; if (common_landing_cancels(m, &sTripleJumpLandAction, set_jumping_action)) { @@ -1884,7 +1870,7 @@ s32 act_triple_jump_land(struct MarioState *m) { return FALSE; } -s32 act_backflip_land(struct MarioState *m) { +s32 act_backflip_land(struct MarioState* m) { if (!(m->input & INPUT_Z_DOWN)) { m->input &= ~INPUT_A_PRESSED; } @@ -1901,8 +1887,7 @@ s32 act_backflip_land(struct MarioState *m) { return FALSE; } -s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animation2, u32 endAction, - u32 airAction) { +s32 quicksand_jump_land_action(struct MarioState* m, s32 animation1, s32 animation2, u32 endAction, u32 airAction) { if (m->actionTimer++ < 6) { m->quicksandDepth -= (7 - m->actionTimer) * 0.8f; if (m->quicksandDepth < 1.0f) { @@ -1927,20 +1912,19 @@ s32 quicksand_jump_land_action(struct MarioState *m, s32 animation1, s32 animati return FALSE; } -s32 act_quicksand_jump_land(struct MarioState *m) { +s32 act_quicksand_jump_land(struct MarioState* m) { s32 cancel = quicksand_jump_land_action(m, MARIO_ANIM_SINGLE_JUMP, MARIO_ANIM_LAND_FROM_SINGLE_JUMP, ACT_JUMP_LAND_STOP, ACT_FREEFALL); return cancel; } -s32 act_hold_quicksand_jump_land(struct MarioState *m) { - s32 cancel = quicksand_jump_land_action(m, MARIO_ANIM_JUMP_WITH_LIGHT_OBJ, - MARIO_ANIM_JUMP_LAND_WITH_LIGHT_OBJ, ACT_HOLD_JUMP_LAND_STOP, - ACT_HOLD_FREEFALL); +s32 act_hold_quicksand_jump_land(struct MarioState* m) { + s32 cancel = quicksand_jump_land_action(m, MARIO_ANIM_JUMP_WITH_LIGHT_OBJ, MARIO_ANIM_JUMP_LAND_WITH_LIGHT_OBJ, + ACT_HOLD_JUMP_LAND_STOP, ACT_HOLD_FREEFALL); return cancel; } -s32 check_common_moving_cancels(struct MarioState *m) { +s32 check_common_moving_cancels(struct MarioState* m) { if (m->pos[1] < m->waterLevel - 100) { return set_water_plunge_action(m); } @@ -1962,7 +1946,7 @@ s32 check_common_moving_cancels(struct MarioState *m) { return FALSE; } -s32 mario_execute_moving_action(struct MarioState *m) { +s32 mario_execute_moving_action(struct MarioState* m) { s32 cancel; if (check_common_moving_cancels(m)) { diff --git a/src/game/mario_actions_object.c b/src/game/mario_actions_object.c index a636a8d6..81ff2fee 100644 --- a/src/game/mario_actions_object.c +++ b/src/game/mario_actions_object.c @@ -16,7 +16,7 @@ */ 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)) { @@ -24,7 +24,7 @@ void animated_stationary_ground_step(struct MarioState *m, s32 animation, u32 en } } -s32 mario_update_punch_sequence(struct MarioState *m) { +s32 mario_update_punch_sequence(struct MarioState* m) { u32 endAction, crouchEndAction; s32 animFrame; @@ -144,7 +144,7 @@ s32 mario_update_punch_sequence(struct MarioState *m) { return FALSE; } -s32 act_punching(struct MarioState *m) { +s32 act_punching(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -172,7 +172,7 @@ s32 act_punching(struct MarioState *m) { return FALSE; } -s32 act_picking_up(struct MarioState *m) { +s32 act_picking_up(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -210,7 +210,7 @@ s32 act_picking_up(struct MarioState *m) { return FALSE; } -s32 act_dive_picking_up(struct MarioState *m) { +s32 act_dive_picking_up(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -230,7 +230,7 @@ s32 act_dive_picking_up(struct MarioState *m) { return FALSE; } -s32 act_placing_down(struct MarioState *m) { +s32 act_placing_down(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -247,7 +247,7 @@ s32 act_placing_down(struct MarioState *m) { return FALSE; } -s32 act_throwing(struct MarioState *m) { +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); } @@ -273,7 +273,7 @@ s32 act_throwing(struct MarioState *m) { return FALSE; } -s32 act_heavy_throw(struct MarioState *m) { +s32 act_heavy_throw(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -295,7 +295,7 @@ s32 act_heavy_throw(struct MarioState *m) { return FALSE; } -s32 act_stomach_slide_stop(struct MarioState *m) { +s32 act_stomach_slide_stop(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -312,7 +312,7 @@ s32 act_stomach_slide_stop(struct MarioState *m) { return FALSE; } -s32 act_picking_up_bowser(struct MarioState *m) { +s32 act_picking_up_bowser(struct MarioState* m) { if (m->actionState == 0) { m->actionState = 1; m->angleVel[1] = 0; @@ -333,12 +333,12 @@ 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) { - if(!ROM_JP) { + if (!ROM_JP) { if (m->angleVel[1] <= -0xE00 || m->angleVel[1] >= 0xE00) { play_sound(SOUND_MARIO_SO_LONGA_BOWSER, m->marioObj->header.gfx.cameraToObject); } else { @@ -420,7 +420,7 @@ s32 act_holding_bowser(struct MarioState *m) { return FALSE; } -s32 act_releasing_bowser(struct MarioState *m) { +s32 act_releasing_bowser(struct MarioState* m) { if (++m->actionTimer == 1) { if (m->actionArg == 0) { #if ENABLE_RUMBLE @@ -440,7 +440,7 @@ 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) { return set_water_plunge_action(m); @@ -457,7 +457,7 @@ s32 check_common_object_cancels(struct MarioState *m) { 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)) { diff --git a/src/game/mario_actions_stationary.c b/src/game/mario_actions_stationary.c index c34ed10f..ed59889d 100644 --- a/src/game/mario_actions_stationary.c +++ b/src/game/mario_actions_stationary.c @@ -17,7 +17,7 @@ #include "surface_terrains.h" #include "rumble_init.h" -s32 check_common_idle_cancels(struct MarioState *m) { +s32 check_common_idle_cancels(struct MarioState* m) { mario_drop_held_object(m); if (m->floor->normal.y < 0.29237169f) { return mario_push_off_steep_floor(m, ACT_FREEFALL, 0); @@ -44,7 +44,7 @@ s32 check_common_idle_cancels(struct MarioState *m) { } if (m->input & INPUT_NONZERO_ANALOG) { - m->faceAngle[1] = (s16) m->intendedYaw; + m->faceAngle[1] = (s16)m->intendedYaw; return set_mario_action(m, ACT_WALKING, 0); } @@ -59,14 +59,13 @@ s32 check_common_idle_cancels(struct MarioState *m) { return FALSE; } -s32 check_common_hold_idle_cancels(struct MarioState *m) { +s32 check_common_hold_idle_cancels(struct MarioState* m) { if (m->floor->normal.y < 0.29237169f) { return mario_push_off_steep_floor(m, ACT_HOLD_FREEFALL, 0); } if (m->heldObj->oInteractionSubtype & INT_SUBTYPE_DROP_IMMEDIATELY) { - m->heldObj->oInteractionSubtype = - (s32)(m->heldObj->oInteractionSubtype & ~INT_SUBTYPE_DROP_IMMEDIATELY); + m->heldObj->oInteractionSubtype = (s32)(m->heldObj->oInteractionSubtype & ~INT_SUBTYPE_DROP_IMMEDIATELY); return set_mario_action(m, ACT_PLACING_DOWN, 0); } @@ -87,7 +86,7 @@ s32 check_common_hold_idle_cancels(struct MarioState *m) { } if (m->input & INPUT_NONZERO_ANALOG) { - m->faceAngle[1] = (s16) m->intendedYaw; + m->faceAngle[1] = (s16)m->intendedYaw; return set_mario_action(m, ACT_HOLD_WALKING, 0); } @@ -102,7 +101,7 @@ s32 check_common_hold_idle_cancels(struct MarioState *m) { return FALSE; } -s32 act_idle(struct MarioState *m) { +s32 act_idle(struct MarioState* m) { if (m->quicksandDepth > 30.0f) { return set_mario_action(m, ACT_IN_QUICKSAND, 0); } @@ -154,7 +153,8 @@ s32 act_idle(struct MarioState *m) { // actionTimer is used to track how many cycles have passed. if (++m->actionState == 3) { f32 deltaYOfFloorBehindMario = m->pos[1] - find_floor_height_relative_polar(m, -0x8000, 60.0f); - if (deltaYOfFloorBehindMario < -24.0f || 24.0f < deltaYOfFloorBehindMario || m->floor->flags & SURFACE_FLAG_DYNAMIC) { + if (deltaYOfFloorBehindMario < -24.0f || 24.0f < deltaYOfFloorBehindMario || + m->floor->flags & SURFACE_FLAG_DYNAMIC) { m->actionState = 0; } else { // If Mario hasn't turned his head 10 times yet, stay idle instead of going to sleep. @@ -172,13 +172,13 @@ s32 act_idle(struct MarioState *m) { return FALSE; } -void play_anim_sound(struct MarioState *m, u32 actionState, s32 animFrame, u32 sound) { +void play_anim_sound(struct MarioState* m, u32 actionState, s32 animFrame, u32 sound) { if (m->actionState == actionState && m->marioObj->header.gfx.animInfo.animFrame == animFrame) { play_sound(sound, m->marioObj->header.gfx.cameraToObject); } } -s32 act_start_sleeping(struct MarioState *m) { +s32 act_start_sleeping(struct MarioState* m) { s32 animFrame; if (check_common_idle_cancels(m)) { @@ -237,11 +237,10 @@ s32 act_start_sleeping(struct MarioState *m) { return FALSE; } -s32 act_sleeping(struct MarioState *m) { +s32 act_sleeping(struct MarioState* m) { s32 animFrame; - if (m->input - & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE - | INPUT_FIRST_PERSON | INPUT_STOMPED | INPUT_B_PRESSED | INPUT_Z_PRESSED)) { + if (m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE | INPUT_FIRST_PERSON | + INPUT_STOMPED | INPUT_B_PRESSED | INPUT_Z_PRESSED)) { return set_mario_action(m, ACT_WAKING_UP, m->actionState); } @@ -292,7 +291,7 @@ s32 act_sleeping(struct MarioState *m) { case 2: animFrame = set_mario_animation(m, MARIO_ANIM_SLEEP_LYING); - if(!ROM_JP) { + if (!ROM_JP) { play_sound_if_no_flag(m, SOUND_MARIO_SNORING3, MARIO_ACTION_SOUND_PLAYED); } else { if (animFrame == 2) { @@ -309,11 +308,11 @@ s32 act_sleeping(struct MarioState *m) { return FALSE; } -s32 act_waking_up(struct MarioState *m) { +s32 act_waking_up(struct MarioState* m) { if (!m->actionTimer) { stop_sound(SOUND_MARIO_SNORING1, m->marioObj->header.gfx.cameraToObject); stop_sound(SOUND_MARIO_SNORING2, m->marioObj->header.gfx.cameraToObject); - if(!ROM_JP) { + if (!ROM_JP) { stop_sound(SOUND_MARIO_SNORING3, m->marioObj->header.gfx.cameraToObject); } raise_background_noise(2); @@ -344,7 +343,7 @@ s32 act_waking_up(struct MarioState *m) { return FALSE; } -s32 act_shivering(struct MarioState *m) { +s32 act_shivering(struct MarioState* m) { s32 animFrame; if (m->input & INPUT_STOMPED) { @@ -359,9 +358,8 @@ s32 act_shivering(struct MarioState *m) { return set_mario_action(m, ACT_BEGIN_SLIDING, 0); } - if (m->input - & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE - | INPUT_FIRST_PERSON | INPUT_STOMPED | INPUT_B_PRESSED | INPUT_Z_PRESSED)) { + if (m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE | INPUT_FIRST_PERSON | + INPUT_STOMPED | INPUT_B_PRESSED | INPUT_Z_PRESSED)) { m->actionState = 2; } @@ -398,7 +396,7 @@ s32 act_shivering(struct MarioState *m) { return FALSE; } -s32 act_coughing(struct MarioState *m) { +s32 act_coughing(struct MarioState* m) { s32 animFrame; if (check_common_idle_cancels(m)) { @@ -422,7 +420,7 @@ s32 act_coughing(struct MarioState *m) { return FALSE; } -s32 act_hold_idle(struct MarioState *m) { +s32 act_hold_idle(struct MarioState* m) { if (segmented_to_virtual(bhvJumpingBox) == m->heldObj->behavior) { return set_mario_action(m, ACT_CRAZY_BOX_BOUNCE, 0); } @@ -444,7 +442,7 @@ s32 act_hold_idle(struct MarioState *m) { return FALSE; } -s32 act_hold_heavy_idle(struct MarioState *m) { +s32 act_hold_heavy_idle(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -470,7 +468,7 @@ s32 act_hold_heavy_idle(struct MarioState *m) { return FALSE; } -s32 act_standing_against_wall(struct MarioState *m) { +s32 act_standing_against_wall(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -492,7 +490,7 @@ s32 act_standing_against_wall(struct MarioState *m) { return FALSE; } -s32 act_in_quicksand(struct MarioState *m) { +s32 act_in_quicksand(struct MarioState* m) { if (m->quicksandDepth < 30.0f) { return set_mario_action(m, ACT_IDLE, 0); } @@ -511,7 +509,7 @@ s32 act_in_quicksand(struct MarioState *m) { return FALSE; } -s32 act_crouching(struct MarioState *m) { +s32 act_crouching(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -549,7 +547,7 @@ s32 act_crouching(struct MarioState *m) { return FALSE; } -s32 act_panting(struct MarioState *m) { +s32 act_panting(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -563,8 +561,7 @@ s32 act_panting(struct MarioState *m) { } if (set_mario_animation(m, MARIO_ANIM_WALK_PANTING) == 1) { - play_sound(SOUND_MARIO_PANTING + ((gAudioRandom % 3U) << 0x10), - m->marioObj->header.gfx.cameraToObject); + play_sound(SOUND_MARIO_PANTING + ((gAudioRandom % 3U) << 0x10), m->marioObj->header.gfx.cameraToObject); } stationary_ground_step(m); @@ -572,7 +569,7 @@ s32 act_panting(struct MarioState *m) { return FALSE; } -s32 act_hold_panting_unused(struct MarioState *m) { +s32 act_hold_panting_unused(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_PANTING, 0); } @@ -595,7 +592,7 @@ s32 act_hold_panting_unused(struct MarioState *m) { return FALSE; } -void stopping_step(struct MarioState *m, s32 animID, u32 action) { +void stopping_step(struct MarioState* m, s32 animID, u32 action) { stationary_ground_step(m); set_mario_animation(m, animID); if (is_anim_at_end(m)) { @@ -603,7 +600,7 @@ void stopping_step(struct MarioState *m, s32 animID, u32 action) { } } -s32 act_braking_stop(struct MarioState *m) { +s32 act_braking_stop(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -616,8 +613,8 @@ s32 act_braking_stop(struct MarioState *m) { return set_mario_action(m, ACT_PUNCHING, 0); } - if (!(m->input & INPUT_FIRST_PERSON) - && m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE)) { + if (!(m->input & INPUT_FIRST_PERSON) && + m->input & (INPUT_NONZERO_ANALOG | INPUT_A_PRESSED | INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE)) { return check_common_action_exits(m); } @@ -625,7 +622,7 @@ s32 act_braking_stop(struct MarioState *m) { return FALSE; } -s32 act_butt_slide_stop(struct MarioState *m) { +s32 act_butt_slide_stop(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -642,7 +639,7 @@ s32 act_butt_slide_stop(struct MarioState *m) { return FALSE; } -s32 act_hold_butt_slide_stop(struct MarioState *m) { +s32 act_hold_butt_slide_stop(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_IDLE, 0); } @@ -663,7 +660,7 @@ s32 act_hold_butt_slide_stop(struct MarioState *m) { return FALSE; } -s32 act_slide_kick_slide_stop(struct MarioState *m) { +s32 act_slide_kick_slide_stop(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -676,7 +673,7 @@ s32 act_slide_kick_slide_stop(struct MarioState *m) { return FALSE; } -s32 act_start_crouching(struct MarioState *m) { +s32 act_start_crouching(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -701,7 +698,7 @@ s32 act_start_crouching(struct MarioState *m) { return FALSE; } -s32 act_stop_crouching(struct MarioState *m) { +s32 act_stop_crouching(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -726,7 +723,7 @@ s32 act_stop_crouching(struct MarioState *m) { return FALSE; } -s32 act_start_crawling(struct MarioState *m) { +s32 act_start_crawling(struct MarioState* m) { if (m->input & INPUT_FIRST_PERSON) { return set_mario_action(m, ACT_STOP_CROUCHING, 0); } @@ -752,7 +749,7 @@ s32 act_start_crawling(struct MarioState *m) { return FALSE; } -s32 act_stop_crawling(struct MarioState *m) { +s32 act_stop_crawling(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -773,7 +770,7 @@ s32 act_stop_crawling(struct MarioState *m) { return FALSE; } -s32 act_shockwave_bounce(struct MarioState *m) { +s32 act_shockwave_bounce(struct MarioState* m) { s16 sp1E; f32 sp18; @@ -813,7 +810,7 @@ s32 act_shockwave_bounce(struct MarioState *m) { return FALSE; } -s32 landing_step(struct MarioState *m, s32 arg1, u32 action) { +s32 landing_step(struct MarioState* m, s32 arg1, u32 action) { stationary_ground_step(m); set_mario_animation(m, arg1); if (is_anim_at_end(m)) { @@ -822,7 +819,7 @@ s32 landing_step(struct MarioState *m, s32 arg1, u32 action) { return FALSE; } -s32 check_common_landing_cancels(struct MarioState *m, u32 action) { +s32 check_common_landing_cancels(struct MarioState* m, u32 action) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -850,7 +847,7 @@ s32 check_common_landing_cancels(struct MarioState *m, u32 action) { return FALSE; } -s32 act_jump_land_stop(struct MarioState *m) { +s32 act_jump_land_stop(struct MarioState* m) { if (check_common_landing_cancels(m, 0)) { return TRUE; } @@ -859,7 +856,7 @@ s32 act_jump_land_stop(struct MarioState *m) { return FALSE; } -s32 act_double_jump_land_stop(struct MarioState *m) { +s32 act_double_jump_land_stop(struct MarioState* m) { if (check_common_landing_cancels(m, 0)) { return TRUE; } @@ -868,7 +865,7 @@ s32 act_double_jump_land_stop(struct MarioState *m) { return FALSE; } -s32 act_side_flip_land_stop(struct MarioState *m) { +s32 act_side_flip_land_stop(struct MarioState* m) { if (check_common_landing_cancels(m, 0)) { return TRUE; } @@ -878,7 +875,7 @@ s32 act_side_flip_land_stop(struct MarioState *m) { return FALSE; } -s32 act_freefall_land_stop(struct MarioState *m) { +s32 act_freefall_land_stop(struct MarioState* m) { if (check_common_landing_cancels(m, 0)) { return TRUE; } @@ -887,7 +884,7 @@ s32 act_freefall_land_stop(struct MarioState *m) { return FALSE; } -s32 act_triple_jump_land_stop(struct MarioState *m) { +s32 act_triple_jump_land_stop(struct MarioState* m) { if (check_common_landing_cancels(m, ACT_JUMP)) { return TRUE; } @@ -896,7 +893,7 @@ s32 act_triple_jump_land_stop(struct MarioState *m) { return FALSE; } -s32 act_backflip_land_stop(struct MarioState *m) { +s32 act_backflip_land_stop(struct MarioState* m) { if (!(m->input & INPUT_Z_DOWN) || m->marioObj->header.gfx.animInfo.animFrame >= 6) { m->input &= ~INPUT_A_PRESSED; } @@ -909,7 +906,7 @@ s32 act_backflip_land_stop(struct MarioState *m) { return FALSE; } -s32 act_lava_boost_land(struct MarioState *m) { +s32 act_lava_boost_land(struct MarioState* m) { m->input &= ~(INPUT_FIRST_PERSON | INPUT_B_PRESSED); if (check_common_landing_cancels(m, 0)) { @@ -920,19 +917,20 @@ s32 act_lava_boost_land(struct MarioState *m) { return FALSE; } -s32 act_long_jump_land_stop(struct MarioState *m) { +s32 act_long_jump_land_stop(struct MarioState* m) { m->input &= ~INPUT_B_PRESSED; if (check_common_landing_cancels(m, ACT_JUMP)) { return TRUE; } - landing_step(m, !m->marioObj->oMarioLongJumpIsSlow ? MARIO_ANIM_CROUCH_FROM_FAST_LONGJUMP - : MARIO_ANIM_CROUCH_FROM_SLOW_LONGJUMP, + landing_step(m, + !m->marioObj->oMarioLongJumpIsSlow ? MARIO_ANIM_CROUCH_FROM_FAST_LONGJUMP + : MARIO_ANIM_CROUCH_FROM_SLOW_LONGJUMP, ACT_CROUCHING); return FALSE; } -s32 act_hold_jump_land_stop(struct MarioState *m) { +s32 act_hold_jump_land_stop(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_IDLE, 0); } @@ -953,7 +951,7 @@ s32 act_hold_jump_land_stop(struct MarioState *m) { return FALSE; } -s32 act_hold_freefall_land_stop(struct MarioState *m) { +s32 act_hold_freefall_land_stop(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_IDLE, 0); } @@ -973,7 +971,7 @@ s32 act_hold_freefall_land_stop(struct MarioState *m) { return FALSE; } -s32 act_air_throw_land(struct MarioState *m) { +s32 act_air_throw_land(struct MarioState* m) { if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); } @@ -990,7 +988,7 @@ s32 act_air_throw_land(struct MarioState *m) { return FALSE; } -s32 act_twirl_land(struct MarioState *m) { +s32 act_twirl_land(struct MarioState* m) { m->actionState = 1; if (m->input & INPUT_STOMPED) { return set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); @@ -1020,7 +1018,7 @@ s32 act_twirl_land(struct MarioState *m) { return FALSE; } -s32 act_ground_pound_land(struct MarioState *m) { +s32 act_ground_pound_land(struct MarioState* m) { m->actionState = 1; if (m->input & INPUT_STOMPED) { return drop_and_set_mario_action(m, ACT_SHOCKWAVE_BOUNCE, 0); @@ -1038,7 +1036,7 @@ s32 act_ground_pound_land(struct MarioState *m) { return FALSE; } -s32 act_first_person(struct MarioState *m) { +s32 act_first_person(struct MarioState* m) { s32 sp1C = (m->input & (INPUT_OFF_FLOOR | INPUT_ABOVE_SLIDE | INPUT_STOMPED)) != 0; if (m->actionState == 0) { @@ -1052,8 +1050,8 @@ s32 act_first_person(struct MarioState *m) { return set_mario_action(m, ACT_IDLE, 0); } - if (m->floor->type == SURFACE_LOOK_UP_WARP - && save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 10) { + if (m->floor->type == SURFACE_LOOK_UP_WARP && + save_file_get_total_star_count(gCurrSaveFileNum - 1, COURSE_MIN - 1, COURSE_MAX - 1) >= 10) { s16 sp1A = m->statusForCamera->headRotation[0]; s16 sp18 = ((m->statusForCamera->headRotation[1] * 4) / 3) + m->faceAngle[1]; if (sp1A == -0x1800 && (sp18 < -0x6FFF || sp18 >= 0x7000)) { @@ -1066,7 +1064,7 @@ s32 act_first_person(struct MarioState *m) { return FALSE; } -s32 check_common_stationary_cancels(struct MarioState *m) { +s32 check_common_stationary_cancels(struct MarioState* m) { if (m->pos[1] < m->waterLevel - 100) { if (m->action == ACT_SPAWN_SPIN_LANDING) { load_level_init_text(0); @@ -1089,7 +1087,7 @@ s32 check_common_stationary_cancels(struct MarioState *m) { return FALSE; } -s32 mario_execute_stationary_action(struct MarioState *m) { +s32 mario_execute_stationary_action(struct MarioState* m) { s32 cancel; if (check_common_stationary_cancels(m)) { diff --git a/src/game/mario_actions_submerged.c b/src/game/mario_actions_submerged.c index 8afb8f09..5bcc9e9b 100644 --- a/src/game/mario_actions_submerged.c +++ b/src/game/mario_actions_submerged.c @@ -28,7 +28,7 @@ static s16 sBobTimer; static s16 sBobIncrement; static f32 sBobHeight; -static void set_swimming_at_surface_particles(struct MarioState *m, u32 particleFlag) { +static void set_swimming_at_surface_particles(struct MarioState* m, u32 particleFlag) { s16 atSurface = m->pos[1] >= m->waterLevel - 130; if (atSurface) { @@ -41,7 +41,7 @@ static void set_swimming_at_surface_particles(struct MarioState *m, u32 particle sWasAtSurface = atSurface; } -static s32 swimming_near_surface(struct MarioState *m) { +static s32 swimming_near_surface(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return FALSE; } @@ -49,7 +49,7 @@ static s32 swimming_near_surface(struct MarioState *m) { return (m->waterLevel - 80) - m->pos[1] < 400.0f; } -static f32 get_buoyancy(struct MarioState *m) { +static f32 get_buoyancy(struct MarioState* m) { f32 buoyancy = 0.0f; if (m->flags & MARIO_METAL_CAP) { @@ -67,10 +67,10 @@ static f32 get_buoyancy(struct MarioState *m) { return buoyancy; } -static u32 perform_water_full_step(struct MarioState *m, Vec3f nextPos) { - struct Surface *wall; - struct Surface *ceil; - struct Surface *floor; +static u32 perform_water_full_step(struct MarioState* m, Vec3f nextPos) { + struct Surface* wall; + struct Surface* ceil; + struct Surface* floor; f32 ceilHeight; f32 floorHeight; @@ -116,7 +116,7 @@ static u32 perform_water_full_step(struct MarioState *m, Vec3f nextPos) { } } -static void apply_water_current(struct MarioState *m, Vec3f step) { +static void apply_water_current(struct MarioState* m, Vec3f step) { s32 i; f32 whirlpoolRadius = 2000.0f; @@ -129,7 +129,7 @@ static void apply_water_current(struct MarioState *m, Vec3f step) { } for (i = 0; i < 2; i++) { - struct Whirlpool *whirlpool = gCurrentArea->whirlpools[i]; + struct Whirlpool* whirlpool = gCurrentArea->whirlpools[i]; if (whirlpool != NULL) { f32 strength = 0.0f; @@ -164,12 +164,12 @@ static void apply_water_current(struct MarioState *m, Vec3f step) { } } -static u32 perform_water_step(struct MarioState *m) { +static u32 perform_water_step(struct MarioState* m) { UNUSED u8 filler[4]; u32 stepResult; Vec3f nextPos; Vec3f step; - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; vec3f_copy(step, m->vel); @@ -194,8 +194,8 @@ static u32 perform_water_step(struct MarioState *m) { return stepResult; } -static BAD_RETURN(u32) update_water_pitch(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +static BAD_RETURN(u32) update_water_pitch(struct MarioState* m) { + struct Object* marioObj = m->marioObj; if (marioObj->header.gfx.angle[0] > 0) { marioObj->header.gfx.pos[1] += @@ -211,7 +211,7 @@ static BAD_RETURN(u32) update_water_pitch(struct MarioState *m) { } } -static void stationary_slow_down(struct MarioState *m) { +static void stationary_slow_down(struct MarioState* m) { f32 buoyancy = get_buoyancy(m); m->angleVel[0] = 0; @@ -227,7 +227,7 @@ static void stationary_slow_down(struct MarioState *m) { m->vel[2] = m->forwardVel * coss(m->faceAngle[0]) * coss(m->faceAngle[1]); } -static void update_swimming_speed(struct MarioState *m, f32 decelThreshold) { +static void update_swimming_speed(struct MarioState* m, f32 decelThreshold) { f32 buoyancy = get_buoyancy(m); f32 maxSpeed = 28.0f; @@ -252,7 +252,7 @@ static void update_swimming_speed(struct MarioState *m, f32 decelThreshold) { m->vel[2] = m->forwardVel * coss(m->faceAngle[0]) * coss(m->faceAngle[1]); } -static void update_swimming_yaw(struct MarioState *m) { +static void update_swimming_yaw(struct MarioState* m) { s16 targetYawVel = -(s16)(10.0f * m->controller->stickX); if (targetYawVel > 0) { @@ -281,7 +281,7 @@ static void update_swimming_yaw(struct MarioState *m) { m->faceAngle[2] = -m->angleVel[1] * 8; } -static void update_swimming_pitch(struct MarioState *m) { +static void update_swimming_pitch(struct MarioState* m) { s16 targetPitch = -(s16)(252.0f * m->controller->stickY); s16 pitchVel; @@ -302,8 +302,8 @@ static void update_swimming_pitch(struct MarioState *m) { } } -static void common_idle_step(struct MarioState *m, s32 animation, s32 arg) { - s16 *val = &m->marioBodyState->headAngle[0]; +static void common_idle_step(struct MarioState* m, s32 animation, s32 arg) { + s16* val = &m->marioBodyState->headAngle[0]; update_swimming_yaw(m); update_swimming_pitch(m); @@ -326,7 +326,7 @@ static void common_idle_step(struct MarioState *m, s32 animation, s32 arg) { set_swimming_at_surface_particles(m, PARTICLE_IDLE_WATER_WAVE); } -static s32 act_water_idle(struct MarioState *m) { +static s32 act_water_idle(struct MarioState* m) { u32 val = 0x10000; if (m->flags & MARIO_METAL_CAP) { @@ -349,7 +349,7 @@ static s32 act_water_idle(struct MarioState *m) { return FALSE; } -static s32 act_hold_water_idle(struct MarioState *m) { +static s32 act_hold_water_idle(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_HOLD_METAL_WATER_FALLING, 0); } @@ -370,7 +370,7 @@ static s32 act_hold_water_idle(struct MarioState *m) { return FALSE; } -static s32 act_water_action_end(struct MarioState *m) { +static s32 act_water_action_end(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_METAL_WATER_FALLING, 1); } @@ -390,7 +390,7 @@ static s32 act_water_action_end(struct MarioState *m) { return FALSE; } -static s32 act_hold_water_action_end(struct MarioState *m) { +static s32 act_hold_water_action_end(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_HOLD_METAL_WATER_FALLING, 0); } @@ -407,16 +407,14 @@ static s32 act_hold_water_action_end(struct MarioState *m) { return set_mario_action(m, ACT_HOLD_BREASTSTROKE, 0); } - common_idle_step( - m, m->actionArg == 0 ? MARIO_ANIM_WATER_ACTION_END_WITH_OBJ : MARIO_ANIM_STOP_GRAB_OBJ_WATER, - 0); + common_idle_step(m, m->actionArg == 0 ? MARIO_ANIM_WATER_ACTION_END_WITH_OBJ : MARIO_ANIM_STOP_GRAB_OBJ_WATER, 0); if (is_anim_at_end(m)) { set_mario_action(m, ACT_HOLD_WATER_IDLE, 0); } return FALSE; } -static void reset_bob_variables(struct MarioState *m) { +static void reset_bob_variables(struct MarioState* m) { sBobTimer = 0; sBobIncrement = 0x800; sBobHeight = m->faceAngle[0] / 256.0f + 20.0f; @@ -425,7 +423,7 @@ static void reset_bob_variables(struct MarioState *m) { /** * Controls the bobbing that happens when you swim near the surface. */ -static void surface_swim_bob(struct MarioState *m) { +static void surface_swim_bob(struct MarioState* m) { if (sBobIncrement != 0 && m->pos[1] > m->waterLevel - 85 && m->faceAngle[0] >= 0) { if ((sBobTimer += sBobIncrement) >= 0) { m->marioObj->header.gfx.pos[1] += sBobHeight * sins(sBobTimer); @@ -436,9 +434,9 @@ static void surface_swim_bob(struct MarioState *m) { sBobIncrement = 0; } -static void common_swimming_step(struct MarioState *m, s16 swimStrength) { +static void common_swimming_step(struct MarioState* m, s16 swimStrength) { s16 floorPitch; - UNUSED struct Object *marioObj = m->marioObj; + UNUSED struct Object* marioObj = m->marioObj; update_swimming_yaw(m); update_swimming_pitch(m); @@ -482,14 +480,15 @@ static void common_swimming_step(struct MarioState *m, s16 swimStrength) { set_swimming_at_surface_particles(m, PARTICLE_WAVE_TRAIL); } -static void play_swimming_noise(struct MarioState *m) { +static void play_swimming_noise(struct MarioState* m) { s16 animFrame = m->marioObj->header.gfx.animInfo.animFrame; // This must be one line to match on -O2 - if (animFrame == 0 || animFrame == 12) play_sound(SOUND_ACTION_UNKNOWN434, m->marioObj->header.gfx.cameraToObject); + if (animFrame == 0 || animFrame == 12) + play_sound(SOUND_ACTION_UNKNOWN434, m->marioObj->header.gfx.cameraToObject); } -static s32 check_water_jump(struct MarioState *m) { +static s32 check_water_jump(struct MarioState* m) { s32 probe = (s32)(m->pos[1] + 1.5f); if (m->input & INPUT_A_PRESSED) { @@ -509,7 +508,7 @@ static s32 check_water_jump(struct MarioState *m) { return FALSE; } -static s32 act_breaststroke(struct MarioState *m) { +static s32 act_breaststroke(struct MarioState* m) { if (m->actionArg == 0) { sSwimStrength = MIN_SWIM_STRENGTH; } @@ -569,7 +568,7 @@ static s32 act_breaststroke(struct MarioState *m) { return FALSE; } -static s32 act_swimming_end(struct MarioState *m) { +static s32 act_swimming_end(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_METAL_WATER_FALLING, 1); } @@ -606,7 +605,7 @@ static s32 act_swimming_end(struct MarioState *m) { return FALSE; } -static s32 act_flutter_kick(struct MarioState *m) { +static s32 act_flutter_kick(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_METAL_WATER_FALLING, 1); } @@ -635,7 +634,7 @@ static s32 act_flutter_kick(struct MarioState *m) { return FALSE; } -static s32 act_hold_breaststroke(struct MarioState *m) { +static s32 act_hold_breaststroke(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_HOLD_METAL_WATER_FALLING, 0); } @@ -686,7 +685,7 @@ static s32 act_hold_breaststroke(struct MarioState *m) { return FALSE; } -static s32 act_hold_swimming_end(struct MarioState *m) { +static s32 act_hold_swimming_end(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_HOLD_METAL_WATER_FALLING, 0); } @@ -719,7 +718,7 @@ static s32 act_hold_swimming_end(struct MarioState *m) { return FALSE; } -static s32 act_hold_flutter_kick(struct MarioState *m) { +static s32 act_hold_flutter_kick(struct MarioState* m) { if (m->flags & MARIO_METAL_CAP) { return set_mario_action(m, ACT_HOLD_METAL_WATER_FALLING, 0); } @@ -745,7 +744,7 @@ static s32 act_hold_flutter_kick(struct MarioState *m) { return FALSE; } -static s32 act_water_shell_swimming(struct MarioState *m) { +static s32 act_water_shell_swimming(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_WATER_IDLE, 0); } @@ -770,12 +769,12 @@ static s32 act_water_shell_swimming(struct MarioState *m) { return FALSE; } -static s32 check_water_grab(struct MarioState *m) { +static s32 check_water_grab(struct MarioState* m) { //! Heave hos have the grabbable interaction type but are not normally // grabbable. Since water grabbing doesn't check the appropriate input flag, // you can use water grab to pick up heave ho. if (m->marioObj->collidedObjInteractTypes & INTERACT_GRABBABLE) { - struct Object *object = mario_get_collided_object(m, INTERACT_GRABBABLE); + struct Object* object = mario_get_collided_object(m, INTERACT_GRABBABLE); f32 dx = object->oPosX - m->pos[0]; f32 dz = object->oPosZ - m->pos[2]; s16 dAngleToObject = atan2s(dz, dx) - m->faceAngle[1]; @@ -791,7 +790,7 @@ static s32 check_water_grab(struct MarioState *m) { return FALSE; } -static s32 act_water_throw(struct MarioState *m) { +static s32 act_water_throw(struct MarioState* m) { update_swimming_yaw(m); update_swimming_pitch(m); update_swimming_speed(m, MIN_SWIM_SPEED); @@ -817,7 +816,7 @@ static s32 act_water_throw(struct MarioState *m) { return FALSE; } -static s32 act_water_punch(struct MarioState *m) { +static s32 act_water_punch(struct MarioState* m) { if (m->forwardVel < 7.0f) { m->forwardVel += 1.0f; } @@ -863,7 +862,7 @@ static s32 act_water_punch(struct MarioState *m) { return FALSE; } -static void common_water_knockback_step(struct MarioState *m, s32 animation, u32 endAction, s32 arg3) { +static void common_water_knockback_step(struct MarioState* m, s32 animation, u32 endAction, s32 arg3) { stationary_slow_down(m); perform_water_step(m); set_mario_animation(m, animation); @@ -879,17 +878,17 @@ static void common_water_knockback_step(struct MarioState *m, s32 animation, u32 } } -static s32 act_backward_water_kb(struct MarioState *m) { +static s32 act_backward_water_kb(struct MarioState* m) { common_water_knockback_step(m, MARIO_ANIM_BACKWARDS_WATER_KB, ACT_WATER_IDLE, m->actionArg); return FALSE; } -static s32 act_forward_water_kb(struct MarioState *m) { +static s32 act_forward_water_kb(struct MarioState* m) { common_water_knockback_step(m, MARIO_ANIM_WATER_FORWARD_KB, ACT_WATER_IDLE, m->actionArg); return FALSE; } -static s32 act_water_shocked(struct MarioState *m) { +static s32 act_water_shocked(struct MarioState* m) { play_sound_if_no_flag(m, SOUND_MARIO_WAAAOOOW, MARIO_ACTION_SOUND_PLAYED); play_sound(SOUND_MOVING_SHOCKED, m->marioObj->header.gfx.cameraToObject); set_camera_shake_from_hit(SHAKE_SHOCK); @@ -910,7 +909,7 @@ static s32 act_water_shocked(struct MarioState *m) { return FALSE; } -static s32 act_drowning(struct MarioState *m) { +static s32 act_drowning(struct MarioState* m) { switch (m->actionState) { case 0: set_mario_animation(m, MARIO_ANIM_DROWNING_PART1); @@ -936,7 +935,7 @@ static s32 act_drowning(struct MarioState *m) { return FALSE; } -static s32 act_water_death(struct MarioState *m) { +static s32 act_water_death(struct MarioState* m) { stationary_slow_down(m); perform_water_step(m); @@ -950,7 +949,7 @@ static s32 act_water_death(struct MarioState *m) { return FALSE; } -static s32 act_water_plunge(struct MarioState *m) { +static s32 act_water_plunge(struct MarioState* m) { u32 stepResult; s32 stateFlags = m->heldObj != NULL; @@ -1037,14 +1036,14 @@ static s32 act_water_plunge(struct MarioState *m) { return FALSE; } -static s32 act_caught_in_whirlpool(struct MarioState *m) { +static s32 act_caught_in_whirlpool(struct MarioState* m) { f32 sinAngleChange; f32 cosAngleChange; f32 newDistance; s16 angleChange; - struct Object *marioObj = m->marioObj; - struct Object *whirlpool = m->usedObj; + struct Object* marioObj = m->marioObj; + struct Object* whirlpool = m->usedObj; f32 dx = m->pos[0] - whirlpool->oPosX; f32 dz = m->pos[2] - whirlpool->oPosZ; @@ -1097,7 +1096,7 @@ static s32 act_caught_in_whirlpool(struct MarioState *m) { return FALSE; } -static void play_metal_water_jumping_sound(struct MarioState *m, u32 landing) { +static void play_metal_water_jumping_sound(struct MarioState* m, u32 landing) { if (!(m->flags & MARIO_ACTION_SOUND_PLAYED)) { m->particleFlags |= PARTICLE_MIST_CIRCLE; } @@ -1106,14 +1105,14 @@ static void play_metal_water_jumping_sound(struct MarioState *m, u32 landing) { MARIO_ACTION_SOUND_PLAYED); } -static void play_metal_water_walking_sound(struct MarioState *m) { +static void play_metal_water_walking_sound(struct MarioState* m) { if (is_anim_past_frame(m, 10) || is_anim_past_frame(m, 49)) { play_sound(SOUND_ACTION_METAL_STEP_WATER, m->marioObj->header.gfx.cameraToObject); m->particleFlags |= PARTICLE_DUST; } } -static void update_metal_water_walking_speed(struct MarioState *m) { +static void update_metal_water_walking_speed(struct MarioState* m) { f32 val = m->intendedMag / 1.5f; if (m->forwardVel <= 0.0f) { @@ -1128,8 +1127,7 @@ static void update_metal_water_walking_speed(struct MarioState *m) { m->forwardVel = 32.0f; } - m->faceAngle[1] = - m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); + m->faceAngle[1] = m->intendedYaw - approach_s32((s16)(m->intendedYaw - m->faceAngle[1]), 0, 0x800, 0x800); m->slideVelX = m->forwardVel * sins(m->faceAngle[1]); m->slideVelZ = m->forwardVel * coss(m->faceAngle[1]); @@ -1139,7 +1137,7 @@ static void update_metal_water_walking_speed(struct MarioState *m) { m->vel[2] = m->slideVelZ; } -static s32 update_metal_water_jump_speed(struct MarioState *m) { +static s32 update_metal_water_jump_speed(struct MarioState* m) { UNUSED f32 nextY = m->pos[1] + m->vel[1]; f32 waterSurface = m->waterLevel - 100; @@ -1168,7 +1166,7 @@ static s32 update_metal_water_jump_speed(struct MarioState *m) { return FALSE; } -static s32 act_metal_water_standing(struct MarioState *m) { +static s32 act_metal_water_standing(struct MarioState* m) { if (!(m->flags & MARIO_METAL_CAP)) { return set_mario_action(m, ACT_WATER_IDLE, 0); } @@ -1205,7 +1203,7 @@ static s32 act_metal_water_standing(struct MarioState *m) { return FALSE; } -static s32 act_hold_metal_water_standing(struct MarioState *m) { +static s32 act_hold_metal_water_standing(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_METAL_WATER_STANDING, 0); } @@ -1227,7 +1225,7 @@ static s32 act_hold_metal_water_standing(struct MarioState *m) { return FALSE; } -static s32 act_metal_water_walking(struct MarioState *m) { +static s32 act_metal_water_walking(struct MarioState* m) { s32 val04; if (!(m->flags & MARIO_METAL_CAP)) { @@ -1267,7 +1265,7 @@ static s32 act_metal_water_walking(struct MarioState *m) { return FALSE; } -static s32 act_hold_metal_water_walking(struct MarioState *m) { +static s32 act_hold_metal_water_walking(struct MarioState* m) { s32 val04; if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { @@ -1309,7 +1307,7 @@ static s32 act_hold_metal_water_walking(struct MarioState *m) { return FALSE; } -static s32 act_metal_water_jump(struct MarioState *m) { +static s32 act_metal_water_jump(struct MarioState* m) { if (!(m->flags & MARIO_METAL_CAP)) { return set_mario_action(m, ACT_WATER_IDLE, 0); } @@ -1334,7 +1332,7 @@ static s32 act_metal_water_jump(struct MarioState *m) { return FALSE; } -static s32 act_hold_metal_water_jump(struct MarioState *m) { +static s32 act_hold_metal_water_jump(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_METAL_WATER_FALLING, 0); } @@ -1363,7 +1361,7 @@ static s32 act_hold_metal_water_jump(struct MarioState *m) { return FALSE; } -static s32 act_metal_water_falling(struct MarioState *m) { +static s32 act_metal_water_falling(struct MarioState* m) { if (!(m->flags & MARIO_METAL_CAP)) { return set_mario_action(m, ACT_WATER_IDLE, 0); } @@ -1382,7 +1380,7 @@ static s32 act_metal_water_falling(struct MarioState *m) { return FALSE; } -static s32 act_hold_metal_water_falling(struct MarioState *m) { +static s32 act_hold_metal_water_falling(struct MarioState* m) { if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { return drop_and_set_mario_action(m, ACT_METAL_WATER_FALLING, 0); } @@ -1405,7 +1403,7 @@ static s32 act_hold_metal_water_falling(struct MarioState *m) { return FALSE; } -static s32 act_metal_water_jump_land(struct MarioState *m) { +static s32 act_metal_water_jump_land(struct MarioState* m) { play_metal_water_jumping_sound(m, TRUE); if (!(m->flags & MARIO_METAL_CAP)) { @@ -1426,7 +1424,7 @@ static s32 act_metal_water_jump_land(struct MarioState *m) { return FALSE; } -static s32 act_hold_metal_water_jump_land(struct MarioState *m) { +static s32 act_hold_metal_water_jump_land(struct MarioState* m) { play_metal_water_jumping_sound(m, TRUE); if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { @@ -1451,7 +1449,7 @@ static s32 act_hold_metal_water_jump_land(struct MarioState *m) { return FALSE; } -static s32 act_metal_water_fall_land(struct MarioState *m) { +static s32 act_metal_water_fall_land(struct MarioState* m) { play_metal_water_jumping_sound(m, TRUE); if (!(m->flags & MARIO_METAL_CAP)) { @@ -1472,7 +1470,7 @@ static s32 act_metal_water_fall_land(struct MarioState *m) { return FALSE; } -static s32 act_hold_metal_water_fall_land(struct MarioState *m) { +static s32 act_hold_metal_water_fall_land(struct MarioState* m) { play_metal_water_jumping_sound(m, TRUE); if (m->marioObj->oInteractStatus & INT_STATUS_MARIO_DROP_OBJECT) { @@ -1497,7 +1495,7 @@ static s32 act_hold_metal_water_fall_land(struct MarioState *m) { return FALSE; } -static s32 check_common_submerged_cancels(struct MarioState *m) { +static s32 check_common_submerged_cancels(struct MarioState* m) { if (m->pos[1] > m->waterLevel - 80) { if (m->waterLevel - 80 > m->floorHeight) { m->pos[1] = m->waterLevel - 80; @@ -1523,7 +1521,7 @@ static s32 check_common_submerged_cancels(struct MarioState *m) { return FALSE; } -s32 mario_execute_submerged_action(struct MarioState *m) { +s32 mario_execute_submerged_action(struct MarioState* m) { s32 cancel; if (check_common_submerged_cancels(m)) { diff --git a/src/game/mario_misc.c b/src/game/mario_misc.c index ca7bbd25..1523f5ef 100644 --- a/src/game/mario_misc.c +++ b/src/game/mario_misc.c @@ -83,18 +83,18 @@ struct GraphNodeObject gMirrorMario; // copy of Mario's geo node for drawing mi /** * Geo node script that draws Mario's head on the title screen. */ -Gfx *geo_draw_mario_head_goddard(s32 callContext, struct GraphNode *node, Mat4 *c) { - Gfx *gfx = NULL; +Gfx* geo_draw_mario_head_goddard(s32 callContext, struct GraphNode* node, Mat4* c) { + Gfx* gfx = NULL; s16 sfx = 0; - struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node; - UNUSED Mat4 *transform = c; + struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*)node; + UNUSED Mat4* transform = c; if (callContext == GEO_CONTEXT_RENDER) { if (gPlayer1Controller->controllerData != NULL && !gWarpTransition.isActive) { gd_copy_p1_contpad(gPlayer1Controller->controllerData); } FrameInterpolation_RecordOpenChild("geo_draw_mario_head_goddard", (uintptr_t)node); - gfx = (Gfx *) PHYSICAL_TO_VIRTUAL(gdm_gettestdl(asGenerated->parameter)); + gfx = (Gfx*)PHYSICAL_TO_VIRTUAL(gdm_gettestdl(asGenerated->parameter)); gGoddardVblankCallback = gd_vblank; sfx = gd_sfx_to_play(); FrameInterpolation_RecordCloseChild(); @@ -126,8 +126,8 @@ static void toad_message_opaque(void) { } static void toad_message_talking(void) { - if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN, - DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, gCurrentObject->oToadMessageDialogId)) { + if (cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_DOWN, DIALOG_FLAG_TURN_TO_MARIO, CUTSCENE_DIALOG, + gCurrentObject->oToadMessageDialogId)) { gCurrentObject->oToadMessageRecentlyTalked = TRUE; gCurrentObject->oToadMessageState = TOAD_MESSAGE_FADING; switch (gCurrentObject->oToadMessageDialogId) { @@ -219,12 +219,10 @@ void bhv_toad_message_init(void) { } static void star_door_unlock_spawn_particles(s16 angleOffset) { - struct Object *sparkleParticle = spawn_object(gCurrentObject, 0, bhvSparkleSpawn); + struct Object* sparkleParticle = spawn_object(gCurrentObject, 0, bhvSparkleSpawn); - sparkleParticle->oPosX += - 100.0f * sins((gCurrentObject->oUnlockDoorStarTimer * 0x2800) + angleOffset); - sparkleParticle->oPosZ += - 100.0f * coss((gCurrentObject->oUnlockDoorStarTimer * 0x2800) + angleOffset); + sparkleParticle->oPosX += 100.0f * sins((gCurrentObject->oUnlockDoorStarTimer * 0x2800) + angleOffset); + sparkleParticle->oPosZ += 100.0f * coss((gCurrentObject->oUnlockDoorStarTimer * 0x2800) + angleOffset); // Particles are spawned lower each frame sparkleParticle->oPosY -= gCurrentObject->oUnlockDoorStarTimer * 10.0f; } @@ -251,26 +249,23 @@ void bhv_unlock_door_star_loop(void) { } 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 + 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 + 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 + cur_obj_hide(); // Hide the object gCurrentObject->oUnlockDoorStarTimer = 0; - gCurrentObject - ->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_SPAWNING_PARTICLES + gCurrentObject->oUnlockDoorStarState++; // Sets state to UNLOCK_DOOR_STAR_SPAWNING_PARTICLES } break; case UNLOCK_DOOR_STAR_SPAWNING_PARTICLES: @@ -291,19 +286,18 @@ void bhv_unlock_door_star_loop(void) { } // 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 + 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) { - Gfx *gfx; - Gfx *gfxHead = NULL; +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); @@ -323,11 +317,11 @@ 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 filler1[4]; - Gfx *gfx = NULL; - struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node; - struct MarioBodyState *bodyState = &gBodyStates[asGenerated->parameter]; + Gfx* gfx = NULL; + struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*)node; + struct MarioBodyState* bodyState = &gBodyStates[asGenerated->parameter]; s16 alpha; UNUSED u8 filler2[4]; @@ -343,9 +337,9 @@ 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; - struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases]; +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) { // assign result. 0 if moving, 1 if stationary. @@ -357,9 +351,9 @@ 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; - struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases]; +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) { @@ -380,16 +374,16 @@ 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; - struct MarioBodyState *bodyState = &gBodyStates[asGenerated->parameter]; +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; + 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) { + if (action != ACT_BUTT_SLIDE && action != ACT_HOLD_BUTT_SLIDE && action != ACT_WALKING && + action != ACT_RIDING_SHELL_GROUND) { vec3s_copy(bodyState->torsoAngle, gVec3sZero); } rotNode->rotation[0] = bodyState->torsoAngle[1]; @@ -402,14 +396,14 @@ 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; - struct MarioBodyState *bodyState = &gBodyStates[asGenerated->parameter]; +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; + struct GraphNodeRotation* rotNode = (struct GraphNodeRotation*)node->next; + struct Camera* camera = gCurGraphNodeCamera->config.camera; if (camera->mode == CAMERA_MODE_C_UP) { rotNode->rotation[0] = gPlayerCameraState->headRotation[1]; @@ -430,9 +424,9 @@ 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; - struct MarioBodyState *bodyState = &gBodyStates[0]; +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) { @@ -440,11 +434,9 @@ Gfx *geo_switch_mario_hand(s32 callContext, struct GraphNode *node, UNUSED Mat4 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; + switchCase->selectedCase = (bodyState->handState < 5) ? bodyState->handState : MARIO_HAND_OPEN; } else { - switchCase->selectedCase = - (bodyState->handState < 2) ? bodyState->handState : MARIO_HAND_FISTS; + switchCase->selectedCase = (bodyState->handState < 2) ? bodyState->handState : MARIO_HAND_FISTS; } } } @@ -459,11 +451,11 @@ 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) { +Gfx* geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) { static s16 sMarioAttackAnimCounter = 0; - struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node; - struct GraphNodeScale *scaleNode = (struct GraphNodeScale *) node->next; - struct MarioBodyState *bodyState = &gBodyStates[0]; + struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*)node; + struct GraphNodeScale* scaleNode = (struct GraphNodeScale*)node->next; + struct MarioBodyState* bodyState = &gBodyStates[0]; if (callContext == GEO_CONTEXT_RENDER) { scaleNode->scale = 1.0f; @@ -473,8 +465,7 @@ Gfx *geo_mario_hand_foot_scaler(s32 callContext, struct GraphNode *node, UNUSED sMarioAttackAnimCounter = gAreaUpdateCounter; } scaleNode->scale = - gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)] - / 10.0f; + gMarioAttackScaleAnimation[asGenerated->parameter * 6 + (bodyState->punchState & 0x3F)] / 10.0f; } } return NULL; @@ -483,9 +474,9 @@ 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; - struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases]; +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; @@ -497,10 +488,10 @@ 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) { - struct GraphNode *next = node->next; - struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node; - struct MarioBodyState *bodyState = &gBodyStates[switchCase->numCases]; +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 MarioBodyState* bodyState = &gBodyStates[switchCase->numCases]; if (callContext == GEO_CONTEXT_RENDER) { switchCase->selectedCase = bodyState->capState & 1; @@ -522,12 +513,12 @@ 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; + struct GraphNodeRotation* rotNode = (struct GraphNodeRotation*)node->next; if (!gBodyStates[asGenerated->parameter >> 1].wingFlutter) { rotX = (coss((gAreaUpdateCounter & 0xF) << 12) + 1.0f) * 4096.0f; @@ -546,10 +537,10 @@ 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; - Mat4 *curTransform = mtx; - struct MarioState *marioState = &gMarioStates[asHeldObj->playerIndex]; +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 = &gMarioStates[asHeldObj->playerIndex]; if (callContext == GEO_CONTEXT_RENDER) { asHeldObj->objNode = NULL; @@ -588,9 +579,9 @@ 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) { +Gfx* geo_render_mirror_mario(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) { f32 mirroredX; - struct Object *mario = gMarioStates[0].marioObj; + struct Object* mario = gMarioStates[0].marioObj; switch (callContext) { case GEO_CONTEXT_CREATE: @@ -616,9 +607,9 @@ Gfx *geo_render_mirror_mario(s32 callContext, struct GraphNode *node, UNUSED Mat gMirrorMario.pos[0] = mirroredX + MIRROR_X; gMirrorMario.angle[1] = -gMirrorMario.angle[1]; gMirrorMario.scale[0] *= -1.0f; - ((struct GraphNode *) &gMirrorMario)->flags |= GRAPH_RENDER_ACTIVE; + ((struct GraphNode*)&gMirrorMario)->flags |= GRAPH_RENDER_ACTIVE; } else { - ((struct GraphNode *) &gMirrorMario)->flags &= ~GRAPH_RENDER_ACTIVE; + ((struct GraphNode*)&gMirrorMario)->flags &= ~GRAPH_RENDER_ACTIVE; } break; } @@ -629,9 +620,9 @@ 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)); diff --git a/src/game/mario_step.c b/src/game/mario_step.c index ccc8e1df..400e6cf1 100644 --- a/src/game/mario_step.c +++ b/src/game/mario_step.c @@ -12,8 +12,7 @@ static s16 sMovingSandSpeeds[] = { 12, 8, 4, 0 }; struct Surface 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, NULL, + 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, NULL, }; /** @@ -39,7 +38,7 @@ 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) { } /** @@ -52,7 +51,7 @@ void stub_mario_step_1(UNUSED struct MarioState *x) { 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; @@ -71,8 +70,9 @@ 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) { +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; @@ -86,7 +86,7 @@ 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) { +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); @@ -104,7 +104,7 @@ void mario_bonk_reflection(struct MarioState *m, u32 negateSpeed) { } } -u32 mario_update_quicksand(struct MarioState *m, f32 sinkingSpeed) { +u32 mario_update_quicksand(struct MarioState* m, f32 sinkingSpeed) { if (m->action & ACT_FLAG_RIDING_SHELL) { m->quicksandDepth = 0.0f; } else { @@ -155,7 +155,7 @@ 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) { @@ -169,12 +169,12 @@ 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) { - struct Surface *floor = m->floor; +u32 mario_update_moving_sand(struct MarioState* m) { + struct Surface* 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) { + if (floorType == SURFACE_DEEP_MOVING_QUICKSAND || floorType == SURFACE_SHALLOW_MOVING_QUICKSAND || + floorType == SURFACE_MOVING_QUICKSAND || floorType == SURFACE_INSTANT_MOVING_QUICKSAND) { s16 pushAngle = floor->force << 8; f32 pushSpeed = sMovingSandSpeeds[floor->force >> 8]; @@ -187,8 +187,8 @@ u32 mario_update_moving_sand(struct MarioState *m) { return FALSE; } -u32 mario_update_windy_ground(struct MarioState *m) { - struct Surface *floor = m->floor; +u32 mario_update_windy_ground(struct MarioState* m) { + struct Surface* floor = m->floor; if (floor->type == SURFACE_HORIZONTAL_WIND) { f32 pushSpeed; @@ -211,7 +211,7 @@ u32 mario_update_windy_ground(struct MarioState *m) { m->vel[0] += pushSpeed * sins(pushAngle); m->vel[2] += pushSpeed * coss(pushAngle); - if(ROM_JP) { + if (ROM_JP) { play_sound(SOUND_ENV_WIND2, m->marioObj->header.gfx.cameraToObject); } return TRUE; @@ -220,8 +220,8 @@ u32 mario_update_windy_ground(struct MarioState *m) { return FALSE; } -void stop_and_set_height_to_floor(struct MarioState *m) { - struct Object *marioObj = m->marioObj; +void stop_and_set_height_to_floor(struct MarioState* m) { + struct Object* marioObj = m->marioObj; mario_set_forward_vel(m, 0.0f); m->vel[1] = 0.0f; @@ -233,9 +233,9 @@ 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) { +s32 stationary_ground_step(struct MarioState* m) { u32 takeStep; - struct Object *marioObj = m->marioObj; + struct Object* marioObj = m->marioObj; u32 stepResult = GROUND_STEP_NONE; mario_set_forward_vel(m, 0.0f); @@ -255,11 +255,11 @@ s32 stationary_ground_step(struct MarioState *m) { return stepResult; } -static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) { - UNUSED struct Surface *lowerWall; - struct Surface *upperWall; - struct Surface *ceil; - struct Surface *floor; +static s32 perform_ground_quarter_step(struct MarioState* m, Vec3f nextPos) { + UNUSED struct Surface* lowerWall; + struct Surface* upperWall; + struct Surface* ceil; + struct Surface* floor; f32 ceilHeight; f32 floorHeight; f32 waterLevel; @@ -319,7 +319,7 @@ static s32 perform_ground_quarter_step(struct MarioState *m, Vec3f nextPos) { return GROUND_STEP_NONE; } -s32 perform_ground_step(struct MarioState *m) { +s32 perform_ground_step(struct MarioState* m) { s32 i; u32 stepResult; Vec3f intendedPos; @@ -345,8 +345,8 @@ s32 perform_ground_step(struct MarioState *m) { return stepResult; } -u32 check_ledge_grab(struct MarioState *m, struct Surface *wall, Vec3f intendedPos, Vec3f nextPos) { - struct Surface *ledgeFloor; +u32 check_ledge_grab(struct MarioState* m, struct Surface* wall, Vec3f intendedPos, Vec3f nextPos) { + struct Surface* ledgeFloor; Vec3f ledgePos; f32 displacementX; f32 displacementZ; @@ -385,13 +385,13 @@ u32 check_ledge_grab(struct MarioState *m, struct Surface *wall, Vec3f intendedP return TRUE; } -s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepArg) { +s32 perform_air_quarter_step(struct MarioState* m, Vec3f intendedPos, u32 stepArg) { s16 wallDYaw; Vec3f nextPos; - struct Surface *upperWall; - struct Surface *lowerWall; - struct Surface *ceil; - struct Surface *floor; + struct Surface* upperWall; + struct Surface* lowerWall; + struct Surface* ceil; + struct Surface* floor; f32 ceilHeight; f32 floorHeight; f32 waterLevel; @@ -448,8 +448,7 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr 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; } @@ -500,7 +499,7 @@ s32 perform_air_quarter_step(struct MarioState *m, Vec3f intendedPos, u32 stepAr return AIR_STEP_NONE; } -void apply_twirl_gravity(struct MarioState *m) { +void apply_twirl_gravity(struct MarioState* m) { f32 terminalVelocity; f32 heaviness = 1.0f; @@ -516,7 +515,7 @@ void apply_twirl_gravity(struct MarioState *m) { } } -u32 should_strengthen_gravity_for_jump_ascent(struct MarioState *m) { +u32 should_strengthen_gravity_for_jump_ascent(struct MarioState* m) { if (!(m->flags & MARIO_UNKNOWN_08)) { return FALSE; } @@ -532,7 +531,7 @@ u32 should_strengthen_gravity_for_jump_ascent(struct MarioState *m) { return FALSE; } -void apply_gravity(struct MarioState *m) { +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) { @@ -540,8 +539,7 @@ void apply_gravity(struct MarioState *m) { 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) { m->vel[1] = -75.0f; @@ -580,7 +578,7 @@ void apply_gravity(struct MarioState *m) { } } -void apply_vertical_wind(struct MarioState *m) { +void apply_vertical_wind(struct MarioState* m) { f32 maxVelY; f32 offsetY; @@ -600,14 +598,14 @@ void apply_vertical_wind(struct MarioState *m) { } } - if(ROM_JP) { + if (ROM_JP) { play_sound(SOUND_ENV_WIND2, m->marioObj->header.gfx.cameraToObject); } } } } -s32 perform_air_step(struct MarioState *m, u32 stepArg) { +s32 perform_air_step(struct MarioState* m, u32 stepArg) { Vec3f intendedPos; s32 i; s32 quarterStepResult; @@ -630,9 +628,8 @@ s32 perform_air_step(struct MarioState *m, u32 stepArg) { stepResult = quarterStepResult; } - if (quarterStepResult == AIR_STEP_LANDED || quarterStepResult == AIR_STEP_GRABBED_LEDGE - || quarterStepResult == AIR_STEP_GRABBED_CEILING - || quarterStepResult == AIR_STEP_HIT_LAVA_WALL) { + if (quarterStepResult == AIR_STEP_LANDED || quarterStepResult == AIR_STEP_GRABBED_LEDGE || + quarterStepResult == AIR_STEP_GRABBED_CEILING || quarterStepResult == AIR_STEP_HIT_LAVA_WALL) { break; } } @@ -656,13 +653,13 @@ 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]); diff --git a/src/game/memory.c b/src/game/memory.c index 23cbde3d..f63cc91d 100644 --- a/src/game/memory.c +++ b/src/game/memory.c @@ -20,65 +20,63 @@ struct MainPoolState { u32 freeSpace; - struct MainPoolBlock *listHeadL; - struct MainPoolBlock *listHeadR; - struct MainPoolState *prev; + struct MainPoolBlock* listHeadL; + struct MainPoolBlock* listHeadR; + struct MainPoolState* prev; }; struct MainPoolBlock { - struct MainPoolBlock *prev; - struct MainPoolBlock *next; + struct MainPoolBlock* prev; + struct MainPoolBlock* next; }; struct MemoryBlock { - struct MemoryBlock *next; + struct MemoryBlock* next; u32 size; }; struct MemoryPool { u32 totalSpace; - struct MemoryBlock *firstBlock; + struct MemoryBlock* firstBlock; struct MemoryBlock freeList; }; extern uintptr_t sSegmentTable[32]; extern u32 sPoolFreeSpace; -extern u8 *sPoolStart; -extern u8 *sPoolEnd; -extern struct MainPoolBlock *sPoolListHeadL; -extern struct MainPoolBlock *sPoolListHeadR; - +extern u8* sPoolStart; +extern u8* sPoolEnd; +extern struct MainPoolBlock* sPoolListHeadL; +extern struct MainPoolBlock* sPoolListHeadR; /** * Memory pool for small graphical effects that aren't connected to Objects. * Used for colored text, paintings, and environmental snow and bubbles. */ -struct MemoryPool *gEffectsMemoryPool; +struct MemoryPool* gEffectsMemoryPool; uintptr_t sSegmentTable[32]; u32 sPoolFreeSpace; -u8 *sPoolStart; -u8 *sPoolEnd; -struct MainPoolBlock *sPoolListHeadL; -struct MainPoolBlock *sPoolListHeadR; +u8* sPoolStart; +u8* sPoolEnd; +struct MainPoolBlock* sPoolListHeadL; +struct MainPoolBlock* sPoolListHeadR; +static struct MainPoolState* gMainPoolState = NULL; -static struct MainPoolState *gMainPoolState = NULL; - -uintptr_t set_segment_base_addr(s32 segment, void *addr) { - sSegmentTable[segment] = (uintptr_t) addr & 0x1FFFFFFF; +uintptr_t set_segment_base_addr(s32 segment, void* addr) { + sSegmentTable[segment] = (uintptr_t)addr & 0x1FFFFFFF; return sSegmentTable[segment]; } -void *get_segment_base_addr(s32 segment) { - return (void *) (sSegmentTable[segment] | 0x80000000); +void* get_segment_base_addr(s32 segment) { + return (void*)(sSegmentTable[segment] | 0x80000000); } -void *segmented_to_virtual(const void *addr) { +void* segmented_to_virtual(const void* addr) { return LOAD_ASSET(addr); } -void *virtual_to_segmented(u32 segment, const void *addr) { +void* virtual_to_segmented(u32 segment, const void* addr) { return LOAD_ASSET(addr); } @@ -90,13 +88,13 @@ void move_segment_table_to_dmem(void) { * that grow inward from the left and right. It therefore only supports * freeing the object that was most recently allocated from a side. */ -void main_pool_init(void *start, void *end) { - sPoolStart = (u8 *) ALIGN16((uintptr_t) start) + 16; - sPoolEnd = (u8 *) ALIGN16((uintptr_t) end - 15) - 16; +void main_pool_init(void* start, void* end) { + sPoolStart = (u8*)ALIGN16((uintptr_t)start) + 16; + sPoolEnd = (u8*)ALIGN16((uintptr_t)end - 15) - 16; sPoolFreeSpace = sPoolEnd - sPoolStart; - sPoolListHeadL = (struct MainPoolBlock *) (sPoolStart - 16); - sPoolListHeadR = (struct MainPoolBlock *) sPoolEnd; + sPoolListHeadL = (struct MainPoolBlock*)(sPoolStart - 16); + sPoolListHeadR = (struct MainPoolBlock*)sPoolEnd; sPoolListHeadL->prev = NULL; sPoolListHeadL->next = NULL; sPoolListHeadR->prev = NULL; @@ -108,27 +106,27 @@ void main_pool_init(void *start, void *end) { * specified side of the pool (MEMORY_POOL_LEFT or MEMORY_POOL_RIGHT). * If there is not enough space, return NULL. */ -void *main_pool_alloc(u32 size, u32 side) { - struct MainPoolBlock *newListHead; - void *addr = NULL; +void* main_pool_alloc(u32 size, u32 side) { + struct MainPoolBlock* newListHead; + void* addr = NULL; size = ALIGN16(size) + 16; if (size != 0 && sPoolFreeSpace >= size) { sPoolFreeSpace -= size; if (side == MEMORY_POOL_LEFT) { - newListHead = (struct MainPoolBlock *) ((u8 *) sPoolListHeadL + size); + newListHead = (struct MainPoolBlock*)((u8*)sPoolListHeadL + size); sPoolListHeadL->next = newListHead; newListHead->prev = sPoolListHeadL; newListHead->next = NULL; - addr = (u8 *) sPoolListHeadL + 16; + addr = (u8*)sPoolListHeadL + 16; sPoolListHeadL = newListHead; } else { - newListHead = (struct MainPoolBlock *) ((u8 *) sPoolListHeadR - size); + newListHead = (struct MainPoolBlock*)((u8*)sPoolListHeadR - size); sPoolListHeadR->prev = newListHead; newListHead->next = sPoolListHeadR; newListHead->prev = NULL; sPoolListHeadR = newListHead; - addr = (u8 *) sPoolListHeadR + 16; + addr = (u8*)sPoolListHeadR + 16; } } return addr; @@ -140,9 +138,9 @@ void *main_pool_alloc(u32 size, u32 side) { * newer blocks are freed as well. * Return the amount of free space left in the pool. */ -u32 main_pool_free(void *addr) { - struct MainPoolBlock *block = (struct MainPoolBlock *) ((u8 *) addr - 16); - struct MainPoolBlock *oldListHead = (struct MainPoolBlock *) ((u8 *) addr - 16); +u32 main_pool_free(void* addr) { + struct MainPoolBlock* block = (struct MainPoolBlock*)((u8*)addr - 16); + struct MainPoolBlock* oldListHead = (struct MainPoolBlock*)((u8*)addr - 16); if (oldListHead < sPoolListHeadL) { while (oldListHead->next != NULL) { @@ -150,14 +148,14 @@ u32 main_pool_free(void *addr) { } sPoolListHeadL = block; sPoolListHeadL->next = NULL; - sPoolFreeSpace += (uintptr_t) oldListHead - (uintptr_t) sPoolListHeadL; + sPoolFreeSpace += (uintptr_t)oldListHead - (uintptr_t)sPoolListHeadL; } else { while (oldListHead->prev != NULL) { oldListHead = oldListHead->prev; } sPoolListHeadR = block->next; sPoolListHeadR->prev = NULL; - sPoolFreeSpace += (uintptr_t) sPoolListHeadR - (uintptr_t) oldListHead; + sPoolFreeSpace += (uintptr_t)sPoolListHeadR - (uintptr_t)oldListHead; } return sPoolFreeSpace; } @@ -168,9 +166,9 @@ u32 main_pool_free(void *addr) { * block from the left side. * The block does not move. */ -void *main_pool_realloc(void *addr, u32 size) { - void *newAddr = NULL; - struct MainPoolBlock *block = (struct MainPoolBlock *) ((u8 *) addr - 16); +void* main_pool_realloc(void* addr, u32 size) { + void* newAddr = NULL; + struct MainPoolBlock* block = (struct MainPoolBlock*)((u8*)addr - 16); if (block->next == sPoolListHeadL) { main_pool_free(addr); @@ -192,10 +190,10 @@ u32 main_pool_available(void) { * in the pool. */ u32 main_pool_push_state(void) { - struct MainPoolState *prevState = gMainPoolState; + struct MainPoolState* prevState = gMainPoolState; u32 freeSpace = sPoolFreeSpace; - struct MainPoolBlock *lhead = sPoolListHeadL; - struct MainPoolBlock *rhead = sPoolListHeadR; + struct MainPoolBlock* lhead = sPoolListHeadL; + struct MainPoolBlock* rhead = sPoolListHeadR; gMainPoolState = main_pool_alloc(sizeof(*gMainPoolState), MEMORY_POOL_LEFT); gMainPoolState->freeSpace = freeSpace; @@ -221,7 +219,7 @@ u32 main_pool_pop_state(void) { * Perform a DMA read from ROM. The transfer is split into 4KB blocks, and this * function blocks until completion. */ -static void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) { +static void dma_read(u8* dest, u8* srcStart, u8* srcEnd) { memcpy(dest, srcStart, srcEnd - srcStart); } @@ -229,8 +227,8 @@ static void dma_read(u8 *dest, u8 *srcStart, u8 *srcEnd) { * Perform a DMA read from ROM, allocating space in the memory pool to write to. * Return the destination address. */ -static void *dynamic_dma_read(u8 *srcStart, u8 *srcEnd, u32 side) { - void *dest; +static void* dynamic_dma_read(u8* srcStart, u8* srcEnd, u32 side) { + void* dest; u32 size = ALIGN16(srcEnd - srcStart); dest = main_pool_alloc(size, side); @@ -240,24 +238,23 @@ static void *dynamic_dma_read(u8 *srcStart, u8 *srcEnd, u32 side) { return dest; } - /** * Allocate an allocation-only pool from the main pool. This pool doesn't * support freeing allocated memory. * Return NULL if there is not enough space in the main pool. */ -struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side) { - void *addr; - struct AllocOnlyPool *subPool = NULL; +struct AllocOnlyPool* alloc_only_pool_init(u32 size, u32 side) { + void* addr; + struct AllocOnlyPool* subPool = NULL; size = ALIGN4(size); addr = main_pool_alloc(size + sizeof(struct AllocOnlyPool), side); if (addr != NULL) { - subPool = (struct AllocOnlyPool *) addr; + subPool = (struct AllocOnlyPool*)addr; subPool->totalSpace = size; subPool->usedSpace = 0; - subPool->startPtr = (u8 *) addr + sizeof(struct AllocOnlyPool); - subPool->freePtr = (u8 *) addr + sizeof(struct AllocOnlyPool); + subPool->startPtr = (u8*)addr + sizeof(struct AllocOnlyPool); + subPool->freePtr = (u8*)addr + sizeof(struct AllocOnlyPool); } return subPool; } @@ -266,8 +263,8 @@ struct AllocOnlyPool *alloc_only_pool_init(u32 size, u32 side) { * Allocate from an allocation-only pool. * Return NULL if there is not enough space. */ -void *alloc_only_pool_alloc(struct AllocOnlyPool *pool, s32 size) { - void *addr = NULL; +void* alloc_only_pool_alloc(struct AllocOnlyPool* pool, s32 size) { + void* addr = NULL; size = ALIGN4(size); if (size > 0 && pool->usedSpace + size <= pool->totalSpace) { @@ -284,8 +281,8 @@ void *alloc_only_pool_alloc(struct AllocOnlyPool *pool, s32 size) { * from the left end of the main pool. * The pool does not move. */ -struct AllocOnlyPool *alloc_only_pool_resize(struct AllocOnlyPool *pool, u32 size) { - struct AllocOnlyPool *newPool; +struct AllocOnlyPool* alloc_only_pool_resize(struct AllocOnlyPool* pool, u32 size) { + struct AllocOnlyPool* newPool; size = ALIGN4(size); newPool = main_pool_realloc(pool, size + sizeof(struct AllocOnlyPool)); @@ -300,19 +297,19 @@ struct AllocOnlyPool *alloc_only_pool_resize(struct AllocOnlyPool *pool, u32 siz * order for allocation/freeing. * Return NULL if there is not enough space in the main pool. */ -struct MemoryPool *mem_pool_init(u32 size, u32 side) { - void *addr; - struct MemoryBlock *block; - struct MemoryPool *pool = NULL; +struct MemoryPool* mem_pool_init(u32 size, u32 side) { + void* addr; + struct MemoryBlock* block; + struct MemoryPool* pool = NULL; size = ALIGN4(size); addr = main_pool_alloc(size + sizeof(struct MemoryPool), side); if (addr != NULL) { - pool = (struct MemoryPool *) addr; + pool = (struct MemoryPool*)addr; pool->totalSpace = size; - pool->firstBlock = (struct MemoryBlock *) ((u8 *) addr + sizeof(struct MemoryPool)); - pool->freeList.next = (struct MemoryBlock *) ((u8 *) addr + sizeof(struct MemoryPool)); + pool->firstBlock = (struct MemoryBlock*)((u8*)addr + sizeof(struct MemoryPool)); + pool->freeList.next = (struct MemoryBlock*)((u8*)addr + sizeof(struct MemoryPool)); block = pool->firstBlock; block->next = NULL; @@ -324,18 +321,18 @@ struct MemoryPool *mem_pool_init(u32 size, u32 side) { /** * Allocate from a memory pool. Return NULL if there is not enough space. */ -void *mem_pool_alloc(struct MemoryPool *pool, u32 size) { - struct MemoryBlock *freeBlock = &pool->freeList; - void *addr = NULL; +void* mem_pool_alloc(struct MemoryPool* pool, u32 size) { + struct MemoryBlock* freeBlock = &pool->freeList; + void* addr = NULL; size = ALIGN4(size) + sizeof(struct MemoryBlock); while (freeBlock->next != NULL) { if (freeBlock->next->size >= size) { - addr = (u8 *) freeBlock->next + sizeof(struct MemoryBlock); + addr = (u8*)freeBlock->next + sizeof(struct MemoryBlock); if (freeBlock->next->size - size <= sizeof(struct MemoryBlock)) { freeBlock->next = freeBlock->next->next; } else { - struct MemoryBlock *newBlock = (struct MemoryBlock *) ((u8 *) freeBlock->next + size); + struct MemoryBlock* newBlock = (struct MemoryBlock*)((u8*)freeBlock->next + size); newBlock->size = freeBlock->next->size - size; newBlock->next = freeBlock->next->next; freeBlock->next->size = size; @@ -351,16 +348,16 @@ void *mem_pool_alloc(struct MemoryPool *pool, u32 size) { /** * Free a block that was allocated using mem_pool_alloc. */ -void mem_pool_free(struct MemoryPool *pool, void *addr) { - struct MemoryBlock *block = (struct MemoryBlock *) ((u8 *) addr - sizeof(struct MemoryBlock)); - struct MemoryBlock *freeList = pool->freeList.next; +void mem_pool_free(struct MemoryPool* pool, void* addr) { + struct MemoryBlock* block = (struct MemoryBlock*)((u8*)addr - sizeof(struct MemoryBlock)); + struct MemoryBlock* freeList = pool->freeList.next; if (pool->freeList.next == NULL) { pool->freeList.next = block; block->next = NULL; } else { if (block < pool->freeList.next) { - if ((u8 *) pool->freeList.next == (u8 *) block + block->size) { + if ((u8*)pool->freeList.next == (u8*)block + block->size) { block->size += freeList->size; block->next = freeList->next; pool->freeList.next = block; @@ -375,14 +372,14 @@ void mem_pool_free(struct MemoryPool *pool, void *addr) { } freeList = freeList->next; } - if ((u8 *) freeList + freeList->size == (u8 *) block) { + if ((u8*)freeList + freeList->size == (u8*)block) { freeList->size += block->size; block = freeList; } else { block->next = freeList->next; freeList->next = block; } - if (block->next != NULL && (u8 *) block->next == (u8 *) block + block->size) { + if (block->next != NULL && (u8*)block->next == (u8*)block + block->size) { block->size = block->size + block->next->size; block->next = block->next->next; } @@ -390,11 +387,11 @@ void mem_pool_free(struct MemoryPool *pool, void *addr) { } } -void *alloc_display_list(u32 size) { - void *ptr = NULL; +void* alloc_display_list(u32 size) { + void* ptr = NULL; size = ALIGN8(size); - if (gGfxPoolEnd - size >= (u8 *) gDisplayListHead) { + if (gGfxPoolEnd - size >= (u8*)gDisplayListHead) { gGfxPoolEnd -= size; ptr = gGfxPoolEnd; } else { @@ -402,11 +399,9 @@ void *alloc_display_list(u32 size) { return ptr; } -static struct DmaTable *load_dma_table_address(u8 *srcAddr) { - struct DmaTable *table = dynamic_dma_read(srcAddr, srcAddr + sizeof(u32), - MEMORY_POOL_LEFT); - u32 size = table->count * sizeof(struct OffsetSizePair) + - sizeof(struct DmaTable) - sizeof(struct OffsetSizePair); +static struct DmaTable* load_dma_table_address(u8* srcAddr) { + struct DmaTable* table = dynamic_dma_read(srcAddr, srcAddr + sizeof(u32), MEMORY_POOL_LEFT); + u32 size = table->count * sizeof(struct OffsetSizePair) + sizeof(struct DmaTable) - sizeof(struct OffsetSizePair); main_pool_free(table); table = dynamic_dma_read(srcAddr, srcAddr + size, MEMORY_POOL_LEFT); @@ -414,7 +409,7 @@ static struct DmaTable *load_dma_table_address(u8 *srcAddr) { return table; } -void setup_dma_table_list(struct DmaHandlerList *list, void *srcAddr, void *buffer) { +void setup_dma_table_list(struct DmaHandlerList* list, void* srcAddr, void* buffer) { if (srcAddr != NULL) { list->dmaTable = load_dma_table_address(srcAddr); } @@ -422,12 +417,12 @@ void setup_dma_table_list(struct DmaHandlerList *list, void *srcAddr, void *buff list->bufTarget = buffer; } -s32 load_patchable_table(struct DmaHandlerList *list, s32 index) { +s32 load_patchable_table(struct DmaHandlerList* list, s32 index) { s32 ret = FALSE; - struct DmaTable *table = list->dmaTable; + struct DmaTable* table = list->dmaTable; if ((u32)index < table->count) { - u8 *addr = table->srcAddr + table->anim[index].offset; + u8* addr = table->srcAddr + table->anim[index].offset; s32 size = table->anim[index].size; if (list->currentAddr != addr) { diff --git a/src/game/moving_texture.c b/src/game/moving_texture.c index 0d84115e..83ae8bad 100644 --- a/src/game/moving_texture.c +++ b/src/game/moving_texture.c @@ -88,14 +88,14 @@ struct MovtexObject { /// amount of moving vertices s32 vtx_count; /// segmented address to movtex mesh with vertices - void *movtexVerts; + void* movtexVerts; /// display list inserted before moving triangles - Gfx *beginDl; + Gfx* beginDl; /// display list inserted after moving triangles - Gfx *endDl; + Gfx* endDl; /// display list with the actual moving texture triangles. /// Assumes the animated vertices are buffered and correct texture is set - Gfx *triDl; + Gfx* triDl; // if the list does not have per-vertex colors, all vertices have these colors u8 r; /// red u8 g; /// green @@ -121,30 +121,30 @@ float gPaintingMarioYEntry = 0.0f; /// Variable to ensure the initial Wet-Dry World water level is set only once s32 gWdwWaterLevelSet = FALSE; -//extern u8 ssl_quicksand[]; -//extern u8 ssl_pyramid_sand[]; -//extern u8 ttc_yellow_triangle[]; +// extern u8 ssl_quicksand[]; +// extern u8 ssl_pyramid_sand[]; +// extern u8 ttc_yellow_triangle[]; /** * An array for converting a movtex texture id to a pointer that can * be passed to gDPSetTextureImage. */ -u8 *gMovtexIdToTexture[] = { texture_waterbox_water, texture_waterbox_mist, +u8* gMovtexIdToTexture[] = { texture_waterbox_water, texture_waterbox_mist, texture_waterbox_jrb_water, texture_waterbox_unknown_water, texture_waterbox_lava, ssl_quicksand, ssl_pyramid_sand, ttc_yellow_triangle }; // extern Gfx castle_grounds_dl_waterfall[]; // extern s16 castle_grounds_movtex_tris_waterfall[]; -//extern s16 ssl_movtex_tris_pyramid_sand_pathway_front[]; -//extern Gfx ssl_dl_pyramid_sand_pathway_begin[]; -//extern Gfx ssl_dl_pyramid_sand_pathway_end[]; -//extern Gfx ssl_dl_pyramid_sand_pathway_front_end[]; -//extern s16 ssl_movtex_tris_pyramid_sand_pathway_floor[]; -//extern Gfx ssl_dl_pyramid_sand_pathway_floor_begin[]; -//extern Gfx ssl_dl_pyramid_sand_pathway_floor_end[]; -//extern s16 ssl_movtex_tris_pyramid_sand_pathway_side[]; -//extern Gfx ssl_dl_pyramid_sand_pathway_side_end[]; +// extern s16 ssl_movtex_tris_pyramid_sand_pathway_front[]; +// extern Gfx ssl_dl_pyramid_sand_pathway_begin[]; +// extern Gfx ssl_dl_pyramid_sand_pathway_end[]; +// extern Gfx ssl_dl_pyramid_sand_pathway_front_end[]; +// extern s16 ssl_movtex_tris_pyramid_sand_pathway_floor[]; +// extern Gfx ssl_dl_pyramid_sand_pathway_floor_begin[]; +// extern Gfx ssl_dl_pyramid_sand_pathway_floor_end[]; +// extern s16 ssl_movtex_tris_pyramid_sand_pathway_side[]; +// extern Gfx ssl_dl_pyramid_sand_pathway_side_end[]; // extern s16 bitfs_movtex_tris_lava_first_section[]; // extern Gfx bitfs_dl_lava_sections[]; // extern s16 bitfs_movtex_tris_lava_second_section[]; @@ -197,34 +197,28 @@ struct MovtexObject gMovtexNonColored[] = { // Inside the pyramid there is a sand pathway with the 5 secrets on it. // pathway_front is the highest 'sand fall', pathway_floor is the horizontal // sand stream and pathway_side is the lower 'sand fall'. - { MOVTEX_PYRAMID_SAND_PATHWAY_FRONT, TEX_PYRAMID_SAND_SSL, 8, - ssl_movtex_tris_pyramid_sand_pathway_front, ssl_dl_pyramid_sand_pathway_begin, - ssl_dl_pyramid_sand_pathway_end, ssl_dl_pyramid_sand_pathway_front_end, 0xff, 0xff, 0xff, 0xff, - LAYER_TRANSPARENT_INTER }, - { MOVTEX_PYRAMID_SAND_PATHWAY_FLOOR, TEX_PYRAMID_SAND_SSL, 8, - ssl_movtex_tris_pyramid_sand_pathway_floor, ssl_dl_pyramid_sand_pathway_floor_begin, - ssl_dl_pyramid_sand_pathway_floor_end, ssl_dl_pyramid_sand_pathway_front_end, 0xff, 0xff, 0xff, - 0xff, LAYER_OPAQUE_INTER }, - { MOVTEX_PYRAMID_SAND_PATHWAY_SIDE, TEX_PYRAMID_SAND_SSL, 6, - ssl_movtex_tris_pyramid_sand_pathway_side, ssl_dl_pyramid_sand_pathway_begin, - ssl_dl_pyramid_sand_pathway_end, ssl_dl_pyramid_sand_pathway_side_end, 0xff, 0xff, 0xff, 0xff, - LAYER_TRANSPARENT_INTER }, + { MOVTEX_PYRAMID_SAND_PATHWAY_FRONT, TEX_PYRAMID_SAND_SSL, 8, ssl_movtex_tris_pyramid_sand_pathway_front, + ssl_dl_pyramid_sand_pathway_begin, ssl_dl_pyramid_sand_pathway_end, ssl_dl_pyramid_sand_pathway_front_end, 0xff, + 0xff, 0xff, 0xff, LAYER_TRANSPARENT_INTER }, + { MOVTEX_PYRAMID_SAND_PATHWAY_FLOOR, TEX_PYRAMID_SAND_SSL, 8, ssl_movtex_tris_pyramid_sand_pathway_floor, + ssl_dl_pyramid_sand_pathway_floor_begin, ssl_dl_pyramid_sand_pathway_floor_end, + ssl_dl_pyramid_sand_pathway_front_end, 0xff, 0xff, 0xff, 0xff, LAYER_OPAQUE_INTER }, + { MOVTEX_PYRAMID_SAND_PATHWAY_SIDE, TEX_PYRAMID_SAND_SSL, 6, ssl_movtex_tris_pyramid_sand_pathway_side, + ssl_dl_pyramid_sand_pathway_begin, ssl_dl_pyramid_sand_pathway_end, ssl_dl_pyramid_sand_pathway_side_end, 0xff, + 0xff, 0xff, 0xff, LAYER_TRANSPARENT_INTER }, // The waterfall outside the castle - { MOVTEX_CASTLE_WATERFALL, TEXTURE_WATER, 15, castle_grounds_movtex_tris_waterfall, - dl_waterbox_rgba16_begin, dl_waterbox_end, castle_grounds_dl_waterfall, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT_INTER }, + { MOVTEX_CASTLE_WATERFALL, TEXTURE_WATER, 15, castle_grounds_movtex_tris_waterfall, dl_waterbox_rgba16_begin, + dl_waterbox_end, castle_grounds_dl_waterfall, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, // Bowser in the Fire Sea has lava at 3 heights, lava_floor is the lowest // and lava_second_section is the highest - { MOVTEX_BITFS_LAVA_FIRST, TEXTURE_LAVA, 4, bitfs_movtex_tris_lava_first_section, - dl_waterbox_rgba16_begin, dl_waterbox_end, bitfs_dl_lava_sections, 0xff, 0xff, 0xff, 0xff, - LAYER_OPAQUE }, - { MOVTEX_BITFS_LAVA_SECOND, TEXTURE_LAVA, 4, bitfs_movtex_tris_lava_second_section, - dl_waterbox_rgba16_begin, dl_waterbox_end, bitfs_dl_lava_sections, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT }, - { MOVTEX_BITFS_LAVA_FLOOR, TEXTURE_LAVA, 9, bitfs_movtex_tris_lava_floor, dl_waterbox_rgba16_begin, - dl_waterbox_end, bitfs_dl_lava_floor, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT }, + { MOVTEX_BITFS_LAVA_FIRST, TEXTURE_LAVA, 4, bitfs_movtex_tris_lava_first_section, dl_waterbox_rgba16_begin, + dl_waterbox_end, bitfs_dl_lava_sections, 0xff, 0xff, 0xff, 0xff, LAYER_OPAQUE }, + { MOVTEX_BITFS_LAVA_SECOND, TEXTURE_LAVA, 4, bitfs_movtex_tris_lava_second_section, dl_waterbox_rgba16_begin, + dl_waterbox_end, bitfs_dl_lava_sections, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT }, + { MOVTEX_BITFS_LAVA_FLOOR, TEXTURE_LAVA, 9, bitfs_movtex_tris_lava_floor, dl_waterbox_rgba16_begin, dl_waterbox_end, + bitfs_dl_lava_floor, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT }, // Lava floor in Lethal Lava Land and the lava fall in the volcano //! Note that the lava floor in the volcano is actually a quad. @@ -234,34 +228,29 @@ struct MovtexObject gMovtexNonColored[] = { // It was probably too large however, resulting in overflowing texture // coordinates or other artifacts, so they converted it to a movtex // mesh with 9 vertices, subdividing the rectangle into 4 smaller ones. - { MOVTEX_LLL_LAVA_FLOOR, TEXTURE_LAVA, 9, lll_movtex_tris_lava_floor, dl_waterbox_rgba16_begin, - dl_waterbox_end, lll_dl_lava_floor, 0xff, 0xff, 0xff, 0xc8, LAYER_TRANSPARENT }, - { MOVTEX_VOLCANO_LAVA_FALL, TEXTURE_LAVA, 16, lll_movtex_tris_lavafall_volcano, - dl_waterbox_rgba16_begin, dl_waterbox_end, lll_dl_lavafall_volcano, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT_INTER }, + { MOVTEX_LLL_LAVA_FLOOR, TEXTURE_LAVA, 9, lll_movtex_tris_lava_floor, dl_waterbox_rgba16_begin, dl_waterbox_end, + lll_dl_lava_floor, 0xff, 0xff, 0xff, 0xc8, LAYER_TRANSPARENT }, + { MOVTEX_VOLCANO_LAVA_FALL, TEXTURE_LAVA, 16, lll_movtex_tris_lavafall_volcano, dl_waterbox_rgba16_begin, + dl_waterbox_end, lll_dl_lavafall_volcano, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, // Cavern of the metal Cap has a waterfall source above the switch platform, // the stream, around the switch, and the waterfall that's the same as the one // outside the castle. They are all part of the same mesh. - { MOVTEX_COTMC_WATER, TEXTURE_WATER, 14, cotmc_movtex_tris_water, cotmc_dl_water_begin, - cotmc_dl_water_end, cotmc_dl_water, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, + { MOVTEX_COTMC_WATER, TEXTURE_WATER, 14, cotmc_movtex_tris_water, cotmc_dl_water_begin, cotmc_dl_water_end, + cotmc_dl_water, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, // Tall Tall mountain has water going from the top to the bottom of the mountain. - { MOVTEX_TTM_BEGIN_WATERFALL, TEXTURE_WATER, 6, ttm_movtex_tris_begin_waterfall, - dl_waterbox_rgba16_begin, dl_waterbox_end, ttm_dl_waterfall, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT }, - { MOVTEX_TTM_END_WATERFALL, TEXTURE_WATER, 6, ttm_movtex_tris_end_waterfall, - dl_waterbox_rgba16_begin, dl_waterbox_end, ttm_dl_waterfall, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT }, + { MOVTEX_TTM_BEGIN_WATERFALL, TEXTURE_WATER, 6, ttm_movtex_tris_begin_waterfall, dl_waterbox_rgba16_begin, + dl_waterbox_end, ttm_dl_waterfall, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT }, + { MOVTEX_TTM_END_WATERFALL, TEXTURE_WATER, 6, ttm_movtex_tris_end_waterfall, dl_waterbox_rgba16_begin, + dl_waterbox_end, ttm_dl_waterfall, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT }, { MOVTEX_TTM_BEGIN_PUDDLE_WATERFALL, TEXTURE_WATER, 4, ttm_movtex_tris_begin_puddle_waterfall, dl_waterbox_rgba16_begin, dl_waterbox_end, ttm_dl_bottom_waterfall, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, - { MOVTEX_TTM_END_PUDDLE_WATERFALL, TEXTURE_WATER, 4, ttm_movtex_tris_end_puddle_waterfall, - dl_waterbox_rgba16_begin, dl_waterbox_end, ttm_dl_bottom_waterfall, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT_INTER }, - { MOVTEX_TTM_PUDDLE_WATERFALL, TEXTURE_WATER, 8, ttm_movtex_tris_puddle_waterfall, - dl_waterbox_rgba16_begin, dl_waterbox_end, ttm_dl_puddle_waterfall, 0xff, 0xff, 0xff, 0xb4, - LAYER_TRANSPARENT_INTER }, + { MOVTEX_TTM_END_PUDDLE_WATERFALL, TEXTURE_WATER, 4, ttm_movtex_tris_end_puddle_waterfall, dl_waterbox_rgba16_begin, + dl_waterbox_end, ttm_dl_bottom_waterfall, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, + { MOVTEX_TTM_PUDDLE_WATERFALL, TEXTURE_WATER, 8, ttm_movtex_tris_puddle_waterfall, dl_waterbox_rgba16_begin, + dl_waterbox_end, ttm_dl_puddle_waterfall, 0xff, 0xff, 0xff, 0xb4, LAYER_TRANSPARENT_INTER }, { 0x00000000, 0x00000000, 0, NULL, NULL, NULL, NULL, 0x00, 0x00, 0x00, 0x00, 0x00000000 }, }; @@ -269,21 +258,19 @@ struct MovtexObject gMovtexNonColored[] = { * MovtexObjects that have color attributes per vertex. */ struct MovtexObject gMovtexColored[] = { - { MOVTEX_SSL_PYRAMID_SIDE, TEX_QUICKSAND_SSL, 12, ssl_movtex_tris_pyramid_quicksand, - ssl_dl_quicksand_begin, ssl_dl_quicksand_end, ssl_dl_pyramid_quicksand, 0xff, 0xff, 0xff, 0xff, - LAYER_OPAQUE }, + { MOVTEX_SSL_PYRAMID_SIDE, TEX_QUICKSAND_SSL, 12, ssl_movtex_tris_pyramid_quicksand, ssl_dl_quicksand_begin, + ssl_dl_quicksand_end, ssl_dl_pyramid_quicksand, 0xff, 0xff, 0xff, 0xff, LAYER_OPAQUE }, { MOVTEX_SSL_PYRAMID_CORNER, TEX_QUICKSAND_SSL, 16, ssl_movtex_tris_pyramid_corners_quicksand, - ssl_dl_quicksand_begin, ssl_dl_quicksand_end, ssl_dl_pyramid_corners_quicksand, 0xff, 0xff, 0xff, - 0xff, LAYER_OPAQUE }, - { MOVTEX_SSL_COURSE_EDGE, TEX_QUICKSAND_SSL, 15, ssl_movtex_tris_sides_quicksand, - ssl_dl_quicksand_begin, ssl_dl_quicksand_end, ssl_dl_sides_quicksand, 0xff, 0xff, 0xff, 0xff, + ssl_dl_quicksand_begin, ssl_dl_quicksand_end, ssl_dl_pyramid_corners_quicksand, 0xff, 0xff, 0xff, 0xff, LAYER_OPAQUE }, + { MOVTEX_SSL_COURSE_EDGE, TEX_QUICKSAND_SSL, 15, ssl_movtex_tris_sides_quicksand, ssl_dl_quicksand_begin, + ssl_dl_quicksand_end, ssl_dl_sides_quicksand, 0xff, 0xff, 0xff, 0xff, LAYER_OPAQUE }, { MOVTEX_TREADMILL_BIG, TEX_YELLOW_TRI_TTC, 12, ttc_movtex_tris_big_surface_treadmill, - ttc_dl_surface_treadmill_begin, ttc_dl_surface_treadmill_end, ttc_dl_surface_treadmill, 0xff, - 0xff, 0xff, 0xff, LAYER_OPAQUE }, + ttc_dl_surface_treadmill_begin, ttc_dl_surface_treadmill_end, ttc_dl_surface_treadmill, 0xff, 0xff, 0xff, 0xff, + LAYER_OPAQUE }, { MOVTEX_TREADMILL_SMALL, TEX_YELLOW_TRI_TTC, 12, ttc_movtex_tris_small_surface_treadmill, - ttc_dl_surface_treadmill_begin, ttc_dl_surface_treadmill_end, ttc_dl_surface_treadmill, 0xff, - 0xff, 0xff, 0xff, LAYER_OPAQUE }, + ttc_dl_surface_treadmill_begin, ttc_dl_surface_treadmill_end, ttc_dl_surface_treadmill, 0xff, 0xff, 0xff, 0xff, + LAYER_OPAQUE }, { 0x00000000, 0x00000000, 0, NULL, NULL, NULL, NULL, 0x00, 0x00, 0x00, 0x00, 0x00000000 }, }; @@ -291,12 +278,11 @@ struct MovtexObject gMovtexColored[] = { * Treated identically to gMovtexColored. */ struct MovtexObject gMovtexColored2[] = { - { MOVTEX_SSL_SAND_PIT_OUTSIDE, TEX_QUICKSAND_SSL, 8, ssl_movtex_tris_quicksand_pit, - ssl_dl_quicksand_pit_begin, ssl_dl_quicksand_pit_end, ssl_dl_quicksand_pit, 0xff, 0xff, 0xff, - 0xff, LAYER_OPAQUE }, + { MOVTEX_SSL_SAND_PIT_OUTSIDE, TEX_QUICKSAND_SSL, 8, ssl_movtex_tris_quicksand_pit, ssl_dl_quicksand_pit_begin, + ssl_dl_quicksand_pit_end, ssl_dl_quicksand_pit, 0xff, 0xff, 0xff, 0xff, LAYER_OPAQUE }, { MOVTEX_SSL_SAND_PIT_PYRAMID, TEX_PYRAMID_SAND_SSL, 8, ssl_movtex_tris_pyramid_quicksand_pit, - ssl_dl_pyramid_quicksand_pit_begin, ssl_dl_pyramid_quicksand_pit_end, ssl_dl_quicksand_pit, 0xff, - 0xff, 0xff, 0xff, LAYER_OPAQUE }, + ssl_dl_pyramid_quicksand_pit_begin, ssl_dl_pyramid_quicksand_pit_end, ssl_dl_quicksand_pit, 0xff, 0xff, 0xff, + 0xff, LAYER_OPAQUE }, { 0x00000000, 0x00000000, 0, NULL, NULL, NULL, NULL, 0x00, 0x00, 0x00, 0x00, 0x00000000 }, }; @@ -304,7 +290,7 @@ struct MovtexObject gMovtexColored2[] = { * Sets the initial water level in Wet-Dry World based on how high Mario * jumped into the painting. */ -Gfx *geo_wdw_set_initial_water_level(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_wdw_set_initial_water_level(s32 callContext, UNUSED struct GraphNode* node, UNUSED Mat4 mtx) { s32 i; UNUSED u8 unused[] = { 1, 0, 4, 0, 7, 0, 10, 0 }; s16 wdwWaterHeight; @@ -312,8 +298,7 @@ Gfx *geo_wdw_set_initial_water_level(s32 callContext, UNUSED struct GraphNode *n // Why was this global variable needed when they could just check for GEO_CONTEXT_AREA_LOAD? if (callContext != GEO_CONTEXT_RENDER) { gWdwWaterLevelSet = FALSE; - } else if (callContext == GEO_CONTEXT_RENDER && gEnvironmentRegions != NULL - && !gWdwWaterLevelSet) { + } else if (callContext == GEO_CONTEXT_RENDER && gEnvironmentRegions != NULL && !gWdwWaterLevelSet) { if (gPaintingMarioYEntry <= 1382.4) { wdwWaterHeight = 31; } else if (gPaintingMarioYEntry >= 1600.0) { @@ -334,7 +319,7 @@ Gfx *geo_wdw_set_initial_water_level(s32 callContext, UNUSED struct GraphNode *n * Textures update when gMovtexCounterPrev != gMovtexCounter. * This ensures water / sand flow stops when the game pauses. */ -Gfx *geo_movtex_pause_control(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_movtex_pause_control(s32 callContext, UNUSED struct GraphNode* node, UNUSED Mat4 mtx) { if (callContext != GEO_CONTEXT_RENDER) { gMovtexCounterPrev = gAreaUpdateCounter - 1; gMovtexCounter = gAreaUpdateCounter; @@ -354,8 +339,7 @@ Gfx *geo_movtex_pause_control(s32 callContext, UNUSED struct GraphNode *node, UN * rotOffset: gets added to base rotation * scale: how often the texture repeats, 1 = no repeat */ -void movtex_make_quad_vertex(Vtx *verts, s32 index, s16 x, s16 y, s16 z, s16 rot, s16 rotOffset, - f32 scale, u8 alpha) { +void movtex_make_quad_vertex(Vtx* verts, s32 index, s16 x, s16 y, s16 z, s16 rot, s16 rotOffset, f32 scale, u8 alpha) { s16 s = 32.0 * (32.0 * scale - 1.0) * sins(rot + rotOffset); s16 t = 32.0 * (32.0 * scale - 1.0) * coss(rot + rotOffset); @@ -400,7 +384,7 @@ s16 gMovetexLastTextureId; /** * Generates and returns a display list for a single MovtexQuad at height y. */ -Gfx *movtex_gen_from_quad(s16 y, struct MovtexQuad *quad) { +Gfx* movtex_gen_from_quad(s16 y, struct MovtexQuad* quad) { s16 rot; s16 rotspeed = quad->rotspeed; s16 scale = quad->scale; @@ -415,9 +399,9 @@ Gfx *movtex_gen_from_quad(s16 y, struct MovtexQuad *quad) { s16 rotDir = quad->rotDir; s16 alpha = quad->alpha; s16 textureId = quad->textureId; - Vtx *verts = alloc_display_list(4 * sizeof(*verts)); - Gfx *gfxHead; - Gfx *gfx; + Vtx* verts = alloc_display_list(4 * sizeof(*verts)); + Gfx* gfxHead; + Gfx* gfx; if (textureId == gMovetexLastTextureId) { gfxHead = alloc_display_list(3 * sizeof(*gfxHead)); @@ -469,12 +453,12 @@ Gfx *movtex_gen_from_quad(s16 y, struct MovtexQuad *quad) { * quadArrSegmented: a segmented address to an array of s16. The first number * is the number of entries, followed by that number of MovtexQuad structs. */ -Gfx *movtex_gen_from_quad_array(s16 y, void *quadArrSegmented) { - s16 *quadArr = segmented_to_virtual(quadArrSegmented); +Gfx* movtex_gen_from_quad_array(s16 y, void* quadArrSegmented) { + s16* quadArr = segmented_to_virtual(quadArrSegmented); s16 numLists = quadArr[0]; - Gfx *gfxHead = alloc_display_list((numLists + 1) * sizeof(*gfxHead)); - Gfx *gfx = gfxHead; - Gfx *subList; + Gfx* gfxHead = alloc_display_list((numLists + 1) * sizeof(*gfxHead)); + Gfx* gfx = gfxHead; + Gfx* subList; s32 i; if (gfxHead == NULL) { @@ -482,8 +466,7 @@ Gfx *movtex_gen_from_quad_array(s16 y, void *quadArrSegmented) { } for (i = 0; i < numLists; i++) { // quadArr is an array of s16, so sizeof(MovtexQuad) gets divided by 2 - subList = movtex_gen_from_quad( - y, (struct MovtexQuad *) (&quadArr[i * (sizeof(struct MovtexQuad) / 2) + 1])); + subList = movtex_gen_from_quad(y, (struct MovtexQuad*)(&quadArr[i * (sizeof(struct MovtexQuad) / 2) + 1])); if (subList != NULL) { gSPDisplayList(gfx++, VIRTUAL_TO_PHYSICAL(subList)); } @@ -500,8 +483,8 @@ Gfx *movtex_gen_from_quad_array(s16 y, void *quadArrSegmented) { * movetexQuadsSegmented: segmented address to the MovtexQuadCollection array * that will be searched. */ -Gfx *movtex_gen_quads_id(s16 id, s16 y, void *movetexQuadsSegmented) { - struct MovtexQuadCollection *collection = segmented_to_virtual(movetexQuadsSegmented); +Gfx* movtex_gen_quads_id(s16 id, s16 y, void* movetexQuadsSegmented) { + struct MovtexQuadCollection* collection = segmented_to_virtual(movetexQuadsSegmented); s32 i = 0; while (collection[i].id != -1) { @@ -515,33 +498,33 @@ Gfx *movtex_gen_quads_id(s16 id, s16 y, void *movetexQuadsSegmented) { // extern u8 bbh_movtex_merry_go_round_water_entrance[]; // extern u8 bbh_movtex_merry_go_round_water_side[]; -//extern u8 ccm_movtex_penguin_puddle_water[]; +// extern u8 ccm_movtex_penguin_puddle_water[]; // extern u8 inside_castle_movtex_green_room_water[]; // extern u8 inside_castle_movtex_moat_water[]; -//extern u8 hmc_movtex_dorrie_pool_water[]; -//extern u8 hmc_movtex_toxic_maze_mist[]; -//extern u8 ssl_movtex_puddle_water[]; -//extern u8 ssl_movtex_toxbox_quicksand_mist[]; -//extern u8 sl_movtex_water[]; -//extern u8 wdw_movtex_area1_water[]; -//extern u8 wdw_movtex_area2_water[]; -//extern u8 jrb_movtex_water[]; -//extern u8 jrb_movtex_initial_mist[]; -//extern u8 jrb_movtex_sunken_ship_water[]; -//extern u8 thi_movtex_area1_water[]; -//extern u8 thi_movtex_area2_water[]; +// extern u8 hmc_movtex_dorrie_pool_water[]; +// extern u8 hmc_movtex_toxic_maze_mist[]; +// extern u8 ssl_movtex_puddle_water[]; +// extern u8 ssl_movtex_toxbox_quicksand_mist[]; +// extern u8 sl_movtex_water[]; +// extern u8 wdw_movtex_area1_water[]; +// extern u8 wdw_movtex_area2_water[]; +// extern u8 jrb_movtex_water[]; +// extern u8 jrb_movtex_initial_mist[]; +// extern u8 jrb_movtex_sunken_ship_water[]; +// extern u8 thi_movtex_area1_water[]; +// extern u8 thi_movtex_area2_water[]; // extern u8 castle_grounds_movtex_water[]; -//extern u8 lll_movtex_volcano_floor_lava[]; -//extern u8 ddd_movtex_area1_water[]; -//extern u8 ddd_movtex_area2_water[]; -//extern u8 wf_movtex_water[]; +// extern u8 lll_movtex_volcano_floor_lava[]; +// extern u8 ddd_movtex_area1_water[]; +// extern u8 ddd_movtex_area2_water[]; +// extern u8 wf_movtex_water[]; // extern u8 castle_courtyard_movtex_star_statue_water[]; -//extern u8 ttm_movtex_puddle[]; +// extern u8 ttm_movtex_puddle[]; /** * Find the quadCollection for a given quad collection id. */ -void *get_quad_collection_from_id(u32 id) { +void* get_quad_collection_from_id(u32 id) { switch (id) { case BBH_MOVTEX_MERRY_GO_ROUND_WATER_ENTRANCE: return bbh_movtex_merry_go_round_water_entrance; @@ -600,7 +583,7 @@ void *get_quad_collection_from_id(u32 id) { * Write to 'gfx' a command to set the current texture format for the given * quadCollection. */ -void movtex_change_texture_format(u32 quadCollectionId, Gfx **gfx) { +void movtex_change_texture_format(u32 quadCollectionId, Gfx** gfx) { switch (quadCollectionId) { case HMC_MOVTEX_TOXIC_MAZE_MIST: gSPDisplayList((*gfx)++, dl_waterbox_ia16_begin); @@ -622,12 +605,12 @@ void movtex_change_texture_format(u32 quadCollectionId, Gfx **gfx) { * of the corresponding water region. The node's parameter determines which quad * collection is drawn, see moving_texture.h. */ -Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { - Gfx *gfxHead = NULL; - Gfx *gfx = NULL; - Gfx *subList; - void *quadCollection; - struct GraphNodeGenerated *asGenerated; +Gfx* geo_movtex_draw_water_regions(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { + Gfx* gfxHead = NULL; + Gfx* gfx = NULL; + Gfx* subList; + void* quadCollection; + struct GraphNodeGenerated* asGenerated; s16 numWaterBoxes; s16 waterId; s16 waterY; @@ -645,13 +628,13 @@ Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUS } else { gfx = gfxHead; } - asGenerated = (struct GraphNodeGenerated *) node; + asGenerated = (struct GraphNodeGenerated*)node; if (asGenerated->parameter == JRB_MOVTEX_INITIAL_MIST) { if (gLakituState.goalPos[1] < 1024.0) { // if camera under water return NULL; } - if (save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_JRB)) - & (1 << 0)) { // the "Plunder in the Sunken Ship" star in JRB is collected + if (save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_JRB)) & + (1 << 0)) { // the "Plunder in the Sunken Ship" star in JRB is collected return NULL; } } else if (asGenerated->parameter == HMC_MOVTEX_TOXIC_MAZE_MIST) { @@ -666,8 +649,7 @@ Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUS char* path = quadCollection; - asGenerated->fnNode.node.flags = - (asGenerated->fnNode.node.flags & 0xFF) | (LAYER_TRANSPARENT_INTER << 8); + asGenerated->fnNode.node.flags = (asGenerated->fnNode.node.flags & 0xFF) | (LAYER_TRANSPARENT_INTER << 8); movtex_change_texture_format(asGenerated->parameter, &gfx); gMovetexLastTextureId = -1; @@ -690,9 +672,9 @@ Gfx *geo_movtex_draw_water_regions(s32 callContext, struct GraphNode *node, UNUS * movtexVerts: vertices to update * attr: which attribute to change */ -void update_moving_texture_offset(s16 *movtexVerts, s32 attr) { +void update_moving_texture_offset(s16* movtexVerts, s32 attr) { s16 movSpeed = movtexVerts[MOVTEX_ATTR_SPEED]; - s16 *curOffset = movtexVerts + attr; + s16* curOffset = movtexVerts + attr; if (gMovtexCounter != gMovtexCounterPrev) { *curOffset += movSpeed; @@ -712,7 +694,7 @@ void update_moving_texture_offset(s16 *movtexVerts, s32 attr) { * vertex's coordinates as base on which to apply offset. * The first vertex has offset 0 by definition, simplifying the calculations a bit. */ -void movtex_write_vertex_first(Vtx *vtx, s16 *movtexVerts, struct MovtexObject *c, s8 attrLayout) { +void movtex_write_vertex_first(Vtx* vtx, s16* movtexVerts, struct MovtexObject* c, s8 attrLayout) { s16 x = movtexVerts[MOVTEX_ATTR_X]; s16 y = movtexVerts[MOVTEX_ATTR_Y]; s16 z = movtexVerts[MOVTEX_ATTR_Z]; @@ -751,8 +733,7 @@ void movtex_write_vertex_first(Vtx *vtx, s16 *movtexVerts, struct MovtexObject * * movtex_write_vertex_first and subsequent vertices use vertex 0 as a base * for their texture coordinates. */ -void movtex_write_vertex_index(Vtx *verts, s32 index, s16 *movtexVerts, struct MovtexObject *d, - s8 attrLayout) { +void movtex_write_vertex_index(Vtx* verts, s32 index, s16* movtexVerts, struct MovtexObject* d, s8 attrLayout) { u8 alpha = d->a; s16 x; s16 y; @@ -808,10 +789,10 @@ void movtex_write_vertex_index(Vtx *verts, s32 index, s16 *movtexVerts, struct M * Generate a displaylist for a MovtexObject. * 'attrLayout' is one of MOVTEX_LAYOUT_NOCOLOR and MOVTEX_LAYOUT_COLORED. */ -Gfx *movtex_gen_list(s16 *movtexVerts, struct MovtexObject *movtexList, s8 attrLayout) { - Vtx *verts = alloc_display_list(movtexList->vtx_count * sizeof(*verts)); - Gfx *gfxHead = alloc_display_list(11 * sizeof(*gfxHead)); - Gfx *gfx = gfxHead; +Gfx* movtex_gen_list(s16* movtexVerts, struct MovtexObject* movtexList, s8 attrLayout) { + Vtx* verts = alloc_display_list(movtexList->vtx_count * sizeof(*verts)); + Gfx* gfxHead = alloc_display_list(11 * sizeof(*gfxHead)); + Gfx* gfx = gfxHead; s32 i; if (verts == NULL || gfxHead == NULL) { @@ -835,15 +816,15 @@ Gfx *movtex_gen_list(s16 *movtexVerts, struct MovtexObject *movtexList, s8 attrL /** * Function for a geo node that draws a MovtexObject in the gMovtexNonColored list. */ -Gfx *geo_movtex_draw_nocolor(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_movtex_draw_nocolor(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { s32 i; - s16 *movtexVerts; - struct GraphNodeGenerated *asGenerated; - Gfx *gfx = NULL; + s16* movtexVerts; + struct GraphNodeGenerated* asGenerated; + Gfx* gfx = NULL; if (callContext == GEO_CONTEXT_RENDER) { i = 0; - asGenerated = (struct GraphNodeGenerated *) node; + asGenerated = (struct GraphNodeGenerated*)node; while (gMovtexNonColored[i].movtexVerts != 0) { if (gMovtexNonColored[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = @@ -863,15 +844,15 @@ Gfx *geo_movtex_draw_nocolor(s32 callContext, struct GraphNode *node, UNUSED Mat /** * Function for a geo node that draws a MovtexObject in the gMovtexColored list. */ -Gfx *geo_movtex_draw_colored(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_movtex_draw_colored(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { s32 i; - s16 *movtexVerts; - struct GraphNodeGenerated *asGenerated; - Gfx *gfx = NULL; + s16* movtexVerts; + struct GraphNodeGenerated* asGenerated; + Gfx* gfx = NULL; if (callContext == GEO_CONTEXT_RENDER) { i = 0; - asGenerated = (struct GraphNodeGenerated *) node; + asGenerated = (struct GraphNodeGenerated*)node; while (gMovtexColored[i].movtexVerts != 0) { if (gMovtexColored[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = @@ -894,15 +875,15 @@ Gfx *geo_movtex_draw_colored(s32 callContext, struct GraphNode *node, UNUSED Mat * instances (like TTC treadmills) so you don't want the animation speed to * increase the more instances there are. */ -Gfx *geo_movtex_draw_colored_no_update(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_movtex_draw_colored_no_update(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { s32 i; - s16 *movtexVerts; - struct GraphNodeGenerated *asGenerated; - Gfx *gfx = NULL; + s16* movtexVerts; + struct GraphNodeGenerated* asGenerated; + Gfx* gfx = NULL; if (callContext == GEO_CONTEXT_RENDER) { i = 0; - asGenerated = (struct GraphNodeGenerated *) node; + asGenerated = (struct GraphNodeGenerated*)node; while (gMovtexColored[i].movtexVerts != 0) { if (gMovtexColored[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = @@ -921,15 +902,15 @@ Gfx *geo_movtex_draw_colored_no_update(s32 callContext, struct GraphNode *node, * Exact copy of geo_movtex_draw_colored_no_update, but now using the gMovtexColored2 array. * Used for the sand pits in SSL, both outside and inside the pyramid. */ -Gfx *geo_movtex_draw_colored_2_no_update(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_movtex_draw_colored_2_no_update(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { s32 i; - s16 *movtexVerts; - struct GraphNodeGenerated *asGenerated; - Gfx *gfx = NULL; + s16* movtexVerts; + struct GraphNodeGenerated* asGenerated; + Gfx* gfx = NULL; if (callContext == GEO_CONTEXT_RENDER) { i = 0; - asGenerated = (struct GraphNodeGenerated *) node; + asGenerated = (struct GraphNodeGenerated*)node; while (gMovtexColored2[i].movtexVerts != 0) { if (gMovtexColored2[i].geoId == asGenerated->parameter) { asGenerated->fnNode.node.flags = @@ -956,11 +937,11 @@ Gfx *geo_movtex_draw_colored_2_no_update(s32 callContext, struct GraphNode *node * model to update multiple times. * Note that the final TTC only has one big treadmill though. */ -Gfx *geo_movtex_update_horizontal(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { - void *movtexVerts; +Gfx* geo_movtex_update_horizontal(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { + void* movtexVerts; if (callContext == GEO_CONTEXT_RENDER) { - struct GraphNodeGenerated *asGenerated = (struct GraphNodeGenerated *) node; + struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*)node; switch (asGenerated->parameter) { case MOVTEX_SSL_SAND_PIT_OUTSIDE: diff --git a/src/game/obj_behaviors.c b/src/game/obj_behaviors.c index c3e764ac..20cd7cd3 100644 --- a/src/game/obj_behaviors.c +++ b/src/game/obj_behaviors.c @@ -46,16 +46,16 @@ #define o gCurrentObject -#define OBJ_COL_FLAG_GROUNDED (1 << 0) -#define OBJ_COL_FLAG_HIT_WALL (1 << 1) +#define OBJ_COL_FLAG_GROUNDED (1 << 0) +#define OBJ_COL_FLAG_HIT_WALL (1 << 1) #define OBJ_COL_FLAG_UNDERWATER (1 << 2) -#define OBJ_COL_FLAG_NO_Y_VEL (1 << 3) -#define OBJ_COL_FLAGS_LANDED (OBJ_COL_FLAG_GROUNDED | OBJ_COL_FLAG_NO_Y_VEL) +#define OBJ_COL_FLAG_NO_Y_VEL (1 << 3) +#define OBJ_COL_FLAGS_LANDED (OBJ_COL_FLAG_GROUNDED | OBJ_COL_FLAG_NO_Y_VEL) /** * Current object floor as defined in object_step. */ -static struct Surface *sObjFloor; +static struct Surface* sObjFloor; /** * Set to false when an object close to the floor should not be oriented in reference @@ -87,21 +87,20 @@ void set_yoshi_as_not_dead(void) { * of the opacity of an object to something else. Perhaps like, giving a parent object the same * opacity? */ -Gfx UNUSED *geo_obj_transparency_something(s32 callContext, struct GraphNode *node, UNUSED Mat4 *mtx) { - Gfx *gfxHead; - Gfx *gfx; - struct Object *heldObject; - struct Object *obj; - UNUSED struct Object *unusedObject; +Gfx UNUSED* geo_obj_transparency_something(s32 callContext, struct GraphNode* node, UNUSED Mat4* mtx) { + Gfx* gfxHead; + Gfx* gfx; + struct Object* heldObject; + struct Object* obj; + UNUSED struct Object* unusedObject; UNUSED u8 filler[4]; gfxHead = NULL; if (callContext == GEO_CONTEXT_RENDER) { - heldObject = (struct Object *) gCurGraphNodeObject; - obj = (struct Object *) node; - unusedObject = (struct Object *) node; - + heldObject = (struct Object*)gCurGraphNodeObject; + obj = (struct Object*)node; + unusedObject = (struct Object*)node; if (gCurGraphNodeHeldObject != NULL) { heldObject = gCurGraphNodeHeldObject->objNode; @@ -133,13 +132,10 @@ f32 absf_2(f32 f) { /** * Turns an object away from floors/walls that it runs into. */ -void turn_obj_away_from_surface(f32 velX, f32 velZ, f32 nX, UNUSED f32 nY, f32 nZ, f32 *objYawX, - f32 *objYawZ) { - *objYawX = (nZ * nZ - nX * nX) * velX / (nX * nX + nZ * nZ) - - 2 * velZ * (nX * nZ) / (nX * nX + nZ * nZ); +void turn_obj_away_from_surface(f32 velX, f32 velZ, f32 nX, UNUSED f32 nY, f32 nZ, f32* objYawX, f32* objYawZ) { + *objYawX = (nZ * nZ - nX * nX) * velX / (nX * nX + nZ * nZ) - 2 * velZ * (nX * nZ) / (nX * nX + nZ * nZ); - *objYawZ = (nX * nX - nZ * nZ) * velZ / (nX * nX + nZ * nZ) - - 2 * velX * (nX * nZ) / (nX * nX + nZ * nZ); + *objYawZ = (nX * nX - nZ * nZ) * velZ / (nX * nX + nZ * nZ) - 2 * velX * (nX * nZ) / (nX * nX + nZ * nZ); } /** @@ -180,7 +176,7 @@ s8 obj_find_wall(f32 objNewX, f32 objY, f32 objNewZ, f32 objVelX, f32 objVelZ) { /** * Turns an object away from steep floors, similarly to walls. */ -s8 turn_obj_away_from_steep_floor(struct Surface *objFloor, f32 floorY, f32 objVelX, f32 objVelZ) { +s8 turn_obj_away_from_steep_floor(struct Surface* objFloor, f32 floorY, f32 objVelX, f32 objVelZ) { f32 floor_nX, floor_nY, floor_nZ, objVelXCopy, objVelZCopy, objYawX, objYawZ; if (objFloor == NULL) { @@ -197,8 +193,7 @@ s8 turn_obj_away_from_steep_floor(struct Surface *objFloor, f32 floorY, f32 objV if (floor_nY < 0.5 && floorY > o->oPosY) { objVelXCopy = objVelX; objVelZCopy = objVelZ; - turn_obj_away_from_surface(objVelXCopy, objVelZCopy, floor_nX, floor_nY, floor_nZ, &objYawX, - &objYawZ); + turn_obj_away_from_surface(objVelXCopy, objVelZCopy, floor_nX, floor_nY, floor_nZ, &objYawX, &objYawZ); o->oMoveAngleYaw = atan2s(objYawZ, objYawX); return FALSE; } @@ -209,10 +204,10 @@ s8 turn_obj_away_from_steep_floor(struct Surface *objFloor, f32 floorY, f32 objV /** * Orients an object with the given normals, typically the surface under the object. */ -void obj_orient_graph(struct Object *obj, f32 normalX, f32 normalY, f32 normalZ) { +void obj_orient_graph(struct Object* obj, f32 normalX, f32 normalY, f32 normalZ) { Vec3f objVisualPosition, surfaceNormals; - Mat4 *throwMatrix; + Mat4* throwMatrix; // Passes on orienting certain objects that shouldn't be oriented, like boulders. if (!sOrientObjWithFloor) { @@ -245,7 +240,7 @@ void obj_orient_graph(struct Object *obj, f32 normalX, f32 normalY, f32 normalZ) /** * Determines an object's forward speed multiplier. */ -void calc_obj_friction(f32 *objFriction, f32 floor_nY) { +void calc_obj_friction(f32* objFriction, f32 floor_nY) { if (floor_nY < 0.2 && o->oFriction < 0.9999) { *objFriction = 0; } else { @@ -256,7 +251,7 @@ void calc_obj_friction(f32 *objFriction, f32 floor_nY) { /** * Updates an objects speed for gravity and updates Y position. */ -void calc_new_obj_vel_and_pos_y(struct Surface *objFloor, f32 objFloorY, f32 objVelX, f32 objVelZ) { +void calc_new_obj_vel_and_pos_y(struct Surface* objFloor, f32 objFloorY, f32 objVelX, f32 objVelZ) { f32 floor_nX = objFloor->normal.x; f32 floor_nY = objFloor->normal.y; f32 floor_nZ = objFloor->normal.z; @@ -273,7 +268,7 @@ void calc_new_obj_vel_and_pos_y(struct Surface *objFloor, f32 objFloorY, f32 obj o->oPosY += o->oVelY; - //Snap the object up to the floor. + // Snap the object up to the floor. if (o->oPosY < objFloorY) { o->oPosY = objFloorY; @@ -286,16 +281,14 @@ void calc_new_obj_vel_and_pos_y(struct Surface *objFloor, f32 objFloorY, f32 obj } //! (Obj Position Crash) If you got an object with height past 2^31, the game would crash. - if ((s32) o->oPosY >= (s32) objFloorY && (s32) o->oPosY < (s32) objFloorY + 37) { + if ((s32)o->oPosY >= (s32)objFloorY && (s32)o->oPosY < (s32)objFloorY + 37) { obj_orient_graph(o, floor_nX, floor_nY, floor_nZ); // Adds horizontal component of gravity for horizontal speed. - objVelX += floor_nX * (floor_nX * floor_nX + floor_nZ * floor_nZ) - / (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * o->oGravity - * 2; - objVelZ += floor_nZ * (floor_nX * floor_nX + floor_nZ * floor_nZ) - / (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * o->oGravity - * 2; + objVelX += floor_nX * (floor_nX * floor_nX + floor_nZ * floor_nZ) / + (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * o->oGravity * 2; + objVelZ += floor_nZ * (floor_nX * floor_nX + floor_nZ * floor_nZ) / + (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * o->oGravity * 2; if (objVelX < 0.000001 && objVelX > -0.000001) { objVelX = 0; @@ -313,8 +306,7 @@ void calc_new_obj_vel_and_pos_y(struct Surface *objFloor, f32 objFloorY, f32 obj } } -void calc_new_obj_vel_and_pos_y_underwater(struct Surface *objFloor, f32 floorY, f32 objVelX, f32 objVelZ, - f32 waterY) { +void calc_new_obj_vel_and_pos_y_underwater(struct Surface* objFloor, f32 floorY, f32 objVelX, f32 objVelZ, f32 waterY) { f32 floor_nX = objFloor->normal.x; f32 floor_nY = objFloor->normal.y; f32 floor_nZ = objFloor->normal.z; @@ -332,7 +324,7 @@ void calc_new_obj_vel_and_pos_y_underwater(struct Surface *objFloor, f32 floorY, o->oPosY += o->oVelY; - //Snap the object up to the floor. + // Snap the object up to the floor. if (o->oPosY < floorY) { o->oPosY = floorY; @@ -349,14 +341,14 @@ void calc_new_obj_vel_and_pos_y_underwater(struct Surface *objFloor, f32 floorY, o->oVelY = -o->oVelY; } - if ((s32) o->oPosY >= (s32) floorY && (s32) o->oPosY < (s32) floorY + 37) { + if ((s32)o->oPosY >= (s32)floorY && (s32)o->oPosY < (s32)floorY + 37) { obj_orient_graph(o, floor_nX, floor_nY, floor_nZ); // Adds horizontal component of gravity for horizontal speed. - objVelX += floor_nX * (floor_nX * floor_nX + floor_nZ * floor_nZ) - / (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * netYAccel * 2; - objVelZ += floor_nZ * (floor_nX * floor_nX + floor_nZ * floor_nZ) - / (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * netYAccel * 2; + objVelX += floor_nX * (floor_nX * floor_nX + floor_nZ * floor_nZ) / + (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * netYAccel * 2; + objVelZ += floor_nZ * (floor_nX * floor_nX + floor_nZ * floor_nZ) / + (floor_nX * floor_nX + floor_nY * floor_nY + floor_nZ * floor_nZ) * netYAccel * 2; } if (objVelX < 0.000001 && objVelX > -0.000001) { @@ -446,21 +438,20 @@ s16 object_step(void) { } } else { // Treat any awkward floors similar to a wall. - collisionFlags += - ((collisionFlags & OBJ_COL_FLAG_HIT_WALL) ^ OBJ_COL_FLAG_HIT_WALL); + collisionFlags += ((collisionFlags & OBJ_COL_FLAG_HIT_WALL) ^ OBJ_COL_FLAG_HIT_WALL); } obj_update_pos_vel_xz(); - if ((s32) o->oPosY == (s32) floorY) { + if ((s32)o->oPosY == (s32)floorY) { collisionFlags += OBJ_COL_FLAG_GROUNDED; } - if ((s32) o->oVelY == 0) { + if ((s32)o->oVelY == 0) { collisionFlags += OBJ_COL_FLAG_NO_Y_VEL; } // Generate a splash if in water. - obj_splash((s32) waterY, (s32) o->oPosY); + obj_splash((s32)waterY, (s32)o->oPosY); return collisionFlags; } @@ -484,7 +475,7 @@ s16 object_step_without_floor_orient(void) { * `obj`'s forward velocity and yaw instead of `o`'s, and wouldn't update `o`'s * position. */ -void obj_move_xyz_using_fvel_and_yaw(struct Object *obj) { +void obj_move_xyz_using_fvel_and_yaw(struct Object* obj) { o->oVelX = obj->oForwardVel * sins(obj->oMoveAngleYaw); o->oVelZ = obj->oForwardVel * coss(obj->oMoveAngleYaw); @@ -501,8 +492,7 @@ s8 is_point_within_radius_of_mario(f32 x, f32 y, f32 z, s32 dist) { f32 mGfxY = gMarioObject->header.gfx.pos[1]; f32 mGfxZ = gMarioObject->header.gfx.pos[2]; - if ((x - mGfxX) * (x - mGfxX) + (y - mGfxY) * (y - mGfxY) + (z - mGfxZ) * (z - mGfxZ) - < (f32)(dist * dist)) { + if ((x - mGfxX) * (x - mGfxX) + (y - mGfxY) * (y - mGfxY) + (z - mGfxZ) * (z - mGfxZ) < (f32)(dist * dist)) { return TRUE; } @@ -512,13 +502,12 @@ s8 is_point_within_radius_of_mario(f32 x, f32 y, f32 z, s32 dist) { /** * Checks whether a point is within distance of a given point. Test is exclusive. */ -s8 is_point_close_to_object(struct Object *obj, f32 x, f32 y, f32 z, s32 dist) { +s8 is_point_close_to_object(struct Object* obj, f32 x, f32 y, f32 z, s32 dist) { f32 objX = obj->oPosX; f32 objY = obj->oPosY; f32 objZ = obj->oPosZ; - if ((x - objX) * (x - objX) + (y - objY) * (y - objY) + (z - objZ) * (z - objZ) - < (f32)(dist * dist)) { + if ((x - objX) * (x - objX) + (y - objY) * (y - objY) + (z - objZ) * (z - objZ) < (f32)(dist * dist)) { return TRUE; } @@ -528,7 +517,7 @@ s8 is_point_close_to_object(struct Object *obj, f32 x, f32 y, f32 z, s32 dist) { /** * Sets an object as visible if within a certain distance of Mario's graphical position. */ -void set_object_visibility(struct Object *obj, s32 dist) { +void set_object_visibility(struct Object* obj, s32 dist) { f32 objX = obj->oPosX; f32 objY = obj->oPosY; f32 objZ = obj->oPosZ; @@ -543,7 +532,7 @@ void set_object_visibility(struct Object *obj, s32 dist) { /** * Turns an object towards home if Mario is not near to it. */ -s8 obj_return_home_if_safe(struct Object *obj, f32 homeX, f32 y, f32 homeZ, s32 dist) { +s8 obj_return_home_if_safe(struct Object* obj, f32 homeX, f32 y, f32 homeZ, s32 dist) { f32 homeDistX = homeX - obj->oPosX; f32 homeDistZ = homeZ - obj->oPosZ; s16 angleTowardsHome = atan2s(homeDistZ, homeDistX); @@ -560,13 +549,13 @@ s8 obj_return_home_if_safe(struct Object *obj, f32 homeX, f32 y, f32 homeZ, s32 /** * Randomly displaces an objects home if RNG says to, and turns the object towards its home. */ -void obj_return_and_displace_home(struct Object *obj, f32 homeX, UNUSED f32 homeY, f32 homeZ, s32 baseDisp) { +void obj_return_and_displace_home(struct Object* obj, f32 homeX, UNUSED f32 homeY, f32 homeZ, s32 baseDisp) { s16 angleToNewHome; f32 homeDistX, homeDistZ; if ((s32)(random_float() * 50.0f) == 0) { - obj->oHomeX = (f32)(baseDisp * 2) * random_float() - (f32) baseDisp + homeX; - obj->oHomeZ = (f32)(baseDisp * 2) * random_float() - (f32) baseDisp + homeZ; + obj->oHomeX = (f32)(baseDisp * 2) * random_float() - (f32)baseDisp + homeX; + obj->oHomeZ = (f32)(baseDisp * 2) * random_float() - (f32)baseDisp + homeZ; } homeDistX = obj->oHomeX - obj->oPosX; @@ -580,10 +569,9 @@ void obj_return_and_displace_home(struct Object *obj, f32 homeX, UNUSED f32 home * of a given angle, within a certain range. */ s8 obj_check_if_facing_toward_angle(u32 base, u32 goal, s16 range) { - s16 dAngle = (u16) goal - (u16) base; + s16 dAngle = (u16)goal - (u16)base; - if (((f32) sins(-range) < (f32) sins(dAngle)) && ((f32) sins(dAngle) < (f32) sins(range)) - && (coss(dAngle) > 0)) { + if (((f32)sins(-range) < (f32)sins(dAngle)) && ((f32)sins(dAngle) < (f32)sins(range)) && (coss(dAngle) > 0)) { return TRUE; } @@ -617,8 +605,8 @@ s8 obj_find_wall_displacement(Vec3f dist, f32 x, f32 y, f32 z, f32 radius) { * Spawns a number of coins at the location of an object * with a random forward velocity, y velocity, and direction. */ -void obj_spawn_yellow_coins(struct Object *obj, s8 nCoins) { - struct Object *coin; +void obj_spawn_yellow_coins(struct Object* obj, s8 nCoins) { + struct Object* coin; s8 count; for (count = 0; count < nCoins; count++) { @@ -632,7 +620,7 @@ void obj_spawn_yellow_coins(struct Object *obj, s8 nCoins) { /** * Controls whether certain objects should flicker/when to despawn. */ -s8 obj_flicker_and_disappear(struct Object *obj, s16 lifeSpan) { +s8 obj_flicker_and_disappear(struct Object* obj, s16 lifeSpan) { if (obj->oTimer < lifeSpan) { return FALSE; } @@ -681,14 +669,15 @@ s8 current_mario_room_check(s16 room) { /** * Triggers dialog when Mario is facing an object and controls it while in the dialog. */ -s16 trigger_obj_dialog_when_facing(s32 *inDialog, s16 dialogID, f32 dist, s32 actionArg) { - if ((is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, (s32) dist) == TRUE - && obj_check_if_facing_toward_angle(o->oFaceAngleYaw, gMarioObject->header.gfx.angle[1] + 0x8000, 0x1000) == TRUE - && obj_check_if_facing_toward_angle(o->oMoveAngleYaw, o->oAngleToMario, 0x1000) == TRUE) - || (*inDialog == TRUE)) { +s16 trigger_obj_dialog_when_facing(s32* inDialog, s16 dialogID, f32 dist, s32 actionArg) { + if ((is_point_within_radius_of_mario(o->oPosX, o->oPosY, o->oPosZ, (s32)dist) == TRUE && + obj_check_if_facing_toward_angle(o->oFaceAngleYaw, gMarioObject->header.gfx.angle[1] + 0x8000, 0x1000) == + TRUE && + obj_check_if_facing_toward_angle(o->oMoveAngleYaw, o->oAngleToMario, 0x1000) == TRUE) || + (*inDialog == TRUE)) { *inDialog = TRUE; - if (set_mario_npc_dialog(actionArg) == MARIO_DIALOG_STATUS_SPEAK) { //If Mario is speaking. + if (set_mario_npc_dialog(actionArg) == MARIO_DIALOG_STATUS_SPEAK) { // If Mario is speaking. s16 dialogResponse = cutscene_object_with_dialog(CUTSCENE_DIALOG, o, dialogID); if (dialogResponse != DIALOG_RESPONSE_NONE) { set_mario_npc_dialog(MARIO_DIALOG_STOP); @@ -705,7 +694,7 @@ s16 trigger_obj_dialog_when_facing(s32 *inDialog, s16 dialogID, f32 dist, s32 ac /** *Checks if a floor is one that should cause an object to "die". */ -void obj_check_floor_death(s16 collisionFlags, struct Surface *floor) { +void obj_check_floor_death(s16 collisionFlags, struct Surface* floor) { if (floor == NULL) { return; } @@ -730,7 +719,7 @@ void obj_check_floor_death(s16 collisionFlags, struct Surface *floor) { * audio, and eventually despawning it. Returns TRUE when the obj is dead. */ s8 obj_lava_death(void) { - struct Object *deathSmoke; + struct Object* deathSmoke; if (o->oTimer > 30) { o->activeFlags = ACTIVE_FLAG_DEACTIVATED; @@ -756,7 +745,7 @@ s8 obj_lava_death(void) { * Spawns an orange number object relatively, such as those that count up for secrets. */ void spawn_orange_number(s8 behParam, s16 relX, s16 relY, s16 relZ) { - struct Object *orangeNumber; + struct Object* orangeNumber; if (behParam >= 10) { return; @@ -786,7 +775,7 @@ UNUSED s8 debug_sequence_tracker(s16 debugInputSequence[]) { if (debugInputSequence[sDebugSequenceTracker] & gPlayer3Controller->buttonPressed) { sDebugSequenceTracker++; sDebugTimer = 0; - // If wrong input or timer reaches 10, reset sequence progress. + // If wrong input or timer reaches 10, reset sequence progress. } else if (sDebugTimer == 10 || gPlayer3Controller->buttonPressed != 0) { sDebugSequenceTracker = 0; sDebugTimer = 0; diff --git a/src/game/obj_behaviors_2.c b/src/game/obj_behaviors_2.c index 6e758e75..60a5e99c 100644 --- a/src/game/obj_behaviors_2.c +++ b/src/game/obj_behaviors_2.c @@ -58,18 +58,17 @@ extern s32 sNumKilledFirePiranhaPlants; extern f32 sObjSavedPosX; extern f32 sObjSavedPosY; extern f32 sObjSavedPosZ; -extern struct Object *sMontyMoleHoleList; +extern struct Object* sMontyMoleHoleList; extern s32 sMontyMoleKillStreak; extern f32 sMontyMoleLastKilledPosX; extern f32 sMontyMoleLastKilledPosY; extern f32 sMontyMoleLastKilledPosZ; -extern struct Object *sMasterTreadmill; +extern struct Object* sMasterTreadmill; /** * The treadmill that plays sounds and controls the others on random setting. */ -struct Object *sMasterTreadmill; - +struct Object* sMasterTreadmill; f32 sObjSavedPosX; f32 sObjSavedPosY; @@ -98,9 +97,9 @@ static s16 obj_get_pitch_from_vel(void) { * move again. */ static s32 obj_update_race_proposition_dialog(s16 dialogID) { - s32 dialogResponse = - cur_obj_update_dialog_with_cutscene(MARIO_DIALOG_LOOK_UP, - (DIALOG_FLAG_TURN_TO_MARIO | DIALOG_FLAG_TIME_STOP_ENABLED), CUTSCENE_RACE_DIALOG, dialogID); + s32 dialogResponse = cur_obj_update_dialog_with_cutscene( + MARIO_DIALOG_LOOK_UP, (DIALOG_FLAG_TURN_TO_MARIO | DIALOG_FLAG_TIME_STOP_ENABLED), CUTSCENE_RACE_DIALOG, + dialogID); if (dialogResponse == DIALOG_RESPONSE_NO) { set_mario_npc_dialog(MARIO_DIALOG_STOP); @@ -116,8 +115,7 @@ static void obj_set_dist_from_home(f32 distFromHome) { } static s32 obj_is_near_to_and_facing_mario(f32 maxDist, s16 maxAngleDiff) { - if (o->oDistanceToMario < maxDist - && abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) < maxAngleDiff) { + if (o->oDistanceToMario < maxDist && abs_angle_diff(o->oMoveAngleYaw, o->oAngleToMario) < maxAngleDiff) { return TRUE; } return FALSE; @@ -148,10 +146,10 @@ static BAD_RETURN(u32) obj_perform_position_op(s32 op) { } static void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32 y, f32 z) { - struct Object *trackBall; - struct Waypoint *initialPrevWaypoint; - struct Waypoint *nextWaypoint; - struct Waypoint *prevWaypoint; + struct Object* trackBall; + struct Waypoint* initialPrevWaypoint; + struct Waypoint* nextWaypoint; + struct Waypoint* prevWaypoint; UNUSED u8 filler[4]; f32 amountToMove; f32 dx; @@ -236,8 +234,7 @@ static void platform_on_track_update_pos_or_spawn_ball(s32 ballIndex, f32 x, f32 obj_perform_position_op(POS_OP_COMPUTE_VELOCITY); - o->oPlatformOnTrackPitch = - atan2s(sqrtf(o->oVelX * o->oVelX + o->oVelZ * o->oVelZ), -o->oVelY); + o->oPlatformOnTrackPitch = atan2s(sqrtf(o->oVelX * o->oVelX + o->oVelZ * o->oVelZ), -o->oVelY); o->oPlatformOnTrackYaw = atan2s(o->oVelZ, o->oVelX); } } @@ -314,7 +311,7 @@ static void obj_compute_vel_from_move_pitch(f32 speed) { o->oVelY = speed * -sins(o->oMoveAnglePitch); } -static s32 clamp_s16(s16 *value, s16 minimum, s16 maximum) { +static s32 clamp_s16(s16* value, s16 minimum, s16 maximum) { if (*value <= minimum) { *value = minimum; } else if (*value >= maximum) { @@ -326,7 +323,7 @@ static s32 clamp_s16(s16 *value, s16 minimum, s16 maximum) { return TRUE; } -static s32 clamp_f32(f32 *value, f32 minimum, f32 maximum) { +static s32 clamp_f32(f32* value, f32 minimum, f32 maximum) { if (*value <= minimum) { *value = minimum; } else if (*value >= maximum) { @@ -386,7 +383,7 @@ static s16 obj_turn_pitch_toward_mario(f32 targetOffsetY, s16 turnAmount) { return targetPitch; } -static s32 approach_f32_ptr(f32 *px, f32 target, f32 delta) { +static s32 approach_f32_ptr(f32* px, f32 target, f32 delta) { if (*px > target) { delta = -delta; } @@ -411,7 +408,7 @@ static s32 obj_y_vel_approach(f32 target, f32 delta) { static s32 obj_move_pitch_approach(s16 target, s16 delta) { o->oMoveAnglePitch = approach_s16_symmetric(o->oMoveAnglePitch, target, delta); - if ((s16) o->oMoveAnglePitch == target) { + if ((s16)o->oMoveAnglePitch == target) { return TRUE; } @@ -421,7 +418,7 @@ static s32 obj_move_pitch_approach(s16 target, s16 delta) { static s32 obj_face_pitch_approach(s16 targetPitch, s16 deltaPitch) { o->oFaceAnglePitch = approach_s16_symmetric(o->oFaceAnglePitch, targetPitch, deltaPitch); - if ((s16) o->oFaceAnglePitch == targetPitch) { + if ((s16)o->oFaceAnglePitch == targetPitch) { return TRUE; } @@ -431,7 +428,7 @@ static s32 obj_face_pitch_approach(s16 targetPitch, s16 deltaPitch) { static s32 obj_face_yaw_approach(s16 targetYaw, s16 deltaYaw) { o->oFaceAngleYaw = approach_s16_symmetric(o->oFaceAngleYaw, targetYaw, deltaYaw); - if ((s16) o->oFaceAngleYaw == targetYaw) { + if ((s16)o->oFaceAngleYaw == targetYaw) { return TRUE; } @@ -441,20 +438,19 @@ static s32 obj_face_yaw_approach(s16 targetYaw, s16 deltaYaw) { static s32 obj_face_roll_approach(s16 targetRoll, s16 deltaRoll) { o->oFaceAngleRoll = approach_s16_symmetric(o->oFaceAngleRoll, targetRoll, deltaRoll); - if ((s16) o->oFaceAngleRoll == targetRoll) { + if ((s16)o->oFaceAngleRoll == targetRoll) { return TRUE; } return FALSE; } -static s32 obj_smooth_turn(s16 *angleVel, s32 *angle, s16 targetAngle, f32 targetSpeedProportion, - s16 accel, s16 minSpeed, s16 maxSpeed) { +static s32 obj_smooth_turn(s16* angleVel, s32* angle, s16 targetAngle, f32 targetSpeedProportion, s16 accel, + s16 minSpeed, s16 maxSpeed) { s16 currentSpeed; s16 currentAngle = (s16)(*angle); - *angleVel = - approach_s16_symmetric(*angleVel, (targetAngle - currentAngle) * targetSpeedProportion, accel); + *angleVel = approach_s16_symmetric(*angleVel, (targetAngle - currentAngle) * targetSpeedProportion, accel); currentSpeed = absi(*angleVel); clamp_s16(¤tSpeed, minSpeed, maxSpeed); @@ -478,7 +474,7 @@ static s16 random_mod_offset(s16 base, s16 step, s16 mod) { } static s16 obj_random_fixed_turn(s16 delta) { - return o->oMoveAngleYaw + (s16) random_sign() * delta; + return o->oMoveAngleYaw + (s16)random_sign() * delta; } /** @@ -488,7 +484,7 @@ static s16 obj_random_fixed_turn(s16 delta) { * shootFireScale during this time, return 1. * Return -1 once it's reached endScale. */ -static s32 obj_grow_then_shrink(f32 *scaleVel, f32 shootFireScale, f32 endScale) { +static s32 obj_grow_then_shrink(f32* scaleVel, f32 shootFireScale, f32 endScale) { if (o->oTimer < 2) { o->header.gfx.scale[0] += *scaleVel; @@ -507,14 +503,12 @@ static s32 obj_grow_then_shrink(f32 *scaleVel, f32 shootFireScale, f32 endScale) return 0; } -static s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero, f32 accel, - f32 slowdown) { +static s32 oscillate_toward(s32* value, f32* vel, s32 target, f32 velCloseToZero, f32 accel, f32 slowdown) { s32 startValue = *value; - *value += (s32) *vel; + *value += (s32)*vel; - if (*value == target - || ((*value - target) * (startValue - target) < 0 && *vel > -velCloseToZero - && *vel < velCloseToZero)) { + if (*value == target || + ((*value - target) * (startValue - target) < 0 && *vel > -velCloseToZero && *vel < velCloseToZero)) { *value = target; *vel = 0.0f; return TRUE; @@ -532,8 +526,7 @@ static s32 oscillate_toward(s32 *value, f32 *vel, s32 target, f32 velCloseToZero return FALSE; } -static void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, - s16 blinkLength) { +static void obj_update_blinking(s32* blinkTimer, s16 baseCycleLength, s16 cycleLengthRange, s16 blinkLength) { if (*blinkTimer != 0) { (*blinkTimer)--; } else { @@ -547,8 +540,8 @@ static void obj_update_blinking(s32 *blinkTimer, s16 baseCycleLength, s16 cycleL } } -static s32 obj_resolve_object_collisions(s32 *targetYaw) { - struct Object *otherObject; +static s32 obj_resolve_object_collisions(s32* targetYaw) { + struct Object* otherObject; f32 dx; f32 dz; s16 angle; @@ -593,7 +586,7 @@ static s32 obj_resolve_object_collisions(s32 *targetYaw) { return FALSE; } -static s32 obj_bounce_off_walls_edges_objects(s32 *targetYaw) { +static s32 obj_bounce_off_walls_edges_objects(s32* targetYaw) { if (o->oMoveFlags & OBJ_MOVE_HIT_WALL) { *targetYaw = cur_obj_reflect_move_angle_off_wall(); } else if (o->oMoveFlags & OBJ_MOVE_HIT_EDGE) { @@ -674,8 +667,7 @@ static void obj_set_squished_action(void) { static s32 obj_die_if_above_lava_and_health_non_positive(void) { if (o->oMoveFlags & OBJ_MOVE_UNDERWATER_ON_GROUND) { - if (o->oGravity + o->oBuoyancy > 0.0f - || find_water_level(o->oPosX, o->oPosZ) - o->oPosY < 150.0f) { + if (o->oGravity + o->oBuoyancy > 0.0f || find_water_level(o->oPosX, o->oPosZ) - o->oPosY < 150.0f) { return FALSE; } } else if (!(o->oMoveFlags & OBJ_MOVE_ABOVE_LAVA)) { @@ -693,8 +685,7 @@ static s32 obj_die_if_above_lava_and_health_non_positive(void) { return TRUE; } -static s32 obj_handle_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction, - u8 *attackHandlers) { +static s32 obj_handle_attacks(struct ObjectHitbox* hitbox, s32 attackedMarioAction, u8* attackHandlers) { s32 attackType; obj_set_hitbox(o, hitbox); @@ -766,9 +757,9 @@ static void obj_act_knockback(UNUSED f32 baseScale) { } //! Dies immediately if above lava - if ((o->oMoveFlags - & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_MASK_IN_WATER | OBJ_MOVE_HIT_WALL | OBJ_MOVE_ABOVE_LAVA)) - || (o->oAction == OBJ_ACT_VERTICAL_KNOCKBACK && o->oTimer >= 9)) { + if ((o->oMoveFlags & + (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_MASK_IN_WATER | OBJ_MOVE_HIT_WALL | OBJ_MOVE_ABOVE_LAVA)) || + (o->oAction == OBJ_ACT_VERTICAL_KNOCKBACK && o->oTimer >= 9)) { obj_die_if_health_non_positive(); } @@ -817,7 +808,7 @@ static s32 obj_update_standard_actions(f32 scale) { } } -static s32 obj_check_attacks(struct ObjectHitbox *hitbox, s32 attackedMarioAction) { +static s32 obj_check_attacks(struct ObjectHitbox* hitbox, s32 attackedMarioAction) { s32 attackType; obj_set_hitbox(o, hitbox); @@ -936,10 +927,10 @@ static void treat_far_home_as_mario(f32 threshold) { /** * Used by bowser, fly guy, piranha plant, and fire spitters. */ -void obj_spit_fire(s16 relativePosX, s16 relativePosY, s16 relativePosZ, f32 scale, s32 model, - f32 startSpeed, f32 endSpeed, s16 movePitch) { - struct Object *obj = spawn_object_relative_with_scale(1, relativePosX, relativePosY, relativePosZ, - scale, o, model, bhvSmallPiranhaFlame); +void obj_spit_fire(s16 relativePosX, s16 relativePosY, s16 relativePosZ, f32 scale, s32 model, f32 startSpeed, + f32 endSpeed, s16 movePitch) { + struct Object* obj = spawn_object_relative_with_scale(1, relativePosX, relativePosY, relativePosZ, scale, o, model, + bhvSmallPiranhaFlame); if (obj != NULL) { obj->oSmallPiranhaFlameStartSpeed = startSpeed; diff --git a/src/game/object_collision.c b/src/game/object_collision.c index 500af456..0b2a0f1c 100644 --- a/src/game/object_collision.c +++ b/src/game/object_collision.c @@ -7,8 +7,8 @@ #include "object_list_processor.h" #include "spawn_object.h" -struct Object *debug_print_obj_collision(struct Object *a) { - struct Object *sp24; +struct Object* debug_print_obj_collision(struct Object* a) { + struct Object* sp24; UNUSED u8 filler[4]; s32 i; @@ -22,7 +22,7 @@ struct Object *debug_print_obj_collision(struct Object *a) { return NULL; } -s32 detect_object_hitbox_overlap(struct Object *a, struct Object *b) { +s32 detect_object_hitbox_overlap(struct Object* a, struct Object* b) { f32 sp3C = a->oPosY - a->hitboxDownOffset; f32 sp38 = b->oPosY - b->hitboxDownOffset; f32 dx = a->oPosX - b->oPosX; @@ -59,7 +59,7 @@ s32 detect_object_hitbox_overlap(struct Object *a, struct Object *b) { return 0; } -s32 detect_object_hurtbox_overlap(struct Object *a, struct Object *b) { +s32 detect_object_hurtbox_overlap(struct Object* a, struct Object* b) { f32 sp3C = a->oPosY - a->hitboxDownOffset; f32 sp38 = b->oPosY - b->hitboxDownOffset; f32 sp34 = a->oPosX - b->oPosX; @@ -91,8 +91,8 @@ s32 detect_object_hurtbox_overlap(struct Object *a, struct Object *b) { return 0; } -void clear_object_collision(struct Object *a) { - struct Object *sp4 = (struct Object *) a->header.next; +void clear_object_collision(struct Object* a) { + struct Object* sp4 = (struct Object*)a->header.next; while (sp4 != a) { sp4->numCollidedObjs = 0; @@ -100,11 +100,11 @@ void clear_object_collision(struct Object *a) { if (sp4->oIntangibleTimer > 0) { sp4->oIntangibleTimer--; } - sp4 = (struct Object *) sp4->header.next; + sp4 = (struct Object*)sp4->header.next; } } -void check_collision_in_list(struct Object *a, struct Object *b, struct Object *c) { +void check_collision_in_list(struct Object* a, struct Object* b, struct Object* c) { if (a->oIntangibleTimer == 0) { while (b != c) { if (b->oIntangibleTimer == 0) { @@ -112,69 +112,69 @@ void check_collision_in_list(struct Object *a, struct Object *b, struct Object * detect_object_hurtbox_overlap(a, b); } } - b = (struct Object *) b->header.next; + b = (struct Object*)b->header.next; } } } void check_player_object_collision(void) { - struct Object *sp1C = (struct Object *) &gObjectLists[OBJ_LIST_PLAYER]; - struct Object *sp18 = (struct Object *) sp1C->header.next; + struct Object* sp1C = (struct Object*)&gObjectLists[OBJ_LIST_PLAYER]; + struct Object* sp18 = (struct Object*)sp1C->header.next; while (sp18 != sp1C) { - check_collision_in_list(sp18, (struct Object *) sp18->header.next, sp1C); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_POLELIKE].next, - (struct Object *) &gObjectLists[OBJ_LIST_POLELIKE]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_LEVEL].next, - (struct Object *) &gObjectLists[OBJ_LIST_LEVEL]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_GENACTOR].next, - (struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_PUSHABLE].next, - (struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_SURFACE].next, - (struct Object *) &gObjectLists[OBJ_LIST_SURFACE]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_DESTRUCTIVE].next, - (struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE]); - sp18 = (struct Object *) sp18->header.next; + check_collision_in_list(sp18, (struct Object*)sp18->header.next, sp1C); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_POLELIKE].next, + (struct Object*)&gObjectLists[OBJ_LIST_POLELIKE]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_LEVEL].next, + (struct Object*)&gObjectLists[OBJ_LIST_LEVEL]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_GENACTOR].next, + (struct Object*)&gObjectLists[OBJ_LIST_GENACTOR]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_PUSHABLE].next, + (struct Object*)&gObjectLists[OBJ_LIST_PUSHABLE]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_SURFACE].next, + (struct Object*)&gObjectLists[OBJ_LIST_SURFACE]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_DESTRUCTIVE].next, + (struct Object*)&gObjectLists[OBJ_LIST_DESTRUCTIVE]); + sp18 = (struct Object*)sp18->header.next; } } void check_pushable_object_collision(void) { - struct Object *sp1C = (struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]; - struct Object *sp18 = (struct Object *) sp1C->header.next; + struct Object* sp1C = (struct Object*)&gObjectLists[OBJ_LIST_PUSHABLE]; + struct Object* sp18 = (struct Object*)sp1C->header.next; while (sp18 != sp1C) { - check_collision_in_list(sp18, (struct Object *) sp18->header.next, sp1C); - sp18 = (struct Object *) sp18->header.next; + check_collision_in_list(sp18, (struct Object*)sp18->header.next, sp1C); + sp18 = (struct Object*)sp18->header.next; } } void check_destructive_object_collision(void) { - struct Object *sp1C = (struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE]; - struct Object *sp18 = (struct Object *) sp1C->header.next; + struct Object* sp1C = (struct Object*)&gObjectLists[OBJ_LIST_DESTRUCTIVE]; + struct Object* sp18 = (struct Object*)sp1C->header.next; while (sp18 != sp1C) { if (sp18->oDistanceToMario < 2000.0f && !(sp18->activeFlags & ACTIVE_FLAG_UNK9)) { - check_collision_in_list(sp18, (struct Object *) sp18->header.next, sp1C); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_GENACTOR].next, - (struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_PUSHABLE].next, - (struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]); - check_collision_in_list(sp18, (struct Object *) gObjectLists[OBJ_LIST_SURFACE].next, - (struct Object *) &gObjectLists[OBJ_LIST_SURFACE]); + check_collision_in_list(sp18, (struct Object*)sp18->header.next, sp1C); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_GENACTOR].next, + (struct Object*)&gObjectLists[OBJ_LIST_GENACTOR]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_PUSHABLE].next, + (struct Object*)&gObjectLists[OBJ_LIST_PUSHABLE]); + check_collision_in_list(sp18, (struct Object*)gObjectLists[OBJ_LIST_SURFACE].next, + (struct Object*)&gObjectLists[OBJ_LIST_SURFACE]); } - sp18 = (struct Object *) sp18->header.next; + sp18 = (struct Object*)sp18->header.next; } } void detect_object_collisions(void) { - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_POLELIKE]); - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_PLAYER]); - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_PUSHABLE]); - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_GENACTOR]); - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_LEVEL]); - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_SURFACE]); - clear_object_collision((struct Object *) &gObjectLists[OBJ_LIST_DESTRUCTIVE]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_POLELIKE]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_PLAYER]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_PUSHABLE]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_GENACTOR]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_LEVEL]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_SURFACE]); + clear_object_collision((struct Object*)&gObjectLists[OBJ_LIST_DESTRUCTIVE]); check_player_object_collision(); check_destructive_object_collision(); check_pushable_object_collision(); diff --git a/src/game/object_helpers.c b/src/game/object_helpers.c index d1289dfc..d4fbf246 100644 --- a/src/game/object_helpers.c +++ b/src/game/object_helpers.c @@ -31,16 +31,16 @@ static s8 sBbhStairJiggleOffsets[] = { -8, 8, -4, 4 }; static s16 sPowersOfTwo[] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }; static s8 sLevelsWithRooms[] = { LEVEL_BBH, LEVEL_CASTLE, LEVEL_HMC, -1 }; -static s32 clear_move_flag(u32 *, s32); +static s32 clear_move_flag(u32*, s32); #define o gCurrentObject -Gfx *geo_update_projectile_pos_from_parent(s32 callContext, UNUSED struct GraphNode *node, Mat4 mtx) { +Gfx* geo_update_projectile_pos_from_parent(s32 callContext, UNUSED struct GraphNode* node, Mat4 mtx) { Mat4 sp20; - struct Object *sp1C; + struct Object* sp1C; if (callContext == GEO_CONTEXT_RENDER) { - sp1C = (struct Object *) gCurGraphNodeObject; // TODO: change global type to Object pointer + sp1C = (struct Object*)gCurGraphNodeObject; // TODO: change global type to Object pointer if (sp1C->prevObj) { create_transformation_from_matrices(sp20, mtx, *gCurGraphNodeCamera->matrixPtr); obj_update_pos_from_parent_transformation(sp20, sp1C->prevObj); @@ -50,19 +50,19 @@ Gfx *geo_update_projectile_pos_from_parent(s32 callContext, UNUSED struct GraphN return NULL; } -Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUSED void *context) { +Gfx* geo_update_layer_transparency(s32 callContext, struct GraphNode* node, UNUSED void* context) { Gfx *dlStart, *dlHead; - struct Object *objectGraphNode; - struct GraphNodeGenerated *currentGraphNode; - UNUSED struct GraphNodeGenerated *sp2C; + struct Object* objectGraphNode; + struct GraphNodeGenerated* currentGraphNode; + UNUSED struct GraphNodeGenerated* sp2C; s32 objectOpacity; dlStart = NULL; if (callContext == GEO_CONTEXT_RENDER) { - objectGraphNode = (struct Object *) gCurGraphNodeObject; // TODO: change this to object pointer? - currentGraphNode = (struct GraphNodeGenerated *) node; - sp2C = (struct GraphNodeGenerated *) node; + objectGraphNode = (struct Object*)gCurGraphNodeObject; // TODO: change this to object pointer? + currentGraphNode = (struct GraphNodeGenerated*)node; + sp2C = (struct GraphNodeGenerated*)node; if (gCurGraphNodeHeldObject != NULL) { objectGraphNode = gCurGraphNodeHeldObject->objNode; @@ -75,26 +75,22 @@ Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUS if (objectOpacity == 0xFF) { if (currentGraphNode->parameter == 20) { - currentGraphNode->fnNode.node.flags = - 0x600 | (currentGraphNode->fnNode.node.flags & 0xFF); + currentGraphNode->fnNode.node.flags = 0x600 | (currentGraphNode->fnNode.node.flags & 0xFF); } else { - currentGraphNode->fnNode.node.flags = - 0x100 | (currentGraphNode->fnNode.node.flags & 0xFF); + currentGraphNode->fnNode.node.flags = 0x100 | (currentGraphNode->fnNode.node.flags & 0xFF); } objectGraphNode->oAnimState = 0; } else { if (currentGraphNode->parameter == 20) { - currentGraphNode->fnNode.node.flags = - 0x600 | (currentGraphNode->fnNode.node.flags & 0xFF); + currentGraphNode->fnNode.node.flags = 0x600 | (currentGraphNode->fnNode.node.flags & 0xFF); } else { - currentGraphNode->fnNode.node.flags = - 0x500 | (currentGraphNode->fnNode.node.flags & 0xFF); + currentGraphNode->fnNode.node.flags = 0x500 | (currentGraphNode->fnNode.node.flags & 0xFF); } objectGraphNode->oAnimState = 1; - if(ROM_JP) { + if (ROM_JP) { if (currentGraphNode->parameter == 10) { if (gDebugInfo[DEBUG_PAGE_ENEMYINFO][3]) { gDPSetAlphaCompare(dlHead++, G_AC_DITHER); @@ -133,16 +129,16 @@ Gfx *geo_update_layer_transparency(s32 callContext, struct GraphNode *node, UNUS * declare it. This is undefined behavior, but harmless in practice due to the * o32 calling convention. */ -Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node, UNUSED void *context) { - struct Object *obj; - struct GraphNodeSwitchCase *switchCase; +Gfx* geo_switch_anim_state(s32 callContext, struct GraphNode* node, UNUSED void* context) { + struct Object* obj; + struct GraphNodeSwitchCase* switchCase; if (callContext == GEO_CONTEXT_RENDER) { - obj = (struct Object *) gCurGraphNodeObject; // TODO: change global type to Object pointer + obj = (struct Object*)gCurGraphNodeObject; // TODO: change global type to Object pointer // move to a local var because GraphNodes are passed in all geo functions. // cast the pointer. - switchCase = (struct GraphNodeSwitchCase *) node; + switchCase = (struct GraphNodeSwitchCase*)node; if (gCurGraphNodeHeldObject != NULL) { obj = gCurGraphNodeHeldObject->objNode; @@ -162,12 +158,11 @@ Gfx *geo_switch_anim_state(s32 callContext, struct GraphNode *node, UNUSED void } //! @bug Same issue as geo_switch_anim_state. -Gfx *geo_switch_area(s32 callContext, struct GraphNode *node, UNUSED void *context) { +Gfx* geo_switch_area(s32 callContext, struct GraphNode* node, UNUSED void* context) { s16 sp26; - struct Surface *sp20; - UNUSED struct Object *sp1C = - (struct Object *) gCurGraphNodeObject; // TODO: change global type to Object pointer - struct GraphNodeSwitchCase *switchCase = (struct GraphNodeSwitchCase *) node; + struct Surface* sp20; + UNUSED struct Object* sp1C = (struct Object*)gCurGraphNodeObject; // TODO: change global type to Object pointer + struct GraphNodeSwitchCase* switchCase = (struct GraphNodeSwitchCase*)node; if (callContext == GEO_CONTEXT_RENDER) { if (gMarioObject == NULL) { @@ -194,7 +189,7 @@ Gfx *geo_switch_area(s32 callContext, struct GraphNode *node, UNUSED void *conte return NULL; } -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; @@ -204,7 +199,7 @@ void obj_update_pos_from_parent_transformation(Mat4 a0, struct Object *a1) { a1->oPosZ = spC * a0[0][2] + sp8 * a0[1][2] + sp4 * a0[2][2] + a0[3][2]; } -void obj_apply_scale_to_matrix(struct Object *obj, Mat4 dst, Mat4 src) { +void obj_apply_scale_to_matrix(struct Object* obj, Mat4 dst, Mat4 src) { dst[0][0] = src[0][0] * obj->header.gfx.scale[0]; dst[1][0] = src[1][0] * obj->header.gfx.scale[1]; dst[2][0] = src[2][0] * obj->header.gfx.scale[2]; @@ -255,7 +250,7 @@ void create_transformation_from_matrices(Mat4 a0, Mat4 a1, Mat4 a2) { a0[3][3] = 1.0f; } -void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior) { +void obj_set_held_state(struct Object* obj, const BehaviorScript* heldBehavior) { obj->parentObj = o; if (obj->oFlags & OBJ_FLAG_HOLDABLE) { @@ -276,14 +271,14 @@ void obj_set_held_state(struct Object *obj, const BehaviorScript *heldBehavior) } } -f32 lateral_dist_between_objects(struct Object *obj1, struct Object *obj2) { +f32 lateral_dist_between_objects(struct Object* obj1, struct Object* obj2) { f32 dx = obj1->oPosX - obj2->oPosX; f32 dz = obj1->oPosZ - obj2->oPosZ; return sqrtf(dx * dx + dz * dz); } -f32 dist_between_objects(struct Object *obj1, struct Object *obj2) { +f32 dist_between_objects(struct Object* obj1, struct Object* obj2) { f32 dx = obj1->oPosX - obj2->oPosX; f32 dy = obj1->oPosY - obj2->oPosY; f32 dz = obj1->oPosZ - obj2->oPosZ; @@ -299,7 +294,7 @@ void cur_obj_forward_vel_approach_upward(f32 target, f32 increment) { } } -s32 approach_f32_signed(f32 *value, f32 target, f32 increment) { +s32 approach_f32_signed(f32* value, f32 target, f32 increment) { s32 reachedTarget = FALSE; *value += increment; @@ -362,28 +357,30 @@ s16 approach_s16_symmetric(s16 value, s16 target, s16 increment) { s32 cur_obj_rotate_yaw_toward(s16 target, s16 increment) { s16 startYaw; - startYaw = (s16) o->oMoveAngleYaw; + startYaw = (s16)o->oMoveAngleYaw; o->oMoveAngleYaw = approach_s16_symmetric(o->oMoveAngleYaw, target, increment); - if ((o->oAngleVelYaw = (s16)((s16) o->oMoveAngleYaw - startYaw)) == 0) { + if ((o->oAngleVelYaw = (s16)((s16)o->oMoveAngleYaw - startYaw)) == 0) { return TRUE; } else { return FALSE; } } -s16 obj_angle_to_object(struct Object *obj1, struct Object *obj2) { +s16 obj_angle_to_object(struct Object* obj1, struct Object* obj2) { f32 z1, x1, z2, x2; s16 angle; - z1 = obj1->oPosZ; z2 = obj2->oPosZ; // ordering of instructions.. - x1 = obj1->oPosX; x2 = obj2->oPosX; + z1 = obj1->oPosZ; + z2 = obj2->oPosZ; // ordering of instructions.. + x1 = obj1->oPosX; + x2 = obj2->oPosX; angle = atan2s(z2 - z1, x2 - x1); return angle; } -s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleIndex, s16 turnAmount) { +s16 obj_turn_toward_object(struct Object* obj, struct Object* target, s16 angleIndex, s16 turnAmount) { f32 a, b, c, d; UNUSED u8 filler[4]; s16 targetAngle, startAngle; @@ -417,19 +414,19 @@ s16 obj_turn_toward_object(struct Object *obj, struct Object *target, s16 angleI return targetAngle; } -void obj_set_parent_relative_pos(struct Object *obj, s16 relX, s16 relY, s16 relZ) { +void obj_set_parent_relative_pos(struct Object* obj, s16 relX, s16 relY, s16 relZ) { obj->oParentRelativePosX = relX; obj->oParentRelativePosY = relY; obj->oParentRelativePosZ = relZ; } -void obj_set_pos(struct Object *obj, s16 x, s16 y, s16 z) { +void obj_set_pos(struct Object* obj, s16 x, s16 y, s16 z) { obj->oPosX = x; obj->oPosY = y; obj->oPosZ = z; } -void obj_set_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll) { +void obj_set_angle(struct Object* obj, s16 pitch, s16 yaw, s16 roll) { obj->oFaceAnglePitch = pitch; obj->oFaceAngleYaw = yaw; obj->oFaceAngleRoll = roll; @@ -442,11 +439,11 @@ void obj_set_angle(struct Object *obj, s16 pitch, s16 yaw, s16 roll) { /* * Spawns an object at an absolute location with a specified angle. */ -struct Object *spawn_object_abs_with_rot(struct Object *parent, s16 uselessArg, u32 model, - const BehaviorScript *behavior, - s16 x, s16 y, s16 z, s16 pitch, s16 yaw, s16 roll) { +struct Object* spawn_object_abs_with_rot(struct Object* parent, s16 uselessArg, u32 model, + const BehaviorScript* behavior, s16 x, s16 y, s16 z, s16 pitch, s16 yaw, + s16 roll) { // 'uselessArg' is unused in the function spawn_object_at_origin() - struct Object *newObj = spawn_object_at_origin(parent, uselessArg, model, behavior); + struct Object* newObj = spawn_object_at_origin(parent, uselessArg, model, behavior); obj_set_pos(newObj, x, y, z); obj_set_angle(newObj, pitch, yaw, roll); @@ -458,9 +455,9 @@ struct Object *spawn_object_abs_with_rot(struct Object *parent, s16 uselessArg, * The roll argument is never used, and the z offset is used for z-rotation instead. This is most likely * a copy-paste typo by one of the programmers. */ -struct Object *spawn_object_rel_with_rot(struct Object *parent, u32 model, const BehaviorScript *behavior, - s16 xOff, s16 yOff, s16 zOff, s16 pitch, s16 yaw, UNUSED s16 roll) { - struct Object *newObj = spawn_object_at_origin(parent, 0, model, behavior); +struct Object* spawn_object_rel_with_rot(struct Object* parent, u32 model, const BehaviorScript* behavior, s16 xOff, + s16 yOff, s16 zOff, s16 pitch, s16 yaw, UNUSED s16 roll) { + struct Object* newObj = spawn_object_at_origin(parent, 0, model, behavior); newObj->oFlags |= OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT; obj_set_parent_relative_pos(newObj, xOff, yOff, zOff); obj_set_angle(newObj, pitch, yaw, zOff); // Nice typo you got there Nintendo. @@ -468,28 +465,27 @@ struct Object *spawn_object_rel_with_rot(struct Object *parent, u32 model, const return newObj; } -struct Object *spawn_obj_with_transform_flags(struct Object *sp20, s32 model, const BehaviorScript *sp28) { - struct Object *sp1C = spawn_object(sp20, model, sp28); +struct Object* spawn_obj_with_transform_flags(struct Object* sp20, s32 model, const BehaviorScript* sp28) { + struct Object* sp1C = spawn_object(sp20, model, sp28); sp1C->oFlags |= OBJ_FLAG_0020 | OBJ_FLAG_SET_THROW_MATRIX_FROM_TRANSFORM; return sp1C; } -struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletParams *params) { +struct Object* spawn_water_droplet(struct Object* parent, struct WaterDropletParams* params) { f32 randomScale; - struct Object *newObj = spawn_object(parent, params->model, params->behavior); + struct Object* newObj = spawn_object(parent, params->model, params->behavior); if (params->flags & WATER_DROPLET_FLAG_RAND_ANGLE) { newObj->oMoveAngleYaw = random_u16(); } if (params->flags & WATER_DROPLET_FLAG_RAND_ANGLE_INCR_PLUS_8000) { - newObj->oMoveAngleYaw = (s16)(newObj->oMoveAngleYaw + 0x8000) - + (s16) random_f32_around_zero(params->moveAngleRange); + newObj->oMoveAngleYaw = + (s16)(newObj->oMoveAngleYaw + 0x8000) + (s16)random_f32_around_zero(params->moveAngleRange); } if (params->flags & WATER_DROPLET_FLAG_RAND_ANGLE_INCR) { - newObj->oMoveAngleYaw = - (s16) newObj->oMoveAngleYaw + (s16) random_f32_around_zero(params->moveAngleRange); + newObj->oMoveAngleYaw = (s16)newObj->oMoveAngleYaw + (s16)random_f32_around_zero(params->moveAngleRange); } if (params->flags & WATER_DROPLET_FLAG_SET_Y_TO_WATER_LEVEL) { @@ -513,10 +509,10 @@ struct Object *spawn_water_droplet(struct Object *parent, struct WaterDropletPar return newObj; } -struct Object *spawn_object_at_origin(struct Object *parent, UNUSED s32 unusedArg, u32 model, - const BehaviorScript *behavior) { - struct Object *obj; - const BehaviorScript *behaviorAddr; +struct Object* spawn_object_at_origin(struct Object* parent, UNUSED s32 unusedArg, u32 model, + const BehaviorScript* behavior) { + struct Object* obj; + const BehaviorScript* behaviorAddr; behaviorAddr = segmented_to_virtual(behavior); obj = create_object(behaviorAddr); @@ -525,23 +521,22 @@ struct Object *spawn_object_at_origin(struct Object *parent, UNUSED s32 unusedAr obj->header.gfx.areaIndex = parent->header.gfx.areaIndex; obj->header.gfx.activeAreaIndex = parent->header.gfx.areaIndex; - geo_obj_init((struct GraphNodeObject *) &obj->header.gfx, gLoadedGraphNodes[model], gVec3fZero, - gVec3sZero); + geo_obj_init((struct GraphNodeObject*)&obj->header.gfx, gLoadedGraphNodes[model], gVec3fZero, gVec3sZero); return obj; } -struct Object *spawn_object(struct Object *parent, s32 model, const BehaviorScript *behavior) { - struct Object *obj = spawn_object_at_origin(parent, 0, model, behavior); +struct Object* spawn_object(struct Object* parent, s32 model, const BehaviorScript* behavior) { + struct Object* obj = spawn_object_at_origin(parent, 0, model, behavior); obj_copy_pos_and_angle(obj, parent); return obj; } -struct Object *try_to_spawn_object(s16 offsetY, f32 scale, struct Object *parent, s32 model, - const BehaviorScript *behavior) { - struct Object *obj; +struct Object* try_to_spawn_object(s16 offsetY, f32 scale, struct Object* parent, s32 model, + const BehaviorScript* behavior) { + struct Object* obj; if (gFreeObjectList.next != NULL) { obj = spawn_object(parent, model, behavior); @@ -553,8 +548,8 @@ struct Object *try_to_spawn_object(s16 offsetY, f32 scale, struct Object *parent } } -struct Object *spawn_object_with_scale(struct Object *parent, s32 model, const BehaviorScript *behavior, f32 scale) { - struct Object *obj = spawn_object_at_origin(parent, 0, model, behavior); +struct Object* spawn_object_with_scale(struct Object* parent, s32 model, const BehaviorScript* behavior, f32 scale) { + struct Object* obj = spawn_object_at_origin(parent, 0, model, behavior); obj_copy_pos_and_angle(obj, parent); obj_scale(obj, scale); @@ -562,14 +557,14 @@ struct Object *spawn_object_with_scale(struct Object *parent, s32 model, const B return obj; } -static void obj_build_relative_transform(struct Object *obj) { +static void obj_build_relative_transform(struct Object* obj) { obj_build_transform_from_pos_and_angle(obj, O_PARENT_RELATIVE_POS_INDEX, O_FACE_ANGLE_INDEX); obj_translate_local(obj, O_POS_INDEX, O_PARENT_RELATIVE_POS_INDEX); } -struct Object *spawn_object_relative(s16 behaviorParam, s16 relativePosX, s16 relativePosY, s16 relativePosZ, - struct Object *parent, s32 model, const BehaviorScript *behavior) { - struct Object *obj = spawn_object_at_origin(parent, 0, model, behavior); +struct Object* spawn_object_relative(s16 behaviorParam, s16 relativePosX, s16 relativePosY, s16 relativePosZ, + struct Object* parent, s32 model, const BehaviorScript* behavior) { + struct Object* obj = spawn_object_at_origin(parent, 0, model, behavior); obj_copy_pos_and_angle(obj, parent); obj_set_parent_relative_pos(obj, relativePosX, relativePosY, relativePosZ); @@ -581,11 +576,11 @@ struct Object *spawn_object_relative(s16 behaviorParam, s16 relativePosX, s16 re return obj; } -struct Object *spawn_object_relative_with_scale(s16 behaviorParam, s16 relativePosX, s16 relativePosY, - s16 relativePosZ, f32 scale, struct Object *parent, - s32 model, const BehaviorScript *behavior) { - struct Object *obj = spawn_object_relative(behaviorParam, relativePosX, relativePosY, relativePosZ, - parent, model, behavior); +struct Object* spawn_object_relative_with_scale(s16 behaviorParam, s16 relativePosX, s16 relativePosY, s16 relativePosZ, + f32 scale, struct Object* parent, s32 model, + const BehaviorScript* behavior) { + struct Object* obj = + spawn_object_relative(behaviorParam, relativePosX, relativePosY, relativePosZ, parent, model, behavior); obj_scale(obj, scale); return obj; @@ -597,22 +592,22 @@ void cur_obj_move_using_vel(void) { o->oPosZ += o->oVelZ; } -void obj_copy_graph_y_offset(struct Object *dst, struct Object *src) { +void obj_copy_graph_y_offset(struct Object* dst, struct Object* src) { dst->oGraphYOffset = src->oGraphYOffset; } -void obj_copy_pos_and_angle(struct Object *dst, struct Object *src) { +void obj_copy_pos_and_angle(struct Object* dst, struct Object* src) { obj_copy_pos(dst, src); obj_copy_angle(dst, src); } -void obj_copy_pos(struct Object *dst, struct Object *src) { +void obj_copy_pos(struct Object* dst, struct Object* src) { dst->oPosX = src->oPosX; dst->oPosY = src->oPosY; dst->oPosZ = src->oPosZ; } -void obj_copy_angle(struct Object *dst, struct Object *src) { +void obj_copy_angle(struct Object* dst, struct Object* src) { dst->oMoveAnglePitch = src->oMoveAnglePitch; dst->oMoveAngleYaw = src->oMoveAngleYaw; dst->oMoveAngleRoll = src->oMoveAngleRoll; @@ -622,14 +617,14 @@ void obj_copy_angle(struct Object *dst, struct Object *src) { dst->oFaceAngleRoll = src->oFaceAngleRoll; } -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; } -void obj_init_animation(struct Object *obj, s32 animIndex) { - struct Animation **anims = o->oAnimations; +void obj_init_animation(struct Object* obj, s32 animIndex) { + struct Animation** anims = o->oAnimations; geo_obj_init_animation(&obj->header.gfx, &anims[animIndex]); } @@ -663,7 +658,7 @@ void linear_mtxf_transpose_mul_vec3f(Mat4 m, Vec3f dst, Vec3f v) { } } -void obj_apply_scale_to_transform(struct Object *obj) { +void obj_apply_scale_to_transform(struct Object* obj) { f32 scaleX = obj->header.gfx.scale[0]; f32 scaleY = obj->header.gfx.scale[1]; f32 scaleZ = obj->header.gfx.scale[2]; @@ -681,19 +676,19 @@ void obj_apply_scale_to_transform(struct Object *obj) { obj->transform[2][2] *= scaleZ; } -void obj_copy_scale(struct Object *dst, struct Object *src) { +void obj_copy_scale(struct Object* dst, struct Object* src) { dst->header.gfx.scale[0] = src->header.gfx.scale[0]; dst->header.gfx.scale[1] = src->header.gfx.scale[1]; dst->header.gfx.scale[2] = src->header.gfx.scale[2]; } -void obj_scale_xyz(struct Object *obj, f32 xScale, f32 yScale, f32 zScale) { +void obj_scale_xyz(struct Object* obj, f32 xScale, f32 yScale, f32 zScale) { obj->header.gfx.scale[0] = xScale; obj->header.gfx.scale[1] = yScale; obj->header.gfx.scale[2] = zScale; } -void obj_scale(struct Object *obj, f32 scale) { +void obj_scale(struct Object* obj, f32 scale) { obj->header.gfx.scale[0] = scale; obj->header.gfx.scale[1] = scale; obj->header.gfx.scale[2] = scale; @@ -706,31 +701,31 @@ void cur_obj_scale(f32 scale) { } void cur_obj_init_animation(s32 animIndex) { - struct Animation **anims = segmented_to_virtual(o->oAnimations); + struct Animation** anims = segmented_to_virtual(o->oAnimations); geo_obj_init_animation(&o->header.gfx, &anims[animIndex]); } void cur_obj_init_animation_with_sound(s32 animIndex) { - struct Animation **anims = segmented_to_virtual(o->oAnimations); + struct Animation** anims = segmented_to_virtual(o->oAnimations); geo_obj_init_animation(&o->header.gfx, &anims[animIndex]); o->oSoundStateID = animIndex; } void cur_obj_init_animation_with_accel_and_sound(s32 animIndex, f32 accel) { - struct Animation **anims = segmented_to_virtual(o->oAnimations); + struct Animation** anims = segmented_to_virtual(o->oAnimations); s32 animAccel = (s32)(accel * 65536.0f); geo_obj_init_animation_accel(&o->header.gfx, &anims[animIndex], animAccel); o->oSoundStateID = animIndex; } -void obj_init_animation_with_sound(struct Object *obj, const struct Animation * const* animations, s32 animIndex) { - struct Animation **anims = (struct Animation **)segmented_to_virtual(animations); - obj->oAnimations = (struct Animation **)animations; +void obj_init_animation_with_sound(struct Object* obj, const struct Animation* const* animations, s32 animIndex) { + struct Animation** anims = (struct Animation**)segmented_to_virtual(animations); + obj->oAnimations = (struct Animation**)animations; geo_obj_init_animation(&obj->header.gfx, &anims[animIndex]); obj->oSoundStateID = animIndex; } -void cur_obj_enable_rendering_and_become_tangible(struct Object *obj) { +void cur_obj_enable_rendering_and_become_tangible(struct Object* obj) { obj->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; obj->oIntangibleTimer = 0; } @@ -739,7 +734,7 @@ void cur_obj_enable_rendering(void) { o->header.gfx.node.flags |= GRAPH_RENDER_ACTIVE; } -void cur_obj_disable_rendering_and_become_intangible(struct Object *obj) { +void cur_obj_disable_rendering_and_become_intangible(struct Object* obj) { obj->header.gfx.node.flags &= ~GRAPH_RENDER_ACTIVE; obj->oIntangibleTimer = -1; } @@ -756,7 +751,7 @@ void cur_obj_hide(void) { o->header.gfx.node.flags |= GRAPH_RENDER_INVISIBLE; } -void cur_obj_set_pos_relative(struct Object *other, f32 dleft, f32 dy, f32 dforward) { +void cur_obj_set_pos_relative(struct Object* other, f32 dleft, f32 dy, f32 dforward) { f32 facingZ = coss(other->oMoveAngleYaw); f32 facingX = sins(other->oMoveAngleYaw); @@ -788,13 +783,13 @@ void cur_obj_unused_init_on_floor(void) { } } -void obj_set_face_angle_to_move_angle(struct Object *obj) { +void obj_set_face_angle_to_move_angle(struct Object* obj) { obj->oFaceAnglePitch = obj->oMoveAnglePitch; obj->oFaceAngleYaw = obj->oMoveAngleYaw; obj->oFaceAngleRoll = obj->oMoveAngleRoll; } -u32 get_object_list_from_behavior(const BehaviorScript *behavior) { +u32 get_object_list_from_behavior(const BehaviorScript* behavior) { u32 objectList; // If the first behavior command is "begin", then get the object list header @@ -808,8 +803,8 @@ u32 get_object_list_from_behavior(const BehaviorScript *behavior) { return objectList; } -struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *behavior) { - struct Object *obj; +struct Object* cur_obj_nearest_object_with_behavior(const BehaviorScript* behavior) { + struct Object* obj; f32 dist; obj = cur_obj_find_nearest_object_with_behavior(behavior, &dist); @@ -817,8 +812,8 @@ struct Object *cur_obj_nearest_object_with_behavior(const BehaviorScript *behavi return obj; } -f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior) { - struct Object *obj; +f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript* behavior) { + struct Object* obj; f32 dist; obj = cur_obj_find_nearest_object_with_behavior(behavior, &dist); @@ -829,17 +824,17 @@ f32 cur_obj_dist_to_nearest_object_with_behavior(const BehaviorScript *behavior) return dist; } -struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *behavior, f32 *dist) { - uintptr_t *behaviorAddr = segmented_to_virtual(behavior); - struct Object *closestObj = NULL; - struct Object *obj; - struct ObjectNode *listHead; +struct Object* cur_obj_find_nearest_object_with_behavior(const BehaviorScript* behavior, f32* dist) { + uintptr_t* behaviorAddr = segmented_to_virtual(behavior); + struct Object* closestObj = NULL; + struct Object* obj; + struct ObjectNode* listHead; f32 minDist = 0x20000; listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; - obj = (struct Object *) listHead->next; + obj = (struct Object*)listHead->next; - while (obj != (struct Object *) listHead) { + while (obj != (struct Object*)listHead) { if (obj->behavior == behaviorAddr) { if (obj->activeFlags != ACTIVE_FLAG_DEACTIVATED && obj != o) { f32 objDist = dist_between_objects(o, obj); @@ -849,27 +844,27 @@ struct Object *cur_obj_find_nearest_object_with_behavior(const BehaviorScript *b } } } - obj = (struct Object *) obj->header.next; + obj = (struct Object*)obj->header.next; } *dist = minDist; return closestObj; } -struct Object *find_unimportant_object(void) { - struct ObjectNode *listHead = &gObjectLists[OBJ_LIST_UNIMPORTANT]; - struct ObjectNode *obj = listHead->next; +struct Object* find_unimportant_object(void) { + struct ObjectNode* listHead = &gObjectLists[OBJ_LIST_UNIMPORTANT]; + struct ObjectNode* obj = listHead->next; if (listHead == obj) { obj = NULL; } - return (struct Object *) obj; + return (struct Object*)obj; } s32 count_unimportant_objects(void) { - struct ObjectNode *listHead = &gObjectLists[OBJ_LIST_UNIMPORTANT]; - struct ObjectNode *obj = listHead->next; + struct ObjectNode* listHead = &gObjectLists[OBJ_LIST_UNIMPORTANT]; + struct ObjectNode* obj = listHead->next; s32 count = 0; while (listHead != obj) { @@ -880,14 +875,14 @@ s32 count_unimportant_objects(void) { return count; } -s32 count_objects_with_behavior(const BehaviorScript *behavior) { - uintptr_t *behaviorAddr = segmented_to_virtual(behavior); - struct ObjectNode *listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; - struct ObjectNode *obj = listHead->next; +s32 count_objects_with_behavior(const BehaviorScript* behavior) { + uintptr_t* behaviorAddr = segmented_to_virtual(behavior); + struct ObjectNode* listHead = &gObjectLists[get_object_list_from_behavior(behaviorAddr)]; + struct ObjectNode* obj = listHead->next; s32 count = 0; while (listHead != obj) { - if (((struct Object *) obj)->behavior == behaviorAddr) { + if (((struct Object*)obj)->behavior == behaviorAddr) { count++; } @@ -897,17 +892,17 @@ s32 count_objects_with_behavior(const BehaviorScript *behavior) { return count; } -struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f32 maxDist) { - const BehaviorScript *behaviorAddr = segmented_to_virtual(behavior); - struct ObjectNode *listHead; - struct Object *obj; - struct Object *foundObj; +struct Object* cur_obj_find_nearby_held_actor(const BehaviorScript* behavior, f32 maxDist) { + const BehaviorScript* behaviorAddr = segmented_to_virtual(behavior); + struct ObjectNode* listHead; + struct Object* obj; + struct Object* foundObj; listHead = &gObjectLists[OBJ_LIST_GENACTOR]; - obj = (struct Object *) listHead->next; + obj = (struct Object*)listHead->next; foundObj = NULL; - while ((struct Object *) listHead != obj) { + while ((struct Object*)listHead != obj) { if (obj->behavior == behaviorAddr) { if (obj->activeFlags != ACTIVE_FLAG_DEACTIVATED) { // This includes the dropped and thrown states. By combining instant @@ -921,7 +916,7 @@ struct Object *cur_obj_find_nearby_held_actor(const BehaviorScript *behavior, f3 } } - obj = (struct Object *) obj->header.next; + obj = (struct Object*)obj->header.next; } return foundObj; @@ -959,11 +954,12 @@ BAD_RETURN(s32) cur_obj_extend_animation_if_at_end(void) { s32 sp4 = o->header.gfx.animInfo.animFrame; s32 sp0 = o->header.gfx.animInfo.curAnim->loopEnd - 2; - if (sp4 == sp0) o->header.gfx.animInfo.animFrame--; + if (sp4 == sp0) + o->header.gfx.animInfo.animFrame--; } s32 cur_obj_check_if_near_animation_end(void) { - u32 animFlags = (s32) o->header.gfx.animInfo.curAnim->flags; + u32 animFlags = (s32)o->header.gfx.animInfo.curAnim->flags; s32 animFrame = o->header.gfx.animInfo.animFrame; s32 nearLoopEnd = o->header.gfx.animInfo.curAnim->loopEnd - 2; s32 isNearEnd = FALSE; @@ -1010,7 +1006,7 @@ s32 cur_obj_check_anim_frame_in_range(s32 startFrame, s32 rangeLength) { } } -s32 cur_obj_check_frame_prior_current_frame(s16 *a0) { +s32 cur_obj_check_frame_prior_current_frame(s16* a0) { s16 sp6 = o->header.gfx.animInfo.animFrame; while (*a0 != -1) { @@ -1125,7 +1121,7 @@ s32 cur_obj_clear_interact_status_flag(s32 flag) { /** * Mark an object to be unloaded at the end of the frame. */ -void obj_mark_for_deletion(struct Object *obj) { +void obj_mark_for_deletion(struct Object* obj) { //! This clears all activeFlags. Since some of these flags disable behavior, // setting it to 0 could potentially enable unexpected behavior. After an // object is marked for deletion, it still updates on that frame (I think), @@ -1149,22 +1145,22 @@ void cur_obj_become_tangible(void) { o->oIntangibleTimer = 0; } -void obj_become_tangible(struct Object *obj) { +void obj_become_tangible(struct Object* obj) { obj->oIntangibleTimer = 0; } void cur_obj_update_floor_height(void) { - struct Surface *floor; + struct Surface* floor; o->oFloorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &floor); } -struct Surface *cur_obj_update_floor_height_and_get_floor(void) { - struct Surface *floor; +struct Surface* cur_obj_update_floor_height_and_get_floor(void) { + struct Surface* floor; o->oFloorHeight = find_floor(o->oPosX, o->oPosY, o->oPosZ, &floor); return floor; } -static void apply_drag_to_value(f32 *value, f32 dragStrength) { +static void apply_drag_to_value(f32* value, f32 dragStrength) { f32 decel; if (*value != 0) { @@ -1191,7 +1187,7 @@ void cur_obj_apply_drag_xz(f32 dragStrength) { } static s32 cur_obj_move_xz(f32 steepSlopeNormalY, s32 careAboutEdgesAndSteepSlopes) { - struct Surface *intendedFloor; + struct Surface* intendedFloor; f32 intendedX = o->oPosX + o->oVelX; f32 intendedZ = o->oPosZ + o->oVelZ; @@ -1361,8 +1357,7 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) { } } - if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE - | OBJ_MOVE_UNDERWATER_OFF_GROUND)) { + if (o->oMoveFlags & (OBJ_MOVE_MASK_ON_GROUND | OBJ_MOVE_AT_WATER_SURFACE | OBJ_MOVE_UNDERWATER_OFF_GROUND)) { o->oMoveFlags &= ~OBJ_MOVE_IN_AIR; } else { o->oMoveFlags |= OBJ_MOVE_IN_AIR; @@ -1372,7 +1367,7 @@ void cur_obj_move_y(f32 gravity, f32 bounciness, f32 buoyancy) { UNUSED static void stub_obj_helpers_1(void) { } -static s32 clear_move_flag(u32 *bitSet, s32 flag) { +static s32 clear_move_flag(u32* bitSet, s32 flag) { if (*bitSet & flag) { *bitSet &= flag ^ 0xFFFFFFFF; return TRUE; @@ -1439,7 +1434,7 @@ f32 increment_velocity_toward_range(f32 value, f32 center, f32 zeroThreshold, f3 } } -s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2) { +s32 obj_check_if_collided_with_object(struct Object* obj1, struct Object* obj2) { s32 i; for (i = 0; i < obj1->numCollidedObjs; i++) { if (obj1->collidedObjs[i] == obj2) { @@ -1450,15 +1445,15 @@ s32 obj_check_if_collided_with_object(struct Object *obj1, struct Object *obj2) return FALSE; } -void cur_obj_set_behavior(const BehaviorScript *behavior) { +void cur_obj_set_behavior(const BehaviorScript* behavior) { o->behavior = segmented_to_virtual(behavior); } -void obj_set_behavior(struct Object *obj, const BehaviorScript *behavior) { +void obj_set_behavior(struct Object* obj, const BehaviorScript* behavior) { obj->behavior = segmented_to_virtual(behavior); } -s32 cur_obj_has_behavior(const BehaviorScript *behavior) { +s32 cur_obj_has_behavior(const BehaviorScript* behavior) { if (o->behavior == segmented_to_virtual(behavior)) { return TRUE; } else { @@ -1466,7 +1461,7 @@ s32 cur_obj_has_behavior(const BehaviorScript *behavior) { } } -s32 obj_has_behavior(struct Object *obj, const BehaviorScript *behavior) { +s32 obj_has_behavior(struct Object* obj, const BehaviorScript* behavior) { if (obj->behavior == segmented_to_virtual(behavior)) { return TRUE; } else { @@ -1554,8 +1549,8 @@ void cur_obj_shake_y(f32 amount) { } } -void cur_obj_start_cam_event(UNUSED struct Object *obj, s32 cameraEvent) { - gPlayerCameraState->cameraEvent = (s16) cameraEvent; +void cur_obj_start_cam_event(UNUSED struct Object* obj, s32 cameraEvent) { + gPlayerCameraState->cameraEvent = (s16)cameraEvent; gSecondCameraFocus = o; } @@ -1566,7 +1561,7 @@ void set_mario_interact_true_if_in_range(UNUSED s32 arg0, UNUSED s32 arg1, f32 r } } -void obj_set_billboard(struct Object *obj) { +void obj_set_billboard(struct Object* obj) { obj->header.gfx.node.flags |= GRAPH_RENDER_BILLBOARD; } @@ -1580,13 +1575,12 @@ void cur_obj_set_hurtbox_radius_and_height(f32 radius, f32 height) { o->hurtboxHeight = height; } -static void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, - const BehaviorScript *coinBehavior, - s16 posJitter, s16 model) { +static void obj_spawn_loot_coins(struct Object* obj, s32 numCoins, f32 sp30, const BehaviorScript* coinBehavior, + s16 posJitter, s16 model) { s32 i; f32 spawnHeight; - struct Surface *floor; - struct Object *coin; + struct Surface* floor; + struct Object* coin; spawnHeight = find_floor(obj->oPosX, obj->oPosY, obj->oPosZ, &floor); if (obj->oPosY - spawnHeight > 100.0f) { @@ -1607,16 +1601,16 @@ static void obj_spawn_loot_coins(struct Object *obj, s32 numCoins, f32 sp30, } } -void obj_spawn_loot_blue_coins(struct Object *obj, s32 numCoins, f32 sp28, s16 posJitter) { +void obj_spawn_loot_blue_coins(struct Object* obj, s32 numCoins, f32 sp28, s16 posJitter) { obj_spawn_loot_coins(obj, numCoins, sp28, bhvBlueCoinJumping, posJitter, MODEL_BLUE_COIN); } -void obj_spawn_loot_yellow_coins(struct Object *obj, s32 numCoins, f32 sp28) { +void obj_spawn_loot_yellow_coins(struct Object* obj, s32 numCoins, f32 sp28) { obj_spawn_loot_coins(obj, numCoins, sp28, bhvSingleCoinGetsSpawned, 0, MODEL_YELLOW_COIN); } void cur_obj_spawn_loot_coin_at_mario_pos(void) { - struct Object *coin; + struct Object* coin; if (o->oNumLootCoins <= 0) { return; } @@ -1658,7 +1652,7 @@ s32 cur_obj_advance_looping_anim(void) { } static s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees) { - struct Surface *intendedFloor; + struct Surface* intendedFloor; f32 intendedX, intendedFloorHeight, intendedZ; f32 deltaFloorHeight; f32 steepNormalY = coss((s16)(steepAngleDegrees * (0x10000 / 360))); @@ -1672,8 +1666,7 @@ static s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees) { if (intendedFloorHeight < FLOOR_LOWER_LIMIT_MISC) { o->oWallAngle = o->oMoveAngleYaw + 0x8000; return 2; - } else if (intendedFloor->normal.y < steepNormalY && deltaFloorHeight > 0 - && intendedFloorHeight > o->oPosY) { + } else if (intendedFloor->normal.y < steepNormalY && deltaFloorHeight > 0 && intendedFloorHeight > o->oPosY) { o->oWallAngle = atan2s(intendedFloor->normal.z, intendedFloor->normal.x); return 1; } else { @@ -1686,7 +1679,7 @@ static s32 cur_obj_detect_steep_floor(s16 steepAngleDegrees) { s32 cur_obj_resolve_wall_collisions(void) { s32 numCollisions; - struct Surface *wall; + struct Surface* wall; struct WallCollisionData collisionData; f32 offsetY = 10.0f; @@ -1695,9 +1688,9 @@ s32 cur_obj_resolve_wall_collisions(void) { if (radius > 0.1L) { collisionData.offsetY = offsetY; collisionData.radius = radius; - collisionData.x = (s16) o->oPosX; - collisionData.y = (s16) o->oPosY; - collisionData.z = (s16) o->oPosZ; + collisionData.x = (s16)o->oPosX; + collisionData.y = (s16)o->oPosY; + collisionData.z = (s16)o->oPosZ; numCollisions = find_wall_collisions(&collisionData); if (numCollisions != 0) { @@ -1719,7 +1712,7 @@ s32 cur_obj_resolve_wall_collisions(void) { } static void cur_obj_update_floor(void) { - struct Surface *floor = cur_obj_update_floor_height_and_get_floor(); + struct Surface* floor = cur_obj_update_floor_height_and_get_floor(); o->oFloor = floor; if (floor != NULL) { @@ -1739,7 +1732,7 @@ static void cur_obj_update_floor(void) { } static void cur_obj_update_floor_and_resolve_wall_collisions(s16 steepSlopeDegrees) { - if(ROM_JP) { + if (ROM_JP) { o->oMoveFlags &= ~OBJ_MOVE_ABOVE_LAVA; } else { o->oMoveFlags &= ~(OBJ_MOVE_ABOVE_LAVA | OBJ_MOVE_ABOVE_DEATH_BARRIER); @@ -1844,8 +1837,7 @@ void cur_obj_move_using_fvel_and_gravity(void) { cur_obj_move_using_vel_and_gravity(); //! No terminal velocity } -void obj_set_pos_relative(struct Object *obj, struct Object *other, f32 dleft, f32 dy, - f32 dforward) { +void obj_set_pos_relative(struct Object* obj, struct Object* other, f32 dleft, f32 dy, f32 dforward) { f32 facingZ = coss(other->oMoveAngleYaw); f32 facingX = sins(other->oMoveAngleYaw); @@ -1868,7 +1860,7 @@ s16 cur_obj_angle_to_home(void) { return angle; } -void obj_set_gfx_pos_at_obj_pos(struct Object *obj1, struct Object *obj2) { +void obj_set_gfx_pos_at_obj_pos(struct Object* obj1, struct Object* obj2) { obj1->header.gfx.pos[0] = obj2->oPosX; obj1->header.gfx.pos[1] = obj2->oPosY + obj2->oGraphYOffset; obj1->header.gfx.pos[2] = obj2->oPosZ; @@ -1882,7 +1874,7 @@ void obj_set_gfx_pos_at_obj_pos(struct Object *obj1, struct Object *obj2) { * Transform the vector at localTranslateIndex into the object's local * coordinates, and then add it to the vector at posIndex. */ -void obj_translate_local(struct Object *obj, s16 posIndex, s16 localTranslateIndex) { +void obj_translate_local(struct Object* obj, s16 posIndex, s16 localTranslateIndex) { f32 dx = obj->rawData.asF32[localTranslateIndex + 0]; f32 dy = obj->rawData.asF32[localTranslateIndex + 1]; f32 dz = obj->rawData.asF32[localTranslateIndex + 2]; @@ -1895,7 +1887,7 @@ void obj_translate_local(struct Object *obj, s16 posIndex, s16 localTranslateInd obj->transform[0][2] * dx + obj->transform[1][2] * dy + obj->transform[2][2] * dz; } -void obj_build_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s16 angleIndex) { +void obj_build_transform_from_pos_and_angle(struct Object* obj, s16 posIndex, s16 angleIndex) { f32 translate[3]; s16 rotation[3]; @@ -1910,7 +1902,7 @@ void obj_build_transform_from_pos_and_angle(struct Object *obj, s16 posIndex, s1 mtxf_rotate_zxy_and_translate(obj->transform, translate, rotation); } -void obj_set_throw_matrix_from_transform(struct Object *obj) { +void obj_set_throw_matrix_from_transform(struct Object* obj) { if (obj->oFlags & OBJ_FLAG_0020) { obj_build_transform_from_pos_and_angle(obj, O_POS_INDEX, O_FACE_ANGLE_INDEX); obj_apply_scale_to_transform(obj); @@ -1923,8 +1915,8 @@ void obj_set_throw_matrix_from_transform(struct Object *obj) { cur_obj_scale(1.0f); } -void obj_build_transform_relative_to_parent(struct Object *obj) { - struct Object *parent = obj->parentObj; +void obj_build_transform_relative_to_parent(struct Object* obj) { + struct Object* parent = obj->parentObj; obj_build_transform_from_pos_and_angle(obj, O_PARENT_RELATIVE_POS_INDEX, O_FACE_ANGLE_INDEX); obj_apply_scale_to_transform(obj); @@ -1941,7 +1933,7 @@ void obj_build_transform_relative_to_parent(struct Object *obj) { cur_obj_scale(1.0f); } -void obj_create_transform_from_self(struct Object *obj) { +void obj_create_transform_from_self(struct Object* obj) { obj->oFlags &= ~OBJ_FLAG_TRANSFORM_RELATIVE_TO_PARENT; obj->oFlags |= OBJ_FLAG_SET_THROW_MATRIX_FROM_TRANSFORM; @@ -1969,9 +1961,9 @@ void cur_obj_set_face_angle_to_move_angle(void) { } s32 cur_obj_follow_path(UNUSED s32 unusedArg) { - struct Waypoint *startWaypoint; - struct Waypoint *lastWaypoint; - struct Waypoint *targetWaypoint; + struct Waypoint* startWaypoint; + struct Waypoint* lastWaypoint; + struct Waypoint* targetWaypoint; f32 prevToNextX, prevToNextY, prevToNextZ; UNUSED u8 filler[4]; f32 objToNextXZ; @@ -2018,7 +2010,7 @@ s32 cur_obj_follow_path(UNUSED s32 unusedArg) { return PATH_NONE; } -void chain_segment_init(struct ChainSegment *segment) { +void chain_segment_init(struct ChainSegment* segment) { segment->posX = 0.0f; segment->posY = 0.0f; segment->posZ = 0.0f; @@ -2032,23 +2024,23 @@ f32 random_f32_around_zero(f32 diameter) { return random_float() * diameter - diameter / 2; } -void obj_scale_random(struct Object *obj, f32 rangeLength, f32 minScale) { +void obj_scale_random(struct Object* obj, f32 rangeLength, f32 minScale) { f32 scale = random_float() * rangeLength + minScale; obj_scale_xyz(obj, scale, scale, scale); } -void obj_translate_xyz_random(struct Object *obj, f32 rangeLength) { +void obj_translate_xyz_random(struct Object* obj, f32 rangeLength) { obj->oPosX += random_float() * rangeLength - rangeLength * 0.5f; obj->oPosY += random_float() * rangeLength - rangeLength * 0.5f; obj->oPosZ += random_float() * rangeLength - rangeLength * 0.5f; } -void obj_translate_xz_random(struct Object *obj, f32 rangeLength) { +void obj_translate_xz_random(struct Object* obj, f32 rangeLength) { obj->oPosX += random_float() * rangeLength - rangeLength * 0.5f; obj->oPosZ += random_float() * rangeLength - rangeLength * 0.5f; } -static void obj_build_vel_from_transform(struct Object *obj) { +static void obj_build_vel_from_transform(struct Object* obj) { f32 up = obj->oUpVel; f32 left = obj->oLeftVel; f32 forward = obj->oForwardVel; @@ -2068,12 +2060,12 @@ void cur_obj_set_pos_via_transform(void) { } s16 cur_obj_reflect_move_angle_off_wall(void) { - s16 angle = o->oWallAngle - ((s16) o->oMoveAngleYaw - (s16) o->oWallAngle) + 0x8000; + s16 angle = o->oWallAngle - ((s16)o->oMoveAngleYaw - (s16)o->oWallAngle) + 0x8000; return angle; } -void cur_obj_spawn_particles(struct SpawnParticlesInfo *info) { - struct Object *particle; +void cur_obj_spawn_particles(struct SpawnParticlesInfo* info) { + struct Object* particle; s32 i; f32 scale; s32 numParticles = info->count; @@ -2107,7 +2099,7 @@ void cur_obj_spawn_particles(struct SpawnParticlesInfo *info) { } } -void obj_set_hitbox(struct Object *obj, struct ObjectHitbox *hitbox) { +void obj_set_hitbox(struct Object* obj, struct ObjectHitbox* hitbox) { if (!(obj->oFlags & OBJ_FLAG_30)) { obj->oFlags |= OBJ_FLAG_30; @@ -2227,16 +2219,16 @@ void bhv_dust_smoke_loop(void) { UNUSED static void stub_obj_helpers_2(void) { } -s32 cur_obj_set_direction_table(s8 *a0) { +s32 cur_obj_set_direction_table(s8* a0) { o->oToxBoxMovementPattern = a0; o->oToxBoxMovementStep = 0; - return *(s8 *) o->oToxBoxMovementPattern; + return *(s8*)o->oToxBoxMovementPattern; } s32 cur_obj_progress_direction_table(void) { s8 spF; - s8 *sp8 = o->oToxBoxMovementPattern; + s8* sp8 = o->oToxBoxMovementPattern; s32 sp4 = o->oToxBoxMovementStep + 1; if (sp8[sp4] != -1) { @@ -2255,7 +2247,7 @@ void stub_obj_helpers_3(UNUSED s32 sp0, UNUSED s32 sp4) { void cur_obj_scale_over_time(s32 a0, s32 a1, f32 sp10, f32 sp14) { f32 sp4 = sp14 - sp10; - f32 sp0 = (f32) o->oTimer / a1; + f32 sp0 = (f32)o->oTimer / a1; if (a0 & 0x01) { o->header.gfx.scale[0] = sp4 * sp0 + sp10; @@ -2316,8 +2308,8 @@ void cur_obj_call_action_function(void (*actionFunctions[])(void)) { actionFunction(); } -static struct Object *spawn_star_with_no_lvl_exit(s32 sp20, s32 sp24) { - struct Object *sp1C = spawn_object(o, MODEL_STAR, bhvSpawnedStarNoLevelExit); +static struct Object* spawn_star_with_no_lvl_exit(s32 sp20, s32 sp24) { + struct Object* sp1C = spawn_object(o, MODEL_STAR, bhvSpawnedStarNoLevelExit); sp1C->oSparkleSpawnUnk1B0 = sp24; sp1C->oBehParams = o->oBehParams; sp1C->oBehParams2ndByte = sp20; @@ -2360,7 +2352,7 @@ s32 is_mario_moving_fast_or_in_air(s32 speedThreshold) { } } -s32 is_item_in_array(s8 item, s8 *array) { +s32 is_item_in_array(s8 item, s8* array) { while (*array != -1) { if (*array == item) { return TRUE; @@ -2376,7 +2368,7 @@ UNUSED static void stub_obj_helpers_5(void) { } void bhv_init_room(void) { - struct Surface *floor; + struct Surface* floor; f32 floorHeight; if (is_item_in_array(gCurrLevelNum, sLevelsWithRooms)) { @@ -2426,7 +2418,7 @@ void cur_obj_enable_rendering_if_mario_in_room(void) { } } -s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deathSound, s32 noLootCoins) { +s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox* hitbox, s32 deathSound, s32 noLootCoins) { s32 interacted = FALSE; obj_set_hitbox(o, hitbox); @@ -2450,7 +2442,6 @@ s32 cur_obj_set_hitbox_and_die_if_attacked(struct ObjectHitbox *hitbox, s32 deat return interacted; } - void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C) { spawn_mist_particles_variable(0, 0, sp18); spawn_triangle_break_particles(30, MODEL_DIRT_ANIMATION, 3.0f, 4); @@ -2463,7 +2454,7 @@ void obj_explode_and_spawn_coins(f32 sp18, s32 sp1C) { } } -void obj_set_collision_data(struct Object *obj, const void *segAddr) { +void obj_set_collision_data(struct Object* obj, const void* segAddr) { obj->collisionData = segmented_to_virtual(segAddr); } @@ -2483,30 +2474,30 @@ s32 cur_obj_hide_if_mario_far_away_y(f32 distY) { } } -Gfx *geo_offset_klepto_held_object(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_offset_klepto_held_object(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { if (callContext == GEO_CONTEXT_RENDER) { - ((struct GraphNodeTranslationRotation *) node->next)->translation[0] = 300; - ((struct GraphNodeTranslationRotation *) node->next)->translation[1] = 300; - ((struct GraphNodeTranslationRotation *) node->next)->translation[2] = 0; + ((struct GraphNodeTranslationRotation*)node->next)->translation[0] = 300; + ((struct GraphNodeTranslationRotation*)node->next)->translation[1] = 300; + ((struct GraphNodeTranslationRotation*)node->next)->translation[2] = 0; } return NULL; } -Gfx *geo_offset_klepto_debug(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_offset_klepto_debug(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { if (callContext == GEO_CONTEXT_RENDER) { - ((struct GraphNodeTranslationRotation *) node->next)->translation[0] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][0]; - ((struct GraphNodeTranslationRotation *) node->next)->translation[1] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][1]; - ((struct GraphNodeTranslationRotation *) node->next)->translation[2] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][2]; - ((struct GraphNodeTranslationRotation *) node->next)->rotation[0] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][3]; - ((struct GraphNodeTranslationRotation *) node->next)->rotation[1] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][4]; - ((struct GraphNodeTranslationRotation *) node->next)->rotation[2] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][5]; + ((struct GraphNodeTranslationRotation*)node->next)->translation[0] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][0]; + ((struct GraphNodeTranslationRotation*)node->next)->translation[1] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][1]; + ((struct GraphNodeTranslationRotation*)node->next)->translation[2] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][2]; + ((struct GraphNodeTranslationRotation*)node->next)->rotation[0] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][3]; + ((struct GraphNodeTranslationRotation*)node->next)->rotation[1] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][4]; + ((struct GraphNodeTranslationRotation*)node->next)->rotation[2] = gDebugInfo[DEBUG_PAGE_EFFECTINFO][5]; } return NULL; } -s32 obj_is_hidden(struct Object *obj) { +s32 obj_is_hidden(struct Object* obj) { if (obj->header.gfx.node.flags & GRAPH_RENDER_INVISIBLE) { return TRUE; } else { @@ -2535,9 +2526,9 @@ s32 cur_obj_can_mario_activate_textbox(f32 radius, f32 height, UNUSED s32 unused f32 latDistToMario = lateral_dist_between_objects(o, gMarioObject); UNUSED s16 angleFromMario = obj_angle_to_object(gMarioObject, o); - if (latDistToMario < radius && o->oPosY < gMarioObject->oPosY + 160.0f - && gMarioObject->oPosY < o->oPosY + height && !(gMarioStates[0].action & ACT_FLAG_AIR) - && mario_ready_to_speak()) { + if (latDistToMario < radius && o->oPosY < gMarioObject->oPosY + 160.0f && + gMarioObject->oPosY < o->oPosY + height && !(gMarioStates[0].action & ACT_FLAG_AIR) && + mario_ready_to_speak()) { return TRUE; } } @@ -2742,7 +2733,7 @@ s32 cur_obj_has_model(u16 modelID) { } void cur_obj_align_gfx_with_floor(void) { - struct Surface *floor; + struct Surface* floor; Vec3f floorNormal; Vec3f position; @@ -2777,9 +2768,9 @@ void cur_obj_shake_screen(s32 shake) { set_camera_shake_from_point(shake, o->oPosX, o->oPosY, o->oPosZ); } -s32 obj_attack_collided_from_other_object(struct Object *obj) { +s32 obj_attack_collided_from_other_object(struct Object* obj) { s32 numCollidedObjs; - struct Object *other; + struct Object* other; s32 touchedOtherObject = FALSE; numCollidedObjs = obj->numCollidedObjs; @@ -2787,8 +2778,8 @@ s32 obj_attack_collided_from_other_object(struct Object *obj) { other = obj->collidedObjs[0]; if (other != gMarioObject) { - other->oInteractStatus |= ATTACK_PUNCH | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED - | INT_STATUS_TOUCHED_BOB_OMB; + other->oInteractStatus |= + ATTACK_PUNCH | INT_STATUS_WAS_ATTACKED | INT_STATUS_INTERACTED | INT_STATUS_TOUCHED_BOB_OMB; touchedOtherObject = TRUE; } } @@ -2799,8 +2790,7 @@ s32 obj_attack_collided_from_other_object(struct Object *obj) { s32 cur_obj_was_attacked_or_ground_pounded(void) { s32 attacked = FALSE; - if ((o->oInteractStatus & INT_STATUS_INTERACTED) - && (o->oInteractStatus & INT_STATUS_WAS_ATTACKED)) { + if ((o->oInteractStatus & INT_STATUS_INTERACTED) && (o->oInteractStatus & INT_STATUS_WAS_ATTACKED)) { attacked = TRUE; } @@ -2812,7 +2802,7 @@ s32 cur_obj_was_attacked_or_ground_pounded(void) { return attacked; } -void obj_copy_behavior_params(struct Object *dst, struct Object *src) { +void obj_copy_behavior_params(struct Object* dst, struct Object* src) { dst->oBehParams = src->oBehParams; dst->oBehParams2ndByte = src->oBehParams2ndByte; } diff --git a/src/game/object_list_processor.c b/src/game/object_list_processor.c index 8ef9ca5c..0c1fcebc 100644 --- a/src/game/object_list_processor.c +++ b/src/game/object_list_processor.c @@ -20,7 +20,6 @@ #include "profiler.h" #include "spawn_object.h" - /** * Flags controlling what debug info is displayed. */ @@ -78,7 +77,7 @@ struct Object gMacroObjectDefaultParent; * Given an object list index idx, gObjectLists[idx] is the head of a doubly * linked list of all currently spawned objects in the list. */ -struct ObjectNode *gObjectLists; +struct ObjectNode* gObjectLists; /** * A singly linked list of available slots in the object pool. @@ -88,26 +87,26 @@ struct ObjectNode gFreeObjectList; /** * The object representing Mario. */ -struct Object *gMarioObject; +struct Object* gMarioObject; /** * An object variable that may have been used to represent the planned * second player. This is speculation, based on its position and its usage in * shadow.c. */ -struct Object *gLuigiObject; +struct Object* gLuigiObject; /** * The object whose behavior script is currently being updated. * This object is used frequently in object behavior code, and so is often * aliased as "o". */ -struct Object *gCurrentObject; +struct Object* gCurrentObject; /** * The next object behavior command to be executed. */ -const BehaviorScript *gCurBhvCommand; +const BehaviorScript* gCurBhvCommand; /** * The number of objects that were processed last frame, which may miss some @@ -141,12 +140,11 @@ s32 gNumStaticSurfaces; /** * A pool used by chain chomp and wiggler to allocate their body parts. */ -struct MemoryPool *gObjectMemoryPool; - +struct MemoryPool* gObjectMemoryPool; s16 gCheckingSurfaceCollisionsForCamera; s16 gFindFloorIncludeSurfaceIntangible; -s16 *gEnvironmentRegions; +s16* gEnvironmentRegions; s32 gEnvironmentLevels[20]; s8 gDoorAdjacentRooms[60][2]; s16 gMarioCurrentRoom; @@ -189,31 +187,31 @@ struct ParticleProperties { u32 particleFlag; u32 activeParticleFlag; u8 model; - const BehaviorScript *behavior; + const BehaviorScript* behavior; }; /** * A table mapping particle flags to various properties use when spawning a particle. */ struct ParticleProperties sParticleTypes[] = { - { PARTICLE_DUST, ACTIVE_PARTICLE_DUST, MODEL_MIST, bhvMistParticleSpawner }, - { PARTICLE_VERTICAL_STAR, ACTIVE_PARTICLE_V_STAR, MODEL_NONE, bhvVertStarParticleSpawner }, - { PARTICLE_HORIZONTAL_STAR, ACTIVE_PARTICLE_H_STAR, MODEL_NONE, bhvHorStarParticleSpawner }, - { PARTICLE_SPARKLES, ACTIVE_PARTICLE_SPARKLES, MODEL_SPARKLES, bhvSparkleParticleSpawner }, - { PARTICLE_BUBBLE, ACTIVE_PARTICLE_BUBBLE, MODEL_BUBBLE, bhvBubbleParticleSpawner }, - { PARTICLE_WATER_SPLASH, ACTIVE_PARTICLE_WATER_SPLASH, MODEL_WATER_SPLASH, bhvWaterSplash }, - { PARTICLE_IDLE_WATER_WAVE, ACTIVE_PARTICLE_IDLE_WATER_WAVE, MODEL_IDLE_WATER_WAVE, bhvIdleWaterWave }, - { PARTICLE_PLUNGE_BUBBLE, ACTIVE_PARTICLE_PLUNGE_BUBBLE, MODEL_WHITE_PARTICLE_SMALL, bhvPlungeBubble }, - { PARTICLE_WAVE_TRAIL, ACTIVE_PARTICLE_WAVE_TRAIL, MODEL_WAVE_TRAIL, bhvWaveTrail }, - { PARTICLE_FIRE, ACTIVE_PARTICLE_FIRE, MODEL_RED_FLAME, bhvFireParticleSpawner }, - { PARTICLE_SHALLOW_WATER_WAVE, ACTIVE_PARTICLE_SHALLOW_WATER_WAVE, MODEL_NONE, bhvShallowWaterWave }, - { PARTICLE_SHALLOW_WATER_SPLASH, ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH, MODEL_NONE, bhvShallowWaterSplash }, - { PARTICLE_LEAF, ACTIVE_PARTICLE_LEAF, MODEL_NONE, bhvLeafParticleSpawner }, - { PARTICLE_SNOW, ACTIVE_PARTICLE_SNOW, MODEL_NONE, bhvSnowParticleSpawner }, - { PARTICLE_BREATH, ACTIVE_PARTICLE_BREATH, MODEL_NONE, bhvBreathParticleSpawner }, - { PARTICLE_DIRT, ACTIVE_PARTICLE_DIRT, MODEL_NONE, bhvDirtParticleSpawner }, - { PARTICLE_MIST_CIRCLE, ACTIVE_PARTICLE_MIST_CIRCLE, MODEL_NONE, bhvMistCircParticleSpawner }, - { PARTICLE_TRIANGLE, ACTIVE_PARTICLE_TRIANGLE, MODEL_NONE, bhvTriangleParticleSpawner }, + { PARTICLE_DUST, ACTIVE_PARTICLE_DUST, MODEL_MIST, bhvMistParticleSpawner }, + { PARTICLE_VERTICAL_STAR, ACTIVE_PARTICLE_V_STAR, MODEL_NONE, bhvVertStarParticleSpawner }, + { PARTICLE_HORIZONTAL_STAR, ACTIVE_PARTICLE_H_STAR, MODEL_NONE, bhvHorStarParticleSpawner }, + { PARTICLE_SPARKLES, ACTIVE_PARTICLE_SPARKLES, MODEL_SPARKLES, bhvSparkleParticleSpawner }, + { PARTICLE_BUBBLE, ACTIVE_PARTICLE_BUBBLE, MODEL_BUBBLE, bhvBubbleParticleSpawner }, + { PARTICLE_WATER_SPLASH, ACTIVE_PARTICLE_WATER_SPLASH, MODEL_WATER_SPLASH, bhvWaterSplash }, + { PARTICLE_IDLE_WATER_WAVE, ACTIVE_PARTICLE_IDLE_WATER_WAVE, MODEL_IDLE_WATER_WAVE, bhvIdleWaterWave }, + { PARTICLE_PLUNGE_BUBBLE, ACTIVE_PARTICLE_PLUNGE_BUBBLE, MODEL_WHITE_PARTICLE_SMALL, bhvPlungeBubble }, + { PARTICLE_WAVE_TRAIL, ACTIVE_PARTICLE_WAVE_TRAIL, MODEL_WAVE_TRAIL, bhvWaveTrail }, + { PARTICLE_FIRE, ACTIVE_PARTICLE_FIRE, MODEL_RED_FLAME, bhvFireParticleSpawner }, + { PARTICLE_SHALLOW_WATER_WAVE, ACTIVE_PARTICLE_SHALLOW_WATER_WAVE, MODEL_NONE, bhvShallowWaterWave }, + { PARTICLE_SHALLOW_WATER_SPLASH, ACTIVE_PARTICLE_SHALLOW_WATER_SPLASH, MODEL_NONE, bhvShallowWaterSplash }, + { PARTICLE_LEAF, ACTIVE_PARTICLE_LEAF, MODEL_NONE, bhvLeafParticleSpawner }, + { PARTICLE_SNOW, ACTIVE_PARTICLE_SNOW, MODEL_NONE, bhvSnowParticleSpawner }, + { PARTICLE_BREATH, ACTIVE_PARTICLE_BREATH, MODEL_NONE, bhvBreathParticleSpawner }, + { PARTICLE_DIRT, ACTIVE_PARTICLE_DIRT, MODEL_NONE, bhvDirtParticleSpawner }, + { PARTICLE_MIST_CIRCLE, ACTIVE_PARTICLE_MIST_CIRCLE, MODEL_NONE, bhvMistCircParticleSpawner }, + { PARTICLE_TRIANGLE, ACTIVE_PARTICLE_TRIANGLE, MODEL_NONE, bhvTriangleParticleSpawner }, { 0, 0, MODEL_NONE, NULL }, }; @@ -252,9 +250,9 @@ void copy_mario_state_to_object(void) { /** * Spawn a particle at gCurrentObject's location. */ -void spawn_particle(u32 activeParticleFlag, s16 model, const BehaviorScript *behavior) { +void spawn_particle(u32 activeParticleFlag, s16 model, const BehaviorScript* behavior) { if (!(gCurrentObject->oActiveParticleFlags & activeParticleFlag)) { - struct Object *particle; + struct Object* particle; gCurrentObject->oActiveParticleFlags |= activeParticleFlag; particle = spawn_object_at_origin(gCurrentObject, 0, model, behavior); obj_copy_pos_and_angle(particle, gCurrentObject); @@ -278,8 +276,7 @@ void bhv_mario_update(void) { i = 0; while (sParticleTypes[i].particleFlag != 0) { if (particleFlags & sParticleTypes[i].particleFlag) { - spawn_particle(sParticleTypes[i].activeParticleFlag, sParticleTypes[i].model, - sParticleTypes[i].behavior); + spawn_particle(sParticleTypes[i].activeParticleFlag, sParticleTypes[i].model, sParticleTypes[i].behavior); } i++; @@ -290,11 +287,11 @@ void bhv_mario_update(void) { * Update every object that occurs after firstObj in the given object list, * including firstObj itself. Return the number of objects that were updated. */ -s32 update_objects_starting_at(struct ObjectNode *objList, struct ObjectNode *firstObj) { +s32 update_objects_starting_at(struct ObjectNode* objList, struct ObjectNode* firstObj) { s32 count = 0; while (objList != firstObj) { - gCurrentObject = (struct Object *) firstObj; + gCurrentObject = (struct Object*)firstObj; gCurrentObject->header.gfx.node.flags |= GRAPH_RENDER_HAS_ANIMATION; cur_obj_update(); @@ -315,12 +312,12 @@ s32 update_objects_starting_at(struct ObjectNode *objList, struct ObjectNode *fi * Return the total number of objects in the list (including those that weren't * updated) */ -s32 update_objects_during_time_stop(struct ObjectNode *objList, struct ObjectNode *firstObj) { +s32 update_objects_during_time_stop(struct ObjectNode* objList, struct ObjectNode* firstObj) { s32 count = 0; s32 unfrozen; while (objList != firstObj) { - gCurrentObject = (struct Object *) firstObj; + gCurrentObject = (struct Object*)firstObj; unfrozen = FALSE; @@ -330,13 +327,12 @@ s32 update_objects_during_time_stop(struct ObjectNode *objList, struct ObjectNod unfrozen = TRUE; } - if ((gCurrentObject->oInteractType & (INTERACT_DOOR | INTERACT_WARP_DOOR)) - && !(gTimeStopState & TIME_STOP_MARIO_AND_DOORS)) { + if ((gCurrentObject->oInteractType & (INTERACT_DOOR | INTERACT_WARP_DOOR)) && + !(gTimeStopState & TIME_STOP_MARIO_AND_DOORS)) { unfrozen = TRUE; } - if (gCurrentObject->activeFlags - & (ACTIVE_FLAG_UNIMPORTANT | ACTIVE_FLAG_INITIATED_TIME_STOP)) { + if (gCurrentObject->activeFlags & (ACTIVE_FLAG_UNIMPORTANT | ACTIVE_FLAG_INITIATED_TIME_STOP)) { unfrozen = TRUE; } } @@ -360,9 +356,9 @@ s32 update_objects_during_time_stop(struct ObjectNode *objList, struct ObjectNod * Update every object in the given list. Return the total number of objects in * the list. */ -s32 update_objects_in_list(struct ObjectNode *objList) { +s32 update_objects_in_list(struct ObjectNode* objList) { s32 count; - struct ObjectNode *firstObj = objList->next; + struct ObjectNode* firstObj = objList->next; if (!(gTimeStopState & TIME_STOP_ACTIVE)) { count = update_objects_starting_at(objList, firstObj); @@ -376,11 +372,11 @@ s32 update_objects_in_list(struct ObjectNode *objList) { /** * Unload any objects in the list that have been deactivated. */ -s32 unload_deactivated_objects_in_list(struct ObjectNode *objList) { - struct ObjectNode *obj = objList->next; +s32 unload_deactivated_objects_in_list(struct ObjectNode* objList) { + struct ObjectNode* obj = objList->next; while (objList != obj) { - gCurrentObject = (struct Object *) obj; + gCurrentObject = (struct Object*)obj; obj = obj->next; @@ -405,18 +401,18 @@ s32 unload_deactivated_objects_in_list(struct ObjectNode *objList) { * list. For other objects, it points to the 32 bit behaviorArg in the * SpawnInfo. */ -void set_object_respawn_info_bits(struct Object *obj, u8 bits) { - u32 *info32; - u16 *info16; +void set_object_respawn_info_bits(struct Object* obj, u8 bits) { + u32* info32; + u16* info16; switch (obj->respawnInfoType) { case RESPAWN_INFO_TYPE_32: - info32 = (u32 *) obj->respawnInfo; + info32 = (u32*)obj->respawnInfo; *info32 |= bits << 8; break; case RESPAWN_INFO_TYPE_16: - info16 = (u16 *) obj->respawnInfo; + info16 = (u16*)obj->respawnInfo; *info16 |= bits << 8; break; } @@ -426,9 +422,9 @@ void set_object_respawn_info_bits(struct Object *obj, u8 bits) { * Unload all objects whose activeAreaIndex is areaIndex. */ void unload_objects_from_area(UNUSED s32 unused, s32 areaIndex) { - struct Object *obj; - struct ObjectNode *node; - struct ObjectNode *list; + struct Object* obj; + struct ObjectNode* node; + struct ObjectNode* list; s32 i; gObjectLists = gObjectListArray; @@ -437,7 +433,7 @@ void unload_objects_from_area(UNUSED s32 unused, s32 areaIndex) { node = list->next; while (node != list) { - obj = (struct Object *) node; + obj = (struct Object*)node; node = node->next; if (obj->header.gfx.activeAreaIndex == areaIndex) { @@ -450,7 +446,7 @@ void unload_objects_from_area(UNUSED s32 unused, s32 areaIndex) { /** * Spawn objects given a list of SpawnInfos. Called when loading an area. */ -void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) { +void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo* spawnInfo) { gObjectLists = gObjectListArray; gTimeStopState = 0; @@ -460,7 +456,7 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) { //! (Spawning Displacement) On the Japanese version, Mario's platform object // isn't cleared when transitioning between areas. This can cause Mario to // receive displacement after spawning. - if(!ROM_JP) { + if (!ROM_JP) { clear_mario_platform(); } @@ -469,16 +465,15 @@ void spawn_objects_from_info(UNUSED s32 unused, struct SpawnInfo *spawnInfo) { } while (spawnInfo != NULL) { - struct Object *object; + struct Object* object; UNUSED u8 filler[4]; - const BehaviorScript *script; + const BehaviorScript* script; UNUSED s16 arg16 = (s16)(spawnInfo->behaviorArg & 0xFFFF); script = segmented_to_virtual(spawnInfo->behaviorScript); // If the object was previously killed/collected, don't respawn it - if ((spawnInfo->behaviorArg & (RESPAWN_INFO_DONT_RESPAWN << 8)) - != (RESPAWN_INFO_DONT_RESPAWN << 8)) { + if ((spawnInfo->behaviorArg & (RESPAWN_INFO_DONT_RESPAWN << 8)) != (RESPAWN_INFO_DONT_RESPAWN << 8)) { object = create_object(script); // Behavior parameters are often treated as four separate bytes, but @@ -602,7 +597,7 @@ void unload_deactivated_objects(void) { /** * Unused profiling function. */ -UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) { +UNUSED static u16 unused_get_elapsed_time(u64* cycleCounts, s32 index) { u16 time; f64 cycles; @@ -611,7 +606,7 @@ UNUSED static u16 unused_get_elapsed_time(u64 *cycleCounts, s32 index) { cycles = 0; } - time = (u16)(((u64) cycles * 1000000 / osClockRate) / 16667.0 * 1000.0); + time = (u16)(((u64)cycles * 1000000 / osClockRate) / 16667.0 * 1000.0); if (time > 999) { time = 999; } diff --git a/src/game/paintings.c b/src/game/paintings.c index 9f3c7d8d..48e63478 100644 --- a/src/game/paintings.c +++ b/src/game/paintings.c @@ -147,40 +147,40 @@ f32 gPaintingMarioZPos; * This mesh only contains the vertex positions and normals. * Paintings use an additional array to map textures to the mesh. */ -struct PaintingMeshVertex *gPaintingMesh; +struct PaintingMeshVertex* gPaintingMesh; /** * The painting's surface normals, used to approximate each of the vertex normals (for gouraud shading). */ -Vec3f *gPaintingTriNorms; +Vec3f* gPaintingTriNorms; /** * The painting that is currently rippling. Only one painting can be rippling at once. */ -struct Painting *gRipplingPainting; +struct Painting* gRipplingPainting; /** * Whether the DDD painting is moved forward, should being moving backwards, or has already moved backwards. */ s8 gDddPaintingStatus; -struct Painting *sHmcPaintings[] = { +struct Painting* sHmcPaintings[] = { cotmc_painting, NULL, }; -struct Painting *sInsideCastlePaintings[] = { +struct Painting* sInsideCastlePaintings[] = { bob_painting, ccm_painting, wf_painting, jrb_painting, lll_painting, ssl_painting, hmc_painting, ddd_painting, wdw_painting, thi_tiny_painting, ttm_painting, ttc_painting, sl_painting, thi_huge_painting, NULL, }; -struct Painting *sTtmPaintings[] = { +struct Painting* sTtmPaintings[] = { ttm_slide_painting, NULL, }; -struct Painting **sPaintingGroups[] = { +struct Painting** sPaintingGroups[] = { sHmcPaintings, sInsideCastlePaintings, sTtmPaintings, @@ -192,13 +192,13 @@ s16 gLastPaintingUpdateCounter = 0; /** * Stop paintings in paintingGroup from rippling if their id is different from *idptr. */ -void stop_other_paintings(s16 *idptr, struct Painting *paintingGroup[]) { +void stop_other_paintings(s16* idptr, struct Painting* paintingGroup[]) { s16 index; s16 id = *idptr; index = 0; while (paintingGroup[index] != NULL) { - struct Painting *painting = segmented_to_virtual(paintingGroup[index]); + struct Painting* painting = segmented_to_virtual(paintingGroup[index]); // stop all rippling except for the selected painting if (painting->id != id) { @@ -211,7 +211,7 @@ void stop_other_paintings(s16 *idptr, struct Painting *paintingGroup[]) { /** * @return Mario's y position inside the painting (bounded). */ -f32 painting_mario_y(struct Painting *painting) { +f32 painting_mario_y(struct Painting* painting) { //! Unnecessary use of double constants // Add 50 to make the ripple closer to Mario's center of mass. f32 relY = gPaintingMarioYPos - painting->posY + 50.0; @@ -227,7 +227,7 @@ f32 painting_mario_y(struct Painting *painting) { /** * @return Mario's z position inside the painting (bounded). */ -f32 painting_mario_z(struct Painting *painting) { +f32 painting_mario_z(struct Painting* painting) { f32 relZ = painting->posZ - gPaintingMarioZPos; if (relZ < 0.0) { @@ -242,7 +242,7 @@ f32 painting_mario_z(struct Painting *painting) { * @return The y origin for the ripple, based on ySource. * For floor paintings, the z-axis is treated as y. */ -f32 painting_ripple_y(struct Painting *painting, s8 ySource) { +f32 painting_ripple_y(struct Painting* painting, s8 ySource) { switch (ySource) { case MARIO_Y: return painting_mario_y(painting); // normal wall paintings @@ -260,7 +260,7 @@ f32 painting_ripple_y(struct Painting *painting, s8 ySource) { /** * Return the quarter of the painting that is closest to the floor Mario entered. */ -f32 painting_nearest_4th(struct Painting *painting) { +f32 painting_nearest_4th(struct Painting* painting) { f32 firstQuarter = painting->size / 4.0; // 1/4 of the way across the painting f32 secondQuarter = painting->size / 2.0; // 1/2 of the way across the painting f32 thirdQuarter = painting->size * 3.0 / 4.0; // 3/4 of the way across the painting @@ -272,7 +272,7 @@ f32 painting_nearest_4th(struct Painting *painting) { } else if (painting->floorEntered & RIPPLE_RIGHT) { return thirdQuarter; - // Same as ripple floors. + // Same as ripple floors. } else if (painting->floorEntered & ENTER_LEFT) { return firstQuarter; } else if (painting->floorEntered & ENTER_MIDDLE) { @@ -286,7 +286,7 @@ f32 painting_nearest_4th(struct Painting *painting) { /** * @return Mario's x position inside the painting (bounded). */ -f32 painting_mario_x(struct Painting *painting) { +f32 painting_mario_x(struct Painting* painting) { f32 relX = gPaintingMarioXPos - painting->posX; if (relX < 0.0) { @@ -300,7 +300,7 @@ f32 painting_mario_x(struct Painting *painting) { /** * @return The x origin for the ripple, based on xSource. */ -f32 painting_ripple_x(struct Painting *painting, s8 xSource) { +f32 painting_ripple_x(struct Painting* painting, s8 xSource) { switch (xSource) { case NEAREST_4TH: // normal wall paintings return painting_nearest_4th(painting); @@ -323,24 +323,24 @@ f32 painting_ripple_x(struct Painting *painting, s8 xSource) { * @param xSource,ySource what to use for the x and y origin of the ripple * @param resetTimer if 100, set the timer to 0 */ -void painting_state(s8 state, struct Painting *painting, struct Painting *paintingGroup[], - s8 xSource, s8 ySource, s8 resetTimer) { +void painting_state(s8 state, struct Painting* painting, struct Painting* paintingGroup[], s8 xSource, s8 ySource, + s8 resetTimer) { // make sure no other paintings are rippling stop_other_paintings(&painting->id, paintingGroup); // use a different set of variables depending on the state switch (state) { case PAINTING_RIPPLE: - painting->currRippleMag = painting->passiveRippleMag; - painting->rippleDecay = painting->passiveRippleDecay; - painting->currRippleRate = painting->passiveRippleRate; + painting->currRippleMag = painting->passiveRippleMag; + painting->rippleDecay = painting->passiveRippleDecay; + painting->currRippleRate = painting->passiveRippleRate; painting->dispersionFactor = painting->passiveDispersionFactor; break; case PAINTING_ENTERED: - painting->currRippleMag = painting->entryRippleMag; - painting->rippleDecay = painting->entryRippleDecay; - painting->currRippleRate = painting->entryRippleRate; + painting->currRippleMag = painting->entryRippleMag; + painting->rippleDecay = painting->entryRippleDecay; + painting->currRippleRate = painting->entryRippleRate; painting->dispersionFactor = painting->entryDispersionFactor; break; } @@ -359,7 +359,7 @@ void painting_state(s8 state, struct Painting *painting, struct Painting *painti /** * Idle update function for wall paintings that use RIPPLE_TRIGGER_PROXIMITY. */ -void wall_painting_proximity_idle(struct Painting *painting, struct Painting *paintingGroup[]) { +void wall_painting_proximity_idle(struct Painting* painting, struct Painting* paintingGroup[]) { // Check for Mario triggering a ripple if (painting->floorEntered & RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); @@ -368,7 +368,7 @@ void wall_painting_proximity_idle(struct Painting *painting, struct Painting *pa } else if (painting->floorEntered & RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); - // Check for Mario entering + // Check for Mario entering } else if (painting->floorEntered & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); } else if (painting->floorEntered & ENTER_MIDDLE) { @@ -381,7 +381,7 @@ void wall_painting_proximity_idle(struct Painting *painting, struct Painting *pa /** * Rippling update function for wall paintings that use RIPPLE_TRIGGER_PROXIMITY. */ -void wall_painting_proximity_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { +void wall_painting_proximity_rippling(struct Painting* painting, struct Painting* paintingGroup[]) { if (painting->floorEntered & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); } else if (painting->floorEntered & ENTER_MIDDLE) { @@ -394,7 +394,7 @@ void wall_painting_proximity_rippling(struct Painting *painting, struct Painting /** * Idle update function for wall paintings that use RIPPLE_TRIGGER_CONTINUOUS. */ -void wall_painting_continuous_idle(struct Painting *painting, struct Painting *paintingGroup[]) { +void wall_painting_continuous_idle(struct Painting* painting, struct Painting* paintingGroup[]) { // Check for Mario triggering a ripple if (painting->floorEntered & RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); @@ -403,7 +403,7 @@ void wall_painting_continuous_idle(struct Painting *painting, struct Painting *p } else if (painting->floorEntered & RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); - // Check for Mario entering + // Check for Mario entering } else if (painting->floorEntered & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, RESET_TIMER); } else if (painting->floorEntered & ENTER_MIDDLE) { @@ -416,7 +416,7 @@ void wall_painting_continuous_idle(struct Painting *painting, struct Painting *p /** * Rippling update function for wall paintings that use RIPPLE_TRIGGER_CONTINUOUS. */ -void wall_painting_continuous_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { +void wall_painting_continuous_rippling(struct Painting* painting, struct Painting* paintingGroup[]) { if (painting->floorEntered & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, NEAREST_4TH, MARIO_Y, DONT_RESET); } else if (painting->floorEntered & ENTER_MIDDLE) { @@ -431,7 +431,7 @@ void wall_painting_continuous_rippling(struct Painting *painting, struct Paintin * * No floor paintings use RIPPLE_TRIGGER_PROXIMITY in the game. */ -void floor_painting_proximity_idle(struct Painting *painting, struct Painting *paintingGroup[]) { +void floor_painting_proximity_idle(struct Painting* painting, struct Painting* paintingGroup[]) { // Check for Mario triggering a ripple if (painting->floorEntered & RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); @@ -440,7 +440,7 @@ void floor_painting_proximity_idle(struct Painting *painting, struct Painting *p } else if (painting->floorEntered & RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); - // Only check for Mario entering if he jumped below the surface + // Only check for Mario entering if he jumped below the surface } else if (painting->marioWentUnder) { if (painting->currFloor & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); @@ -457,7 +457,7 @@ void floor_painting_proximity_idle(struct Painting *painting, struct Painting *p * * No floor paintings use RIPPLE_TRIGGER_PROXIMITY in the game. */ -void floor_painting_proximity_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { +void floor_painting_proximity_rippling(struct Painting* painting, struct Painting* paintingGroup[]) { if (painting->marioWentUnder) { if (painting->currFloor & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); @@ -476,7 +476,7 @@ void floor_painting_proximity_rippling(struct Painting *painting, struct Paintin * The floor just inside the doorway is RIPPLE_LEFT, so the painting starts rippling as soon as Mario * enters the room. */ -void floor_painting_continuous_idle(struct Painting *painting, struct Painting *paintingGroup[]) { +void floor_painting_continuous_idle(struct Painting* painting, struct Painting* paintingGroup[]) { // Check for Mario triggering a ripple if (painting->floorEntered & RIPPLE_LEFT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); @@ -485,7 +485,7 @@ void floor_painting_continuous_idle(struct Painting *painting, struct Painting * } else if (painting->floorEntered & RIPPLE_RIGHT) { painting_state(PAINTING_RIPPLE, painting, paintingGroup, MIDDLE_X, MIDDLE_Y, RESET_TIMER); - // Check for Mario entering + // Check for Mario entering } else if (painting->currFloor & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, RESET_TIMER); } else if (painting->currFloor & ENTER_MIDDLE) { @@ -498,7 +498,7 @@ void floor_painting_continuous_idle(struct Painting *painting, struct Painting * /** * Rippling update function for floor paintings that use RIPPLE_TRIGGER_CONTINUOUS. */ -void floor_painting_continuous_rippling(struct Painting *painting, struct Painting *paintingGroup[]) { +void floor_painting_continuous_rippling(struct Painting* painting, struct Painting* paintingGroup[]) { if (painting->marioWentUnder) { if (painting->currFloor & ENTER_LEFT) { painting_state(PAINTING_ENTERED, painting, paintingGroup, MARIO_X, MARIO_Z, DONT_RESET); @@ -513,7 +513,7 @@ void floor_painting_continuous_rippling(struct Painting *painting, struct Painti /** * Check for Mario entering one of the special floors associated with the painting. */ -void painting_update_floors(struct Painting *painting) { +void painting_update_floors(struct Painting* painting) { s16 paintingId = painting->id; s8 rippleLeft = 0; s8 rippleMiddle = 0; @@ -573,7 +573,7 @@ void painting_update_floors(struct Painting *painting) { * Automatically changes the painting back to IDLE state (or RIPPLE for continuous paintings) if the * ripple's magnitude becomes small enough. */ -void painting_update_ripple_state(struct Painting *painting) { +void painting_update_ripple_state(struct Painting* painting) { if (gPaintingUpdateCounter != gLastPaintingUpdateCounter) { painting->currRippleMag *= painting->rippleDecay; @@ -609,7 +609,7 @@ void painting_update_ripple_state(struct Painting *painting) { * @return the ripple function at posX, posY * note that posX and posY correspond to a point on the face of the painting, not actual axes */ -s16 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) { +s16 calculate_ripple_at_point(struct Painting* painting, f32 posX, f32 posY) { /// Controls the peaks of the ripple. f32 rippleMag = painting->currRippleMag; /// Controls the ripple's frequency @@ -647,7 +647,7 @@ s16 calculate_ripple_at_point(struct Painting *painting, f32 posX, f32 posY) { * If movable, return the ripple function at (posX, posY) * else return 0 */ -s16 ripple_if_movable(struct Painting *painting, s16 movable, s16 posX, s16 posY) { +s16 ripple_if_movable(struct Painting* painting, s16 movable, s16 posX, s16 posY) { s16 rippleZ = 0; if (movable) { @@ -675,20 +675,19 @@ s16 ripple_if_movable(struct Painting *painting, s16 movable, s16 posX, s16 posY * * The mesh used in game, seg2_painting_triangle_mesh, is in bin/segment2.c. */ -void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { +void painting_generate_mesh(struct Painting* painting, s16* mesh, s16 numTris) { s16 i; gPaintingMesh = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(struct PaintingMeshVertex)); - if (gPaintingMesh == NULL) { - } + if (gPaintingMesh == NULL) {} // accesses are off by 1 since the first entry is the number of vertices for (i = 0; i < numTris; i++) { gPaintingMesh[i].pos[0] = mesh[i * 3 + 1]; gPaintingMesh[i].pos[1] = mesh[i * 3 + 2]; // The "z coordinate" of each vertex in the mesh is either 1 or 0. Instead of being an // actual coordinate, it just determines whether the vertex moves - gPaintingMesh[i].pos[2] = ripple_if_movable(painting, mesh[i * 3 + 3], - gPaintingMesh[i].pos[0], gPaintingMesh[i].pos[1]); + gPaintingMesh[i].pos[2] = + ripple_if_movable(painting, mesh[i * 3 + 3], gPaintingMesh[i].pos[0], gPaintingMesh[i].pos[1]); } } @@ -707,12 +706,11 @@ void painting_generate_mesh(struct Painting *painting, s16 *mesh, s16 numTris) { * * The mesh used in game, seg2_painting_triangle_mesh, is in bin/segment2.c. */ -void painting_calculate_triangle_normals(s16 *mesh, s16 numVtx, s16 numTris) { +void painting_calculate_triangle_normals(s16* mesh, s16 numVtx, s16 numTris) { s16 i; gPaintingTriNorms = mem_pool_alloc(gEffectsMemoryPool, numTris * sizeof(Vec3f)); - if (gPaintingTriNorms == NULL) { - } + if (gPaintingTriNorms == NULL) {} for (i = 0; i < numTris; i++) { s16 tri = numVtx * 3 + i * 3 + 2; // Add 2 because of the 2 length entries preceding the list s16 v0 = mesh[tri]; @@ -750,7 +748,7 @@ s8 normalize_component(f32 comp) { } else if (comp < 0.0) { rounded = comp * 128.0 - 0.5; // round down } else { - rounded = 0; // don't round 0 + rounded = 0; // don't round 0 } return rounded; } @@ -770,7 +768,7 @@ s8 normalize_component(f32 comp) { * * The table used in game, seg2_painting_mesh_neighbor_tris, is in bin/segment2.c. */ -void painting_average_vertex_normals(s16 *neighborTris, s16 numVtx) { +void painting_average_vertex_normals(s16* neighborTris, s16 numVtx) { UNUSED s16 unused; s16 tri; s16 i; @@ -820,7 +818,7 @@ void painting_average_vertex_normals(s16 *neighborTris, s16 numVtx) { * If the textureMap doesn't describe the whole mesh, then multiple calls are needed to draw the whole * painting. */ -Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapVerts, s16 mapTris, u8 alpha) { +Gfx* render_painting(u8* img, s16 tWidth, s16 tHeight, s16* textureMap, s16 mapVerts, s16 mapTris, u8 alpha) { s16 group; s16 map; s16 triGroup; @@ -836,12 +834,11 @@ Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapV s16 numVtx = mapTris * 3; s16 commands = triGroups * 2 + remGroupTris + 7; - Vtx *verts = alloc_display_list(numVtx * sizeof(Vtx)); - Gfx *dlist = alloc_display_list(commands * sizeof(Gfx)); - Gfx *gfx = dlist; + Vtx* verts = alloc_display_list(numVtx * sizeof(Vtx)); + Gfx* dlist = alloc_display_list(commands * sizeof(Gfx)); + Gfx* gfx = dlist; - if (verts == NULL || dlist == NULL) { - } + if (verts == NULL || dlist == NULL) {} gLoadBlockTexture(gfx++, tWidth, tHeight, G_IM_FMT_RGBA, img); @@ -900,17 +897,16 @@ Gfx *render_painting(u8 *img, s16 tWidth, s16 tHeight, s16 *textureMap, s16 mapV /** * Orient the painting mesh for rendering. */ -Gfx *painting_model_view_transform(struct Painting *painting) { +Gfx* painting_model_view_transform(struct Painting* painting) { f32 sizeRatio = painting->size / PAINTING_SIZE; - Mtx *rotX = alloc_display_list(sizeof(Mtx)); - Mtx *rotY = alloc_display_list(sizeof(Mtx)); - Mtx *translate = alloc_display_list(sizeof(Mtx)); - Mtx *scale = alloc_display_list(sizeof(Mtx)); - Gfx *dlist = alloc_display_list(5 * sizeof(Gfx)); - Gfx *gfx = dlist; + Mtx* rotX = alloc_display_list(sizeof(Mtx)); + Mtx* rotY = alloc_display_list(sizeof(Mtx)); + Mtx* translate = alloc_display_list(sizeof(Mtx)); + Mtx* scale = alloc_display_list(sizeof(Mtx)); + Gfx* dlist = alloc_display_list(5 * sizeof(Gfx)); + Gfx* gfx = dlist; - if (rotX == NULL || rotY == NULL || translate == NULL || dlist == NULL) { - } + if (rotX == NULL || rotY == NULL || translate == NULL || dlist == NULL) {} guTranslate(translate, painting->posX, painting->posY, painting->posZ); guRotate(rotX, painting->pitch, 1.0f, 0.0f, 0.0f); @@ -918,9 +914,9 @@ Gfx *painting_model_view_transform(struct Painting *painting) { guScale(scale, sizeRatio, sizeRatio, sizeRatio); gSPMatrix(gfx++, translate, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); - gSPMatrix(gfx++, rotX, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); - gSPMatrix(gfx++, rotY, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); - gSPMatrix(gfx++, scale, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); + gSPMatrix(gfx++, rotX, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); + gSPMatrix(gfx++, rotY, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); + gSPMatrix(gfx++, scale, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_NOPUSH); gSPEndDisplayList(gfx); return dlist; @@ -929,18 +925,18 @@ Gfx *painting_model_view_transform(struct Painting *painting) { /** * Ripple a painting that has 1 or more images that need to be mapped */ -Gfx *painting_ripple_image(struct Painting *painting) { +Gfx* painting_ripple_image(struct Painting* painting) { s16 meshVerts; s16 meshTris; s16 i; - s16 *textureMap; + s16* textureMap; s16 imageCount = painting->imageCount; s16 tWidth = painting->textureWidth; s16 tHeight = painting->textureHeight; - s16 **textureMaps = segmented_to_virtual(painting->textureMaps); - u8 **textures = segmented_to_virtual(painting->textureArray); - Gfx *dlist = alloc_display_list((imageCount + 6) * sizeof(Gfx)); - Gfx *gfx = dlist; + s16** textureMaps = segmented_to_virtual(painting->textureMaps); + u8** textures = segmented_to_virtual(painting->textureArray); + Gfx* dlist = alloc_display_list((imageCount + 6) * sizeof(Gfx)); + Gfx* gfx = dlist; if (dlist == NULL) { return dlist; @@ -956,7 +952,7 @@ Gfx *painting_ripple_image(struct Painting *painting) { meshVerts = textureMap[0]; meshTris = textureMap[meshVerts * 3 + 1]; Gfx* render = render_painting(textures[i], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha); - if(gfx != NULL){ + if (gfx != NULL) { gSPDisplayList(gfx++, render); } } @@ -973,16 +969,16 @@ Gfx *painting_ripple_image(struct Painting *painting) { /** * Ripple a painting that has 1 "environment map" texture. */ -Gfx *painting_ripple_env_mapped(struct Painting *painting) { +Gfx* painting_ripple_env_mapped(struct Painting* painting) { s16 meshVerts; s16 meshTris; - s16 *textureMap; + s16* textureMap; s16 tWidth = painting->textureWidth; s16 tHeight = painting->textureHeight; - s16 **textureMaps = segmented_to_virtual(painting->textureMaps); - u8 **tArray = segmented_to_virtual(painting->textureArray); - Gfx *dlist = alloc_display_list(7 * sizeof(Gfx)); - Gfx *gfx = dlist; + s16** textureMaps = segmented_to_virtual(painting->textureMaps); + u8** tArray = segmented_to_virtual(painting->textureArray); + Gfx* dlist = alloc_display_list(7 * sizeof(Gfx)); + Gfx* gfx = dlist; if (dlist == NULL) { return dlist; @@ -996,7 +992,8 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { textureMap = segmented_to_virtual(textureMaps[0]); meshVerts = textureMap[0]; meshTris = textureMap[meshVerts * 3 + 1]; - gSPDisplayList(gfx++, render_painting(tArray[0], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha)); + gSPDisplayList(gfx++, + render_painting(tArray[0], tWidth, tHeight, textureMap, meshVerts, meshTris, painting->alpha)); // Update the ripple, may automatically reset the painting's state. painting_update_ripple_state(painting); @@ -1011,12 +1008,12 @@ Gfx *painting_ripple_env_mapped(struct Painting *painting) { * Generates a mesh, calculates vertex normals for lighting, and renders a rippling painting. * The mesh and vertex normals are regenerated and freed every frame. */ -Gfx *display_painting_rippling(struct Painting *painting) { - s16 *mesh = segmented_to_virtual(seg2_painting_triangle_mesh); - s16 *neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris); +Gfx* display_painting_rippling(struct Painting* painting) { + s16* mesh = segmented_to_virtual(seg2_painting_triangle_mesh); + s16* neighborTris = segmented_to_virtual(seg2_painting_mesh_neighbor_tris); s16 numVtx = mesh[0]; s16 numTris = mesh[numVtx * 3 + 1]; - Gfx *dlist; + Gfx* dlist; // Generate the mesh and its lighting data painting_generate_mesh(painting, mesh, numVtx); @@ -1042,9 +1039,9 @@ Gfx *display_painting_rippling(struct Painting *painting) { /** * Render a normal painting. */ -Gfx *display_painting_not_rippling(struct Painting *painting) { - Gfx *dlist = alloc_display_list(4 * sizeof(Gfx)); - Gfx *gfx = dlist; +Gfx* display_painting_not_rippling(struct Painting* painting) { + Gfx* dlist = alloc_display_list(4 * sizeof(Gfx)); + Gfx* gfx = dlist; if (dlist == NULL) { return dlist; @@ -1059,7 +1056,7 @@ Gfx *display_painting_not_rippling(struct Painting *painting) { /** * Clear Mario-related state and clear gRipplingPainting. */ -void reset_painting(struct Painting *painting) { +void reset_painting(struct Painting* painting) { painting->lastFloor = 0; painting->currFloor = 0; painting->floorEntered = 0; @@ -1102,7 +1099,7 @@ void reset_painting(struct Painting *painting) { * 2 (0b10): set x coordinate to backPos * 3 (0b11): same as 2. Bit 0 is ignored */ -void move_ddd_painting(struct Painting *painting, f32 frontPos, f32 backPos, f32 speed) { +void move_ddd_painting(struct Painting* painting, f32 frontPos, f32 backPos, f32 speed) { // Obtain the DDD star flags u32 dddFlags = save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_DDD)); // Get the other save file flags @@ -1136,7 +1133,7 @@ void move_ddd_painting(struct Painting *painting, f32 frontPos, f32 backPos, f32 /** * Set the painting's node's layer based on its alpha */ -void set_painting_layer(struct GraphNodeGenerated *gen, struct Painting *painting) { +void set_painting_layer(struct GraphNodeGenerated* gen, struct Painting* painting) { switch (painting->alpha) { case 0xFF: // Opaque gen->fnNode.node.flags = (gen->fnNode.node.flags & 0xFF) | (LAYER_OPAQUE << 8); @@ -1150,7 +1147,7 @@ void set_painting_layer(struct GraphNodeGenerated *gen, struct Painting *paintin /** * Display either a normal painting or a rippling one depending on the painting's ripple status */ -Gfx *display_painting(struct Painting *painting) { +Gfx* display_painting(struct Painting* painting) { switch (painting->state) { case PAINTING_IDLE: return display_painting_not_rippling(painting); @@ -1165,7 +1162,7 @@ Gfx *display_painting(struct Painting *painting) { * Update function for wall paintings. * Calls a different update function depending on the painting's ripple trigger and current state. */ -void wall_painting_update(struct Painting *painting, struct Painting *paintingGroup[]) { +void wall_painting_update(struct Painting* painting, struct Painting* paintingGroup[]) { if (painting->rippleTrigger == RIPPLE_TRIGGER_PROXIMITY) { switch (painting->state) { case PAINTING_IDLE: @@ -1193,7 +1190,7 @@ void wall_painting_update(struct Painting *painting, struct Painting *paintingGr * * No floor paintings use RIPPLE_TRIGGER_PROXIMITY in the game. */ -void floor_painting_update(struct Painting *painting, struct Painting *paintingGroup[]) { +void floor_painting_update(struct Painting* painting, struct Painting* paintingGroup[]) { if (painting->rippleTrigger == RIPPLE_TRIGGER_PROXIMITY) { switch (painting->state) { case PAINTING_IDLE: @@ -1219,13 +1216,13 @@ void floor_painting_update(struct Painting *painting, struct Painting *paintingG * Render and update the painting whose id and group matches the values in the GraphNode's parameter. * Use PAINTING_ID(id, group) to set the right parameter in a level's geo layout. */ -Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *context) { - struct GraphNodeGenerated *gen = (struct GraphNodeGenerated *) node; +Gfx* geo_painting_draw(s32 callContext, struct GraphNode* node, UNUSED void* context) { + struct GraphNodeGenerated* gen = (struct GraphNodeGenerated*)node; s32 group = (gen->parameter >> 8) & 0xFF; s32 id = gen->parameter & 0xFF; - Gfx *paintingDlist = NULL; - struct Painting **paintingGroup = sPaintingGroups[group]; - struct Painting *painting = segmented_to_virtual(paintingGroup[id]); + Gfx* paintingDlist = NULL; + struct Painting** paintingGroup = sPaintingGroups[group]; + struct Painting* painting = segmented_to_virtual(paintingGroup[id]); if (callContext != GEO_CONTEXT_RENDER) { reset_painting(painting); @@ -1244,7 +1241,7 @@ Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *con // Update the painting painting_update_floors(painting); - switch ((s16) painting->pitch) { + switch ((s16)painting->pitch) { // only paintings with 0 pitch are treated as walls case 0: wall_painting_update(painting, paintingGroup); @@ -1260,8 +1257,8 @@ Gfx *geo_painting_draw(s32 callContext, struct GraphNode *node, UNUSED void *con /** * Update the painting system's local copy of Mario's current floor and position. */ -Gfx *geo_painting_update(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 c) { - struct Surface *surface; +Gfx* geo_painting_update(s32 callContext, UNUSED struct GraphNode* node, UNUSED Mat4 c) { + struct Surface* surface; // Reset the update counter if (callContext != GEO_CONTEXT_RENDER) { diff --git a/src/game/platform_displacement.c b/src/game/platform_displacement.c index a6a15f0f..27b54fbf 100644 --- a/src/game/platform_displacement.c +++ b/src/game/platform_displacement.c @@ -14,14 +14,14 @@ u16 D_8032FEC0 = 0; u32 unused_8032FEC4[4] = { 0 }; -struct Object *gMarioPlatform = NULL; +struct Object* gMarioPlatform = NULL; /** * 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) { - struct Surface *floor; + struct Surface* floor; UNUSED u8 filler[4]; f32 marioX; f32 marioY; @@ -70,7 +70,7 @@ void update_mario_platform(void) { /** * Get Mario's position and store it in x, y, and z. */ -void get_mario_pos(f32 *x, f32 *y, f32 *z) { +void get_mario_pos(f32* x, f32* y, f32* z) { *x = gMarioStates[0].pos[0]; *y = gMarioStates[0].pos[1]; *z = gMarioStates[0].pos[2]; @@ -89,7 +89,7 @@ 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 Object *platform) { +void apply_platform_displacement(u32 isMario, struct Object* platform) { f32 x; f32 y; f32 z; @@ -123,8 +123,8 @@ void apply_platform_displacement(u32 isMario, struct Object *platform) { if (rotation[0] != 0 || rotation[1] != 0 || rotation[2] != 0) { unusedPitch = rotation[0]; - unusedRoll = rotation[2]; - unusedYaw = platform->oFaceAngleYaw; + unusedRoll = rotation[2]; + unusedYaw = platform->oFaceAngleYaw; if (isMario) { gMarioStates[0].faceAngle[1] += rotation[1]; @@ -170,7 +170,7 @@ void apply_platform_displacement(u32 isMario, struct Object *platform) { * If Mario's platform is not null, apply platform displacement. */ void apply_mario_platform_displacement(void) { - struct Object *platform = gMarioPlatform; + struct Object* platform = gMarioPlatform; if (!(gTimeStopState & TIME_STOP_ACTIVE) && gMarioObject != NULL && platform != NULL) { apply_platform_displacement(TRUE, platform); diff --git a/src/game/print.c b/src/game/print.c index d9b050d2..a43dda90 100644 --- a/src/game/print.c +++ b/src/game/print.c @@ -25,7 +25,7 @@ struct TextLabel { * Stores the text to be rendered on screen * and how they are to be rendered. */ -struct TextLabel *sTextLabels[52]; +struct TextLabel* sTextLabels[52]; s16 sTextLabelsCount = 0; /** @@ -46,7 +46,7 @@ s32 int_pow(s32 n, s32 exponent) { * Formats an integer n for print by fitting it to width, prefixing with a negative, * and converting the base. */ -void format_integer(s32 n, s32 base, char *dest, s32 *totalLength, u8 width, s8 zeroPad) { +void format_integer(s32 n, s32 base, char* dest, s32* totalLength, u8 width, s8 zeroPad) { u32 powBase; s32 numDigits = 0; s32 i; @@ -72,7 +72,7 @@ void format_integer(s32 n, s32 base, char *dest, s32 *totalLength, u8 width, s8 while (TRUE) { powBase = int_pow(base, numDigits); - if (powBase > (u32) n) { + if (powBase > (u32)n) { break; } @@ -81,7 +81,8 @@ void format_integer(s32 n, s32 base, char *dest, s32 *totalLength, u8 width, s8 // Add leading pad to fit width. if (width > numDigits) { - for (len = 0; len < width - numDigits; len++) dest[len] = pad; + for (len = 0; len < width - numDigits; len++) + dest[len] = pad; // Needs 1 length to print negative prefix. if (negative == TRUE) { @@ -112,7 +113,8 @@ void format_integer(s32 n, s32 base, char *dest, s32 *totalLength, u8 width, s8 } else { // n is zero. numDigits = 1; if (width > numDigits) { - for (len = 0; len < width - numDigits; len++) dest[len] = pad; + for (len = 0; len < width - numDigits; len++) + dest[len] = pad; } dest[len] = '0'; } @@ -125,7 +127,7 @@ void format_integer(s32 n, s32 base, char *dest, s32 *totalLength, u8 width, s8 * Additionally, this determines if a number should be zero-padded, * writing to 'zeroPad'. */ -void parse_width_field(const char *str, s32 *srcIndex, u8 *width, s8 *zeroPad) { +void parse_width_field(const char* str, s32* srcIndex, u8* width, s8* zeroPad) { s8 digits[12]; // unknown length s8 digitsLen = 0; s16 i; @@ -168,7 +170,7 @@ void parse_width_field(const char *str, s32 *srcIndex, u8 *width, s8 *zeroPad) { * Warning: this fails on too large numbers, because format_integer has bugs * related to overflow. For romhacks, prefer sprintf + print_text. */ -void print_text_fmt_int(s32 x, s32 y, const char *str, s32 n) { +void print_text_fmt_int(s32 x, s32 y, const char* str, s32 n) { char c = 0; s8 zeroPad = FALSE; u8 width = 0; @@ -177,8 +179,7 @@ void print_text_fmt_int(s32 x, s32 y, const char *str, s32 n) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, - sizeof(struct TextLabel))) == NULL) { + if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct TextLabel))) == NULL) { return; } @@ -221,14 +222,13 @@ void print_text_fmt_int(s32 x, s32 y, const char *str, s32 n) { /** * Prints text in the colorful lettering at given X, Y coordinates. */ -void print_text(s32 x, s32 y, const char *str) { +void print_text(s32 x, s32 y, const char* str) { char c = 0; s32 length = 0; s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, - sizeof(struct TextLabel))) == NULL) { + if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct TextLabel))) == NULL) { return; } @@ -252,7 +252,7 @@ void print_text(s32 x, s32 y, const char *str) { /** * Prints text in the colorful lettering centered at given X, Y coordinates. */ -void print_text_centered(s32 x, s32 y, const char *str) { +void print_text_centered(s32 x, s32 y, const char* str) { char c = 0; UNUSED s8 unused1 = 0; UNUSED s32 unused2 = 0; @@ -260,8 +260,7 @@ void print_text_centered(s32 x, s32 y, const char *str) { s32 srcIndex = 0; // Don't continue if there is no memory to do so. - if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, - sizeof(struct TextLabel))) == NULL) { + if ((sTextLabels[sTextLabelsCount] = mem_pool_alloc(gEffectsMemoryPool, sizeof(struct TextLabel))) == NULL) { return; } @@ -352,11 +351,12 @@ s8 char_to_glyph_index(char c) { * Adds an individual glyph to be rendered. */ void add_glyph_texture(s8 glyphIndex) { - const u8 *const *glyphs = segmented_to_virtual(main_hud_lut); - const u8 *texture = glyphs[glyphIndex]; + const u8* const* glyphs = segmented_to_virtual(main_hud_lut); + const u8* texture = glyphs[glyphIndex]; gDPPipeSync(gDisplayListHead++); - gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, texture == NULL ? glyphs[COLOR_CHAR_STAR] : texture); + gDPSetTextureImage(gDisplayListHead++, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, + texture == NULL ? glyphs[COLOR_CHAR_STAR] : texture); gSPDisplayList(gDisplayListHead++, dl_hud_img_load_tex_block); } @@ -371,8 +371,8 @@ void render_textrect(s32 x, s32 y, s32 pos) { rectX = rectBaseX; rectY = rectBaseY; - gSPWideTextureRectangle(gDisplayListHead++, rectX << 2, rectY << 2, (rectX + 15) << 2, - (rectY + 15) << 2, G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); + gSPWideTextureRectangle(gDisplayListHead++, rectX << 2, rectY << 2, (rectX + 15) << 2, (rectY + 15) << 2, + G_TX_RENDERTILE, 0, 0, 4 << 10, 1 << 10); } /** @@ -383,7 +383,7 @@ void render_text_labels(void) { s32 i; s32 j; s8 glyphIndex; - Mtx *mtx; + Mtx* mtx; if (sTextLabelsCount == 0) { return; @@ -397,7 +397,7 @@ void render_text_labels(void) { } guOrtho(mtx, 0.0f, SCREEN_WIDTH, 0.0f, SCREEN_HEIGHT, -10.0f, 10.0f, 1.0f); - gSPPerspNormalize((Gfx *) (gDisplayListHead++), 0xFFFF); + gSPPerspNormalize((Gfx*)(gDisplayListHead++), 0xFFFF); gSPMatrix(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(mtx), G_MTX_PROJECTION | G_MTX_LOAD | G_MTX_NOPUSH); gSPDisplayList(gDisplayListHead++, dl_hud_img_begin); diff --git a/src/game/profiler.c b/src/game/profiler.c index 9869b14c..ec4a3970 100644 --- a/src/game/profiler.c +++ b/src/game/profiler.c @@ -31,7 +31,7 @@ void profiler_log_thread5_time(enum ProfilerGameEvent eventID) { // log the audio system before and after osTimes in pairs to the soundTimes array. void profiler_log_thread4_time(void) { - struct ProfilerFrameData *profiler = &gProfilerFrameData[gCurrentFrameIndex1]; + struct ProfilerFrameData* profiler = &gProfilerFrameData[gCurrentFrameIndex1]; if (profiler->numSoundTimes < ARRAY_COUNT(profiler->soundTimes)) { profiler->soundTimes[profiler->numSoundTimes++] = osGetTime(); @@ -50,7 +50,7 @@ void profiler_log_gfx_time(enum ProfilerGfxEvent eventID) { // log the times between vblank started and ended. void profiler_log_vblank_time(void) { - struct ProfilerFrameData *profiler = &gProfilerFrameData[gCurrentFrameIndex2]; + struct ProfilerFrameData* profiler = &gProfilerFrameData[gCurrentFrameIndex2]; if (profiler->numVblankTimes < ARRAY_COUNT(profiler->vblankTimes)) { profiler->vblankTimes[profiler->numVblankTimes++] = osGetTime(); @@ -98,26 +98,22 @@ void draw_reference_profiler_bars(void) { // Blue gDPPipeSync(gDisplayListHead++); - gDPSetFillColor(gDisplayListHead++, - GPACK_RGBA5551(40, 80, 255, 1) << 16 | GPACK_RGBA5551(40, 80, 255, 1)); + gDPSetFillColor(gDisplayListHead++, GPACK_RGBA5551(40, 80, 255, 1) << 16 | GPACK_RGBA5551(40, 80, 255, 1)); gDPFillRectangle(gDisplayListHead++, 30, 220, 79, 222); // Yellow gDPPipeSync(gDisplayListHead++); - gDPSetFillColor(gDisplayListHead++, - GPACK_RGBA5551(255, 255, 40, 1) << 16 | GPACK_RGBA5551(255, 255, 40, 1)); + gDPSetFillColor(gDisplayListHead++, GPACK_RGBA5551(255, 255, 40, 1) << 16 | GPACK_RGBA5551(255, 255, 40, 1)); gDPFillRectangle(gDisplayListHead++, 79, 220, 128, 222); // Orange gDPPipeSync(gDisplayListHead++); - gDPSetFillColor(gDisplayListHead++, - GPACK_RGBA5551(255, 120, 40, 1) << 16 | GPACK_RGBA5551(255, 120, 40, 1)); + gDPSetFillColor(gDisplayListHead++, GPACK_RGBA5551(255, 120, 40, 1) << 16 | GPACK_RGBA5551(255, 120, 40, 1)); gDPFillRectangle(gDisplayListHead++, 128, 220, 177, 222); // Red gDPPipeSync(gDisplayListHead++); - gDPSetFillColor(gDisplayListHead++, - GPACK_RGBA5551(255, 40, 40, 1) << 16 | GPACK_RGBA5551(255, 40, 40, 1)); + gDPSetFillColor(gDisplayListHead++, GPACK_RGBA5551(255, 40, 40, 1) << 16 | GPACK_RGBA5551(255, 40, 40, 1)); gDPFillRectangle(gDisplayListHead++, 177, 220, 226, 222); } @@ -137,7 +133,7 @@ void draw_reference_profiler_bars(void) { */ void draw_profiler_mode_1(void) { s32 i; - struct ProfilerFrameData *profiler; + struct ProfilerFrameData* profiler; OSTime clockBase; // the profiler logs 2 frames of data: last frame and current frame. Indexes are used @@ -149,17 +145,14 @@ void draw_profiler_mode_1(void) { clockBase = profiler->soundTimes[0] - (16433 * osClockRate / 1000000); // draw the profiler for the time it takes for level scripts to execute. (yellow) - draw_profiler_bar(clockBase, profiler->gameTimes[0], profiler->gameTimes[1], 212, - GPACK_RGBA5551(255, 255, 40, 1)); + draw_profiler_bar(clockBase, profiler->gameTimes[0], profiler->gameTimes[1], 212, GPACK_RGBA5551(255, 255, 40, 1)); // draw the profiler for the time it takes for the game to render (between level scripts and // pre-display lists). (orange) - draw_profiler_bar(clockBase, profiler->gameTimes[1], profiler->gameTimes[2], 212, - GPACK_RGBA5551(255, 120, 40, 1)); + draw_profiler_bar(clockBase, profiler->gameTimes[1], profiler->gameTimes[2], 212, GPACK_RGBA5551(255, 120, 40, 1)); // draw the profiler for the time it takes for the display lists to send. (blue) - draw_profiler_bar(clockBase, profiler->gameTimes[2], profiler->gameTimes[3], 212, - GPACK_RGBA5551(40, 192, 230, 1)); + draw_profiler_bar(clockBase, profiler->gameTimes[2], profiler->gameTimes[3], 212, GPACK_RGBA5551(40, 192, 230, 1)); // we need to get the amount of finished numSoundTimes pairs, so get rid of the odd bit to get the // limit of finished pairs. @@ -175,11 +168,9 @@ void draw_profiler_mode_1(void) { // it is theoretically possible they might not. In all cases, the RDP should finish later than RSP. // Thus, this is not really a bug in practice, but should still be noted that the C doesn't check // this. - draw_profiler_bar(clockBase, profiler->gfxTimes[0], profiler->gfxTimes[1], 216, - GPACK_RGBA5551(255, 255, 40, 1)); + draw_profiler_bar(clockBase, profiler->gfxTimes[0], profiler->gfxTimes[1], 216, GPACK_RGBA5551(255, 255, 40, 1)); // (orange) - draw_profiler_bar(clockBase, profiler->gfxTimes[1], profiler->gfxTimes[2], 216, - GPACK_RGBA5551(255, 120, 40, 1)); + draw_profiler_bar(clockBase, profiler->gfxTimes[1], profiler->gfxTimes[2], 216, GPACK_RGBA5551(255, 120, 40, 1)); // like earlier, toss the odd bit. profiler->numVblankTimes &= 0xFFFE; @@ -208,7 +199,7 @@ void draw_profiler_mode_1(void) { */ void draw_profiler_mode_0(void) { s32 i; - struct ProfilerFrameData *profiler; + struct ProfilerFrameData* profiler; u64 clockStart; u64 levelScriptDuration; @@ -224,8 +215,7 @@ void draw_profiler_mode_0(void) { profiler = &gProfilerFrameData[gCurrentFrameIndex1 ^ 1]; // was thread 5 ran before thread 4? set the lower one to be the clockStart. - clockStart = profiler->gameTimes[0] <= profiler->soundTimes[0] ? profiler->gameTimes[0] - : profiler->soundTimes[0]; + clockStart = profiler->gameTimes[0] <= profiler->soundTimes[0] ? profiler->gameTimes[0] : profiler->soundTimes[0]; // set variables for duration of tasks. levelScriptDuration = profiler->gameTimes[1] - clockStart; @@ -272,13 +262,11 @@ void draw_profiler_mode_0(void) { // draw level script execution duration. (yellow) clockStart += taskStart; - draw_profiler_bar(0, clockStart, clockStart + levelScriptDuration, 212, - GPACK_RGBA5551(255, 255, 40, 1)); + draw_profiler_bar(0, clockStart, clockStart + levelScriptDuration, 212, GPACK_RGBA5551(255, 255, 40, 1)); // draw render duration. (orange) clockStart += levelScriptDuration; - draw_profiler_bar(0, clockStart, clockStart + renderDuration, 212, - GPACK_RGBA5551(255, 120, 40, 1)); + draw_profiler_bar(0, clockStart, clockStart + renderDuration, 212, GPACK_RGBA5551(255, 120, 40, 1)); // Draw bottom profilers. diff --git a/src/game/rendering_graph_node.c b/src/game/rendering_graph_node.c index 08e9bcf9..dee33767 100644 --- a/src/game/rendering_graph_node.c +++ b/src/game/rendering_graph_node.c @@ -40,7 +40,7 @@ s16 gMatStackIndex; Mat4 gMatStack[32]; -Mtx *gMatStackFixed[32]; +Mtx* gMatStackFixed[32]; /** * Animation nodes have state in global variables, so this struct captures @@ -52,8 +52,8 @@ struct GeoAnimState { /*0x01*/ u8 enabled; /*0x02*/ s16 frame; /*0x04*/ f32 translationMultiplier; - /*0x08*/ u16 *attribute; - /*0x0C*/ s16 *data; + /*0x08*/ u16* attribute; + /*0x0C*/ s16* data; }; // For some reason, this is a GeoAnimState struct, but the current state consists @@ -64,10 +64,10 @@ u8 gCurrAnimType; u8 gCurrAnimEnabled; s16 gCurrAnimFrame; f32 gCurrAnimTranslationMultiplier; -u16 *gCurrAnimAttribute; -s16 *gCurrAnimData; +u16* gCurrAnimAttribute; +s16* gCurrAnimData; -struct AllocOnlyPool *gDisplayListHeap; +struct AllocOnlyPool* gDisplayListHeap; struct RenderModeContainer { u32 modes[8]; @@ -75,56 +75,56 @@ struct RenderModeContainer { /* Rendermode settings for cycle 1 for all 8 layers. */ struct RenderModeContainer renderModeTable_1Cycle[2] = { { { - G_RM_OPA_SURF, - G_RM_AA_OPA_SURF, - G_RM_AA_OPA_SURF, - G_RM_AA_OPA_SURF, - G_RM_AA_TEX_EDGE, - G_RM_AA_XLU_SURF, - G_RM_AA_XLU_SURF, - G_RM_AA_XLU_SURF, - } }, - { { - /* z-buffered */ - G_RM_ZB_OPA_SURF, - G_RM_AA_ZB_OPA_SURF, - G_RM_AA_ZB_OPA_DECAL, - G_RM_AA_ZB_OPA_INTER, - G_RM_AA_ZB_TEX_EDGE, - G_RM_AA_ZB_XLU_SURF, - G_RM_AA_ZB_XLU_DECAL, - G_RM_AA_ZB_XLU_INTER, - } } }; + G_RM_OPA_SURF, + G_RM_AA_OPA_SURF, + G_RM_AA_OPA_SURF, + G_RM_AA_OPA_SURF, + G_RM_AA_TEX_EDGE, + G_RM_AA_XLU_SURF, + G_RM_AA_XLU_SURF, + G_RM_AA_XLU_SURF, + } }, + { { + /* z-buffered */ + G_RM_ZB_OPA_SURF, + G_RM_AA_ZB_OPA_SURF, + G_RM_AA_ZB_OPA_DECAL, + G_RM_AA_ZB_OPA_INTER, + G_RM_AA_ZB_TEX_EDGE, + G_RM_AA_ZB_XLU_SURF, + G_RM_AA_ZB_XLU_DECAL, + G_RM_AA_ZB_XLU_INTER, + } } }; /* Rendermode settings for cycle 2 for all 8 layers. */ struct RenderModeContainer renderModeTable_2Cycle[2] = { { { - G_RM_OPA_SURF2, - G_RM_AA_OPA_SURF2, - G_RM_AA_OPA_SURF2, - G_RM_AA_OPA_SURF2, - G_RM_AA_TEX_EDGE2, - G_RM_AA_XLU_SURF2, - G_RM_AA_XLU_SURF2, - G_RM_AA_XLU_SURF2, - } }, - { { - /* z-buffered */ - G_RM_ZB_OPA_SURF2, - G_RM_AA_ZB_OPA_SURF2, - G_RM_AA_ZB_OPA_DECAL2, - G_RM_AA_ZB_OPA_INTER2, - G_RM_AA_ZB_TEX_EDGE2, - G_RM_AA_ZB_XLU_SURF2, - G_RM_AA_ZB_XLU_DECAL2, - G_RM_AA_ZB_XLU_INTER2, - } } }; + G_RM_OPA_SURF2, + G_RM_AA_OPA_SURF2, + G_RM_AA_OPA_SURF2, + G_RM_AA_OPA_SURF2, + G_RM_AA_TEX_EDGE2, + G_RM_AA_XLU_SURF2, + G_RM_AA_XLU_SURF2, + G_RM_AA_XLU_SURF2, + } }, + { { + /* z-buffered */ + G_RM_ZB_OPA_SURF2, + G_RM_AA_ZB_OPA_SURF2, + G_RM_AA_ZB_OPA_DECAL2, + G_RM_AA_ZB_OPA_INTER2, + G_RM_AA_ZB_TEX_EDGE2, + G_RM_AA_ZB_XLU_SURF2, + G_RM_AA_ZB_XLU_DECAL2, + G_RM_AA_ZB_XLU_INTER2, + } } }; -struct GraphNodeRoot *gCurGraphNodeRoot = NULL; -struct GraphNodeMasterList *gCurGraphNodeMasterList = NULL; -struct GraphNodePerspective *gCurGraphNodeCamFrustum = NULL; -struct GraphNodeCamera *gCurGraphNodeCamera = NULL; -struct GraphNodeObject *gCurGraphNodeObject = NULL; -struct GraphNodeHeldObject *gCurGraphNodeHeldObject = NULL; +struct GraphNodeRoot* gCurGraphNodeRoot = NULL; +struct GraphNodeMasterList* gCurGraphNodeMasterList = NULL; +struct GraphNodePerspective* gCurGraphNodeCamFrustum = NULL; +struct GraphNodeCamera* gCurGraphNodeCamera = NULL; +struct GraphNodeObject* gCurGraphNodeObject = NULL; +struct GraphNodeHeldObject* gCurGraphNodeHeldObject = NULL; u16 gAreaUpdateCounter = 0; #ifdef F3DEX_GBI_2 @@ -134,12 +134,12 @@ LookAt lookAt; /** * Process a master list node. */ -static void geo_process_master_list_sub(struct GraphNodeMasterList *node) { - struct DisplayListNode *currList; +static void geo_process_master_list_sub(struct GraphNodeMasterList* node) { + struct DisplayListNode* currList; s32 i; s32 enableZBuffer = (node->node.flags & GRAPH_RENDER_Z_BUFFER) != 0; - struct RenderModeContainer *modeList = &renderModeTable_1Cycle[enableZBuffer]; - struct RenderModeContainer *mode2List = &renderModeTable_2Cycle[enableZBuffer]; + struct RenderModeContainer* modeList = &renderModeTable_1Cycle[enableZBuffer]; + struct RenderModeContainer* mode2List = &renderModeTable_2Cycle[enableZBuffer]; FrameInterpolation_RecordOpenChild("geo_process_master_list_sub", node); // @bug This is where the LookAt values should be calculated but aren't. @@ -178,14 +178,13 @@ static void geo_process_master_list_sub(struct GraphNodeMasterList *node) { * parameter. Look at the RenderModeContainer struct to see the corresponding * render modes of layers. */ -static void geo_append_display_list(void *displayList, s16 layer) { +static void geo_append_display_list(void* displayList, s16 layer) { #ifdef F3DEX_GBI_2 gSPLookAt(gDisplayListHead++, &lookAt); #endif if (gCurGraphNodeMasterList != 0) { FrameInterpolation_RecordOpenChild("geo_append_display_list", displayList); - struct DisplayListNode *listNode = - alloc_only_pool_alloc(gDisplayListHeap, sizeof(struct DisplayListNode)); + struct DisplayListNode* listNode = alloc_only_pool_alloc(gDisplayListHeap, sizeof(struct DisplayListNode)); listNode->transform = gMatStackFixed[gMatStackIndex]; listNode->displayList = displayList; @@ -203,7 +202,7 @@ static void geo_append_display_list(void *displayList, s16 layer) { /** * Process the master list node. */ -static void geo_process_master_list(struct GraphNodeMasterList *node) { +static void geo_process_master_list(struct GraphNodeMasterList* node) { s32 i; UNUSED s32 sp1C; @@ -223,9 +222,9 @@ static void geo_process_master_list(struct GraphNodeMasterList *node) { /** * Process an orthographic projection node. */ -static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node) { +static void geo_process_ortho_projection(struct GraphNodeOrthoProjection* node) { if (node->node.children != NULL) { - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); f32 left = (gCurGraphNodeRoot->x - gCurGraphNodeRoot->width) / 2.0f * node->scale; f32 right = (gCurGraphNodeRoot->x + gCurGraphNodeRoot->width) / 2.0f * node->scale; f32 top = (gCurGraphNodeRoot->y - gCurGraphNodeRoot->height) / 2.0f * node->scale; @@ -244,7 +243,7 @@ static void geo_process_ortho_projection(struct GraphNodeOrthoProjection *node) /** * Process a perspective projection node. */ -static void geo_process_perspective(struct GraphNodePerspective *node) { +static void geo_process_perspective(struct GraphNodePerspective* node) { if (node->fnNode.func != NULL) { FrameInterpolation_RecordOpenChild("geo_process_perspective", (uintptr_t)node); node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, gMatStack[gMatStackIndex]); @@ -252,13 +251,13 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { } if (node->fnNode.node.children != NULL) { u16 perspNorm; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_perspective_children", (uintptr_t)node); #ifdef VERSION_EU - f32 aspect = ((f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height) * 1.1f; + f32 aspect = ((f32)gCurGraphNodeRoot->width / (f32)gCurGraphNodeRoot->height) * 1.1f; #else - f32 aspect = (f32) gCurGraphNodeRoot->width / (f32) gCurGraphNodeRoot->height; + f32 aspect = (f32)gCurGraphNodeRoot->width / (f32)gCurGraphNodeRoot->height; #endif guPerspective(mtx, &perspNorm, node->fov, aspect, node->near, node->far, 1.0f); gSPPerspNormalize(gDisplayListHead++, perspNorm); @@ -278,17 +277,17 @@ static void geo_process_perspective(struct GraphNodePerspective *node) { * of this node are only processed if that distance is within the render * range of this node. */ -static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) { +static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail* node) { #ifdef GBI_FLOATS - Mtx *mtx = gMatStackFixed[gMatStackIndex]; - s16 distanceFromCam = (s32) -mtx->mf[3][2]; // z-component of the translation column + Mtx* mtx = gMatStackFixed[gMatStackIndex]; + s16 distanceFromCam = (s32)-mtx->mf[3][2]; // z-component of the translation column #else // The fixed point Mtx type is defined as 16 longs, but it's actually 16 // shorts for the integer parts followed by 16 shorts for the fraction parts - Mtx *mtx = gMatStackFixed[gMatStackIndex]; + Mtx* mtx = gMatStackFixed[gMatStackIndex]; s16 distanceFromCam = -GET_HIGH_S16_OF_32(mtx->m[1][3]); // z-component of the translation column #endif - if(CVarGetInteger("gDisableLOD", 0) == 1) { + if (CVarGetInteger("gDisableLOD", 0) == 1) { distanceFromCam = 0; } @@ -306,8 +305,8 @@ static void geo_process_level_of_detail(struct GraphNodeLevelOfDetail *node) { * if it is 0, and among the node's children, only the selected child is * processed next. */ -static void geo_process_switch(struct GraphNodeSwitchCase *node) { - struct GraphNode *selectedChild = node->fnNode.node.children; +static void geo_process_switch(struct GraphNodeSwitchCase* node) { + struct GraphNode* selectedChild = node->fnNode.node.children; s32 i; FrameInterpolation_RecordOpenChild("geo_process_switch", (uintptr_t)node); if (node->fnNode.func != NULL) { @@ -325,10 +324,10 @@ static void geo_process_switch(struct GraphNodeSwitchCase *node) { /** * Process a camera node. */ -static void geo_process_camera(struct GraphNodeCamera *node) { +static void geo_process_camera(struct GraphNodeCamera* node) { Mat4 cameraTransform; - Mtx *rollMtx = alloc_display_list(sizeof(*rollMtx)); - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* rollMtx = alloc_display_list(sizeof(*rollMtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_camera", (uintptr_t)node); @@ -360,10 +359,10 @@ static void geo_process_camera(struct GraphNodeCamera *node) { * the float and fixed point matrix stacks. * For the rest it acts as a normal display list node. */ -static void geo_process_translation_rotation(struct GraphNodeTranslationRotation *node) { +static void geo_process_translation_rotation(struct GraphNodeTranslationRotation* node) { Mat4 mtxf; Vec3f translation; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_translation_rotation", TAG_OBJECT(node)); vec3s_to_vec3f(translation, node->translation); @@ -387,10 +386,10 @@ static void geo_process_translation_rotation(struct GraphNodeTranslationRotation * translation is created and pushed on both the float and fixed point matrix stacks. * For the rest it acts as a normal display list node. */ -static void geo_process_translation(struct GraphNodeTranslation *node) { +static void geo_process_translation(struct GraphNodeTranslation* node) { Mat4 mtxf; Vec3f translation; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_translation", (uintptr_t)node); @@ -415,9 +414,9 @@ static void geo_process_translation(struct GraphNodeTranslation *node) { * rotation is created and pushed on both the float and fixed point matrix stacks. * For the rest it acts as a normal display list node. */ -static void geo_process_rotation(struct GraphNodeRotation *node) { +static void geo_process_rotation(struct GraphNodeRotation* node) { Mat4 mtxf; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_rotation", (uintptr_t)node); @@ -441,10 +440,10 @@ static void geo_process_rotation(struct GraphNodeRotation *node) { * scale is created and pushed on both the float and fixed point matrix stacks. * For the rest it acts as a normal display list node. */ -static void geo_process_scale(struct GraphNodeScale *node) { +static void geo_process_scale(struct GraphNodeScale* node) { UNUSED Mat4 transform; Vec3f scaleVec; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_scale", (uintptr_t)node); @@ -469,22 +468,20 @@ static void geo_process_scale(struct GraphNodeScale *node) { * point matrix stacks. * For the rest it acts as a normal display list node. */ -static void geo_process_billboard(struct GraphNodeBillboard *node) { +static void geo_process_billboard(struct GraphNodeBillboard* node) { Vec3f translation; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_billboard", (uintptr_t)node); gMatStackIndex++; vec3s_to_vec3f(translation, node->translation); - mtxf_billboard(gMatStack[gMatStackIndex], gMatStack[gMatStackIndex - 1], translation, - gCurGraphNodeCamera->roll); + mtxf_billboard(gMatStack[gMatStackIndex], gMatStack[gMatStackIndex - 1], translation, gCurGraphNodeCamera->roll); if (gCurGraphNodeHeldObject != NULL) { mtxf_scale_vec3f(gMatStack[gMatStackIndex], gMatStack[gMatStackIndex], gCurGraphNodeHeldObject->objNode->header.gfx.scale); } else if (gCurGraphNodeObject != NULL) { - mtxf_scale_vec3f(gMatStack[gMatStackIndex], gMatStack[gMatStackIndex], - gCurGraphNodeObject->scale); + mtxf_scale_vec3f(gMatStack[gMatStackIndex], gMatStack[gMatStackIndex], gCurGraphNodeObject->scale); } mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]); @@ -504,7 +501,7 @@ static void geo_process_billboard(struct GraphNodeBillboard *node) { * a transformation on the stack, so all transformations are inherited from the * parent node. It processes its children if it has them. */ -static void geo_process_display_list(struct GraphNodeDisplayList *node) { +static void geo_process_display_list(struct GraphNodeDisplayList* node) { FrameInterpolation_RecordOpenChild("geo_process_display_list", (uintptr_t)node); if (node->displayList != NULL) { geo_append_display_list(node->displayList, node->node.flags >> 8); @@ -519,14 +516,14 @@ static void geo_process_display_list(struct GraphNodeDisplayList *node) { * Process a generated list. Instead of storing a pointer to a display list, * the list is generated on the fly by a function. */ -static void geo_process_generated_list(struct GraphNodeGenerated *node) { +static void geo_process_generated_list(struct GraphNodeGenerated* node) { if (node->fnNode.func != NULL) { - Gfx *list = node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, - (struct AllocOnlyPool *) gMatStack[gMatStackIndex]); + Gfx* list = + node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, (struct AllocOnlyPool*)gMatStack[gMatStackIndex]); if (list != NULL) { FrameInterpolation_RecordOpenChild("geo_process_generated_list", (uintptr_t)node); - geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8); + geo_append_display_list((void*)VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8); FrameInterpolation_RecordCloseChild(); } } @@ -542,35 +539,35 @@ static void geo_process_generated_list(struct GraphNodeGenerated *node) { * the function of the node. If that function is null or returns null, a black * rectangle is drawn instead. */ -static void geo_process_background(struct GraphNodeBackground *node) { - Gfx *list = NULL; +static void geo_process_background(struct GraphNodeBackground* node) { + Gfx* list = NULL; FrameInterpolation_RecordOpenChild("geo_process_background", (uintptr_t)node); if (node->fnNode.func != NULL) { - list = node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, - (struct AllocOnlyPool *) gMatStack[gMatStackIndex]); + list = + node->fnNode.func(GEO_CONTEXT_RENDER, &node->fnNode.node, (struct AllocOnlyPool*)gMatStack[gMatStackIndex]); } if (list != NULL) { - geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8); + geo_append_display_list((void*)VIRTUAL_TO_PHYSICAL(list), node->fnNode.node.flags >> 8); } else if (gCurGraphNodeMasterList != NULL) { #ifndef F3DEX_GBI_2E - Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 7); + Gfx* gfxStart = alloc_display_list(sizeof(Gfx) * 7); #else - Gfx *gfxStart = alloc_display_list(sizeof(Gfx) * 8); + Gfx* gfxStart = alloc_display_list(sizeof(Gfx) * 8); #endif - Gfx *gfx = gfxStart; + Gfx* gfx = gfxStart; gDPPipeSync(gfx++); gDPSetCycleType(gfx++, G_CYC_FILL); gDPSetFillColor(gfx++, node->background); gDPFillWideRectangle(gfx++, GFX_DIMENSIONS_RECT_FROM_LEFT_EDGE(0), BORDER_HEIGHT, - GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(0) - 1, SCREEN_HEIGHT - BORDER_HEIGHT - 1); + GFX_DIMENSIONS_RECT_FROM_RIGHT_EDGE(0) - 1, SCREEN_HEIGHT - BORDER_HEIGHT - 1); gDPPipeSync(gfx++); gDPSetCycleType(gfx++, G_CYC_1CYCLE); gSPEndDisplayList(gfx++); - geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(gfxStart), 0); + geo_append_display_list((void*)VIRTUAL_TO_PHYSICAL(gfxStart), 0); } if (node->fnNode.node.children != NULL) { geo_process_node_and_siblings(node->fnNode.node.children); @@ -582,39 +579,36 @@ static void geo_process_background(struct GraphNodeBackground *node) { * Render an animated part. The current animation state is not part of the node * but set in global variables. If an animated part is skipped, everything afterwards desyncs. */ -static void geo_process_animated_part(struct GraphNodeAnimatedPart *node) { +static void geo_process_animated_part(struct GraphNodeAnimatedPart* node) { Mat4 matrix; Vec3s rotation; Vec3f translation; - Mtx *matrixPtr = alloc_display_list(sizeof(*matrixPtr)); + Mtx* matrixPtr = alloc_display_list(sizeof(*matrixPtr)); FrameInterpolation_RecordOpenChild("geo_process_animated_part", (uintptr_t)node); vec3s_copy(rotation, gVec3sZero); vec3f_set(translation, node->translation[0], node->translation[1], node->translation[2]); if (gCurrAnimType == ANIM_TYPE_TRANSLATION) { - translation[0] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier; - translation[1] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier; - translation[2] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier; + translation[0] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier; + translation[1] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier; + translation[2] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier; gCurrAnimType = ANIM_TYPE_ROTATION; } else { if (gCurrAnimType == ANIM_TYPE_LATERAL_TRANSLATION) { - translation[0] += - gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier; + translation[0] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier; gCurrAnimAttribute += 2; - translation[2] += - gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier; + translation[2] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier; gCurrAnimType = ANIM_TYPE_ROTATION; } else { if (gCurrAnimType == ANIM_TYPE_VERTICAL_TRANSLATION) { gCurrAnimAttribute += 2; - translation[1] += - gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier; + translation[1] += gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier; gCurrAnimAttribute += 2; gCurrAnimType = ANIM_TYPE_ROTATION; } else if (gCurrAnimType == ANIM_TYPE_NO_TRANSLATION) { @@ -648,8 +642,8 @@ static void geo_process_animated_part(struct GraphNodeAnimatedPart *node) { * Initialize the animation-related global variables for the currently drawn * object's animation. */ -void geo_set_animation_globals(struct AnimInfo *node, s32 hasAnimation) { - struct Animation *anim = node->curAnim; +void geo_set_animation_globals(struct AnimInfo* node, s32 hasAnimation) { + struct Animation* anim = node->curAnim; FrameInterpolation_RecordOpenChild("geo_set_animation_globals", (uintptr_t)node); @@ -669,13 +663,13 @@ void geo_set_animation_globals(struct AnimInfo *node, s32 hasAnimation) { gCurrAnimFrame = node->animFrame; gCurrAnimEnabled = (anim->flags & ANIM_FLAG_5) == 0; - gCurrAnimAttribute = segmented_to_virtual((void *) anim->index); - gCurrAnimData = segmented_to_virtual((void *) anim->values); + gCurrAnimAttribute = segmented_to_virtual((void*)anim->index); + gCurrAnimData = segmented_to_virtual((void*)anim->values); if (anim->animYTransDivisor == 0) { gCurrAnimTranslationMultiplier = 1.0f; } else { - gCurrAnimTranslationMultiplier = (f32) node->animYTrans / (f32) anim->animYTransDivisor; + gCurrAnimTranslationMultiplier = (f32)node->animYTrans / (f32)anim->animYTransDivisor; } FrameInterpolation_RecordCloseChild(); } @@ -685,8 +679,8 @@ void geo_set_animation_globals(struct AnimInfo *node, s32 hasAnimation) { * translation of the first animated component and rotated according to * the floor below it. */ -static void geo_process_shadow(struct GraphNodeShadow *node) { - Gfx *shadowList; +static void geo_process_shadow(struct GraphNodeShadow* node) { + Gfx* shadowList; Mat4 mtxf; Vec3f shadowPos; Vec3f animOffset; @@ -694,14 +688,13 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { f32 shadowScale; f32 sinAng; f32 cosAng; - struct GraphNode *geo; - Mtx *mtx; + struct GraphNode* geo; + Mtx* mtx; if (gCurGraphNodeCamera != NULL && gCurGraphNodeObject != NULL) { FrameInterpolation_RecordOpenChild("geo_process_shadow", (uintptr_t)node); if (gCurGraphNodeHeldObject != NULL) { - get_pos_from_transform_mtx(shadowPos, gMatStack[gMatStackIndex], - *gCurGraphNodeCamera->matrixPtr); + get_pos_from_transform_mtx(shadowPos, gMatStack[gMatStackIndex], *gCurGraphNodeCamera->matrixPtr); shadowScale = node->shadowScale; } else { vec3f_copy(shadowPos, gCurGraphNodeObject->pos); @@ -710,20 +703,17 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { objScale = 1.0f; if (gCurrAnimEnabled) { - if (gCurrAnimType == ANIM_TYPE_TRANSLATION - || gCurrAnimType == ANIM_TYPE_LATERAL_TRANSLATION) { + if (gCurrAnimType == ANIM_TYPE_TRANSLATION || gCurrAnimType == ANIM_TYPE_LATERAL_TRANSLATION) { geo = node->node.children; if (geo != NULL && geo->type == GRAPH_NODE_TYPE_SCALE) { - objScale = ((struct GraphNodeScale *) geo)->scale; + objScale = ((struct GraphNodeScale*)geo)->scale; } - animOffset[0] = - gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier * objScale; + animOffset[0] = gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier * objScale; animOffset[1] = 0.0f; gCurrAnimAttribute += 2; - animOffset[2] = - gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] - * gCurrAnimTranslationMultiplier * objScale; + animOffset[2] = gCurrAnimData[retrieve_animation_index(gCurrAnimFrame, &gCurrAnimAttribute)] * + gCurrAnimTranslationMultiplier * objScale; gCurrAnimAttribute -= 6; // simple matrix rotation so the shadow offset rotates along with the object @@ -745,11 +735,11 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]); gMatStackFixed[gMatStackIndex] = mtx; if (gShadowAboveWaterOrLava == TRUE) { - geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(shadowList), 4); + geo_append_display_list((void*)VIRTUAL_TO_PHYSICAL(shadowList), 4); } else if (gMarioOnIceOrCarpet == 1) { - geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(shadowList), 5); + geo_append_display_list((void*)VIRTUAL_TO_PHYSICAL(shadowList), 5); } else { - geo_append_display_list((void *) VIRTUAL_TO_PHYSICAL(shadowList), 6); + geo_append_display_list((void*)VIRTUAL_TO_PHYSICAL(shadowList), 6); } gMatStackIndex--; } @@ -793,10 +783,10 @@ static void geo_process_shadow(struct GraphNodeShadow *node) { * * Since (0,0,0) is unaffected by rotation, columns 0, 1 and 2 are ignored. */ -static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { +static s32 obj_is_in_view(struct GraphNodeObject* node, Mat4 matrix) { s16 cullingRadius; s16 halfFov; // half of the fov in in-game angle units instead of degrees - struct GraphNode *geo; + struct GraphNode* geo; f32 hScreenEdge; if (node->node.flags & GRAPH_RENDER_INVISIBLE) { @@ -819,8 +809,7 @@ static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { hScreenEdge *= GFX_DIMENSIONS_ASPECT_RATIO; if (geo != NULL && geo->type == GRAPH_NODE_TYPE_CULLING_RADIUS) { - cullingRadius = - (f32)((struct GraphNodeCullingRadius *) geo)->cullingRadius; //! Why is there a f32 cast? + cullingRadius = (f32)((struct GraphNodeCullingRadius*)geo)->cullingRadius; //! Why is there a f32 cast? } else { cullingRadius = 300; } @@ -851,7 +840,7 @@ static s32 obj_is_in_view(struct GraphNodeObject *node, Mat4 matrix) { /** * Process an object node. */ -static void geo_process_object(struct Object *node) { +static void geo_process_object(struct Object* node) { Mat4 mtxf; s32 hasAnimation = (node->header.gfx.node.flags & GRAPH_RENDER_HAS_ANIMATION) != 0; @@ -859,18 +848,16 @@ static void geo_process_object(struct Object *node) { if (node->header.gfx.areaIndex == gCurGraphNodeRoot->areaIndex) { if (node->header.gfx.throwMatrix != NULL) { - mtxf_mul(gMatStack[gMatStackIndex + 1], *node->header.gfx.throwMatrix, - gMatStack[gMatStackIndex]); + mtxf_mul(gMatStack[gMatStackIndex + 1], *node->header.gfx.throwMatrix, gMatStack[gMatStackIndex]); } else if (node->header.gfx.node.flags & GRAPH_RENDER_BILLBOARD) { - mtxf_billboard(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex], - node->header.gfx.pos, gCurGraphNodeCamera->roll); + mtxf_billboard(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex], node->header.gfx.pos, + gCurGraphNodeCamera->roll); } else { mtxf_rotate_zxy_and_translate(mtxf, node->header.gfx.pos, node->header.gfx.angle); mtxf_mul(gMatStack[gMatStackIndex + 1], mtxf, gMatStack[gMatStackIndex]); } - mtxf_scale_vec3f(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex + 1], - node->header.gfx.scale); + mtxf_scale_vec3f(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex + 1], node->header.gfx.scale); node->header.gfx.throwMatrix = &gMatStack[++gMatStackIndex]; node->header.gfx.cameraToObject[0] = gMatStack[gMatStackIndex][3][0]; node->header.gfx.cameraToObject[1] = gMatStack[gMatStackIndex][3][1]; @@ -881,12 +868,12 @@ static void geo_process_object(struct Object *node) { geo_set_animation_globals(&node->header.gfx.animInfo, hasAnimation); } if (obj_is_in_view(&node->header.gfx, gMatStack[gMatStackIndex])) { - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]); gMatStackFixed[gMatStackIndex] = mtx; if (node->header.gfx.sharedChild != NULL) { - gCurGraphNodeObject = (struct GraphNodeObject *) node; + gCurGraphNodeObject = (struct GraphNodeObject*)node; node->header.gfx.sharedChild->parent = &node->header.gfx.node; geo_process_node_and_siblings(node->header.gfx.sharedChild); node->header.gfx.sharedChild->parent = NULL; @@ -909,10 +896,10 @@ static void geo_process_object(struct Object *node) { * the subtree rooted at 'sharedChild' and processes the subtree, after which the * actual children are be processed. (in practice they are null though) */ -static void geo_process_object_parent(struct GraphNodeObjectParent *node) { +static void geo_process_object_parent(struct GraphNodeObjectParent* node) { if (node->sharedChild != NULL) { FrameInterpolation_RecordOpenChild("geo_process_object_parent", (uintptr_t)node); - node->sharedChild->parent = (struct GraphNode *) node; + node->sharedChild->parent = (struct GraphNode*)node; geo_process_node_and_siblings(node->sharedChild); node->sharedChild->parent = NULL; FrameInterpolation_RecordCloseChild(); @@ -927,10 +914,10 @@ static void geo_process_object_parent(struct GraphNodeObjectParent *node) { /** * Process a held object node. */ -void geo_process_held_object(struct GraphNodeHeldObject *node) { +void geo_process_held_object(struct GraphNodeHeldObject* node) { Mat4 mat; Vec3f translation; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); FrameInterpolation_RecordOpenChild("geo_process_held_object", (uintptr_t)node); #ifdef F3DEX_GBI_2 @@ -953,11 +940,10 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { gMatStack[gMatStackIndex + 1][3][1] = gMatStack[gMatStackIndex][3][1]; gMatStack[gMatStackIndex + 1][3][2] = gMatStack[gMatStackIndex][3][2]; mtxf_mul(gMatStack[gMatStackIndex + 1], mat, gMatStack[gMatStackIndex + 1]); - mtxf_scale_vec3f(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex + 1], - node->objNode->header.gfx.scale); + mtxf_scale_vec3f(gMatStack[gMatStackIndex + 1], gMatStack[gMatStackIndex + 1], node->objNode->header.gfx.scale); if (node->fnNode.func != NULL) { node->fnNode.func(GEO_CONTEXT_HELD_OBJ, &node->fnNode.node, - (struct AllocOnlyPool *) gMatStack[gMatStackIndex + 1]); + (struct AllocOnlyPool*)gMatStack[gMatStackIndex + 1]); } gMatStackIndex++; mtxf_to_mtx(mtx, gMatStack[gMatStackIndex]); @@ -969,7 +955,7 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { gGeoTempState.attribute = gCurrAnimAttribute; gGeoTempState.data = gCurrAnimData; gCurrAnimType = 0; - gCurGraphNodeHeldObject = (void *) node; + gCurGraphNodeHeldObject = (void*)node; if (node->objNode->header.gfx.animInfo.curAnim != NULL) { geo_set_animation_globals(&node->objNode->header.gfx.animInfo, hasAnimation); } @@ -994,7 +980,7 @@ void geo_process_held_object(struct GraphNodeHeldObject *node) { /** * Processes the children of the given GraphNode if it has any */ -void geo_try_process_children(struct GraphNode *node) { +void geo_try_process_children(struct GraphNode* node) { if (node->children != NULL) { geo_process_node_and_siblings(node->children); } @@ -1005,10 +991,10 @@ void geo_try_process_children(struct GraphNode *node) { * The first argument is the start node, and all its siblings will * be iterated over. */ -void geo_process_node_and_siblings(struct GraphNode *firstNode) { +void geo_process_node_and_siblings(struct GraphNode* firstNode) { s16 iterateChildren = TRUE; - struct GraphNode *curGraphNode = firstNode; - struct GraphNode *parent = curGraphNode->parent; + struct GraphNode* curGraphNode = firstNode; + struct GraphNode* parent = curGraphNode->parent; // In the case of a switch node, exactly one of the children of the node is // processed instead of all children like usual @@ -1023,71 +1009,70 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) { } else { switch (curGraphNode->type) { case GRAPH_NODE_TYPE_ORTHO_PROJECTION: - geo_process_ortho_projection((struct GraphNodeOrthoProjection *) curGraphNode); + geo_process_ortho_projection((struct GraphNodeOrthoProjection*)curGraphNode); break; case GRAPH_NODE_TYPE_PERSPECTIVE: - geo_process_perspective((struct GraphNodePerspective *) curGraphNode); + geo_process_perspective((struct GraphNodePerspective*)curGraphNode); break; case GRAPH_NODE_TYPE_MASTER_LIST: - geo_process_master_list((struct GraphNodeMasterList *) curGraphNode); + geo_process_master_list((struct GraphNodeMasterList*)curGraphNode); break; case GRAPH_NODE_TYPE_LEVEL_OF_DETAIL: - geo_process_level_of_detail((struct GraphNodeLevelOfDetail *) curGraphNode); + geo_process_level_of_detail((struct GraphNodeLevelOfDetail*)curGraphNode); break; case GRAPH_NODE_TYPE_SWITCH_CASE: - geo_process_switch((struct GraphNodeSwitchCase *) curGraphNode); + geo_process_switch((struct GraphNodeSwitchCase*)curGraphNode); break; case GRAPH_NODE_TYPE_CAMERA: - geo_process_camera((struct GraphNodeCamera *) curGraphNode); + geo_process_camera((struct GraphNodeCamera*)curGraphNode); break; case GRAPH_NODE_TYPE_TRANSLATION_ROTATION: - geo_process_translation_rotation( - (struct GraphNodeTranslationRotation *) curGraphNode); + geo_process_translation_rotation((struct GraphNodeTranslationRotation*)curGraphNode); break; case GRAPH_NODE_TYPE_TRANSLATION: - geo_process_translation((struct GraphNodeTranslation *) curGraphNode); + geo_process_translation((struct GraphNodeTranslation*)curGraphNode); break; case GRAPH_NODE_TYPE_ROTATION: - geo_process_rotation((struct GraphNodeRotation *) curGraphNode); + geo_process_rotation((struct GraphNodeRotation*)curGraphNode); break; case GRAPH_NODE_TYPE_OBJECT: - geo_process_object((struct Object *) curGraphNode); + geo_process_object((struct Object*)curGraphNode); break; case GRAPH_NODE_TYPE_ANIMATED_PART: - geo_process_animated_part((struct GraphNodeAnimatedPart *) curGraphNode); + geo_process_animated_part((struct GraphNodeAnimatedPart*)curGraphNode); break; case GRAPH_NODE_TYPE_BILLBOARD: - geo_process_billboard((struct GraphNodeBillboard *) curGraphNode); + geo_process_billboard((struct GraphNodeBillboard*)curGraphNode); break; case GRAPH_NODE_TYPE_DISPLAY_LIST: - geo_process_display_list((struct GraphNodeDisplayList *) curGraphNode); + geo_process_display_list((struct GraphNodeDisplayList*)curGraphNode); break; case GRAPH_NODE_TYPE_SCALE: - geo_process_scale((struct GraphNodeScale *) curGraphNode); + geo_process_scale((struct GraphNodeScale*)curGraphNode); break; case GRAPH_NODE_TYPE_SHADOW: - geo_process_shadow((struct GraphNodeShadow *) curGraphNode); + geo_process_shadow((struct GraphNodeShadow*)curGraphNode); break; case GRAPH_NODE_TYPE_OBJECT_PARENT: - geo_process_object_parent((struct GraphNodeObjectParent *) curGraphNode); + geo_process_object_parent((struct GraphNodeObjectParent*)curGraphNode); break; case GRAPH_NODE_TYPE_GENERATED_LIST: - geo_process_generated_list((struct GraphNodeGenerated *) curGraphNode); + geo_process_generated_list((struct GraphNodeGenerated*)curGraphNode); break; case GRAPH_NODE_TYPE_BACKGROUND: - geo_process_background((struct GraphNodeBackground *) curGraphNode); + geo_process_background((struct GraphNodeBackground*)curGraphNode); break; case GRAPH_NODE_TYPE_HELD_OBJ: - geo_process_held_object((struct GraphNodeHeldObject *) curGraphNode); + geo_process_held_object((struct GraphNodeHeldObject*)curGraphNode); break; default: - geo_try_process_children((struct GraphNode *) curGraphNode); + geo_try_process_children((struct GraphNode*)curGraphNode); break; } } } else { if (curGraphNode->type == GRAPH_NODE_TYPE_OBJECT) { - ((struct GraphNodeObject *) curGraphNode)->throwMatrix = NULL; + ((struct GraphNodeObject*)curGraphNode)->throwMatrix = NULL; } } } while (iterateChildren && (curGraphNode = curGraphNode->next) != firstNode); @@ -1098,16 +1083,15 @@ void geo_process_node_and_siblings(struct GraphNode *firstNode) { * The root node itself sets up the viewport, then all its children are processed * to set up the projection and draw display lists. */ -void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) { +void geo_process_root(struct GraphNodeRoot* node, Vp* b, Vp* c, s32 clearColor) { UNUSED s32 unused; if (node->node.flags & GRAPH_RENDER_ACTIVE) { FrameInterpolation_RecordOpenChild("geo_process_root", (uintptr_t)node->nodeId); - Mtx *initialMatrix; - Vp *viewport = alloc_display_list(sizeof(*viewport)); + Mtx* initialMatrix; + Vp* viewport = alloc_display_list(sizeof(*viewport)); - gDisplayListHeap = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), - MEMORY_POOL_LEFT); + gDisplayListHeap = alloc_only_pool_init(main_pool_available() - sizeof(struct AllocOnlyPool), MEMORY_POOL_LEFT); initialMatrix = alloc_display_list(sizeof(*initialMatrix)); gMatStackIndex = 0; gCurrAnimType = 0; @@ -1139,8 +1123,7 @@ void geo_process_root(struct GraphNodeRoot *node, Vp *b, Vp *c, s32 clearColor) } gCurGraphNodeRoot = NULL; if (gShowDebugText) { - print_text_fmt_int(180, 36, "MEM %d", - gDisplayListHeap->totalSpace - gDisplayListHeap->usedSpace); + print_text_fmt_int(180, 36, "MEM %d", gDisplayListHeap->totalSpace - gDisplayListHeap->usedSpace); } main_pool_free(gDisplayListHeap); FrameInterpolation_RecordCloseChild(); diff --git a/src/game/rumble_init.c b/src/game/rumble_init.c index c57c95ed..a710b363 100644 --- a/src/game/rumble_init.c +++ b/src/game/rumble_init.c @@ -236,7 +236,7 @@ void func_sh_8024CA04(void) { gCurrRumbleSettings.unk0C = 4; } -static void thread6_rumble_loop(UNUSED void *a0) { +static void thread6_rumble_loop(UNUSED void* a0) { OSMesg msg; // cancel_rumble(); diff --git a/src/game/save_file.c b/src/game/save_file.c index fdc9162f..31e4b313 100644 --- a/src/game/save_file.c +++ b/src/game/save_file.c @@ -36,13 +36,12 @@ u8 gSpecialTripleJump = FALSE; #define DEFINE_LEVEL(_0, _1, courseenum, _3, _4, _5, _6, _7, _8, _9, _10, _11) courseenum, s8 gLevelToCourseNumTable[] = { - #include "levels/level_defines.h" +#include "levels/level_defines.h" }; #undef STUB_LEVEL #undef DEFINE_LEVEL -STATIC_ASSERT(ARRAY_COUNT(gLevelToCourseNumTable) == LEVEL_COUNT - 1, - "change this array if you are adding levels"); +STATIC_ASSERT(ARRAY_COUNT(gLevelToCourseNumTable) == LEVEL_COUNT - 1, "change this array if you are adding levels"); // This was probably used to set progress to 100% for debugging, but // it was removed from the release ROM. @@ -56,12 +55,12 @@ static void stub_save_file_1(void) { * Try at most 4 times, and return 0 on success. On failure, return the status returned from * osEepromLongRead. It also returns 0 if EEPROM isn't loaded correctly in the system. */ -static s32 read_eeprom_data(void *buffer, s32 size) { +static s32 read_eeprom_data(void* buffer, s32 size) { s32 status = 0; if (gEepromProbe != 0) { s32 triesLeft = 4; - u32 offset = (u32)((u8 *) buffer - (u8 *) &gSaveBuffer) / 8; + u32 offset = (u32)((u8*)buffer - (u8*)&gSaveBuffer) / 8; do { #if ENABLE_RUMBLE @@ -84,12 +83,12 @@ static s32 read_eeprom_data(void *buffer, s32 size) { * Try at most 4 times, and return 0 on success. On failure, return the status returned from * osEepromLongWrite. Unlike read_eeprom_data, return 1 if EEPROM isn't loaded. */ -static s32 write_eeprom_data(void *buffer, s32 size) { +static s32 write_eeprom_data(void* buffer, s32 size) { s32 status = 1; if (gEepromProbe != 0) { s32 triesLeft = 4; - u32 offset = (u32)((u8 *) buffer - (u8 *) &gSaveBuffer) >> 3; + u32 offset = (u32)((u8*)buffer - (u8*)&gSaveBuffer) >> 3; do { #if ENABLE_RUMBLE @@ -110,7 +109,7 @@ static s32 write_eeprom_data(void *buffer, s32 size) { * Sum the bytes in data to data + size - 2. The last two bytes are ignored * because that is where the checksum is stored. */ -static u16 calc_checksum(u8 *data, s32 size) { +static u16 calc_checksum(u8* data, s32 size) { u16 chksum = 0; while (size-- > 2) { @@ -122,8 +121,8 @@ static u16 calc_checksum(u8 *data, s32 size) { /** * Verify the signature at the end of the block to check if the data is valid. */ -static s32 verify_save_block_signature(void *buffer, s32 size, u16 magic) { - struct SaveBlockSignature *sig = (struct SaveBlockSignature *) ((size - 4) + (u8 *) buffer); +static s32 verify_save_block_signature(void* buffer, s32 size, u16 magic) { + struct SaveBlockSignature* sig = (struct SaveBlockSignature*)((size - 4) + (u8*)buffer); if (sig->magic != magic) { return FALSE; @@ -137,8 +136,8 @@ static s32 verify_save_block_signature(void *buffer, s32 size, u16 magic) { /** * Write a signature at the end of the block to make sure the data is valid */ -static void add_save_block_signature(void *buffer, s32 size, u16 magic) { - struct SaveBlockSignature *sig = (struct SaveBlockSignature *) ((size - 4) + (u8 *) buffer); +static void add_save_block_signature(void* buffer, s32 size, u16 magic) { + struct SaveBlockSignature* sig = (struct SaveBlockSignature*)((size - 4) + (u8*)buffer); sig->magic = magic; sig->chksum = calc_checksum(buffer, size); @@ -237,23 +236,22 @@ static void restore_save_file_data(s32 fileIndex, s32 srcSlot) { s32 destSlot = srcSlot ^ 1; // Compute checksum on source data - add_save_block_signature(&gSaveBuffer.files[fileIndex][srcSlot], - sizeof(gSaveBuffer.files[fileIndex][srcSlot]), SAVE_FILE_MAGIC); + add_save_block_signature(&gSaveBuffer.files[fileIndex][srcSlot], sizeof(gSaveBuffer.files[fileIndex][srcSlot]), + SAVE_FILE_MAGIC); // Copy source data to destination slot bcopy(&gSaveBuffer.files[fileIndex][srcSlot], &gSaveBuffer.files[fileIndex][destSlot], sizeof(gSaveBuffer.files[fileIndex][destSlot])); // Write destination data to EEPROM - write_eeprom_data(&gSaveBuffer.files[fileIndex][destSlot], - sizeof(gSaveBuffer.files[fileIndex][destSlot])); + write_eeprom_data(&gSaveBuffer.files[fileIndex][destSlot], sizeof(gSaveBuffer.files[fileIndex][destSlot])); } void save_file_do_save(s32 fileIndex) { if (gSaveFileModified) { // Compute checksum - add_save_block_signature(&gSaveBuffer.files[fileIndex][0], - sizeof(gSaveBuffer.files[fileIndex][0]), SAVE_FILE_MAGIC); + add_save_block_signature(&gSaveBuffer.files[fileIndex][0], sizeof(gSaveBuffer.files[fileIndex][0]), + SAVE_FILE_MAGIC); // Copy to backup slot bcopy(&gSaveBuffer.files[fileIndex][0], &gSaveBuffer.files[fileIndex][1], @@ -299,8 +297,10 @@ void save_file_load_all(void) { read_eeprom_data(&gSaveBuffer, sizeof(gSaveBuffer)); // Verify the main menu data and create a backup copy if only one of the slots is valid. - validSlots = verify_save_block_signature(&gSaveBuffer.menuData[0], sizeof(gSaveBuffer.menuData[0]), MENU_DATA_MAGIC); - validSlots |= verify_save_block_signature(&gSaveBuffer.menuData[1], sizeof(gSaveBuffer.menuData[1]),MENU_DATA_MAGIC) << 1; + validSlots = + verify_save_block_signature(&gSaveBuffer.menuData[0], sizeof(gSaveBuffer.menuData[0]), MENU_DATA_MAGIC); + validSlots |= + verify_save_block_signature(&gSaveBuffer.menuData[1], sizeof(gSaveBuffer.menuData[1]), MENU_DATA_MAGIC) << 1; switch (validSlots) { case 0: // Neither copy is correct wipe_main_menu_data(); @@ -315,8 +315,11 @@ void save_file_load_all(void) { for (file = 0; file < NUM_SAVE_FILES; file++) { // Verify the save file and create a backup copy if only one of the slots is valid. - validSlots = verify_save_block_signature(&gSaveBuffer.files[file][0], sizeof(gSaveBuffer.files[file][0]), SAVE_FILE_MAGIC); - validSlots |= verify_save_block_signature(&gSaveBuffer.files[file][1], sizeof(gSaveBuffer.files[file][1]), SAVE_FILE_MAGIC) << 1; + validSlots = verify_save_block_signature(&gSaveBuffer.files[file][0], sizeof(gSaveBuffer.files[file][0]), + SAVE_FILE_MAGIC); + validSlots |= verify_save_block_signature(&gSaveBuffer.files[file][1], sizeof(gSaveBuffer.files[file][1]), + SAVE_FILE_MAGIC) + << 1; switch (validSlots) { case 0: // Neither copy is correct save_file_erase(file); @@ -366,12 +369,11 @@ void save_file_collect_star_or_key(s16 coinScore, s16 starIndex) { sUnusedGotGlobalCoinHiScore = FALSE; gGotFileCoinHiScore = FALSE; - if (courseIndex >= COURSE_NUM_TO_INDEX(COURSE_MIN) - && courseIndex <= COURSE_NUM_TO_INDEX(COURSE_STAGES_MAX)) { + if (courseIndex >= COURSE_NUM_TO_INDEX(COURSE_MIN) && courseIndex <= COURSE_NUM_TO_INDEX(COURSE_STAGES_MAX)) { //! Compares the coin score as a 16 bit value, but only writes the 8 bit // truncation. This can allow a high score to decrease. - if (coinScore > ((u16) save_file_get_max_coin_score(courseIndex) & 0xFFFF)) { + if (coinScore > ((u16)save_file_get_max_coin_score(courseIndex) & 0xFFFF)) { sUnusedGotGlobalCoinHiScore = TRUE; } @@ -534,7 +536,7 @@ void save_file_set_cannon_unlocked(void) { } void save_file_set_cap_pos(s16 x, s16 y, s16 z) { - struct SaveFile *saveFile = &gSaveBuffer.files[gCurrSaveFileNum - 1][0]; + struct SaveFile* saveFile = &gSaveBuffer.files[gCurrSaveFileNum - 1][0]; saveFile->capLevel = gCurrLevelNum; saveFile->capArea = gCurrAreaIndex; @@ -543,11 +545,11 @@ void save_file_set_cap_pos(s16 x, s16 y, s16 z) { } s32 save_file_get_cap_pos(Vec3s capPos) { - struct SaveFile *saveFile = &gSaveBuffer.files[gCurrSaveFileNum - 1][0]; + struct SaveFile* saveFile = &gSaveBuffer.files[gCurrSaveFileNum - 1][0]; s32 flags = save_file_get_flags(); - if (saveFile->capLevel == gCurrLevelNum && saveFile->capArea == gCurrAreaIndex - && (flags & SAVE_FLAG_CAP_ON_GROUND)) { + if (saveFile->capLevel == gCurrLevelNum && saveFile->capArea == gCurrAreaIndex && + (flags & SAVE_FLAG_CAP_ON_GROUND)) { vec3s_copy(capPos, saveFile->capPos); return TRUE; } @@ -604,7 +606,7 @@ void disable_warp_checkpoint(void) { * Checks the upper bit of the WarpNode->destLevel byte to see if the * game should set a warp checkpoint. */ -void check_if_should_set_warp_checkpoint(struct WarpNode *warpNode) { +void check_if_should_set_warp_checkpoint(struct WarpNode* warpNode) { if (warpNode->destLevel & 0x80) { // Overwrite the warp checkpoint variables. gWarpCheckpoint.actNum = gCurrActNum; @@ -620,13 +622,13 @@ void check_if_should_set_warp_checkpoint(struct WarpNode *warpNode) { * also update the level, area, and destination node of the input WarpNode. * returns TRUE if input WarpNode was updated, and FALSE if not. */ -s32 check_warp_checkpoint(struct WarpNode *warpNode) { +s32 check_warp_checkpoint(struct WarpNode* warpNode) { s16 warpCheckpointActive = FALSE; s16 currCourseNum = gLevelToCourseNumTable[(warpNode->destLevel & 0x7F) - 1]; // gSavedCourseNum is only used in this function. - if (gWarpCheckpoint.courseNum != COURSE_NONE && gSavedCourseNum == currCourseNum - && gWarpCheckpoint.actNum == gCurrActNum) { + if (gWarpCheckpoint.courseNum != COURSE_NONE && gSavedCourseNum == currCourseNum && + gWarpCheckpoint.actNum == gCurrActNum) { warpNode->destLevel = gWarpCheckpoint.levelID; warpNode->destArea = gWarpCheckpoint.areaNum; warpNode->destNode = gWarpCheckpoint.warpNode; diff --git a/src/game/screen_transition.c b/src/game/screen_transition.c index 4cc1e4f5..04969cf2 100644 --- a/src/game/screen_transition.c +++ b/src/game/screen_transition.c @@ -34,7 +34,7 @@ u8 set_transition_color_fade_alpha(s8 fadeType, s8 fadeTimer, u8 transTime) { switch (fadeType) { case 0: - time = (f32) sTransitionColorFadeCount[fadeTimer] * 255.0 / (f32)(transTime - 1) + 0.5; // fade in + time = (f32)sTransitionColorFadeCount[fadeTimer] * 255.0 / (f32)(transTime - 1) + 0.5; // fade in break; case 1: time = (1.0 - sTransitionColorFadeCount[fadeTimer] / (f32)(transTime - 1)) * 255.0 + 0.5; // fade out @@ -43,8 +43,8 @@ u8 set_transition_color_fade_alpha(s8 fadeType, s8 fadeTimer, u8 transTime) { return time; } -Vtx *vertex_transition_color(struct WarpTransitionData *transData, u8 alpha) { - Vtx *verts = alloc_display_list(4 * sizeof(*verts)); +Vtx* vertex_transition_color(struct WarpTransitionData* transData, u8 alpha) { + Vtx* verts = alloc_display_list(4 * sizeof(*verts)); u8 r = transData->red; u8 g = transData->green; u8 b = transData->blue; @@ -59,8 +59,8 @@ Vtx *vertex_transition_color(struct WarpTransitionData *transData, u8 alpha) { return verts; } -s32 dl_transition_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData *transData, u8 alpha) { - Vtx *verts = vertex_transition_color(transData, alpha); +s32 dl_transition_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData* transData, u8 alpha) { + Vtx* verts = vertex_transition_color(transData, alpha); if (verts != NULL) { gSPDisplayList(gDisplayListHead++, dl_proj_mtx_fullscreen); @@ -73,19 +73,19 @@ s32 dl_transition_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData *t return set_and_reset_transition_fade_timer(fadeTimer, transTime); } -s32 render_fade_transition_from_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData *transData) { +s32 render_fade_transition_from_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData* transData) { u8 alpha = set_transition_color_fade_alpha(1, fadeTimer, transTime); return dl_transition_color(fadeTimer, transTime, transData, alpha); } -s32 render_fade_transition_into_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData *transData) { +s32 render_fade_transition_into_color(s8 fadeTimer, u8 transTime, struct WarpTransitionData* transData) { u8 alpha = set_transition_color_fade_alpha(0, fadeTimer, transTime); return dl_transition_color(fadeTimer, transTime, transData, alpha); } -s16 calc_tex_transition_radius(s8 fadeTimer, s8 transTime, struct WarpTransitionData *transData) { +s16 calc_tex_transition_radius(s8 fadeTimer, s8 transTime, struct WarpTransitionData* transData) { f32 texRadius = transData->endTexRadius - transData->startTexRadius; f32 radiusTime = sTransitionColorFadeCount[fadeTimer] * texRadius / (f32)(transTime - 1); f32 result = transData->startTexRadius + radiusTime; @@ -93,38 +93,38 @@ s16 calc_tex_transition_radius(s8 fadeTimer, s8 transTime, struct WarpTransition return (s16)(result + 0.5); } -f32 calc_tex_transition_time(s8 fadeTimer, s8 transTime, struct WarpTransitionData *transData) { +f32 calc_tex_transition_time(s8 fadeTimer, s8 transTime, struct WarpTransitionData* transData) { f32 startX = transData->startTexX; f32 startY = transData->startTexY; f32 endX = transData->endTexX; f32 endY = transData->endTexY; f32 sqrtfXY = sqrtf((startX - endX) * (startX - endX) + (startY - endY) * (startY - endY)); - f32 result = (f32) sTransitionColorFadeCount[fadeTimer] * sqrtfXY / (f32)(transTime - 1); + f32 result = (f32)sTransitionColorFadeCount[fadeTimer] * sqrtfXY / (f32)(transTime - 1); return result; } -u16 convert_tex_transition_angle_to_pos(struct WarpTransitionData *transData) { +u16 convert_tex_transition_angle_to_pos(struct WarpTransitionData* transData) { f32 x = transData->endTexX - transData->startTexX; f32 y = transData->endTexY - transData->startTexY; return atan2s(x, y); } -s16 center_tex_transition_x(struct WarpTransitionData *transData, f32 texTransTime, u16 texTransPos) { +s16 center_tex_transition_x(struct WarpTransitionData* transData, f32 texTransTime, u16 texTransPos) { f32 x = transData->startTexX + coss(texTransPos) * texTransTime; return (s16)(x + 0.5); } -s16 center_tex_transition_y(struct WarpTransitionData *transData, f32 texTransTime, u16 texTransPos) { +s16 center_tex_transition_y(struct WarpTransitionData* transData, f32 texTransTime, u16 texTransPos) { f32 y = transData->startTexY + sins(texTransPos) * texTransTime; return (s16)(y + 0.5); } -void make_tex_transition_vertex(Vtx *verts, s32 n, s8 fadeTimer, struct WarpTransitionData *transData, s16 centerTransX, s16 centerTransY, - s16 texRadius1, s16 texRadius2, s16 tx, s16 ty) { +void make_tex_transition_vertex(Vtx* verts, s32 n, s8 fadeTimer, struct WarpTransitionData* transData, s16 centerTransX, + s16 centerTransY, s16 texRadius1, s16 texRadius2, s16 tx, s16 ty) { u8 r = transData->red; u8 g = transData->green; u8 b = transData->blue; @@ -137,20 +137,28 @@ void make_tex_transition_vertex(Vtx *verts, s32 n, s8 fadeTimer, struct WarpTran make_vertex(verts, n, x, y, -1, tx * 32, ty * 32, r, g, b, 255); } -void load_tex_transition_vertex(Vtx *verts, s8 fadeTimer, struct WarpTransitionData *transData, s16 centerTransX, s16 centerTransY, - s16 texTransRadius, s8 transTexType) { +void load_tex_transition_vertex(Vtx* verts, s8 fadeTimer, struct WarpTransitionData* transData, s16 centerTransX, + s16 centerTransY, s16 texTransRadius, s8 transTexType) { switch (transTexType) { case TRANS_TYPE_MIRROR: - make_tex_transition_vertex(verts, 0, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, -texTransRadius, -31, 63); - make_tex_transition_vertex(verts, 1, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, -texTransRadius, 31, 63); - make_tex_transition_vertex(verts, 2, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, texTransRadius, 31, 0); - make_tex_transition_vertex(verts, 3, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, texTransRadius, -31, 0); + make_tex_transition_vertex(verts, 0, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, + -texTransRadius, -31, 63); + make_tex_transition_vertex(verts, 1, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, + -texTransRadius, 31, 63); + make_tex_transition_vertex(verts, 2, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, + texTransRadius, 31, 0); + make_tex_transition_vertex(verts, 3, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, + texTransRadius, -31, 0); break; case TRANS_TYPE_CLAMP: - make_tex_transition_vertex(verts, 0, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, -texTransRadius, 0, 63); - make_tex_transition_vertex(verts, 1, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, -texTransRadius, 63, 63); - make_tex_transition_vertex(verts, 2, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, texTransRadius, 63, 0); - make_tex_transition_vertex(verts, 3, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, texTransRadius, 0, 0); + make_tex_transition_vertex(verts, 0, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, + -texTransRadius, 0, 63); + make_tex_transition_vertex(verts, 1, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, + -texTransRadius, 63, 63); + make_tex_transition_vertex(verts, 2, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, + texTransRadius, 63, 0); + make_tex_transition_vertex(verts, 3, fadeTimer, transData, centerTransX, centerTransY, -texTransRadius, + texTransRadius, 0, 0); break; } make_tex_transition_vertex(verts, 4, fadeTimer, transData, centerTransX, centerTransY, -2000, -2000, 0, 0); @@ -159,23 +167,25 @@ void load_tex_transition_vertex(Vtx *verts, s8 fadeTimer, struct WarpTransitionD make_tex_transition_vertex(verts, 7, fadeTimer, transData, centerTransX, centerTransY, -2000, 2000, 0, 0); } -void *sTextureTransitionID[] = { +void* sTextureTransitionID[] = { texture_transition_star_half, texture_transition_circle_half, texture_transition_mario, texture_transition_bowser_half, }; -s32 render_textured_transition(s8 fadeTimer, s8 transTime, struct WarpTransitionData *transData, s8 texID, s8 transTexType) { +s32 render_textured_transition(s8 fadeTimer, s8 transTime, struct WarpTransitionData* transData, s8 texID, + s8 transTexType) { f32 texTransTime = calc_tex_transition_time(fadeTimer, transTime, transData); u16 texTransPos = convert_tex_transition_angle_to_pos(transData); s16 centerTransX = center_tex_transition_x(transData, texTransTime, texTransPos); s16 centerTransY = center_tex_transition_y(transData, texTransTime, texTransPos); s16 texTransRadius = calc_tex_transition_radius(fadeTimer, transTime, transData); - Vtx *verts = alloc_display_list(8 * sizeof(*verts)); + Vtx* verts = alloc_display_list(8 * sizeof(*verts)); if (verts != NULL) { - load_tex_transition_vertex(verts, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, transTexType); + load_tex_transition_vertex(verts, fadeTimer, transData, centerTransX, centerTransY, texTransRadius, + transTexType); gSPDisplayList(gDisplayListHead++, dl_proj_mtx_fullscreen); gDPSetCombineMode(gDisplayListHead++, G_CC_SHADE, G_CC_SHADE); gDPSetRenderMode(gDisplayListHead++, G_RM_AA_OPA_SURF, G_RM_AA_OPA_SURF2); @@ -186,14 +196,14 @@ s32 render_textured_transition(s8 fadeTimer, s8 transTime, struct WarpTransition gDPSetRenderMode(gDisplayListHead++, G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2); gDPSetTextureFilter(gDisplayListHead++, G_TF_BILERP); switch (transTexType) { - case TRANS_TYPE_MIRROR: - gDPLoadTextureBlock(gDisplayListHead++, sTextureTransitionID[texID], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, - G_TX_WRAP | G_TX_MIRROR, G_TX_WRAP | G_TX_MIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD); - break; - case TRANS_TYPE_CLAMP: - gDPLoadTextureBlock(gDisplayListHead++, sTextureTransitionID[texID], G_IM_FMT_IA, G_IM_SIZ_8b, 64, 64, 0, - G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); - break; + case TRANS_TYPE_MIRROR: + gDPLoadTextureBlock(gDisplayListHead++, sTextureTransitionID[texID], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, + 0, G_TX_WRAP | G_TX_MIRROR, G_TX_WRAP | G_TX_MIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD); + break; + case TRANS_TYPE_CLAMP: + gDPLoadTextureBlock(gDisplayListHead++, sTextureTransitionID[texID], G_IM_FMT_IA, G_IM_SIZ_8b, 64, 64, + 0, G_TX_CLAMP, G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); + break; } gSPTexture(gDisplayListHead++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPVertex(gDisplayListHead++, VIRTUAL_TO_PHYSICAL(verts), 4, 0); @@ -206,7 +216,7 @@ s32 render_textured_transition(s8 fadeTimer, s8 transTime, struct WarpTransition return set_and_reset_transition_fade_timer(fadeTimer, transTime); } -s32 render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct WarpTransitionData *transData) { +s32 render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct WarpTransitionData* transData) { switch (transType) { case WARP_TRANSITION_FADE_FROM_COLOR: return render_fade_transition_from_color(fadeTimer, transTime, transData); @@ -242,10 +252,10 @@ s32 render_screen_transition(s8 fadeTimer, s8 transType, u8 transTime, struct Wa return 0; } -Gfx *render_cannon_circle_base(void) { - Vtx *verts = alloc_display_list(8 * sizeof(*verts)); - Gfx *dlist = alloc_display_list(20 * sizeof(*dlist)); - Gfx *g = dlist; +Gfx* render_cannon_circle_base(void) { + Vtx* verts = alloc_display_list(8 * sizeof(*verts)); + Gfx* dlist = alloc_display_list(20 * sizeof(*dlist)); + Gfx* g = dlist; if (verts != NULL && dlist != NULL) { make_vertex(verts, 0, 0, 0, -1, -1152, 1824, 0, 0, 0, 255); @@ -263,7 +273,7 @@ Gfx *render_cannon_circle_base(void) { gDPSetCombineMode(g++, G_CC_MODULATEIDECALA, G_CC_MODULATEIDECALA); gDPSetTextureFilter(g++, G_TF_BILERP); gDPLoadTextureBlock(g++, sTextureTransitionID[TEX_TRANS_CIRCLE], G_IM_FMT_IA, G_IM_SIZ_8b, 32, 64, 0, - G_TX_WRAP | G_TX_MIRROR, G_TX_WRAP | G_TX_MIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD); + G_TX_WRAP | G_TX_MIRROR, G_TX_WRAP | G_TX_MIRROR, 5, 6, G_TX_NOLOD, G_TX_NOLOD); gSPTexture(g++, 0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON); gSPVertex(g++, VIRTUAL_TO_PHYSICAL(verts), 4, 0); gSPDisplayList(g++, dl_draw_quad_verts_0123); @@ -280,12 +290,12 @@ Gfx *render_cannon_circle_base(void) { return dlist; } -Gfx *geo_cannon_circle_base(s32 callContext, struct GraphNode *node, UNUSED Mat4 mtx) { - struct GraphNodeGenerated *graphNode = (struct GraphNodeGenerated *) node; - Gfx *dlist = NULL; +Gfx* geo_cannon_circle_base(s32 callContext, struct GraphNode* node, UNUSED Mat4 mtx) { + struct GraphNodeGenerated* graphNode = (struct GraphNodeGenerated*)node; + Gfx* dlist = NULL; - if (callContext == GEO_CONTEXT_RENDER && gCurrentArea != NULL - && gCurrentArea->camera->mode == CAMERA_MODE_INSIDE_CANNON) { + if (callContext == GEO_CONTEXT_RENDER && gCurrentArea != NULL && + gCurrentArea->camera->mode == CAMERA_MODE_INSIDE_CANNON) { graphNode->fnNode.node.flags = (graphNode->fnNode.node.flags & 0xFF) | 0x500; dlist = render_cannon_circle_base(); } diff --git a/src/game/shadow.c b/src/game/shadow.c index 32acd870..2c5bc32a 100644 --- a/src/game/shadow.c +++ b/src/game/shadow.c @@ -112,8 +112,8 @@ s16 sSurfaceTypeBelowShadow; * function will update (newZ, newX) to equal the new coordinates of that point * after a rotation equal to the yaw of the current graph node object. */ -void rotate_rectangle(f32 *newZ, f32 *newX, f32 oldZ, f32 oldX) { - struct Object *obj = (struct Object *) gCurGraphNodeObject; +void rotate_rectangle(f32* newZ, f32* newX, f32 oldZ, f32 oldX) { + struct Object* obj = (struct Object*)gCurGraphNodeObject; *newZ = oldZ * coss(obj->oFaceAngleYaw) - oldX * sins(obj->oFaceAngleYaw); *newX = oldZ * sins(obj->oFaceAngleYaw) + oldX * coss(obj->oFaceAngleYaw); } @@ -123,7 +123,7 @@ void rotate_rectangle(f32 *newZ, f32 *newX, f32 oldZ, f32 oldX) { * the standard atan2. */ f32 atan2_deg(f32 a, f32 b) { - return ((f32) atan2s(a, b) / 65535.0 * 360.0); + return ((f32)atan2s(a, b) / 65535.0 * 360.0); } /** @@ -168,7 +168,7 @@ u8 dim_shadow_with_distance(u8 solidity, f32 distFromFloor) { } else if (distFromFloor >= 600.0) { return 120; } else { - ret = ((120 - solidity) * distFromFloor) / 600.0 + (f32) solidity; + ret = ((120 - solidity) * distFromFloor) / 600.0 + (f32)solidity; return ret; } } @@ -177,7 +177,7 @@ u8 dim_shadow_with_distance(u8 solidity, f32 distFromFloor) { * Return the water level below a shadow, or 0 if the water level is below * -10,000. */ -f32 get_water_level_below_shadow(struct Shadow *s) { +f32 get_water_level_below_shadow(struct Shadow* s) { f32 waterLevel = find_water_level(s->parentX, s->parentZ); if (waterLevel < FLOOR_LOWER_LIMIT_SHADOW) { return 0; @@ -197,10 +197,10 @@ f32 get_water_level_below_shadow(struct Shadow *s) { * @param overwriteSolidity Flag for whether the existing shadow solidity should * be dimmed based on its distance to the floor */ -s8 init_shadow(struct Shadow *s, f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 overwriteSolidity) { +s8 init_shadow(struct Shadow* s, f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 overwriteSolidity) { f32 waterLevel; f32 floorSteepness; - struct FloorGeometry *floorGeometry; + struct FloorGeometry* floorGeometry; s->parentX = xPos; s->parentY = yPos; @@ -259,7 +259,7 @@ s8 init_shadow(struct Shadow *s, f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, * 3 = (-15, 0) 4 = (0, 0) 5 = (15, 0) * 6 = (-15, 15) 7 = (0, 15) 8 = (15, 15) */ -void get_texture_coords_9_vertices(s8 vertexNum, s16 *textureX, s16 *textureY) { +void get_texture_coords_9_vertices(s8 vertexNum, s16* textureX, s16* textureY) { *textureX = vertexNum % 3 * 15 - 15; *textureY = vertexNum / 3 * 15 - 15; } @@ -270,7 +270,7 @@ void get_texture_coords_9_vertices(s8 vertexNum, s16 *textureX, s16 *textureY) { * 0 = (-15, -15) 1 = (15, -15) * 2 = (-15, 15) 3 = (15, 15) */ -void get_texture_coords_4_vertices(s8 vertexNum, s16 *textureX, s16 *textureY) { +void get_texture_coords_4_vertices(s8 vertexNum, s16* textureX, s16* textureY) { *textureX = (vertexNum % 2) * 2 * 15 - 15; *textureY = (vertexNum / 2) * 2 * 15 - 15; } @@ -284,8 +284,7 @@ void get_texture_coords_4_vertices(s8 vertexNum, s16 *textureX, s16 *textureY) { * @param alpha Opacity of the vertex * @param shadowVertexType One of SHADOW_WITH_9_VERTS or SHADOW_WITH_4_VERTS */ -void make_shadow_vertex_at_xyz(Vtx *vertices, s8 index, f32 relX, f32 relY, f32 relZ, u8 alpha, - s8 shadowVertexType) { +void make_shadow_vertex_at_xyz(Vtx* vertices, s8 index, f32 relX, f32 relY, f32 relZ, u8 alpha, s8 shadowVertexType) { f32 vtxX = relX; f32 vtxY = relY; f32 vtxZ = relZ; @@ -307,8 +306,7 @@ void make_shadow_vertex_at_xyz(Vtx *vertices, s8 index, f32 relX, f32 relY, f32 vtxZ += 5; } make_vertex( // shadows are black - vertices, index, vtxX, vtxY, vtxZ, textureX << 5, textureY << 5, 255, 255, 255, alpha - ); + vertices, index, vtxX, vtxY, vtxZ, textureX << 5, textureY << 5, 255, 255, 255, alpha); } /** @@ -326,7 +324,7 @@ f32 extrapolate_vertex_y_position(struct Shadow s, f32 vtxX, f32 vtxZ) { * `get_texture_coords_4_vertices()`, which have similar functionality, but * return 15 times these values. */ -void get_vertex_coords(s8 index, s8 shadowVertexType, s8 *xCoord, s8 *zCoord) { +void get_vertex_coords(s8 index, s8 shadowVertexType, s8* xCoord, s8* zCoord) { *xCoord = index % (3 - shadowVertexType) - 1; *zCoord = index / (3 - shadowVertexType) - 1; @@ -353,15 +351,14 @@ void get_vertex_coords(s8 index, s8 shadowVertexType, s8 *xCoord, s8 *zCoord) { * vertex and 4 vertex cases are identical, and the above-described clamping * behavior is overwritten. */ -void calculate_vertex_xyz(s8 index, struct Shadow s, f32 *xPosVtx, f32 *yPosVtx, f32 *zPosVtx, - s8 shadowVertexType) { +void calculate_vertex_xyz(s8 index, struct Shadow s, f32* xPosVtx, f32* yPosVtx, f32* zPosVtx, s8 shadowVertexType) { f32 tiltedScale = cosf(s.floorTilt * M_PI / 180.0) * s.shadowScale; f32 downwardAngle = s.floorDownwardAngle * M_PI / 180.0; f32 halfScale; f32 halfTiltedScale; s8 xCoordUnit; s8 zCoordUnit; - struct FloorGeometry *dummy; + struct FloorGeometry* dummy; // This makes xCoordUnit and yCoordUnit each one of -1, 0, or 1. get_vertex_coords(index, shadowVertexType, &xCoordUnit, &zCoordUnit); @@ -419,7 +416,7 @@ s16 floor_local_tilt(struct Shadow s, f32 vtxX, f32 vtxY, f32 vtxZ) { /** * Make a particular vertex from a shadow, calculating its position and solidity. */ -void make_shadow_vertex(Vtx *vertices, s8 index, struct Shadow s, s8 shadowVertexType) { +void make_shadow_vertex(Vtx* vertices, s8 index, struct Shadow s, s8 shadowVertexType) { f32 xPosVtx, yPosVtx, zPosVtx; f32 relX, relY, relZ; @@ -445,8 +442,8 @@ void make_shadow_vertex(Vtx *vertices, s8 index, struct Shadow s, s8 shadowVerte * The gShadowAboveWaterOrLava check is redundant, since `floor_local_tilt` * will always be 0 over water or lava (since they are always flat). */ - if (shadowVertexType == SHADOW_WITH_9_VERTS && !gShadowAboveWaterOrLava - && floor_local_tilt(s, xPosVtx, yPosVtx, zPosVtx) != 0) { + if (shadowVertexType == SHADOW_WITH_9_VERTS && !gShadowAboveWaterOrLava && + floor_local_tilt(s, xPosVtx, yPosVtx, zPosVtx) != 0) { yPosVtx = extrapolate_vertex_y_position(s, xPosVtx, zPosVtx); solidity = 0; } @@ -460,7 +457,7 @@ void make_shadow_vertex(Vtx *vertices, s8 index, struct Shadow s, s8 shadowVerte /** * Add a shadow to the given display list. */ -void add_shadow_to_display_list(Gfx *displayListHead, Vtx *verts, s8 shadowVertexType, s8 shadowShape) { +void add_shadow_to_display_list(Gfx* displayListHead, Vtx* verts, s8 shadowVertexType, s8 shadowShape) { switch (shadowShape) { case SHADOW_SHAPE_CIRCLE: gSPDisplayList(displayListHead++, dl_shadow_circle); @@ -487,14 +484,13 @@ void add_shadow_to_display_list(Gfx *displayListHead, Vtx *verts, s8 shadowVerte * Linearly interpolate a shadow's solidity between zero and finalSolidity * depending on curr's relation to start and end. */ -void linearly_interpolate_solidity_positive(struct Shadow *s, u8 finalSolidity, s16 curr, s16 start, - s16 end) { +void linearly_interpolate_solidity_positive(struct Shadow* s, u8 finalSolidity, s16 curr, s16 start, s16 end) { if (curr >= 0 && curr < start) { s->solidity = 0; } else if (end < curr) { s->solidity = finalSolidity; } else { - s->solidity = (f32) finalSolidity * (curr - start) / (end - start); + s->solidity = (f32)finalSolidity * (curr - start) / (end - start); } } @@ -503,14 +499,13 @@ void linearly_interpolate_solidity_positive(struct Shadow *s, u8 finalSolidity, * depending on curr's relation to start and end. Note that if curr < start, * the solidity will be zero. */ -void linearly_interpolate_solidity_negative(struct Shadow *s, u8 initialSolidity, s16 curr, s16 start, - s16 end) { +void linearly_interpolate_solidity_negative(struct Shadow* s, u8 initialSolidity, s16 curr, s16 start, s16 end) { // The curr < start case is not handled. Thus, if start != 0, this function // will have the surprising behavior of hiding the shadow until start. // This is not necessarily a bug, since this function is only used once, // with start == 0. if (curr >= start && end >= curr) { - s->solidity = ((f32) initialSolidity * (1.0 - (f32)(curr - start) / (end - start))); + s->solidity = ((f32)initialSolidity * (1.0 - (f32)(curr - start) / (end - start))); } else { s->solidity = 0; } @@ -519,8 +514,8 @@ void linearly_interpolate_solidity_negative(struct Shadow *s, u8 initialSolidity /** * Change a shadow's solidity based on the player's current animation frame. */ -s8 correct_shadow_solidity_for_animations(s32 isLuigi, u8 initialSolidity, struct Shadow *shadow) { - struct Object *player; +s8 correct_shadow_solidity_for_animations(s32 isLuigi, u8 initialSolidity, struct Shadow* shadow) { + struct Object* player; s8 ret; s16 animFrame; @@ -568,7 +563,7 @@ s8 correct_shadow_solidity_for_animations(s32 isLuigi, u8 initialSolidity, struc /** * Slightly change the height of a shadow in levels with lava. */ -void correct_lava_shadow_height(struct Shadow *s) { +void correct_lava_shadow_height(struct Shadow* s) { if (gCurrLevelNum == LEVEL_BITFS && sSurfaceTypeBelowShadow == SURFACE_BURNING) { if (s->floorHeight < -3000.0) { s->floorHeight = -3062.0; @@ -577,8 +572,7 @@ void correct_lava_shadow_height(struct Shadow *s) { s->floorHeight = 3492.0; gShadowAboveWaterOrLava = TRUE; } - } else if (gCurrLevelNum == LEVEL_LLL && gCurrAreaIndex == 1 - && sSurfaceTypeBelowShadow == SURFACE_BURNING) { + } else if (gCurrLevelNum == LEVEL_LLL && gCurrAreaIndex == 1 && sSurfaceTypeBelowShadow == SURFACE_BURNING) { s->floorHeight = 5.0; gShadowAboveWaterOrLava = TRUE; } @@ -588,9 +582,9 @@ void correct_lava_shadow_height(struct Shadow *s) { * Create a shadow under a player, correcting that shadow's opacity during * appropriate animations and other states. */ -Gfx *create_shadow_player(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity, s32 isLuigi) { - Vtx *verts; - Gfx *displayList; +Gfx* create_shadow_player(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity, s32 isLuigi) { + Vtx* verts; + Gfx* displayList; struct Shadow shadow; s8 ret; s32 i; @@ -641,9 +635,9 @@ Gfx *create_shadow_player(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 soli /** * Create a circular shadow composed of 9 vertices. */ -Gfx *create_shadow_circle_9_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity) { - Vtx *verts; - Gfx *displayList; +Gfx* create_shadow_circle_9_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity) { + Vtx* verts; + Gfx* displayList; struct Shadow shadow; s32 i; @@ -667,9 +661,9 @@ Gfx *create_shadow_circle_9_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, /** * Create a circular shadow composed of 4 vertices. */ -Gfx *create_shadow_circle_4_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity) { - Vtx *verts; - Gfx *displayList; +Gfx* create_shadow_circle_4_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity) { + Vtx* verts; + Gfx* displayList; struct Shadow shadow; s32 i; @@ -695,11 +689,10 @@ Gfx *create_shadow_circle_4_verts(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, * Create a circular shadow composed of 4 vertices and assume that the ground * underneath it is totally flat. */ -Gfx *create_shadow_circle_assuming_flat_ground(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, - u8 solidity) { - Vtx *verts; - Gfx *displayList; - struct FloorGeometry *dummy; // only for calling find_floor_height_and_data +Gfx* create_shadow_circle_assuming_flat_ground(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity) { + Vtx* verts; + Gfx* displayList; + struct FloorGeometry* dummy; // only for calling find_floor_height_and_data f32 distBelowFloor; f32 floorHeight = find_floor_height_and_data(xPos, yPos, zPos, &dummy) + 0.4f; f32 radius = shadowScale / 2; @@ -730,9 +723,9 @@ Gfx *create_shadow_circle_assuming_flat_ground(f32 xPos, f32 yPos, f32 zPos, s16 * Create a rectangular shadow composed of 4 vertices. This assumes the ground * underneath the shadow is totally flat. */ -Gfx *create_shadow_rectangle(f32 halfWidth, f32 halfLength, f32 relY, u8 solidity) { - Vtx *verts = alloc_display_list(4 * sizeof(Vtx)); - Gfx *displayList = alloc_display_list(5 * sizeof(Gfx)); +Gfx* create_shadow_rectangle(f32 halfWidth, f32 halfLength, f32 relY, u8 solidity) { + Vtx* verts = alloc_display_list(4 * sizeof(Vtx)); + Gfx* displayList = alloc_display_list(5 * sizeof(Gfx)); f32 frontLeftX, frontLeftZ, frontRightX, frontRightZ, backLeftX, backLeftZ, backRightX, backRightZ; if (verts == NULL || displayList == NULL) { @@ -758,8 +751,8 @@ Gfx *create_shadow_rectangle(f32 halfWidth, f32 halfLength, f32 relY, u8 solidit * Populate `shadowHeight` and `solidity` appropriately; the default solidity * value is 200. Return 0 if a shadow should be drawn, 1 if not. */ -s32 get_shadow_height_solidity(f32 xPos, f32 yPos, f32 zPos, f32 *shadowHeight, u8 *solidity) { - struct FloorGeometry *dummy; +s32 get_shadow_height_solidity(f32 xPos, f32 yPos, f32 zPos, f32* shadowHeight, u8* solidity) { + struct FloorGeometry* dummy; f32 waterLevel; *shadowHeight = find_floor_height_and_data(xPos, yPos, zPos, &dummy) + 0.4f; @@ -782,7 +775,7 @@ s32 get_shadow_height_solidity(f32 xPos, f32 yPos, f32 zPos, f32 *shadowHeight, /** * Create a square shadow composed of 4 vertices. */ -Gfx *create_shadow_square(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity, s8 shadowType) { +Gfx* create_shadow_square(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 solidity, s8 shadowType) { f32 shadowHeight; f32 distFromShadow; f32 shadowRadius; @@ -813,8 +806,8 @@ Gfx *create_shadow_square(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 soli * Create a rectangular shadow whose parameters have been hardcoded in the * `rectangles` array. */ -Gfx *create_shadow_hardcoded_rectangle(f32 xPos, f32 yPos, f32 zPos, UNUSED s16 shadowScale, - u8 solidity, s8 shadowType) { +Gfx* create_shadow_hardcoded_rectangle(f32 xPos, f32 yPos, f32 zPos, UNUSED s16 shadowScale, u8 solidity, + s8 shadowType) { f32 shadowHeight; f32 distFromShadow; f32 halfWidth; @@ -847,10 +840,9 @@ Gfx *create_shadow_hardcoded_rectangle(f32 xPos, f32 yPos, f32 zPos, UNUSED s16 * Create a shadow at the absolute position given, with the given parameters. * Return a pointer to the display list representing the shadow. */ -Gfx *create_shadow_below_xyz(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 shadowSolidity, - s8 shadowType) { - Gfx *displayList = NULL; - struct Surface *pfloor; +Gfx* create_shadow_below_xyz(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 shadowSolidity, s8 shadowType) { + Gfx* displayList = NULL; + struct Surface* pfloor; find_floor(xPos, yPos, zPos, &pfloor); gShadowAboveWaterOrLava = FALSE; @@ -870,28 +862,23 @@ Gfx *create_shadow_below_xyz(f32 xPos, f32 yPos, f32 zPos, s16 shadowScale, u8 s displayList = create_shadow_circle_4_verts(xPos, yPos, zPos, shadowScale, shadowSolidity); break; case SHADOW_CIRCLE_4_VERTS_FLAT_UNUSED: // unused shadow type - displayList = create_shadow_circle_assuming_flat_ground(xPos, yPos, zPos, shadowScale, - shadowSolidity); + displayList = create_shadow_circle_assuming_flat_ground(xPos, yPos, zPos, shadowScale, shadowSolidity); break; case SHADOW_SQUARE_PERMANENT: - displayList = - create_shadow_square(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); + displayList = create_shadow_square(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); break; case SHADOW_SQUARE_SCALABLE: - displayList = - create_shadow_square(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); + displayList = create_shadow_square(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); break; case SHADOW_SQUARE_TOGGLABLE: - displayList = - create_shadow_square(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); + displayList = create_shadow_square(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); break; case SHADOW_CIRCLE_PLAYER: displayList = create_shadow_player(xPos, yPos, zPos, shadowScale, shadowSolidity, /* isLuigi */ FALSE); break; default: - displayList = create_shadow_hardcoded_rectangle(xPos, yPos, zPos, shadowScale, - shadowSolidity, shadowType); + displayList = create_shadow_hardcoded_rectangle(xPos, yPos, zPos, shadowScale, shadowSolidity, shadowType); break; } return displayList; diff --git a/src/game/skybox.c b/src/game/skybox.c index a4b4d4b9..e0dfef14 100644 --- a/src/game/skybox.c +++ b/src/game/skybox.c @@ -63,10 +63,8 @@ struct Skybox sSkyBoxInfo[2]; static uint8_t** gSkyboxTiles = NULL; static s8 gLastSkybox = -1; -static const char* gSkyboxTextures[] = { - gSkyboxWater, gSkyboxBitfs, gSkyboxWdw, gSkyboxCloudFloor, gSkyboxCcm, - gSkyboxSsl, gSkyboxBbh, gSkyboxBitdw, gSkyboxClouds, gSkyboxBits -}; +static const char* gSkyboxTextures[] = { gSkyboxWater, gSkyboxBitfs, gSkyboxWdw, gSkyboxCloudFloor, gSkyboxCcm, + gSkyboxSsl, gSkyboxBbh, gSkyboxBitdw, gSkyboxClouds, gSkyboxBits }; /** * The skybox color mask. @@ -110,7 +108,6 @@ u8 sSkyboxColors[][3] = { #define CHUNK_HEIGHT 32 // Height of each texture chunk in pixels #define BYTES_PER_PIXEL 2 // Assuming 2 bytes per pixel - /** * Convert the camera's yaw into an x position into the scaled skybox image. * @@ -130,7 +127,7 @@ f32 calculate_skybox_scaled_x(s8 player, f32 fov) { f32 scaledX = yawScaled; if (scaledX > SKYBOX_WIDTH) { - scaledX -= (s32) scaledX / SKYBOX_WIDTH * SKYBOX_WIDTH; + scaledX -= (s32)scaledX / SKYBOX_WIDTH * SKYBOX_WIDTH; } return SKYBOX_WIDTH - scaledX; } @@ -143,7 +140,7 @@ f32 calculate_skybox_scaled_x(s8 player, f32 fov) { */ f32 calculate_skybox_scaled_y(s8 player, UNUSED f32 fov) { // Convert pitch to degrees. Pitch is bounded between -90 (looking down) and 90 (looking up). - f32 pitchInDegrees = (f32) sSkyBoxInfo[player].pitch * 360.0 / 65535.0; + f32 pitchInDegrees = (f32)sSkyBoxInfo[player].pitch * 360.0 / 65535.0; // Scale by 360 / fov f32 degreesToScale = 360.0f * pitchInDegrees / 90.0; @@ -178,20 +175,20 @@ static s32 get_top_left_tile_idx(s8 player) { * into an x and y by modulus and division by SKYBOX_COLS. x and y are then scaled by * SKYBOX_TILE_WIDTH to get a point in world space. */ -Vtx *make_skybox_rect(s32 tileIndex, s8 colorIndex) { - Vtx *verts = alloc_display_list(4 * sizeof(*verts)); +Vtx* make_skybox_rect(s32 tileIndex, s8 colorIndex) { + Vtx* verts = alloc_display_list(4 * sizeof(*verts)); s16 x = (tileIndex % SKYBOX_COLS) * SKYBOX_TILE_WIDTH; s16 y = SKYBOX_HEIGHT - (tileIndex / SKYBOX_COLS) * SKYBOX_TILE_HEIGHT; if (verts != NULL) { make_vertex(verts, 0, x, y, -1, 0, 0, sSkyboxColors[colorIndex][0], sSkyboxColors[colorIndex][1], sSkyboxColors[colorIndex][2], 255); - make_vertex(verts, 1, x, y - SKYBOX_TILE_HEIGHT, -1, 0, 31 << 5, sSkyboxColors[colorIndex][0], sSkyboxColors[colorIndex][1], - sSkyboxColors[colorIndex][2], 255); - make_vertex(verts, 2, x + SKYBOX_TILE_WIDTH, y - SKYBOX_TILE_HEIGHT, -1, 31 << 5, 31 << 5, sSkyboxColors[colorIndex][0], + make_vertex(verts, 1, x, y - SKYBOX_TILE_HEIGHT, -1, 0, 31 << 5, sSkyboxColors[colorIndex][0], + sSkyboxColors[colorIndex][1], sSkyboxColors[colorIndex][2], 255); + make_vertex(verts, 2, x + SKYBOX_TILE_WIDTH, y - SKYBOX_TILE_HEIGHT, -1, 31 << 5, 31 << 5, + sSkyboxColors[colorIndex][0], sSkyboxColors[colorIndex][1], sSkyboxColors[colorIndex][2], 255); + make_vertex(verts, 3, x + SKYBOX_TILE_WIDTH, y, -1, 31 << 5, 0, sSkyboxColors[colorIndex][0], sSkyboxColors[colorIndex][1], sSkyboxColors[colorIndex][2], 255); - make_vertex(verts, 3, x + SKYBOX_TILE_WIDTH, y, -1, 31 << 5, 0, sSkyboxColors[colorIndex][0], sSkyboxColors[colorIndex][1], - sSkyboxColors[colorIndex][2], 255); } else { } return verts; @@ -215,7 +212,7 @@ void* CalculateDataOffset(void* data, int x, int y, size_t blobSize) { // Calculate the total offset in bytes within the data bin uint32_t totalOffset = (chunkOffset * (CHUNK_WIDTH * CHUNK_HEIGHT * BYTES_PER_PIXEL) + chunkDataOffset); - if(totalOffset + 4096 > blobSize) { + if (totalOffset + 4096 > blobSize) { totalOffset = 0; } @@ -230,7 +227,7 @@ void* CalculateDataOffset(void* data, int x, int y, size_t blobSize) { * The row and column are converted into an index into the skybox's tile list, which is then drawn in * world space so that the tiles will rotate with the camera. */ -void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) { +void draw_skybox_tile_grid(Gfx** dlist, s8 background, s8 player, s8 colorIndex) { s32 row; s32 col; @@ -241,7 +238,7 @@ void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) for (col = 0; col < 3; col++) { s32 tileRow = (sSkyBoxInfo[player].upperLeftTile / SKYBOX_COLS) + row; s32 tileCol = (sSkyBoxInfo[player].upperLeftTile % SKYBOX_COLS) + col; - + // Wrap horizontally tileCol %= SKYBOX_COLS; @@ -254,8 +251,8 @@ void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) // Calculate the x and y coordinates within the skybox image int32_t x = skyboxCol * CHUNK_WIDTH; int32_t y = skyboxRow * CHUNK_HEIGHT; - - if(x >= 256){ + + if (x >= 256) { y -= CHUNK_HEIGHT; } @@ -265,7 +262,7 @@ void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) // Memcpy texture with calculated offset from x and y using the fact that every tile is 2048 bytes memcpy(texture, CalculateDataOffset(data, x, y, blobSize), 2048); - Vtx *vertices = make_skybox_rect(tileIndex, colorIndex); + Vtx* vertices = make_skybox_rect(tileIndex, colorIndex); gSPInvalidateTexCache((*dlist)++, texture); gLoadBlockTexture((*dlist)++, 32, 32, G_IM_FMT_RGBA, texture); @@ -275,12 +272,12 @@ void draw_skybox_tile_grid(Gfx **dlist, s8 background, s8 player, s8 colorIndex) } } -void *create_skybox_ortho_matrix(s8 player) { +void* create_skybox_ortho_matrix(s8 player) { f32 left = sSkyBoxInfo[player].scaledX; f32 right = sSkyBoxInfo[player].scaledX + SCREEN_WIDTH; f32 bottom = sSkyBoxInfo[player].scaledY - SCREEN_HEIGHT; f32 top = sSkyBoxInfo[player].scaledY; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); f32 half_width = (4.0f / 3.0f) / GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_WIDTH / 2; f32 center = (sSkyBoxInfo[player].scaledX + SCREEN_WIDTH / 2); @@ -299,7 +296,7 @@ void *create_skybox_ortho_matrix(s8 player) { } void skybox_init_tiles() { - if(gSkyboxTiles != NULL) { + if (gSkyboxTiles != NULL) { return; } @@ -312,17 +309,17 @@ void skybox_init_tiles() { /** * Creates the skybox's display list, then draws the 3x3 grid of tiles. */ -Gfx *init_skybox_display_list(s8 player, s8 background, s8 colorIndex) { +Gfx* init_skybox_display_list(s8 player, s8 background, s8 colorIndex) { s32 dlCommandCount = 20 + (3 * 3) * 7; // 5 for the start and end, plus 9 skybox tiles - void *skybox = alloc_display_list(dlCommandCount * sizeof(Gfx)); - Gfx *dlist = skybox; + void* skybox = alloc_display_list(dlCommandCount * sizeof(Gfx)); + Gfx* dlist = skybox; skybox_init_tiles(); if (skybox == NULL) { return NULL; } else { - Mtx *ortho = create_skybox_ortho_matrix(player); + Mtx* ortho = create_skybox_ortho_matrix(player); gSPDisplayList(dlist++, dl_skybox_begin); gSPMatrix(dlist++, VIRTUAL_TO_PHYSICAL(ortho), G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); gSPDisplayList(dlist++, dl_skybox_tile_tex_settings); @@ -345,17 +342,16 @@ Gfx *init_skybox_display_list(s8 player, s8 background, s8 colorIndex) { * @param posX,posY,posZ The camera's position * @param focX,focY,focZ The camera's focus. */ -Gfx *create_skybox_facing_camera(s8 player, s8 background, f32 fov, - f32 posX, f32 posY, f32 posZ, - f32 focX, f32 focY, f32 focZ) { +Gfx* create_skybox_facing_camera(s8 player, s8 background, f32 fov, f32 posX, f32 posY, f32 posZ, f32 focX, f32 focY, + f32 focZ) { f32 cameraFaceX = focX - posX; f32 cameraFaceY = focY - posY; f32 cameraFaceZ = focZ - posZ; s8 colorIndex = 1; // If the "Plunder in the Sunken Ship" star in JRB is collected, make the sky darker and slightly green - if (background == 8 - && !(save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_JRB)) & (1 << 0))) { + if (background == 8 && + !(save_file_get_star_flags(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(COURSE_JRB)) & (1 << 0))) { colorIndex = 0; } diff --git a/src/game/sound_init.c b/src/game/sound_init.c index bc623c96..61aafbdc 100644 --- a/src/game/sound_init.c +++ b/src/game/sound_init.c @@ -74,7 +74,7 @@ static u32 sMenuSoundsExtra[] = { }; static s8 sPaintingEjectSoundPlayed = FALSE; -void play_menu_sounds_extra(s32 a, void *b); +void play_menu_sounds_extra(s32 a, void* b); /** * Called from threads: thread5_game_loop @@ -187,8 +187,7 @@ void play_painting_eject_sound(void) { if (gRipplingPainting != NULL && gRipplingPainting->state == PAINTING_ENTERED) { // ripple when Mario enters painting if (!sPaintingEjectSoundPlayed) { - play_sound(SOUND_GENERAL_PAINTING_EJECT, - gMarioStates[0].marioObj->header.gfx.cameraToObject); + play_sound(SOUND_GENERAL_PAINTING_EJECT, gMarioStates[0].marioObj->header.gfx.cameraToObject); } sPaintingEjectSoundPlayed = TRUE; } else { @@ -318,7 +317,7 @@ 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); } @@ -332,7 +331,7 @@ void audio_game_loop_tick(void) { /** * Sound processing thread. Runs at 60 FPS. */ -void thread4_sound(UNUSED void *arg) { +void thread4_sound(UNUSED void* arg) { audio_init(); sound_init(); @@ -346,7 +345,7 @@ void thread4_sound(UNUSED void *arg) { osRecvMesg(&sSoundMesgQueue, &msg, OS_MESG_BLOCK); if (gResetTimer < 25) { - struct SPTask *spTask; + struct SPTask* spTask; profiler_log_thread4_time(); spTask = create_next_audio_frame_task(); profiler_log_thread4_time(); diff --git a/src/game/spawn_object.c b/src/game/spawn_object.c index 4d1cd641..a4969533 100644 --- a/src/game/spawn_object.c +++ b/src/game/spawn_object.c @@ -18,8 +18,8 @@ * An unused linked list struct that seems to have been replaced by ObjectNode. */ struct LinkedList { - struct LinkedList *next; - struct LinkedList *prev; + struct LinkedList* next; + struct LinkedList* prev; }; /** @@ -27,10 +27,10 @@ struct LinkedList { * a list, and return this list in pFreeList. * Appears to have been replaced by init_free_object_list. */ -void unused_init_free_list(struct LinkedList *usedList, struct LinkedList **pFreeList, - struct LinkedList *pool, s32 itemSize, s32 poolLength) { +void unused_init_free_list(struct LinkedList* usedList, struct LinkedList** pFreeList, struct LinkedList* pool, + s32 itemSize, s32 poolLength) { s32 i; - struct LinkedList *node = pool; + struct LinkedList* node = pool; usedList->next = usedList; usedList->prev = usedList; @@ -39,7 +39,7 @@ void unused_init_free_list(struct LinkedList *usedList, struct LinkedList **pFre for (i = 0; i < poolLength - 1; i++) { // Add next node to free list - node = (struct LinkedList *) ((u8 *) node + itemSize); + node = (struct LinkedList*)((u8*)node + itemSize); pool->next = node; pool = node; } @@ -54,9 +54,8 @@ void unused_init_free_list(struct LinkedList *usedList, struct LinkedList **pFre * freeList is empty. * Appears to have been replaced by try_allocate_object. */ -struct LinkedList *unused_try_allocate(struct LinkedList *destList, - struct LinkedList *freeList) { - struct LinkedList *node = freeList->next; +struct LinkedList* unused_try_allocate(struct LinkedList* destList, struct LinkedList* freeList) { + struct LinkedList* node = freeList->next; if (node != NULL) { // Remove from free list @@ -77,8 +76,8 @@ struct LinkedList *unused_try_allocate(struct LinkedList *destList, * to the end of destList (doubly linked). Return the object, or NULL if * freeList is empty. */ -struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNode *freeList) { - struct ObjectNode *nextObj; +struct Object* try_allocate_object(struct ObjectNode* destList, struct ObjectNode* freeList) { + struct ObjectNode* nextObj; if ((nextObj = freeList->next) != NULL) { // Remove from free list @@ -96,7 +95,7 @@ struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNod geo_remove_child(&nextObj->gfx.node); geo_add_child(&gObjParentGraphNode, &nextObj->gfx.node); - return (struct Object *) nextObj; + return (struct Object*)nextObj; } /** @@ -104,7 +103,7 @@ struct Object *try_allocate_object(struct ObjectNode *destList, struct ObjectNod * singly linked freeList. * This function seems to have been replaced by deallocate_object. */ -void unused_deallocate(struct LinkedList *freeList, struct LinkedList *node) { +void unused_deallocate(struct LinkedList* freeList, struct LinkedList* node) { // Remove from doubly linked list node->next->prev = node->prev; node->prev->next = node->next; @@ -117,7 +116,7 @@ void unused_deallocate(struct LinkedList *freeList, struct LinkedList *node) { * Remove the given object from the object list that it's currently in, and * insert it at the beginning of the free list (singly linked). */ -static void deallocate_object(struct ObjectNode *freeList, struct ObjectNode *obj) { +static void deallocate_object(struct ObjectNode* freeList, struct ObjectNode* obj) { // Remove from object list obj->next->prev = obj->prev; obj->prev->next = obj->next; @@ -135,8 +134,8 @@ void init_free_object_list(void) { s32 poolLength = OBJECT_POOL_CAPACITY; // Add the first object in the pool to the free list - struct Object *obj = &gObjectPool[0]; - gFreeObjectList.next = (struct ObjectNode *) obj; + struct Object* obj = &gObjectPool[0]; + gFreeObjectList.next = (struct ObjectNode*)obj; // Link each object in the pool to the following object for (i = 0; i < poolLength - 1; i++) { @@ -151,7 +150,7 @@ void init_free_object_list(void) { /** * Clear each object list, without adding the objects back to the free list. */ -void clear_object_lists(struct ObjectNode *objLists) { +void clear_object_lists(struct ObjectNode* objLists) { s32 i; for (i = 0; i < NUM_OBJ_LISTS; i++) { @@ -164,12 +163,12 @@ void clear_object_lists(struct ObjectNode *objLists) { * This function looks broken, but it appears to attempt to delete the leaf * graph nodes under obj and obj's siblings. */ -UNUSED static void unused_delete_leaf_nodes(struct Object *obj) { - struct Object *children; - struct Object *sibling; - struct Object *obj0 = obj; +UNUSED static void unused_delete_leaf_nodes(struct Object* obj) { + struct Object* children; + struct Object* sibling; + struct Object* obj0 = obj; - if ((children = (struct Object *) obj->header.gfx.node.children) != NULL) { + if ((children = (struct Object*)obj->header.gfx.node.children) != NULL) { unused_delete_leaf_nodes(children); } else { // No children @@ -177,16 +176,16 @@ UNUSED static void unused_delete_leaf_nodes(struct Object *obj) { } // Probably meant to be != - while ((sibling = (struct Object *) obj->header.gfx.node.next) == obj0) { + while ((sibling = (struct Object*)obj->header.gfx.node.next) == obj0) { unused_delete_leaf_nodes(sibling); - obj = (struct Object *) sibling->header.gfx.node.next; + obj = (struct Object*)sibling->header.gfx.node.next; } } /** * Free the given object. */ -void unload_object(struct Object *obj) { +void unload_object(struct Object* obj) { obj->activeFlags = ACTIVE_FLAG_DEACTIVATED; obj->prevObj = NULL; @@ -206,22 +205,21 @@ void unload_object(struct Object *obj) { * an unimportant object if necessary. If this is not possible, hang using an * infinite loop. */ -struct Object *allocate_object(struct ObjectNode *objList) { +struct Object* allocate_object(struct ObjectNode* objList) { s32 i; - struct Object *obj = try_allocate_object(objList, &gFreeObjectList); + struct Object* obj = try_allocate_object(objList, &gFreeObjectList); // The object list is full if the newly created pointer is NULL. // If this happens, we first attempt to unload unimportant objects // in order to finish allocating the object. if (obj == NULL) { // Look for an unimportant object to kick out. - struct Object *unimportantObj = find_unimportant_object(); + struct Object* unimportantObj = find_unimportant_object(); // If no unimportant object exists, then the object pool is exhausted. if (unimportantObj == NULL) { // We've met with a terrible fate. - while (TRUE) { - } + while (TRUE) {} } else { // If an unimportant object does exist, unload it and take its slot. unload_object(unimportantObj); @@ -250,7 +248,8 @@ struct Object *allocate_object(struct ObjectNode *objList) { } #else // -O2 needs everything until = on the same line - for (i = 0; i < 0x50; i++) obj->rawData.asS32[i] = 0; + for (i = 0; i < 0x50; i++) + obj->rawData.asS32[i] = 0; #endif obj->unused1 = 0; @@ -297,8 +296,8 @@ struct Object *allocate_object(struct ObjectNode *objList) { /** * If the object is close to being on the floor, move it to be exactly on the floor. */ -static void snap_object_to_floor(struct Object *obj) { - struct Surface *surface; +static void snap_object_to_floor(struct Object* obj) { + struct Surface* surface; obj->oFloorHeight = find_floor(obj->oPosX, obj->oPosY, obj->oPosZ, &surface); @@ -311,11 +310,11 @@ static void snap_object_to_floor(struct Object *obj) { /** * Spawn an object at the origin with the behavior script at virtual address bhvScript. */ -struct Object *create_object(const BehaviorScript *bhvScript) { +struct Object* create_object(const BehaviorScript* bhvScript) { s32 objListIndex; - struct Object *obj; - struct ObjectNode *objList; - const BehaviorScript *behavior = bhvScript; + struct Object* obj; + struct ObjectNode* objList; + const BehaviorScript* behavior = bhvScript; // If the first behavior script command is "begin ", then // extract the object list from it @@ -356,7 +355,7 @@ struct Object *create_object(const BehaviorScript *bhvScript) { /** * Mark an object to be unloaded at the end of the frame. */ -void mark_obj_for_deletion(struct Object *obj) { +void mark_obj_for_deletion(struct Object* obj) { //! Same issue as obj_mark_for_deletion obj->activeFlags = ACTIVE_FLAG_DEACTIVATED; } diff --git a/src/game/spawn_sound.c b/src/game/spawn_sound.c index af6adfce..573dd54c 100644 --- a/src/game/spawn_sound.c +++ b/src/game/spawn_sound.c @@ -15,7 +15,7 @@ * of sound states. Used for the stepping sounds of various * objects. (King Bobomb, Bowser, King Whomp) */ -void exec_anim_sound_state(struct SoundState *soundStates) { +void exec_anim_sound_state(struct SoundState* soundStates) { s32 stateIdx = gCurrentObject->oSoundStateID; switch (soundStates[stateIdx].playSound) { @@ -49,7 +49,7 @@ void exec_anim_sound_state(struct SoundState *soundStates) { * (Breakable walls, King Bobomb exploding, etc) */ void create_sound_spawner(s32 soundMagic) { - struct Object *obj = spawn_object(gCurrentObject, 0, bhvSoundSpawner); + struct Object* obj = spawn_object(gCurrentObject, 0, bhvSoundSpawner); obj->oSoundEffectUnkF4 = soundMagic; } diff --git a/src/goddard/debug_utils.c b/src/goddard/debug_utils.c index b2ea3f8a..3be4621e 100644 --- a/src/goddard/debug_utils.c +++ b/src/goddard/debug_utils.c @@ -15,26 +15,19 @@ struct UnkBufThing { // data static s32 sNumRoutinesInStack = 0; // @ 801A8280 -static s32 sTimerGadgetColours[7] = { - COLOUR_RED, - COLOUR_WHITE, - COLOUR_GREEN, - COLOUR_BLUE, - COLOUR_GRAY, - COLOUR_YELLOW, - COLOUR_PINK -}; +static s32 sTimerGadgetColours[7] = { COLOUR_RED, COLOUR_WHITE, COLOUR_GREEN, COLOUR_BLUE, + COLOUR_GRAY, COLOUR_YELLOW, COLOUR_PINK }; static s32 sNumActiveMemTrackers = 0; // @ 801A82A0 static u32 sPrimarySeed = 0x12345678; // @ 801A82A4 static u32 sSecondarySeed = 0x58374895; // @ 801A82A8 // bss -u8 *gGdStreamBuffer; // @ 801BA190 -static const char *sRoutineNames[64]; // @ 801BA198 +u8* gGdStreamBuffer; // @ 801BA190 +static const char* sRoutineNames[64]; // @ 801BA198 static s32 sTimingActive; // @ 801BA298 static struct GdTimer sTimers[GD_NUM_TIMERS]; // @ 801BA2A0 static struct MemTracker sMemTrackers[GD_NUM_MEM_TRACKERS]; // @ 801BA720 -static struct MemTracker *sActiveMemTrackers[16]; // @ 801BA920 +static struct MemTracker* sActiveMemTrackers[16]; // @ 801BA920 /* * Memtrackers @@ -53,9 +46,9 @@ static struct MemTracker *sActiveMemTrackers[16]; // @ 801BA920 /** * Creates a new memtracker with the specified name */ -struct MemTracker *new_memtracker(const char *name) { +struct MemTracker* new_memtracker(const char* name) { s32 i; - struct MemTracker *tracker = NULL; + struct MemTracker* tracker = NULL; for (i = 0; i < ARRAY_COUNT(sMemTrackers); i++) { if (sMemTrackers[i].name == NULL) { @@ -76,7 +69,7 @@ struct MemTracker *new_memtracker(const char *name) { * Returns the memtracker with the specified name, or NULL if it * does not exist */ -struct MemTracker *get_memtracker(const char *name) { +struct MemTracker* get_memtracker(const char* name) { s32 i; for (i = 0; i < ARRAY_COUNT(sMemTrackers); i++) { @@ -93,8 +86,8 @@ struct MemTracker *get_memtracker(const char *name) { /** * Records the amount of heap usage before allocating memory. */ -struct MemTracker *start_memtracker(const char *name) { - struct MemTracker *tracker = get_memtracker(name); +struct MemTracker* start_memtracker(const char* name) { + struct MemTracker* tracker = get_memtracker(name); // Create one if it doesn't exist if (tracker == NULL) { @@ -104,7 +97,7 @@ struct MemTracker *start_memtracker(const char *name) { } } - tracker->begin = (f32) get_alloc_mem_amt(); + tracker->begin = (f32)get_alloc_mem_amt(); if (sNumActiveMemTrackers >= ARRAY_COUNT(sActiveMemTrackers)) { fatal_printf("too many memtracker calls"); } @@ -122,8 +115,8 @@ void print_most_recent_memtracker_name(void) { /** * Records the amount of heap usage after allocating memory. */ -u32 stop_memtracker(const char *name) { - struct MemTracker *tracker; +u32 stop_memtracker(const char* name) { + struct MemTracker* tracker; if (sNumActiveMemTrackers-- < 0) { fatal_printf("bad mem tracker count"); @@ -137,7 +130,7 @@ u32 stop_memtracker(const char *name) { tracker->end = get_alloc_mem_amt(); tracker->total += (tracker->end - tracker->begin); - return (u32) tracker->total; + return (u32)tracker->total; } /** @@ -159,7 +152,7 @@ void remove_all_memtrackers(void) { /** * Returns a memtracker by index rather than name */ -struct MemTracker *get_memtracker_by_index(s32 index) { +struct MemTracker* get_memtracker_by_index(s32 index) { return &sMemTrackers[index]; } @@ -193,8 +186,7 @@ void print_all_timers(void) { gd_printf("\nTimers:\n"); for (i = 0; i < ARRAY_COUNT(sTimers); i++) { if (sTimers[i].name != NULL) { - gd_printf("'%s' = %f (%d)\n", sTimers[i].name, sTimers[i].scaledTotal, - sTimers[i].resetCount); + gd_printf("'%s' = %f (%d)\n", sTimers[i].name, sTimers[i].scaledTotal, sTimers[i].resetCount); } } } @@ -221,7 +213,7 @@ void remove_all_timers(void) { sTimers[i].unused = 0.0f; sTimers[i].scaledTotal = 0.0f; sTimers[i].prevScaledTotal = 0.0f; - sTimers[i].gadgetColourNum = sTimerGadgetColours[(u32) i % 7]; + sTimers[i].gadgetColourNum = sTimerGadgetColours[(u32)i % 7]; sTimers[i].resetCount = 0; } activate_timing(); @@ -230,9 +222,9 @@ void remove_all_timers(void) { /** * Creates a new timer with the specified name */ -static struct GdTimer *new_timer(const char *name) { +static struct GdTimer* new_timer(const char* name) { s32 i; - struct GdTimer *timer = NULL; + struct GdTimer* timer = NULL; for (i = 0; i < ARRAY_COUNT(sTimers); i++) { if (sTimers[i].name == NULL) { @@ -248,7 +240,7 @@ static struct GdTimer *new_timer(const char *name) { /** * Returns the timer with the specified name, or NULL if it does not exist. */ -struct GdTimer *get_timer(const char *timerName) { +struct GdTimer* get_timer(const char* timerName) { s32 i; for (i = 0; i < ARRAY_COUNT(sTimers); i++) { @@ -266,8 +258,8 @@ struct GdTimer *get_timer(const char *timerName) { * Returns the timer with the specified name, or aborts the program if it does * not exist. */ -static struct GdTimer *get_timer_checked(const char *timerName) { - struct GdTimer *timer; +static struct GdTimer* get_timer_checked(const char* timerName) { + struct GdTimer* timer; timer = get_timer(timerName); if (timer == NULL) { @@ -280,7 +272,7 @@ static struct GdTimer *get_timer_checked(const char *timerName) { /** * Returns a timer by index rather than name */ -struct GdTimer *get_timernum(s32 index) { +struct GdTimer* get_timernum(s32 index) { if (index >= ARRAY_COUNT(sTimers)) { fatal_printf("get_timernum(): Timer number %d out of range (MAX %d)", index, ARRAY_COUNT(sTimers)); } @@ -289,7 +281,7 @@ struct GdTimer *get_timernum(s32 index) { } /* 23B350 -> 23B42C; orig name: func_8018CB80 */ -void split_timer_ptr(struct GdTimer *timer) { +void split_timer_ptr(struct GdTimer* timer) { if (!sTimingActive) { return; } @@ -301,14 +293,14 @@ void split_timer_ptr(struct GdTimer *timer) { timer->total = 0; } - timer->scaledTotal = ((f32) timer->total) / get_time_scale(); + timer->scaledTotal = ((f32)timer->total) / get_time_scale(); timer->start = timer->end; } /* 23B42C -> 23B49C; not called; orig name: Unknown8018CC5C */ void split_all_timers(void) { s32 i; - struct GdTimer *timer; + struct GdTimer* timer; for (i = 0; i < ARRAY_COUNT(sTimers); i++) { timer = get_timernum(i); @@ -323,7 +315,7 @@ void split_all_timers(void) { */ void start_all_timers(void) { s32 i; - struct GdTimer *timer; + struct GdTimer* timer; if (!sTimingActive) { return; @@ -341,8 +333,8 @@ void start_all_timers(void) { /** * Records the current time before performing an operation */ -void start_timer(const char *name) { - struct GdTimer *timer; +void start_timer(const char* name) { + struct GdTimer* timer; if (!sTimingActive) { return; @@ -366,8 +358,8 @@ void start_timer(const char *name) { /** * Records the current time before performing an operation */ -void restart_timer(const char *name) { - struct GdTimer *timer; +void restart_timer(const char* name) { + struct GdTimer* timer; if (!sTimingActive) { return; @@ -390,8 +382,8 @@ void restart_timer(const char *name) { * Records the current time after performing an operation, adds the elapsed time * to the total, then restarts the timer */ -void split_timer(const char *name) { - struct GdTimer *timer; +void split_timer(const char* name) { + struct GdTimer* timer; if (!sTimingActive) { return; @@ -404,8 +396,8 @@ void split_timer(const char *name) { /** * Records the current time after performing an operation */ -void stop_timer(const char *name) { - struct GdTimer *timer; +void stop_timer(const char* name) { + struct GdTimer* timer; if (!sTimingActive) { return; @@ -418,14 +410,14 @@ void stop_timer(const char *name) { timer->total = 0; } - timer->scaledTotal = ((f32) timer->total) / get_time_scale(); + timer->scaledTotal = ((f32)timer->total) / get_time_scale(); } /** * Returns the scaled total for the specified timer */ -f32 get_scaled_timer_total(const char *name) { - struct GdTimer *timer = get_timer_checked(name); +f32 get_scaled_timer_total(const char* name) { + struct GdTimer* timer = get_timer_checked(name); return timer->scaledTotal; } @@ -433,22 +425,20 @@ f32 get_scaled_timer_total(const char *name) { /** * Unused - returns the raw total for the specified timer */ -f32 get_timer_total(const char *name) { - struct GdTimer *timer = get_timer_checked(name); +f32 get_timer_total(const char* name) { + struct GdTimer* timer = get_timer_checked(name); - return (f32) timer->total; + return (f32)timer->total; } - /* * Miscellaneous debug functions */ - /** * Prints the given string, prints the stack trace, and exits the program */ -void fatal_print(const char *str) { +void fatal_print(const char* str) { fatal_printf(str); } @@ -466,7 +456,7 @@ void print_stack_trace(void) { /** * Prints the formatted string, prints the stack trace, and exits the program */ -void fatal_printf(const char *fmt, ...) { +void fatal_printf(const char* fmt, ...) { char cur; UNUSED u8 filler[4]; va_list vl; @@ -483,7 +473,7 @@ void fatal_printf(const char *fmt, ...) { gd_printf("%f", va_arg(vl, double)); break; case 's': - gd_printf("%s", va_arg(vl, char *)); + gd_printf("%s", va_arg(vl, char*)); break; case 'c': gd_printf("%c", (char)va_arg(vl, int)); @@ -517,9 +507,9 @@ void fatal_printf(const char *fmt, ...) { * "I'm in" * Adds the function name to the stack trace */ -void imin(const char *routine) { +void imin(const char* routine) { sRoutineNames[sNumRoutinesInStack++] = routine; - sRoutineNames[sNumRoutinesInStack] = NULL; //! array bounds is checked after writing this. + sRoutineNames[sNumRoutinesInStack] = NULL; //! array bounds is checked after writing this. if (sNumRoutinesInStack >= ARRAY_COUNT(sRoutineNames)) { fatal_printf("You're in too many routines"); @@ -579,9 +569,9 @@ f32 gd_rand_float(void) { /** * Reimplementation of the standard "atoi" function */ -s32 gd_atoi(const char *str) { +s32 gd_atoi(const char* str) { char cur; - const char *origstr = str; + const char* origstr = str; s32 curval; s32 out = 0; s32 isNegative = FALSE; @@ -617,14 +607,14 @@ s32 gd_atoi(const char *str) { /** * Like the standard "atof" function, but only supports integer values */ -f64 gd_lazy_atof(const char *str, UNUSED u32 *unk) { +f64 gd_lazy_atof(const char* str, UNUSED u32* unk) { return gd_atoi(str); } -static char sHexNumerals[] = {"0123456789ABCDEF"}; +static char sHexNumerals[] = { "0123456789ABCDEF" }; /* 23C018 -> 23C078; orig name: func_8018D848 */ -char *format_number_hex(char *str, s32 val) { +char* format_number_hex(char* str, s32 val) { s32 shift; for (shift = 28; shift > -4; shift -= 4) { @@ -640,7 +630,7 @@ static s32 sPadNumPrint = 0; // @ 801A82C0 /* 23C078 -> 23C174; orig name: func_8018D8A8 */ /* padnum = a decimal number with the max desired output width */ -char *format_number_decimal(char *str, s32 val, s32 padnum) { +char* format_number_decimal(char* str, s32 val, s32 padnum) { s32 i; if (val == 0) { @@ -693,7 +683,7 @@ static s32 int_sci_notation(s32 base, s32 significand) { } /* 23C1C8 -> 23C468; orig name: func_8018D9F8 */ -char *sprint_val_withspecifiers(char *str, union PrintVal val, char *specifiers) { +char* sprint_val_withspecifiers(char* str, union PrintVal val, char* specifiers) { s32 fracPart; // sp3C s32 intPart; // sp38 s32 intPrec; // sp34 @@ -712,8 +702,8 @@ char *sprint_val_withspecifiers(char *str, union PrintVal val, char *specifiers) sPadNumPrint = TRUE; /* doesn't affect hex printing, though... */ str = format_number_hex(str, val.i); } else if (cur == 'f') { - intPart = (s32) val.f; - fracPart = (s32)((val.f - (f32) intPart) * (f32) int_sci_notation(10, fracPrec)); + intPart = (s32)val.f; + fracPart = (s32)((val.f - (f32)intPart) * (f32)int_sci_notation(10, fracPrec)); sPadNumPrint = FALSE; str = format_number_decimal(str, intPart, int_sci_notation(10, intPrec)); *str++ = '.'; @@ -735,14 +725,14 @@ char *sprint_val_withspecifiers(char *str, union PrintVal val, char *specifiers) } /* 23C468 -> 23C4AC; orig name: func_8018DC98 */ -void gd_strcpy(char *dst, const char *src) { +void gd_strcpy(char* dst, const char* src) { while ((*dst++ = *src++)) { ; } } /* 23C4AC -> 23C52C; not called; orig name: Unknown8018DCDC */ -void ascii_to_uppercase(char *str) { +void ascii_to_uppercase(char* str) { char c; while ((c = *str)) { @@ -754,8 +744,8 @@ void ascii_to_uppercase(char *str) { } /* 23C52C -> 23C5A8; orig name: func_8018DD5C */ -char *gd_strdup(const char *src) { - char *dst; // sp24 +char* gd_strdup(const char* src) { + char* dst; // sp24 dst = gd_malloc_perm((gd_strlen(src) + 1) * sizeof(char)); @@ -768,7 +758,7 @@ char *gd_strdup(const char *src) { } /* 23C5A8 -> 23C5FC; orig name: func_8018DDD8 */ -u32 gd_strlen(const char *str) { +u32 gd_strlen(const char* str) { u32 len = 0; while (*str++) { @@ -779,7 +769,7 @@ u32 gd_strlen(const char *str) { } /* 23C5FC -> 23C680; orig name: func_8018DE2C */ -char *gd_strcat(char *dst, const char *src) { +char* gd_strcat(char* dst, const char* src) { while (*dst++) { ; } @@ -796,7 +786,7 @@ char *gd_strcat(char *dst, const char *src) { /* 23C67C -> 23C728; orig name: func_8018DEB0 */ /* Returns a bool, not the position of the mismatch */ -s32 gd_str_not_equal(const char *str1, const char *str2) { +s32 gd_str_not_equal(const char* str1, const char* str2) { while (*str1 && *str2) { if (*str1++ != *str2++) { return TRUE; @@ -807,8 +797,8 @@ s32 gd_str_not_equal(const char *str1, const char *str2) { } /* 23C728 -> 23C7B8; orig name; func_8018DF58 */ -s32 gd_str_contains(const char *str1, const char *str2) { - const char *startsub = str2; +s32 gd_str_contains(const char* str1, const char* str2) { + const char* startsub = str2; while (*str1 && *str2) { if (*str1++ != *str2++) { @@ -820,30 +810,30 @@ s32 gd_str_contains(const char *str1, const char *str2) { } /* 23C7B8 -> 23C7DC; orig name: func_8018DFE8 */ -s32 gd_feof(struct GdFile *f) { +s32 gd_feof(struct GdFile* f) { return f->flags & 0x4; } /* 23C7DC -> 23C7FC; orig name: func_8018E00C */ -void gd_set_feof(struct GdFile *f) { +void gd_set_feof(struct GdFile* f) { f->flags |= 0x4; } /* 23C7FC -> 23CA0C */ -struct GdFile *gd_fopen(const char *filename, const char *mode) { - struct GdFile *f; // sp74 - char *loadedname; // sp70 +struct GdFile* gd_fopen(const char* filename, const char* mode) { + struct GdFile* f; // sp74 + char* loadedname; // sp70 u32 i; // sp6C UNUSED u8 filler[4]; struct UnkBufThing buf; // sp24 - u8 *bufbytes; // sp20 - u8 *fileposptr; // sp1C + u8* bufbytes; // sp20 + u8* fileposptr; // sp1C s32 filecsr; // sp18 filecsr = 0; while (TRUE) { - bufbytes = (u8 *) &buf; + bufbytes = (u8*)&buf; for (i = 0; i < sizeof(struct UnkBufThing); i++) { *bufbytes++ = gGdStreamBuffer[filecsr++]; } @@ -872,7 +862,7 @@ struct GdFile *gd_fopen(const char *filename, const char *mode) { return NULL; } - f->stream = (s8 *) fileposptr; + f->stream = (s8*)fileposptr; f->size = buf.size; f->pos = f->flags = 0; if (gd_str_contains(mode, "w")) { @@ -886,7 +876,7 @@ struct GdFile *gd_fopen(const char *filename, const char *mode) { } /* 23CA0C -> 23CB38; orig name: func_8018E23C */ -s32 gd_fread(s8 *buf, s32 bytes, UNUSED s32 count, struct GdFile *f) { +s32 gd_fread(s8* buf, s32 bytes, UNUSED s32 count, struct GdFile* f) { s32 bytesToRead = bytes; s32 bytesread; @@ -908,12 +898,12 @@ s32 gd_fread(s8 *buf, s32 bytes, UNUSED s32 count, struct GdFile *f) { } /* 23CB38 -> 23CB54; orig name: func_8018E368 */ -void gd_fclose(UNUSED struct GdFile *f) { +void gd_fclose(UNUSED struct GdFile* f) { return; } /* 23CB54 -> 23CB70; orig name: func_8018E384 */ -u32 gd_get_file_size(struct GdFile *f) { +u32 gd_get_file_size(struct GdFile* f) { return f->size; } @@ -923,7 +913,7 @@ s32 is_newline(char c) { } /* 23CBA8 -> 23CCF0; orig name: func_8018E3D8 */ -s32 gd_fread_line(char *buf, u32 size, struct GdFile *f) { +s32 gd_fread_line(char* buf, u32 size, struct GdFile* f) { signed char c; u32 pos = 0; UNUSED u8 filler[4]; diff --git a/src/goddard/draw_objects.c b/src/goddard/draw_objects.c index 77d30be6..2270dc36 100644 --- a/src/goddard/draw_objects.c +++ b/src/goddard/draw_objects.c @@ -21,10 +21,10 @@ */ // forward declarations -void func_80179B64(struct ObjGroup *); -void update_shaders(struct ObjShape *, struct GdVec3f *); -void draw_shape_faces(struct ObjShape *); -void register_light(struct ObjLight *); +void func_80179B64(struct ObjGroup*); +void update_shaders(struct ObjShape*, struct GdVec3f*); +void draw_shape_faces(struct ObjShape*); +void register_light(struct ObjLight*); // types /** @@ -57,14 +57,14 @@ static struct GdColour sClrGrey = { 0.6, 0.6, 0.6 }; // @ 801A80C4 static struct GdColour sClrDarkGrey = { 0.4, 0.4, 0.4 }; // @ 801A80D0 static struct GdColour sClrYellow = { 1.0, 1.0, 0.0 }; // @ 801A80DC static struct GdColour sLightColours[1] = { { 1.0, 1.0, 0.0 } }; // @ 801A80E8 -static struct GdColour *sSelectedColour = &sClrRed; // @ 801A80F4 -struct ObjCamera *gViewUpdateCamera = NULL; // @ 801A80F8 -UNUSED static void *sUnref801A80FC = NULL; +static struct GdColour* sSelectedColour = &sClrRed; // @ 801A80F4 +struct ObjCamera* gViewUpdateCamera = NULL; // @ 801A80F8 +UNUSED static void* sUnref801A80FC = NULL; static s32 sUnreadShapeFlag = 0; // @ 801A8100 -struct GdColour *sColourPalette[5] = { // @ 801A8104 +struct GdColour* sColourPalette[5] = { // @ 801A8104 &sClrWhite, &sClrYellow, &sClrRed, &sClrBlack, &sClrBlack }; -struct GdColour *sWhiteBlack[2] = { +struct GdColour* sWhiteBlack[2] = { //@ 801A8118 &sClrWhite, &sClrBlack, @@ -80,7 +80,7 @@ UNUSED static s32 sUnref801A81A4[4] = { 0 }; // bss u8 gUnref_801B9B30[0x88]; -struct ObjGroup *gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group? +struct ObjGroup* gGdLightGroup; // @ 801B9BB8; is this the main light group? only light group? UNUSED static u8 sUnref_801B9BBC[0x40]; static enum SceneType sSceneProcessType; // @ 801B9C00 @@ -88,17 +88,17 @@ static s32 sUseSelectedColor; // @ 801B9C04 static s16 sPickBuffer[100]; ///< buffer of objects near click static s32 sPickDataTemp; ///< now, only data is the object number of a selected joint static f32 sPickObjDistance; ///< distance between object position and cursor click location -static struct GdObj *sPickedObject; ///< object selected with cursor +static struct GdObj* sPickedObject; ///< object selected with cursor /// Various counters and pointers set in update_view() and used in various `draw_XXX` functions static struct { u8 filler1[4]; // @ 801B9CE0 - struct ObjView *view; // @ 801B9CE4 + struct ObjView* view; // @ 801B9CE4 s32 unreadCounter; // @ 801B9CE8 s32 mtlDlNum; // @ 801B9CEC; name is a big guess s32 shapesDrawn; // @ 801B9CF0 s32 unused; // @ 801B9CF4 } sUpdateViewState; -static struct ObjLight *sPhongLight; // material light? phong light? +static struct ObjLight* sPhongLight; // material light? phong light? static struct GdVec3f sPhongLightPosition; //@ 801B9D00; guess; light source unit position for light // flagged 0x20 (sPhongLight) static struct GdVec3f sLightPositionOffset; // @ 801B9D10 @@ -125,23 +125,23 @@ void setup_lights(void) { /** * @note Not called */ -void Unknown801781DC(struct ObjZone *zone) { +void Unknown801781DC(struct ObjZone* zone) { struct GdVec3f lightPos; // 3c - struct ObjUnk200000 *unk; + struct ObjUnk200000* unk; f32 sp34; f32 sp30; f32 sp2C; - struct ObjLight *light; - register struct ListNode *link = zone->unk30->firstMember; // s0 (24) - struct GdObj *obj; // 20 + struct ObjLight* light; + register struct ListNode* link = zone->unk30->firstMember; // s0 (24) + struct GdObj* obj; // 20 while (link != NULL) { obj = link->obj; - light = (struct ObjLight *) gGdLightGroup->firstMember->obj; + light = (struct ObjLight*)gGdLightGroup->firstMember->obj; lightPos.x = light->position.x; lightPos.y = light->position.y; lightPos.z = light->position.z; - unk = (struct ObjUnk200000 *) obj; + unk = (struct ObjUnk200000*)obj; sp34 = gd_dot_vec3f(&unk->unk34->normal, &unk->unk30->pos); sp30 = gd_dot_vec3f(&unk->unk34->normal, &lightPos); lightPos.x -= unk->unk34->normal.x * (sp30 - sp34); @@ -163,11 +163,11 @@ void Unknown801781DC(struct ObjZone *zone) { } /* 226C6C -> 226FDC */ -void draw_shape(struct ObjShape *shape, s32 flag, f32 c, f32 d, f32 e, // "sweep" indices 0-2 x, y, z - f32 f, f32 g, f32 h, // translate shape + store offset (unused) - f32 i, f32 j, f32 k, // translate shape - f32 l, f32 m, f32 n, // rotate x, y, z - s32 colorIdx, Mat4f *rotMtx) { +void draw_shape(struct ObjShape* shape, s32 flag, f32 c, f32 d, f32 e, // "sweep" indices 0-2 x, y, z + f32 f, f32 g, f32 h, // translate shape + store offset (unused) + f32 i, f32 j, f32 k, // translate shape + f32 l, f32 m, f32 n, // rotate x, y, z + s32 colorIdx, Mat4f* rotMtx) { UNUSED u8 filler[8]; struct GdVec3f sp1C; @@ -242,9 +242,9 @@ void draw_shape(struct ObjShape *shape, s32 flag, f32 c, f32 d, f32 e, // "sweep split_timer("drawshape"); } -void draw_shape_2d(struct ObjShape *shape, s32 flag, UNUSED f32 c, UNUSED f32 d, UNUSED f32 e, f32 f, - f32 g, f32 h, UNUSED f32 i, UNUSED f32 j, UNUSED f32 k, UNUSED f32 l, UNUSED f32 m, - UNUSED f32 n, UNUSED s32 color, UNUSED s32 p) { +void draw_shape_2d(struct ObjShape* shape, s32 flag, UNUSED f32 c, UNUSED f32 d, UNUSED f32 e, f32 f, f32 g, f32 h, + UNUSED f32 i, UNUSED f32 j, UNUSED f32 k, UNUSED f32 l, UNUSED f32 m, UNUSED f32 n, UNUSED s32 color, + UNUSED s32 p) { UNUSED u8 filler[8]; struct GdVec3f sp1C; @@ -268,12 +268,12 @@ void draw_shape_2d(struct ObjShape *shape, s32 flag, UNUSED f32 c, UNUSED f32 d, split_timer("drawshape2d"); } -void draw_light(struct ObjLight *light) { +void draw_light(struct ObjLight* light) { struct GdVec3f sp94; Mat4f sp54; - UNUSED Mat4f *uMatPtr; + UNUSED Mat4f* uMatPtr; UNUSED f32 uMultiplier; - struct ObjShape *shape; + struct ObjShape* shape; if (sSceneProcessType == FIND_PICKS) { return; @@ -302,18 +302,18 @@ void draw_light(struct ObjLight *light) { shape->unk50 = sLightDlCounter; } - draw_shape_2d(shape, 2, 1.0f, 1.0f, 1.0f, light->position.x, light->position.y, light->position.z, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1, 0); + draw_shape_2d(shape, 2, 1.0f, 1.0f, 1.0f, light->position.x, light->position.y, light->position.z, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 0.0f, -1, 0); } -void draw_material(struct ObjMaterial *mtl) { +void draw_material(struct ObjMaterial* mtl) { s32 mtlType = mtl->type; // 24 if (mtlType == GD_MTL_SHINE_DL) { if (sPhongLight != NULL && sPhongLight->unk30 > 0.0f) { if (gViewUpdateCamera != NULL) { - gd_dl_hilite(mtl->gddlNumber, gViewUpdateCamera, &sPhongLight->position, - &sLightPositionOffset, &sPhongLightPosition, &sPhongLight->colour); + gd_dl_hilite(mtl->gddlNumber, gViewUpdateCamera, &sPhongLight->position, &sLightPositionOffset, + &sPhongLightPosition, &sPhongLight->colour); } else { fatal_printf("draw_material() no active camera for phong"); } @@ -332,7 +332,7 @@ void draw_material(struct ObjMaterial *mtl) { * Create a `GdDisplayList` and store its number in the input `ObjMaterial` * if this material doesn't have one */ -void create_mtl_gddl_if_empty(struct ObjMaterial *mtl) { +void create_mtl_gddl_if_empty(struct ObjMaterial* mtl) { if (mtl->gddlNumber == 0) { mtl->gddlNumber = create_mtl_gddl(mtl->type); } @@ -343,19 +343,19 @@ void create_mtl_gddl_if_empty(struct ObjMaterial *mtl) { * unconverted vertex data, or old vertex structures (like `BetaVtx`) * @note Not called */ -void check_face_bad_vtx(struct ObjFace *face) { +void check_face_bad_vtx(struct ObjFace* face) { s32 i; - struct ObjVertex *vtx; + struct ObjVertex* vtx; for (i = 0; i < face->vtxCount; i++) { vtx = face->vertices[i]; // These seem to be checks against bad conversions, or an outdated vertex structure..? - if ((uintptr_t) vtx == 39) { + if ((uintptr_t)vtx == 39) { gd_printf("bad1\n"); return; } - if ((uintptr_t) vtx->gbiVerts == 0x3F800000) { - fatal_printf("bad2 %x,%d,%d,%d\n", (u32) (uintptr_t) vtx, vtx->scaleFactor, vtx->id, vtx->header.type); + if ((uintptr_t)vtx->gbiVerts == 0x3F800000) { + fatal_printf("bad2 %x,%d,%d,%d\n", (u32)(uintptr_t)vtx, vtx->scaleFactor, vtx->id, vtx->header.type); } } } @@ -373,7 +373,7 @@ void check_face_bad_vtx(struct ObjFace *face) { * @param idx Index of colour * @return Pointer to a GdColour struct */ -struct GdColour *gd_get_colour(s32 idx) { +struct GdColour* gd_get_colour(s32 idx) { switch (idx) { case COLOUR_BLACK: return &sClrBlack; @@ -432,15 +432,15 @@ void Unknown80178ECC(f32 v0X, f32 v0Y, f32 v0Z, f32 v1X, f32 v1Y, f32 v1Z) { * Rendering function for `ObjFace` structures. It has a fair amount * of stub code */ -void draw_face(struct ObjFace *face) { - struct ObjVertex *vtx; // 3c +void draw_face(struct ObjFace* face) { + struct ObjVertex* vtx; // 3c f32 z; // 38 f32 y; // 34 f32 x; // 30 UNUSED u8 filler[12]; s32 i; // 20; also used to store mtl's gddl number s32 hasTextCoords; // 1c - Vtx *gbiVtx; // 18 + Vtx* gbiVtx; // 18 imin("draw_face"); hasTextCoords = FALSE; @@ -455,8 +455,7 @@ void draw_face(struct ObjFace *face) { } } - if (FALSE) { - } + if (FALSE) {} } check_tri_display(face->vtxCount); @@ -477,7 +476,7 @@ void draw_face(struct ObjFace *face) { //! as the struct requests fields passed the end of an ObjVertex. //! The bad code is statically unreachable, so... if (hasTextCoords) { - set_vtx_tc_buf(((struct BetaVtx *) vtx)->s, ((struct BetaVtx *) vtx)->t); + set_vtx_tc_buf(((struct BetaVtx*)vtx)->s, ((struct BetaVtx*)vtx)->t); } gbiVtx = gd_dl_make_vertex(x, y, z, vtx->alpha); @@ -518,7 +517,7 @@ void draw_rect_stroke(s32 color, f32 ulx, f32 uly, f32 lrx, f32 lry) { * Uncalled function that calls other orphan stub functions. * @note Not called */ -void Unknown801792F0(struct GdObj *obj) { +void Unknown801792F0(struct GdObj* obj) { char objId[32]; struct GdVec3f objPos; @@ -532,11 +531,11 @@ void Unknown801792F0(struct GdObj *obj) { /** * Draws a label */ -void draw_label(struct ObjLabel *label) { +void draw_label(struct ObjLabel* label) { struct GdVec3f position; char strbuf[0x100]; UNUSED u8 filler[16]; - struct ObjValPtr *valptr; + struct ObjValPtr* valptr; union ObjVarVal varval; valptrproc_t valfn = label->valfn; @@ -590,8 +589,8 @@ void draw_label(struct ObjLabel *label) { } /* 227DF8 -> 227F3C; orig name: Proc80179628 */ -void draw_net(struct ObjNet *self) { - struct ObjNet *net = self; +void draw_net(struct ObjNet* self) { + struct ObjNet* net = self; s32 netColor; UNUSED u8 filler[80]; @@ -606,8 +605,8 @@ void draw_net(struct ObjNet *self) { } if (net->shapePtr != NULL) { - draw_shape(net->shapePtr, 0x10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, netColor, &net->mat168); + draw_shape(net->shapePtr, 0x10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, + netColor, &net->mat168); } if (net->unk1C8 != NULL) { @@ -618,31 +617,25 @@ void draw_net(struct ObjNet *self) { /** * Draws a gadget */ -void draw_gadget(struct ObjGadget *gdgt) { +void draw_gadget(struct ObjGadget* gdgt) { s32 colour = 0; if (gdgt->colourNum != 0) { colour = gdgt->colourNum; } - draw_rect_fill(colour, - gdgt->worldPos.x, - gdgt->worldPos.y, - gdgt->worldPos.x + gdgt->sliderPos * gdgt->size.x, - gdgt->worldPos.y + gdgt->size.y); + draw_rect_fill(colour, gdgt->worldPos.x, gdgt->worldPos.y, gdgt->worldPos.x + gdgt->sliderPos * gdgt->size.x, + gdgt->worldPos.y + gdgt->size.y); if (gdgt->header.drawFlags & OBJ_HIGHLIGHTED) { - draw_rect_stroke(COLOUR_YELLOW, - gdgt->worldPos.x, - gdgt->worldPos.y, - gdgt->worldPos.x + gdgt->sliderPos * gdgt->size.x, - gdgt->worldPos.y + gdgt->size.y); + draw_rect_stroke(COLOUR_YELLOW, gdgt->worldPos.x, gdgt->worldPos.y, + gdgt->worldPos.x + gdgt->sliderPos * gdgt->size.x, gdgt->worldPos.y + gdgt->size.y); } gdgt->header.drawFlags &= ~OBJ_HIGHLIGHTED; } /* 22803C -> 22829C */ -void draw_camera(struct ObjCamera *cam) { +void draw_camera(struct ObjCamera* cam) { struct GdVec3f sp44; UNUSED f32 sp40 = 0.0f; @@ -680,11 +673,11 @@ void draw_camera(struct ObjCamera *cam) { * for the GdObj.drawFlags * @note Not called */ -void Unknown80179ACC(struct GdObj *obj) { +void Unknown80179ACC(struct GdObj* obj) { switch (obj->type) { case OBJ_TYPE_NETS: - if (((struct ObjNet *) obj)->unk1C8 != NULL) { - func_80179B64(((struct ObjNet *) obj)->unk1C8); + if (((struct ObjNet*)obj)->unk1C8 != NULL) { + func_80179B64(((struct ObjNet*)obj)->unk1C8); } break; default: @@ -697,14 +690,14 @@ void Unknown80179ACC(struct GdObj *obj) { * Forms uncalled recursive loop with Unknown80179ACC() * @note Not called */ -void func_80179B64(struct ObjGroup *group) { - apply_to_obj_types_in_group(OBJ_TYPE_LABELS | OBJ_TYPE_GADGETS | OBJ_TYPE_CAMERAS | OBJ_TYPE_NETS - | OBJ_TYPE_JOINTS | OBJ_TYPE_BONES, - (applyproc_t) Unknown80179ACC, group); +void func_80179B64(struct ObjGroup* group) { + apply_to_obj_types_in_group(OBJ_TYPE_LABELS | OBJ_TYPE_GADGETS | OBJ_TYPE_CAMERAS | OBJ_TYPE_NETS | + OBJ_TYPE_JOINTS | OBJ_TYPE_BONES, + (applyproc_t)Unknown80179ACC, group); } /* 22836C -> 228498 */ -void world_pos_to_screen_coords(struct GdVec3f *pos, struct ObjCamera *cam, struct ObjView *view) { +void world_pos_to_screen_coords(struct GdVec3f* pos, struct ObjCamera* cam, struct ObjView* view) { gd_rotate_and_translate_vec3f(pos, &cam->unkE8); if (pos->z > -256.0f) { return; @@ -727,11 +720,11 @@ void world_pos_to_screen_coords(struct GdVec3f *pos, struct ObjCamera *cam, stru * @param input `GdObj` to check position of * @return void */ -void check_grabbable_click(struct GdObj *input) { +void check_grabbable_click(struct GdObj* input) { struct GdVec3f objPos; UNUSED u8 filler[12]; - struct GdObj *obj; - Mat4f *mtx; + struct GdObj* obj; + Mat4f* mtx; if (gViewUpdateCamera == NULL) { return; @@ -771,7 +764,7 @@ void check_grabbable_click(struct GdObj *input) { * @param interactables components of `ObjView` * @param lightgrp lights of `ObjView */ -void drawscene(enum SceneType process, struct ObjGroup *interactables, struct ObjGroup *lightgrp) { +void drawscene(enum SceneType process, struct ObjGroup* interactables, struct ObjGroup* lightgrp) { UNUSED u8 filler[16]; restart_timer("drawscene"); @@ -782,19 +775,17 @@ void drawscene(enum SceneType process, struct ObjGroup *interactables, struct Ob set_gd_mtx_parameters(G_MTX_PROJECTION | G_MTX_MUL | G_MTX_PUSH); if (sUpdateViewState.view->projectionType == 1) { gd_create_perspective_matrix(sUpdateViewState.view->clipping.z, - sUpdateViewState.view->lowerRight.x / sUpdateViewState.view->lowerRight.y, - sUpdateViewState.view->clipping.x, sUpdateViewState.view->clipping.y); + sUpdateViewState.view->lowerRight.x / sUpdateViewState.view->lowerRight.y, + sUpdateViewState.view->clipping.x, sUpdateViewState.view->clipping.y); } else { - gd_create_ortho_matrix( - -sUpdateViewState.view->lowerRight.x / 2.0, sUpdateViewState.view->lowerRight.x / 2.0, - -sUpdateViewState.view->lowerRight.y / 2.0, sUpdateViewState.view->lowerRight.y / 2.0, - sUpdateViewState.view->clipping.x, sUpdateViewState.view->clipping.y); + gd_create_ortho_matrix(-sUpdateViewState.view->lowerRight.x / 2.0, sUpdateViewState.view->lowerRight.x / 2.0, + -sUpdateViewState.view->lowerRight.y / 2.0, sUpdateViewState.view->lowerRight.y / 2.0, + sUpdateViewState.view->clipping.x, sUpdateViewState.view->clipping.y); } if (lightgrp != NULL) { set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); - apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS | OBJ_TYPE_PARTICLES, - (applyproc_t) apply_obj_draw_fn, lightgrp); + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS | OBJ_TYPE_PARTICLES, (applyproc_t)apply_obj_draw_fn, lightgrp); set_gd_mtx_parameters(G_MTX_PROJECTION | G_MTX_MUL | G_MTX_PUSH); } @@ -814,21 +805,20 @@ void drawscene(enum SceneType process, struct ObjGroup *interactables, struct Ob } sNumActiveLights = 1; - apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t) register_light, gGdLightGroup); + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t)register_light, gGdLightGroup); split_timer("draw1"); restart_timer("drawobj"); imin("process_group"); if (sSceneProcessType == FIND_PICKS) { - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) check_grabbable_click, interactables); + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)check_grabbable_click, interactables); } else { - apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS | OBJ_TYPE_GADGETS | OBJ_TYPE_NETS - | OBJ_TYPE_PARTICLES, - (applyproc_t) apply_obj_draw_fn, interactables); + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS | OBJ_TYPE_GADGETS | OBJ_TYPE_NETS | OBJ_TYPE_PARTICLES, + (applyproc_t)apply_obj_draw_fn, interactables); } imout(); split_timer("drawobj"); gd_setproperty(GD_PROP_LIGHTING, 0.0f, 0.0f, 0.0f); - apply_to_obj_types_in_group(OBJ_TYPE_LABELS, (applyproc_t) apply_obj_draw_fn, interactables); + apply_to_obj_types_in_group(OBJ_TYPE_LABELS, (applyproc_t)apply_obj_draw_fn, interactables); gd_setproperty(GD_PROP_LIGHTING, 1.0f, 0.0f, 0.0f); gd_dl_pop_matrix(); imout(); @@ -840,7 +830,7 @@ void drawscene(enum SceneType process, struct ObjGroup *interactables, struct Ob * A drawing function that does nothing. This function is used for * `GdObj`s that don't need to be rendered */ -void draw_nothing(UNUSED struct GdObj *nop) { +void draw_nothing(UNUSED struct GdObj* nop) { } /** @@ -848,11 +838,11 @@ void draw_nothing(UNUSED struct GdObj *nop) { * draw_shape() and draw_shape_2d(), or when creating the shape * `GdDisplayList` when calling create_shape_gddl() */ -void draw_shape_faces(struct ObjShape *shape) { +void draw_shape_faces(struct ObjShape* shape) { sUpdateViewState.mtlDlNum = 0; sUpdateViewState.unreadCounter = 0; gddl_is_loading_stub_dl(FALSE); - sUnreadShapeFlag = (s32) shape->flag & 1; + sUnreadShapeFlag = (s32)shape->flag & 1; set_render_alpha(shape->alpha); if (shape->dlNums[gGdFrameBufNum] != 0) { draw_indexed_dl(shape->dlNums[gGdFrameBufNum], shape->unk50); @@ -866,11 +856,11 @@ void draw_shape_faces(struct ObjShape *shape) { /** * Rendering function for `ObjParticle`. */ -void draw_particle(struct GdObj *obj) { - struct ObjParticle *ptc = (struct ObjParticle *) obj; +void draw_particle(struct GdObj* obj) { + struct ObjParticle* ptc = (struct ObjParticle*)obj; UNUSED u8 filler1[16]; - struct GdColour *white; - struct GdColour *black; + struct GdColour* white; + struct GdColour* black; f32 brightness; UNUSED u8 filler2[16]; @@ -890,8 +880,8 @@ void draw_particle(struct GdObj *obj) { if (ptc->timeout > 0) { ptc->shapePtr->unk50 = ptc->timeout; - draw_shape_2d(ptc->shapePtr, 2, 1.0f, 1.0f, 1.0f, ptc->pos.x, ptc->pos.y, ptc->pos.z, 0.0f, - 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, -1, 0); + draw_shape_2d(ptc->shapePtr, 2, 1.0f, 1.0f, 1.0f, ptc->pos.x, ptc->pos.y, ptc->pos.z, 0.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 0.0f, -1, 0); } if (ptc->unk60 == 3) { if (ptc->subParticlesGrp != NULL) { @@ -906,8 +896,8 @@ void draw_particle(struct GdObj *obj) { * @note This function returns before doing any work. It seems * that Goddard moved away from using bones in the final code */ -void draw_bone(struct GdObj *obj) { - struct ObjBone *bone = (struct ObjBone *) obj; +void draw_bone(struct GdObj* obj) { + struct ObjBone* bone = (struct ObjBone*)obj; UNUSED u8 filler1[4]; s32 colour; UNUSED u8 filler2[4]; @@ -937,15 +927,15 @@ void draw_bone(struct GdObj *obj) { /** * Rendering function for `ObjJoint`. */ -void draw_joint(struct GdObj *obj) { - struct ObjJoint *joint = (struct ObjJoint *) obj; +void draw_joint(struct GdObj* obj) { + struct ObjJoint* joint = (struct ObjJoint*)obj; UNUSED u8 filler1[4]; UNUSED f32 sp7C = 70.0f; UNUSED u8 filler2[4]; UNUSED s32 sp74 = 1; s32 colour; UNUSED u8 filler3[8]; - struct ObjShape *boneShape; + struct ObjShape* boneShape; UNUSED u8 filler4[28]; if ((boneShape = joint->shapePtr) == NULL) { @@ -958,8 +948,8 @@ void draw_joint(struct GdObj *obj) { colour = joint->colourNum; } - draw_shape(boneShape, 0x10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, - colour, &joint->mat128); + draw_shape(boneShape, 0x10, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, colour, + &joint->mat128); } /** @@ -968,19 +958,19 @@ void draw_joint(struct GdObj *obj) { * @param grp `ObjGroup` of objects to draw * @return void */ -void draw_group(struct ObjGroup *grp) { +void draw_group(struct ObjGroup* grp) { if (grp == NULL) { fatal_print("Draw_Group: Bad group definition!"); } - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) apply_obj_draw_fn, grp); + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)apply_obj_draw_fn, grp); } /** * Rendering function for `ObjPlane`. */ -void draw_plane(struct GdObj *obj) { - struct ObjPlane *plane = (struct ObjPlane *) obj; +void draw_plane(struct GdObj* obj) { + struct ObjPlane* plane = (struct ObjPlane*)obj; if (obj->drawFlags & OBJ_HIGHLIGHTED) { obj->drawFlags &= ~OBJ_HIGHLIGHTED; @@ -997,7 +987,7 @@ void draw_plane(struct GdObj *obj) { * @param obj `GdObj` to draw * @return void */ -void apply_obj_draw_fn(struct GdObj *obj) { +void apply_obj_draw_fn(struct GdObj* obj) { if (obj == NULL) { fatal_print("Bad object!"); } @@ -1011,7 +1001,7 @@ void apply_obj_draw_fn(struct GdObj *obj) { /** * Count input `ObjLight` as an active light, if it wasn't already counted. */ -void register_light(struct ObjLight *light) { +void register_light(struct ObjLight* light) { set_light_id(light->id); gd_setproperty(GD_PROP_LIGHTING, 2.0f, 0.0f, 0.0f); if (light->flags & LIGHT_NEW_UNCOUNTED) { @@ -1021,7 +1011,7 @@ void register_light(struct ObjLight *light) { } /* 229180 -> 229564 */ -void Proc8017A980(struct ObjLight *light) { +void Proc8017A980(struct ObjLight* light) { f32 sp24; // diffuse factor? f32 sp20; f32 sp1C; @@ -1056,15 +1046,14 @@ void Proc8017A980(struct ObjLight *light) { sp24 *= sp20; } set_light_id(light->id); - gd_setproperty(GD_PROP_DIFUSE_COLOUR, light->diffuse.r * sp24, light->diffuse.g * sp24, - light->diffuse.b * sp24); - gd_setproperty(GD_PROP_LIGHT_DIR, sLightPositionCache[light->id].x, - sLightPositionCache[light->id].y, sLightPositionCache[light->id].z); + gd_setproperty(GD_PROP_DIFUSE_COLOUR, light->diffuse.r * sp24, light->diffuse.g * sp24, light->diffuse.b * sp24); + gd_setproperty(GD_PROP_LIGHT_DIR, sLightPositionCache[light->id].x, sLightPositionCache[light->id].y, + sLightPositionCache[light->id].z); gd_setproperty(GD_PROP_LIGHTING, 2.0f, 0.0f, 0.0f); } /* 229568 -> 229658; orig name: func_8017AD98 */ -void update_shaders(struct ObjShape *shape, struct GdVec3f *offset) { +void update_shaders(struct ObjShape* shape, struct GdVec3f* offset) { restart_timer("updateshaders"); stash_current_gddl(); sLightPositionOffset.x = offset->x; @@ -1072,11 +1061,10 @@ void update_shaders(struct ObjShape *shape, struct GdVec3f *offset) { sLightPositionOffset.z = offset->z; sPhongLight = NULL; if (gGdLightGroup != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t) Proc8017A980, gGdLightGroup); + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t)Proc8017A980, gGdLightGroup); } if (shape->mtlGroup != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_MATERIALS, (applyproc_t) apply_obj_draw_fn, - shape->mtlGroup); + apply_to_obj_types_in_group(OBJ_TYPE_MATERIALS, (applyproc_t)apply_obj_draw_fn, shape->mtlGroup); } pop_gddl_stash(); split_timer("updateshaders"); @@ -1089,10 +1077,9 @@ void update_shaders(struct ObjShape *shape, struct GdVec3f *offset) { * @param shape Input `ObjShape` to create material GdDLs for * @return void */ -void create_shape_mtl_gddls(struct ObjShape *shape) { +void create_shape_mtl_gddls(struct ObjShape* shape) { if (shape->mtlGroup != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_MATERIALS, (applyproc_t) create_mtl_gddl_if_empty, - shape->mtlGroup); + apply_to_obj_types_in_group(OBJ_TYPE_MATERIALS, (applyproc_t)create_mtl_gddl_if_empty, shape->mtlGroup); } } @@ -1104,11 +1091,11 @@ void create_shape_mtl_gddls(struct ObjShape *shape) { * @return void * @note Not called */ -void unref_8017AEDC(struct ObjGroup *grp) { - register struct ListNode *link = grp->firstMember; +void unref_8017AEDC(struct ObjGroup* grp) { + register struct ListNode* link = grp->firstMember; while (link != NULL) { - struct GdObj *obj = link->obj; + struct GdObj* obj = link->obj; stub_objects_1(grp, obj); link = link->next; @@ -1125,8 +1112,8 @@ void unref_8017AEDC(struct ObjGroup *grp) { * @bug Nothing is returned if the DL is created * @note Contains string literals that suggest a removed `printf` call */ -void create_shape_gddl(struct ObjShape *s) { - struct ObjShape *shape = s; // 24 +void create_shape_gddl(struct ObjShape* s) { + struct ObjShape* shape = s; // 24 s32 shapedl; // 20 UNUSED s32 enddl; // 1C @@ -1160,9 +1147,8 @@ void create_shape_gddl(struct ObjShape *s) { * @return void * @note Contains string literals that suggest a removed `printf` call */ -void create_gddl_for_shapes(struct ObjGroup *grp) { - UNUSED s32 shapedls = - apply_to_obj_types_in_group(OBJ_TYPE_SHAPES, (applyproc_t) create_shape_gddl, grp); +void create_gddl_for_shapes(struct ObjGroup* grp) { + UNUSED s32 shapedls = apply_to_obj_types_in_group(OBJ_TYPE_SHAPES, (applyproc_t)create_shape_gddl, grp); printf("made %d display lists\n", shapedls); } @@ -1174,20 +1160,20 @@ void create_gddl_for_shapes(struct ObjGroup *grp) { * @param[in] mtls `ObjGroup` of `ObjMaterial` structs to map ids to pointers * @return void */ -void map_face_materials(struct ObjGroup *faces, struct ObjGroup *mtls) { - struct ObjFace *face; - register struct ListNode *linkFaces; - struct GdObj *temp; - register struct ListNode *linkMtls; - struct ObjMaterial *mtl; +void map_face_materials(struct ObjGroup* faces, struct ObjGroup* mtls) { + struct ObjFace* face; + register struct ListNode* linkFaces; + struct GdObj* temp; + register struct ListNode* linkMtls; + struct ObjMaterial* mtl; linkFaces = faces->firstMember; while (linkFaces != NULL) { temp = linkFaces->obj; - face = (struct ObjFace *) temp; + face = (struct ObjFace*)temp; linkMtls = mtls->firstMember; while (linkMtls != NULL) { - mtl = (struct ObjMaterial *) linkMtls->obj; + mtl = (struct ObjMaterial*)linkMtls->obj; if (mtl->id == face->mtlId) { break; } @@ -1213,18 +1199,18 @@ void map_face_materials(struct ObjGroup *faces, struct ObjGroup *mtls) { * @param facegrp `ObjGroup` of `ObjFace` structures that use @p vtx * @return void */ -static void calc_vtx_normal(struct ObjVertex *vtx, struct ObjGroup *facegrp) { +static void calc_vtx_normal(struct ObjVertex* vtx, struct ObjGroup* facegrp) { s32 i; s32 faceCount; - register struct ListNode *node; - struct ObjFace *curFace; + register struct ListNode* node; + struct ObjFace* curFace; vtx->normal.x = vtx->normal.y = vtx->normal.z = 0.0f; faceCount = 0; node = facegrp->firstMember; while (node != NULL) { - curFace = (struct ObjFace *) node->obj; + curFace = (struct ObjFace*)node->obj; for (i = 0; i < curFace->vtxCount; i++) { if (curFace->vertices[i] == vtx) { vtx->normal.x += curFace->normal.x; @@ -1254,10 +1240,10 @@ static void calc_vtx_normal(struct ObjVertex *vtx, struct ObjGroup *facegrp) { * @param vertexGrp `ObjGroup` to index in for `ObjVertex` or `ObjPaticle` structures * @return void */ -static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp) { +static void find_thisface_verts(struct ObjFace* face, struct ObjGroup* vertexGrp) { s32 i; u32 currIndex; - struct ListNode *node; + struct ListNode* node; for (i = 0; i < face->vtxCount; i++) { // find the vertex or particle whose index in vertexGrp equals face->vertices[i] @@ -1265,7 +1251,7 @@ static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp currIndex = 0; while (node != NULL) { if (node->obj->type == OBJ_TYPE_VERTICES || node->obj->type == OBJ_TYPE_PARTICLES) { - if (currIndex++ == (u32) (uintptr_t) face->vertices[i]) { + if (currIndex++ == (u32)(uintptr_t)face->vertices[i]) { break; } } @@ -1276,7 +1262,7 @@ static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp } // set the vertex to point to the resolved `ObjVertex` - face->vertices[i] = (struct ObjVertex *) node->obj; + face->vertices[i] = (struct ObjVertex*)node->obj; } calc_face_normal(face); } @@ -1295,18 +1281,18 @@ static void find_thisface_verts(struct ObjFace *face, struct ObjGroup *vertexGrp * @note It seems that this function was replaced by `chk_shapegen()`, which performs * a very similar task... */ -void map_vertices(struct ObjGroup *facegrp, struct ObjGroup *vtxgrp) { - register struct ListNode *faceNode; - struct ObjFace *curFace; - register struct ListNode *vtxNode; - struct ObjVertex *vtx; +void map_vertices(struct ObjGroup* facegrp, struct ObjGroup* vtxgrp) { + register struct ListNode* faceNode; + struct ObjFace* curFace; + register struct ListNode* vtxNode; + struct ObjVertex* vtx; imin("map_vertices"); // resolve vertex indices to actual vertices faceNode = facegrp->firstMember; while (faceNode != NULL) { - curFace = (struct ObjFace *) faceNode->obj; + curFace = (struct ObjFace*)faceNode->obj; find_thisface_verts(curFace, vtxgrp); faceNode = faceNode->next; } @@ -1314,7 +1300,7 @@ void map_vertices(struct ObjGroup *facegrp, struct ObjGroup *vtxgrp) { // compute normals of vertices in vtxgrp vtxNode = vtxgrp->firstMember; while (vtxNode != NULL) { - vtx = (struct ObjVertex *) vtxNode->obj; + vtx = (struct ObjVertex*)vtxNode->obj; calc_vtx_normal(vtx, facegrp); vtxNode = vtxNode->next; } @@ -1329,8 +1315,8 @@ void map_vertices(struct ObjGroup *facegrp, struct ObjGroup *vtxgrp) { * @return void * @note Not Called */ -void unpick_obj(struct GdObj *obj) { - struct GdObj *why = obj; +void unpick_obj(struct GdObj* obj) { + struct GdObj* why = obj; if (why->drawFlags & OBJ_IS_GRABBABLE) { why->drawFlags &= ~(OBJ_PICKED | OBJ_HIGHLIGHTED); } @@ -1345,8 +1331,8 @@ void unpick_obj(struct GdObj *obj) { * @param input `GdObj` to check * @return void */ -void find_closest_pickable_obj(struct GdObj *input) { - struct GdObj *obj = input; +void find_closest_pickable_obj(struct GdObj* input) { + struct GdObj* obj = input; UNUSED u8 filler[12]; f32 distance; @@ -1374,7 +1360,7 @@ void find_closest_pickable_obj(struct GdObj *input) { * @param cam `ObjCamera` to set to the update camera, if possible * @return void */ -void set_view_update_camera(struct ObjCamera *cam) { +void set_view_update_camera(struct ObjCamera* cam) { if (gViewUpdateCamera != NULL) { return; } @@ -1392,7 +1378,7 @@ void set_view_update_camera(struct ObjCamera *cam) { * @param view The `ObjView` to update * @return void */ -void update_view(struct ObjView *view) { +void update_view(struct ObjView* view) { s32 i; s32 pickOffset; s32 pickDataSize; @@ -1420,8 +1406,7 @@ void update_view(struct ObjView *view) { gViewUpdateCamera = NULL; if (view->components != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_CAMERAS, (applyproc_t) set_view_update_camera, - view->components); + apply_to_obj_types_in_group(OBJ_TYPE_CAMERAS, (applyproc_t)set_view_update_camera, view->components); view->activeCam = gViewUpdateCamera; if (view->activeCam != NULL) { @@ -1489,8 +1474,7 @@ void update_view(struct ObjView *view) { if (pickDataSize >= 2) { for (j = 0; j < pickDataSize - 1; j++) { sPickDataTemp = sPickBuffer[pickDataIdx++]; - apply_to_obj_types_in_group(pickedObjType, - (applyproc_t) find_closest_pickable_obj, + apply_to_obj_types_in_group(pickedObjType, (applyproc_t)find_closest_pickable_obj, sUpdateViewState.view->components); } } diff --git a/src/goddard/dynlist_proc.c b/src/goddard/dynlist_proc.c index 713eb857..f9ece25a 100644 --- a/src/goddard/dynlist_proc.c +++ b/src/goddard/dynlist_proc.c @@ -37,7 +37,7 @@ /// Information about a dynamically created `GdObj` struct DynObjInfo { char name[DYNOBJ_NAME_SIZE]; - struct GdObj *obj; + struct GdObj* obj; s32 num; s32 unk; }; @@ -61,29 +61,28 @@ struct DynObjInfo { ///@} // data -static struct DynObjInfo *sGdDynObjList = NULL; // @ 801A8250; info for all loaded/made dynobjs -static struct GdObj *sDynListCurObj = NULL; // @ 801A8254 -static struct GdBoundingBox sNullBoundingBox = { // @ 801A8258 - 0.0, 0.0, 0.0, - 0.0, 0.0, 0.0 +static struct DynObjInfo* sGdDynObjList = NULL; // @ 801A8250; info for all loaded/made dynobjs +static struct GdObj* sDynListCurObj = NULL; // @ 801A8254 +static struct GdBoundingBox sNullBoundingBox = { // @ 801A8258 + 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; -static s32 sUseIntegerNames = FALSE; // if TRUE, then all DynNames are specified as integers +static s32 sUseIntegerNames = FALSE; // if TRUE, then all DynNames are specified as integers // bss static char sIntToStringBuf[DYNOBJ_NAME_SIZE]; ///< buffer for returning formated string from ///< `integer_name_to_string()` static struct DynObjInfo sNullDynObjInfo; // @ 801B9F08 -static char sDynNameSuffix[DYNOBJ_NAME_SIZE]; // @ 801B9F20; small buf for printing dynid to? -static s32 - sUnnamedObjCount; // @ 801B9F28; used to print empty string ids (not NULL char *) to sDynNameSuffix -static s32 sLoadedDynObjs; // @ 801B9F2C; total loaded dynobjs -static struct DynObjInfo *sDynListCurInfo; // @ 801B9F30; info for most recently added object -static struct DynObjInfo *sParentObjInfo; ///< Information for `ObjNet` made by `d_add_net_with_subgroup()` or `ObjJoint` made by `d_attach_joint_to_net()` -static struct DynObjInfo *sStashedDynObjInfo; // @ 801B9F38 -static struct GdObj *sStashedDynObj; // @ 801B9F3C +static char sDynNameSuffix[DYNOBJ_NAME_SIZE]; // @ 801B9F20; small buf for printing dynid to? +static s32 sUnnamedObjCount; // @ 801B9F28; used to print empty string ids (not NULL char *) to sDynNameSuffix +static s32 sLoadedDynObjs; // @ 801B9F2C; total loaded dynobjs +static struct DynObjInfo* sDynListCurInfo; // @ 801B9F30; info for most recently added object +static struct DynObjInfo* sParentObjInfo; ///< Information for `ObjNet` made by `d_add_net_with_subgroup()` or + ///< `ObjJoint` made by `d_attach_joint_to_net()` +static struct DynObjInfo* sStashedDynObjInfo; // @ 801B9F38 +static struct GdObj* sStashedDynObj; // @ 801B9F3C static s32 sDynNetCount; // @ 801B9F40 -static char sDynNetNameSuffix[0x20]; // @ 801B9F48 -static char sStashedDynNameSuffix[0x100]; // @ 801B9F68 +static char sDynNetNameSuffix[0x20]; // @ 801B9F48 +static char sStashedDynNameSuffix[0x100]; // @ 801B9F68 // necessary foreward declarations void d_add_net_with_subgroup(s32, DynObjName); @@ -91,17 +90,17 @@ void d_end_net_with_subgroup(DynObjName); void d_attach_joint_to_net(s32, DynObjName); void d_addto_group(DynObjName); void d_link_with(DynObjName); -void d_link_with_ptr(void *); +void d_link_with_ptr(void*); void d_set_normal(f32, f32, f32); -void d_make_vertex(struct GdVec3f *); +void d_make_vertex(struct GdVec3f*); void d_set_rotation(f32, f32, f32); void d_center_of_gravity(f32, f32, f32); void d_set_shape_offset(f32, f32, f32); void d_clear_flags(s32); void d_attach(DynObjName); -void d_attach_to(s32, struct GdObj *); +void d_attach_to(s32, struct GdObj*); void d_attachto_dynid(s32, DynObjName); -void d_set_att_offset(const struct GdVec3f *); +void d_set_att_offset(const struct GdVec3f*); void d_set_nodegroup(DynObjName); void d_set_matgroup(DynObjName); void d_set_skinshape(DynObjName); @@ -113,14 +112,14 @@ void d_set_ambient(f32, f32, f32); void d_set_control_type(s32); void d_set_skin_weight(s32, f32); void d_set_id(s32); -void d_set_material(void *, s32); +void d_set_material(void*, s32); void d_map_materials(DynObjName); void d_map_vertices(DynObjName); void d_set_texture_st(f32, f32); -void d_use_texture(void *); +void d_use_texture(void*); void d_make_netfromshapeid(DynObjName); -void d_make_netfromshape_ptrptr(struct ObjShape **); -void add_to_dynobj_list(struct GdObj *, DynObjName); +void d_make_netfromshape_ptrptr(struct ObjShape**); +void add_to_dynobj_list(struct GdObj*, DynObjName); /** * Store the active dynamic `GdObj` into a one object stash. @@ -158,7 +157,7 @@ void reset_dynlist(void) { * @returns Pointer to current dynamically created dynamic `GdObj`. * Normally the dynlist specifically sets an object for return. */ -struct GdObj *proc_dynlist(struct DynList *dylist) { +struct GdObj* proc_dynlist(struct DynList* dylist) { UNUSED u8 filler[8]; if (dylist++->cmd != 0xD1D4) { @@ -198,8 +197,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { d_link_with(Dyn1AsName(dylist)); break; case 50: - d_add_valptr(Dyn1AsName(dylist), (u32) DynVecY(dylist), Dyn2AsInt(dylist), - (size_t) DynVecX(dylist)); + d_add_valptr(Dyn1AsName(dylist), (u32)DynVecY(dylist), Dyn2AsInt(dylist), (size_t)DynVecX(dylist)); break; case 29: d_link_with_ptr(Dyn1AsPtr(dylist)); @@ -342,7 +340,7 @@ struct GdObj *proc_dynlist(struct DynList *dylist) { * is `NULL`, then a generic string is created based on the number of * unnamed objects. */ -void d_set_name_suffix(char *str) { +void d_set_name_suffix(char* str) { if (str != NULL) { if (str[0] == '\0') { sprintf(sDynNameSuffix, "__%d", ++sUnnamedObjCount); @@ -362,7 +360,7 @@ void d_set_name_suffix(char *str) { * * @note Not called */ -void d_append_to_name_suffix(char *str) { +void d_append_to_name_suffix(char* str) { char buf[0xff + 1]; if (str != NULL) { @@ -398,8 +396,8 @@ static void unstash_name_suffix(void) { * @param name Either a string or integer id for a dynamic `GdObj` * @returns pointer to that object's information */ -static struct DynObjInfo *get_dynobj_info(DynObjName name) { - struct DynObjInfo *foundDynobj; +static struct DynObjInfo* get_dynobj_info(DynObjName name) { + struct DynObjInfo* foundDynobj; char buf[0x100]; s32 i; @@ -484,7 +482,7 @@ void d_end_net_with_subgroup(DynObjName name) { * @param name Name for created `ObjJoint` */ void d_attach_joint_to_net(UNUSED s32 arg0, DynObjName name) { - UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; + UNUSED struct DynObjInfo* curInfo = sDynListCurInfo; UNUSED u8 filler[8]; d_makeobj(D_JOINT, name); @@ -499,14 +497,14 @@ void d_attach_joint_to_net(UNUSED s32 arg0, DynObjName name) { * The newly made net is added to the dynamic object list. */ void d_make_netfromshapeid(DynObjName name) { - struct DynObjInfo *dyninfo = get_dynobj_info(name); - struct ObjNet *net; + struct DynObjInfo* dyninfo = get_dynobj_info(name); + struct ObjNet* net; if (dyninfo == NULL) { fatal_printf("dMakeNetFromShape(\"%s\"): Undefined object", DynNameAsStr(name)); } - net = make_netfromshape((struct ObjShape *) dyninfo->obj); + net = make_netfromshape((struct ObjShape*)dyninfo->obj); add_to_dynobj_list(&net->header, NULL); } @@ -515,9 +513,9 @@ void d_make_netfromshapeid(DynObjName name) { * The newly made net is added to the dynamic object list, but * the shape is not moved into the dynamic list. */ -void d_make_netfromshape_ptrptr(struct ObjShape **shapePtr) { +void d_make_netfromshape_ptrptr(struct ObjShape** shapePtr) { UNUSED u8 filler[4]; - struct ObjNet *net = make_netfromshape(*shapePtr); + struct ObjNet* net = make_netfromshape(*shapePtr); printf("dMakeNetFromShapePtrPtr\n"); @@ -529,7 +527,7 @@ void d_make_netfromshape_ptrptr(struct ObjShape **shapePtr) { * is in the dynamic list, it can referred to by its `name` when that object is * needed later. */ -void add_to_dynobj_list(struct GdObj *newobj, DynObjName name) { +void add_to_dynobj_list(struct GdObj* newobj, DynObjName name) { UNUSED u8 filler[4]; char idbuf[0x100]; @@ -548,7 +546,7 @@ void add_to_dynobj_list(struct GdObj *newobj, DynObjName name) { sprintf(idbuf, "N%d", DynNameAsInt(name)); name = NULL; } else { - sprintf(idbuf, "U%d", ((u32) sLoadedDynObjs) + 1); + sprintf(idbuf, "U%d", ((u32)sLoadedDynObjs) + 1); } if (DynNameAsStr(name) != NULL) { @@ -586,7 +584,7 @@ void add_to_dynobj_list(struct GdObj *newobj, DynObjName name) { * @returns pointer to global buffer for id * @retval NULL if `name` is `NULL` or if `DynObjName`s are interpreted as strings */ -static char *integer_name_to_string(DynObjName name) { +static char* integer_name_to_string(DynObjName name) { if (DynNameAsInt(name) != 0 && sUseIntegerNames) { sprintf(sIntToStringBuf, "N%d", DynNameAsInt(name)); return sIntToStringBuf; @@ -602,9 +600,9 @@ static char *integer_name_to_string(DynObjName name) { * * @returns pointer to created object */ -struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name) { - struct GdObj *dobj; - UNUSED struct ObjGroup *dgroup; +struct GdObj* d_makeobj(enum DObjTypes type, DynObjName name) { + struct GdObj* dobj; + UNUSED struct ObjGroup* dgroup; switch (type) { case D_CAR_DYNAMICS: @@ -621,11 +619,11 @@ struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name) { break; case D_GROUP: dobj = &make_group(0)->header; - dgroup = (struct ObjGroup *) dobj; + dgroup = (struct ObjGroup*)dobj; break; case D_DATA_GRP: d_makeobj(D_GROUP, name); - ((struct ObjGroup *) sDynListCurObj)->linkType = 1; + ((struct ObjGroup*)sDynListCurObj)->linkType = 1; return NULL; case D_CAMERA: dobj = &make_camera(0, NULL)->header; @@ -662,8 +660,8 @@ struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name) { break; case D_VIEW: dobj = &make_view(NULL, - (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_UNK_2000 | VIEW_UNK_4000 - | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), + (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_UNK_2000 | VIEW_UNK_4000 | VIEW_1_CYCLE | + VIEW_MOVEMENT | VIEW_DRAW), 2, 0, 0, 0, 0, NULL) ->header; break; @@ -688,7 +686,7 @@ struct GdObj *d_makeobj(enum DObjTypes type, DynObjName name) { * @note This function doesn't actually do anything. */ void d_attach(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -703,8 +701,8 @@ void d_attach(DynObjName name) { case OBJ_TYPE_JOINTS: break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttach()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttach()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -712,11 +710,11 @@ void d_attach(DynObjName name) { * Attach the current dynamic `GdObj` into the proper subgroup of `obj` and set * the "attach flags" of the current dynamic object to `flag` */ -void d_attach_to(s32 flag, struct GdObj *obj) { +void d_attach_to(s32 flag, struct GdObj* obj) { UNUSED u8 filler1[4]; - struct ObjGroup *attgrp; + struct ObjGroup* attgrp; UNUSED u8 filler2[8]; - UNUSED struct DynObjInfo *curInfo = sDynListCurInfo; + UNUSED struct DynObjInfo* curInfo = sDynListCurInfo; struct GdVec3f currObjPos; // transformed into attach offset struct GdVec3f objPos; @@ -729,28 +727,28 @@ void d_attach_to(s32 flag, struct GdObj *obj) { // find or generate attachment groups switch (obj->type) { case OBJ_TYPE_JOINTS: - if ((attgrp = ((struct ObjJoint *) obj)->attachedObjsGrp) == NULL) { - attgrp = ((struct ObjJoint *) obj)->attachedObjsGrp = make_group(0); + if ((attgrp = ((struct ObjJoint*)obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjJoint*)obj)->attachedObjsGrp = make_group(0); } break; case OBJ_TYPE_NETS: - if ((attgrp = ((struct ObjNet *) obj)->attachedObjsGrp) == NULL) { - attgrp = ((struct ObjNet *) obj)->attachedObjsGrp = make_group(0); + if ((attgrp = ((struct ObjNet*)obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjNet*)obj)->attachedObjsGrp = make_group(0); } break; case OBJ_TYPE_PARTICLES: - if ((attgrp = ((struct ObjParticle *) obj)->attachedObjsGrp) == NULL) { - attgrp = ((struct ObjParticle *) obj)->attachedObjsGrp = make_group(0); + if ((attgrp = ((struct ObjParticle*)obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjParticle*)obj)->attachedObjsGrp = make_group(0); } break; case OBJ_TYPE_ANIMATORS: - if ((attgrp = ((struct ObjAnimator *) obj)->attachedObjsGrp) == NULL) { - attgrp = ((struct ObjAnimator *) obj)->attachedObjsGrp = make_group(0); + if ((attgrp = ((struct ObjAnimator*)obj)->attachedObjsGrp) == NULL) { + attgrp = ((struct ObjAnimator*)obj)->attachedObjsGrp = make_group(0); } break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttachTo()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttachTo()", sDynListCurInfo->name, + sDynListCurObj->type); } if (group_contains_obj(attgrp, sDynListCurObj)) { @@ -772,24 +770,24 @@ void d_attach_to(s32 flag, struct GdObj *obj) { d_unstash_dynobj(); switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->attachFlags = flag; - ((struct ObjJoint *) sDynListCurObj)->attachedToObj = obj; + ((struct ObjJoint*)sDynListCurObj)->attachFlags = flag; + ((struct ObjJoint*)sDynListCurObj)->attachedToObj = obj; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->attachFlags = flag; - ((struct ObjNet *) sDynListCurObj)->attachedToObj = obj; + ((struct ObjNet*)sDynListCurObj)->attachFlags = flag; + ((struct ObjNet*)sDynListCurObj)->attachedToObj = obj; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) sDynListCurObj)->attachFlags = flag; - ((struct ObjParticle *) sDynListCurObj)->attachedToObj = obj; + ((struct ObjParticle*)sDynListCurObj)->attachFlags = flag; + ((struct ObjParticle*)sDynListCurObj)->attachedToObj = obj; break; case OBJ_TYPE_ANIMATORS: - ((struct ObjAnimator *) sDynListCurObj)->attachFlags = flag; - ((struct ObjAnimator *) sDynListCurObj)->attachedToObj = obj; + ((struct ObjAnimator*)sDynListCurObj)->attachFlags = flag; + ((struct ObjAnimator*)sDynListCurObj)->attachedToObj = obj; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttachTo()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAttachTo()", sDynListCurInfo->name, + sDynListCurObj->type); } if (flag & 9) { @@ -802,7 +800,7 @@ void d_attach_to(s32 flag, struct GdObj *obj) { * is a wrapper around `d_attach_to()` */ void d_attachto_dynid(s32 flag, DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (name == NULL) { return; @@ -822,7 +820,7 @@ void d_attachto_dynid(s32 flag, DynObjName name) { /** * Helper function to copy bytes. Where's memcpy when you need it? */ -void copy_bytes(u8 *src, u8 *dst, s32 num) { +void copy_bytes(u8* src, u8* dst, s32 num) { if (num == 0) { return; } @@ -836,23 +834,23 @@ void copy_bytes(u8 *src, u8 *dst, s32 num) { * Animation data of type `::GD_ANIM_SCALE3S_POS3S_ROT3S` is converted to a `AnimMtxVec` struct, * rather than solely byted copied like the other types. */ -void alloc_animdata(struct ObjAnimator *animator) { +void alloc_animdata(struct ObjAnimator* animator) { UNUSED u8 filler1[4]; // probably should be three GdVec3fs, not triangle... // vec0 = position; vec1 = scale? rotation?; vec2 = translation struct GdTriangleF tri; //+58; temp float for converting half to f32? s16(*halfarr)[9]; //+54; data to convert into a AnimMtxVec - struct AnimDataInfo *curAnimSrc; //+50; source animation data... - struct AnimDataInfo *animDst; //+4c; destination anim data II - struct AnimDataInfo *animDataArr; //+48; start of allocated anim data memory - struct ObjGroup *animgrp; //+44 + struct AnimDataInfo* curAnimSrc; //+50; source animation data... + struct AnimDataInfo* animDst; //+4c; destination anim data II + struct AnimDataInfo* animDataArr; //+48; start of allocated anim data memory + struct ObjGroup* animgrp; //+44 s32 datasize; //+40; anim data allocation size? s32 dataIdx; //+3C; byte count? s32 animCnt; //+38; count of animdata "info" structs s32 i; //+34 - void *allocSpace; //+30; allocated animdata space + void* allocSpace; //+30; allocated animdata space f32 allocMtxScale = 0.1f; //+2C; scale postion/rotation of GD_ANIM_SCALE3S_POS3S_ROT3S data - struct AnimMtxVec *curMtxVec; //+28 + struct AnimMtxVec* curMtxVec; //+28 UNUSED u8 filler2[4]; start_memtracker("animdata"); @@ -861,7 +859,7 @@ void alloc_animdata(struct ObjAnimator *animator) { fatal_printf("no anim group"); } - if ((curAnimSrc = (struct AnimDataInfo *) animgrp->firstMember->obj) == NULL) { + if ((curAnimSrc = (struct AnimDataInfo*)animgrp->firstMember->obj) == NULL) { fatal_printf("no animation data"); } @@ -915,8 +913,8 @@ void alloc_animdata(struct ObjAnimator *animator) { if (curAnimSrc->type == GD_ANIM_SCALE3S_POS3S_ROT3S) { for (dataIdx = 0; dataIdx < curAnimSrc->count; dataIdx++) { - halfarr = &((s16(*)[9]) curAnimSrc->data)[dataIdx]; - curMtxVec = &((struct AnimMtxVec *) allocSpace)[dataIdx]; + halfarr = &((s16(*)[9])curAnimSrc->data)[dataIdx]; + curMtxVec = &((struct AnimMtxVec*)allocSpace)[dataIdx]; tri.p0.x = (f32)(*halfarr)[0] * allocMtxScale; tri.p0.y = (f32)(*halfarr)[1] * allocMtxScale; @@ -932,9 +930,9 @@ void alloc_animdata(struct ObjAnimator *animator) { gd_rot_mat_about_vec(&curMtxVec->matrix, &tri.p1); gd_add_vec3f_to_mat4f_offset(&curMtxVec->matrix, &tri.p2); - ((struct AnimMtxVec *) allocSpace)[dataIdx].vec.x = tri.p0.x; - ((struct AnimMtxVec *) allocSpace)[dataIdx].vec.y = tri.p0.y; - ((struct AnimMtxVec *) allocSpace)[dataIdx].vec.z = tri.p0.z; + ((struct AnimMtxVec*)allocSpace)[dataIdx].vec.x = tri.p0.x; + ((struct AnimMtxVec*)allocSpace)[dataIdx].vec.y = tri.p0.y; + ((struct AnimMtxVec*)allocSpace)[dataIdx].vec.z = tri.p0.z; } curAnimSrc->type = GD_ANIM_MTX4x4F_SCALE3F; } else { @@ -949,7 +947,7 @@ void alloc_animdata(struct ObjAnimator *animator) { curAnimSrc++; // next anim data struct } - animgrp->firstMember->obj = (void *) animDataArr; + animgrp->firstMember->obj = (void*)animDataArr; stop_memtracker("animdata"); } @@ -962,20 +960,20 @@ void alloc_animdata(struct ObjAnimator *animator) { * * @note Face/vertices need to be set before materials */ -void chk_shapegen(struct ObjShape *shape) { - struct ObjFace *face; // sp5C; made face - struct ObjVertex *vtx; // sp58; made gdvtx - struct ObjVertex **vtxbuf; // sp54; heap storage for made gd vtx - struct ObjGroup *shapeMtls; // sp50 - struct ObjGroup *shapeFaces; // sp4C - struct ObjGroup *shapeVtx; // sp48 +void chk_shapegen(struct ObjShape* shape) { + struct ObjFace* face; // sp5C; made face + struct ObjVertex* vtx; // sp58; made gdvtx + struct ObjVertex** vtxbuf; // sp54; heap storage for made gd vtx + struct ObjGroup* shapeMtls; // sp50 + struct ObjGroup* shapeFaces; // sp4C + struct ObjGroup* shapeVtx; // sp48 UNUSED u8 filler[4]; - struct ObjGroup *madeFaces; // sp40 - struct ObjGroup *madeVtx; // sp3C + struct ObjGroup* madeFaces; // sp40 + struct ObjGroup* madeVtx; // sp3C u32 i; // sp38 - struct GdVtxData *vtxdata; // sp34 - struct GdFaceData *facedata; // sp30 - struct GdObj *oldObjHead; // sp2C + struct GdVtxData* vtxdata; // sp34 + struct GdFaceData* facedata; // sp30 + struct GdObj* oldObjHead; // sp2C start_memtracker("chk_shapegen"); imin("chk_shapegen"); @@ -986,8 +984,8 @@ void chk_shapegen(struct ObjShape *shape) { if (shapeVtx != NULL && shapeFaces != NULL) { if ((shapeVtx->linkType & 1) && (shapeFaces->linkType & 1)) { //? needs the double if // These ListNodes point to special, compressed data structures - vtxdata = (struct GdVtxData *) shapeVtx->firstMember->obj; - facedata = (struct GdFaceData *) shapeFaces->firstMember->obj; + vtxdata = (struct GdVtxData*)shapeVtx->firstMember->obj; + facedata = (struct GdFaceData*)shapeFaces->firstMember->obj; if (facedata->type != 1) { fatal_printf("unsupported poly type"); } @@ -1000,7 +998,7 @@ void chk_shapegen(struct ObjShape *shape) { fatal_printf("shapegen() too many vertices"); } - vtxbuf = gd_malloc_temp(VTX_BUF_SIZE * sizeof(struct ObjVertex *)); + vtxbuf = gd_malloc_temp(VTX_BUF_SIZE * sizeof(struct ObjVertex*)); oldObjHead = gGdObjectList; for (i = 0; i < vtxdata->count; i++) { @@ -1017,7 +1015,7 @@ void chk_shapegen(struct ObjShape *shape) { //! due to Goddard only declaring the functions, //! not prototyping the functions face = make_face_with_colour(1.0, 1.0, 1.0); - face->mtlId = (s32) facedata->data[i][0]; + face->mtlId = (s32)facedata->data[i][0]; add_3_vtx_to_face(face, vtxbuf[facedata->data[i][1]], vtxbuf[facedata->data[i][2]], vtxbuf[facedata->data[i][3]]); vtxbuf[facedata->data[i][1]]->normal.x += face->normal.x; @@ -1074,7 +1072,7 @@ void chk_shapegen(struct ObjShape *shape) { * * something is set for `ObjGadget` */ void d_set_nodegroup(DynObjName name) { - struct DynObjInfo *info; // sp2C + struct DynObjInfo* info; // sp2C UNUSED u8 filler[8]; if (sDynListCurObj == NULL) { @@ -1088,19 +1086,19 @@ void d_set_nodegroup(DynObjName name) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->unk1C8 = (struct ObjGroup *) info->obj; - ((struct ObjNet *) sDynListCurObj)->unk1D0 = (struct ObjGroup *) info->obj; + ((struct ObjNet*)sDynListCurObj)->unk1C8 = (struct ObjGroup*)info->obj; + ((struct ObjNet*)sDynListCurObj)->unk1D0 = (struct ObjGroup*)info->obj; break; case OBJ_TYPE_SHAPES: - ((struct ObjShape *) sDynListCurObj)->vtxGroup = (struct ObjGroup *) info->obj; - chk_shapegen((struct ObjShape *) sDynListCurObj); + ((struct ObjShape*)sDynListCurObj)->vtxGroup = (struct ObjGroup*)info->obj; + chk_shapegen((struct ObjShape*)sDynListCurObj); break; case OBJ_TYPE_GADGETS: - ((struct ObjGadget *) sDynListCurObj)->unk54 = (struct ObjGroup *) info->obj; + ((struct ObjGadget*)sDynListCurObj)->unk54 = (struct ObjGroup*)info->obj; break; case OBJ_TYPE_ANIMATORS: - ((struct ObjAnimator *) sDynListCurObj)->animdataGrp = (struct ObjGroup *) info->obj; - alloc_animdata((struct ObjAnimator *) sDynListCurObj); + ((struct ObjAnimator*)sDynListCurObj)->animdataGrp = (struct ObjGroup*)info->obj; + alloc_animdata((struct ObjAnimator*)sDynListCurObj); break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetNodeGroup()", @@ -1112,7 +1110,7 @@ void d_set_nodegroup(DynObjName name) { * Set the material group of the current dynamic `ObjShape` to `name`. */ void d_set_matgroup(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1125,12 +1123,12 @@ void d_set_matgroup(DynObjName name) { switch (sDynListCurObj->type) { case OBJ_TYPE_SHAPES: - ((struct ObjShape *) sDynListCurObj)->mtlGroup = (struct ObjGroup *) info->obj; - chk_shapegen((struct ObjShape *) sDynListCurObj); + ((struct ObjShape*)sDynListCurObj)->mtlGroup = (struct ObjGroup*)info->obj; + chk_shapegen((struct ObjShape*)sDynListCurObj); break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMatGroup()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMatGroup()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1159,18 +1157,18 @@ void d_set_texture_st(UNUSED f32 s, UNUSED f32 t) { /** * Set the texture pointer of the current dynamic `ObjMaterial`. */ -void d_use_texture(void *texture) { +void d_use_texture(void* texture) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_MATERIALS: - ((struct ObjMaterial *) sDynListCurObj)->texture = texture; + ((struct ObjMaterial*)sDynListCurObj)->texture = texture; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dUseTexture()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dUseTexture()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1179,7 +1177,7 @@ void d_use_texture(void *texture) { * the dynamic `ObjShape` with `name`. */ void d_set_skinshape(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1192,7 +1190,7 @@ void d_set_skinshape(DynObjName name) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->skinGrp = ((struct ObjShape *) info->obj)->vtxGroup; + ((struct ObjNet*)sDynListCurObj)->skinGrp = ((struct ObjShape*)info->obj)->vtxGroup; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSkinShape()", @@ -1207,7 +1205,7 @@ void d_set_skinshape(DynObjName name) { * See `map_face_materials()` for more info. */ void d_map_materials(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1218,7 +1216,7 @@ void d_map_materials(DynObjName name) { fatal_printf("dMapMaterials(\"%s\"): Undefined group", DynNameAsStr(name)); } - map_face_materials((struct ObjGroup *) sDynListCurObj, (struct ObjGroup *) info->obj); + map_face_materials((struct ObjGroup*)sDynListCurObj, (struct ObjGroup*)info->obj); } /** @@ -1230,7 +1228,7 @@ void d_map_materials(DynObjName name) { * @param name name of a vertex group dynobj */ void d_map_vertices(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1241,7 +1239,7 @@ void d_map_vertices(DynObjName name) { fatal_printf("dMapVertices(\"%s\"): Undefined group", DynNameAsStr(name)); } - map_vertices((struct ObjGroup *) sDynListCurObj, (struct ObjGroup *) info->obj); + map_vertices((struct ObjGroup*)sDynListCurObj, (struct ObjGroup*)info->obj); } /** @@ -1251,7 +1249,7 @@ void d_map_vertices(DynObjName name) { * of that usage in existing code. */ void d_set_planegroup(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; UNUSED u8 filler[8]; if (sDynListCurObj == NULL) { @@ -1265,11 +1263,11 @@ void d_set_planegroup(DynObjName name) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->unk1CC = (struct ObjGroup *) info->obj; + ((struct ObjNet*)sDynListCurObj)->unk1CC = (struct ObjGroup*)info->obj; break; case OBJ_TYPE_SHAPES: - ((struct ObjShape *) sDynListCurObj)->faceGroup = (struct ObjGroup *) info->obj; - chk_shapegen((struct ObjShape *) sDynListCurObj); + ((struct ObjShape*)sDynListCurObj)->faceGroup = (struct ObjGroup*)info->obj; + chk_shapegen((struct ObjShape*)sDynListCurObj); break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetPlaneGroup()", @@ -1281,8 +1279,8 @@ void d_set_planegroup(DynObjName name) { * Set the shape pointer of the current active dynamic object to the * pointer pointed to by `shpPtrptr`. */ -void d_set_shapeptrptr(struct ObjShape **shpPtrptr) { - struct ObjShape *defaultptr = NULL; +void d_set_shapeptrptr(struct ObjShape** shpPtrptr) { + struct ObjShape* defaultptr = NULL; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1294,23 +1292,23 @@ void d_set_shapeptrptr(struct ObjShape **shpPtrptr) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->shapePtr = *shpPtrptr; - ((struct ObjJoint *) sDynListCurObj)->colourNum = 0; + ((struct ObjJoint*)sDynListCurObj)->shapePtr = *shpPtrptr; + ((struct ObjJoint*)sDynListCurObj)->colourNum = 0; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->shapePtr = *shpPtrptr; + ((struct ObjNet*)sDynListCurObj)->shapePtr = *shpPtrptr; break; case OBJ_TYPE_BONES: - ((struct ObjBone *) sDynListCurObj)->shapePtr = *shpPtrptr; + ((struct ObjBone*)sDynListCurObj)->shapePtr = *shpPtrptr; break; case OBJ_TYPE_GADGETS: - ((struct ObjGadget *) sDynListCurObj)->shapePtr = *shpPtrptr; + ((struct ObjGadget*)sDynListCurObj)->shapePtr = *shpPtrptr; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) sDynListCurObj)->shapePtr = *shpPtrptr; + ((struct ObjParticle*)sDynListCurObj)->shapePtr = *shpPtrptr; break; case OBJ_TYPE_LIGHTS: - ((struct ObjLight *) sDynListCurObj)->unk9C = *shpPtrptr; + ((struct ObjLight*)sDynListCurObj)->unk9C = *shpPtrptr; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetShapePtrPtr()", @@ -1323,7 +1321,7 @@ void d_set_shapeptrptr(struct ObjShape **shpPtrptr) { * `ObjShape` `name`. */ void d_set_shapeptr(DynObjName name) { - struct DynObjInfo *info; + struct DynObjInfo* info; if (name == NULL) { return; } @@ -1335,32 +1333,32 @@ void d_set_shapeptr(DynObjName name) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; - ((struct ObjJoint *) sDynListCurObj)->colourNum = 0; + ((struct ObjJoint*)sDynListCurObj)->shapePtr = (struct ObjShape*)info->obj; + ((struct ObjJoint*)sDynListCurObj)->colourNum = 0; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + ((struct ObjNet*)sDynListCurObj)->shapePtr = (struct ObjShape*)info->obj; break; case OBJ_TYPE_BONES: - ((struct ObjBone *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + ((struct ObjBone*)sDynListCurObj)->shapePtr = (struct ObjShape*)info->obj; break; case OBJ_TYPE_GADGETS: - ((struct ObjGadget *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + ((struct ObjGadget*)sDynListCurObj)->shapePtr = (struct ObjShape*)info->obj; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) sDynListCurObj)->shapePtr = (struct ObjShape *) info->obj; + ((struct ObjParticle*)sDynListCurObj)->shapePtr = (struct ObjShape*)info->obj; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetShapePtr()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetShapePtr()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Set the current active dynamic object to object `name`. */ -struct GdObj *d_use_obj(DynObjName name) { - struct DynObjInfo *info = get_dynobj_info(name); +struct GdObj* d_use_obj(DynObjName name) { + struct DynObjInfo* info = get_dynobj_info(name); if (info == NULL) { fatal_printf("dUseObj(\"%s\"): Undefined object", DynNameAsStr(name)); } @@ -1376,7 +1374,7 @@ struct GdObj *d_use_obj(DynObjName name) { * any type of `GdObj`, not just an object created through the * dynmaic object system. */ -void set_cur_dynobj(struct GdObj *obj) { +void set_cur_dynobj(struct GdObj* obj) { sDynListCurObj = obj; sDynListCurInfo = &sNullDynObjInfo; } @@ -1394,15 +1392,15 @@ void d_start_group(DynObjName name) { */ void d_end_group(DynObjName name) { UNUSED u8 filler[4]; - struct DynObjInfo *info = get_dynobj_info(name); - struct ObjGroup *dynGrp; + struct DynObjInfo* info = get_dynobj_info(name); + struct ObjGroup* dynGrp; s32 i; if (info == NULL) { fatal_printf("dEndGroup(\"%s\"): Undefined group", DynNameAsStr(name)); } - dynGrp = (struct ObjGroup *) info->obj; + dynGrp = (struct ObjGroup*)info->obj; for (i = info->num + 1; i < sLoadedDynObjs; i++) { if (sGdDynObjList[i].obj->type != OBJ_TYPE_GROUPS) { addto_group(dynGrp, sGdDynObjList[i].obj); @@ -1415,14 +1413,14 @@ void d_end_group(DynObjName name) { */ void d_addto_group(DynObjName name) { UNUSED u8 filler[4]; - struct DynObjInfo *info = get_dynobj_info(name); - struct ObjGroup *targetGrp; + struct DynObjInfo* info = get_dynobj_info(name); + struct ObjGroup* targetGrp; if (info == NULL) { fatal_printf("dAddToGroup(\"%s\"): Undefined group", DynNameAsStr(name)); } - targetGrp = (struct ObjGroup *) info->obj; + targetGrp = (struct ObjGroup*)info->obj; addto_group(targetGrp, sDynListCurObj); } @@ -1442,7 +1440,7 @@ void d_use_integer_names(s32 isIntBool) { */ void d_set_init_pos(f32 x, f32 y, f32 z) { UNUSED u8 filler1[12]; - struct GdObj *dynobj = sDynListCurObj; // sp28 + struct GdObj* dynobj = sDynListCurObj; // sp28 UNUSED u8 filler2[4]; if (sDynListCurObj == NULL) { @@ -1451,47 +1449,47 @@ void d_set_init_pos(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->worldPos.x = x; - ((struct ObjJoint *) dynobj)->worldPos.y = y; - ((struct ObjJoint *) dynobj)->worldPos.z = z; + ((struct ObjJoint*)dynobj)->worldPos.x = x; + ((struct ObjJoint*)dynobj)->worldPos.y = y; + ((struct ObjJoint*)dynobj)->worldPos.z = z; - ((struct ObjJoint *) dynobj)->unk3C.x = x; - ((struct ObjJoint *) dynobj)->unk3C.y = y; - ((struct ObjJoint *) dynobj)->unk3C.z = z; + ((struct ObjJoint*)dynobj)->unk3C.x = x; + ((struct ObjJoint*)dynobj)->unk3C.y = y; + ((struct ObjJoint*)dynobj)->unk3C.z = z; - ((struct ObjJoint *) dynobj)->initPos.x = x; - ((struct ObjJoint *) dynobj)->initPos.y = y; - ((struct ObjJoint *) dynobj)->initPos.z = z; + ((struct ObjJoint*)dynobj)->initPos.x = x; + ((struct ObjJoint*)dynobj)->initPos.y = y; + ((struct ObjJoint*)dynobj)->initPos.z = z; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->worldPos.x = x; - ((struct ObjNet *) dynobj)->worldPos.y = y; - ((struct ObjNet *) dynobj)->worldPos.z = z; + ((struct ObjNet*)dynobj)->worldPos.x = x; + ((struct ObjNet*)dynobj)->worldPos.y = y; + ((struct ObjNet*)dynobj)->worldPos.z = z; - ((struct ObjNet *) dynobj)->initPos.x = x; - ((struct ObjNet *) dynobj)->initPos.y = y; - ((struct ObjNet *) dynobj)->initPos.z = z; + ((struct ObjNet*)dynobj)->initPos.x = x; + ((struct ObjNet*)dynobj)->initPos.y = y; + ((struct ObjNet*)dynobj)->initPos.z = z; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) dynobj)->pos.x = x; - ((struct ObjParticle *) dynobj)->pos.y = y; - ((struct ObjParticle *) dynobj)->pos.z = z; + ((struct ObjParticle*)dynobj)->pos.x = x; + ((struct ObjParticle*)dynobj)->pos.y = y; + ((struct ObjParticle*)dynobj)->pos.z = z; break; case OBJ_TYPE_CAMERAS: - ((struct ObjCamera *) dynobj)->worldPos.x = x; - ((struct ObjCamera *) dynobj)->worldPos.y = y; - ((struct ObjCamera *) dynobj)->worldPos.z = z; + ((struct ObjCamera*)dynobj)->worldPos.x = x; + ((struct ObjCamera*)dynobj)->worldPos.y = y; + ((struct ObjCamera*)dynobj)->worldPos.z = z; break; case OBJ_TYPE_VERTICES: d_set_rel_pos(x, y, z); - ((struct ObjVertex *) dynobj)->initPos.x = x; - ((struct ObjVertex *) dynobj)->initPos.y = y; - ((struct ObjVertex *) dynobj)->initPos.z = z; + ((struct ObjVertex*)dynobj)->initPos.x = x; + ((struct ObjVertex*)dynobj)->initPos.y = y; + ((struct ObjVertex*)dynobj)->initPos.z = z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetInitPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetInitPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1499,8 +1497,8 @@ void d_set_init_pos(f32 x, f32 y, f32 z) { * Set the velocity of the current active dynamic object. The * values of the input `GdVec3f` are copied into the object. */ -void d_set_velocity(const struct GdVec3f *vel) { - struct GdObj *dynobj = sDynListCurObj; +void d_set_velocity(const struct GdVec3f* vel) { + struct GdObj* dynobj = sDynListCurObj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1508,18 +1506,18 @@ void d_set_velocity(const struct GdVec3f *vel) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->velocity.x = vel->x; - ((struct ObjJoint *) dynobj)->velocity.y = vel->y; - ((struct ObjJoint *) dynobj)->velocity.z = vel->z; + ((struct ObjJoint*)dynobj)->velocity.x = vel->x; + ((struct ObjJoint*)dynobj)->velocity.y = vel->y; + ((struct ObjJoint*)dynobj)->velocity.z = vel->z; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->velocity.x = vel->x; - ((struct ObjNet *) dynobj)->velocity.y = vel->y; - ((struct ObjNet *) dynobj)->velocity.z = vel->z; + ((struct ObjNet*)dynobj)->velocity.x = vel->x; + ((struct ObjNet*)dynobj)->velocity.y = vel->y; + ((struct ObjNet*)dynobj)->velocity.z = vel->z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetVelocity()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetVelocity()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1528,8 +1526,8 @@ void d_set_velocity(const struct GdVec3f *vel) { * * @param[out] dst values are copied to this `GdVec3f` */ -void d_get_velocity(struct GdVec3f *dst) { - struct GdObj *dynobj = sDynListCurObj; +void d_get_velocity(struct GdVec3f* dst) { + struct GdObj* dynobj = sDynListCurObj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1537,14 +1535,14 @@ void d_get_velocity(struct GdVec3f *dst) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) dynobj)->velocity.x; - dst->y = ((struct ObjJoint *) dynobj)->velocity.y; - dst->z = ((struct ObjJoint *) dynobj)->velocity.z; + dst->x = ((struct ObjJoint*)dynobj)->velocity.x; + dst->y = ((struct ObjJoint*)dynobj)->velocity.y; + dst->z = ((struct ObjJoint*)dynobj)->velocity.z; break; case OBJ_TYPE_NETS: - dst->x = ((struct ObjNet *) dynobj)->velocity.x; - dst->y = ((struct ObjNet *) dynobj)->velocity.y; - dst->z = ((struct ObjNet *) dynobj)->velocity.z; + dst->x = ((struct ObjNet*)dynobj)->velocity.x; + dst->y = ((struct ObjNet*)dynobj)->velocity.y; + dst->z = ((struct ObjNet*)dynobj)->velocity.z; break; default: dst->x = dst->y = dst->z = 0.0f; @@ -1558,8 +1556,8 @@ void d_get_velocity(struct GdVec3f *dst) { * * @note Not called */ -void d_set_torque(const struct GdVec3f *src) { - struct GdObj *dynobj = sDynListCurObj; +void d_set_torque(const struct GdVec3f* src) { + struct GdObj* dynobj = sDynListCurObj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1567,13 +1565,13 @@ void d_set_torque(const struct GdVec3f *src) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->torque.x = src->x; - ((struct ObjNet *) dynobj)->torque.y = src->y; - ((struct ObjNet *) dynobj)->torque.z = src->z; + ((struct ObjNet*)dynobj)->torque.x = src->x; + ((struct ObjNet*)dynobj)->torque.y = src->y; + ((struct ObjNet*)dynobj)->torque.z = src->z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetTorque()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetTorque()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1581,8 +1579,8 @@ void d_set_torque(const struct GdVec3f *src) { * Get the initial position of the current dynamic object and * store in `dst`. */ -void d_get_init_pos(struct GdVec3f *dst) { - struct GdObj *dynobj = sDynListCurObj; +void d_get_init_pos(struct GdVec3f* dst) { + struct GdObj* dynobj = sDynListCurObj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1590,23 +1588,23 @@ void d_get_init_pos(struct GdVec3f *dst) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) dynobj)->initPos.x; - dst->y = ((struct ObjJoint *) dynobj)->initPos.y; - dst->z = ((struct ObjJoint *) dynobj)->initPos.z; + dst->x = ((struct ObjJoint*)dynobj)->initPos.x; + dst->y = ((struct ObjJoint*)dynobj)->initPos.y; + dst->z = ((struct ObjJoint*)dynobj)->initPos.z; break; case OBJ_TYPE_NETS: - dst->x = ((struct ObjNet *) dynobj)->initPos.x; - dst->y = ((struct ObjNet *) dynobj)->initPos.y; - dst->z = ((struct ObjNet *) dynobj)->initPos.z; + dst->x = ((struct ObjNet*)dynobj)->initPos.x; + dst->y = ((struct ObjNet*)dynobj)->initPos.y; + dst->z = ((struct ObjNet*)dynobj)->initPos.z; break; case OBJ_TYPE_VERTICES: - dst->x = ((struct ObjVertex *) dynobj)->initPos.x; - dst->y = ((struct ObjVertex *) dynobj)->initPos.y; - dst->z = ((struct ObjVertex *) dynobj)->initPos.z; + dst->x = ((struct ObjVertex*)dynobj)->initPos.x; + dst->y = ((struct ObjVertex*)dynobj)->initPos.y; + dst->z = ((struct ObjVertex*)dynobj)->initPos.z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetInitPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetInitPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1614,8 +1612,8 @@ void d_get_init_pos(struct GdVec3f *dst) { * Get the initial rotation of the current dynamic object and * store in `dst`. */ -void d_get_init_rot(struct GdVec3f *dst) { - struct GdObj *dynobj = sDynListCurObj; +void d_get_init_rot(struct GdVec3f* dst) { + struct GdObj* dynobj = sDynListCurObj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1623,21 +1621,21 @@ void d_get_init_rot(struct GdVec3f *dst) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) dynobj)->unk6C.x; - dst->y = ((struct ObjJoint *) dynobj)->unk6C.y; - dst->z = ((struct ObjJoint *) dynobj)->unk6C.z; + dst->x = ((struct ObjJoint*)dynobj)->unk6C.x; + dst->y = ((struct ObjJoint*)dynobj)->unk6C.y; + dst->z = ((struct ObjJoint*)dynobj)->unk6C.z; break; case OBJ_TYPE_NETS: - dst->x = ((struct ObjNet *) dynobj)->unk68.x; - dst->y = ((struct ObjNet *) dynobj)->unk68.y; - dst->z = ((struct ObjNet *) dynobj)->unk68.z; + dst->x = ((struct ObjNet*)dynobj)->unk68.x; + dst->y = ((struct ObjNet*)dynobj)->unk68.y; + dst->z = ((struct ObjNet*)dynobj)->unk68.z; break; case OBJ_TYPE_LIGHTS: dst->x = dst->y = dst->z = 0.0f; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetInitRot()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetInitRot()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1648,7 +1646,7 @@ void d_get_init_rot(struct GdVec3f *dst) { * for an `ObjCamera`. */ void d_set_rel_pos(f32 x, f32 y, f32 z) { - struct GdObj *dynobj = sDynListCurObj; // sp34 + struct GdObj* dynobj = sDynListCurObj; // sp34 UNUSED struct GdVec3f unusedVec; // sp28 if (sDynListCurObj == NULL) { @@ -1657,61 +1655,61 @@ void d_set_rel_pos(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->unk3C.x = x; - ((struct ObjJoint *) dynobj)->unk3C.y = y; - ((struct ObjJoint *) dynobj)->unk3C.z = z; + ((struct ObjJoint*)dynobj)->unk3C.x = x; + ((struct ObjJoint*)dynobj)->unk3C.y = y; + ((struct ObjJoint*)dynobj)->unk3C.z = z; break; case OBJ_TYPE_CAMERAS: unusedVec.x = x; unusedVec.y = y; unusedVec.z = z; - ((struct ObjCamera *) dynobj)->unk40.x = x; - ((struct ObjCamera *) dynobj)->unk40.y = y; - ((struct ObjCamera *) dynobj)->unk40.z = z; + ((struct ObjCamera*)dynobj)->unk40.x = x; + ((struct ObjCamera*)dynobj)->unk40.y = y; + ((struct ObjCamera*)dynobj)->unk40.z = z; - ((struct ObjCamera *) dynobj)->zoomPositions[0].x = x; - ((struct ObjCamera *) dynobj)->zoomPositions[0].y = y; - ((struct ObjCamera *) dynobj)->zoomPositions[0].z = z; + ((struct ObjCamera*)dynobj)->zoomPositions[0].x = x; + ((struct ObjCamera*)dynobj)->zoomPositions[0].y = y; + ((struct ObjCamera*)dynobj)->zoomPositions[0].z = z; - ((struct ObjCamera *) dynobj)->zoomPositions[1].x = x * 1.5; //? 1.5f - ((struct ObjCamera *) dynobj)->zoomPositions[1].y = y * 1.5; //? 1.5f - ((struct ObjCamera *) dynobj)->zoomPositions[1].z = z * 1.5; //? 1.5f + ((struct ObjCamera*)dynobj)->zoomPositions[1].x = x * 1.5; //? 1.5f + ((struct ObjCamera*)dynobj)->zoomPositions[1].y = y * 1.5; //? 1.5f + ((struct ObjCamera*)dynobj)->zoomPositions[1].z = z * 1.5; //? 1.5f - ((struct ObjCamera *) dynobj)->zoomPositions[2].x = x * 2.0f; - ((struct ObjCamera *) dynobj)->zoomPositions[2].y = y * 2.0f; - ((struct ObjCamera *) dynobj)->zoomPositions[2].z = z * 2.0f; + ((struct ObjCamera*)dynobj)->zoomPositions[2].x = x * 2.0f; + ((struct ObjCamera*)dynobj)->zoomPositions[2].y = y * 2.0f; + ((struct ObjCamera*)dynobj)->zoomPositions[2].z = z * 2.0f; - ((struct ObjCamera *) dynobj)->maxZoomLevel = 2; + ((struct ObjCamera*)dynobj)->maxZoomLevel = 2; break; case OBJ_TYPE_VERTICES: - ((struct ObjVertex *) dynobj)->pos.x = x; - ((struct ObjVertex *) dynobj)->pos.y = y; - ((struct ObjVertex *) dynobj)->pos.z = z; + ((struct ObjVertex*)dynobj)->pos.x = x; + ((struct ObjVertex*)dynobj)->pos.y = y; + ((struct ObjVertex*)dynobj)->pos.z = z; break; case OBJ_TYPE_LABELS: - ((struct ObjLabel *) dynobj)->position.x = x; - ((struct ObjLabel *) dynobj)->position.y = y; - ((struct ObjLabel *) dynobj)->position.z = z; + ((struct ObjLabel*)dynobj)->position.x = x; + ((struct ObjLabel*)dynobj)->position.y = y; + ((struct ObjLabel*)dynobj)->position.z = z; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) dynobj)->pos.x = x; - ((struct ObjParticle *) dynobj)->pos.y = y; - ((struct ObjParticle *) dynobj)->pos.z = z; + ((struct ObjParticle*)dynobj)->pos.x = x; + ((struct ObjParticle*)dynobj)->pos.y = y; + ((struct ObjParticle*)dynobj)->pos.z = z; break; case OBJ_TYPE_NETS: break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRelPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRelPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Offset the current position of the current dynamic object. */ -void d_addto_rel_pos(struct GdVec3f *src) { - struct GdObj *dynobj = sDynListCurObj; // sp24 +void d_addto_rel_pos(struct GdVec3f* src) { + struct GdObj* dynobj = sDynListCurObj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1719,58 +1717,58 @@ void d_addto_rel_pos(struct GdVec3f *src) { switch (sDynListCurObj->type) { case OBJ_TYPE_VERTICES: - ((struct ObjVertex *) dynobj)->pos.x += src->x; - ((struct ObjVertex *) dynobj)->pos.y += src->y; - ((struct ObjVertex *) dynobj)->pos.z += src->z; + ((struct ObjVertex*)dynobj)->pos.x += src->x; + ((struct ObjVertex*)dynobj)->pos.y += src->y; + ((struct ObjVertex*)dynobj)->pos.z += src->z; break; case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->unk3C.x += src->x; - ((struct ObjJoint *) dynobj)->unk3C.y += src->y; - ((struct ObjJoint *) dynobj)->unk3C.z += src->z; + ((struct ObjJoint*)dynobj)->unk3C.x += src->x; + ((struct ObjJoint*)dynobj)->unk3C.y += src->y; + ((struct ObjJoint*)dynobj)->unk3C.z += src->z; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) dynobj)->pos.x += src->x; - ((struct ObjParticle *) dynobj)->pos.y += src->y; - ((struct ObjParticle *) dynobj)->pos.z += src->z; + ((struct ObjParticle*)dynobj)->pos.x += src->x; + ((struct ObjParticle*)dynobj)->pos.y += src->y; + ((struct ObjParticle*)dynobj)->pos.z += src->z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddToRelPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddToRelPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Store the current dynamic object's position into `dst`. */ -void d_get_rel_pos(struct GdVec3f *dst) { +void d_get_rel_pos(struct GdVec3f* dst) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_VERTICES: - dst->x = ((struct ObjVertex *) sDynListCurObj)->pos.x; - dst->y = ((struct ObjVertex *) sDynListCurObj)->pos.y; - dst->z = ((struct ObjVertex *) sDynListCurObj)->pos.z; + dst->x = ((struct ObjVertex*)sDynListCurObj)->pos.x; + dst->y = ((struct ObjVertex*)sDynListCurObj)->pos.y; + dst->z = ((struct ObjVertex*)sDynListCurObj)->pos.z; break; case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) sDynListCurObj)->unk3C.x; - dst->y = ((struct ObjJoint *) sDynListCurObj)->unk3C.y; - dst->z = ((struct ObjJoint *) sDynListCurObj)->unk3C.z; + dst->x = ((struct ObjJoint*)sDynListCurObj)->unk3C.x; + dst->y = ((struct ObjJoint*)sDynListCurObj)->unk3C.y; + dst->z = ((struct ObjJoint*)sDynListCurObj)->unk3C.z; break; case OBJ_TYPE_CAMERAS: - dst->x = ((struct ObjCamera *) sDynListCurObj)->unk40.x; - dst->y = ((struct ObjCamera *) sDynListCurObj)->unk40.y; - dst->z = ((struct ObjCamera *) sDynListCurObj)->unk40.z; + dst->x = ((struct ObjCamera*)sDynListCurObj)->unk40.x; + dst->y = ((struct ObjCamera*)sDynListCurObj)->unk40.y; + dst->z = ((struct ObjCamera*)sDynListCurObj)->unk40.z; break; case OBJ_TYPE_PARTICLES: - dst->x = ((struct ObjParticle *) sDynListCurObj)->pos.x; - dst->y = ((struct ObjParticle *) sDynListCurObj)->pos.y; - dst->z = ((struct ObjParticle *) sDynListCurObj)->pos.z; + dst->x = ((struct ObjParticle*)sDynListCurObj)->pos.x; + dst->y = ((struct ObjParticle*)sDynListCurObj)->pos.y; + dst->z = ((struct ObjParticle*)sDynListCurObj)->pos.z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetRelPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetRelPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -1778,17 +1776,17 @@ void d_get_rel_pos(struct GdVec3f *dst) { * Return a pointer to the attached object group of the current * dynamic object. */ -struct ObjGroup *d_get_att_objgroup(void) { +struct ObjGroup* d_get_att_objgroup(void) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - return ((struct ObjJoint *) sDynListCurObj)->attachedObjsGrp; + return ((struct ObjJoint*)sDynListCurObj)->attachedObjsGrp; break; // lol case OBJ_TYPE_NETS: - return ((struct ObjNet *) sDynListCurObj)->attachedObjsGrp; + return ((struct ObjNet*)sDynListCurObj)->attachedObjsGrp; break; // lol default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttObjGroup()", @@ -1800,21 +1798,21 @@ struct ObjGroup *d_get_att_objgroup(void) { /** * Return a pointer to the object that the current dynamic object is attached to. */ -struct GdObj *d_get_att_to_obj(void) { +struct GdObj* d_get_att_to_obj(void) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - return ((struct ObjJoint *) sDynListCurObj)->attachedToObj; + return ((struct ObjJoint*)sDynListCurObj)->attachedToObj; break; // lol case OBJ_TYPE_NETS: - return ((struct ObjNet *) sDynListCurObj)->attachedToObj; + return ((struct ObjNet*)sDynListCurObj)->attachedToObj; break; // lol default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttToObj()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttToObj()", sDynListCurInfo->name, + sDynListCurObj->type); } // No null return due to `fatal_printf()` being a non-returning function? } @@ -1822,8 +1820,8 @@ struct GdObj *d_get_att_to_obj(void) { /** * Store the current dynamic object's scale into `dst`. */ -void d_get_scale(struct GdVec3f *dst) { - struct GdObj *dynobj; // sp24 +void d_get_scale(struct GdVec3f* dst) { + struct GdObj* dynobj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1832,14 +1830,14 @@ void d_get_scale(struct GdVec3f *dst) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) dynobj)->scale.x; - dst->y = ((struct ObjJoint *) dynobj)->scale.y; - dst->z = ((struct ObjJoint *) dynobj)->scale.z; + dst->x = ((struct ObjJoint*)dynobj)->scale.x; + dst->y = ((struct ObjJoint*)dynobj)->scale.y; + dst->z = ((struct ObjJoint*)dynobj)->scale.z; break; case OBJ_TYPE_NETS: - dst->x = ((struct ObjNet *) dynobj)->scale.x; - dst->y = ((struct ObjNet *) dynobj)->scale.y; - dst->z = ((struct ObjNet *) dynobj)->scale.z; + dst->x = ((struct ObjNet*)dynobj)->scale.x; + dst->y = ((struct ObjNet*)dynobj)->scale.y; + dst->z = ((struct ObjNet*)dynobj)->scale.z; break; case OBJ_TYPE_LIGHTS: dst->x = 1.0f; @@ -1847,16 +1845,16 @@ void d_get_scale(struct GdVec3f *dst) { dst->z = 1.0f; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetScale()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetScale()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Set the offset of the attached object on the current dynamic object. */ -void d_set_att_offset(const struct GdVec3f *off) { - struct GdObj *dynobj; // sp24 +void d_set_att_offset(const struct GdVec3f* off) { + struct GdObj* dynobj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -1865,22 +1863,22 @@ void d_set_att_offset(const struct GdVec3f *off) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->attachOffset.x = off->x; - ((struct ObjJoint *) dynobj)->attachOffset.y = off->y; - ((struct ObjJoint *) dynobj)->attachOffset.z = off->z; + ((struct ObjJoint*)dynobj)->attachOffset.x = off->x; + ((struct ObjJoint*)dynobj)->attachOffset.y = off->y; + ((struct ObjJoint*)dynobj)->attachOffset.z = off->z; - ((struct ObjJoint *) dynobj)->initPos.x = off->x; - ((struct ObjJoint *) dynobj)->initPos.y = off->y; - ((struct ObjJoint *) dynobj)->initPos.z = off->z; + ((struct ObjJoint*)dynobj)->initPos.x = off->x; + ((struct ObjJoint*)dynobj)->initPos.y = off->y; + ((struct ObjJoint*)dynobj)->initPos.z = off->z; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->attachOffset.x = off->x; - ((struct ObjNet *) dynobj)->attachOffset.y = off->y; - ((struct ObjNet *) dynobj)->attachOffset.z = off->z; + ((struct ObjNet*)dynobj)->attachOffset.x = off->x; + ((struct ObjNet*)dynobj)->attachOffset.y = off->y; + ((struct ObjNet*)dynobj)->attachOffset.z = off->z; - ((struct ObjNet *) dynobj)->initPos.x = off->x; - ((struct ObjNet *) dynobj)->initPos.y = off->y; - ((struct ObjNet *) dynobj)->initPos.z = off->z; + ((struct ObjNet*)dynobj)->initPos.x = off->x; + ((struct ObjNet*)dynobj)->initPos.y = off->y; + ((struct ObjNet*)dynobj)->initPos.z = off->z; break; case OBJ_TYPE_PARTICLES: break; @@ -1899,7 +1897,7 @@ void d_set_att_offset(const struct GdVec3f *off) { * @note Not called */ void d_set_att_to_offset(UNUSED u32 a) { - struct GdObj *dynobj; // sp3c + struct GdObj* dynobj; // sp3c UNUSED u8 filler[24]; if (sDynListCurObj == NULL) { @@ -1910,13 +1908,13 @@ void d_set_att_to_offset(UNUSED u32 a) { d_stash_dynobj(); switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - set_cur_dynobj(((struct ObjJoint *) dynobj)->attachedToObj); + set_cur_dynobj(((struct ObjJoint*)dynobj)->attachedToObj); break; case OBJ_TYPE_NETS: - set_cur_dynobj(((struct ObjNet *) dynobj)->attachedToObj); + set_cur_dynobj(((struct ObjNet*)dynobj)->attachedToObj); break; case OBJ_TYPE_PARTICLES: - set_cur_dynobj(((struct ObjParticle *) dynobj)->attachedToObj); + set_cur_dynobj(((struct ObjParticle*)dynobj)->attachedToObj); break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAttToOffset()", @@ -1924,8 +1922,7 @@ void d_set_att_to_offset(UNUSED u32 a) { } if (sDynListCurObj == NULL) { - fatal_printf("dSetAttOffset(): Object '%s' isnt attached to anything", - sStashedDynObjInfo->name); + fatal_printf("dSetAttOffset(): Object '%s' isnt attached to anything", sStashedDynObjInfo->name); } d_set_att_to_offset(a); d_unstash_dynobj(); @@ -1936,21 +1933,21 @@ void d_set_att_to_offset(UNUSED u32 a) { * * @note Not called */ -void d_get_att_offset(struct GdVec3f *dst) { +void d_get_att_offset(struct GdVec3f* dst) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) sDynListCurObj)->attachOffset.x; - dst->y = ((struct ObjJoint *) sDynListCurObj)->attachOffset.y; - dst->z = ((struct ObjJoint *) sDynListCurObj)->attachOffset.z; + dst->x = ((struct ObjJoint*)sDynListCurObj)->attachOffset.x; + dst->y = ((struct ObjJoint*)sDynListCurObj)->attachOffset.y; + dst->z = ((struct ObjJoint*)sDynListCurObj)->attachOffset.z; break; case OBJ_TYPE_NETS: - dst->x = ((struct ObjNet *) sDynListCurObj)->attachOffset.x; - dst->y = ((struct ObjNet *) sDynListCurObj)->attachOffset.y; - dst->z = ((struct ObjNet *) sDynListCurObj)->attachOffset.z; + dst->x = ((struct ObjNet*)sDynListCurObj)->attachOffset.x; + dst->y = ((struct ObjNet*)sDynListCurObj)->attachOffset.y; + dst->z = ((struct ObjNet*)sDynListCurObj)->attachOffset.z; break; case OBJ_TYPE_PARTICLES: break; @@ -1972,17 +1969,17 @@ s32 d_get_att_flags(void) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - attflag = ((struct ObjJoint *) sDynListCurObj)->attachFlags; + attflag = ((struct ObjJoint*)sDynListCurObj)->attachFlags; break; case OBJ_TYPE_NETS: - attflag = ((struct ObjNet *) sDynListCurObj)->attachFlags; + attflag = ((struct ObjNet*)sDynListCurObj)->attachFlags; break; case OBJ_TYPE_PARTICLES: - attflag = ((struct ObjParticle *) sDynListCurObj)->attachFlags; + attflag = ((struct ObjParticle*)sDynListCurObj)->attachFlags; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttFlags()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetAttFlags()", sDynListCurInfo->name, + sDynListCurObj->type); } return attflag; @@ -2000,38 +1997,38 @@ void d_set_world_pos(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_CAMERAS: - ((struct ObjCamera *) sDynListCurObj)->worldPos.x = x; - ((struct ObjCamera *) sDynListCurObj)->worldPos.y = y; - ((struct ObjCamera *) sDynListCurObj)->worldPos.z = z; + ((struct ObjCamera*)sDynListCurObj)->worldPos.x = x; + ((struct ObjCamera*)sDynListCurObj)->worldPos.y = y; + ((struct ObjCamera*)sDynListCurObj)->worldPos.z = z; break; case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->worldPos.x = x; - ((struct ObjJoint *) sDynListCurObj)->worldPos.y = y; - ((struct ObjJoint *) sDynListCurObj)->worldPos.z = z; + ((struct ObjJoint*)sDynListCurObj)->worldPos.x = x; + ((struct ObjJoint*)sDynListCurObj)->worldPos.y = y; + ((struct ObjJoint*)sDynListCurObj)->worldPos.z = z; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->worldPos.x = x; - ((struct ObjNet *) sDynListCurObj)->worldPos.y = y; - ((struct ObjNet *) sDynListCurObj)->worldPos.z = z; + ((struct ObjNet*)sDynListCurObj)->worldPos.x = x; + ((struct ObjNet*)sDynListCurObj)->worldPos.y = y; + ((struct ObjNet*)sDynListCurObj)->worldPos.z = z; break; case OBJ_TYPE_GADGETS: - ((struct ObjGadget *) sDynListCurObj)->worldPos.x = x; - ((struct ObjGadget *) sDynListCurObj)->worldPos.y = y; - ((struct ObjGadget *) sDynListCurObj)->worldPos.z = z; + ((struct ObjGadget*)sDynListCurObj)->worldPos.x = x; + ((struct ObjGadget*)sDynListCurObj)->worldPos.y = y; + ((struct ObjGadget*)sDynListCurObj)->worldPos.z = z; break; case OBJ_TYPE_VIEWS: - ((struct ObjView *) sDynListCurObj)->upperLeft.x = x; - ((struct ObjView *) sDynListCurObj)->upperLeft.y = y; - ((struct ObjView *) sDynListCurObj)->upperLeft.z = z; + ((struct ObjView*)sDynListCurObj)->upperLeft.x = x; + ((struct ObjView*)sDynListCurObj)->upperLeft.y = y; + ((struct ObjView*)sDynListCurObj)->upperLeft.z = z; break; case OBJ_TYPE_VERTICES: - ((struct ObjVertex *) sDynListCurObj)->pos.x = x; - ((struct ObjVertex *) sDynListCurObj)->pos.y = y; - ((struct ObjVertex *) sDynListCurObj)->pos.z = z; + ((struct ObjVertex*)sDynListCurObj)->pos.x = x; + ((struct ObjVertex*)sDynListCurObj)->pos.y = y; + ((struct ObjVertex*)sDynListCurObj)->pos.z = z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetWorldPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetWorldPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2053,13 +2050,13 @@ void d_set_normal(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_VERTICES: - ((struct ObjVertex *) sDynListCurObj)->normal.x = normal.x; - ((struct ObjVertex *) sDynListCurObj)->normal.y = normal.y; - ((struct ObjVertex *) sDynListCurObj)->normal.z = normal.z; + ((struct ObjVertex*)sDynListCurObj)->normal.x = normal.x; + ((struct ObjVertex*)sDynListCurObj)->normal.y = normal.y; + ((struct ObjVertex*)sDynListCurObj)->normal.z = normal.z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetNormal()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetNormal()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2069,17 +2066,17 @@ void d_set_normal(f32 x, f32 y, f32 z) { * * @note Not called. */ -struct GdVec3f *d_get_world_pos_ptr(void) { +struct GdVec3f* d_get_world_pos_ptr(void) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_VERTICES: - return &((struct ObjVertex *) sDynListCurObj)->pos; + return &((struct ObjVertex*)sDynListCurObj)->pos; break; case OBJ_TYPE_PARTICLES: - return &((struct ObjParticle *) sDynListCurObj)->pos; + return &((struct ObjParticle*)sDynListCurObj)->pos; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetWorldPosPtr()", @@ -2091,41 +2088,41 @@ struct GdVec3f *d_get_world_pos_ptr(void) { /** * Copy the world position of the current dynamic object into `dst`. */ -void d_get_world_pos(struct GdVec3f *dst) { +void d_get_world_pos(struct GdVec3f* dst) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_VERTICES: - dst->x = ((struct ObjVertex *) sDynListCurObj)->pos.x; - dst->y = ((struct ObjVertex *) sDynListCurObj)->pos.y; - dst->z = ((struct ObjVertex *) sDynListCurObj)->pos.z; + dst->x = ((struct ObjVertex*)sDynListCurObj)->pos.x; + dst->y = ((struct ObjVertex*)sDynListCurObj)->pos.y; + dst->z = ((struct ObjVertex*)sDynListCurObj)->pos.z; break; case OBJ_TYPE_JOINTS: - dst->x = ((struct ObjJoint *) sDynListCurObj)->worldPos.x; - dst->y = ((struct ObjJoint *) sDynListCurObj)->worldPos.y; - dst->z = ((struct ObjJoint *) sDynListCurObj)->worldPos.z; + dst->x = ((struct ObjJoint*)sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjJoint*)sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjJoint*)sDynListCurObj)->worldPos.z; break; case OBJ_TYPE_NETS: - dst->x = ((struct ObjNet *) sDynListCurObj)->worldPos.x; - dst->y = ((struct ObjNet *) sDynListCurObj)->worldPos.y; - dst->z = ((struct ObjNet *) sDynListCurObj)->worldPos.z; + dst->x = ((struct ObjNet*)sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjNet*)sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjNet*)sDynListCurObj)->worldPos.z; break; case OBJ_TYPE_PARTICLES: - dst->x = ((struct ObjParticle *) sDynListCurObj)->pos.x; - dst->y = ((struct ObjParticle *) sDynListCurObj)->pos.y; - dst->z = ((struct ObjParticle *) sDynListCurObj)->pos.z; + dst->x = ((struct ObjParticle*)sDynListCurObj)->pos.x; + dst->y = ((struct ObjParticle*)sDynListCurObj)->pos.y; + dst->z = ((struct ObjParticle*)sDynListCurObj)->pos.z; break; case OBJ_TYPE_CAMERAS: - dst->x = ((struct ObjCamera *) sDynListCurObj)->worldPos.x; - dst->y = ((struct ObjCamera *) sDynListCurObj)->worldPos.y; - dst->z = ((struct ObjCamera *) sDynListCurObj)->worldPos.z; + dst->x = ((struct ObjCamera*)sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjCamera*)sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjCamera*)sDynListCurObj)->worldPos.z; break; case OBJ_TYPE_BONES: - dst->x = ((struct ObjBone *) sDynListCurObj)->worldPos.x; - dst->y = ((struct ObjBone *) sDynListCurObj)->worldPos.y; - dst->z = ((struct ObjBone *) sDynListCurObj)->worldPos.z; + dst->x = ((struct ObjBone*)sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjBone*)sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjBone*)sDynListCurObj)->worldPos.z; break; case OBJ_TYPE_SHAPES: dst->x = dst->y = dst->z = 0.0f; @@ -2134,44 +2131,44 @@ void d_get_world_pos(struct GdVec3f *dst) { dst->x = dst->y = dst->z = 0.0f; break; case OBJ_TYPE_GADGETS: - dst->x = ((struct ObjGadget *) sDynListCurObj)->worldPos.x; - dst->y = ((struct ObjGadget *) sDynListCurObj)->worldPos.y; - dst->z = ((struct ObjGadget *) sDynListCurObj)->worldPos.z; + dst->x = ((struct ObjGadget*)sDynListCurObj)->worldPos.x; + dst->y = ((struct ObjGadget*)sDynListCurObj)->worldPos.y; + dst->z = ((struct ObjGadget*)sDynListCurObj)->worldPos.z; break; case OBJ_TYPE_PLANES: - dst->x = ((struct ObjPlane *) sDynListCurObj)->boundingBox.minX; - dst->y = ((struct ObjPlane *) sDynListCurObj)->boundingBox.minY; - dst->z = ((struct ObjPlane *) sDynListCurObj)->boundingBox.minZ; + dst->x = ((struct ObjPlane*)sDynListCurObj)->boundingBox.minX; + dst->y = ((struct ObjPlane*)sDynListCurObj)->boundingBox.minY; + dst->z = ((struct ObjPlane*)sDynListCurObj)->boundingBox.minZ; - dst->x += ((struct ObjPlane *) sDynListCurObj)->boundingBox.maxX; - dst->y += ((struct ObjPlane *) sDynListCurObj)->boundingBox.maxY; - dst->z += ((struct ObjPlane *) sDynListCurObj)->boundingBox.maxZ; + dst->x += ((struct ObjPlane*)sDynListCurObj)->boundingBox.maxX; + dst->y += ((struct ObjPlane*)sDynListCurObj)->boundingBox.maxY; + dst->z += ((struct ObjPlane*)sDynListCurObj)->boundingBox.maxZ; dst->x *= 0.5; //? 0.5f dst->y *= 0.5; //? 0.5f dst->z *= 0.5; //? 0.5f break; case OBJ_TYPE_ZONES: - dst->x = ((struct ObjZone *) sDynListCurObj)->boundingBox.minX; - dst->y = ((struct ObjZone *) sDynListCurObj)->boundingBox.minY; - dst->z = ((struct ObjZone *) sDynListCurObj)->boundingBox.minZ; + dst->x = ((struct ObjZone*)sDynListCurObj)->boundingBox.minX; + dst->y = ((struct ObjZone*)sDynListCurObj)->boundingBox.minY; + dst->z = ((struct ObjZone*)sDynListCurObj)->boundingBox.minZ; - dst->x += ((struct ObjZone *) sDynListCurObj)->boundingBox.maxX; - dst->y += ((struct ObjZone *) sDynListCurObj)->boundingBox.maxY; - dst->z += ((struct ObjZone *) sDynListCurObj)->boundingBox.maxZ; + dst->x += ((struct ObjZone*)sDynListCurObj)->boundingBox.maxX; + dst->y += ((struct ObjZone*)sDynListCurObj)->boundingBox.maxY; + dst->z += ((struct ObjZone*)sDynListCurObj)->boundingBox.maxZ; dst->x *= 0.5; //? 0.5f dst->y *= 0.5; //? 0.5f dst->z *= 0.5; //? 0.5f break; case OBJ_TYPE_LIGHTS: - dst->x = ((struct ObjLight *) sDynListCurObj)->position.x; - dst->y = ((struct ObjLight *) sDynListCurObj)->position.y; - dst->z = ((struct ObjLight *) sDynListCurObj)->position.z; + dst->x = ((struct ObjLight*)sDynListCurObj)->position.x; + dst->y = ((struct ObjLight*)sDynListCurObj)->position.y; + dst->z = ((struct ObjLight*)sDynListCurObj)->position.z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetWorldPos()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetWorldPos()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2180,7 +2177,7 @@ void d_get_world_pos(struct GdVec3f *dst) { * * @param[in] pos values are copied to set vertex position */ -void d_make_vertex(struct GdVec3f *pos) { +void d_make_vertex(struct GdVec3f* pos) { d_makeobj(D_VERTEX, AsDynName(NULL)); d_set_init_pos(pos->x, pos->y, pos->z); } @@ -2191,7 +2188,7 @@ void d_make_vertex(struct GdVec3f *pos) { * @note Sets the lower right coordinates of an `ObjView` */ void d_set_scale(f32 x, f32 y, f32 z) { - struct GdObj *initDynobj; + struct GdObj* initDynobj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2201,35 +2198,35 @@ void d_set_scale(f32 x, f32 y, f32 z) { d_stash_dynobj(); switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) initDynobj)->scale.x = x; - ((struct ObjJoint *) initDynobj)->scale.y = y; - ((struct ObjJoint *) initDynobj)->scale.z = z; + ((struct ObjJoint*)initDynobj)->scale.x = x; + ((struct ObjJoint*)initDynobj)->scale.y = y; + ((struct ObjJoint*)initDynobj)->scale.z = z; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) initDynobj)->scale.x = x; - ((struct ObjNet *) initDynobj)->scale.y = y; - ((struct ObjNet *) initDynobj)->scale.z = z; + ((struct ObjNet*)initDynobj)->scale.x = x; + ((struct ObjNet*)initDynobj)->scale.y = y; + ((struct ObjNet*)initDynobj)->scale.z = z; break; case OBJ_TYPE_VIEWS: - ((struct ObjView *) initDynobj)->lowerRight.x = x; - ((struct ObjView *) initDynobj)->lowerRight.y = y; - ((struct ObjView *) initDynobj)->lowerRight.z = z; + ((struct ObjView*)initDynobj)->lowerRight.x = x; + ((struct ObjView*)initDynobj)->lowerRight.y = y; + ((struct ObjView*)initDynobj)->lowerRight.z = z; break; case OBJ_TYPE_PARTICLES: break; case OBJ_TYPE_GADGETS: - if (((struct ObjGadget *) initDynobj)->shapePtr != NULL) { - scale_verts_in_shape(((struct ObjGadget *) initDynobj)->shapePtr, x, y, z); + if (((struct ObjGadget*)initDynobj)->shapePtr != NULL) { + scale_verts_in_shape(((struct ObjGadget*)initDynobj)->shapePtr, x, y, z); } - ((struct ObjGadget *) initDynobj)->size.x = x; - ((struct ObjGadget *) initDynobj)->size.y = y; - ((struct ObjGadget *) initDynobj)->size.z = z; + ((struct ObjGadget*)initDynobj)->size.x = x; + ((struct ObjGadget*)initDynobj)->size.y = y; + ((struct ObjGadget*)initDynobj)->size.z = z; break; case OBJ_TYPE_LIGHTS: break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetScale()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetScale()", sDynListCurInfo->name, + sDynListCurObj->type); } d_unstash_dynobj(); } @@ -2238,7 +2235,7 @@ void d_set_scale(f32 x, f32 y, f32 z) { * Set the rotation value of the current active dynamic object. */ void d_set_rotation(f32 x, f32 y, f32 z) { - struct GdObj *dynobj; // sp2C + struct GdObj* dynobj; // sp2C UNUSED u8 filler[4]; if (sDynListCurObj == NULL) { @@ -2248,18 +2245,18 @@ void d_set_rotation(f32 x, f32 y, f32 z) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->unk6C.x = x; - ((struct ObjJoint *) dynobj)->unk6C.y = y; - ((struct ObjJoint *) dynobj)->unk6C.z = z; + ((struct ObjJoint*)dynobj)->unk6C.x = x; + ((struct ObjJoint*)dynobj)->unk6C.y = y; + ((struct ObjJoint*)dynobj)->unk6C.z = z; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->unk68.x = x; - ((struct ObjNet *) dynobj)->unk68.y = y; - ((struct ObjNet *) dynobj)->unk68.z = z; + ((struct ObjNet*)dynobj)->unk68.x = x; + ((struct ObjNet*)dynobj)->unk68.y = y; + ((struct ObjNet*)dynobj)->unk68.z = z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRotation()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRotation()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2273,13 +2270,13 @@ void d_center_of_gravity(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->centerOfGravity.x = x; - ((struct ObjNet *) sDynListCurObj)->centerOfGravity.y = y; - ((struct ObjNet *) sDynListCurObj)->centerOfGravity.z = z; + ((struct ObjNet*)sDynListCurObj)->centerOfGravity.x = x; + ((struct ObjNet*)sDynListCurObj)->centerOfGravity.y = y; + ((struct ObjNet*)sDynListCurObj)->centerOfGravity.z = z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dCofG()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dCofG()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2293,13 +2290,13 @@ void d_set_shape_offset(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->shapeOffset.x = x; - ((struct ObjJoint *) sDynListCurObj)->shapeOffset.y = y; - ((struct ObjJoint *) sDynListCurObj)->shapeOffset.z = z; + ((struct ObjJoint*)sDynListCurObj)->shapeOffset.x = x; + ((struct ObjJoint*)sDynListCurObj)->shapeOffset.y = y; + ((struct ObjJoint*)sDynListCurObj)->shapeOffset.z = z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dShapeOffset()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dShapeOffset()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2310,9 +2307,9 @@ void d_set_shape_offset(f32 x, f32 y, f32 z) { * the address of a standalone variable. */ void d_add_valptr(DynObjName name, u32 vflags, enum ValPtrType type, size_t offset) { - struct GdObj *dynobj; - struct ObjValPtr *valptr; - struct DynObjInfo *info; + struct GdObj* dynobj; + struct ObjValPtr* valptr; + struct DynObjInfo* info; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2335,17 +2332,17 @@ void d_add_valptr(DynObjName name, u32 vflags, enum ValPtrType type, size_t offs switch (sDynListCurObj->type) { case OBJ_TYPE_GADGETS: - if (((struct ObjGadget *) dynobj)->valueGrp == NULL) { - ((struct ObjGadget *) dynobj)->valueGrp = make_group(0); + if (((struct ObjGadget*)dynobj)->valueGrp == NULL) { + ((struct ObjGadget*)dynobj)->valueGrp = make_group(0); } - addto_group(((struct ObjGadget *) dynobj)->valueGrp, &valptr->header); + addto_group(((struct ObjGadget*)dynobj)->valueGrp, &valptr->header); break; case OBJ_TYPE_LABELS: - ((struct ObjLabel *) dynobj)->valptr = valptr; + ((struct ObjLabel*)dynobj)->valptr = valptr; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddValPtr()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddValPtr()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2354,7 +2351,7 @@ void d_add_valptr(DynObjName name, u32 vflags, enum ValPtrType type, size_t offs * dynamic `ObjLabel`. */ void d_add_valproc(valptrproc_t proc) { - struct GdObj *dynobj; + struct GdObj* dynobj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2363,11 +2360,11 @@ void d_add_valproc(valptrproc_t proc) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_LABELS: - ((struct ObjLabel *) dynobj)->valfn = proc; + ((struct ObjLabel*)dynobj)->valfn = proc; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddValProc()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dAddValProc()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2376,10 +2373,10 @@ void d_add_valproc(valptrproc_t proc) { * In the final game, this is used to link arrays of raw vertex, face, * or animation data to `ObjGroup`s, or to link joints to `ObjAnimator`s. */ -void d_link_with_ptr(void *ptr) { - struct GdObj *dynobj; // sp34 - struct ObjValPtr *valptr; // sp30 - struct ListNode *link; // sp2C +void d_link_with_ptr(void* ptr) { + struct GdObj* dynobj; // sp34 + struct ObjValPtr* valptr; // sp30 + struct ListNode* link; // sp2C if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2389,52 +2386,50 @@ void d_link_with_ptr(void *ptr) { imin("dLinkWithPtr"); switch (sDynListCurObj->type) { case OBJ_TYPE_CAMERAS: - ((struct ObjCamera *) dynobj)->unk30 = ptr; + ((struct ObjCamera*)dynobj)->unk30 = ptr; break; case OBJ_TYPE_GROUPS: link = make_link_to_obj(NULL, ptr); - ((struct ObjGroup *) dynobj)->firstMember = link; + ((struct ObjGroup*)dynobj)->firstMember = link; break; case OBJ_TYPE_BONES: - add_joint2bone((struct ObjBone *) dynobj, ptr); + add_joint2bone((struct ObjBone*)dynobj, ptr); break; case OBJ_TYPE_VIEWS: - ((struct ObjView *) dynobj)->components = ptr; - ((struct ObjView *) dynobj)->unk1C = - setup_view_buffers(((struct ObjView *) dynobj)->namePtr, ((struct ObjView *) dynobj), - (s32)((struct ObjView *) dynobj)->upperLeft.x, - (s32)((struct ObjView *) dynobj)->upperLeft.y, - (s32)((struct ObjView *) dynobj)->lowerRight.x, - (s32)((struct ObjView *) dynobj)->lowerRight.y); - reset_nets_and_gadgets(((struct ObjView *) dynobj)->components); + ((struct ObjView*)dynobj)->components = ptr; + ((struct ObjView*)dynobj)->unk1C = setup_view_buffers( + ((struct ObjView*)dynobj)->namePtr, ((struct ObjView*)dynobj), + (s32)((struct ObjView*)dynobj)->upperLeft.x, (s32)((struct ObjView*)dynobj)->upperLeft.y, + (s32)((struct ObjView*)dynobj)->lowerRight.x, (s32)((struct ObjView*)dynobj)->lowerRight.y); + reset_nets_and_gadgets(((struct ObjView*)dynobj)->components); break; case OBJ_TYPE_FACES: - if (((struct ObjFace *) dynobj)->vtxCount >= 4) { + if (((struct ObjFace*)dynobj)->vtxCount >= 4) { fatal_printf("too many points"); } - ((struct ObjFace *) dynobj)->vertices[((struct ObjFace *) dynobj)->vtxCount] = ptr; - ((struct ObjFace *) dynobj)->vtxCount++; + ((struct ObjFace*)dynobj)->vertices[((struct ObjFace*)dynobj)->vtxCount] = ptr; + ((struct ObjFace*)dynobj)->vtxCount++; - if (((struct ObjFace *) dynobj)->vtxCount >= 3) { - calc_face_normal((struct ObjFace *) dynobj); + if (((struct ObjFace*)dynobj)->vtxCount >= 3) { + calc_face_normal((struct ObjFace*)dynobj); } break; case OBJ_TYPE_ANIMATORS: - if (((struct ObjAnimator *) dynobj)->animatedPartsGrp == NULL) { - ((struct ObjAnimator *) dynobj)->animatedPartsGrp = make_group(0); + if (((struct ObjAnimator*)dynobj)->animatedPartsGrp == NULL) { + ((struct ObjAnimator*)dynobj)->animatedPartsGrp = make_group(0); } - addto_group(((struct ObjAnimator *) dynobj)->animatedPartsGrp, ptr); + addto_group(((struct ObjAnimator*)dynobj)->animatedPartsGrp, ptr); break; case OBJ_TYPE_LABELS: valptr = make_valptr(ptr, OBJ_TYPE_ALL, 0, 0); - ((struct ObjLabel *) dynobj)->valptr = valptr; + ((struct ObjLabel*)dynobj)->valptr = valptr; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dLinkWithPtr()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dLinkWithPtr()", sDynListCurInfo->name, + sDynListCurObj->type); } imout(); } @@ -2444,8 +2439,8 @@ void d_link_with_ptr(void *ptr) { * `d_link_with_ptr()`. */ void d_link_with(DynObjName name) { - struct DynObjInfo *info; // sp1C - struct DynObjInfo *origInfo = sDynListCurInfo; // sp18 + struct DynObjInfo* info; // sp1C + struct DynObjInfo* origInfo = sDynListCurInfo; // sp18 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2469,7 +2464,7 @@ void d_link_with(DynObjName name) { * Set the object specific flags of the current dynamic object. */ void d_set_flags(s32 flags) { - struct GdObj *dynobj; // sp24 + struct GdObj* dynobj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2478,32 +2473,32 @@ void d_set_flags(s32 flags) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->flags |= flags; + ((struct ObjJoint*)dynobj)->flags |= flags; break; case OBJ_TYPE_BONES: - ((struct ObjBone *) dynobj)->unk104 |= flags; + ((struct ObjBone*)dynobj)->unk104 |= flags; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->flags |= flags; + ((struct ObjNet*)dynobj)->flags |= flags; break; case OBJ_TYPE_CAMERAS: - ((struct ObjCamera *) dynobj)->flags |= flags; + ((struct ObjCamera*)dynobj)->flags |= flags; break; case OBJ_TYPE_VIEWS: - ((struct ObjView *) dynobj)->flags |= flags; + ((struct ObjView*)dynobj)->flags |= flags; break; case OBJ_TYPE_SHAPES: - ((struct ObjShape *) dynobj)->flag |= flags; + ((struct ObjShape*)dynobj)->flag |= flags; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) dynobj)->flags |= flags; + ((struct ObjParticle*)dynobj)->flags |= flags; break; case OBJ_TYPE_LIGHTS: - ((struct ObjLight *) dynobj)->flags |= flags; + ((struct ObjLight*)dynobj)->flags |= flags; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetFlags()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetFlags()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2517,23 +2512,23 @@ void d_clear_flags(s32 flags) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->flags &= ~flags; + ((struct ObjJoint*)sDynListCurObj)->flags &= ~flags; break; case OBJ_TYPE_BONES: - ((struct ObjBone *) sDynListCurObj)->unk104 &= ~flags; + ((struct ObjBone*)sDynListCurObj)->unk104 &= ~flags; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->flags &= ~flags; + ((struct ObjNet*)sDynListCurObj)->flags &= ~flags; break; case OBJ_TYPE_CAMERAS: - ((struct ObjCamera *) sDynListCurObj)->flags &= ~flags; + ((struct ObjCamera*)sDynListCurObj)->flags &= ~flags; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) sDynListCurObj)->flags &= ~flags; + ((struct ObjParticle*)sDynListCurObj)->flags &= ~flags; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dClrFlags()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dClrFlags()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2551,45 +2546,42 @@ void d_set_parm_f(enum DParmF param, f32 val) { case OBJ_TYPE_SHAPES: switch (param) { case PARM_F_ALPHA: - ((struct ObjShape *) sDynListCurObj)->alpha = val; + ((struct ObjShape*)sDynListCurObj)->alpha = val; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", - "dSetParmf() - unsupported parm.", sDynListCurInfo->name, - sDynListCurObj->type); + "dSetParmf() - unsupported parm.", sDynListCurInfo->name, sDynListCurObj->type); } break; case OBJ_TYPE_GADGETS: switch (param) { case PARM_F_RANGE_MIN: - ((struct ObjGadget *) sDynListCurObj)->rangeMin = val; + ((struct ObjGadget*)sDynListCurObj)->rangeMin = val; break; case PARM_F_RANGE_MAX: - ((struct ObjGadget *) sDynListCurObj)->rangeMax = val; + ((struct ObjGadget*)sDynListCurObj)->rangeMax = val; break; case PARM_F_VARVAL: - ((struct ObjGadget *) sDynListCurObj)->varval.f = val; + ((struct ObjGadget*)sDynListCurObj)->varval.f = val; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", - "dSetParmf() - unsupported parm.", sDynListCurInfo->name, - sDynListCurObj->type); + "dSetParmf() - unsupported parm.", sDynListCurInfo->name, sDynListCurObj->type); } break; case OBJ_TYPE_VERTICES: switch (param) { case PARM_F_ALPHA: - ((struct ObjVertex *) sDynListCurObj)->alpha = val; + ((struct ObjVertex*)sDynListCurObj)->alpha = val; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", - "dSetParmf() - unsupported parm.", sDynListCurInfo->name, - sDynListCurObj->type); + "dSetParmf() - unsupported parm.", sDynListCurInfo->name, sDynListCurObj->type); } break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetParmf()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetParmf()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2598,7 +2590,7 @@ void d_set_parm_f(enum DParmF param, f32 val) { * Normally, this is used to set `char *` pointer for various objects, * but it can also set the vertices for an `ObjFace`. */ -void d_set_parm_ptr(enum DParmPtr param, void *ptr) { +void d_set_parm_ptr(enum DParmPtr param, void* ptr) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } @@ -2607,7 +2599,7 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) { case OBJ_TYPE_LABELS: switch (param) { case PARM_PTR_CHAR: - ((struct ObjLabel *) sDynListCurObj)->fmtstr = ptr; + ((struct ObjLabel*)sDynListCurObj)->fmtstr = ptr; break; default: fatal_printf("Bad parm"); @@ -2616,7 +2608,7 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) { case OBJ_TYPE_VIEWS: switch (param) { case PARM_PTR_CHAR: - ((struct ObjView *) sDynListCurObj)->namePtr = ptr; + ((struct ObjView*)sDynListCurObj)->namePtr = ptr; break; default: fatal_printf("Bad parm"); @@ -2626,20 +2618,21 @@ void d_set_parm_ptr(enum DParmPtr param, void *ptr) { switch (param) { case PARM_PTR_OBJ_VTX: // Don't allow more than 4 vertices in a face - if (((struct ObjFace *) sDynListCurObj)->vtxCount >= 4) { + if (((struct ObjFace*)sDynListCurObj)->vtxCount >= 4) { fatal_printf("dsetparmp() too many points"); } // `ptr` here is a vertex index, not an actual pointer. - // These vertex indices later get converted to `ObjVertex` pointers when `find_thisface_verts` is called. - ((struct ObjFace *) sDynListCurObj)->vertices[((struct ObjFace *) sDynListCurObj)->vtxCount++] = ptr; + // These vertex indices later get converted to `ObjVertex` pointers when `find_thisface_verts` is + // called. + ((struct ObjFace*)sDynListCurObj)->vertices[((struct ObjFace*)sDynListCurObj)->vtxCount++] = ptr; break; default: fatal_printf("Bad parm"); } break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetParmp()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetParmp()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2658,7 +2651,7 @@ void d_set_obj_draw_flag(enum ObjDrawingFlags flag) { * Set an object specific type field for the current dynamic object. */ void d_set_type(s32 type) { - struct GdObj *dynobj = sDynListCurObj; // sp24 + struct GdObj* dynobj = sDynListCurObj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2666,26 +2659,26 @@ void d_set_type(s32 type) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) dynobj)->netType = type; + ((struct ObjNet*)dynobj)->netType = type; break; case OBJ_TYPE_GADGETS: - ((struct ObjGadget *) dynobj)->type = type; + ((struct ObjGadget*)dynobj)->type = type; break; case OBJ_TYPE_GROUPS: - ((struct ObjGroup *) dynobj)->debugPrint = type; + ((struct ObjGroup*)dynobj)->debugPrint = type; break; case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->type = type; + ((struct ObjJoint*)dynobj)->type = type; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) dynobj)->unk60 = type; + ((struct ObjParticle*)dynobj)->unk60 = type; break; case OBJ_TYPE_MATERIALS: - ((struct ObjMaterial *) dynobj)->type = type; + ((struct ObjMaterial*)dynobj)->type = type; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetType()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetType()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2693,7 +2686,7 @@ void d_set_type(s32 type) { * Set the specific object ID field for the current dynamic object. */ void d_set_id(s32 id) { - struct GdObj *dynobj = sDynListCurObj; // sp24 + struct GdObj* dynobj = sDynListCurObj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2701,20 +2694,20 @@ void d_set_id(s32 id) { switch (sDynListCurObj->type) { case OBJ_TYPE_MATERIALS: - ((struct ObjMaterial *) dynobj)->id = id; + ((struct ObjMaterial*)dynobj)->id = id; break; case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) dynobj)->id = id; + ((struct ObjJoint*)dynobj)->id = id; break; case OBJ_TYPE_VERTICES: - ((struct ObjVertex *) dynobj)->id = id; + ((struct ObjVertex*)dynobj)->id = id; break; case OBJ_TYPE_LIGHTS: - ((struct ObjLight *) dynobj)->id = id; + ((struct ObjLight*)dynobj)->id = id; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetID()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetID()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2724,7 +2717,7 @@ void d_set_id(s32 id) { * for `gd_get_colour()` */ void d_set_colour_num(s32 colornum) { - struct GdColour *rgbcolor; + struct GdColour* rgbcolor; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2732,49 +2725,49 @@ void d_set_colour_num(s32 colornum) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->colourNum = colornum; + ((struct ObjJoint*)sDynListCurObj)->colourNum = colornum; break; case OBJ_TYPE_PARTICLES: - ((struct ObjParticle *) sDynListCurObj)->colourNum = colornum; + ((struct ObjParticle*)sDynListCurObj)->colourNum = colornum; break; case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->colourNum = colornum; + ((struct ObjNet*)sDynListCurObj)->colourNum = colornum; break; case OBJ_TYPE_GADGETS: - ((struct ObjGadget *) sDynListCurObj)->colourNum = colornum; + ((struct ObjGadget*)sDynListCurObj)->colourNum = colornum; break; case OBJ_TYPE_FACES: rgbcolor = gd_get_colour(colornum); if (rgbcolor != NULL) { - ((struct ObjFace *) sDynListCurObj)->colour.r = rgbcolor->r; - ((struct ObjFace *) sDynListCurObj)->colour.g = rgbcolor->g; - ((struct ObjFace *) sDynListCurObj)->colour.b = rgbcolor->b; - ((struct ObjFace *) sDynListCurObj)->colourNum = colornum; + ((struct ObjFace*)sDynListCurObj)->colour.r = rgbcolor->r; + ((struct ObjFace*)sDynListCurObj)->colour.g = rgbcolor->g; + ((struct ObjFace*)sDynListCurObj)->colour.b = rgbcolor->b; + ((struct ObjFace*)sDynListCurObj)->colourNum = colornum; } else { fatal_printf("dSetColNum: Unkown colour number"); } break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dColourNum()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dColourNum()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Set the material ID of the current dynamic `ObjFace`. */ -void d_set_material(UNUSED void *a0, s32 mtlId) { +void d_set_material(UNUSED void* a0, s32 mtlId) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_FACES: - ((struct ObjFace *) sDynListCurObj)->mtlId = mtlId; + ((struct ObjFace*)sDynListCurObj)->mtlId = mtlId; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMaterial()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMaterial()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2788,13 +2781,13 @@ void d_friction(f32 x, f32 y, f32 z) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) sDynListCurObj)->friction.x = x; - ((struct ObjJoint *) sDynListCurObj)->friction.y = y; - ((struct ObjJoint *) sDynListCurObj)->friction.z = z; + ((struct ObjJoint*)sDynListCurObj)->friction.x = x; + ((struct ObjJoint*)sDynListCurObj)->friction.y = y; + ((struct ObjJoint*)sDynListCurObj)->friction.z = z; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dFriction()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dFriction()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2808,11 +2801,11 @@ void d_set_spring(f32 spring) { switch (sDynListCurObj->type) { case OBJ_TYPE_BONES: - ((struct ObjBone *) sDynListCurObj)->spring = spring; + ((struct ObjBone*)sDynListCurObj)->spring = spring; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSpring()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSpring()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2826,13 +2819,13 @@ void d_set_ambient(f32 r, f32 g, f32 b) { switch (sDynListCurObj->type) { case OBJ_TYPE_MATERIALS: - ((struct ObjMaterial *) sDynListCurObj)->Ka.r = r; - ((struct ObjMaterial *) sDynListCurObj)->Ka.g = g; - ((struct ObjMaterial *) sDynListCurObj)->Ka.b = b; + ((struct ObjMaterial*)sDynListCurObj)->Ka.r = r; + ((struct ObjMaterial*)sDynListCurObj)->Ka.g = g; + ((struct ObjMaterial*)sDynListCurObj)->Ka.b = b; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAmbient()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetAmbient()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2846,18 +2839,18 @@ void d_set_diffuse(f32 r, f32 g, f32 b) { switch (sDynListCurObj->type) { case OBJ_TYPE_MATERIALS: - ((struct ObjMaterial *) sDynListCurObj)->Kd.r = r; - ((struct ObjMaterial *) sDynListCurObj)->Kd.g = g; - ((struct ObjMaterial *) sDynListCurObj)->Kd.b = b; + ((struct ObjMaterial*)sDynListCurObj)->Kd.r = r; + ((struct ObjMaterial*)sDynListCurObj)->Kd.g = g; + ((struct ObjMaterial*)sDynListCurObj)->Kd.b = b; break; case OBJ_TYPE_LIGHTS: - ((struct ObjLight *) sDynListCurObj)->diffuse.r = r; - ((struct ObjLight *) sDynListCurObj)->diffuse.g = g; - ((struct ObjLight *) sDynListCurObj)->diffuse.b = b; + ((struct ObjLight*)sDynListCurObj)->diffuse.r = r; + ((struct ObjLight*)sDynListCurObj)->diffuse.g = g; + ((struct ObjLight*)sDynListCurObj)->diffuse.b = b; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetDiffuse()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetDiffuse()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2871,11 +2864,11 @@ void d_set_control_type(s32 ctrltype) { switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - ((struct ObjNet *) sDynListCurObj)->ctrlType = ctrltype; + ((struct ObjNet*)sDynListCurObj)->ctrlType = ctrltype; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dControlType()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dControlType()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2884,20 +2877,20 @@ void d_set_control_type(s32 ctrltype) { * If the current object does not have a bounding box, a pointer to * a global bounding box at (0,0) is returned. */ -struct GdBoundingBox *d_get_bounding_box(void) { +struct GdBoundingBox* d_get_bounding_box(void) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - return &((struct ObjNet *) sDynListCurObj)->boundingBox; + return &((struct ObjNet*)sDynListCurObj)->boundingBox; break; case OBJ_TYPE_PLANES: - return &((struct ObjPlane *) sDynListCurObj)->boundingBox; + return &((struct ObjPlane*)sDynListCurObj)->boundingBox; break; case OBJ_TYPE_ZONES: - return &((struct ObjZone *) sDynListCurObj)->boundingBox; + return &((struct ObjZone*)sDynListCurObj)->boundingBox; break; default: return &sNullBoundingBox; @@ -2907,8 +2900,8 @@ struct GdBoundingBox *d_get_bounding_box(void) { /** * Copy the matrix from the current dynamic object into `dst`. */ -void d_get_matrix(Mat4f *dst) { - struct GdObj *dynobj; // sp24 +void d_get_matrix(Mat4f* dst) { + struct GdObj* dynobj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -2917,14 +2910,14 @@ void d_get_matrix(Mat4f *dst) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - gd_copy_mat4f(&((struct ObjNet *) dynobj)->mat128, dst); + gd_copy_mat4f(&((struct ObjNet*)dynobj)->mat128, dst); break; break; // lol case OBJ_TYPE_JOINTS: - gd_copy_mat4f(&((struct ObjJoint *) dynobj)->matE8, dst); + gd_copy_mat4f(&((struct ObjJoint*)dynobj)->matE8, dst); break; case OBJ_TYPE_CAMERAS: - gd_copy_mat4f(&((struct ObjCamera *) dynobj)->unkE8, dst); + gd_copy_mat4f(&((struct ObjCamera*)dynobj)->unkE8, dst); break; case OBJ_TYPE_PARTICLES: gd_set_identity_mat4(dst); @@ -2933,35 +2926,35 @@ void d_get_matrix(Mat4f *dst) { gd_set_identity_mat4(dst); break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetMatrix()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetMatrix()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Set the matrix of the current dynamic object by copying `src` into the object. */ -void d_set_matrix(Mat4f *src) { +void d_set_matrix(Mat4f* src) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - gd_copy_mat4f(src, &((struct ObjNet *) sDynListCurObj)->mat128); + gd_copy_mat4f(src, &((struct ObjNet*)sDynListCurObj)->mat128); //! @bug When setting an `ObjNet` matrix, the source is copied twice //! due to a probable copy-paste line repeat error - gd_copy_mat4f(src, &((struct ObjNet *) sDynListCurObj)->mat128); + gd_copy_mat4f(src, &((struct ObjNet*)sDynListCurObj)->mat128); break; case OBJ_TYPE_JOINTS: - gd_copy_mat4f(src, &((struct ObjJoint *) sDynListCurObj)->matE8); + gd_copy_mat4f(src, &((struct ObjJoint*)sDynListCurObj)->matE8); break; case OBJ_TYPE_CAMERAS: - gd_copy_mat4f(src, &((struct ObjCamera *) sDynListCurObj)->unk64); + gd_copy_mat4f(src, &((struct ObjCamera*)sDynListCurObj)->unk64); break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMatrix()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetMatrix()", sDynListCurInfo->name, + sDynListCurObj->type); } } @@ -2969,37 +2962,37 @@ void d_set_matrix(Mat4f *src) { * Set the rotation matrix of the current dynamic object by copying * the input matrix `src`. */ -void d_set_rot_mtx(Mat4f *src) { +void d_set_rot_mtx(Mat4f* src) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - gd_copy_mat4f(src, &((struct ObjJoint *) sDynListCurObj)->mat128); + gd_copy_mat4f(src, &((struct ObjJoint*)sDynListCurObj)->mat128); break; case OBJ_TYPE_NETS: - gd_copy_mat4f(src, &((struct ObjNet *) sDynListCurObj)->mat168); + gd_copy_mat4f(src, &((struct ObjNet*)sDynListCurObj)->mat168); break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRMatrix()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetRMatrix()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Get a pointer to the current dynamic object's rotation matrix. */ -Mat4f *d_get_rot_mtx_ptr(void) { +Mat4f* d_get_rot_mtx_ptr(void) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - return &((struct ObjJoint *) sDynListCurObj)->mat128; + return &((struct ObjJoint*)sDynListCurObj)->mat128; case OBJ_TYPE_NETS: - return &((struct ObjNet *) sDynListCurObj)->mat168; + return &((struct ObjNet*)sDynListCurObj)->mat168; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetRMatrixPtr()", sDynListCurInfo->name, sDynListCurObj->type); @@ -3011,8 +3004,8 @@ Mat4f *d_get_rot_mtx_ptr(void) { * Copy `src` into the matrix of the current dynamic object. * TODO: What is an IMatrix? */ -void d_set_i_matrix(Mat4f *src) { - struct GdObj *dynobj; +void d_set_i_matrix(Mat4f* src) { + struct GdObj* dynobj; if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -3021,42 +3014,42 @@ void d_set_i_matrix(Mat4f *src) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - gd_copy_mat4f(src, &((struct ObjNet *) dynobj)->matE8); + gd_copy_mat4f(src, &((struct ObjNet*)dynobj)->matE8); break; case OBJ_TYPE_JOINTS: - gd_copy_mat4f(src, &((struct ObjJoint *) dynobj)->mat168); + gd_copy_mat4f(src, &((struct ObjJoint*)dynobj)->mat168); break; case OBJ_TYPE_LIGHTS: - ((struct ObjLight *) dynobj)->position.x = (*src)[3][0]; - ((struct ObjLight *) dynobj)->position.y = (*src)[3][1]; - ((struct ObjLight *) dynobj)->position.z = (*src)[3][2]; + ((struct ObjLight*)dynobj)->position.x = (*src)[3][0]; + ((struct ObjLight*)dynobj)->position.y = (*src)[3][1]; + ((struct ObjLight*)dynobj)->position.z = (*src)[3][2]; break; default: - fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetIMatrix()", - sDynListCurInfo->name, sDynListCurObj->type); + fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetIMatrix()", sDynListCurInfo->name, + sDynListCurObj->type); } } /** * Get a pointer to the current dynamic object's matrix. */ -Mat4f *d_get_matrix_ptr(void) { +Mat4f* d_get_matrix_ptr(void) { if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); } switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - return &((struct ObjNet *) sDynListCurObj)->mat128; + return &((struct ObjNet*)sDynListCurObj)->mat128; break; case OBJ_TYPE_CAMERAS: - return &((struct ObjCamera *) sDynListCurObj)->unk64; + return &((struct ObjCamera*)sDynListCurObj)->unk64; break; case OBJ_TYPE_BONES: - return &((struct ObjBone *) sDynListCurObj)->mat70; + return &((struct ObjBone*)sDynListCurObj)->mat70; break; case OBJ_TYPE_JOINTS: - return &((struct ObjJoint *) sDynListCurObj)->matE8; + return &((struct ObjJoint*)sDynListCurObj)->matE8; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetMatrixPtr()", @@ -3069,8 +3062,8 @@ Mat4f *d_get_matrix_ptr(void) { * Get a pointer to the current dynamic object's matrix. * TODO: What is an IMatrix? */ -Mat4f *d_get_i_mtx_ptr(void) { - struct GdObj *dynobj; // sp24 +Mat4f* d_get_i_mtx_ptr(void) { + struct GdObj* dynobj; // sp24 if (sDynListCurObj == NULL) { fatal_printf("proc_dynlist(): No current object"); @@ -3079,10 +3072,10 @@ Mat4f *d_get_i_mtx_ptr(void) { dynobj = sDynListCurObj; switch (sDynListCurObj->type) { case OBJ_TYPE_NETS: - return &((struct ObjNet *) dynobj)->matE8; + return &((struct ObjNet*)dynobj)->matE8; break; case OBJ_TYPE_JOINTS: - return &((struct ObjJoint *) dynobj)->mat168; + return &((struct ObjJoint*)dynobj)->mat168; break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dGetIMatrixPtr()", @@ -3095,7 +3088,7 @@ Mat4f *d_get_i_mtx_ptr(void) { * Use the dynamic object system to calculate the distance between * two `GdObj`s. The objects don't have to be dynamic objects. */ -f32 d_calc_world_dist_btwn(struct GdObj *obj1, struct GdObj *obj2) { +f32 d_calc_world_dist_btwn(struct GdObj* obj1, struct GdObj* obj2) { struct GdVec3f obj1pos; // sp34 struct GdVec3f obj2pos; // sp28 struct GdVec3f posdiff; // sp1C @@ -3123,8 +3116,7 @@ void d_set_skin_weight(s32 vtxId, f32 percentWeight) { switch (sDynListCurObj->type) { case OBJ_TYPE_JOINTS: - set_skin_weight((struct ObjJoint *) sDynListCurObj, vtxId, NULL, - percentWeight / 100.0); + set_skin_weight((struct ObjJoint*)sDynListCurObj, vtxId, NULL, percentWeight / 100.0); break; default: fatal_printf("%s: Object '%s'(%x) does not support this function.", "dSetSkinWeight()", diff --git a/src/goddard/dynlists/anim_group_1.c b/src/goddard/dynlists/anim_group_1.c index 2c3c8007..fe6f5cfc 100644 --- a/src/goddard/dynlists/anim_group_1.c +++ b/src/goddard/dynlists/anim_group_1.c @@ -5,143 +5,124 @@ #include "../gd_types.h" static s16 animdata_mario_eyebrows_equalizer_1[][3] = { - { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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, -1 }, - { 0, 0, -1 }, { 0, 0, -2 }, { 0, 0, -2 }, { 0, 0, -3 }, { 0, 0, -3 }, { 0, 0, -4 }, - { 0, 0, -4 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -6 }, { 0, 0, -6 }, - { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -8 }, { 0, 0, -8 }, { 0, 0, -9 }, { 0, 0, -9 }, - { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -11 }, { 0, 0, -11 }, { 0, 0, -12 }, - { 0, 0, -12 }, { 0, 0, -13 }, { 0, 0, -13 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -14 }, - { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -16 }, { 0, 0, -16 }, { 0, 0, -17 }, { 0, 0, -17 }, - { 0, 0, -17 }, { 0, 0, -18 }, { 0, 0, -18 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -20 }, - { 0, 0, -20 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -22 }, { 0, 0, -22 }, - { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -25 }, - { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -26 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -27 }, - { 0, 0, -28 }, { 0, 0, -28 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -30 }, { 0, 0, -30 }, - { 0, 0, -30 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -33 }, - { 0, 0, -33 }, { 0, 0, -33 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -35 }, { 0, 0, -35 }, - { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -38 }, - { 0, 0, -38 }, { 0, 0, -39 }, { 0, 0, -39 }, { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -40 }, - { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -42 }, { 0, 0, -42 }, { 0, 0, -43 }, { 0, 0, -43 }, - { 0, 0, -44 }, { 0, 0, -44 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -46 }, - { 0, 0, -46 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -48 }, { 0, 0, -48 }, { 0, 0, -49 }, - { 0, 0, -49 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -51 }, { 0, 0, -51 }, - { 0, 0, -52 }, { 0, 0, -52 }, { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -54 }, { 0, 0, -54 }, - { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -56 }, { 0, 0, -56 }, { 0, 0, -57 }, { 0, 0, -57 }, - { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -60 }, - { 0, 0, -60 }, { 0, 0, -61 }, { 0, 0, -61 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -63 }, - { 0, 0, -63 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -65 }, { 0, 0, -65 }, { 0, 0, -66 }, - { 0, 0, -66 }, { 0, 0, -67 }, { 0, 0, -67 }, { 0, 0, -68 }, { 0, 0, -68 }, { 0, 0, -69 }, - { 0, 0, -69 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, - { 0, 0, -73 }, { 0, 0, -73 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, - { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -79 }, - { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, - { 0, 0, -82 }, { 0, 0, -83 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -85 }, { 0, 0, -85 }, - { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -87 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -89 }, - { 0, 0, -89 }, { 0, 0, -90 }, { 0, 0, -91 }, { 0, 0, -91 }, { 0, 0, -92 }, { 0, 0, -92 }, - { 0, 0, -93 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -95 }, { 0, 0, -96 }, { 0, 0, -96 }, - { 0, 0, -97 }, { 0, 0, -97 }, { 0, 0, -98 }, { 0, 0, -99 }, { 0, 0, -99 }, { 0, 0, -100 }, - { 0, 0, -101 }, { 0, 0, -101 }, { 0, 0, -102 }, { 0, 0, -103 }, { 0, 0, -103 }, { 0, 0, -104 }, - { 0, 0, -105 }, { 0, 0, -105 }, { 0, 0, -106 }, { 0, 0, -107 }, { 0, 0, -107 }, { 0, 0, -108 }, - { 0, 0, -110 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -138 }, - { 0, 0, -145 }, { 0, 0, -150 }, { 0, 0, -154 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -156 }, - { 0, 0, -155 }, { 0, 0, -154 }, { 0, 0, -154 }, { 0, 0, -153 }, { 0, 0, -152 }, { 0, 0, -152 }, - { 0, 0, -151 }, { 0, 0, -150 }, { 0, 0, -150 }, { 0, 0, -149 }, { 0, 0, -148 }, { 0, 0, -148 }, - { 0, 0, -147 }, { 0, 0, -147 }, { 0, 0, -146 }, { 0, 0, -145 }, { 0, 0, -145 }, { 0, 0, -144 }, - { 0, 0, -143 }, { 0, 0, -143 }, { 0, 0, -142 }, { 0, 0, -141 }, { 0, 0, -141 }, { 0, 0, -140 }, - { 0, 0, -139 }, { 0, 0, -139 }, { 0, 0, -138 }, { 0, 0, -137 }, { 0, 0, -137 }, { 0, 0, -136 }, - { 0, 0, -135 }, { 0, 0, -135 }, { 0, 0, -134 }, { 0, 0, -134 }, { 0, 0, -133 }, { 0, 0, -132 }, - { 0, 0, -132 }, { 0, 0, -131 }, { 0, 0, -130 }, { 0, 0, -130 }, { 0, 0, -129 }, { 0, 0, -128 }, - { 0, 0, -128 }, { 0, 0, -127 }, { 0, 0, -126 }, { 0, 0, -126 }, { 0, 0, -125 }, { 0, 0, -124 }, - { 0, 0, -124 }, { 0, 0, -123 }, { 0, 0, -122 }, { 0, 0, -122 }, { 0, 0, -121 }, { 0, 0, -120 }, - { 0, 0, -120 }, { 0, 0, -119 }, { 0, 0, -118 }, { 0, 0, -118 }, { 0, 0, -117 }, { 0, 0, -116 }, - { 0, 0, -116 }, { 0, 0, -115 }, { 0, 0, -114 }, { 0, 0, -114 }, { 0, 0, -113 }, { 0, 0, -112 }, - { 0, 0, -112 }, { 0, 0, -111 }, { 0, 0, -110 }, { 0, 0, -110 }, { 0, 0, -109 }, { 0, 0, -108 }, - { 0, 0, -108 }, { 0, 0, -107 }, { 0, 0, -106 }, { 0, 0, -106 }, { 0, 0, -105 }, { 0, 0, -104 }, - { 0, 0, -104 }, { 0, 0, -103 }, { 0, 0, -102 }, { 0, 0, -102 }, { 0, 0, -101 }, { 0, 0, -100 }, - { 0, 0, -100 }, { 0, 0, -99 }, { 0, 0, -98 }, { 0, 0, -98 }, { 0, 0, -97 }, { 0, 0, -96 }, - { 0, 0, -96 }, { 0, 0, -95 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -93 }, { 0, 0, -92 }, - { 0, 0, -92 }, { 0, 0, -91 }, { 0, 0, -90 }, { 0, 0, -90 }, { 0, 0, -89 }, { 0, 0, -88 }, - { 0, 0, -88 }, { 0, 0, -87 }, { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -85 }, { 0, 0, -84 }, - { 0, 0, -84 }, { 0, 0, -83 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, - { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -77 }, { 0, 0, -76 }, - { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, - { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, { 0, 0, -68 }, - { 0, 0, -68 }, { 0, 0, -67 }, { 0, 0, -66 }, { 0, 0, -66 }, { 0, 0, -65 }, { 0, 0, -64 }, - { 0, 0, -64 }, { 0, 0, -63 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -61 }, { 0, 0, -60 }, - { 0, 0, -60 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -57 }, - { 0, 0, -56 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -54 }, { 0, 0, -53 }, { 0, 0, -53 }, - { 0, 0, -52 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -50 }, { 0, 0, -49 }, { 0, 0, -49 }, - { 0, 0, -48 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -46 }, { 0, 0, -45 }, { 0, 0, -45 }, - { 0, 0, -44 }, { 0, 0, -43 }, { 0, 0, -43 }, { 0, 0, -42 }, { 0, 0, -41 }, { 0, 0, -41 }, - { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -39 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -37 }, - { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -35 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -33 }, - { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -30 }, { 0, 0, -29 }, - { 0, 0, -29 }, { 0, 0, -28 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -26 }, { 0, 0, -25 }, - { 0, 0, -25 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, - { 0, 0, -21 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -18 }, - { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -16 }, { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -14 }, - { 0, 0, -14 }, { 0, 0, -13 }, { 0, 0, -12 }, { 0, 0, -12 }, { 0, 0, -11 }, { 0, 0, -10 }, - { 0, 0, -10 }, { 0, 0, -9 }, { 0, 0, -9 }, { 0, 0, -8 }, { 0, 0, -7 }, { 0, 0, -7 }, - { 0, 0, -6 }, { 0, 0, -6 }, { 0, 0, -5 }, { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -3 }, - { 0, 0, -3 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -1 }, { 0, 0, 0 }, { 0, 0, 0 }, - { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, - { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, - { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, -1 }, { 0, 0, -1 }, { 0, 0, -2 }, { 0, 0, -2 }, { 0, 0, -3 }, + { 0, 0, -3 }, { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -6 }, + { 0, 0, -6 }, { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -8 }, { 0, 0, -8 }, { 0, 0, -9 }, { 0, 0, -9 }, + { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -11 }, { 0, 0, -11 }, { 0, 0, -12 }, { 0, 0, -12 }, + { 0, 0, -13 }, { 0, 0, -13 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -15 }, { 0, 0, -15 }, + { 0, 0, -16 }, { 0, 0, -16 }, { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -18 }, { 0, 0, -18 }, + { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -21 }, + { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -24 }, + { 0, 0, -25 }, { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -26 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -27 }, + { 0, 0, -28 }, { 0, 0, -28 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -30 }, { 0, 0, -30 }, { 0, 0, -30 }, + { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -33 }, { 0, 0, -33 }, { 0, 0, -33 }, + { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -35 }, { 0, 0, -35 }, { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -37 }, + { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -39 }, { 0, 0, -39 }, { 0, 0, -40 }, + { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -42 }, { 0, 0, -42 }, { 0, 0, -43 }, + { 0, 0, -43 }, { 0, 0, -44 }, { 0, 0, -44 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -46 }, + { 0, 0, -46 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -48 }, { 0, 0, -48 }, { 0, 0, -49 }, { 0, 0, -49 }, + { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -52 }, { 0, 0, -52 }, + { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -54 }, { 0, 0, -54 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -56 }, + { 0, 0, -56 }, { 0, 0, -57 }, { 0, 0, -57 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -58 }, { 0, 0, -59 }, + { 0, 0, -59 }, { 0, 0, -60 }, { 0, 0, -60 }, { 0, 0, -61 }, { 0, 0, -61 }, { 0, 0, -62 }, { 0, 0, -62 }, + { 0, 0, -63 }, { 0, 0, -63 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -65 }, { 0, 0, -65 }, { 0, 0, -66 }, + { 0, 0, -66 }, { 0, 0, -67 }, { 0, 0, -67 }, { 0, 0, -68 }, { 0, 0, -68 }, { 0, 0, -69 }, { 0, 0, -69 }, + { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -73 }, { 0, 0, -73 }, + { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -77 }, + { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -79 }, { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, + { 0, 0, -81 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -83 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -85 }, + { 0, 0, -85 }, { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -87 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -89 }, + { 0, 0, -89 }, { 0, 0, -90 }, { 0, 0, -91 }, { 0, 0, -91 }, { 0, 0, -92 }, { 0, 0, -92 }, { 0, 0, -93 }, + { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -95 }, { 0, 0, -96 }, { 0, 0, -96 }, { 0, 0, -97 }, { 0, 0, -97 }, + { 0, 0, -98 }, { 0, 0, -99 }, { 0, 0, -99 }, { 0, 0, -100 }, { 0, 0, -101 }, { 0, 0, -101 }, { 0, 0, -102 }, + { 0, 0, -103 }, { 0, 0, -103 }, { 0, 0, -104 }, { 0, 0, -105 }, { 0, 0, -105 }, { 0, 0, -106 }, { 0, 0, -107 }, + { 0, 0, -107 }, { 0, 0, -108 }, { 0, 0, -110 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, + { 0, 0, -138 }, { 0, 0, -145 }, { 0, 0, -150 }, { 0, 0, -154 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -156 }, + { 0, 0, -155 }, { 0, 0, -154 }, { 0, 0, -154 }, { 0, 0, -153 }, { 0, 0, -152 }, { 0, 0, -152 }, { 0, 0, -151 }, + { 0, 0, -150 }, { 0, 0, -150 }, { 0, 0, -149 }, { 0, 0, -148 }, { 0, 0, -148 }, { 0, 0, -147 }, { 0, 0, -147 }, + { 0, 0, -146 }, { 0, 0, -145 }, { 0, 0, -145 }, { 0, 0, -144 }, { 0, 0, -143 }, { 0, 0, -143 }, { 0, 0, -142 }, + { 0, 0, -141 }, { 0, 0, -141 }, { 0, 0, -140 }, { 0, 0, -139 }, { 0, 0, -139 }, { 0, 0, -138 }, { 0, 0, -137 }, + { 0, 0, -137 }, { 0, 0, -136 }, { 0, 0, -135 }, { 0, 0, -135 }, { 0, 0, -134 }, { 0, 0, -134 }, { 0, 0, -133 }, + { 0, 0, -132 }, { 0, 0, -132 }, { 0, 0, -131 }, { 0, 0, -130 }, { 0, 0, -130 }, { 0, 0, -129 }, { 0, 0, -128 }, + { 0, 0, -128 }, { 0, 0, -127 }, { 0, 0, -126 }, { 0, 0, -126 }, { 0, 0, -125 }, { 0, 0, -124 }, { 0, 0, -124 }, + { 0, 0, -123 }, { 0, 0, -122 }, { 0, 0, -122 }, { 0, 0, -121 }, { 0, 0, -120 }, { 0, 0, -120 }, { 0, 0, -119 }, + { 0, 0, -118 }, { 0, 0, -118 }, { 0, 0, -117 }, { 0, 0, -116 }, { 0, 0, -116 }, { 0, 0, -115 }, { 0, 0, -114 }, + { 0, 0, -114 }, { 0, 0, -113 }, { 0, 0, -112 }, { 0, 0, -112 }, { 0, 0, -111 }, { 0, 0, -110 }, { 0, 0, -110 }, + { 0, 0, -109 }, { 0, 0, -108 }, { 0, 0, -108 }, { 0, 0, -107 }, { 0, 0, -106 }, { 0, 0, -106 }, { 0, 0, -105 }, + { 0, 0, -104 }, { 0, 0, -104 }, { 0, 0, -103 }, { 0, 0, -102 }, { 0, 0, -102 }, { 0, 0, -101 }, { 0, 0, -100 }, + { 0, 0, -100 }, { 0, 0, -99 }, { 0, 0, -98 }, { 0, 0, -98 }, { 0, 0, -97 }, { 0, 0, -96 }, { 0, 0, -96 }, + { 0, 0, -95 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -93 }, { 0, 0, -92 }, { 0, 0, -92 }, { 0, 0, -91 }, + { 0, 0, -90 }, { 0, 0, -90 }, { 0, 0, -89 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -87 }, { 0, 0, -86 }, + { 0, 0, -86 }, { 0, 0, -85 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -83 }, { 0, 0, -82 }, { 0, 0, -82 }, + { 0, 0, -81 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -77 }, + { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, + { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, { 0, 0, -68 }, { 0, 0, -68 }, + { 0, 0, -67 }, { 0, 0, -66 }, { 0, 0, -66 }, { 0, 0, -65 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -63 }, + { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -61 }, { 0, 0, -60 }, { 0, 0, -60 }, { 0, 0, -59 }, { 0, 0, -59 }, + { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -57 }, { 0, 0, -56 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -54 }, + { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -52 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -50 }, { 0, 0, -49 }, + { 0, 0, -49 }, { 0, 0, -48 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -46 }, { 0, 0, -45 }, { 0, 0, -45 }, + { 0, 0, -44 }, { 0, 0, -43 }, { 0, 0, -43 }, { 0, 0, -42 }, { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -40 }, + { 0, 0, -40 }, { 0, 0, -39 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -37 }, { 0, 0, -36 }, { 0, 0, -36 }, + { 0, 0, -35 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -33 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -31 }, + { 0, 0, -31 }, { 0, 0, -30 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -28 }, { 0, 0, -27 }, { 0, 0, -27 }, + { 0, 0, -26 }, { 0, 0, -25 }, { 0, 0, -25 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -23 }, { 0, 0, -22 }, + { 0, 0, -22 }, { 0, 0, -21 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -18 }, + { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -16 }, { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -14 }, { 0, 0, -14 }, + { 0, 0, -13 }, { 0, 0, -12 }, { 0, 0, -12 }, { 0, 0, -11 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -9 }, + { 0, 0, -9 }, { 0, 0, -8 }, { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -6 }, { 0, 0, -6 }, { 0, 0, -5 }, + { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -3 }, { 0, 0, -3 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -1 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 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, 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, 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 }, { 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, 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, 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 }, { 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 }, }; struct AnimDataInfo anim_mario_eyebrows_equalizer[] = { @@ -318,40 +299,34 @@ static s16 animdata_mario_eyebrows_2_1[][3] = { }; static s16 animdata_mario_eyebrows_2_2[][3] = { - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, - { 28, -5, 1943 }, { 28, -5, 1942 }, { 28, -5, 1941 }, { 29, -5, 1939 }, { 29, -5, 1937 }, - { 30, -5, 1934 }, { 30, -5, 1932 }, { 31, -5, 1929 }, { 31, -5, 1926 }, { 32, -5, 1922 }, - { 32, -5, 1919 }, { 32, -4, 1916 }, { 32, -4, 1913 }, { 32, -4, 1910 }, { 31, -4, 1907 }, - { 30, -4, 1905 }, { 29, -3, 1903 }, { 28, -3, 1901 }, { 26, -3, 1900 }, { 24, -2, 1898 }, - { 22, -2, 1897 }, { 19, -2, 1896 }, { 16, -1, 1894 }, { 13, -1, 1893 }, { 10, -1, 1892 }, - { 6, 0, 1891 }, { 3, 0, 1890 }, { 0, 0, 1889 }, { -3, 0, 1888 }, { -7, 1, 1887 }, - { -10, 1, 1886 }, { -14, 2, 1885 }, { -18, 2, 1884 }, { -21, 2, 1883 }, { -24, 3, 1883 }, - { -28, 3, 1882 }, { -31, 4, 1881 }, { -33, 4, 1880 }, { -36, 5, 1880 }, { -38, 5, 1879 }, - { -40, 6, 1878 }, { -42, 7, 1877 }, { -44, 7, 1877 }, { -45, 8, 1876 }, { -45, 8, 1875 }, - { -46, 9, 1874 }, { -45, 9, 1874 }, { -45, 10, 1873 }, { -45, 11, 1872 }, { -44, 11, 1872 }, - { -43, 12, 1871 }, { -42, 13, 1870 }, { -40, 13, 1870 }, { -39, 14, 1869 }, { -37, 15, 1868 }, - { -35, 16, 1868 }, { -33, 17, 1867 }, { -31, 18, 1867 }, { -29, 18, 1866 }, { -27, 19, 1866 }, - { -24, 20, 1865 }, { -22, 21, 1864 }, { -20, 22, 1864 }, { -17, 23, 1863 }, { -14, 24, 1863 }, - { -12, 24, 1862 }, { -9, 25, 1862 }, { -7, 26, 1861 }, { -4, 27, 1861 }, { -1, 27, 1860 }, - { 0, 28, 1860 }, { 3, 29, 1859 }, { 5, 29, 1859 }, { 8, 30, 1858 }, { 10, 31, 1857 }, - { 13, 31, 1857 }, { 15, 31, 1856 }, { 17, 32, 1856 }, { 19, 32, 1855 }, { 21, 32, 1855 }, - { 23, 33, 1854 }, { 24, 33, 1853 }, { 26, 33, 1853 }, { 27, 33, 1852 }, { 28, 33, 1851 }, - { 29, 33, 1851 }, { 30, 32, 1850 }, { 31, 32, 1849 }, { 31, 31, 1848 }, { 32, 31, 1847 }, - { 32, 30, 1846 }, { 33, 29, 1845 }, { 33, 28, 1844 }, { 33, 27, 1844 }, { 33, 26, 1842 }, - { 33, 25, 1841 }, { 33, 24, 1840 }, { 33, 22, 1839 }, { 33, 21, 1838 }, { 33, 20, 1837 }, - { 33, 18, 1836 }, { 33, 17, 1835 }, { 33, 16, 1834 }, { 32, 14, 1833 }, { 32, 13, 1832 }, - { 32, 12, 1831 }, { 31, 10, 1830 }, { 31, 9, 1830 }, { 31, 8, 1829 }, { 30, 7, 1828 }, - { 30, 6, 1827 }, { 30, 5, 1827 }, { 30, 4, 1826 }, { 29, 3, 1825 }, { 29, 2, 1825 }, - { 29, 1, 1824 }, { 29, 1, 1824 }, { 28, 0, 1824 }, { 28, 0, 1823 }, { 28, 0, 1823 }, - { 28, 0, 1823 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, + { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1943 }, { 28, -5, 1942 }, { 28, -5, 1941 }, + { 29, -5, 1939 }, { 29, -5, 1937 }, { 30, -5, 1934 }, { 30, -5, 1932 }, { 31, -5, 1929 }, { 31, -5, 1926 }, + { 32, -5, 1922 }, { 32, -5, 1919 }, { 32, -4, 1916 }, { 32, -4, 1913 }, { 32, -4, 1910 }, { 31, -4, 1907 }, + { 30, -4, 1905 }, { 29, -3, 1903 }, { 28, -3, 1901 }, { 26, -3, 1900 }, { 24, -2, 1898 }, { 22, -2, 1897 }, + { 19, -2, 1896 }, { 16, -1, 1894 }, { 13, -1, 1893 }, { 10, -1, 1892 }, { 6, 0, 1891 }, { 3, 0, 1890 }, + { 0, 0, 1889 }, { -3, 0, 1888 }, { -7, 1, 1887 }, { -10, 1, 1886 }, { -14, 2, 1885 }, { -18, 2, 1884 }, + { -21, 2, 1883 }, { -24, 3, 1883 }, { -28, 3, 1882 }, { -31, 4, 1881 }, { -33, 4, 1880 }, { -36, 5, 1880 }, + { -38, 5, 1879 }, { -40, 6, 1878 }, { -42, 7, 1877 }, { -44, 7, 1877 }, { -45, 8, 1876 }, { -45, 8, 1875 }, + { -46, 9, 1874 }, { -45, 9, 1874 }, { -45, 10, 1873 }, { -45, 11, 1872 }, { -44, 11, 1872 }, { -43, 12, 1871 }, + { -42, 13, 1870 }, { -40, 13, 1870 }, { -39, 14, 1869 }, { -37, 15, 1868 }, { -35, 16, 1868 }, { -33, 17, 1867 }, + { -31, 18, 1867 }, { -29, 18, 1866 }, { -27, 19, 1866 }, { -24, 20, 1865 }, { -22, 21, 1864 }, { -20, 22, 1864 }, + { -17, 23, 1863 }, { -14, 24, 1863 }, { -12, 24, 1862 }, { -9, 25, 1862 }, { -7, 26, 1861 }, { -4, 27, 1861 }, + { -1, 27, 1860 }, { 0, 28, 1860 }, { 3, 29, 1859 }, { 5, 29, 1859 }, { 8, 30, 1858 }, { 10, 31, 1857 }, + { 13, 31, 1857 }, { 15, 31, 1856 }, { 17, 32, 1856 }, { 19, 32, 1855 }, { 21, 32, 1855 }, { 23, 33, 1854 }, + { 24, 33, 1853 }, { 26, 33, 1853 }, { 27, 33, 1852 }, { 28, 33, 1851 }, { 29, 33, 1851 }, { 30, 32, 1850 }, + { 31, 32, 1849 }, { 31, 31, 1848 }, { 32, 31, 1847 }, { 32, 30, 1846 }, { 33, 29, 1845 }, { 33, 28, 1844 }, + { 33, 27, 1844 }, { 33, 26, 1842 }, { 33, 25, 1841 }, { 33, 24, 1840 }, { 33, 22, 1839 }, { 33, 21, 1838 }, + { 33, 20, 1837 }, { 33, 18, 1836 }, { 33, 17, 1835 }, { 33, 16, 1834 }, { 32, 14, 1833 }, { 32, 13, 1832 }, + { 32, 12, 1831 }, { 31, 10, 1830 }, { 31, 9, 1830 }, { 31, 8, 1829 }, { 30, 7, 1828 }, { 30, 6, 1827 }, + { 30, 5, 1827 }, { 30, 4, 1826 }, { 29, 3, 1825 }, { 29, 2, 1825 }, { 29, 1, 1824 }, { 29, 1, 1824 }, + { 28, 0, 1824 }, { 28, 0, 1823 }, { 28, 0, 1823 }, { 28, 0, 1823 }, }; struct AnimDataInfo anim_mario_eyebrows_2[] = { @@ -361,143 +336,124 @@ struct AnimDataInfo anim_mario_eyebrows_2[] = { }; static s16 anim_mario_eyebrows_3_1[][3] = { - { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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, -1 }, - { 0, 0, -1 }, { 0, 0, -2 }, { 0, 0, -2 }, { 0, 0, -3 }, { 0, 0, -3 }, { 0, 0, -4 }, - { 0, 0, -4 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -6 }, { 0, 0, -6 }, - { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -8 }, { 0, 0, -8 }, { 0, 0, -9 }, { 0, 0, -9 }, - { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -11 }, { 0, 0, -11 }, { 0, 0, -12 }, - { 0, 0, -12 }, { 0, 0, -13 }, { 0, 0, -13 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -14 }, - { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -16 }, { 0, 0, -16 }, { 0, 0, -17 }, { 0, 0, -17 }, - { 0, 0, -17 }, { 0, 0, -18 }, { 0, 0, -18 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -20 }, - { 0, 0, -20 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -22 }, { 0, 0, -22 }, - { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -25 }, - { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -26 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -27 }, - { 0, 0, -28 }, { 0, 0, -28 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -30 }, { 0, 0, -30 }, - { 0, 0, -30 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -33 }, - { 0, 0, -33 }, { 0, 0, -33 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -35 }, { 0, 0, -35 }, - { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -38 }, - { 0, 0, -38 }, { 0, 0, -39 }, { 0, 0, -39 }, { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -40 }, - { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -42 }, { 0, 0, -42 }, { 0, 0, -43 }, { 0, 0, -43 }, - { 0, 0, -44 }, { 0, 0, -44 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -46 }, - { 0, 0, -46 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -48 }, { 0, 0, -48 }, { 0, 0, -49 }, - { 0, 0, -49 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -51 }, { 0, 0, -51 }, - { 0, 0, -52 }, { 0, 0, -52 }, { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -54 }, { 0, 0, -54 }, - { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -56 }, { 0, 0, -56 }, { 0, 0, -57 }, { 0, 0, -57 }, - { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -60 }, - { 0, 0, -60 }, { 0, 0, -61 }, { 0, 0, -61 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -63 }, - { 0, 0, -63 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -65 }, { 0, 0, -65 }, { 0, 0, -66 }, - { 0, 0, -66 }, { 0, 0, -67 }, { 0, 0, -67 }, { 0, 0, -68 }, { 0, 0, -68 }, { 0, 0, -69 }, - { 0, 0, -69 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, - { 0, 0, -73 }, { 0, 0, -73 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, - { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -79 }, - { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, - { 0, 0, -82 }, { 0, 0, -83 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -85 }, { 0, 0, -85 }, - { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -87 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -89 }, - { 0, 0, -89 }, { 0, 0, -90 }, { 0, 0, -91 }, { 0, 0, -91 }, { 0, 0, -92 }, { 0, 0, -92 }, - { 0, 0, -93 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -95 }, { 0, 0, -96 }, { 0, 0, -96 }, - { 0, 0, -97 }, { 0, 0, -97 }, { 0, 0, -98 }, { 0, 0, -99 }, { 0, 0, -99 }, { 0, 0, -100 }, - { 0, 0, -101 }, { 0, 0, -101 }, { 0, 0, -102 }, { 0, 0, -103 }, { 0, 0, -103 }, { 0, 0, -104 }, - { 0, 0, -105 }, { 0, 0, -105 }, { 0, 0, -106 }, { 0, 0, -107 }, { 0, 0, -107 }, { 0, 0, -108 }, - { 0, 0, -110 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -138 }, - { 0, 0, -145 }, { 0, 0, -150 }, { 0, 0, -154 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -156 }, - { 0, 0, -155 }, { 0, 0, -154 }, { 0, 0, -154 }, { 0, 0, -153 }, { 0, 0, -152 }, { 0, 0, -152 }, - { 0, 0, -151 }, { 0, 0, -150 }, { 0, 0, -150 }, { 0, 0, -149 }, { 0, 0, -148 }, { 0, 0, -148 }, - { 0, 0, -147 }, { 0, 0, -147 }, { 0, 0, -146 }, { 0, 0, -145 }, { 0, 0, -145 }, { 0, 0, -144 }, - { 0, 0, -143 }, { 0, 0, -143 }, { 0, 0, -142 }, { 0, 0, -141 }, { 0, 0, -141 }, { 0, 0, -140 }, - { 0, 0, -139 }, { 0, 0, -139 }, { 0, 0, -138 }, { 0, 0, -137 }, { 0, 0, -137 }, { 0, 0, -136 }, - { 0, 0, -135 }, { 0, 0, -135 }, { 0, 0, -134 }, { 0, 0, -134 }, { 0, 0, -133 }, { 0, 0, -132 }, - { 0, 0, -132 }, { 0, 0, -131 }, { 0, 0, -130 }, { 0, 0, -130 }, { 0, 0, -129 }, { 0, 0, -128 }, - { 0, 0, -128 }, { 0, 0, -127 }, { 0, 0, -126 }, { 0, 0, -126 }, { 0, 0, -125 }, { 0, 0, -124 }, - { 0, 0, -124 }, { 0, 0, -123 }, { 0, 0, -122 }, { 0, 0, -122 }, { 0, 0, -121 }, { 0, 0, -120 }, - { 0, 0, -120 }, { 0, 0, -119 }, { 0, 0, -118 }, { 0, 0, -118 }, { 0, 0, -117 }, { 0, 0, -116 }, - { 0, 0, -116 }, { 0, 0, -115 }, { 0, 0, -114 }, { 0, 0, -114 }, { 0, 0, -113 }, { 0, 0, -112 }, - { 0, 0, -112 }, { 0, 0, -111 }, { 0, 0, -110 }, { 0, 0, -110 }, { 0, 0, -109 }, { 0, 0, -108 }, - { 0, 0, -108 }, { 0, 0, -107 }, { 0, 0, -106 }, { 0, 0, -106 }, { 0, 0, -105 }, { 0, 0, -104 }, - { 0, 0, -104 }, { 0, 0, -103 }, { 0, 0, -102 }, { 0, 0, -102 }, { 0, 0, -101 }, { 0, 0, -100 }, - { 0, 0, -100 }, { 0, 0, -99 }, { 0, 0, -98 }, { 0, 0, -98 }, { 0, 0, -97 }, { 0, 0, -96 }, - { 0, 0, -96 }, { 0, 0, -95 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -93 }, { 0, 0, -92 }, - { 0, 0, -92 }, { 0, 0, -91 }, { 0, 0, -90 }, { 0, 0, -90 }, { 0, 0, -89 }, { 0, 0, -88 }, - { 0, 0, -88 }, { 0, 0, -87 }, { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -85 }, { 0, 0, -84 }, - { 0, 0, -84 }, { 0, 0, -83 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, - { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -77 }, { 0, 0, -76 }, - { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, - { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, { 0, 0, -68 }, - { 0, 0, -68 }, { 0, 0, -67 }, { 0, 0, -66 }, { 0, 0, -66 }, { 0, 0, -65 }, { 0, 0, -64 }, - { 0, 0, -64 }, { 0, 0, -63 }, { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -61 }, { 0, 0, -60 }, - { 0, 0, -60 }, { 0, 0, -59 }, { 0, 0, -59 }, { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -57 }, - { 0, 0, -56 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -54 }, { 0, 0, -53 }, { 0, 0, -53 }, - { 0, 0, -52 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -50 }, { 0, 0, -49 }, { 0, 0, -49 }, - { 0, 0, -48 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -46 }, { 0, 0, -45 }, { 0, 0, -45 }, - { 0, 0, -44 }, { 0, 0, -43 }, { 0, 0, -43 }, { 0, 0, -42 }, { 0, 0, -41 }, { 0, 0, -41 }, - { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -39 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -37 }, - { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -35 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -33 }, - { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -30 }, { 0, 0, -29 }, - { 0, 0, -29 }, { 0, 0, -28 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -26 }, { 0, 0, -25 }, - { 0, 0, -25 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, - { 0, 0, -21 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -18 }, - { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -16 }, { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -14 }, - { 0, 0, -14 }, { 0, 0, -13 }, { 0, 0, -12 }, { 0, 0, -12 }, { 0, 0, -11 }, { 0, 0, -10 }, - { 0, 0, -10 }, { 0, 0, -9 }, { 0, 0, -9 }, { 0, 0, -8 }, { 0, 0, -7 }, { 0, 0, -7 }, - { 0, 0, -6 }, { 0, 0, -6 }, { 0, 0, -5 }, { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -3 }, - { 0, 0, -3 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -1 }, { 0, 0, 0 }, { 0, 0, 0 }, - { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, - { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, - { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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 }, { 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, 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, 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 }, { 0, 0, 0 }, { 0, 0, 0 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, -1 }, { 0, 0, -1 }, { 0, 0, -2 }, { 0, 0, -2 }, { 0, 0, -3 }, + { 0, 0, -3 }, { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -5 }, { 0, 0, -6 }, + { 0, 0, -6 }, { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -8 }, { 0, 0, -8 }, { 0, 0, -9 }, { 0, 0, -9 }, + { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -11 }, { 0, 0, -11 }, { 0, 0, -12 }, { 0, 0, -12 }, + { 0, 0, -13 }, { 0, 0, -13 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -14 }, { 0, 0, -15 }, { 0, 0, -15 }, + { 0, 0, -16 }, { 0, 0, -16 }, { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -18 }, { 0, 0, -18 }, + { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -21 }, { 0, 0, -21 }, { 0, 0, -21 }, + { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -24 }, + { 0, 0, -25 }, { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -26 }, { 0, 0, -27 }, { 0, 0, -27 }, { 0, 0, -27 }, + { 0, 0, -28 }, { 0, 0, -28 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -30 }, { 0, 0, -30 }, { 0, 0, -30 }, + { 0, 0, -31 }, { 0, 0, -31 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -33 }, { 0, 0, -33 }, { 0, 0, -33 }, + { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -35 }, { 0, 0, -35 }, { 0, 0, -36 }, { 0, 0, -36 }, { 0, 0, -37 }, + { 0, 0, -37 }, { 0, 0, -37 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -39 }, { 0, 0, -39 }, { 0, 0, -40 }, + { 0, 0, -40 }, { 0, 0, -40 }, { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -42 }, { 0, 0, -42 }, { 0, 0, -43 }, + { 0, 0, -43 }, { 0, 0, -44 }, { 0, 0, -44 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -45 }, { 0, 0, -46 }, + { 0, 0, -46 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -48 }, { 0, 0, -48 }, { 0, 0, -49 }, { 0, 0, -49 }, + { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -50 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -52 }, { 0, 0, -52 }, + { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -54 }, { 0, 0, -54 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -56 }, + { 0, 0, -56 }, { 0, 0, -57 }, { 0, 0, -57 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -58 }, { 0, 0, -59 }, + { 0, 0, -59 }, { 0, 0, -60 }, { 0, 0, -60 }, { 0, 0, -61 }, { 0, 0, -61 }, { 0, 0, -62 }, { 0, 0, -62 }, + { 0, 0, -63 }, { 0, 0, -63 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -65 }, { 0, 0, -65 }, { 0, 0, -66 }, + { 0, 0, -66 }, { 0, 0, -67 }, { 0, 0, -67 }, { 0, 0, -68 }, { 0, 0, -68 }, { 0, 0, -69 }, { 0, 0, -69 }, + { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -73 }, { 0, 0, -73 }, + { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -77 }, + { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -79 }, { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, + { 0, 0, -81 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -83 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -85 }, + { 0, 0, -85 }, { 0, 0, -86 }, { 0, 0, -86 }, { 0, 0, -87 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -89 }, + { 0, 0, -89 }, { 0, 0, -90 }, { 0, 0, -91 }, { 0, 0, -91 }, { 0, 0, -92 }, { 0, 0, -92 }, { 0, 0, -93 }, + { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -95 }, { 0, 0, -96 }, { 0, 0, -96 }, { 0, 0, -97 }, { 0, 0, -97 }, + { 0, 0, -98 }, { 0, 0, -99 }, { 0, 0, -99 }, { 0, 0, -100 }, { 0, 0, -101 }, { 0, 0, -101 }, { 0, 0, -102 }, + { 0, 0, -103 }, { 0, 0, -103 }, { 0, 0, -104 }, { 0, 0, -105 }, { 0, 0, -105 }, { 0, 0, -106 }, { 0, 0, -107 }, + { 0, 0, -107 }, { 0, 0, -108 }, { 0, 0, -110 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, + { 0, 0, -138 }, { 0, 0, -145 }, { 0, 0, -150 }, { 0, 0, -154 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -156 }, + { 0, 0, -155 }, { 0, 0, -154 }, { 0, 0, -154 }, { 0, 0, -153 }, { 0, 0, -152 }, { 0, 0, -152 }, { 0, 0, -151 }, + { 0, 0, -150 }, { 0, 0, -150 }, { 0, 0, -149 }, { 0, 0, -148 }, { 0, 0, -148 }, { 0, 0, -147 }, { 0, 0, -147 }, + { 0, 0, -146 }, { 0, 0, -145 }, { 0, 0, -145 }, { 0, 0, -144 }, { 0, 0, -143 }, { 0, 0, -143 }, { 0, 0, -142 }, + { 0, 0, -141 }, { 0, 0, -141 }, { 0, 0, -140 }, { 0, 0, -139 }, { 0, 0, -139 }, { 0, 0, -138 }, { 0, 0, -137 }, + { 0, 0, -137 }, { 0, 0, -136 }, { 0, 0, -135 }, { 0, 0, -135 }, { 0, 0, -134 }, { 0, 0, -134 }, { 0, 0, -133 }, + { 0, 0, -132 }, { 0, 0, -132 }, { 0, 0, -131 }, { 0, 0, -130 }, { 0, 0, -130 }, { 0, 0, -129 }, { 0, 0, -128 }, + { 0, 0, -128 }, { 0, 0, -127 }, { 0, 0, -126 }, { 0, 0, -126 }, { 0, 0, -125 }, { 0, 0, -124 }, { 0, 0, -124 }, + { 0, 0, -123 }, { 0, 0, -122 }, { 0, 0, -122 }, { 0, 0, -121 }, { 0, 0, -120 }, { 0, 0, -120 }, { 0, 0, -119 }, + { 0, 0, -118 }, { 0, 0, -118 }, { 0, 0, -117 }, { 0, 0, -116 }, { 0, 0, -116 }, { 0, 0, -115 }, { 0, 0, -114 }, + { 0, 0, -114 }, { 0, 0, -113 }, { 0, 0, -112 }, { 0, 0, -112 }, { 0, 0, -111 }, { 0, 0, -110 }, { 0, 0, -110 }, + { 0, 0, -109 }, { 0, 0, -108 }, { 0, 0, -108 }, { 0, 0, -107 }, { 0, 0, -106 }, { 0, 0, -106 }, { 0, 0, -105 }, + { 0, 0, -104 }, { 0, 0, -104 }, { 0, 0, -103 }, { 0, 0, -102 }, { 0, 0, -102 }, { 0, 0, -101 }, { 0, 0, -100 }, + { 0, 0, -100 }, { 0, 0, -99 }, { 0, 0, -98 }, { 0, 0, -98 }, { 0, 0, -97 }, { 0, 0, -96 }, { 0, 0, -96 }, + { 0, 0, -95 }, { 0, 0, -94 }, { 0, 0, -94 }, { 0, 0, -93 }, { 0, 0, -92 }, { 0, 0, -92 }, { 0, 0, -91 }, + { 0, 0, -90 }, { 0, 0, -90 }, { 0, 0, -89 }, { 0, 0, -88 }, { 0, 0, -88 }, { 0, 0, -87 }, { 0, 0, -86 }, + { 0, 0, -86 }, { 0, 0, -85 }, { 0, 0, -84 }, { 0, 0, -84 }, { 0, 0, -83 }, { 0, 0, -82 }, { 0, 0, -82 }, + { 0, 0, -81 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -77 }, + { 0, 0, -76 }, { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, + { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, { 0, 0, -68 }, { 0, 0, -68 }, + { 0, 0, -67 }, { 0, 0, -66 }, { 0, 0, -66 }, { 0, 0, -65 }, { 0, 0, -64 }, { 0, 0, -64 }, { 0, 0, -63 }, + { 0, 0, -62 }, { 0, 0, -62 }, { 0, 0, -61 }, { 0, 0, -60 }, { 0, 0, -60 }, { 0, 0, -59 }, { 0, 0, -59 }, + { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -57 }, { 0, 0, -56 }, { 0, 0, -55 }, { 0, 0, -55 }, { 0, 0, -54 }, + { 0, 0, -53 }, { 0, 0, -53 }, { 0, 0, -52 }, { 0, 0, -51 }, { 0, 0, -51 }, { 0, 0, -50 }, { 0, 0, -49 }, + { 0, 0, -49 }, { 0, 0, -48 }, { 0, 0, -47 }, { 0, 0, -47 }, { 0, 0, -46 }, { 0, 0, -45 }, { 0, 0, -45 }, + { 0, 0, -44 }, { 0, 0, -43 }, { 0, 0, -43 }, { 0, 0, -42 }, { 0, 0, -41 }, { 0, 0, -41 }, { 0, 0, -40 }, + { 0, 0, -40 }, { 0, 0, -39 }, { 0, 0, -38 }, { 0, 0, -38 }, { 0, 0, -37 }, { 0, 0, -36 }, { 0, 0, -36 }, + { 0, 0, -35 }, { 0, 0, -34 }, { 0, 0, -34 }, { 0, 0, -33 }, { 0, 0, -32 }, { 0, 0, -32 }, { 0, 0, -31 }, + { 0, 0, -31 }, { 0, 0, -30 }, { 0, 0, -29 }, { 0, 0, -29 }, { 0, 0, -28 }, { 0, 0, -27 }, { 0, 0, -27 }, + { 0, 0, -26 }, { 0, 0, -25 }, { 0, 0, -25 }, { 0, 0, -24 }, { 0, 0, -24 }, { 0, 0, -23 }, { 0, 0, -22 }, + { 0, 0, -22 }, { 0, 0, -21 }, { 0, 0, -20 }, { 0, 0, -20 }, { 0, 0, -19 }, { 0, 0, -19 }, { 0, 0, -18 }, + { 0, 0, -17 }, { 0, 0, -17 }, { 0, 0, -16 }, { 0, 0, -15 }, { 0, 0, -15 }, { 0, 0, -14 }, { 0, 0, -14 }, + { 0, 0, -13 }, { 0, 0, -12 }, { 0, 0, -12 }, { 0, 0, -11 }, { 0, 0, -10 }, { 0, 0, -10 }, { 0, 0, -9 }, + { 0, 0, -9 }, { 0, 0, -8 }, { 0, 0, -7 }, { 0, 0, -7 }, { 0, 0, -6 }, { 0, 0, -6 }, { 0, 0, -5 }, + { 0, 0, -4 }, { 0, 0, -4 }, { 0, 0, -3 }, { 0, 0, -3 }, { 0, 0, -2 }, { 0, 0, -1 }, { 0, 0, -1 }, + { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 0 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, { 0, 0, 1 }, + { 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, 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, 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 }, { 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, 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, 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 }, { 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 }, }; struct AnimDataInfo anim_mario_eyebrows_3[] = { @@ -674,40 +630,34 @@ static s16 animdata_mario_eyebrows_4_1[][3] = { }; static s16 animdata_mario_eyebrows_4_2[][3] = { - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, - { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1755 }, { -34, 0, -1755 }, { -34, 0, -1756 }, - { -34, 0, -1756 }, { -34, 0, -1757 }, { -34, 0, -1757 }, { -34, 0, -1758 }, { -34, 0, -1759 }, - { -34, 0, -1759 }, { -34, 0, -1760 }, { -34, 0, -1760 }, { -34, 0, -1761 }, { -34, 0, -1761 }, - { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, - { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, - { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, - { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, - { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, - { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, - { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, - { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, - { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, - { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, - { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, - { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, - { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, - { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, - { -34, 0, -1762 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1764 }, - { -34, 0, -1764 }, { -34, 0, -1764 }, { -34, 0, -1765 }, { -34, 0, -1765 }, { -34, 0, -1766 }, - { -34, 0, -1766 }, { -34, 0, -1767 }, { -34, 0, -1767 }, { -34, 0, -1768 }, { -34, 0, -1769 }, - { -34, 0, -1769 }, { -34, 0, -1770 }, { -34, 0, -1770 }, { -34, 0, -1771 }, { -34, 0, -1771 }, - { -34, 0, -1772 }, { -34, 0, -1773 }, { -34, 0, -1773 }, { -34, 0, -1774 }, { -34, 0, -1774 }, - { -34, 0, -1775 }, { -34, 0, -1775 }, { -34, 0, -1775 }, { -34, 0, -1776 }, { -34, 0, -1776 }, - { -34, 0, -1776 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, - { -34, 0, -1777 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, + { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1754 }, { -34, 0, -1755 }, + { -34, 0, -1755 }, { -34, 0, -1756 }, { -34, 0, -1756 }, { -34, 0, -1757 }, { -34, 0, -1757 }, { -34, 0, -1758 }, + { -34, 0, -1759 }, { -34, 0, -1759 }, { -34, 0, -1760 }, { -34, 0, -1760 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1761 }, + { -34, 0, -1761 }, { -34, 0, -1761 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, + { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1762 }, { -34, 0, -1763 }, + { -34, 0, -1763 }, { -34, 0, -1763 }, { -34, 0, -1764 }, { -34, 0, -1764 }, { -34, 0, -1764 }, { -34, 0, -1765 }, + { -34, 0, -1765 }, { -34, 0, -1766 }, { -34, 0, -1766 }, { -34, 0, -1767 }, { -34, 0, -1767 }, { -34, 0, -1768 }, + { -34, 0, -1769 }, { -34, 0, -1769 }, { -34, 0, -1770 }, { -34, 0, -1770 }, { -34, 0, -1771 }, { -34, 0, -1771 }, + { -34, 0, -1772 }, { -34, 0, -1773 }, { -34, 0, -1773 }, { -34, 0, -1774 }, { -34, 0, -1774 }, { -34, 0, -1775 }, + { -34, 0, -1775 }, { -34, 0, -1775 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1776 }, { -34, 0, -1777 }, + { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, { -34, 0, -1777 }, }; struct AnimDataInfo anim_mario_eyebrows_4[] = { @@ -890,211 +840,170 @@ struct AnimDataInfo anim_mario_eyebrows_5[] = { }; static s16 animdata_mario_eye_left_1[][3] = { - { -68, 2, -974 }, { -68, 1, -974 }, { -68, 0, -974 }, { -68, -2, -974 }, - { -68, -6, -973 }, { -68, -10, -973 }, { -68, -15, -972 }, { -68, -20, -972 }, - { -68, -26, -971 }, { -69, -32, -970 }, { -69, -38, -970 }, { -69, -44, -969 }, - { -69, -50, -968 }, { -69, -56, -968 }, { -69, -61, -967 }, { -69, -66, -966 }, - { -69, -70, -966 }, { -69, -74, -966 }, { -69, -76, -965 }, { -69, -78, -965 }, - { -69, -78, -965 }, { -69, -72, -966 }, { -69, -56, -968 }, { -69, -36, -970 }, - { -69, -16, -973 }, { -68, 0, -975 }, { -68, 7, -976 }, { -68, 9, -976 }, - { -68, 10, -976 }, { -68, 11, -976 }, { -68, 12, -976 }, { -68, 13, -976 }, - { -68, 14, -977 }, { -68, 15, -977 }, { -68, 15, -977 }, { -68, 16, -977 }, - { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, - { -68, 16, -977 }, { -68, 16, -976 }, { -68, 15, -976 }, { -68, 15, -976 }, - { -68, 15, -976 }, { -68, 14, -976 }, { -68, 14, -976 }, { -68, 13, -976 }, - { -68, 12, -976 }, { -68, 12, -976 }, { -68, 11, -976 }, { -68, 10, -975 }, - { -68, 10, -975 }, { -68, 9, -975 }, { -68, 8, -975 }, { -68, 7, -975 }, - { -68, 7, -975 }, { -68, 6, -975 }, { -68, 5, -975 }, { -68, 5, -975 }, - { -68, 4, -974 }, { -68, 4, -974 }, { -68, 3, -974 }, { -68, 3, -974 }, - { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, - { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 3, -975 }, - { -68, 4, -975 }, { -68, 5, -975 }, { -68, 6, -976 }, { -68, 7, -976 }, - { -68, 8, -976 }, { -68, 9, -977 }, { -68, 10, -977 }, { -68, 11, -977 }, - { -68, 12, -977 }, { -68, 12, -977 }, { -68, 12, -977 }, { -68, 12, -977 }, - { -68, 11, -977 }, { -68, 9, -977 }, { -68, 7, -976 }, { -68, 5, -975 }, - { -68, 2, -974 }, { -68, -8, -971 }, { -67, -29, -964 }, { -67, -54, -956 }, - { -66, -75, -950 }, { -66, -86, -946 }, { -66, -90, -945 }, { -66, -93, -944 }, - { -66, -96, -943 }, { -66, -98, -942 }, { -66, -100, -942 }, { -66, -102, -941 }, - { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, - { -66, -103, -941 }, { -66, -101, -942 }, { -66, -100, -942 }, { -66, -98, -943 }, - { -66, -96, -943 }, { -66, -93, -944 }, { -66, -90, -945 }, { -66, -86, -946 }, - { -66, -78, -949 }, { -67, -62, -954 }, { -67, -43, -960 }, { -68, -24, -966 }, - { -68, -7, -971 }, { -68, 2, -974 }, { -68, 6, -975 }, { -67, 10, -975 }, - { -66, 13, -974 }, { -64, 15, -972 }, { -63, 16, -970 }, { -62, 16, -968 }, - { -61, 15, -967 }, { -62, 13, -967 }, { -63, 10, -968 }, { -65, 6, -970 }, - { -68, 2, -974 }, { -78, -9, -986 }, { -95, -30, -1006 }, { -113, -54, -1029 }, - { -129, -73, -1048 }, { -136, -82, -1057 }, { -137, -84, -1058 }, { -138, -85, -1059 }, - { -138, -85, -1059 }, { -138, -86, -1058 }, { -138, -85, -1057 }, { -137, -85, -1055 }, - { -136, -84, -1054 }, { -134, -83, -1051 }, { -133, -81, -1049 }, { -131, -80, -1046 }, - { -129, -78, -1043 }, { -127, -75, -1040 }, { -125, -73, -1037 }, { -123, -70, -1034 }, - { -120, -67, -1032 }, { -118, -64, -1029 }, { -116, -61, -1027 }, { -113, -58, -1024 }, - { -111, -55, -1023 }, { -109, -51, -1021 }, { -107, -48, -1020 }, { -106, -44, -1020 }, - { -104, -40, -1020 }, { -102, -33, -1023 }, { -100, -26, -1027 }, { -98, -17, -1031 }, - { -96, -8, -1036 }, { -94, 0, -1041 }, { -91, 8, -1045 }, { -89, 16, -1049 }, - { -87, 23, -1052 }, { -85, 29, -1053 }, { -83, 32, -1051 }, { -81, 33, -1047 }, - { -79, 32, -1040 }, { -77, 28, -1031 }, { -75, 24, -1020 }, { -73, 18, -1008 }, - { -72, 13, -997 }, { -70, 8, -987 }, { -69, 4, -979 }, { -68, 2, -974 }, - { -68, 0, -971 }, { -67, 0, -969 }, { -67, 0, -968 }, { -67, 0, -967 }, - { -67, 0, -967 }, { -67, 0, -968 }, { -67, 0, -969 }, { -67, 0, -970 }, - { -68, 0, -971 }, { -68, 1, -972 }, { -68, 1, -973 }, { -68, 1, -974 }, - { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, - { -68, 2, -974 }, { -68, 1, -975 }, { -68, 1, -975 }, { -68, 1, -975 }, - { -68, 1, -975 }, { -68, 1, -976 }, { -68, 1, -976 }, { -68, 1, -976 }, - { -68, 1, -977 }, { -68, 1, -977 }, { -68, 1, -977 }, { -68, 1, -978 }, - { -68, 1, -978 }, { -68, 1, -978 }, { -68, 1, -979 }, { -68, 1, -979 }, - { -68, 1, -979 }, { -68, 1, -979 }, { -68, 1, -980 }, { -68, 1, -980 }, - { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, - { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -979 }, { -68, 1, -979 }, - { -68, 1, -979 }, { -68, 1, -978 }, { -68, 1, -978 }, { -68, 1, -977 }, - { -68, 1, -977 }, { -68, 1, -976 }, { -68, 1, -975 }, { -68, 2, -974 }, - { -68, 2, -970 }, { -68, 3, -963 }, { -68, 4, -953 }, { -68, 5, -943 }, - { -68, 6, -934 }, { -68, 7, -929 }, { -68, 7, -926 }, { -68, 6, -925 }, - { -68, 5, -924 }, { -68, 4, -925 }, { -68, 3, -925 }, { -68, 2, -926 }, - { -68, 3, -927 }, { -68, 4, -928 }, { -68, 7, -929 }, { -68, 12, -929 }, - { -68, 19, -929 }, { -68, 27, -929 }, { -68, 36, -930 }, { -68, 45, -930 }, - { -68, 54, -931 }, { -68, 62, -932 }, { -68, 69, -933 }, { -68, 74, -934 }, - { -69, 77, -935 }, { -69, 78, -938 }, { -69, 78, -941 }, { -69, 77, -943 }, - { -69, 75, -946 }, { -69, 72, -947 }, { -69, 68, -948 }, { -69, 64, -947 }, - { -69, 60, -946 }, { -69, 55, -946 }, { -69, 50, -944 }, { -69, 45, -943 }, - { -69, 40, -942 }, { -69, 35, -941 }, { -69, 30, -939 }, { -68, 24, -938 }, - { -68, 19, -936 }, { -68, 13, -935 }, { -68, 7, -933 }, { -68, 2, -931 }, - { -68, -3, -930 }, { -68, -9, -929 }, { -68, -14, -927 }, { -68, -20, -926 }, - { -68, -26, -925 }, { -68, -32, -924 }, { -68, -37, -923 }, { -68, -43, -923 }, - { -68, -50, -922 }, { -68, -57, -922 }, { -68, -64, -922 }, { -68, -72, -922 }, - { -68, -79, -922 }, { -68, -87, -922 }, { -68, -94, -922 }, { -68, -101, -922 }, - { -68, -108, -923 }, { -68, -114, -923 }, { -68, -119, -923 }, { -68, -124, -923 }, - { -68, -127, -924 }, { -68, -130, -924 }, { -68, -131, -923 }, { -69, -129, -921 }, - { -69, -126, -918 }, { -69, -122, -915 }, { -69, -117, -912 }, { -69, -111, -911 }, - { -69, -105, -910 }, { -69, -99, -912 }, { -69, -94, -916 }, { -69, -89, -923 }, - { -69, -86, -933 }, { -69, -82, -946 }, { -68, -78, -961 }, { -68, -74, -978 }, - { -68, -70, -996 }, { -68, -67, -1015 }, { -68, -63, -1034 }, { -67, -60, -1053 }, - { -67, -57, -1071 }, { -67, -54, -1087 }, { -67, -51, -1101 }, { -67, -49, -1112 }, - { -67, -48, -1121 }, { -67, -48, -1128 }, { -67, -50, -1132 }, { -67, -51, -1133 }, - { -67, -52, -1131 }, { -67, -52, -1124 }, { -67, -49, -1112 }, { -67, -41, -1090 }, - { -67, -28, -1055 }, { -68, -14, -1015 }, { -68, -1, -976 }, { -68, 7, -945 }, - { -68, 7, -929 }, { -68, 2, -923 }, { -67, -4, -919 }, { -67, -12, -917 }, - { -67, -21, -916 }, { -66, -30, -916 }, { -66, -40, -917 }, { -65, -51, -920 }, - { -65, -62, -923 }, { -65, -74, -926 }, { -64, -85, -930 }, { -64, -96, -934 }, - { -63, -108, -938 }, { -63, -118, -942 }, { -63, -128, -946 }, { -63, -138, -949 }, - { -62, -146, -952 }, { -62, -154, -954 }, { -62, -160, -954 }, { -63, -161, -953 }, - { -64, -153, -949 }, { -66, -141, -943 }, { -67, -130, -938 }, { -68, -124, -935 }, - { -68, -121, -933 }, { -69, -120, -931 }, { -69, -119, -929 }, { -69, -119, -927 }, - { -69, -119, -925 }, { -69, -119, -923 }, { -69, -119, -921 }, { -69, -119, -920 }, - { -69, -119, -919 }, { -69, -119, -917 }, { -69, -118, -916 }, { -69, -116, -916 }, - { -69, -114, -915 }, { -69, -110, -915 }, { -69, -106, -915 }, { -69, -99, -915 }, - { -69, -90, -917 }, { -68, -80, -919 }, { -68, -68, -922 }, { -67, -55, -924 }, - { -67, -41, -928 }, { -66, -28, -931 }, { -66, -16, -934 }, { -65, -5, -936 }, - { -65, 4, -939 }, { -64, 11, -940 }, { -64, 17, -940 }, { -64, 20, -938 }, - { -64, 21, -934 }, { -64, 21, -931 }, { -64, 20, -928 }, { -64, 17, -929 }, - { -64, 15, -932 }, { -64, 11, -940 }, { -64, 6, -958 }, { -64, -1, -986 }, - { -64, -11, -1018 }, { -63, -21, -1050 }, { -63, -29, -1077 }, { -63, -34, -1092 }, - { -63, -36, -1099 }, { -63, -37, -1103 }, { -63, -38, -1105 }, { -63, -38, -1105 }, - { -63, -37, -1103 }, { -63, -36, -1101 }, { -63, -35, -1098 }, { -63, -34, -1095 }, - { -63, -34, -1092 }, { -63, -33, -1091 }, { -63, -33, -1091 }, { -63, -34, -1092 }, - { -62, -43, -1121 }, { -62, -50, -1135 }, { -62, -43, -1092 }, { -62, -31, -1030 }, - { -62, -19, -971 }, { -62, -11, -938 }, { -62, -8, -926 }, { -63, -4, -917 }, - { -64, -1, -911 }, { -65, 1, -906 }, { -65, 4, -904 }, { -66, 7, -903 }, - { -67, 8, -905 }, { -68, 10, -907 }, { -68, 10, -911 }, { -68, 10, -916 }, - { -68, 9, -922 }, { -68, 7, -929 }, { -67, 4, -937 }, { -66, 0, -948 }, - { -64, -6, -962 }, { -63, -13, -977 }, { -61, -20, -993 }, { -59, -28, -1011 }, - { -57, -36, -1028 }, { -54, -44, -1045 }, { -52, -51, -1062 }, { -51, -58, -1077 }, - { -49, -65, -1091 }, { -48, -70, -1102 }, { -47, -74, -1110 }, { -46, -77, -1117 }, - { -45, -78, -1122 }, { -45, -80, -1127 }, { -44, -80, -1130 }, { -44, -81, -1132 }, - { -44, -80, -1133 }, { -44, -80, -1133 }, { -44, -79, -1132 }, { -44, -78, -1130 }, - { -45, -77, -1127 }, { -45, -76, -1122 }, { -46, -75, -1117 }, { -47, -74, -1110 }, - { -48, -73, -1101 }, { -49, -71, -1086 }, { -51, -70, -1069 }, { -54, -68, -1049 }, - { -56, -66, -1028 }, { -59, -63, -1007 }, { -61, -61, -987 }, { -63, -60, -969 }, - { -65, -58, -954 }, { -66, -57, -943 }, { -66, -57, -938 }, { -66, -57, -938 }, - { -66, -57, -941 }, { -65, -58, -946 }, { -64, -59, -954 }, { -63, -60, -964 }, - { -62, -61, -975 }, { -60, -63, -987 }, { -59, -64, -999 }, { -57, -66, -1011 }, - { -56, -67, -1023 }, { -55, -68, -1033 }, { -54, -69, -1042 }, { -53, -69, -1049 }, - { -53, -69, -1054 }, { -53, -68, -1055 }, { -56, -65, -1043 }, { -61, -58, -1015 }, - { -68, -50, -981 }, { -74, -44, -951 }, { -77, -40, -935 }, { -77, -39, -931 }, - { -78, -38, -927 }, { -79, -38, -923 }, { -79, -37, -920 }, { -80, -36, -917 }, - { -80, -36, -915 }, { -80, -35, -913 }, { -80, -35, -911 }, { -81, -35, -910 }, - { -81, -35, -908 }, { -81, -35, -907 }, { -81, -34, -907 }, { -81, -34, -906 }, - { -81, -34, -906 }, { -81, -35, -905 }, { -80, -35, -905 }, { -80, -35, -905 }, - { -80, -35, -905 }, { -80, -35, -906 }, { -80, -35, -906 }, { -80, -35, -906 }, - { -80, -35, -907 }, { -79, -35, -907 }, { -79, -36, -907 }, { -79, -36, -907 }, - { -79, -36, -907 }, { -79, -36, -907 }, { -79, -36, -908 }, { -79, -36, -911 }, - { -79, -37, -914 }, { -78, -37, -918 }, { -78, -38, -922 }, { -77, -39, -926 }, - { -77, -39, -930 }, { -77, -40, -933 }, { -77, -40, -935 }, { -77, -40, -936 }, - { -77, -40, -937 }, { -76, -40, -937 }, { -76, -40, -938 }, { -76, -40, -938 }, - { -76, -40, -938 }, { -77, -40, -937 }, { -77, -40, -937 }, { -77, -40, -937 }, - { -77, -40, -936 }, { -77, -40, -936 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, - { -77, -41, -935 }, { -77, -41, -934 }, { -77, -41, -934 }, { -77, -41, -934 }, - { -77, -41, -934 }, { -77, -42, -934 }, { -77, -42, -934 }, { -77, -42, -933 }, - { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, - { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, - { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -934 }, { -77, -41, -934 }, - { -77, -41, -934 }, { -77, -41, -935 }, { -77, -40, -935 }, { -77, -39, -936 }, - { -76, -39, -936 }, { -76, -38, -937 }, { -76, -37, -938 }, { -76, -37, -938 }, - { -76, -36, -939 }, { -76, -35, -940 }, { -76, -34, -941 }, { -75, -33, -941 }, - { -75, -32, -942 }, { -75, -31, -943 }, { -75, -30, -944 }, { -75, -29, -945 }, - { -74, -28, -946 }, { -74, -27, -947 }, { -74, -26, -948 }, { -74, -25, -949 }, - { -74, -24, -950 }, { -73, -23, -951 }, { -73, -22, -952 }, { -73, -21, -953 }, - { -73, -20, -954 }, { -72, -19, -955 }, { -72, -17, -956 }, { -72, -16, -957 }, - { -72, -15, -958 }, { -72, -14, -959 }, { -71, -13, -960 }, { -71, -12, -961 }, - { -71, -11, -962 }, { -71, -10, -963 }, { -70, -9, -964 }, { -70, -8, -965 }, - { -70, -7, -966 }, { -70, -6, -966 }, { -70, -5, -967 }, { -70, -4, -968 }, - { -69, -3, -969 }, { -69, -2, -970 }, { -69, -1, -971 }, { -69, 0, -971 }, - { -69, 0, -972 }, { -69, 0, -973 }, { -68, 1, -973 }, { -68, 2, -974 }, - { -68, 2, -975 }, { -68, 3, -975 }, { -68, 3, -976 }, { -68, 4, -977 }, - { -68, 4, -977 }, { -68, 5, -978 }, { -68, 5, -978 }, { -68, 6, -979 }, - { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, - { -68, 6, -979 }, { -68, 6, -979 }, { -68, 5, -979 }, { -68, 5, -978 }, - { -68, 4, -977 }, { -68, 3, -976 }, { -68, 3, -975 }, { -68, 2, -974 }, - { -68, 0, -972 }, { -68, -1, -969 }, { -68, -4, -965 }, { -68, -8, -961 }, - { -68, -12, -956 }, { -68, -16, -951 }, { -68, -20, -946 }, { -68, -23, -941 }, - { -68, -27, -937 }, { -68, -29, -933 }, { -68, -31, -931 }, { -68, -32, -930 }, - { -68, -33, -929 }, { -68, -33, -928 }, { -68, -34, -928 }, { -68, -34, -927 }, - { -68, -35, -927 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, - { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, - { -68, -36, -925 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, - { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, - { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, - { -68, -37, -924 }, { -68, -36, -924 }, { -68, -36, -925 }, { -68, -36, -925 }, - { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, - { -68, -36, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, - { -68, -35, -926 }, { -68, -35, -927 }, { -68, -35, -927 }, { -68, -34, -927 }, - { -68, -34, -927 }, { -68, -34, -927 }, { -68, -34, -928 }, { -68, -34, -928 }, - { -68, -34, -928 }, { -68, -33, -928 }, { -68, -33, -928 }, { -68, -33, -929 }, - { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, - { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, - { -68, -32, -929 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, - { -68, -33, -929 }, { -68, -32, -930 }, { -68, -29, -934 }, { -68, -25, -939 }, - { -68, -21, -945 }, { -68, -16, -951 }, { -68, -11, -956 }, { -68, -7, -962 }, - { -68, -3, -967 }, { -68, 0, -971 }, { -68, 1, -973 }, { -68, 2, -974 }, + { -68, 2, -974 }, { -68, 1, -974 }, { -68, 0, -974 }, { -68, -2, -974 }, { -68, -6, -973 }, + { -68, -10, -973 }, { -68, -15, -972 }, { -68, -20, -972 }, { -68, -26, -971 }, { -69, -32, -970 }, + { -69, -38, -970 }, { -69, -44, -969 }, { -69, -50, -968 }, { -69, -56, -968 }, { -69, -61, -967 }, + { -69, -66, -966 }, { -69, -70, -966 }, { -69, -74, -966 }, { -69, -76, -965 }, { -69, -78, -965 }, + { -69, -78, -965 }, { -69, -72, -966 }, { -69, -56, -968 }, { -69, -36, -970 }, { -69, -16, -973 }, + { -68, 0, -975 }, { -68, 7, -976 }, { -68, 9, -976 }, { -68, 10, -976 }, { -68, 11, -976 }, + { -68, 12, -976 }, { -68, 13, -976 }, { -68, 14, -977 }, { -68, 15, -977 }, { -68, 15, -977 }, + { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, { -68, 16, -977 }, + { -68, 16, -977 }, { -68, 16, -976 }, { -68, 15, -976 }, { -68, 15, -976 }, { -68, 15, -976 }, + { -68, 14, -976 }, { -68, 14, -976 }, { -68, 13, -976 }, { -68, 12, -976 }, { -68, 12, -976 }, + { -68, 11, -976 }, { -68, 10, -975 }, { -68, 10, -975 }, { -68, 9, -975 }, { -68, 8, -975 }, + { -68, 7, -975 }, { -68, 7, -975 }, { -68, 6, -975 }, { -68, 5, -975 }, { -68, 5, -975 }, + { -68, 4, -974 }, { -68, 4, -974 }, { -68, 3, -974 }, { -68, 3, -974 }, { -68, 2, -974 }, + { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, + { -68, 2, -974 }, { -68, 3, -975 }, { -68, 4, -975 }, { -68, 5, -975 }, { -68, 6, -976 }, + { -68, 7, -976 }, { -68, 8, -976 }, { -68, 9, -977 }, { -68, 10, -977 }, { -68, 11, -977 }, + { -68, 12, -977 }, { -68, 12, -977 }, { -68, 12, -977 }, { -68, 12, -977 }, { -68, 11, -977 }, + { -68, 9, -977 }, { -68, 7, -976 }, { -68, 5, -975 }, { -68, 2, -974 }, { -68, -8, -971 }, + { -67, -29, -964 }, { -67, -54, -956 }, { -66, -75, -950 }, { -66, -86, -946 }, { -66, -90, -945 }, + { -66, -93, -944 }, { -66, -96, -943 }, { -66, -98, -942 }, { -66, -100, -942 }, { -66, -102, -941 }, + { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, { -66, -103, -941 }, + { -66, -101, -942 }, { -66, -100, -942 }, { -66, -98, -943 }, { -66, -96, -943 }, { -66, -93, -944 }, + { -66, -90, -945 }, { -66, -86, -946 }, { -66, -78, -949 }, { -67, -62, -954 }, { -67, -43, -960 }, + { -68, -24, -966 }, { -68, -7, -971 }, { -68, 2, -974 }, { -68, 6, -975 }, { -67, 10, -975 }, + { -66, 13, -974 }, { -64, 15, -972 }, { -63, 16, -970 }, { -62, 16, -968 }, { -61, 15, -967 }, + { -62, 13, -967 }, { -63, 10, -968 }, { -65, 6, -970 }, { -68, 2, -974 }, { -78, -9, -986 }, + { -95, -30, -1006 }, { -113, -54, -1029 }, { -129, -73, -1048 }, { -136, -82, -1057 }, { -137, -84, -1058 }, + { -138, -85, -1059 }, { -138, -85, -1059 }, { -138, -86, -1058 }, { -138, -85, -1057 }, { -137, -85, -1055 }, + { -136, -84, -1054 }, { -134, -83, -1051 }, { -133, -81, -1049 }, { -131, -80, -1046 }, { -129, -78, -1043 }, + { -127, -75, -1040 }, { -125, -73, -1037 }, { -123, -70, -1034 }, { -120, -67, -1032 }, { -118, -64, -1029 }, + { -116, -61, -1027 }, { -113, -58, -1024 }, { -111, -55, -1023 }, { -109, -51, -1021 }, { -107, -48, -1020 }, + { -106, -44, -1020 }, { -104, -40, -1020 }, { -102, -33, -1023 }, { -100, -26, -1027 }, { -98, -17, -1031 }, + { -96, -8, -1036 }, { -94, 0, -1041 }, { -91, 8, -1045 }, { -89, 16, -1049 }, { -87, 23, -1052 }, + { -85, 29, -1053 }, { -83, 32, -1051 }, { -81, 33, -1047 }, { -79, 32, -1040 }, { -77, 28, -1031 }, + { -75, 24, -1020 }, { -73, 18, -1008 }, { -72, 13, -997 }, { -70, 8, -987 }, { -69, 4, -979 }, + { -68, 2, -974 }, { -68, 0, -971 }, { -67, 0, -969 }, { -67, 0, -968 }, { -67, 0, -967 }, + { -67, 0, -967 }, { -67, 0, -968 }, { -67, 0, -969 }, { -67, 0, -970 }, { -68, 0, -971 }, + { -68, 1, -972 }, { -68, 1, -973 }, { -68, 1, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, + { -68, 2, -974 }, { -68, 2, -974 }, { -68, 2, -974 }, { -68, 1, -975 }, { -68, 1, -975 }, + { -68, 1, -975 }, { -68, 1, -975 }, { -68, 1, -976 }, { -68, 1, -976 }, { -68, 1, -976 }, + { -68, 1, -977 }, { -68, 1, -977 }, { -68, 1, -977 }, { -68, 1, -978 }, { -68, 1, -978 }, + { -68, 1, -978 }, { -68, 1, -979 }, { -68, 1, -979 }, { -68, 1, -979 }, { -68, 1, -979 }, + { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, + { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -980 }, { -68, 1, -979 }, { -68, 1, -979 }, + { -68, 1, -979 }, { -68, 1, -978 }, { -68, 1, -978 }, { -68, 1, -977 }, { -68, 1, -977 }, + { -68, 1, -976 }, { -68, 1, -975 }, { -68, 2, -974 }, { -68, 2, -970 }, { -68, 3, -963 }, + { -68, 4, -953 }, { -68, 5, -943 }, { -68, 6, -934 }, { -68, 7, -929 }, { -68, 7, -926 }, + { -68, 6, -925 }, { -68, 5, -924 }, { -68, 4, -925 }, { -68, 3, -925 }, { -68, 2, -926 }, + { -68, 3, -927 }, { -68, 4, -928 }, { -68, 7, -929 }, { -68, 12, -929 }, { -68, 19, -929 }, + { -68, 27, -929 }, { -68, 36, -930 }, { -68, 45, -930 }, { -68, 54, -931 }, { -68, 62, -932 }, + { -68, 69, -933 }, { -68, 74, -934 }, { -69, 77, -935 }, { -69, 78, -938 }, { -69, 78, -941 }, + { -69, 77, -943 }, { -69, 75, -946 }, { -69, 72, -947 }, { -69, 68, -948 }, { -69, 64, -947 }, + { -69, 60, -946 }, { -69, 55, -946 }, { -69, 50, -944 }, { -69, 45, -943 }, { -69, 40, -942 }, + { -69, 35, -941 }, { -69, 30, -939 }, { -68, 24, -938 }, { -68, 19, -936 }, { -68, 13, -935 }, + { -68, 7, -933 }, { -68, 2, -931 }, { -68, -3, -930 }, { -68, -9, -929 }, { -68, -14, -927 }, + { -68, -20, -926 }, { -68, -26, -925 }, { -68, -32, -924 }, { -68, -37, -923 }, { -68, -43, -923 }, + { -68, -50, -922 }, { -68, -57, -922 }, { -68, -64, -922 }, { -68, -72, -922 }, { -68, -79, -922 }, + { -68, -87, -922 }, { -68, -94, -922 }, { -68, -101, -922 }, { -68, -108, -923 }, { -68, -114, -923 }, + { -68, -119, -923 }, { -68, -124, -923 }, { -68, -127, -924 }, { -68, -130, -924 }, { -68, -131, -923 }, + { -69, -129, -921 }, { -69, -126, -918 }, { -69, -122, -915 }, { -69, -117, -912 }, { -69, -111, -911 }, + { -69, -105, -910 }, { -69, -99, -912 }, { -69, -94, -916 }, { -69, -89, -923 }, { -69, -86, -933 }, + { -69, -82, -946 }, { -68, -78, -961 }, { -68, -74, -978 }, { -68, -70, -996 }, { -68, -67, -1015 }, + { -68, -63, -1034 }, { -67, -60, -1053 }, { -67, -57, -1071 }, { -67, -54, -1087 }, { -67, -51, -1101 }, + { -67, -49, -1112 }, { -67, -48, -1121 }, { -67, -48, -1128 }, { -67, -50, -1132 }, { -67, -51, -1133 }, + { -67, -52, -1131 }, { -67, -52, -1124 }, { -67, -49, -1112 }, { -67, -41, -1090 }, { -67, -28, -1055 }, + { -68, -14, -1015 }, { -68, -1, -976 }, { -68, 7, -945 }, { -68, 7, -929 }, { -68, 2, -923 }, + { -67, -4, -919 }, { -67, -12, -917 }, { -67, -21, -916 }, { -66, -30, -916 }, { -66, -40, -917 }, + { -65, -51, -920 }, { -65, -62, -923 }, { -65, -74, -926 }, { -64, -85, -930 }, { -64, -96, -934 }, + { -63, -108, -938 }, { -63, -118, -942 }, { -63, -128, -946 }, { -63, -138, -949 }, { -62, -146, -952 }, + { -62, -154, -954 }, { -62, -160, -954 }, { -63, -161, -953 }, { -64, -153, -949 }, { -66, -141, -943 }, + { -67, -130, -938 }, { -68, -124, -935 }, { -68, -121, -933 }, { -69, -120, -931 }, { -69, -119, -929 }, + { -69, -119, -927 }, { -69, -119, -925 }, { -69, -119, -923 }, { -69, -119, -921 }, { -69, -119, -920 }, + { -69, -119, -919 }, { -69, -119, -917 }, { -69, -118, -916 }, { -69, -116, -916 }, { -69, -114, -915 }, + { -69, -110, -915 }, { -69, -106, -915 }, { -69, -99, -915 }, { -69, -90, -917 }, { -68, -80, -919 }, + { -68, -68, -922 }, { -67, -55, -924 }, { -67, -41, -928 }, { -66, -28, -931 }, { -66, -16, -934 }, + { -65, -5, -936 }, { -65, 4, -939 }, { -64, 11, -940 }, { -64, 17, -940 }, { -64, 20, -938 }, + { -64, 21, -934 }, { -64, 21, -931 }, { -64, 20, -928 }, { -64, 17, -929 }, { -64, 15, -932 }, + { -64, 11, -940 }, { -64, 6, -958 }, { -64, -1, -986 }, { -64, -11, -1018 }, { -63, -21, -1050 }, + { -63, -29, -1077 }, { -63, -34, -1092 }, { -63, -36, -1099 }, { -63, -37, -1103 }, { -63, -38, -1105 }, + { -63, -38, -1105 }, { -63, -37, -1103 }, { -63, -36, -1101 }, { -63, -35, -1098 }, { -63, -34, -1095 }, + { -63, -34, -1092 }, { -63, -33, -1091 }, { -63, -33, -1091 }, { -63, -34, -1092 }, { -62, -43, -1121 }, + { -62, -50, -1135 }, { -62, -43, -1092 }, { -62, -31, -1030 }, { -62, -19, -971 }, { -62, -11, -938 }, + { -62, -8, -926 }, { -63, -4, -917 }, { -64, -1, -911 }, { -65, 1, -906 }, { -65, 4, -904 }, + { -66, 7, -903 }, { -67, 8, -905 }, { -68, 10, -907 }, { -68, 10, -911 }, { -68, 10, -916 }, + { -68, 9, -922 }, { -68, 7, -929 }, { -67, 4, -937 }, { -66, 0, -948 }, { -64, -6, -962 }, + { -63, -13, -977 }, { -61, -20, -993 }, { -59, -28, -1011 }, { -57, -36, -1028 }, { -54, -44, -1045 }, + { -52, -51, -1062 }, { -51, -58, -1077 }, { -49, -65, -1091 }, { -48, -70, -1102 }, { -47, -74, -1110 }, + { -46, -77, -1117 }, { -45, -78, -1122 }, { -45, -80, -1127 }, { -44, -80, -1130 }, { -44, -81, -1132 }, + { -44, -80, -1133 }, { -44, -80, -1133 }, { -44, -79, -1132 }, { -44, -78, -1130 }, { -45, -77, -1127 }, + { -45, -76, -1122 }, { -46, -75, -1117 }, { -47, -74, -1110 }, { -48, -73, -1101 }, { -49, -71, -1086 }, + { -51, -70, -1069 }, { -54, -68, -1049 }, { -56, -66, -1028 }, { -59, -63, -1007 }, { -61, -61, -987 }, + { -63, -60, -969 }, { -65, -58, -954 }, { -66, -57, -943 }, { -66, -57, -938 }, { -66, -57, -938 }, + { -66, -57, -941 }, { -65, -58, -946 }, { -64, -59, -954 }, { -63, -60, -964 }, { -62, -61, -975 }, + { -60, -63, -987 }, { -59, -64, -999 }, { -57, -66, -1011 }, { -56, -67, -1023 }, { -55, -68, -1033 }, + { -54, -69, -1042 }, { -53, -69, -1049 }, { -53, -69, -1054 }, { -53, -68, -1055 }, { -56, -65, -1043 }, + { -61, -58, -1015 }, { -68, -50, -981 }, { -74, -44, -951 }, { -77, -40, -935 }, { -77, -39, -931 }, + { -78, -38, -927 }, { -79, -38, -923 }, { -79, -37, -920 }, { -80, -36, -917 }, { -80, -36, -915 }, + { -80, -35, -913 }, { -80, -35, -911 }, { -81, -35, -910 }, { -81, -35, -908 }, { -81, -35, -907 }, + { -81, -34, -907 }, { -81, -34, -906 }, { -81, -34, -906 }, { -81, -35, -905 }, { -80, -35, -905 }, + { -80, -35, -905 }, { -80, -35, -905 }, { -80, -35, -906 }, { -80, -35, -906 }, { -80, -35, -906 }, + { -80, -35, -907 }, { -79, -35, -907 }, { -79, -36, -907 }, { -79, -36, -907 }, { -79, -36, -907 }, + { -79, -36, -907 }, { -79, -36, -908 }, { -79, -36, -911 }, { -79, -37, -914 }, { -78, -37, -918 }, + { -78, -38, -922 }, { -77, -39, -926 }, { -77, -39, -930 }, { -77, -40, -933 }, { -77, -40, -935 }, + { -77, -40, -936 }, { -77, -40, -937 }, { -76, -40, -937 }, { -76, -40, -938 }, { -76, -40, -938 }, + { -76, -40, -938 }, { -77, -40, -937 }, { -77, -40, -937 }, { -77, -40, -937 }, { -77, -40, -936 }, + { -77, -40, -936 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, { -77, -40, -935 }, + { -77, -40, -935 }, { -77, -40, -935 }, { -77, -41, -935 }, { -77, -41, -934 }, { -77, -41, -934 }, + { -77, -41, -934 }, { -77, -41, -934 }, { -77, -42, -934 }, { -77, -42, -934 }, { -77, -42, -933 }, + { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, + { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, { -77, -42, -933 }, + { -77, -42, -934 }, { -77, -41, -934 }, { -77, -41, -934 }, { -77, -41, -935 }, { -77, -40, -935 }, + { -77, -39, -936 }, { -76, -39, -936 }, { -76, -38, -937 }, { -76, -37, -938 }, { -76, -37, -938 }, + { -76, -36, -939 }, { -76, -35, -940 }, { -76, -34, -941 }, { -75, -33, -941 }, { -75, -32, -942 }, + { -75, -31, -943 }, { -75, -30, -944 }, { -75, -29, -945 }, { -74, -28, -946 }, { -74, -27, -947 }, + { -74, -26, -948 }, { -74, -25, -949 }, { -74, -24, -950 }, { -73, -23, -951 }, { -73, -22, -952 }, + { -73, -21, -953 }, { -73, -20, -954 }, { -72, -19, -955 }, { -72, -17, -956 }, { -72, -16, -957 }, + { -72, -15, -958 }, { -72, -14, -959 }, { -71, -13, -960 }, { -71, -12, -961 }, { -71, -11, -962 }, + { -71, -10, -963 }, { -70, -9, -964 }, { -70, -8, -965 }, { -70, -7, -966 }, { -70, -6, -966 }, + { -70, -5, -967 }, { -70, -4, -968 }, { -69, -3, -969 }, { -69, -2, -970 }, { -69, -1, -971 }, + { -69, 0, -971 }, { -69, 0, -972 }, { -69, 0, -973 }, { -68, 1, -973 }, { -68, 2, -974 }, + { -68, 2, -975 }, { -68, 3, -975 }, { -68, 3, -976 }, { -68, 4, -977 }, { -68, 4, -977 }, + { -68, 5, -978 }, { -68, 5, -978 }, { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, + { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, { -68, 6, -979 }, { -68, 5, -979 }, + { -68, 5, -978 }, { -68, 4, -977 }, { -68, 3, -976 }, { -68, 3, -975 }, { -68, 2, -974 }, + { -68, 0, -972 }, { -68, -1, -969 }, { -68, -4, -965 }, { -68, -8, -961 }, { -68, -12, -956 }, + { -68, -16, -951 }, { -68, -20, -946 }, { -68, -23, -941 }, { -68, -27, -937 }, { -68, -29, -933 }, + { -68, -31, -931 }, { -68, -32, -930 }, { -68, -33, -929 }, { -68, -33, -928 }, { -68, -34, -928 }, + { -68, -34, -927 }, { -68, -35, -927 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, + { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, + { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, + { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, { -68, -37, -924 }, + { -68, -37, -924 }, { -68, -37, -924 }, { -68, -36, -924 }, { -68, -36, -925 }, { -68, -36, -925 }, + { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -925 }, { -68, -36, -926 }, + { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -926 }, { -68, -35, -927 }, + { -68, -35, -927 }, { -68, -34, -927 }, { -68, -34, -927 }, { -68, -34, -927 }, { -68, -34, -928 }, + { -68, -34, -928 }, { -68, -34, -928 }, { -68, -33, -928 }, { -68, -33, -928 }, { -68, -33, -929 }, + { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, + { -68, -33, -929 }, { -68, -33, -929 }, { -68, -33, -929 }, { -68, -32, -929 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, + { -68, -32, -930 }, { -68, -32, -930 }, { -68, -32, -930 }, { -68, -33, -929 }, { -68, -32, -930 }, + { -68, -29, -934 }, { -68, -25, -939 }, { -68, -21, -945 }, { -68, -16, -951 }, { -68, -11, -956 }, + { -68, -7, -962 }, { -68, -3, -967 }, { -68, 0, -971 }, { -68, 1, -973 }, { -68, 2, -974 }, }; static s16 animdata_mario_eye_left_2[][3] = { @@ -1141,256 +1050,207 @@ struct AnimDataInfo anim_mario_eye_left[] = { }; static s16 animdata_mario_eye_right_1[][3] = { - { 1844, -1788, 824 }, { 1844, -1789, 824 }, { 1844, -1791, 825 }, { 1844, -1794, 825 }, - { 1844, -1797, 826 }, { 1844, -1802, 826 }, { 1844, -1807, 827 }, { 1844, -1813, 828 }, - { 1844, -1819, 829 }, { 1845, -1826, 829 }, { 1845, -1832, 830 }, { 1845, -1839, 831 }, - { 1845, -1845, 832 }, { 1845, -1851, 833 }, { 1845, -1857, 834 }, { 1845, -1862, 835 }, - { 1845, -1866, 836 }, { 1845, -1870, 836 }, { 1845, -1873, 837 }, { 1845, -1874, 838 }, - { 1845, -1875, 838 }, { 1845, -1868, 838 }, { 1845, -1851, 837 }, { 1845, -1830, 835 }, - { 1844, -1808, 834 }, { 1844, -1791, 832 }, { 1844, -1783, 832 }, { 1844, -1781, 831 }, - { 1844, -1779, 831 }, { 1844, -1778, 831 }, { 1844, -1777, 830 }, { 1844, -1776, 830 }, - { 1844, -1775, 830 }, { 1844, -1774, 830 }, { 1844, -1774, 829 }, { 1844, -1773, 829 }, - { 1844, -1773, 829 }, { 1844, -1773, 829 }, { 1844, -1773, 828 }, { 1844, -1773, 828 }, - { 1844, -1773, 828 }, { 1844, -1773, 828 }, { 1844, -1773, 827 }, { 1844, -1774, 827 }, - { 1844, -1774, 827 }, { 1844, -1775, 827 }, { 1844, -1775, 827 }, { 1844, -1776, 826 }, - { 1844, -1777, 826 }, { 1844, -1777, 826 }, { 1844, -1778, 826 }, { 1844, -1779, 826 }, - { 1844, -1780, 826 }, { 1844, -1780, 825 }, { 1844, -1781, 825 }, { 1844, -1782, 825 }, - { 1844, -1783, 825 }, { 1844, -1784, 825 }, { 1844, -1784, 825 }, { 1844, -1785, 825 }, - { 1844, -1786, 825 }, { 1844, -1786, 825 }, { 1844, -1787, 825 }, { 1844, -1787, 824 }, - { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, - { 1844, -1788, 824 }, { 1844, -1788, 825 }, { 1844, -1788, 825 }, { 1844, -1787, 826 }, - { 1844, -1786, 827 }, { 1844, -1785, 829 }, { 1844, -1784, 830 }, { 1844, -1782, 832 }, - { 1844, -1781, 833 }, { 1844, -1780, 835 }, { 1844, -1779, 836 }, { 1844, -1778, 837 }, - { 1844, -1777, 838 }, { 1844, -1777, 838 }, { 1844, -1777, 838 }, { 1844, -1778, 838 }, - { 1844, -1779, 837 }, { 1844, -1780, 835 }, { 1844, -1782, 832 }, { 1844, -1785, 829 }, - { 1844, -1788, 824 }, { 1844, -1800, 810 }, { 1844, -1823, 782 }, { 1844, -1849, 749 }, - { 1844, -1872, 720 }, { 1843, -1884, 705 }, { 1843, -1888, 701 }, { 1843, -1891, 696 }, - { 1843, -1894, 693 }, { 1843, -1897, 689 }, { 1843, -1899, 687 }, { 1843, -1900, 685 }, - { 1843, -1902, 684 }, { 1843, -1902, 683 }, { 1843, -1902, 683 }, { 1843, -1902, 683 }, - { 1843, -1901, 684 }, { 1843, -1900, 685 }, { 1843, -1899, 687 }, { 1843, -1897, 690 }, - { 1843, -1894, 693 }, { 1843, -1891, 697 }, { 1843, -1888, 701 }, { 1843, -1884, 705 }, - { 1844, -1875, 717 }, { 1844, -1858, 738 }, { 1844, -1837, 763 }, { 1844, -1816, 789 }, - { 1844, -1799, 811 }, { 1844, -1788, 824 }, { 1844, -1783, 830 }, { 1844, -1779, 834 }, - { 1844, -1776, 835 }, { 1844, -1774, 835 }, { 1844, -1773, 834 }, { 1844, -1773, 832 }, - { 1844, -1774, 830 }, { 1844, -1776, 828 }, { 1844, -1779, 826 }, { 1844, -1783, 825 }, - { 1844, -1788, 824 }, { 1844, -1801, 825 }, { 1844, -1824, 827 }, { 1845, -1849, 829 }, - { 1845, -1870, 831 }, { 1845, -1880, 832 }, { 1845, -1881, 832 }, { 1845, -1882, 832 }, - { 1845, -1883, 832 }, { 1845, -1883, 831 }, { 1845, -1883, 831 }, { 1845, -1882, 831 }, - { 1845, -1881, 830 }, { 1845, -1880, 830 }, { 1845, -1878, 830 }, { 1845, -1876, 829 }, - { 1845, -1874, 829 }, { 1845, -1871, 828 }, { 1845, -1869, 828 }, { 1845, -1866, 828 }, - { 1845, -1863, 827 }, { 1845, -1859, 827 }, { 1845, -1856, 827 }, { 1845, -1853, 827 }, - { 1845, -1849, 827 }, { 1845, -1846, 827 }, { 1845, -1842, 828 }, { 1845, -1839, 828 }, - { 1844, -1834, 829 }, { 1844, -1829, 831 }, { 1844, -1822, 834 }, { 1844, -1814, 836 }, - { 1844, -1805, 839 }, { 1843, -1797, 842 }, { 1843, -1789, 845 }, { 1843, -1781, 848 }, - { 1843, -1775, 850 }, { 1842, -1770, 851 }, { 1842, -1766, 851 }, { 1842, -1765, 850 }, - { 1843, -1766, 848 }, { 1843, -1768, 845 }, { 1843, -1771, 841 }, { 1843, -1775, 837 }, - { 1844, -1780, 833 }, { 1844, -1783, 829 }, { 1844, -1787, 826 }, { 1844, -1788, 824 }, - { 1844, -1789, 823 }, { 1844, -1790, 823 }, { 1844, -1790, 822 }, { 1845, -1790, 822 }, - { 1844, -1790, 822 }, { 1844, -1790, 822 }, { 1844, -1790, 823 }, { 1844, -1790, 823 }, - { 1844, -1789, 823 }, { 1844, -1789, 824 }, { 1844, -1789, 824 }, { 1844, -1788, 824 }, - { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, - { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 823 }, { 1844, -1788, 823 }, - { 1844, -1788, 823 }, { 1844, -1788, 823 }, { 1844, -1789, 822 }, { 1844, -1789, 822 }, - { 1844, -1789, 821 }, { 1844, -1789, 821 }, { 1844, -1789, 821 }, { 1844, -1789, 820 }, - { 1844, -1789, 820 }, { 1844, -1789, 820 }, { 1844, -1789, 819 }, { 1844, -1789, 819 }, - { 1844, -1789, 819 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, - { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, - { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 819 }, - { 1844, -1789, 819 }, { 1844, -1789, 819 }, { 1844, -1789, 820 }, { 1844, -1789, 821 }, - { 1844, -1789, 821 }, { 1844, -1789, 822 }, { 1844, -1788, 823 }, { 1844, -1788, 824 }, - { 1844, -1788, 828 }, { 1844, -1787, 837 }, { 1844, -1786, 848 }, { 1844, -1786, 860 }, - { 1843, -1785, 870 }, { 1843, -1784, 876 }, { 1843, -1785, 878 }, { 1843, -1785, 880 }, - { 1843, -1786, 880 }, { 1843, -1788, 880 }, { 1843, -1789, 879 }, { 1843, -1789, 878 }, - { 1843, -1789, 877 }, { 1843, -1787, 876 }, { 1843, -1784, 876 }, { 1843, -1780, 876 }, - { 1843, -1773, 878 }, { 1843, -1765, 879 }, { 1843, -1756, 881 }, { 1843, -1746, 883 }, - { 1843, -1738, 883 }, { 1844, -1729, 883 }, { 1844, -1723, 882 }, { 1844, -1718, 878 }, - { 1844, -1715, 872 }, { 1845, -1714, 863 }, { 1845, -1715, 851 }, { 1846, -1716, 839 }, - { 1846, -1719, 827 }, { 1846, -1722, 816 }, { 1846, -1726, 808 }, { 1846, -1731, 801 }, - { 1846, -1735, 794 }, { 1846, -1740, 788 }, { 1846, -1745, 781 }, { 1846, -1750, 774 }, - { 1846, -1755, 768 }, { 1845, -1760, 761 }, { 1845, -1765, 755 }, { 1845, -1771, 748 }, - { 1845, -1776, 742 }, { 1844, -1782, 737 }, { 1844, -1787, 731 }, { 1844, -1793, 725 }, - { 1844, -1799, 720 }, { 1844, -1804, 715 }, { 1843, -1810, 711 }, { 1843, -1816, 706 }, - { 1843, -1822, 703 }, { 1843, -1827, 699 }, { 1843, -1833, 696 }, { 1843, -1839, 693 }, - { 1843, -1845, 690 }, { 1843, -1852, 687 }, { 1843, -1859, 685 }, { 1843, -1866, 683 }, - { 1843, -1873, 682 }, { 1843, -1880, 681 }, { 1843, -1887, 681 }, { 1843, -1894, 681 }, - { 1844, -1901, 682 }, { 1844, -1907, 684 }, { 1844, -1912, 687 }, { 1844, -1917, 691 }, - { 1844, -1921, 697 }, { 1844, -1924, 703 }, { 1844, -1927, 712 }, { 1843, -1927, 726 }, - { 1843, -1927, 744 }, { 1843, -1926, 763 }, { 1842, -1923, 784 }, { 1842, -1920, 805 }, - { 1842, -1917, 825 }, { 1842, -1913, 843 }, { 1841, -1909, 857 }, { 1841, -1906, 868 }, - { 1841, -1902, 874 }, { 1841, -1897, 878 }, { 1841, -1891, 880 }, { 1841, -1886, 881 }, - { 1842, -1880, 881 }, { 1842, -1873, 879 }, { 1842, -1867, 877 }, { 1842, -1861, 875 }, - { 1842, -1856, 873 }, { 1842, -1851, 871 }, { 1843, -1846, 869 }, { 1843, -1842, 869 }, - { 1843, -1840, 869 }, { 1843, -1841, 869 }, { 1843, -1842, 869 }, { 1843, -1844, 869 }, - { 1843, -1846, 869 }, { 1843, -1845, 869 }, { 1843, -1842, 869 }, { 1843, -1834, 869 }, - { 1843, -1822, 870 }, { 1843, -1807, 870 }, { 1843, -1794, 871 }, { 1843, -1785, 871 }, - { 1843, -1785, 870 }, { 1843, -1790, 869 }, { 1843, -1796, 868 }, { 1843, -1804, 867 }, - { 1842, -1813, 867 }, { 1842, -1822, 866 }, { 1842, -1832, 866 }, { 1842, -1843, 866 }, - { 1841, -1854, 865 }, { 1841, -1865, 864 }, { 1841, -1877, 863 }, { 1841, -1888, 862 }, - { 1840, -1899, 860 }, { 1840, -1909, 858 }, { 1839, -1919, 855 }, { 1838, -1928, 852 }, - { 1838, -1936, 849 }, { 1837, -1943, 844 }, { 1836, -1949, 839 }, { 1834, -1950, 829 }, - { 1831, -1943, 811 }, { 1827, -1933, 789 }, { 1823, -1922, 767 }, { 1820, -1912, 749 }, - { 1818, -1907, 739 }, { 1818, -1905, 735 }, { 1817, -1905, 731 }, { 1817, -1905, 728 }, - { 1816, -1906, 725 }, { 1816, -1908, 724 }, { 1816, -1910, 723 }, { 1816, -1912, 722 }, - { 1816, -1913, 723 }, { 1816, -1915, 724 }, { 1817, -1915, 726 }, { 1817, -1915, 728 }, - { 1817, -1914, 731 }, { 1818, -1911, 735 }, { 1818, -1907, 739 }, { 1819, -1900, 745 }, - { 1820, -1891, 754 }, { 1821, -1880, 764 }, { 1822, -1867, 776 }, { 1823, -1853, 788 }, - { 1825, -1839, 801 }, { 1826, -1825, 814 }, { 1827, -1811, 826 }, { 1829, -1799, 837 }, - { 1830, -1789, 847 }, { 1830, -1781, 854 }, { 1831, -1775, 860 }, { 1831, -1772, 865 }, - { 1831, -1770, 869 }, { 1832, -1770, 871 }, { 1831, -1772, 871 }, { 1831, -1774, 869 }, - { 1831, -1777, 863 }, { 1830, -1781, 854 }, { 1829, -1786, 836 }, { 1828, -1796, 808 }, - { 1826, -1806, 775 }, { 1825, -1817, 742 }, { 1823, -1826, 716 }, { 1822, -1831, 700 }, - { 1822, -1833, 693 }, { 1822, -1834, 689 }, { 1822, -1835, 687 }, { 1822, -1835, 687 }, - { 1822, -1834, 689 }, { 1822, -1833, 692 }, { 1822, -1832, 695 }, { 1822, -1831, 698 }, - { 1822, -1830, 700 }, { 1822, -1830, 702 }, { 1822, -1830, 702 }, { 1822, -1831, 700 }, - { 1821, -1841, 671 }, { 1821, -1848, 656 }, { 1824, -1839, 699 }, { 1829, -1825, 762 }, - { 1833, -1812, 821 }, { 1836, -1803, 855 }, { 1837, -1799, 867 }, { 1838, -1796, 875 }, - { 1839, -1792, 881 }, { 1840, -1789, 884 }, { 1841, -1787, 885 }, { 1841, -1785, 884 }, - { 1842, -1783, 883 }, { 1842, -1782, 881 }, { 1842, -1781, 878 }, { 1843, -1782, 877 }, - { 1843, -1783, 876 }, { 1843, -1784, 876 }, { 1843, -1787, 877 }, { 1844, -1792, 878 }, - { 1844, -1797, 878 }, { 1844, -1803, 879 }, { 1844, -1810, 879 }, { 1844, -1817, 880 }, - { 1844, -1824, 880 }, { 1844, -1831, 880 }, { 1844, -1838, 881 }, { 1843, -1845, 881 }, - { 1843, -1850, 881 }, { 1843, -1855, 881 }, { 1843, -1859, 881 }, { 1843, -1861, 882 }, - { 1844, -1863, 884 }, { 1844, -1863, 886 }, { 1844, -1864, 889 }, { 1844, -1864, 891 }, - { 1845, -1863, 894 }, { 1845, -1862, 896 }, { 1845, -1861, 897 }, { 1845, -1860, 897 }, - { 1845, -1859, 896 }, { 1845, -1859, 893 }, { 1844, -1858, 888 }, { 1843, -1859, 881 }, - { 1842, -1859, 871 }, { 1840, -1860, 854 }, { 1838, -1862, 835 }, { 1835, -1863, 812 }, - { 1833, -1865, 788 }, { 1830, -1866, 765 }, { 1828, -1868, 742 }, { 1825, -1869, 722 }, - { 1823, -1870, 706 }, { 1822, -1870, 696 }, { 1822, -1870, 691 }, { 1822, -1869, 692 }, - { 1822, -1868, 695 }, { 1823, -1867, 699 }, { 1823, -1866, 705 }, { 1824, -1865, 713 }, - { 1825, -1863, 722 }, { 1826, -1862, 732 }, { 1828, -1860, 742 }, { 1829, -1858, 754 }, - { 1830, -1856, 766 }, { 1832, -1855, 778 }, { 1833, -1853, 790 }, { 1834, -1851, 802 }, - { 1836, -1850, 813 }, { 1837, -1848, 824 }, { 1838, -1847, 834 }, { 1839, -1846, 844 }, - { 1840, -1844, 852 }, { 1841, -1843, 858 }, { 1841, -1843, 863 }, { 1842, -1842, 867 }, - { 1842, -1842, 870 }, { 1843, -1841, 873 }, { 1843, -1841, 876 }, { 1843, -1841, 878 }, - { 1843, -1840, 880 }, { 1843, -1840, 881 }, { 1844, -1840, 882 }, { 1844, -1840, 883 }, - { 1844, -1840, 884 }, { 1844, -1840, 884 }, { 1844, -1840, 885 }, { 1844, -1840, 885 }, - { 1844, -1840, 885 }, { 1844, -1840, 885 }, { 1844, -1840, 884 }, { 1843, -1840, 884 }, - { 1843, -1840, 883 }, { 1843, -1840, 883 }, { 1843, -1841, 882 }, { 1843, -1841, 882 }, - { 1843, -1841, 881 }, { 1843, -1841, 881 }, { 1843, -1841, 880 }, { 1843, -1841, 880 }, - { 1843, -1841, 880 }, { 1843, -1841, 880 }, { 1843, -1841, 879 }, { 1843, -1841, 878 }, - { 1843, -1841, 876 }, { 1842, -1842, 873 }, { 1842, -1842, 871 }, { 1842, -1842, 868 }, - { 1842, -1842, 866 }, { 1842, -1843, 864 }, { 1841, -1843, 863 }, { 1841, -1843, 862 }, - { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 861 }, { 1841, -1843, 861 }, - { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, - { 1841, -1843, 862 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, - { 1841, -1844, 863 }, { 1841, -1844, 864 }, { 1841, -1844, 864 }, { 1841, -1844, 864 }, - { 1841, -1844, 864 }, { 1841, -1845, 864 }, { 1841, -1845, 865 }, { 1841, -1845, 865 }, - { 1841, -1845, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, - { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, - { 1841, -1846, 865 }, { 1841, -1845, 865 }, { 1841, -1845, 865 }, { 1841, -1845, 864 }, - { 1841, -1844, 864 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1842, 862 }, - { 1842, -1841, 862 }, { 1842, -1840, 861 }, { 1842, -1839, 861 }, { 1842, -1838, 860 }, - { 1842, -1837, 859 }, { 1842, -1836, 858 }, { 1842, -1835, 858 }, { 1842, -1834, 857 }, - { 1842, -1833, 856 }, { 1842, -1832, 855 }, { 1842, -1830, 854 }, { 1842, -1829, 853 }, - { 1842, -1828, 852 }, { 1842, -1826, 851 }, { 1842, -1825, 850 }, { 1842, -1824, 849 }, - { 1843, -1822, 849 }, { 1843, -1821, 848 }, { 1843, -1820, 847 }, { 1843, -1818, 846 }, - { 1843, -1817, 845 }, { 1843, -1815, 844 }, { 1843, -1814, 843 }, { 1843, -1813, 842 }, - { 1843, -1811, 841 }, { 1843, -1810, 840 }, { 1843, -1808, 839 }, { 1843, -1807, 838 }, - { 1843, -1806, 837 }, { 1843, -1804, 836 }, { 1844, -1803, 835 }, { 1844, -1802, 834 }, - { 1844, -1800, 833 }, { 1844, -1799, 832 }, { 1844, -1798, 831 }, { 1844, -1797, 830 }, - { 1844, -1795, 829 }, { 1844, -1794, 829 }, { 1844, -1793, 828 }, { 1844, -1792, 827 }, - { 1844, -1791, 826 }, { 1844, -1790, 826 }, { 1844, -1789, 825 }, { 1844, -1788, 824 }, - { 1844, -1788, 824 }, { 1844, -1787, 823 }, { 1844, -1786, 823 }, { 1844, -1786, 822 }, - { 1844, -1785, 822 }, { 1844, -1785, 821 }, { 1844, -1784, 821 }, { 1844, -1784, 821 }, - { 1844, -1784, 821 }, { 1844, -1784, 820 }, { 1844, -1784, 820 }, { 1844, -1784, 820 }, - { 1844, -1784, 821 }, { 1844, -1784, 821 }, { 1844, -1785, 821 }, { 1844, -1785, 821 }, - { 1844, -1786, 822 }, { 1844, -1787, 823 }, { 1844, -1787, 823 }, { 1844, -1788, 824 }, - { 1844, -1790, 826 }, { 1845, -1792, 828 }, { 1845, -1795, 831 }, { 1845, -1798, 834 }, - { 1845, -1802, 837 }, { 1845, -1805, 841 }, { 1845, -1809, 844 }, { 1846, -1812, 848 }, - { 1846, -1815, 851 }, { 1846, -1818, 853 }, { 1846, -1819, 855 }, { 1846, -1820, 856 }, - { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, - { 1846, -1822, 857 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, - { 1846, -1823, 858 }, { 1846, -1823, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, - { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, - { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, - { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, - { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, - { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1823, 859 }, { 1846, -1823, 858 }, - { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, - { 1846, -1823, 858 }, { 1846, -1822, 858 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, - { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, - { 1846, -1821, 857 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, - { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, - { 1846, -1821, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, - { 1846, -1821, 856 }, { 1846, -1820, 856 }, { 1846, -1817, 853 }, { 1846, -1814, 849 }, - { 1845, -1810, 845 }, { 1845, -1805, 841 }, { 1845, -1801, 837 }, { 1845, -1797, 833 }, - { 1845, -1794, 829 }, { 1844, -1791, 827 }, { 1844, -1789, 825 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1789, 824 }, { 1844, -1791, 825 }, { 1844, -1794, 825 }, { 1844, -1797, 826 }, + { 1844, -1802, 826 }, { 1844, -1807, 827 }, { 1844, -1813, 828 }, { 1844, -1819, 829 }, { 1845, -1826, 829 }, + { 1845, -1832, 830 }, { 1845, -1839, 831 }, { 1845, -1845, 832 }, { 1845, -1851, 833 }, { 1845, -1857, 834 }, + { 1845, -1862, 835 }, { 1845, -1866, 836 }, { 1845, -1870, 836 }, { 1845, -1873, 837 }, { 1845, -1874, 838 }, + { 1845, -1875, 838 }, { 1845, -1868, 838 }, { 1845, -1851, 837 }, { 1845, -1830, 835 }, { 1844, -1808, 834 }, + { 1844, -1791, 832 }, { 1844, -1783, 832 }, { 1844, -1781, 831 }, { 1844, -1779, 831 }, { 1844, -1778, 831 }, + { 1844, -1777, 830 }, { 1844, -1776, 830 }, { 1844, -1775, 830 }, { 1844, -1774, 830 }, { 1844, -1774, 829 }, + { 1844, -1773, 829 }, { 1844, -1773, 829 }, { 1844, -1773, 829 }, { 1844, -1773, 828 }, { 1844, -1773, 828 }, + { 1844, -1773, 828 }, { 1844, -1773, 828 }, { 1844, -1773, 827 }, { 1844, -1774, 827 }, { 1844, -1774, 827 }, + { 1844, -1775, 827 }, { 1844, -1775, 827 }, { 1844, -1776, 826 }, { 1844, -1777, 826 }, { 1844, -1777, 826 }, + { 1844, -1778, 826 }, { 1844, -1779, 826 }, { 1844, -1780, 826 }, { 1844, -1780, 825 }, { 1844, -1781, 825 }, + { 1844, -1782, 825 }, { 1844, -1783, 825 }, { 1844, -1784, 825 }, { 1844, -1784, 825 }, { 1844, -1785, 825 }, + { 1844, -1786, 825 }, { 1844, -1786, 825 }, { 1844, -1787, 825 }, { 1844, -1787, 824 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 825 }, + { 1844, -1788, 825 }, { 1844, -1787, 826 }, { 1844, -1786, 827 }, { 1844, -1785, 829 }, { 1844, -1784, 830 }, + { 1844, -1782, 832 }, { 1844, -1781, 833 }, { 1844, -1780, 835 }, { 1844, -1779, 836 }, { 1844, -1778, 837 }, + { 1844, -1777, 838 }, { 1844, -1777, 838 }, { 1844, -1777, 838 }, { 1844, -1778, 838 }, { 1844, -1779, 837 }, + { 1844, -1780, 835 }, { 1844, -1782, 832 }, { 1844, -1785, 829 }, { 1844, -1788, 824 }, { 1844, -1800, 810 }, + { 1844, -1823, 782 }, { 1844, -1849, 749 }, { 1844, -1872, 720 }, { 1843, -1884, 705 }, { 1843, -1888, 701 }, + { 1843, -1891, 696 }, { 1843, -1894, 693 }, { 1843, -1897, 689 }, { 1843, -1899, 687 }, { 1843, -1900, 685 }, + { 1843, -1902, 684 }, { 1843, -1902, 683 }, { 1843, -1902, 683 }, { 1843, -1902, 683 }, { 1843, -1901, 684 }, + { 1843, -1900, 685 }, { 1843, -1899, 687 }, { 1843, -1897, 690 }, { 1843, -1894, 693 }, { 1843, -1891, 697 }, + { 1843, -1888, 701 }, { 1843, -1884, 705 }, { 1844, -1875, 717 }, { 1844, -1858, 738 }, { 1844, -1837, 763 }, + { 1844, -1816, 789 }, { 1844, -1799, 811 }, { 1844, -1788, 824 }, { 1844, -1783, 830 }, { 1844, -1779, 834 }, + { 1844, -1776, 835 }, { 1844, -1774, 835 }, { 1844, -1773, 834 }, { 1844, -1773, 832 }, { 1844, -1774, 830 }, + { 1844, -1776, 828 }, { 1844, -1779, 826 }, { 1844, -1783, 825 }, { 1844, -1788, 824 }, { 1844, -1801, 825 }, + { 1844, -1824, 827 }, { 1845, -1849, 829 }, { 1845, -1870, 831 }, { 1845, -1880, 832 }, { 1845, -1881, 832 }, + { 1845, -1882, 832 }, { 1845, -1883, 832 }, { 1845, -1883, 831 }, { 1845, -1883, 831 }, { 1845, -1882, 831 }, + { 1845, -1881, 830 }, { 1845, -1880, 830 }, { 1845, -1878, 830 }, { 1845, -1876, 829 }, { 1845, -1874, 829 }, + { 1845, -1871, 828 }, { 1845, -1869, 828 }, { 1845, -1866, 828 }, { 1845, -1863, 827 }, { 1845, -1859, 827 }, + { 1845, -1856, 827 }, { 1845, -1853, 827 }, { 1845, -1849, 827 }, { 1845, -1846, 827 }, { 1845, -1842, 828 }, + { 1845, -1839, 828 }, { 1844, -1834, 829 }, { 1844, -1829, 831 }, { 1844, -1822, 834 }, { 1844, -1814, 836 }, + { 1844, -1805, 839 }, { 1843, -1797, 842 }, { 1843, -1789, 845 }, { 1843, -1781, 848 }, { 1843, -1775, 850 }, + { 1842, -1770, 851 }, { 1842, -1766, 851 }, { 1842, -1765, 850 }, { 1843, -1766, 848 }, { 1843, -1768, 845 }, + { 1843, -1771, 841 }, { 1843, -1775, 837 }, { 1844, -1780, 833 }, { 1844, -1783, 829 }, { 1844, -1787, 826 }, + { 1844, -1788, 824 }, { 1844, -1789, 823 }, { 1844, -1790, 823 }, { 1844, -1790, 822 }, { 1845, -1790, 822 }, + { 1844, -1790, 822 }, { 1844, -1790, 822 }, { 1844, -1790, 823 }, { 1844, -1790, 823 }, { 1844, -1789, 823 }, + { 1844, -1789, 824 }, { 1844, -1789, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 824 }, { 1844, -1788, 823 }, + { 1844, -1788, 823 }, { 1844, -1788, 823 }, { 1844, -1788, 823 }, { 1844, -1789, 822 }, { 1844, -1789, 822 }, + { 1844, -1789, 821 }, { 1844, -1789, 821 }, { 1844, -1789, 821 }, { 1844, -1789, 820 }, { 1844, -1789, 820 }, + { 1844, -1789, 820 }, { 1844, -1789, 819 }, { 1844, -1789, 819 }, { 1844, -1789, 819 }, { 1844, -1789, 818 }, + { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, + { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 818 }, { 1844, -1789, 819 }, + { 1844, -1789, 819 }, { 1844, -1789, 819 }, { 1844, -1789, 820 }, { 1844, -1789, 821 }, { 1844, -1789, 821 }, + { 1844, -1789, 822 }, { 1844, -1788, 823 }, { 1844, -1788, 824 }, { 1844, -1788, 828 }, { 1844, -1787, 837 }, + { 1844, -1786, 848 }, { 1844, -1786, 860 }, { 1843, -1785, 870 }, { 1843, -1784, 876 }, { 1843, -1785, 878 }, + { 1843, -1785, 880 }, { 1843, -1786, 880 }, { 1843, -1788, 880 }, { 1843, -1789, 879 }, { 1843, -1789, 878 }, + { 1843, -1789, 877 }, { 1843, -1787, 876 }, { 1843, -1784, 876 }, { 1843, -1780, 876 }, { 1843, -1773, 878 }, + { 1843, -1765, 879 }, { 1843, -1756, 881 }, { 1843, -1746, 883 }, { 1843, -1738, 883 }, { 1844, -1729, 883 }, + { 1844, -1723, 882 }, { 1844, -1718, 878 }, { 1844, -1715, 872 }, { 1845, -1714, 863 }, { 1845, -1715, 851 }, + { 1846, -1716, 839 }, { 1846, -1719, 827 }, { 1846, -1722, 816 }, { 1846, -1726, 808 }, { 1846, -1731, 801 }, + { 1846, -1735, 794 }, { 1846, -1740, 788 }, { 1846, -1745, 781 }, { 1846, -1750, 774 }, { 1846, -1755, 768 }, + { 1845, -1760, 761 }, { 1845, -1765, 755 }, { 1845, -1771, 748 }, { 1845, -1776, 742 }, { 1844, -1782, 737 }, + { 1844, -1787, 731 }, { 1844, -1793, 725 }, { 1844, -1799, 720 }, { 1844, -1804, 715 }, { 1843, -1810, 711 }, + { 1843, -1816, 706 }, { 1843, -1822, 703 }, { 1843, -1827, 699 }, { 1843, -1833, 696 }, { 1843, -1839, 693 }, + { 1843, -1845, 690 }, { 1843, -1852, 687 }, { 1843, -1859, 685 }, { 1843, -1866, 683 }, { 1843, -1873, 682 }, + { 1843, -1880, 681 }, { 1843, -1887, 681 }, { 1843, -1894, 681 }, { 1844, -1901, 682 }, { 1844, -1907, 684 }, + { 1844, -1912, 687 }, { 1844, -1917, 691 }, { 1844, -1921, 697 }, { 1844, -1924, 703 }, { 1844, -1927, 712 }, + { 1843, -1927, 726 }, { 1843, -1927, 744 }, { 1843, -1926, 763 }, { 1842, -1923, 784 }, { 1842, -1920, 805 }, + { 1842, -1917, 825 }, { 1842, -1913, 843 }, { 1841, -1909, 857 }, { 1841, -1906, 868 }, { 1841, -1902, 874 }, + { 1841, -1897, 878 }, { 1841, -1891, 880 }, { 1841, -1886, 881 }, { 1842, -1880, 881 }, { 1842, -1873, 879 }, + { 1842, -1867, 877 }, { 1842, -1861, 875 }, { 1842, -1856, 873 }, { 1842, -1851, 871 }, { 1843, -1846, 869 }, + { 1843, -1842, 869 }, { 1843, -1840, 869 }, { 1843, -1841, 869 }, { 1843, -1842, 869 }, { 1843, -1844, 869 }, + { 1843, -1846, 869 }, { 1843, -1845, 869 }, { 1843, -1842, 869 }, { 1843, -1834, 869 }, { 1843, -1822, 870 }, + { 1843, -1807, 870 }, { 1843, -1794, 871 }, { 1843, -1785, 871 }, { 1843, -1785, 870 }, { 1843, -1790, 869 }, + { 1843, -1796, 868 }, { 1843, -1804, 867 }, { 1842, -1813, 867 }, { 1842, -1822, 866 }, { 1842, -1832, 866 }, + { 1842, -1843, 866 }, { 1841, -1854, 865 }, { 1841, -1865, 864 }, { 1841, -1877, 863 }, { 1841, -1888, 862 }, + { 1840, -1899, 860 }, { 1840, -1909, 858 }, { 1839, -1919, 855 }, { 1838, -1928, 852 }, { 1838, -1936, 849 }, + { 1837, -1943, 844 }, { 1836, -1949, 839 }, { 1834, -1950, 829 }, { 1831, -1943, 811 }, { 1827, -1933, 789 }, + { 1823, -1922, 767 }, { 1820, -1912, 749 }, { 1818, -1907, 739 }, { 1818, -1905, 735 }, { 1817, -1905, 731 }, + { 1817, -1905, 728 }, { 1816, -1906, 725 }, { 1816, -1908, 724 }, { 1816, -1910, 723 }, { 1816, -1912, 722 }, + { 1816, -1913, 723 }, { 1816, -1915, 724 }, { 1817, -1915, 726 }, { 1817, -1915, 728 }, { 1817, -1914, 731 }, + { 1818, -1911, 735 }, { 1818, -1907, 739 }, { 1819, -1900, 745 }, { 1820, -1891, 754 }, { 1821, -1880, 764 }, + { 1822, -1867, 776 }, { 1823, -1853, 788 }, { 1825, -1839, 801 }, { 1826, -1825, 814 }, { 1827, -1811, 826 }, + { 1829, -1799, 837 }, { 1830, -1789, 847 }, { 1830, -1781, 854 }, { 1831, -1775, 860 }, { 1831, -1772, 865 }, + { 1831, -1770, 869 }, { 1832, -1770, 871 }, { 1831, -1772, 871 }, { 1831, -1774, 869 }, { 1831, -1777, 863 }, + { 1830, -1781, 854 }, { 1829, -1786, 836 }, { 1828, -1796, 808 }, { 1826, -1806, 775 }, { 1825, -1817, 742 }, + { 1823, -1826, 716 }, { 1822, -1831, 700 }, { 1822, -1833, 693 }, { 1822, -1834, 689 }, { 1822, -1835, 687 }, + { 1822, -1835, 687 }, { 1822, -1834, 689 }, { 1822, -1833, 692 }, { 1822, -1832, 695 }, { 1822, -1831, 698 }, + { 1822, -1830, 700 }, { 1822, -1830, 702 }, { 1822, -1830, 702 }, { 1822, -1831, 700 }, { 1821, -1841, 671 }, + { 1821, -1848, 656 }, { 1824, -1839, 699 }, { 1829, -1825, 762 }, { 1833, -1812, 821 }, { 1836, -1803, 855 }, + { 1837, -1799, 867 }, { 1838, -1796, 875 }, { 1839, -1792, 881 }, { 1840, -1789, 884 }, { 1841, -1787, 885 }, + { 1841, -1785, 884 }, { 1842, -1783, 883 }, { 1842, -1782, 881 }, { 1842, -1781, 878 }, { 1843, -1782, 877 }, + { 1843, -1783, 876 }, { 1843, -1784, 876 }, { 1843, -1787, 877 }, { 1844, -1792, 878 }, { 1844, -1797, 878 }, + { 1844, -1803, 879 }, { 1844, -1810, 879 }, { 1844, -1817, 880 }, { 1844, -1824, 880 }, { 1844, -1831, 880 }, + { 1844, -1838, 881 }, { 1843, -1845, 881 }, { 1843, -1850, 881 }, { 1843, -1855, 881 }, { 1843, -1859, 881 }, + { 1843, -1861, 882 }, { 1844, -1863, 884 }, { 1844, -1863, 886 }, { 1844, -1864, 889 }, { 1844, -1864, 891 }, + { 1845, -1863, 894 }, { 1845, -1862, 896 }, { 1845, -1861, 897 }, { 1845, -1860, 897 }, { 1845, -1859, 896 }, + { 1845, -1859, 893 }, { 1844, -1858, 888 }, { 1843, -1859, 881 }, { 1842, -1859, 871 }, { 1840, -1860, 854 }, + { 1838, -1862, 835 }, { 1835, -1863, 812 }, { 1833, -1865, 788 }, { 1830, -1866, 765 }, { 1828, -1868, 742 }, + { 1825, -1869, 722 }, { 1823, -1870, 706 }, { 1822, -1870, 696 }, { 1822, -1870, 691 }, { 1822, -1869, 692 }, + { 1822, -1868, 695 }, { 1823, -1867, 699 }, { 1823, -1866, 705 }, { 1824, -1865, 713 }, { 1825, -1863, 722 }, + { 1826, -1862, 732 }, { 1828, -1860, 742 }, { 1829, -1858, 754 }, { 1830, -1856, 766 }, { 1832, -1855, 778 }, + { 1833, -1853, 790 }, { 1834, -1851, 802 }, { 1836, -1850, 813 }, { 1837, -1848, 824 }, { 1838, -1847, 834 }, + { 1839, -1846, 844 }, { 1840, -1844, 852 }, { 1841, -1843, 858 }, { 1841, -1843, 863 }, { 1842, -1842, 867 }, + { 1842, -1842, 870 }, { 1843, -1841, 873 }, { 1843, -1841, 876 }, { 1843, -1841, 878 }, { 1843, -1840, 880 }, + { 1843, -1840, 881 }, { 1844, -1840, 882 }, { 1844, -1840, 883 }, { 1844, -1840, 884 }, { 1844, -1840, 884 }, + { 1844, -1840, 885 }, { 1844, -1840, 885 }, { 1844, -1840, 885 }, { 1844, -1840, 885 }, { 1844, -1840, 884 }, + { 1843, -1840, 884 }, { 1843, -1840, 883 }, { 1843, -1840, 883 }, { 1843, -1841, 882 }, { 1843, -1841, 882 }, + { 1843, -1841, 881 }, { 1843, -1841, 881 }, { 1843, -1841, 880 }, { 1843, -1841, 880 }, { 1843, -1841, 880 }, + { 1843, -1841, 880 }, { 1843, -1841, 879 }, { 1843, -1841, 878 }, { 1843, -1841, 876 }, { 1842, -1842, 873 }, + { 1842, -1842, 871 }, { 1842, -1842, 868 }, { 1842, -1842, 866 }, { 1842, -1843, 864 }, { 1841, -1843, 863 }, + { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 861 }, { 1841, -1843, 861 }, + { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, { 1841, -1843, 862 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1843, 863 }, { 1841, -1843, 863 }, { 1841, -1844, 863 }, { 1841, -1844, 864 }, { 1841, -1844, 864 }, + { 1841, -1844, 864 }, { 1841, -1844, 864 }, { 1841, -1845, 864 }, { 1841, -1845, 865 }, { 1841, -1845, 865 }, + { 1841, -1845, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, + { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1846, 865 }, { 1841, -1845, 865 }, + { 1841, -1845, 865 }, { 1841, -1845, 864 }, { 1841, -1844, 864 }, { 1841, -1843, 863 }, { 1841, -1843, 863 }, + { 1841, -1842, 862 }, { 1842, -1841, 862 }, { 1842, -1840, 861 }, { 1842, -1839, 861 }, { 1842, -1838, 860 }, + { 1842, -1837, 859 }, { 1842, -1836, 858 }, { 1842, -1835, 858 }, { 1842, -1834, 857 }, { 1842, -1833, 856 }, + { 1842, -1832, 855 }, { 1842, -1830, 854 }, { 1842, -1829, 853 }, { 1842, -1828, 852 }, { 1842, -1826, 851 }, + { 1842, -1825, 850 }, { 1842, -1824, 849 }, { 1843, -1822, 849 }, { 1843, -1821, 848 }, { 1843, -1820, 847 }, + { 1843, -1818, 846 }, { 1843, -1817, 845 }, { 1843, -1815, 844 }, { 1843, -1814, 843 }, { 1843, -1813, 842 }, + { 1843, -1811, 841 }, { 1843, -1810, 840 }, { 1843, -1808, 839 }, { 1843, -1807, 838 }, { 1843, -1806, 837 }, + { 1843, -1804, 836 }, { 1844, -1803, 835 }, { 1844, -1802, 834 }, { 1844, -1800, 833 }, { 1844, -1799, 832 }, + { 1844, -1798, 831 }, { 1844, -1797, 830 }, { 1844, -1795, 829 }, { 1844, -1794, 829 }, { 1844, -1793, 828 }, + { 1844, -1792, 827 }, { 1844, -1791, 826 }, { 1844, -1790, 826 }, { 1844, -1789, 825 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, { 1844, -1787, 823 }, { 1844, -1786, 823 }, { 1844, -1786, 822 }, { 1844, -1785, 822 }, + { 1844, -1785, 821 }, { 1844, -1784, 821 }, { 1844, -1784, 821 }, { 1844, -1784, 821 }, { 1844, -1784, 820 }, + { 1844, -1784, 820 }, { 1844, -1784, 820 }, { 1844, -1784, 821 }, { 1844, -1784, 821 }, { 1844, -1785, 821 }, + { 1844, -1785, 821 }, { 1844, -1786, 822 }, { 1844, -1787, 823 }, { 1844, -1787, 823 }, { 1844, -1788, 824 }, + { 1844, -1790, 826 }, { 1845, -1792, 828 }, { 1845, -1795, 831 }, { 1845, -1798, 834 }, { 1845, -1802, 837 }, + { 1845, -1805, 841 }, { 1845, -1809, 844 }, { 1846, -1812, 848 }, { 1846, -1815, 851 }, { 1846, -1818, 853 }, + { 1846, -1819, 855 }, { 1846, -1820, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1822, 857 }, + { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, + { 1846, -1823, 858 }, { 1846, -1823, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1824, 859 }, + { 1846, -1824, 859 }, { 1846, -1824, 859 }, { 1846, -1823, 859 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, + { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1823, 858 }, { 1846, -1822, 858 }, + { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, { 1846, -1822, 857 }, + { 1846, -1822, 857 }, { 1846, -1821, 857 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, + { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, { 1846, -1821, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, + { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1820, 856 }, { 1846, -1821, 856 }, { 1846, -1820, 856 }, + { 1846, -1817, 853 }, { 1846, -1814, 849 }, { 1845, -1810, 845 }, { 1845, -1805, 841 }, { 1845, -1801, 837 }, + { 1845, -1797, 833 }, { 1845, -1794, 829 }, { 1844, -1791, 827 }, { 1844, -1789, 825 }, { 1844, -1788, 824 }, }; static s16 animdata_mario_eye_right_2[][3] = { - { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1711, 853 }, - { 1841, -1710, 853 }, { 1841, -1710, 853 }, { 1841, -1709, 853 }, { 1841, -1708, 853 }, - { 1841, -1707, 853 }, { 1841, -1706, 853 }, { 1841, -1705, 853 }, { 1841, -1705, 853 }, - { 1841, -1704, 853 }, { 1841, -1703, 853 }, { 1841, -1702, 852 }, { 1841, -1701, 852 }, - { 1841, -1701, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, - { 1841, -1699, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, - { 1841, -1701, 852 }, { 1841, -1702, 852 }, { 1841, -1703, 853 }, { 1841, -1705, 853 }, - { 1841, -1707, 853 }, { 1841, -1709, 853 }, { 1841, -1711, 853 }, { 1841, -1721, 854 }, - { 1841, -1739, 855 }, { 1841, -1762, 857 }, { 1841, -1785, 858 }, { 1841, -1802, 860 }, - { 1840, -1809, 860 }, { 1841, -1804, 860 }, { 1841, -1793, 859 }, { 1841, -1778, 858 }, - { 1841, -1760, 857 }, { 1841, -1742, 855 }, { 1841, -1727, 854 }, { 1841, -1716, 853 }, - { 1841, -1711, 853 }, { 1841, -1726, 852 }, { 1840, -1762, 848 }, { 1839, -1804, 843 }, - { 1839, -1839, 837 }, { 1838, -1853, 833 }, { 1838, -1842, 830 }, { 1838, -1814, 827 }, - { 1838, -1778, 824 }, { 1839, -1743, 822 }, { 1839, -1715, 820 }, { 1839, -1702, 819 }, - { 1839, -1708, 820 }, { 1839, -1727, 821 }, { 1840, -1753, 823 }, { 1840, -1782, 825 }, - { 1840, -1811, 827 }, { 1840, -1834, 828 }, { 1840, -1837, 828 }, { 1840, -1818, 833 }, - { 1841, -1795, 838 }, { 1841, -1771, 844 }, { 1842, -1749, 849 }, { 1842, -1733, 853 }, - { 1842, -1726, 855 }, { 1842, -1724, 855 }, { 1842, -1723, 855 }, { 1842, -1721, 856 }, - { 1842, -1720, 856 }, { 1843, -1719, 856 }, { 1843, -1717, 857 }, { 1843, -1716, 857 }, - { 1843, -1715, 857 }, { 1843, -1714, 858 }, { 1843, -1713, 858 }, { 1843, -1713, 858 }, - { 1843, -1712, 858 }, { 1843, -1711, 858 }, { 1843, -1711, 859 }, { 1843, -1710, 859 }, - { 1843, -1710, 859 }, { 1843, -1709, 859 }, { 1843, -1709, 859 }, { 1843, -1708, 859 }, - { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, - { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, - { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1842, -1708, 860 }, { 1842, -1709, 860 }, - { 1842, -1709, 860 }, { 1842, -1709, 860 }, { 1842, -1709, 860 }, { 1842, -1710, 860 }, - { 1842, -1710, 860 }, { 1842, -1711, 860 }, { 1842, -1711, 860 }, { 1842, -1712, 859 }, - { 1842, -1712, 859 }, { 1842, -1713, 859 }, { 1842, -1713, 859 }, { 1842, -1714, 859 }, - { 1842, -1715, 859 }, { 1842, -1715, 859 }, { 1842, -1716, 858 }, { 1842, -1716, 858 }, - { 1842, -1717, 858 }, { 1842, -1718, 858 }, { 1842, -1718, 858 }, { 1842, -1719, 857 }, - { 1842, -1720, 857 }, { 1842, -1721, 857 }, { 1842, -1721, 857 }, { 1842, -1722, 856 }, - { 1842, -1723, 856 }, { 1842, -1723, 856 }, { 1842, -1724, 856 }, { 1842, -1725, 855 }, - { 1842, -1725, 855 }, { 1842, -1726, 855 }, { 1842, -1727, 854 }, { 1842, -1728, 854 }, - { 1842, -1729, 853 }, { 1842, -1730, 853 }, { 1843, -1732, 852 }, { 1843, -1733, 851 }, - { 1843, -1735, 850 }, { 1843, -1737, 849 }, { 1843, -1739, 848 }, { 1843, -1741, 847 }, - { 1843, -1743, 846 }, { 1843, -1746, 845 }, { 1843, -1748, 844 }, { 1843, -1750, 843 }, - { 1843, -1753, 842 }, { 1843, -1755, 840 }, { 1843, -1758, 839 }, { 1843, -1760, 838 }, - { 1844, -1762, 837 }, { 1844, -1765, 836 }, { 1844, -1767, 835 }, { 1844, -1770, 833 }, - { 1844, -1772, 832 }, { 1844, -1774, 831 }, { 1844, -1776, 830 }, { 1844, -1778, 829 }, - { 1844, -1780, 829 }, { 1844, -1781, 828 }, { 1844, -1783, 827 }, { 1844, -1784, 826 }, - { 1844, -1785, 826 }, { 1844, -1786, 825 }, { 1844, -1787, 825 }, { 1844, -1788, 825 }, - { 1844, -1788, 824 }, { 1844, -1788, 824 }, + { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1711, 853 }, { 1841, -1710, 853 }, + { 1841, -1710, 853 }, { 1841, -1709, 853 }, { 1841, -1708, 853 }, { 1841, -1707, 853 }, { 1841, -1706, 853 }, + { 1841, -1705, 853 }, { 1841, -1705, 853 }, { 1841, -1704, 853 }, { 1841, -1703, 853 }, { 1841, -1702, 852 }, + { 1841, -1701, 852 }, { 1841, -1701, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, + { 1841, -1699, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1700, 852 }, { 1841, -1701, 852 }, + { 1841, -1702, 852 }, { 1841, -1703, 853 }, { 1841, -1705, 853 }, { 1841, -1707, 853 }, { 1841, -1709, 853 }, + { 1841, -1711, 853 }, { 1841, -1721, 854 }, { 1841, -1739, 855 }, { 1841, -1762, 857 }, { 1841, -1785, 858 }, + { 1841, -1802, 860 }, { 1840, -1809, 860 }, { 1841, -1804, 860 }, { 1841, -1793, 859 }, { 1841, -1778, 858 }, + { 1841, -1760, 857 }, { 1841, -1742, 855 }, { 1841, -1727, 854 }, { 1841, -1716, 853 }, { 1841, -1711, 853 }, + { 1841, -1726, 852 }, { 1840, -1762, 848 }, { 1839, -1804, 843 }, { 1839, -1839, 837 }, { 1838, -1853, 833 }, + { 1838, -1842, 830 }, { 1838, -1814, 827 }, { 1838, -1778, 824 }, { 1839, -1743, 822 }, { 1839, -1715, 820 }, + { 1839, -1702, 819 }, { 1839, -1708, 820 }, { 1839, -1727, 821 }, { 1840, -1753, 823 }, { 1840, -1782, 825 }, + { 1840, -1811, 827 }, { 1840, -1834, 828 }, { 1840, -1837, 828 }, { 1840, -1818, 833 }, { 1841, -1795, 838 }, + { 1841, -1771, 844 }, { 1842, -1749, 849 }, { 1842, -1733, 853 }, { 1842, -1726, 855 }, { 1842, -1724, 855 }, + { 1842, -1723, 855 }, { 1842, -1721, 856 }, { 1842, -1720, 856 }, { 1843, -1719, 856 }, { 1843, -1717, 857 }, + { 1843, -1716, 857 }, { 1843, -1715, 857 }, { 1843, -1714, 858 }, { 1843, -1713, 858 }, { 1843, -1713, 858 }, + { 1843, -1712, 858 }, { 1843, -1711, 858 }, { 1843, -1711, 859 }, { 1843, -1710, 859 }, { 1843, -1710, 859 }, + { 1843, -1709, 859 }, { 1843, -1709, 859 }, { 1843, -1708, 859 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, + { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, + { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1843, -1708, 860 }, { 1842, -1708, 860 }, { 1842, -1709, 860 }, + { 1842, -1709, 860 }, { 1842, -1709, 860 }, { 1842, -1709, 860 }, { 1842, -1710, 860 }, { 1842, -1710, 860 }, + { 1842, -1711, 860 }, { 1842, -1711, 860 }, { 1842, -1712, 859 }, { 1842, -1712, 859 }, { 1842, -1713, 859 }, + { 1842, -1713, 859 }, { 1842, -1714, 859 }, { 1842, -1715, 859 }, { 1842, -1715, 859 }, { 1842, -1716, 858 }, + { 1842, -1716, 858 }, { 1842, -1717, 858 }, { 1842, -1718, 858 }, { 1842, -1718, 858 }, { 1842, -1719, 857 }, + { 1842, -1720, 857 }, { 1842, -1721, 857 }, { 1842, -1721, 857 }, { 1842, -1722, 856 }, { 1842, -1723, 856 }, + { 1842, -1723, 856 }, { 1842, -1724, 856 }, { 1842, -1725, 855 }, { 1842, -1725, 855 }, { 1842, -1726, 855 }, + { 1842, -1727, 854 }, { 1842, -1728, 854 }, { 1842, -1729, 853 }, { 1842, -1730, 853 }, { 1843, -1732, 852 }, + { 1843, -1733, 851 }, { 1843, -1735, 850 }, { 1843, -1737, 849 }, { 1843, -1739, 848 }, { 1843, -1741, 847 }, + { 1843, -1743, 846 }, { 1843, -1746, 845 }, { 1843, -1748, 844 }, { 1843, -1750, 843 }, { 1843, -1753, 842 }, + { 1843, -1755, 840 }, { 1843, -1758, 839 }, { 1843, -1760, 838 }, { 1844, -1762, 837 }, { 1844, -1765, 836 }, + { 1844, -1767, 835 }, { 1844, -1770, 833 }, { 1844, -1772, 832 }, { 1844, -1774, 831 }, { 1844, -1776, 830 }, + { 1844, -1778, 829 }, { 1844, -1780, 829 }, { 1844, -1781, 828 }, { 1844, -1783, 827 }, { 1844, -1784, 826 }, + { 1844, -1785, 826 }, { 1844, -1786, 825 }, { 1844, -1787, 825 }, { 1844, -1788, 825 }, { 1844, -1788, 824 }, + { 1844, -1788, 824 }, }; struct AnimDataInfo anim_mario_eye_right[] = { @@ -1567,34 +1427,30 @@ static s16 animdata_mario_cap_1[][3] = { }; static s16 animdata_mario_cap_2[][3] = { - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1538 }, { 0, 0, 1538 }, { 0, 0, 1538 }, - { 0, 0, 1537 }, { 0, 0, 1537 }, { 0, 0, 1536 }, { 0, 0, 1536 }, { 0, 0, 1535 }, { 0, 0, 1535 }, - { 0, 0, 1535 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, - { 0, 0, 1534 }, { 0, 0, 1535 }, { 0, 0, 1536 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1539 }, - { 0, 0, 1544 }, { 0, 0, 1554 }, { 0, 0, 1566 }, { 0, 0, 1575 }, { 0, 0, 1579 }, { 0, 0, 1579 }, - { 0, 0, 1577 }, { 0, 0, 1575 }, { 0, 0, 1573 }, { 0, 0, 1570 }, { 0, 0, 1566 }, { 0, 0, 1563 }, - { 0, 0, 1559 }, { 0, 0, 1555 }, { 0, 0, 1552 }, { 0, 0, 1548 }, { 0, 0, 1545 }, { 0, 0, 1543 }, - { 0, 0, 1541 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, - { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1538 }, { 0, 0, 1538 }, { 0, 0, 1538 }, { 0, 0, 1537 }, + { 0, 0, 1537 }, { 0, 0, 1536 }, { 0, 0, 1536 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1534 }, + { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1534 }, { 0, 0, 1535 }, { 0, 0, 1536 }, + { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1539 }, { 0, 0, 1544 }, { 0, 0, 1554 }, { 0, 0, 1566 }, { 0, 0, 1575 }, + { 0, 0, 1579 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1575 }, { 0, 0, 1573 }, { 0, 0, 1570 }, { 0, 0, 1566 }, + { 0, 0, 1563 }, { 0, 0, 1559 }, { 0, 0, 1555 }, { 0, 0, 1552 }, { 0, 0, 1548 }, { 0, 0, 1545 }, { 0, 0, 1543 }, + { 0, 0, 1541 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, + { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, { 0, 0, 1539 }, }; struct AnimDataInfo anim_mario_cap[] = { @@ -1604,256 +1460,207 @@ struct AnimDataInfo anim_mario_cap[] = { }; static s16 animdata_mario_lips_3_1[][3] = { - { 0, 0, -665 }, { 0, 0, -664 }, { 0, 0, -662 }, { 0, 0, -660 }, - { -1, 0, -656 }, { -1, 0, -652 }, { -2, 0, -648 }, { -3, 1, -643 }, - { -3, 1, -638 }, { -4, 1, -634 }, { -5, 2, -629 }, { -5, 2, -625 }, - { -6, 2, -622 }, { -6, 2, -620 }, { -7, 2, -618 }, { -7, 2, -618 }, - { -6, 2, -619 }, { -6, 2, -622 }, { -5, 2, -626 }, { -4, 1, -633 }, - { -3, 1, -641 }, { -1, 0, -652 }, { 0, 0, -665 }, { 6, -1, -704 }, - { 17, -5, -781 }, { 32, -10, -874 }, { 46, -14, -966 }, { 57, -19, -1036 }, - { 63, -22, -1064 }, { 64, -25, -1061 }, { 64, -27, -1052 }, { 64, -30, -1038 }, - { 64, -33, -1019 }, { 62, -36, -996 }, { 61, -39, -970 }, { 59, -42, -941 }, - { 57, -44, -911 }, { 54, -47, -879 }, { 52, -49, -847 }, { 49, -51, -816 }, - { 46, -53, -786 }, { 44, -55, -758 }, { 41, -56, -733 }, { 39, -57, -711 }, - { 37, -57, -693 }, { 35, -56, -681 }, { 33, -56, -671 }, { 32, -54, -664 }, - { 30, -53, -657 }, { 28, -50, -652 }, { 26, -48, -648 }, { 24, -45, -645 }, - { 22, -42, -643 }, { 20, -39, -642 }, { 18, -35, -642 }, { 16, -32, -642 }, - { 14, -28, -643 }, { 12, -25, -645 }, { 10, -21, -647 }, { 8, -18, -649 }, - { 7, -14, -651 }, { 5, -11, -653 }, { 4, -8, -656 }, { 3, -6, -658 }, - { 2, -4, -660 }, { 1, -2, -662 }, { 0, -1, -663 }, { 0, 0, -664 }, - { 0, 0, -665 }, { 0, -1, -664 }, { 0, -6, -662 }, { 1, -12, -660 }, - { 1, -21, -656 }, { 2, -31, -652 }, { 3, -42, -648 }, { 3, -54, -643 }, - { 4, -65, -639 }, { 5, -76, -635 }, { 6, -85, -631 }, { 6, -94, -628 }, - { 6, -100, -625 }, { 8, -104, -623 }, { 12, -107, -621 }, { 17, -108, -619 }, - { 21, -108, -618 }, { 23, -107, -617 }, { 22, -106, -618 }, { 17, -103, -621 }, - { 6, -100, -625 }, { -19, -93, -636 }, { -63, -83, -654 }, { -111, -71, -673 }, - { -153, -61, -690 }, { -174, -55, -699 }, { -182, -54, -701 }, { -188, -53, -704 }, - { -194, -52, -706 }, { -199, -52, -707 }, { -202, -53, -708 }, { -205, -53, -709 }, - { -207, -54, -709 }, { -208, -55, -709 }, { -209, -56, -709 }, { -208, -57, -708 }, - { -207, -58, -708 }, { -204, -59, -707 }, { -201, -60, -705 }, { -198, -60, -704 }, - { -193, -59, -703 }, { -188, -59, -701 }, { -181, -57, -700 }, { -174, -55, -699 }, - { -156, -50, -695 }, { -123, -39, -688 }, { -81, -26, -680 }, { -41, -13, -673 }, - { -11, -3, -667 }, { 0, 0, -665 }, { 0, 0, -665 }, { 10, 9, -656 }, - { 23, 20, -647 }, { 36, 32, -636 }, { 49, 44, -626 }, { 63, 57, -614 }, - { 78, 69, -603 }, { 92, 82, -592 }, { 105, 94, -582 }, { 118, 105, -572 }, - { 130, 116, -562 }, { 140, 125, -554 }, { 148, 132, -548 }, { 154, 138, -543 }, - { 159, 141, -540 }, { 160, 143, -539 }, { 160, 143, -539 }, { 159, 142, -539 }, - { 158, 141, -540 }, { 157, 140, -542 }, { 156, 139, -543 }, { 154, 137, -545 }, - { 151, 135, -548 }, { 149, 133, -550 }, { 146, 130, -553 }, { 143, 128, -556 }, - { 140, 125, -559 }, { 137, 122, -563 }, { 133, 118, -566 }, { 129, 115, -570 }, - { 125, 111, -574 }, { 121, 108, -578 }, { 117, 104, -582 }, { 112, 100, -587 }, - { 108, 95, -591 }, { 103, 91, -595 }, { 98, 87, -600 }, { 93, 82, -604 }, - { 88, 78, -609 }, { 83, 74, -613 }, { 78, 69, -617 }, { 73, 64, -622 }, - { 68, 60, -626 }, { 63, 55, -630 }, { 58, 51, -634 }, { 53, 46, -638 }, - { 48, 42, -641 }, { 43, 37, -645 }, { 38, 33, -648 }, { 33, 29, -651 }, - { 29, 25, -654 }, { 24, 21, -656 }, { 20, 17, -658 }, { 15, 13, -660 }, - { 11, 9, -662 }, { 7, 6, -663 }, { 3, 3, -664 }, { 0, 0, -665 }, - { -2, -1, -652 }, { -4, 0, -621 }, { -4, 0, -586 }, { -5, 2, -559 }, - { -4, 1, -555 }, { -4, 0, -574 }, { -4, -2, -607 }, { -3, -5, -648 }, - { -2, -8, -693 }, { -1, -11, -736 }, { 0, -14, -772 }, { 0, -16, -796 }, - { 1, -17, -802 }, { 1, -16, -797 }, { 1, -15, -788 }, { 0, -14, -777 }, - { 0, -12, -763 }, { 0, -10, -747 }, { 0, -7, -729 }, { -1, -4, -709 }, - { -1, -1, -689 }, { -2, 1, -667 }, { -2, 4, -644 }, { -3, 7, -621 }, - { -4, 10, -598 }, { -4, 13, -576 }, { -5, 15, -553 }, { -5, 17, -532 }, - { -5, 19, -512 }, { -5, 20, -493 }, { -5, 20, -476 }, { -5, 20, -461 }, - { -5, 19, -448 }, { -4, 17, -438 }, { -3, 14, -430 }, { -2, 10, -427 }, - { -1, 5, -426 }, { 0, 0, -430 }, { 7, -25, -482 }, { 22, -76, -602 }, - { 39, -136, -749 }, { 51, -188, -884 }, { 53, -217, -967 }, { 46, -222, -1002 }, - { 33, -219, -1021 }, { 18, -208, -1028 }, { 0, -194, -1026 }, { -17, -177, -1019 }, - { -34, -161, -1010 }, { -49, -147, -1004 }, { -60, -138, -1002 }, { -66, -133, -1005 }, - { -70, -130, -1007 }, { -72, -129, -1008 }, { -73, -128, -1008 }, { -72, -128, -1009 }, - { -72, -128, -1009 }, { -71, -129, -1009 }, { -71, -129, -1009 }, { -71, -129, -1009 }, - { -71, -129, -1009 }, { -70, -129, -1010 }, { -70, -129, -1010 }, { -69, -128, -1011 }, - { -69, -128, -1011 }, { -68, -128, -1012 }, { -67, -129, -1013 }, { -67, -129, -1013 }, - { -66, -129, -1014 }, { -65, -129, -1014 }, { -64, -129, -1014 }, { -64, -129, -1014 }, - { -63, -130, -1014 }, { -62, -130, -1014 }, { -62, -131, -1014 }, { -61, -131, -1013 }, - { -61, -132, -1013 }, { -60, -133, -1012 }, { -60, -134, -1010 }, { -60, -135, -1009 }, - { -59, -136, -1007 }, { -59, -137, -1005 }, { -60, -138, -1002 }, { -60, -140, -999 }, - { -60, -142, -995 }, { -61, -144, -991 }, { -62, -147, -986 }, { -63, -149, -980 }, - { -64, -152, -974 }, { -65, -155, -967 }, { -66, -159, -960 }, { -67, -162, -953 }, - { -68, -165, -946 }, { -70, -169, -939 }, { -71, -172, -932 }, { -72, -175, -925 }, - { -73, -178, -918 }, { -74, -181, -912 }, { -76, -184, -906 }, { -77, -187, -900 }, - { -77, -189, -895 }, { -78, -191, -891 }, { -79, -193, -887 }, { -79, -194, -884 }, - { -80, -196, -881 }, { -80, -197, -879 }, { -81, -198, -877 }, { -81, -199, -875 }, - { -81, -199, -873 }, { -81, -200, -873 }, { -81, -200, -872 }, { -81, -200, -872 }, - { -81, -200, -873 }, { -81, -199, -875 }, { -81, -198, -877 }, { -80, -197, -880 }, - { -80, -195, -883 }, { -79, -193, -887 }, { -78, -190, -894 }, { -76, -185, -903 }, - { -74, -179, -916 }, { -72, -173, -929 }, { -69, -166, -944 }, { -67, -159, -959 }, - { -65, -152, -973 }, { -62, -146, -985 }, { -61, -142, -995 }, { -60, -138, -1002 }, - { -59, -136, -1007 }, { -58, -135, -1010 }, { -58, -134, -1011 }, { -58, -134, -1012 }, - { -58, -134, -1011 }, { -58, -135, -1010 }, { -58, -135, -1009 }, { -59, -136, -1007 }, - { -59, -137, -1005 }, { -59, -138, -1004 }, { -59, -138, -1003 }, { -60, -138, -1002 }, - { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, - { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, - { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, - { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1003 }, - { -59, -138, -1003 }, { -59, -138, -1003 }, { -59, -138, -1003 }, { -59, -138, -1003 }, - { -59, -138, -1004 }, { -59, -139, -1004 }, { -59, -139, -1004 }, { -59, -139, -1005 }, - { -59, -139, -1005 }, { -59, -139, -1005 }, { -59, -139, -1006 }, { -59, -139, -1006 }, - { -59, -139, -1007 }, { -59, -139, -1007 }, { -58, -139, -1008 }, { -58, -139, -1008 }, - { -58, -139, -1008 }, { -58, -139, -1009 }, { -58, -139, -1009 }, { -58, -139, -1010 }, - { -58, -139, -1010 }, { -58, -140, -1011 }, { -58, -140, -1011 }, { -58, -140, -1011 }, - { -58, -140, -1012 }, { -58, -140, -1012 }, { -57, -140, -1012 }, { -57, -140, -1013 }, - { -57, -140, -1013 }, { -57, -140, -1013 }, { -57, -140, -1014 }, { -57, -140, -1014 }, - { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, - { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, - { -57, -140, -1014 }, { -57, -140, -1013 }, { -57, -140, -1013 }, { -57, -140, -1013 }, - { -58, -140, -1012 }, { -58, -140, -1012 }, { -58, -140, -1011 }, { -58, -139, -1010 }, - { -58, -139, -1010 }, { -58, -139, -1009 }, { -58, -139, -1008 }, { -59, -139, -1007 }, - { -59, -139, -1006 }, { -59, -139, -1005 }, { -59, -138, -1004 }, { -60, -138, -1002 }, - { -62, -136, -989 }, { -68, -132, -962 }, { -74, -128, -934 }, { -77, -125, -918 }, - { -78, -125, -915 }, { -78, -125, -914 }, { -78, -125, -915 }, { -77, -125, -918 }, - { -77, -126, -921 }, { -76, -126, -925 }, { -75, -127, -928 }, { -75, -127, -931 }, - { -74, -127, -932 }, { -75, -127, -930 }, { -76, -127, -926 }, { -77, -125, -918 }, - { -81, -122, -898 }, { -89, -117, -862 }, { -97, -111, -819 }, { -106, -105, -779 }, - { -112, -100, -750 }, { -114, -98, -742 }, { -113, -99, -751 }, { -110, -100, -768 }, - { -107, -102, -791 }, { -102, -105, -818 }, { -97, -108, -848 }, { -92, -111, -880 }, - { -86, -114, -911 }, { -81, -117, -940 }, { -77, -121, -966 }, { -74, -124, -987 }, - { -72, -126, -1002 }, { -71, -129, -1009 }, { -72, -131, -1011 }, { -72, -132, -1011 }, - { -73, -134, -1011 }, { -74, -136, -1011 }, { -76, -138, -1009 }, { -77, -140, -1007 }, - { -79, -142, -1004 }, { -80, -143, -1000 }, { -82, -145, -996 }, { -84, -147, -991 }, - { -86, -148, -986 }, { -88, -150, -980 }, { -90, -152, -974 }, { -93, -154, -968 }, - { -95, -155, -961 }, { -97, -157, -954 }, { -100, -158, -947 }, { -102, -160, -940 }, - { -104, -162, -933 }, { -107, -163, -925 }, { -109, -165, -918 }, { -111, -167, -911 }, - { -113, -169, -904 }, { -115, -170, -897 }, { -117, -172, -891 }, { -119, -174, -884 }, - { -121, -175, -878 }, { -123, -177, -873 }, { -124, -179, -868 }, { -126, -181, -863 }, - { -127, -183, -859 }, { -128, -185, -855 }, { -129, -187, -852 }, { -129, -189, -850 }, - { -130, -191, -849 }, { -130, -193, -848 }, { -130, -195, -847 }, { -130, -197, -847 }, - { -130, -200, -846 }, { -130, -203, -846 }, { -130, -205, -847 }, { -129, -208, -847 }, - { -129, -211, -848 }, { -128, -214, -849 }, { -128, -217, -850 }, { -127, -221, -851 }, - { -126, -224, -852 }, { -126, -227, -854 }, { -125, -230, -856 }, { -124, -234, -857 }, - { -123, -237, -859 }, { -122, -240, -861 }, { -121, -243, -864 }, { -120, -247, -866 }, - { -119, -250, -868 }, { -118, -253, -871 }, { -116, -256, -873 }, { -115, -259, -876 }, - { -114, -262, -878 }, { -113, -265, -881 }, { -111, -267, -884 }, { -110, -270, -887 }, - { -109, -272, -889 }, { -108, -274, -892 }, { -106, -277, -895 }, { -105, -278, -898 }, - { -104, -280, -900 }, { -103, -282, -903 }, { -102, -283, -905 }, { -100, -284, -908 }, - { -99, -285, -910 }, { -98, -286, -913 }, { -97, -286, -915 }, { -96, -286, -917 }, - { -95, -286, -919 }, { -94, -286, -921 }, { -93, -285, -923 }, { -93, -282, -925 }, - { -92, -276, -928 }, { -90, -266, -932 }, { -89, -254, -935 }, { -88, -240, -939 }, - { -87, -225, -942 }, { -86, -210, -945 }, { -85, -194, -948 }, { -85, -180, -950 }, - { -84, -167, -951 }, { -84, -156, -951 }, { -84, -148, -950 }, { -85, -144, -947 }, - { -90, -166, -926 }, { -100, -213, -890 }, { -105, -241, -868 }, { -107, -246, -864 }, - { -110, -250, -862 }, { -113, -252, -860 }, { -116, -253, -859 }, { -120, -253, -859 }, - { -123, -253, -859 }, { -125, -252, -860 }, { -127, -250, -862 }, { -128, -248, -863 }, - { -127, -246, -865 }, { -125, -244, -866 }, { -121, -243, -867 }, { -114, -242, -868 }, - { -105, -241, -868 }, { -93, -241, -868 }, { -75, -241, -868 }, { -55, -241, -868 }, - { -31, -241, -868 }, { -5, -241, -868 }, { 21, -241, -868 }, { 48, -241, -868 }, - { 75, -241, -868 }, { 102, -241, -868 }, { 126, -241, -868 }, { 147, -241, -868 }, - { 166, -241, -868 }, { 179, -241, -868 }, { 188, -241, -868 }, { 192, -241, -868 }, - { 187, -241, -868 }, { 175, -241, -868 }, { 156, -241, -868 }, { 133, -241, -868 }, - { 105, -241, -868 }, { 74, -241, -868 }, { 43, -241, -868 }, { 11, -241, -868 }, - { -18, -241, -868 }, { -46, -241, -868 }, { -70, -241, -868 }, { -89, -241, -868 }, - { -101, -241, -868 }, { -105, -241, -868 }, { -102, -241, -868 }, { -91, -241, -868 }, - { -74, -241, -868 }, { -53, -241, -868 }, { -28, -241, -868 }, { 0, -241, -868 }, - { 28, -241, -868 }, { 57, -241, -868 }, { 87, -241, -868 }, { 114, -241, -868 }, - { 139, -241, -868 }, { 161, -241, -868 }, { 177, -241, -868 }, { 188, -241, -868 }, - { 192, -241, -868 }, { 187, -241, -868 }, { 175, -241, -868 }, { 156, -241, -868 }, - { 133, -241, -868 }, { 105, -241, -868 }, { 74, -241, -868 }, { 43, -241, -868 }, - { 11, -241, -868 }, { -18, -241, -868 }, { -46, -241, -868 }, { -70, -241, -868 }, - { -89, -241, -868 }, { -101, -241, -868 }, { -105, -241, -868 }, { -100, -241, -868 }, - { -86, -241, -868 }, { -65, -241, -868 }, { -38, -241, -868 }, { -7, -241, -868 }, - { 25, -241, -868 }, { 60, -241, -868 }, { 93, -241, -868 }, { 124, -241, -868 }, - { 151, -241, -868 }, { 173, -241, -868 }, { 187, -241, -868 }, { 192, -241, -868 }, - { 188, -242, -869 }, { 178, -242, -869 }, { 162, -243, -870 }, { 142, -245, -871 }, - { 118, -246, -872 }, { 91, -247, -873 }, { 63, -248, -874 }, { 34, -250, -875 }, - { 5, -250, -876 }, { -21, -250, -876 }, { -46, -250, -876 }, { -68, -249, -875 }, - { -86, -248, -874 }, { -99, -245, -871 }, { -105, -241, -868 }, { -108, -237, -865 }, - { -111, -233, -861 }, { -113, -229, -858 }, { -114, -224, -854 }, { -115, -219, -850 }, - { -116, -214, -845 }, { -116, -209, -841 }, { -116, -204, -837 }, { -115, -198, -832 }, - { -114, -193, -828 }, { -113, -187, -823 }, { -111, -182, -818 }, { -109, -176, -813 }, - { -107, -170, -808 }, { -105, -164, -803 }, { -102, -158, -798 }, { -99, -152, -793 }, - { -96, -146, -788 }, { -92, -140, -783 }, { -89, -134, -778 }, { -85, -128, -773 }, - { -81, -122, -768 }, { -78, -116, -762 }, { -73, -110, -757 }, { -69, -103, -752 }, - { -65, -97, -747 }, { -61, -91, -742 }, { -57, -85, -737 }, { -53, -79, -732 }, - { -48, -74, -727 }, { -44, -68, -722 }, { -40, -62, -717 }, { -36, -57, -713 }, - { -32, -51, -708 }, { -28, -46, -703 }, { -24, -40, -699 }, { -21, -35, -695 }, - { -17, -30, -690 }, { -14, -25, -686 }, { -11, -21, -682 }, { -8, -16, -678 }, - { -6, -12, -675 }, { -3, -7, -671 }, { -1, -3, -668 }, { 0, 0, -665 }, - { 1, 3, -662 }, { 2, 7, -659 }, { 3, 10, -656 }, { 4, 13, -654 }, - { 4, 15, -653 }, { 4, 18, -651 }, { 4, 20, -650 }, { 3, 21, -649 }, - { 3, 22, -648 }, { 2, 23, -648 }, { 2, 23, -648 }, { 1, 23, -649 }, - { 1, 22, -649 }, { 0, 21, -650 }, { 0, 19, -652 }, { 0, 16, -654 }, - { 0, 13, -656 }, { 0, 9, -658 }, { 0, 5, -661 }, { 0, 0, -665 }, - { 0, -7, -669 }, { 2, -16, -677 }, { 3, -29, -686 }, { 5, -43, -697 }, - { 6, -59, -709 }, { 8, -76, -721 }, { 10, -95, -733 }, { 12, -114, -745 }, - { 14, -134, -756 }, { 15, -155, -765 }, { 17, -175, -772 }, { 18, -198, -778 }, - { 19, -227, -782 }, { 20, -259, -786 }, { 22, -292, -788 }, { 22, -324, -790 }, - { 23, -353, -790 }, { 24, -376, -790 }, { 24, -392, -789 }, { 23, -398, -788 }, - { 22, -398, -785 }, { 21, -396, -782 }, { 20, -394, -779 }, { 19, -390, -775 }, - { 18, -385, -771 }, { 16, -379, -766 }, { 14, -373, -762 }, { 13, -365, -757 }, - { 11, -357, -752 }, { 9, -348, -747 }, { 7, -339, -741 }, { 6, -330, -736 }, - { 4, -319, -731 }, { 2, -309, -726 }, { 1, -299, -722 }, { 0, -288, -717 }, - { -1, -277, -713 }, { -3, -266, -709 }, { -4, -256, -706 }, { -5, -246, -703 }, - { -6, -235, -701 }, { -6, -226, -699 }, { -7, -217, -698 }, { -7, -208, -698 }, - { -7, -200, -698 }, { -6, -192, -700 }, { -4, -185, -705 }, { 0, -179, -718 }, - { 7, -172, -735 }, { 15, -166, -756 }, { 23, -161, -778 }, { 31, -157, -800 }, - { 37, -154, -820 }, { 41, -153, -837 }, { 42, -154, -849 }, { 32, -164, -848 }, - { 11, -184, -836 }, { -9, -204, -820 }, { -23, -215, -809 }, { -24, -210, -806 }, - { -19, -196, -807 }, { -11, -181, -807 }, { -6, -171, -803 }, { -5, -169, -790 }, - { -4, -173, -770 }, { -5, -177, -753 }, { -5, -181, -736 }, { -6, -186, -719 }, - { -6, -191, -706 }, { -6, -192, -700 }, { -6, -193, -699 }, { -6, -193, -698 }, - { -6, -193, -697 }, { -6, -193, -697 }, { -6, -194, -696 }, { -6, -194, -696 }, - { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -694 }, { -7, -194, -694 }, - { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, - { -7, -194, -693 }, { -7, -195, -693 }, { -7, -195, -693 }, { -7, -195, -692 }, - { -7, -195, -693 }, { -7, -195, -693 }, { -7, -195, -693 }, { -7, -194, -693 }, - { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, - { -7, -194, -694 }, { -7, -194, -694 }, { -7, -194, -694 }, { -6, -194, -694 }, - { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -695 }, - { -6, -194, -696 }, { -6, -194, -696 }, { -6, -193, -696 }, { -6, -193, -697 }, - { -6, -193, -697 }, { -6, -193, -697 }, { -6, -193, -697 }, { -6, -193, -698 }, - { -6, -193, -698 }, { -6, -193, -698 }, { -6, -193, -698 }, { -6, -193, -699 }, - { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, - { -6, -193, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, - { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, - { -6, -196, -701 }, { -6, -192, -700 }, { -6, -174, -696 }, { -5, -152, -692 }, - { -4, -127, -688 }, { -3, -101, -683 }, { -2, -76, -679 }, { -1, -52, -674 }, - { 0, -31, -670 }, { 0, -14, -667 }, { 0, -3, -665 }, { 0, 0, -665 }, + { 0, 0, -665 }, { 0, 0, -664 }, { 0, 0, -662 }, { 0, 0, -660 }, { -1, 0, -656 }, + { -1, 0, -652 }, { -2, 0, -648 }, { -3, 1, -643 }, { -3, 1, -638 }, { -4, 1, -634 }, + { -5, 2, -629 }, { -5, 2, -625 }, { -6, 2, -622 }, { -6, 2, -620 }, { -7, 2, -618 }, + { -7, 2, -618 }, { -6, 2, -619 }, { -6, 2, -622 }, { -5, 2, -626 }, { -4, 1, -633 }, + { -3, 1, -641 }, { -1, 0, -652 }, { 0, 0, -665 }, { 6, -1, -704 }, { 17, -5, -781 }, + { 32, -10, -874 }, { 46, -14, -966 }, { 57, -19, -1036 }, { 63, -22, -1064 }, { 64, -25, -1061 }, + { 64, -27, -1052 }, { 64, -30, -1038 }, { 64, -33, -1019 }, { 62, -36, -996 }, { 61, -39, -970 }, + { 59, -42, -941 }, { 57, -44, -911 }, { 54, -47, -879 }, { 52, -49, -847 }, { 49, -51, -816 }, + { 46, -53, -786 }, { 44, -55, -758 }, { 41, -56, -733 }, { 39, -57, -711 }, { 37, -57, -693 }, + { 35, -56, -681 }, { 33, -56, -671 }, { 32, -54, -664 }, { 30, -53, -657 }, { 28, -50, -652 }, + { 26, -48, -648 }, { 24, -45, -645 }, { 22, -42, -643 }, { 20, -39, -642 }, { 18, -35, -642 }, + { 16, -32, -642 }, { 14, -28, -643 }, { 12, -25, -645 }, { 10, -21, -647 }, { 8, -18, -649 }, + { 7, -14, -651 }, { 5, -11, -653 }, { 4, -8, -656 }, { 3, -6, -658 }, { 2, -4, -660 }, + { 1, -2, -662 }, { 0, -1, -663 }, { 0, 0, -664 }, { 0, 0, -665 }, { 0, -1, -664 }, + { 0, -6, -662 }, { 1, -12, -660 }, { 1, -21, -656 }, { 2, -31, -652 }, { 3, -42, -648 }, + { 3, -54, -643 }, { 4, -65, -639 }, { 5, -76, -635 }, { 6, -85, -631 }, { 6, -94, -628 }, + { 6, -100, -625 }, { 8, -104, -623 }, { 12, -107, -621 }, { 17, -108, -619 }, { 21, -108, -618 }, + { 23, -107, -617 }, { 22, -106, -618 }, { 17, -103, -621 }, { 6, -100, -625 }, { -19, -93, -636 }, + { -63, -83, -654 }, { -111, -71, -673 }, { -153, -61, -690 }, { -174, -55, -699 }, { -182, -54, -701 }, + { -188, -53, -704 }, { -194, -52, -706 }, { -199, -52, -707 }, { -202, -53, -708 }, { -205, -53, -709 }, + { -207, -54, -709 }, { -208, -55, -709 }, { -209, -56, -709 }, { -208, -57, -708 }, { -207, -58, -708 }, + { -204, -59, -707 }, { -201, -60, -705 }, { -198, -60, -704 }, { -193, -59, -703 }, { -188, -59, -701 }, + { -181, -57, -700 }, { -174, -55, -699 }, { -156, -50, -695 }, { -123, -39, -688 }, { -81, -26, -680 }, + { -41, -13, -673 }, { -11, -3, -667 }, { 0, 0, -665 }, { 0, 0, -665 }, { 10, 9, -656 }, + { 23, 20, -647 }, { 36, 32, -636 }, { 49, 44, -626 }, { 63, 57, -614 }, { 78, 69, -603 }, + { 92, 82, -592 }, { 105, 94, -582 }, { 118, 105, -572 }, { 130, 116, -562 }, { 140, 125, -554 }, + { 148, 132, -548 }, { 154, 138, -543 }, { 159, 141, -540 }, { 160, 143, -539 }, { 160, 143, -539 }, + { 159, 142, -539 }, { 158, 141, -540 }, { 157, 140, -542 }, { 156, 139, -543 }, { 154, 137, -545 }, + { 151, 135, -548 }, { 149, 133, -550 }, { 146, 130, -553 }, { 143, 128, -556 }, { 140, 125, -559 }, + { 137, 122, -563 }, { 133, 118, -566 }, { 129, 115, -570 }, { 125, 111, -574 }, { 121, 108, -578 }, + { 117, 104, -582 }, { 112, 100, -587 }, { 108, 95, -591 }, { 103, 91, -595 }, { 98, 87, -600 }, + { 93, 82, -604 }, { 88, 78, -609 }, { 83, 74, -613 }, { 78, 69, -617 }, { 73, 64, -622 }, + { 68, 60, -626 }, { 63, 55, -630 }, { 58, 51, -634 }, { 53, 46, -638 }, { 48, 42, -641 }, + { 43, 37, -645 }, { 38, 33, -648 }, { 33, 29, -651 }, { 29, 25, -654 }, { 24, 21, -656 }, + { 20, 17, -658 }, { 15, 13, -660 }, { 11, 9, -662 }, { 7, 6, -663 }, { 3, 3, -664 }, + { 0, 0, -665 }, { -2, -1, -652 }, { -4, 0, -621 }, { -4, 0, -586 }, { -5, 2, -559 }, + { -4, 1, -555 }, { -4, 0, -574 }, { -4, -2, -607 }, { -3, -5, -648 }, { -2, -8, -693 }, + { -1, -11, -736 }, { 0, -14, -772 }, { 0, -16, -796 }, { 1, -17, -802 }, { 1, -16, -797 }, + { 1, -15, -788 }, { 0, -14, -777 }, { 0, -12, -763 }, { 0, -10, -747 }, { 0, -7, -729 }, + { -1, -4, -709 }, { -1, -1, -689 }, { -2, 1, -667 }, { -2, 4, -644 }, { -3, 7, -621 }, + { -4, 10, -598 }, { -4, 13, -576 }, { -5, 15, -553 }, { -5, 17, -532 }, { -5, 19, -512 }, + { -5, 20, -493 }, { -5, 20, -476 }, { -5, 20, -461 }, { -5, 19, -448 }, { -4, 17, -438 }, + { -3, 14, -430 }, { -2, 10, -427 }, { -1, 5, -426 }, { 0, 0, -430 }, { 7, -25, -482 }, + { 22, -76, -602 }, { 39, -136, -749 }, { 51, -188, -884 }, { 53, -217, -967 }, { 46, -222, -1002 }, + { 33, -219, -1021 }, { 18, -208, -1028 }, { 0, -194, -1026 }, { -17, -177, -1019 }, { -34, -161, -1010 }, + { -49, -147, -1004 }, { -60, -138, -1002 }, { -66, -133, -1005 }, { -70, -130, -1007 }, { -72, -129, -1008 }, + { -73, -128, -1008 }, { -72, -128, -1009 }, { -72, -128, -1009 }, { -71, -129, -1009 }, { -71, -129, -1009 }, + { -71, -129, -1009 }, { -71, -129, -1009 }, { -70, -129, -1010 }, { -70, -129, -1010 }, { -69, -128, -1011 }, + { -69, -128, -1011 }, { -68, -128, -1012 }, { -67, -129, -1013 }, { -67, -129, -1013 }, { -66, -129, -1014 }, + { -65, -129, -1014 }, { -64, -129, -1014 }, { -64, -129, -1014 }, { -63, -130, -1014 }, { -62, -130, -1014 }, + { -62, -131, -1014 }, { -61, -131, -1013 }, { -61, -132, -1013 }, { -60, -133, -1012 }, { -60, -134, -1010 }, + { -60, -135, -1009 }, { -59, -136, -1007 }, { -59, -137, -1005 }, { -60, -138, -1002 }, { -60, -140, -999 }, + { -60, -142, -995 }, { -61, -144, -991 }, { -62, -147, -986 }, { -63, -149, -980 }, { -64, -152, -974 }, + { -65, -155, -967 }, { -66, -159, -960 }, { -67, -162, -953 }, { -68, -165, -946 }, { -70, -169, -939 }, + { -71, -172, -932 }, { -72, -175, -925 }, { -73, -178, -918 }, { -74, -181, -912 }, { -76, -184, -906 }, + { -77, -187, -900 }, { -77, -189, -895 }, { -78, -191, -891 }, { -79, -193, -887 }, { -79, -194, -884 }, + { -80, -196, -881 }, { -80, -197, -879 }, { -81, -198, -877 }, { -81, -199, -875 }, { -81, -199, -873 }, + { -81, -200, -873 }, { -81, -200, -872 }, { -81, -200, -872 }, { -81, -200, -873 }, { -81, -199, -875 }, + { -81, -198, -877 }, { -80, -197, -880 }, { -80, -195, -883 }, { -79, -193, -887 }, { -78, -190, -894 }, + { -76, -185, -903 }, { -74, -179, -916 }, { -72, -173, -929 }, { -69, -166, -944 }, { -67, -159, -959 }, + { -65, -152, -973 }, { -62, -146, -985 }, { -61, -142, -995 }, { -60, -138, -1002 }, { -59, -136, -1007 }, + { -58, -135, -1010 }, { -58, -134, -1011 }, { -58, -134, -1012 }, { -58, -134, -1011 }, { -58, -135, -1010 }, + { -58, -135, -1009 }, { -59, -136, -1007 }, { -59, -137, -1005 }, { -59, -138, -1004 }, { -59, -138, -1003 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, { -60, -138, -1002 }, + { -60, -138, -1002 }, { -60, -138, -1003 }, { -59, -138, -1003 }, { -59, -138, -1003 }, { -59, -138, -1003 }, + { -59, -138, -1003 }, { -59, -138, -1004 }, { -59, -139, -1004 }, { -59, -139, -1004 }, { -59, -139, -1005 }, + { -59, -139, -1005 }, { -59, -139, -1005 }, { -59, -139, -1006 }, { -59, -139, -1006 }, { -59, -139, -1007 }, + { -59, -139, -1007 }, { -58, -139, -1008 }, { -58, -139, -1008 }, { -58, -139, -1008 }, { -58, -139, -1009 }, + { -58, -139, -1009 }, { -58, -139, -1010 }, { -58, -139, -1010 }, { -58, -140, -1011 }, { -58, -140, -1011 }, + { -58, -140, -1011 }, { -58, -140, -1012 }, { -58, -140, -1012 }, { -57, -140, -1012 }, { -57, -140, -1013 }, + { -57, -140, -1013 }, { -57, -140, -1013 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, + { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, + { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1014 }, { -57, -140, -1013 }, { -57, -140, -1013 }, + { -57, -140, -1013 }, { -58, -140, -1012 }, { -58, -140, -1012 }, { -58, -140, -1011 }, { -58, -139, -1010 }, + { -58, -139, -1010 }, { -58, -139, -1009 }, { -58, -139, -1008 }, { -59, -139, -1007 }, { -59, -139, -1006 }, + { -59, -139, -1005 }, { -59, -138, -1004 }, { -60, -138, -1002 }, { -62, -136, -989 }, { -68, -132, -962 }, + { -74, -128, -934 }, { -77, -125, -918 }, { -78, -125, -915 }, { -78, -125, -914 }, { -78, -125, -915 }, + { -77, -125, -918 }, { -77, -126, -921 }, { -76, -126, -925 }, { -75, -127, -928 }, { -75, -127, -931 }, + { -74, -127, -932 }, { -75, -127, -930 }, { -76, -127, -926 }, { -77, -125, -918 }, { -81, -122, -898 }, + { -89, -117, -862 }, { -97, -111, -819 }, { -106, -105, -779 }, { -112, -100, -750 }, { -114, -98, -742 }, + { -113, -99, -751 }, { -110, -100, -768 }, { -107, -102, -791 }, { -102, -105, -818 }, { -97, -108, -848 }, + { -92, -111, -880 }, { -86, -114, -911 }, { -81, -117, -940 }, { -77, -121, -966 }, { -74, -124, -987 }, + { -72, -126, -1002 }, { -71, -129, -1009 }, { -72, -131, -1011 }, { -72, -132, -1011 }, { -73, -134, -1011 }, + { -74, -136, -1011 }, { -76, -138, -1009 }, { -77, -140, -1007 }, { -79, -142, -1004 }, { -80, -143, -1000 }, + { -82, -145, -996 }, { -84, -147, -991 }, { -86, -148, -986 }, { -88, -150, -980 }, { -90, -152, -974 }, + { -93, -154, -968 }, { -95, -155, -961 }, { -97, -157, -954 }, { -100, -158, -947 }, { -102, -160, -940 }, + { -104, -162, -933 }, { -107, -163, -925 }, { -109, -165, -918 }, { -111, -167, -911 }, { -113, -169, -904 }, + { -115, -170, -897 }, { -117, -172, -891 }, { -119, -174, -884 }, { -121, -175, -878 }, { -123, -177, -873 }, + { -124, -179, -868 }, { -126, -181, -863 }, { -127, -183, -859 }, { -128, -185, -855 }, { -129, -187, -852 }, + { -129, -189, -850 }, { -130, -191, -849 }, { -130, -193, -848 }, { -130, -195, -847 }, { -130, -197, -847 }, + { -130, -200, -846 }, { -130, -203, -846 }, { -130, -205, -847 }, { -129, -208, -847 }, { -129, -211, -848 }, + { -128, -214, -849 }, { -128, -217, -850 }, { -127, -221, -851 }, { -126, -224, -852 }, { -126, -227, -854 }, + { -125, -230, -856 }, { -124, -234, -857 }, { -123, -237, -859 }, { -122, -240, -861 }, { -121, -243, -864 }, + { -120, -247, -866 }, { -119, -250, -868 }, { -118, -253, -871 }, { -116, -256, -873 }, { -115, -259, -876 }, + { -114, -262, -878 }, { -113, -265, -881 }, { -111, -267, -884 }, { -110, -270, -887 }, { -109, -272, -889 }, + { -108, -274, -892 }, { -106, -277, -895 }, { -105, -278, -898 }, { -104, -280, -900 }, { -103, -282, -903 }, + { -102, -283, -905 }, { -100, -284, -908 }, { -99, -285, -910 }, { -98, -286, -913 }, { -97, -286, -915 }, + { -96, -286, -917 }, { -95, -286, -919 }, { -94, -286, -921 }, { -93, -285, -923 }, { -93, -282, -925 }, + { -92, -276, -928 }, { -90, -266, -932 }, { -89, -254, -935 }, { -88, -240, -939 }, { -87, -225, -942 }, + { -86, -210, -945 }, { -85, -194, -948 }, { -85, -180, -950 }, { -84, -167, -951 }, { -84, -156, -951 }, + { -84, -148, -950 }, { -85, -144, -947 }, { -90, -166, -926 }, { -100, -213, -890 }, { -105, -241, -868 }, + { -107, -246, -864 }, { -110, -250, -862 }, { -113, -252, -860 }, { -116, -253, -859 }, { -120, -253, -859 }, + { -123, -253, -859 }, { -125, -252, -860 }, { -127, -250, -862 }, { -128, -248, -863 }, { -127, -246, -865 }, + { -125, -244, -866 }, { -121, -243, -867 }, { -114, -242, -868 }, { -105, -241, -868 }, { -93, -241, -868 }, + { -75, -241, -868 }, { -55, -241, -868 }, { -31, -241, -868 }, { -5, -241, -868 }, { 21, -241, -868 }, + { 48, -241, -868 }, { 75, -241, -868 }, { 102, -241, -868 }, { 126, -241, -868 }, { 147, -241, -868 }, + { 166, -241, -868 }, { 179, -241, -868 }, { 188, -241, -868 }, { 192, -241, -868 }, { 187, -241, -868 }, + { 175, -241, -868 }, { 156, -241, -868 }, { 133, -241, -868 }, { 105, -241, -868 }, { 74, -241, -868 }, + { 43, -241, -868 }, { 11, -241, -868 }, { -18, -241, -868 }, { -46, -241, -868 }, { -70, -241, -868 }, + { -89, -241, -868 }, { -101, -241, -868 }, { -105, -241, -868 }, { -102, -241, -868 }, { -91, -241, -868 }, + { -74, -241, -868 }, { -53, -241, -868 }, { -28, -241, -868 }, { 0, -241, -868 }, { 28, -241, -868 }, + { 57, -241, -868 }, { 87, -241, -868 }, { 114, -241, -868 }, { 139, -241, -868 }, { 161, -241, -868 }, + { 177, -241, -868 }, { 188, -241, -868 }, { 192, -241, -868 }, { 187, -241, -868 }, { 175, -241, -868 }, + { 156, -241, -868 }, { 133, -241, -868 }, { 105, -241, -868 }, { 74, -241, -868 }, { 43, -241, -868 }, + { 11, -241, -868 }, { -18, -241, -868 }, { -46, -241, -868 }, { -70, -241, -868 }, { -89, -241, -868 }, + { -101, -241, -868 }, { -105, -241, -868 }, { -100, -241, -868 }, { -86, -241, -868 }, { -65, -241, -868 }, + { -38, -241, -868 }, { -7, -241, -868 }, { 25, -241, -868 }, { 60, -241, -868 }, { 93, -241, -868 }, + { 124, -241, -868 }, { 151, -241, -868 }, { 173, -241, -868 }, { 187, -241, -868 }, { 192, -241, -868 }, + { 188, -242, -869 }, { 178, -242, -869 }, { 162, -243, -870 }, { 142, -245, -871 }, { 118, -246, -872 }, + { 91, -247, -873 }, { 63, -248, -874 }, { 34, -250, -875 }, { 5, -250, -876 }, { -21, -250, -876 }, + { -46, -250, -876 }, { -68, -249, -875 }, { -86, -248, -874 }, { -99, -245, -871 }, { -105, -241, -868 }, + { -108, -237, -865 }, { -111, -233, -861 }, { -113, -229, -858 }, { -114, -224, -854 }, { -115, -219, -850 }, + { -116, -214, -845 }, { -116, -209, -841 }, { -116, -204, -837 }, { -115, -198, -832 }, { -114, -193, -828 }, + { -113, -187, -823 }, { -111, -182, -818 }, { -109, -176, -813 }, { -107, -170, -808 }, { -105, -164, -803 }, + { -102, -158, -798 }, { -99, -152, -793 }, { -96, -146, -788 }, { -92, -140, -783 }, { -89, -134, -778 }, + { -85, -128, -773 }, { -81, -122, -768 }, { -78, -116, -762 }, { -73, -110, -757 }, { -69, -103, -752 }, + { -65, -97, -747 }, { -61, -91, -742 }, { -57, -85, -737 }, { -53, -79, -732 }, { -48, -74, -727 }, + { -44, -68, -722 }, { -40, -62, -717 }, { -36, -57, -713 }, { -32, -51, -708 }, { -28, -46, -703 }, + { -24, -40, -699 }, { -21, -35, -695 }, { -17, -30, -690 }, { -14, -25, -686 }, { -11, -21, -682 }, + { -8, -16, -678 }, { -6, -12, -675 }, { -3, -7, -671 }, { -1, -3, -668 }, { 0, 0, -665 }, + { 1, 3, -662 }, { 2, 7, -659 }, { 3, 10, -656 }, { 4, 13, -654 }, { 4, 15, -653 }, + { 4, 18, -651 }, { 4, 20, -650 }, { 3, 21, -649 }, { 3, 22, -648 }, { 2, 23, -648 }, + { 2, 23, -648 }, { 1, 23, -649 }, { 1, 22, -649 }, { 0, 21, -650 }, { 0, 19, -652 }, + { 0, 16, -654 }, { 0, 13, -656 }, { 0, 9, -658 }, { 0, 5, -661 }, { 0, 0, -665 }, + { 0, -7, -669 }, { 2, -16, -677 }, { 3, -29, -686 }, { 5, -43, -697 }, { 6, -59, -709 }, + { 8, -76, -721 }, { 10, -95, -733 }, { 12, -114, -745 }, { 14, -134, -756 }, { 15, -155, -765 }, + { 17, -175, -772 }, { 18, -198, -778 }, { 19, -227, -782 }, { 20, -259, -786 }, { 22, -292, -788 }, + { 22, -324, -790 }, { 23, -353, -790 }, { 24, -376, -790 }, { 24, -392, -789 }, { 23, -398, -788 }, + { 22, -398, -785 }, { 21, -396, -782 }, { 20, -394, -779 }, { 19, -390, -775 }, { 18, -385, -771 }, + { 16, -379, -766 }, { 14, -373, -762 }, { 13, -365, -757 }, { 11, -357, -752 }, { 9, -348, -747 }, + { 7, -339, -741 }, { 6, -330, -736 }, { 4, -319, -731 }, { 2, -309, -726 }, { 1, -299, -722 }, + { 0, -288, -717 }, { -1, -277, -713 }, { -3, -266, -709 }, { -4, -256, -706 }, { -5, -246, -703 }, + { -6, -235, -701 }, { -6, -226, -699 }, { -7, -217, -698 }, { -7, -208, -698 }, { -7, -200, -698 }, + { -6, -192, -700 }, { -4, -185, -705 }, { 0, -179, -718 }, { 7, -172, -735 }, { 15, -166, -756 }, + { 23, -161, -778 }, { 31, -157, -800 }, { 37, -154, -820 }, { 41, -153, -837 }, { 42, -154, -849 }, + { 32, -164, -848 }, { 11, -184, -836 }, { -9, -204, -820 }, { -23, -215, -809 }, { -24, -210, -806 }, + { -19, -196, -807 }, { -11, -181, -807 }, { -6, -171, -803 }, { -5, -169, -790 }, { -4, -173, -770 }, + { -5, -177, -753 }, { -5, -181, -736 }, { -6, -186, -719 }, { -6, -191, -706 }, { -6, -192, -700 }, + { -6, -193, -699 }, { -6, -193, -698 }, { -6, -193, -697 }, { -6, -193, -697 }, { -6, -194, -696 }, + { -6, -194, -696 }, { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -694 }, { -7, -194, -694 }, + { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, + { -7, -195, -693 }, { -7, -195, -693 }, { -7, -195, -692 }, { -7, -195, -693 }, { -7, -195, -693 }, + { -7, -195, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, { -7, -194, -693 }, + { -7, -194, -693 }, { -7, -194, -694 }, { -7, -194, -694 }, { -7, -194, -694 }, { -6, -194, -694 }, + { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -695 }, { -6, -194, -696 }, + { -6, -194, -696 }, { -6, -193, -696 }, { -6, -193, -697 }, { -6, -193, -697 }, { -6, -193, -697 }, + { -6, -193, -697 }, { -6, -193, -698 }, { -6, -193, -698 }, { -6, -193, -698 }, { -6, -193, -698 }, + { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, { -6, -193, -699 }, + { -6, -193, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, + { -6, -192, -700 }, { -6, -192, -700 }, { -6, -192, -700 }, { -6, -196, -701 }, { -6, -192, -700 }, + { -6, -174, -696 }, { -5, -152, -692 }, { -4, -127, -688 }, { -3, -101, -683 }, { -2, -76, -679 }, + { -1, -52, -674 }, { 0, -31, -670 }, { 0, -14, -667 }, { 0, -3, -665 }, { 0, 0, -665 }, }; static s16 animdata_mario_lips_3_2[][3] = { - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, - { -269, -128, -669 }, { -269, -129, -669 }, { -267, -131, -668 }, { -265, -134, -666 }, - { -262, -139, -664 }, { -259, -144, -661 }, { -254, -150, -658 }, { -250, -156, -655 }, - { -245, -163, -651 }, { -239, -171, -647 }, { -234, -178, -643 }, { -228, -186, -639 }, - { -223, -194, -635 }, { -217, -202, -631 }, { -211, -209, -627 }, { -206, -216, -624 }, - { -201, -222, -620 }, { -197, -228, -617 }, { -190, -225, -617 }, { -190, -224, -617 }, - { -190, -224, -617 }, { -190, -224, -617 }, { -190, -225, -617 }, { -190, -225, -617 }, - { -191, -225, -617 }, { -191, -225, -616 }, { -191, -225, -616 }, { -191, -225, -616 }, - { -192, -225, -615 }, { -192, -225, -615 }, { -192, -225, -615 }, { -193, -226, -614 }, - { -193, -226, -614 }, { -193, -226, -613 }, { -194, -226, -613 }, { -194, -227, -612 }, - { -195, -227, -612 }, { -195, -227, -611 }, { -196, -227, -611 }, { -196, -227, -610 }, - { -197, -228, -610 }, { -197, -228, -609 }, { -198, -228, -609 }, { -198, -229, -608 }, - { -199, -229, -608 }, { -199, -229, -607 }, { -200, -229, -607 }, { -200, -230, -606 }, - { -201, -230, -606 }, { -201, -230, -605 }, { -202, -230, -605 }, { -202, -230, -604 }, - { -203, -231, -604 }, { -203, -231, -603 }, { -203, -231, -603 }, { -204, -231, -603 }, - { -204, -231, -603 }, { -204, -231, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, - { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, - { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, - { -205, -232, -602 }, { -204, -232, -603 }, { -204, -231, -603 }, { -204, -231, -603 }, - { -203, -231, -604 }, { -203, -231, -604 }, { -202, -230, -605 }, { -201, -230, -606 }, - { -201, -230, -607 }, { -200, -229, -608 }, { -199, -229, -608 }, { -198, -228, -609 }, - { -197, -228, -611 }, { -196, -227, -612 }, { -194, -227, -613 }, { -193, -226, -614 }, - { -192, -225, -616 }, { -190, -225, -617 }, { -186, -223, -622 }, { -177, -219, -632 }, - { -165, -215, -646 }, { -151, -209, -662 }, { -135, -202, -679 }, { -119, -194, -697 }, - { -103, -187, -713 }, { -89, -179, -727 }, { -78, -172, -736 }, { -70, -165, -741 }, - { -65, -159, -742 }, { -60, -152, -742 }, { -55, -145, -741 }, { -50, -137, -740 }, - { -46, -129, -738 }, { -42, -121, -735 }, { -38, -112, -732 }, { -34, -104, -729 }, - { -30, -95, -725 }, { -27, -87, -721 }, { -23, -79, -716 }, { -20, -70, -712 }, - { -18, -62, -707 }, { -15, -54, -702 }, { -12, -47, -697 }, { -10, -39, -693 }, - { -8, -33, -688 }, { -6, -26, -684 }, { -5, -20, -680 }, { -3, -15, -676 }, - { -2, -11, -673 }, { -1, -7, -670 }, { 0, -4, -668 }, { 0, -1, -666 }, - { 0, 0, -665 }, { 0, 0, -665 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, { -269, -128, -669 }, + { -269, -129, -669 }, { -267, -131, -668 }, { -265, -134, -666 }, { -262, -139, -664 }, { -259, -144, -661 }, + { -254, -150, -658 }, { -250, -156, -655 }, { -245, -163, -651 }, { -239, -171, -647 }, { -234, -178, -643 }, + { -228, -186, -639 }, { -223, -194, -635 }, { -217, -202, -631 }, { -211, -209, -627 }, { -206, -216, -624 }, + { -201, -222, -620 }, { -197, -228, -617 }, { -190, -225, -617 }, { -190, -224, -617 }, { -190, -224, -617 }, + { -190, -224, -617 }, { -190, -225, -617 }, { -190, -225, -617 }, { -191, -225, -617 }, { -191, -225, -616 }, + { -191, -225, -616 }, { -191, -225, -616 }, { -192, -225, -615 }, { -192, -225, -615 }, { -192, -225, -615 }, + { -193, -226, -614 }, { -193, -226, -614 }, { -193, -226, -613 }, { -194, -226, -613 }, { -194, -227, -612 }, + { -195, -227, -612 }, { -195, -227, -611 }, { -196, -227, -611 }, { -196, -227, -610 }, { -197, -228, -610 }, + { -197, -228, -609 }, { -198, -228, -609 }, { -198, -229, -608 }, { -199, -229, -608 }, { -199, -229, -607 }, + { -200, -229, -607 }, { -200, -230, -606 }, { -201, -230, -606 }, { -201, -230, -605 }, { -202, -230, -605 }, + { -202, -230, -604 }, { -203, -231, -604 }, { -203, -231, -603 }, { -203, -231, -603 }, { -204, -231, -603 }, + { -204, -231, -603 }, { -204, -231, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, + { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, + { -205, -232, -602 }, { -205, -232, -602 }, { -205, -232, -602 }, { -204, -232, -603 }, { -204, -231, -603 }, + { -204, -231, -603 }, { -203, -231, -604 }, { -203, -231, -604 }, { -202, -230, -605 }, { -201, -230, -606 }, + { -201, -230, -607 }, { -200, -229, -608 }, { -199, -229, -608 }, { -198, -228, -609 }, { -197, -228, -611 }, + { -196, -227, -612 }, { -194, -227, -613 }, { -193, -226, -614 }, { -192, -225, -616 }, { -190, -225, -617 }, + { -186, -223, -622 }, { -177, -219, -632 }, { -165, -215, -646 }, { -151, -209, -662 }, { -135, -202, -679 }, + { -119, -194, -697 }, { -103, -187, -713 }, { -89, -179, -727 }, { -78, -172, -736 }, { -70, -165, -741 }, + { -65, -159, -742 }, { -60, -152, -742 }, { -55, -145, -741 }, { -50, -137, -740 }, { -46, -129, -738 }, + { -42, -121, -735 }, { -38, -112, -732 }, { -34, -104, -729 }, { -30, -95, -725 }, { -27, -87, -721 }, + { -23, -79, -716 }, { -20, -70, -712 }, { -18, -62, -707 }, { -15, -54, -702 }, { -12, -47, -697 }, + { -10, -39, -693 }, { -8, -33, -688 }, { -6, -26, -684 }, { -5, -20, -680 }, { -3, -15, -676 }, + { -2, -11, -673 }, { -1, -7, -670 }, { 0, -4, -668 }, { 0, -1, -666 }, { 0, 0, -665 }, + { 0, 0, -665 }, }; struct AnimDataInfo anim_mario_lips_3[] = { @@ -1863,248 +1670,201 @@ struct AnimDataInfo anim_mario_lips_3[] = { }; static s16 animdata_mario_lips_4_1[][3] = { - { 0, 0, -665 }, { 0, 0, -664 }, { 0, 0, -663 }, { 0, 0, -661 }, - { 0, 0, -659 }, { 0, 0, -656 }, { 0, 0, -653 }, { 0, 0, -650 }, - { 0, 0, -647 }, { 0, 0, -644 }, { 0, 0, -641 }, { 0, 0, -638 }, - { 0, 0, -636 }, { 0, 0, -634 }, { 0, 0, -633 }, { 0, 0, -633 }, - { 0, 0, -634 }, { 0, 0, -636 }, { 0, 0, -639 }, { 0, 0, -643 }, - { 0, 0, -649 }, { 0, 0, -656 }, { 0, 0, -665 }, { 0, 0, -692 }, - { 0, 2, -744 }, { 0, 3, -808 }, { 1, 5, -871 }, { 1, 6, -917 }, - { 2, 7, -934 }, { 2, 7, -929 }, { 2, 7, -919 }, { 3, 7, -906 }, - { 3, 7, -889 }, { 3, 7, -869 }, { 3, 7, -847 }, { 4, 7, -823 }, - { 4, 7, -798 }, { 4, 6, -772 }, { 4, 6, -746 }, { 5, 6, -721 }, - { 5, 6, -696 }, { 5, 5, -672 }, { 5, 5, -650 }, { 5, 5, -631 }, - { 5, 5, -614 }, { 6, 5, -602 }, { 6, 5, -593 }, { 6, 5, -587 }, - { 6, 6, -585 }, { 6, 7, -586 }, { 6, 8, -588 }, { 6, 9, -592 }, - { 6, 9, -596 }, { 6, 10, -601 }, { 6, 10, -605 }, { 6, 10, -607 }, - { 6, 9, -608 }, { 6, 7, -606 }, { 6, 5, -602 }, { 6, 0, -590 }, - { 6, -7, -570 }, { 6, -16, -546 }, { 7, -26, -520 }, { 7, -36, -496 }, - { 7, -45, -477 }, { 7, -51, -465 }, { 7, -53, -465 }, { 3, -27, -566 }, - { 0, 0, -665 }, { 0, 0, -649 }, { 2, 1, -620 }, { 6, 5, -602 }, - { 10, 10, -597 }, { 15, 17, -595 }, { 20, 24, -594 }, { 25, 32, -595 }, - { 30, 39, -596 }, { 35, 46, -598 }, { 39, 52, -599 }, { 43, 58, -600 }, - { 46, 62, -601 }, { 48, 65, -601 }, { 48, 67, -602 }, { 48, 68, -602 }, - { 48, 69, -603 }, { 47, 69, -603 }, { 46, 67, -603 }, { 46, 65, -602 }, - { 46, 62, -601 }, { 46, 55, -597 }, { 47, 43, -591 }, { 48, 30, -585 }, - { 48, 20, -579 }, { 49, 14, -576 }, { 49, 12, -575 }, { 49, 11, -574 }, - { 50, 10, -572 }, { 50, 9, -571 }, { 51, 9, -570 }, { 52, 9, -568 }, - { 52, 9, -567 }, { 53, 10, -566 }, { 53, 10, -565 }, { 54, 11, -565 }, - { 54, 12, -565 }, { 54, 13, -565 }, { 54, 13, -565 }, { 54, 14, -566 }, - { 53, 14, -568 }, { 52, 14, -570 }, { 50, 14, -573 }, { 49, 14, -576 }, - { 43, 12, -585 }, { 34, 10, -602 }, { 22, 6, -623 }, { 11, 3, -643 }, - { 3, 0, -659 }, { 0, 0, -665 }, { 0, 0, -665 }, { -14, 0, -665 }, - { -29, 0, -665 }, { -46, 0, -665 }, { -64, 0, -665 }, { -82, 0, -665 }, - { -100, 0, -665 }, { -118, 0, -665 }, { -136, 0, -665 }, { -152, 0, -665 }, - { -167, 0, -665 }, { -180, 0, -665 }, { -191, 0, -665 }, { -199, 0, -665 }, - { -204, 0, -665 }, { -206, 0, -665 }, { -206, 0, -665 }, { -205, 0, -665 }, - { -204, 0, -665 }, { -202, 0, -666 }, { -200, 0, -666 }, { -198, 0, -667 }, - { -195, 0, -668 }, { -192, 0, -668 }, { -188, 0, -669 }, { -185, 0, -670 }, - { -181, 0, -671 }, { -176, 0, -672 }, { -172, 0, -673 }, { -167, 0, -674 }, - { -161, 0, -675 }, { -156, 0, -676 }, { -151, 0, -677 }, { -145, 0, -678 }, - { -139, 0, -679 }, { -133, 0, -680 }, { -127, 0, -681 }, { -120, 0, -681 }, - { -114, 0, -682 }, { -108, 0, -682 }, { -101, 0, -683 }, { -95, 0, -683 }, - { -88, 0, -683 }, { -81, 0, -683 }, { -75, 0, -683 }, { -68, 0, -683 }, - { -62, 0, -683 }, { -56, 0, -682 }, { -49, 0, -681 }, { -43, 0, -680 }, - { -37, 0, -679 }, { -31, 0, -678 }, { -25, 0, -676 }, { -20, 0, -675 }, - { -14, 0, -672 }, { -9, 0, -670 }, { -4, 0, -667 }, { 0, 0, -665 }, - { 3, -1, -647 }, { 5, -3, -609 }, { 7, -4, -566 }, { 7, -4, -532 }, - { 7, 0, -522 }, { 6, 6, -537 }, { 4, 17, -565 }, { 2, 30, -602 }, - { 0, 42, -643 }, { -1, 55, -682 }, { -3, 65, -716 }, { -5, 72, -739 }, - { -5, 74, -745 }, { -6, 73, -741 }, { -5, 71, -733 }, { -5, 67, -724 }, - { -4, 64, -711 }, { -3, 59, -697 }, { -2, 54, -681 }, { -1, 48, -664 }, - { 0, 42, -645 }, { 1, 35, -626 }, { 3, 28, -606 }, { 4, 22, -586 }, - { 5, 15, -565 }, { 6, 8, -545 }, { 7, 2, -526 }, { 8, -3, -507 }, - { 9, -8, -489 }, { 9, -13, -473 }, { 9, -17, -458 }, { 9, -20, -445 }, - { 8, -23, -435 }, { 7, -24, -426 }, { 5, -24, -421 }, { 3, -23, -419 }, - { 0, -20, -419 }, { -2, -16, -424 }, { -17, 8, -474 }, { -45, 64, -587 }, - { -78, 130, -727 }, { -106, 187, -856 }, { -117, 218, -937 }, { -113, 222, -973 }, - { -102, 216, -996 }, { -86, 203, -1007 }, { -68, 185, -1010 }, { -48, 165, -1008 }, - { -29, 145, -1005 }, { -13, 128, -1003 }, { -2, 117, -1005 }, { 4, 111, -1009 }, - { 8, 107, -1012 }, { 10, 104, -1014 }, { 10, 103, -1015 }, { 9, 103, -1016 }, - { 9, 103, -1016 }, { 8, 104, -1016 }, { 8, 104, -1016 }, { 8, 104, -1016 }, - { 7, 103, -1017 }, { 7, 103, -1017 }, { 6, 103, -1018 }, { 6, 103, -1018 }, - { 5, 102, -1019 }, { 4, 102, -1020 }, { 3, 102, -1020 }, { 2, 102, -1021 }, - { 1, 102, -1022 }, { 0, 102, -1022 }, { 0, 102, -1022 }, { 0, 102, -1022 }, - { -1, 102, -1022 }, { -2, 103, -1022 }, { -2, 104, -1022 }, { -3, 105, -1021 }, - { -3, 106, -1020 }, { -4, 107, -1018 }, { -4, 108, -1016 }, { -4, 110, -1014 }, - { -3, 112, -1011 }, { -3, 114, -1008 }, { -2, 117, -1005 }, { -1, 120, -1000 }, - { 0, 124, -995 }, { 1, 128, -989 }, { 3, 133, -981 }, { 6, 139, -973 }, - { 8, 144, -965 }, { 11, 151, -956 }, { 14, 157, -946 }, { 17, 164, -936 }, - { 20, 170, -927 }, { 23, 177, -917 }, { 27, 184, -907 }, { 30, 190, -897 }, - { 33, 197, -888 }, { 36, 203, -879 }, { 38, 208, -870 }, { 41, 213, -863 }, - { 43, 218, -856 }, { 45, 222, -849 }, { 46, 226, -844 }, { 48, 229, -840 }, - { 49, 231, -836 }, { 50, 234, -832 }, { 51, 236, -829 }, { 52, 237, -827 }, - { 52, 239, -825 }, { 53, 240, -824 }, { 53, 240, -824 }, { 53, 240, -824 }, - { 52, 239, -825 }, { 52, 238, -827 }, { 51, 236, -830 }, { 50, 233, -834 }, - { 48, 230, -838 }, { 46, 226, -844 }, { 44, 220, -853 }, { 39, 210, -867 }, - { 34, 199, -884 }, { 28, 186, -903 }, { 22, 172, -923 }, { 16, 158, -944 }, - { 10, 145, -963 }, { 4, 133, -981 }, { 0, 124, -995 }, { -2, 117, -1005 }, - { -4, 113, -1011 }, { -5, 110, -1015 }, { -6, 109, -1017 }, { -6, 108, -1018 }, - { -6, 109, -1017 }, { -5, 110, -1016 }, { -5, 111, -1014 }, { -4, 113, -1011 }, - { -3, 114, -1009 }, { -3, 116, -1007 }, { -2, 117, -1005 }, { -2, 117, -1005 }, - { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, - { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, - { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, - { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, - { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1006 }, { -2, 117, -1006 }, - { -2, 117, -1006 }, { -2, 117, -1007 }, { -2, 117, -1007 }, { -3, 117, -1007 }, - { -3, 117, -1008 }, { -3, 117, -1008 }, { -3, 117, -1009 }, { -3, 117, -1009 }, - { -3, 117, -1010 }, { -3, 117, -1010 }, { -3, 117, -1011 }, { -3, 117, -1011 }, - { -3, 117, -1012 }, { -3, 117, -1012 }, { -4, 117, -1013 }, { -4, 117, -1013 }, - { -4, 117, -1014 }, { -4, 117, -1014 }, { -4, 117, -1015 }, { -4, 117, -1015 }, - { -4, 117, -1015 }, { -4, 117, -1016 }, { -4, 117, -1016 }, { -4, 117, -1017 }, - { -4, 117, -1017 }, { -4, 118, -1017 }, { -4, 118, -1017 }, { -5, 118, -1018 }, - { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, - { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, - { -4, 118, -1018 }, { -4, 118, -1017 }, { -4, 117, -1017 }, { -4, 117, -1016 }, - { -4, 117, -1016 }, { -4, 117, -1015 }, { -4, 117, -1015 }, { -4, 117, -1014 }, - { -4, 117, -1013 }, { -3, 117, -1012 }, { -3, 117, -1011 }, { -3, 117, -1010 }, - { -3, 117, -1009 }, { -3, 117, -1008 }, { -2, 117, -1006 }, { -2, 117, -1005 }, - { 0, 116, -990 }, { 6, 115, -959 }, { 12, 113, -927 }, { 16, 112, -909 }, - { 17, 112, -904 }, { 17, 112, -903 }, { 17, 112, -905 }, { 16, 112, -908 }, - { 15, 113, -912 }, { 14, 113, -916 }, { 14, 113, -920 }, { 13, 113, -923 }, - { 13, 113, -924 }, { 13, 113, -922 }, { 14, 113, -918 }, { 16, 112, -909 }, - { 20, 111, -885 }, { 28, 110, -844 }, { 38, 108, -795 }, { 46, 106, -749 }, - { 53, 104, -717 }, { 55, 103, -707 }, { 54, 102, -718 }, { 51, 102, -737 }, - { 47, 101, -763 }, { 43, 101, -793 }, { 37, 100, -827 }, { 32, 100, -863 }, - { 26, 100, -898 }, { 21, 100, -932 }, { 16, 100, -962 }, { 12, 101, -988 }, - { 9, 102, -1006 }, { 8, 104, -1016 }, { 8, 106, -1020 }, { 8, 108, -1024 }, - { 8, 110, -1027 }, { 8, 112, -1029 }, { 8, 114, -1031 }, { 9, 116, -1031 }, - { 9, 118, -1032 }, { 10, 121, -1031 }, { 11, 123, -1030 }, { 12, 125, -1028 }, - { 13, 128, -1026 }, { 14, 130, -1024 }, { 15, 133, -1021 }, { 17, 135, -1017 }, - { 18, 138, -1014 }, { 19, 141, -1010 }, { 20, 143, -1006 }, { 22, 146, -1002 }, - { 23, 148, -998 }, { 24, 151, -993 }, { 26, 154, -989 }, { 27, 157, -984 }, - { 28, 159, -980 }, { 30, 162, -976 }, { 31, 165, -971 }, { 32, 167, -967 }, - { 33, 170, -964 }, { 34, 173, -960 }, { 35, 176, -957 }, { 36, 178, -954 }, - { 36, 181, -952 }, { 37, 184, -950 }, { 37, 186, -948 }, { 37, 189, -947 }, - { 38, 192, -947 }, { 37, 194, -947 }, { 37, 197, -947 }, { 37, 200, -948 }, - { 37, 202, -948 }, { 37, 205, -949 }, { 36, 208, -950 }, { 36, 211, -951 }, - { 36, 214, -952 }, { 35, 216, -953 }, { 34, 219, -954 }, { 34, 222, -956 }, - { 33, 225, -957 }, { 33, 228, -959 }, { 32, 231, -960 }, { 31, 234, -962 }, - { 30, 237, -964 }, { 29, 240, -966 }, { 29, 243, -968 }, { 28, 246, -970 }, - { 27, 248, -972 }, { 26, 251, -974 }, { 25, 254, -976 }, { 24, 257, -978 }, - { 23, 260, -980 }, { 22, 263, -982 }, { 22, 266, -984 }, { 21, 268, -986 }, - { 20, 271, -988 }, { 19, 274, -990 }, { 18, 276, -992 }, { 17, 279, -994 }, - { 16, 282, -996 }, { 15, 284, -998 }, { 15, 287, -1000 }, { 14, 289, -1002 }, - { 13, 291, -1004 }, { 12, 294, -1005 }, { 12, 296, -1007 }, { 11, 298, -1008 }, - { 10, 300, -1010 }, { 10, 302, -1011 }, { 9, 304, -1012 }, { 9, 306, -1013 }, - { 9, 307, -1014 }, { 8, 308, -1015 }, { 8, 309, -1015 }, { 8, 309, -1015 }, - { 8, 309, -1015 }, { 8, 308, -1015 }, { 8, 308, -1015 }, { 9, 308, -1014 }, - { 9, 307, -1014 }, { 9, 306, -1014 }, { 9, 306, -1013 }, { 9, 305, -1013 }, - { 9, 305, -1013 }, { 9, 304, -1012 }, { 9, 304, -1012 }, { 10, 304, -1012 }, - { 12, 304, -1013 }, { 14, 304, -1013 }, { 17, 305, -1013 }, { 20, 305, -1013 }, - { 23, 305, -1013 }, { 26, 305, -1013 }, { 28, 305, -1014 }, { 29, 305, -1014 }, - { 28, 305, -1014 }, { 27, 305, -1014 }, { 23, 305, -1013 }, { 17, 305, -1013 }, - { 9, 304, -1012 }, { -1, 304, -1012 }, { -17, 303, -1011 }, { -36, 302, -1009 }, - { -57, 300, -1008 }, { -80, 299, -1006 }, { -105, 298, -1005 }, { -130, 296, -1003 }, - { -154, 295, -1001 }, { -178, 294, -1000 }, { -200, 293, -998 }, { -220, 292, -997 }, - { -236, 291, -996 }, { -249, 290, -995 }, { -257, 290, -994 }, { -260, 289, -994 }, - { -256, 290, -994 }, { -245, 290, -995 }, { -228, 291, -996 }, { -206, 292, -998 }, - { -181, 294, -999 }, { -153, 295, -1001 }, { -125, 297, -1003 }, { -96, 298, -1005 }, - { -68, 300, -1007 }, { -43, 301, -1009 }, { -22, 302, -1010 }, { -5, 303, -1011 }, - { 5, 304, -1012 }, { 9, 304, -1012 }, { 6, 304, -1012 }, { -3, 303, -1011 }, - { -18, 303, -1010 }, { -37, 302, -1009 }, { -60, 300, -1008 }, { -85, 299, -1006 }, - { -111, 298, -1004 }, { -138, 296, -1002 }, { -165, 295, -1001 }, { -190, 293, -999 }, - { -212, 292, -997 }, { -232, 291, -996 }, { -246, 290, -995 }, { -256, 290, -994 }, - { -260, 289, -994 }, { -256, 290, -994 }, { -245, 290, -995 }, { -228, 291, -996 }, - { -206, 292, -998 }, { -181, 294, -999 }, { -153, 295, -1001 }, { -125, 297, -1003 }, - { -96, 298, -1005 }, { -68, 300, -1007 }, { -43, 301, -1009 }, { -22, 302, -1010 }, - { -5, 303, -1011 }, { 5, 304, -1012 }, { 9, 304, -1012 }, { 5, 304, -1012 }, - { -7, 303, -1011 }, { -26, 302, -1010 }, { -51, 301, -1008 }, { -79, 299, -1006 }, - { -109, 298, -1004 }, { -140, 296, -1002 }, { -171, 294, -1000 }, { -199, 293, -998 }, - { -223, 291, -997 }, { -242, 290, -995 }, { -255, 290, -994 }, { -260, 289, -994 }, - { -256, 290, -995 }, { -247, 291, -996 }, { -234, 293, -999 }, { -216, 296, -1002 }, - { -194, 299, -1005 }, { -171, 302, -1008 }, { -146, 304, -1012 }, { -120, 307, -1015 }, - { -94, 309, -1018 }, { -69, 311, -1020 }, { -46, 312, -1021 }, { -26, 312, -1021 }, - { -9, 311, -1020 }, { 2, 308, -1017 }, { 9, 304, -1012 }, { 13, 299, -1007 }, - { 17, 294, -1001 }, { 21, 289, -995 }, { 24, 283, -988 }, { 26, 277, -981 }, - { 29, 271, -974 }, { 30, 265, -967 }, { 32, 258, -960 }, { 33, 251, -952 }, - { 35, 245, -944 }, { 35, 238, -937 }, { 36, 231, -928 }, { 36, 223, -920 }, - { 36, 216, -912 }, { 36, 209, -903 }, { 36, 201, -895 }, { 35, 194, -886 }, - { 35, 186, -877 }, { 34, 178, -869 }, { 33, 170, -860 }, { 32, 163, -851 }, - { 30, 155, -842 }, { 29, 147, -833 }, { 27, 139, -824 }, { 26, 132, -816 }, - { 24, 124, -807 }, { 23, 116, -798 }, { 21, 109, -789 }, { 19, 101, -781 }, - { 17, 94, -772 }, { 16, 86, -764 }, { 14, 79, -755 }, { 12, 72, -747 }, - { 11, 65, -739 }, { 9, 58, -731 }, { 7, 51, -724 }, { 6, 45, -716 }, - { 5, 38, -709 }, { 3, 32, -702 }, { 2, 26, -695 }, { 1, 20, -688 }, - { 1, 15, -682 }, { 0, 9, -676 }, { 0, 4, -670 }, { 0, 0, -665 }, - { 0, -4, -660 }, { 0, -8, -655 }, { 0, -11, -652 }, { 0, -14, -649 }, - { 0, -16, -647 }, { 0, -17, -646 }, { 0, -19, -645 }, { 0, -19, -644 }, - { 0, -20, -644 }, { 0, -19, -645 }, { 0, -19, -646 }, { 0, -18, -647 }, - { 0, -17, -648 }, { 0, -15, -650 }, { 0, -13, -652 }, { 0, -11, -654 }, - { 0, -8, -657 }, { 0, -6, -659 }, { 0, -3, -662 }, { 0, 0, -665 }, - { 0, 3, -668 }, { -1, 8, -673 }, { -1, 13, -679 }, { -2, 20, -685 }, - { -3, 27, -693 }, { -4, 36, -701 }, { -6, 46, -710 }, { -7, 58, -719 }, - { -9, 71, -728 }, { -11, 85, -737 }, { -14, 102, -746 }, { -18, 123, -756 }, - { -23, 152, -770 }, { -30, 186, -784 }, { -37, 221, -799 }, { -44, 256, -813 }, - { -50, 289, -825 }, { -54, 316, -834 }, { -56, 335, -838 }, { -54, 344, -836 }, - { -51, 346, -830 }, { -47, 347, -823 }, { -42, 346, -815 }, { -37, 345, -806 }, - { -31, 342, -796 }, { -25, 339, -785 }, { -19, 334, -773 }, { -12, 329, -761 }, - { -6, 324, -748 }, { 0, 317, -735 }, { 7, 310, -722 }, { 15, 303, -709 }, - { 22, 295, -695 }, { 29, 287, -682 }, { 36, 279, -669 }, { 43, 271, -656 }, - { 50, 262, -644 }, { 57, 254, -632 }, { 63, 245, -621 }, { 69, 237, -611 }, - { 75, 229, -601 }, { 80, 222, -593 }, { 85, 215, -586 }, { 90, 208, -580 }, - { 93, 202, -576 }, { 97, 197, -573 }, { 97, 192, -577 }, { 94, 188, -591 }, - { 89, 184, -613 }, { 81, 181, -641 }, { 72, 178, -671 }, { 63, 175, -701 }, - { 55, 173, -728 }, { 48, 170, -750 }, { 44, 167, -765 }, { 46, 165, -759 }, - { 53, 163, -734 }, { 60, 162, -709 }, { 61, 162, -706 }, { 52, 164, -736 }, - { 37, 167, -787 }, { 22, 170, -839 }, { 12, 173, -873 }, { 12, 173, -875 }, - { 17, 172, -857 }, { 23, 171, -836 }, { 29, 170, -817 }, { 36, 169, -794 }, - { 41, 168, -774 }, { 44, 167, -765 }, { 44, 167, -764 }, { 45, 167, -763 }, - { 45, 167, -762 }, { 45, 167, -761 }, { 45, 167, -760 }, { 46, 167, -760 }, - { 46, 167, -759 }, { 46, 167, -758 }, { 46, 167, -758 }, { 46, 167, -757 }, - { 46, 167, -757 }, { 47, 167, -757 }, { 47, 167, -756 }, { 47, 167, -756 }, - { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, - { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, - { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -757 }, - { 46, 167, -757 }, { 46, 167, -757 }, { 46, 167, -758 }, { 46, 167, -758 }, - { 46, 167, -758 }, { 46, 167, -759 }, { 46, 167, -759 }, { 46, 167, -759 }, - { 46, 167, -760 }, { 45, 167, -760 }, { 45, 167, -761 }, { 45, 167, -761 }, - { 45, 167, -761 }, { 45, 167, -762 }, { 45, 167, -762 }, { 45, 167, -763 }, - { 45, 167, -763 }, { 45, 167, -763 }, { 44, 167, -764 }, { 44, 167, -764 }, - { 44, 167, -764 }, { 44, 167, -764 }, { 44, 167, -765 }, { 44, 167, -765 }, - { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, - { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, - { 45, 171, -767 }, { 44, 167, -765 }, { 40, 151, -756 }, { 35, 132, -744 }, - { 29, 111, -731 }, { 23, 88, -718 }, { 17, 66, -704 }, { 11, 45, -692 }, - { 7, 27, -681 }, { 3, 12, -672 }, { 0, 3, -667 }, { 0, 0, -665 }, + { 0, 0, -665 }, { 0, 0, -664 }, { 0, 0, -663 }, { 0, 0, -661 }, { 0, 0, -659 }, + { 0, 0, -656 }, { 0, 0, -653 }, { 0, 0, -650 }, { 0, 0, -647 }, { 0, 0, -644 }, + { 0, 0, -641 }, { 0, 0, -638 }, { 0, 0, -636 }, { 0, 0, -634 }, { 0, 0, -633 }, + { 0, 0, -633 }, { 0, 0, -634 }, { 0, 0, -636 }, { 0, 0, -639 }, { 0, 0, -643 }, + { 0, 0, -649 }, { 0, 0, -656 }, { 0, 0, -665 }, { 0, 0, -692 }, { 0, 2, -744 }, + { 0, 3, -808 }, { 1, 5, -871 }, { 1, 6, -917 }, { 2, 7, -934 }, { 2, 7, -929 }, + { 2, 7, -919 }, { 3, 7, -906 }, { 3, 7, -889 }, { 3, 7, -869 }, { 3, 7, -847 }, + { 4, 7, -823 }, { 4, 7, -798 }, { 4, 6, -772 }, { 4, 6, -746 }, { 5, 6, -721 }, + { 5, 6, -696 }, { 5, 5, -672 }, { 5, 5, -650 }, { 5, 5, -631 }, { 5, 5, -614 }, + { 6, 5, -602 }, { 6, 5, -593 }, { 6, 5, -587 }, { 6, 6, -585 }, { 6, 7, -586 }, + { 6, 8, -588 }, { 6, 9, -592 }, { 6, 9, -596 }, { 6, 10, -601 }, { 6, 10, -605 }, + { 6, 10, -607 }, { 6, 9, -608 }, { 6, 7, -606 }, { 6, 5, -602 }, { 6, 0, -590 }, + { 6, -7, -570 }, { 6, -16, -546 }, { 7, -26, -520 }, { 7, -36, -496 }, { 7, -45, -477 }, + { 7, -51, -465 }, { 7, -53, -465 }, { 3, -27, -566 }, { 0, 0, -665 }, { 0, 0, -649 }, + { 2, 1, -620 }, { 6, 5, -602 }, { 10, 10, -597 }, { 15, 17, -595 }, { 20, 24, -594 }, + { 25, 32, -595 }, { 30, 39, -596 }, { 35, 46, -598 }, { 39, 52, -599 }, { 43, 58, -600 }, + { 46, 62, -601 }, { 48, 65, -601 }, { 48, 67, -602 }, { 48, 68, -602 }, { 48, 69, -603 }, + { 47, 69, -603 }, { 46, 67, -603 }, { 46, 65, -602 }, { 46, 62, -601 }, { 46, 55, -597 }, + { 47, 43, -591 }, { 48, 30, -585 }, { 48, 20, -579 }, { 49, 14, -576 }, { 49, 12, -575 }, + { 49, 11, -574 }, { 50, 10, -572 }, { 50, 9, -571 }, { 51, 9, -570 }, { 52, 9, -568 }, + { 52, 9, -567 }, { 53, 10, -566 }, { 53, 10, -565 }, { 54, 11, -565 }, { 54, 12, -565 }, + { 54, 13, -565 }, { 54, 13, -565 }, { 54, 14, -566 }, { 53, 14, -568 }, { 52, 14, -570 }, + { 50, 14, -573 }, { 49, 14, -576 }, { 43, 12, -585 }, { 34, 10, -602 }, { 22, 6, -623 }, + { 11, 3, -643 }, { 3, 0, -659 }, { 0, 0, -665 }, { 0, 0, -665 }, { -14, 0, -665 }, + { -29, 0, -665 }, { -46, 0, -665 }, { -64, 0, -665 }, { -82, 0, -665 }, { -100, 0, -665 }, + { -118, 0, -665 }, { -136, 0, -665 }, { -152, 0, -665 }, { -167, 0, -665 }, { -180, 0, -665 }, + { -191, 0, -665 }, { -199, 0, -665 }, { -204, 0, -665 }, { -206, 0, -665 }, { -206, 0, -665 }, + { -205, 0, -665 }, { -204, 0, -665 }, { -202, 0, -666 }, { -200, 0, -666 }, { -198, 0, -667 }, + { -195, 0, -668 }, { -192, 0, -668 }, { -188, 0, -669 }, { -185, 0, -670 }, { -181, 0, -671 }, + { -176, 0, -672 }, { -172, 0, -673 }, { -167, 0, -674 }, { -161, 0, -675 }, { -156, 0, -676 }, + { -151, 0, -677 }, { -145, 0, -678 }, { -139, 0, -679 }, { -133, 0, -680 }, { -127, 0, -681 }, + { -120, 0, -681 }, { -114, 0, -682 }, { -108, 0, -682 }, { -101, 0, -683 }, { -95, 0, -683 }, + { -88, 0, -683 }, { -81, 0, -683 }, { -75, 0, -683 }, { -68, 0, -683 }, { -62, 0, -683 }, + { -56, 0, -682 }, { -49, 0, -681 }, { -43, 0, -680 }, { -37, 0, -679 }, { -31, 0, -678 }, + { -25, 0, -676 }, { -20, 0, -675 }, { -14, 0, -672 }, { -9, 0, -670 }, { -4, 0, -667 }, + { 0, 0, -665 }, { 3, -1, -647 }, { 5, -3, -609 }, { 7, -4, -566 }, { 7, -4, -532 }, + { 7, 0, -522 }, { 6, 6, -537 }, { 4, 17, -565 }, { 2, 30, -602 }, { 0, 42, -643 }, + { -1, 55, -682 }, { -3, 65, -716 }, { -5, 72, -739 }, { -5, 74, -745 }, { -6, 73, -741 }, + { -5, 71, -733 }, { -5, 67, -724 }, { -4, 64, -711 }, { -3, 59, -697 }, { -2, 54, -681 }, + { -1, 48, -664 }, { 0, 42, -645 }, { 1, 35, -626 }, { 3, 28, -606 }, { 4, 22, -586 }, + { 5, 15, -565 }, { 6, 8, -545 }, { 7, 2, -526 }, { 8, -3, -507 }, { 9, -8, -489 }, + { 9, -13, -473 }, { 9, -17, -458 }, { 9, -20, -445 }, { 8, -23, -435 }, { 7, -24, -426 }, + { 5, -24, -421 }, { 3, -23, -419 }, { 0, -20, -419 }, { -2, -16, -424 }, { -17, 8, -474 }, + { -45, 64, -587 }, { -78, 130, -727 }, { -106, 187, -856 }, { -117, 218, -937 }, { -113, 222, -973 }, + { -102, 216, -996 }, { -86, 203, -1007 }, { -68, 185, -1010 }, { -48, 165, -1008 }, { -29, 145, -1005 }, + { -13, 128, -1003 }, { -2, 117, -1005 }, { 4, 111, -1009 }, { 8, 107, -1012 }, { 10, 104, -1014 }, + { 10, 103, -1015 }, { 9, 103, -1016 }, { 9, 103, -1016 }, { 8, 104, -1016 }, { 8, 104, -1016 }, + { 8, 104, -1016 }, { 7, 103, -1017 }, { 7, 103, -1017 }, { 6, 103, -1018 }, { 6, 103, -1018 }, + { 5, 102, -1019 }, { 4, 102, -1020 }, { 3, 102, -1020 }, { 2, 102, -1021 }, { 1, 102, -1022 }, + { 0, 102, -1022 }, { 0, 102, -1022 }, { 0, 102, -1022 }, { -1, 102, -1022 }, { -2, 103, -1022 }, + { -2, 104, -1022 }, { -3, 105, -1021 }, { -3, 106, -1020 }, { -4, 107, -1018 }, { -4, 108, -1016 }, + { -4, 110, -1014 }, { -3, 112, -1011 }, { -3, 114, -1008 }, { -2, 117, -1005 }, { -1, 120, -1000 }, + { 0, 124, -995 }, { 1, 128, -989 }, { 3, 133, -981 }, { 6, 139, -973 }, { 8, 144, -965 }, + { 11, 151, -956 }, { 14, 157, -946 }, { 17, 164, -936 }, { 20, 170, -927 }, { 23, 177, -917 }, + { 27, 184, -907 }, { 30, 190, -897 }, { 33, 197, -888 }, { 36, 203, -879 }, { 38, 208, -870 }, + { 41, 213, -863 }, { 43, 218, -856 }, { 45, 222, -849 }, { 46, 226, -844 }, { 48, 229, -840 }, + { 49, 231, -836 }, { 50, 234, -832 }, { 51, 236, -829 }, { 52, 237, -827 }, { 52, 239, -825 }, + { 53, 240, -824 }, { 53, 240, -824 }, { 53, 240, -824 }, { 52, 239, -825 }, { 52, 238, -827 }, + { 51, 236, -830 }, { 50, 233, -834 }, { 48, 230, -838 }, { 46, 226, -844 }, { 44, 220, -853 }, + { 39, 210, -867 }, { 34, 199, -884 }, { 28, 186, -903 }, { 22, 172, -923 }, { 16, 158, -944 }, + { 10, 145, -963 }, { 4, 133, -981 }, { 0, 124, -995 }, { -2, 117, -1005 }, { -4, 113, -1011 }, + { -5, 110, -1015 }, { -6, 109, -1017 }, { -6, 108, -1018 }, { -6, 109, -1017 }, { -5, 110, -1016 }, + { -5, 111, -1014 }, { -4, 113, -1011 }, { -3, 114, -1009 }, { -3, 116, -1007 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, + { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1005 }, { -2, 117, -1006 }, + { -2, 117, -1006 }, { -2, 117, -1006 }, { -2, 117, -1007 }, { -2, 117, -1007 }, { -3, 117, -1007 }, + { -3, 117, -1008 }, { -3, 117, -1008 }, { -3, 117, -1009 }, { -3, 117, -1009 }, { -3, 117, -1010 }, + { -3, 117, -1010 }, { -3, 117, -1011 }, { -3, 117, -1011 }, { -3, 117, -1012 }, { -3, 117, -1012 }, + { -4, 117, -1013 }, { -4, 117, -1013 }, { -4, 117, -1014 }, { -4, 117, -1014 }, { -4, 117, -1015 }, + { -4, 117, -1015 }, { -4, 117, -1015 }, { -4, 117, -1016 }, { -4, 117, -1016 }, { -4, 117, -1017 }, + { -4, 117, -1017 }, { -4, 118, -1017 }, { -4, 118, -1017 }, { -5, 118, -1018 }, { -5, 118, -1018 }, + { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, { -5, 118, -1018 }, + { -5, 118, -1018 }, { -5, 118, -1018 }, { -4, 118, -1018 }, { -4, 118, -1017 }, { -4, 117, -1017 }, + { -4, 117, -1016 }, { -4, 117, -1016 }, { -4, 117, -1015 }, { -4, 117, -1015 }, { -4, 117, -1014 }, + { -4, 117, -1013 }, { -3, 117, -1012 }, { -3, 117, -1011 }, { -3, 117, -1010 }, { -3, 117, -1009 }, + { -3, 117, -1008 }, { -2, 117, -1006 }, { -2, 117, -1005 }, { 0, 116, -990 }, { 6, 115, -959 }, + { 12, 113, -927 }, { 16, 112, -909 }, { 17, 112, -904 }, { 17, 112, -903 }, { 17, 112, -905 }, + { 16, 112, -908 }, { 15, 113, -912 }, { 14, 113, -916 }, { 14, 113, -920 }, { 13, 113, -923 }, + { 13, 113, -924 }, { 13, 113, -922 }, { 14, 113, -918 }, { 16, 112, -909 }, { 20, 111, -885 }, + { 28, 110, -844 }, { 38, 108, -795 }, { 46, 106, -749 }, { 53, 104, -717 }, { 55, 103, -707 }, + { 54, 102, -718 }, { 51, 102, -737 }, { 47, 101, -763 }, { 43, 101, -793 }, { 37, 100, -827 }, + { 32, 100, -863 }, { 26, 100, -898 }, { 21, 100, -932 }, { 16, 100, -962 }, { 12, 101, -988 }, + { 9, 102, -1006 }, { 8, 104, -1016 }, { 8, 106, -1020 }, { 8, 108, -1024 }, { 8, 110, -1027 }, + { 8, 112, -1029 }, { 8, 114, -1031 }, { 9, 116, -1031 }, { 9, 118, -1032 }, { 10, 121, -1031 }, + { 11, 123, -1030 }, { 12, 125, -1028 }, { 13, 128, -1026 }, { 14, 130, -1024 }, { 15, 133, -1021 }, + { 17, 135, -1017 }, { 18, 138, -1014 }, { 19, 141, -1010 }, { 20, 143, -1006 }, { 22, 146, -1002 }, + { 23, 148, -998 }, { 24, 151, -993 }, { 26, 154, -989 }, { 27, 157, -984 }, { 28, 159, -980 }, + { 30, 162, -976 }, { 31, 165, -971 }, { 32, 167, -967 }, { 33, 170, -964 }, { 34, 173, -960 }, + { 35, 176, -957 }, { 36, 178, -954 }, { 36, 181, -952 }, { 37, 184, -950 }, { 37, 186, -948 }, + { 37, 189, -947 }, { 38, 192, -947 }, { 37, 194, -947 }, { 37, 197, -947 }, { 37, 200, -948 }, + { 37, 202, -948 }, { 37, 205, -949 }, { 36, 208, -950 }, { 36, 211, -951 }, { 36, 214, -952 }, + { 35, 216, -953 }, { 34, 219, -954 }, { 34, 222, -956 }, { 33, 225, -957 }, { 33, 228, -959 }, + { 32, 231, -960 }, { 31, 234, -962 }, { 30, 237, -964 }, { 29, 240, -966 }, { 29, 243, -968 }, + { 28, 246, -970 }, { 27, 248, -972 }, { 26, 251, -974 }, { 25, 254, -976 }, { 24, 257, -978 }, + { 23, 260, -980 }, { 22, 263, -982 }, { 22, 266, -984 }, { 21, 268, -986 }, { 20, 271, -988 }, + { 19, 274, -990 }, { 18, 276, -992 }, { 17, 279, -994 }, { 16, 282, -996 }, { 15, 284, -998 }, + { 15, 287, -1000 }, { 14, 289, -1002 }, { 13, 291, -1004 }, { 12, 294, -1005 }, { 12, 296, -1007 }, + { 11, 298, -1008 }, { 10, 300, -1010 }, { 10, 302, -1011 }, { 9, 304, -1012 }, { 9, 306, -1013 }, + { 9, 307, -1014 }, { 8, 308, -1015 }, { 8, 309, -1015 }, { 8, 309, -1015 }, { 8, 309, -1015 }, + { 8, 308, -1015 }, { 8, 308, -1015 }, { 9, 308, -1014 }, { 9, 307, -1014 }, { 9, 306, -1014 }, + { 9, 306, -1013 }, { 9, 305, -1013 }, { 9, 305, -1013 }, { 9, 304, -1012 }, { 9, 304, -1012 }, + { 10, 304, -1012 }, { 12, 304, -1013 }, { 14, 304, -1013 }, { 17, 305, -1013 }, { 20, 305, -1013 }, + { 23, 305, -1013 }, { 26, 305, -1013 }, { 28, 305, -1014 }, { 29, 305, -1014 }, { 28, 305, -1014 }, + { 27, 305, -1014 }, { 23, 305, -1013 }, { 17, 305, -1013 }, { 9, 304, -1012 }, { -1, 304, -1012 }, + { -17, 303, -1011 }, { -36, 302, -1009 }, { -57, 300, -1008 }, { -80, 299, -1006 }, { -105, 298, -1005 }, + { -130, 296, -1003 }, { -154, 295, -1001 }, { -178, 294, -1000 }, { -200, 293, -998 }, { -220, 292, -997 }, + { -236, 291, -996 }, { -249, 290, -995 }, { -257, 290, -994 }, { -260, 289, -994 }, { -256, 290, -994 }, + { -245, 290, -995 }, { -228, 291, -996 }, { -206, 292, -998 }, { -181, 294, -999 }, { -153, 295, -1001 }, + { -125, 297, -1003 }, { -96, 298, -1005 }, { -68, 300, -1007 }, { -43, 301, -1009 }, { -22, 302, -1010 }, + { -5, 303, -1011 }, { 5, 304, -1012 }, { 9, 304, -1012 }, { 6, 304, -1012 }, { -3, 303, -1011 }, + { -18, 303, -1010 }, { -37, 302, -1009 }, { -60, 300, -1008 }, { -85, 299, -1006 }, { -111, 298, -1004 }, + { -138, 296, -1002 }, { -165, 295, -1001 }, { -190, 293, -999 }, { -212, 292, -997 }, { -232, 291, -996 }, + { -246, 290, -995 }, { -256, 290, -994 }, { -260, 289, -994 }, { -256, 290, -994 }, { -245, 290, -995 }, + { -228, 291, -996 }, { -206, 292, -998 }, { -181, 294, -999 }, { -153, 295, -1001 }, { -125, 297, -1003 }, + { -96, 298, -1005 }, { -68, 300, -1007 }, { -43, 301, -1009 }, { -22, 302, -1010 }, { -5, 303, -1011 }, + { 5, 304, -1012 }, { 9, 304, -1012 }, { 5, 304, -1012 }, { -7, 303, -1011 }, { -26, 302, -1010 }, + { -51, 301, -1008 }, { -79, 299, -1006 }, { -109, 298, -1004 }, { -140, 296, -1002 }, { -171, 294, -1000 }, + { -199, 293, -998 }, { -223, 291, -997 }, { -242, 290, -995 }, { -255, 290, -994 }, { -260, 289, -994 }, + { -256, 290, -995 }, { -247, 291, -996 }, { -234, 293, -999 }, { -216, 296, -1002 }, { -194, 299, -1005 }, + { -171, 302, -1008 }, { -146, 304, -1012 }, { -120, 307, -1015 }, { -94, 309, -1018 }, { -69, 311, -1020 }, + { -46, 312, -1021 }, { -26, 312, -1021 }, { -9, 311, -1020 }, { 2, 308, -1017 }, { 9, 304, -1012 }, + { 13, 299, -1007 }, { 17, 294, -1001 }, { 21, 289, -995 }, { 24, 283, -988 }, { 26, 277, -981 }, + { 29, 271, -974 }, { 30, 265, -967 }, { 32, 258, -960 }, { 33, 251, -952 }, { 35, 245, -944 }, + { 35, 238, -937 }, { 36, 231, -928 }, { 36, 223, -920 }, { 36, 216, -912 }, { 36, 209, -903 }, + { 36, 201, -895 }, { 35, 194, -886 }, { 35, 186, -877 }, { 34, 178, -869 }, { 33, 170, -860 }, + { 32, 163, -851 }, { 30, 155, -842 }, { 29, 147, -833 }, { 27, 139, -824 }, { 26, 132, -816 }, + { 24, 124, -807 }, { 23, 116, -798 }, { 21, 109, -789 }, { 19, 101, -781 }, { 17, 94, -772 }, + { 16, 86, -764 }, { 14, 79, -755 }, { 12, 72, -747 }, { 11, 65, -739 }, { 9, 58, -731 }, + { 7, 51, -724 }, { 6, 45, -716 }, { 5, 38, -709 }, { 3, 32, -702 }, { 2, 26, -695 }, + { 1, 20, -688 }, { 1, 15, -682 }, { 0, 9, -676 }, { 0, 4, -670 }, { 0, 0, -665 }, + { 0, -4, -660 }, { 0, -8, -655 }, { 0, -11, -652 }, { 0, -14, -649 }, { 0, -16, -647 }, + { 0, -17, -646 }, { 0, -19, -645 }, { 0, -19, -644 }, { 0, -20, -644 }, { 0, -19, -645 }, + { 0, -19, -646 }, { 0, -18, -647 }, { 0, -17, -648 }, { 0, -15, -650 }, { 0, -13, -652 }, + { 0, -11, -654 }, { 0, -8, -657 }, { 0, -6, -659 }, { 0, -3, -662 }, { 0, 0, -665 }, + { 0, 3, -668 }, { -1, 8, -673 }, { -1, 13, -679 }, { -2, 20, -685 }, { -3, 27, -693 }, + { -4, 36, -701 }, { -6, 46, -710 }, { -7, 58, -719 }, { -9, 71, -728 }, { -11, 85, -737 }, + { -14, 102, -746 }, { -18, 123, -756 }, { -23, 152, -770 }, { -30, 186, -784 }, { -37, 221, -799 }, + { -44, 256, -813 }, { -50, 289, -825 }, { -54, 316, -834 }, { -56, 335, -838 }, { -54, 344, -836 }, + { -51, 346, -830 }, { -47, 347, -823 }, { -42, 346, -815 }, { -37, 345, -806 }, { -31, 342, -796 }, + { -25, 339, -785 }, { -19, 334, -773 }, { -12, 329, -761 }, { -6, 324, -748 }, { 0, 317, -735 }, + { 7, 310, -722 }, { 15, 303, -709 }, { 22, 295, -695 }, { 29, 287, -682 }, { 36, 279, -669 }, + { 43, 271, -656 }, { 50, 262, -644 }, { 57, 254, -632 }, { 63, 245, -621 }, { 69, 237, -611 }, + { 75, 229, -601 }, { 80, 222, -593 }, { 85, 215, -586 }, { 90, 208, -580 }, { 93, 202, -576 }, + { 97, 197, -573 }, { 97, 192, -577 }, { 94, 188, -591 }, { 89, 184, -613 }, { 81, 181, -641 }, + { 72, 178, -671 }, { 63, 175, -701 }, { 55, 173, -728 }, { 48, 170, -750 }, { 44, 167, -765 }, + { 46, 165, -759 }, { 53, 163, -734 }, { 60, 162, -709 }, { 61, 162, -706 }, { 52, 164, -736 }, + { 37, 167, -787 }, { 22, 170, -839 }, { 12, 173, -873 }, { 12, 173, -875 }, { 17, 172, -857 }, + { 23, 171, -836 }, { 29, 170, -817 }, { 36, 169, -794 }, { 41, 168, -774 }, { 44, 167, -765 }, + { 44, 167, -764 }, { 45, 167, -763 }, { 45, 167, -762 }, { 45, 167, -761 }, { 45, 167, -760 }, + { 46, 167, -760 }, { 46, 167, -759 }, { 46, 167, -758 }, { 46, 167, -758 }, { 46, 167, -757 }, + { 46, 167, -757 }, { 47, 167, -757 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, + { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, + { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, { 47, 167, -756 }, + { 47, 167, -757 }, { 46, 167, -757 }, { 46, 167, -757 }, { 46, 167, -758 }, { 46, 167, -758 }, + { 46, 167, -758 }, { 46, 167, -759 }, { 46, 167, -759 }, { 46, 167, -759 }, { 46, 167, -760 }, + { 45, 167, -760 }, { 45, 167, -761 }, { 45, 167, -761 }, { 45, 167, -761 }, { 45, 167, -762 }, + { 45, 167, -762 }, { 45, 167, -763 }, { 45, 167, -763 }, { 45, 167, -763 }, { 44, 167, -764 }, + { 44, 167, -764 }, { 44, 167, -764 }, { 44, 167, -764 }, { 44, 167, -765 }, { 44, 167, -765 }, + { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, + { 44, 167, -765 }, { 44, 167, -765 }, { 44, 167, -765 }, { 45, 171, -767 }, { 44, 167, -765 }, + { 40, 151, -756 }, { 35, 132, -744 }, { 29, 111, -731 }, { 23, 88, -718 }, { 17, 66, -704 }, + { 11, 45, -692 }, { 7, 27, -681 }, { 3, 12, -672 }, { 0, 3, -667 }, { 0, 0, -665 }, }; static s16 animdata_mario_lips_4_2[][3] = { - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, - { 51, 6, -623 }, { 51, 9, -623 }, { 50, 15, -624 }, { 49, 22, -624 }, { 48, 30, -624 }, - { 47, 39, -625 }, { 46, 50, -625 }, { 45, 61, -626 }, { 43, 72, -626 }, { 42, 83, -627 }, - { 40, 94, -627 }, { 39, 105, -627 }, { 38, 115, -628 }, { 37, 124, -628 }, { 36, 132, -629 }, - { 35, 139, -629 }, { 35, 143, -629 }, { 34, 146, -629 }, { 34, 148, -629 }, { 34, 149, -629 }, - { 34, 151, -629 }, { 34, 152, -629 }, { 33, 153, -629 }, { 33, 154, -629 }, { 33, 156, -628 }, - { 33, 157, -628 }, { 33, 157, -627 }, { 33, 158, -627 }, { 33, 159, -627 }, { 33, 160, -626 }, - { 33, 161, -626 }, { 34, 161, -625 }, { 34, 162, -624 }, { 34, 162, -624 }, { 34, 163, -623 }, - { 34, 163, -622 }, { 34, 163, -622 }, { 34, 163, -621 }, { 34, 164, -620 }, { 35, 164, -620 }, - { 35, 164, -619 }, { 35, 164, -618 }, { 35, 164, -618 }, { 35, 164, -617 }, { 36, 164, -616 }, - { 36, 163, -615 }, { 36, 163, -615 }, { 36, 163, -614 }, { 36, 163, -614 }, { 36, 162, -613 }, - { 37, 162, -612 }, { 37, 162, -612 }, { 37, 161, -611 }, { 37, 161, -611 }, { 37, 161, -610 }, - { 37, 160, -610 }, { 38, 160, -610 }, { 38, 159, -609 }, { 38, 159, -609 }, { 38, 158, -609 }, - { 38, 158, -609 }, { 38, 157, -609 }, { 38, 157, -609 }, { 38, 156, -609 }, { 38, 155, -609 }, - { 38, 155, -609 }, { 38, 154, -609 }, { 38, 154, -609 }, { 38, 153, -610 }, { 38, 153, -610 }, - { 38, 152, -611 }, { 38, 151, -611 }, { 38, 151, -612 }, { 38, 150, -613 }, { 38, 150, -614 }, - { 37, 149, -615 }, { 37, 149, -616 }, { 37, 149, -617 }, { 37, 148, -619 }, { 36, 148, -620 }, - { 36, 147, -622 }, { 36, 147, -623 }, { 35, 147, -625 }, { 35, 146, -627 }, { 34, 146, -629 }, - { 33, 146, -635 }, { 30, 145, -649 }, { 26, 144, -667 }, { 21, 143, -689 }, { 15, 141, -712 }, - { 10, 139, -736 }, { 5, 137, -757 }, { 0, 134, -775 }, { -2, 131, -788 }, { -4, 127, -793 }, - { -5, 123, -793 }, { -5, 118, -792 }, { -6, 113, -790 }, { -6, 107, -787 }, { -6, 102, -784 }, - { -7, 95, -779 }, { -7, 89, -774 }, { -7, 83, -768 }, { -6, 76, -761 }, { -6, 70, -754 }, - { -6, 63, -747 }, { -5, 57, -739 }, { -5, 50, -732 }, { -4, 44, -724 }, { -4, 38, -717 }, - { -3, 32, -709 }, { -3, 27, -702 }, { -2, 21, -695 }, { -2, 17, -689 }, { -1, 12, -683 }, - { -1, 9, -678 }, { 0, 6, -673 }, { 0, 3, -670 }, { 0, 1, -667 }, { 0, 0, -665 }, - { 0, 0, -665 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, + { 51, 5, -623 }, { 51, 5, -623 }, { 51, 5, -623 }, { 51, 6, -623 }, { 51, 9, -623 }, { 50, 15, -624 }, + { 49, 22, -624 }, { 48, 30, -624 }, { 47, 39, -625 }, { 46, 50, -625 }, { 45, 61, -626 }, { 43, 72, -626 }, + { 42, 83, -627 }, { 40, 94, -627 }, { 39, 105, -627 }, { 38, 115, -628 }, { 37, 124, -628 }, { 36, 132, -629 }, + { 35, 139, -629 }, { 35, 143, -629 }, { 34, 146, -629 }, { 34, 148, -629 }, { 34, 149, -629 }, { 34, 151, -629 }, + { 34, 152, -629 }, { 33, 153, -629 }, { 33, 154, -629 }, { 33, 156, -628 }, { 33, 157, -628 }, { 33, 157, -627 }, + { 33, 158, -627 }, { 33, 159, -627 }, { 33, 160, -626 }, { 33, 161, -626 }, { 34, 161, -625 }, { 34, 162, -624 }, + { 34, 162, -624 }, { 34, 163, -623 }, { 34, 163, -622 }, { 34, 163, -622 }, { 34, 163, -621 }, { 34, 164, -620 }, + { 35, 164, -620 }, { 35, 164, -619 }, { 35, 164, -618 }, { 35, 164, -618 }, { 35, 164, -617 }, { 36, 164, -616 }, + { 36, 163, -615 }, { 36, 163, -615 }, { 36, 163, -614 }, { 36, 163, -614 }, { 36, 162, -613 }, { 37, 162, -612 }, + { 37, 162, -612 }, { 37, 161, -611 }, { 37, 161, -611 }, { 37, 161, -610 }, { 37, 160, -610 }, { 38, 160, -610 }, + { 38, 159, -609 }, { 38, 159, -609 }, { 38, 158, -609 }, { 38, 158, -609 }, { 38, 157, -609 }, { 38, 157, -609 }, + { 38, 156, -609 }, { 38, 155, -609 }, { 38, 155, -609 }, { 38, 154, -609 }, { 38, 154, -609 }, { 38, 153, -610 }, + { 38, 153, -610 }, { 38, 152, -611 }, { 38, 151, -611 }, { 38, 151, -612 }, { 38, 150, -613 }, { 38, 150, -614 }, + { 37, 149, -615 }, { 37, 149, -616 }, { 37, 149, -617 }, { 37, 148, -619 }, { 36, 148, -620 }, { 36, 147, -622 }, + { 36, 147, -623 }, { 35, 147, -625 }, { 35, 146, -627 }, { 34, 146, -629 }, { 33, 146, -635 }, { 30, 145, -649 }, + { 26, 144, -667 }, { 21, 143, -689 }, { 15, 141, -712 }, { 10, 139, -736 }, { 5, 137, -757 }, { 0, 134, -775 }, + { -2, 131, -788 }, { -4, 127, -793 }, { -5, 123, -793 }, { -5, 118, -792 }, { -6, 113, -790 }, { -6, 107, -787 }, + { -6, 102, -784 }, { -7, 95, -779 }, { -7, 89, -774 }, { -7, 83, -768 }, { -6, 76, -761 }, { -6, 70, -754 }, + { -6, 63, -747 }, { -5, 57, -739 }, { -5, 50, -732 }, { -4, 44, -724 }, { -4, 38, -717 }, { -3, 32, -709 }, + { -3, 27, -702 }, { -2, 21, -695 }, { -2, 17, -689 }, { -1, 12, -683 }, { -1, 9, -678 }, { 0, 6, -673 }, + { 0, 3, -670 }, { 0, 1, -667 }, { 0, 0, -665 }, { 0, 0, -665 }, }; struct AnimDataInfo anim_mario_lips_4[] = { @@ -2114,211 +1874,170 @@ struct AnimDataInfo anim_mario_lips_4[] = { }; static s16 animdata_mario_ear_left_1[][3] = { - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1535 }, - { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, - { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, - { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, - { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, - { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, - { 1800, 1800, -1538 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, - { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, - { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, - { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1542 }, - { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, - { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, - { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, - { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, - { 1800, 1800, -1543 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, - { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1540 }, - { 1800, 1800, -1540 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1538 }, - { 1800, 1800, -1538 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1536 }, - { 1800, 1800, -1536 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1510 }, { 1800, 1800, -1469 }, { 1800, 1800, -1459 }, { 1800, 1800, -1497 }, - { 1800, 1800, -1557 }, { 1800, 1800, -1622 }, { 1800, 1800, -1676 }, { 1800, 1800, -1703 }, - { 1800, 1800, -1691 }, { 1800, 1800, -1651 }, { 1800, 1800, -1601 }, { 1800, 1800, -1556 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1529 }, { 1800, 1800, -1525 }, { 1800, 1800, -1522 }, - { 1800, 1800, -1520 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, - { 1800, 1800, -1520 }, { 1800, 1800, -1521 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, - { 1800, 1800, -1528 }, { 1800, 1800, -1530 }, { 1800, 1800, -1532 }, { 1800, 1800, -1535 }, - { 1800, 1800, -1537 }, { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, { 1800, 1800, -1542 }, - { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1541 }, { 1800, 1800, -1540 }, - { 1800, 1800, -1537 }, { 1800, 1800, -1534 }, { 1800, 1800, -1519 }, { 1800, 1800, -1489 }, - { 1800, 1800, -1454 }, { 1800, 1800, -1425 }, { 1800, 1800, -1414 }, { 1800, 1800, -1415 }, - { 1800, 1800, -1419 }, { 1800, 1800, -1425 }, { 1800, 1800, -1432 }, { 1800, 1800, -1441 }, - { 1800, 1800, -1452 }, { 1800, 1800, -1462 }, { 1800, 1800, -1474 }, { 1800, 1800, -1485 }, - { 1800, 1800, -1496 }, { 1800, 1800, -1506 }, { 1800, 1800, -1516 }, { 1800, 1800, -1523 }, - { 1800, 1800, -1530 }, { 1800, 1800, -1534 }, { 1800, 1800, -1537 }, { 1800, 1800, -1539 }, - { 1800, 1800, -1541 }, { 1800, 1800, -1543 }, { 1800, 1800, -1545 }, { 1800, 1800, -1546 }, - { 1800, 1800, -1547 }, { 1800, 1800, -1548 }, { 1800, 1800, -1548 }, { 1800, 1800, -1549 }, - { 1800, 1800, -1549 }, { 1800, 1800, -1549 }, { 1800, 1800, -1548 }, { 1800, 1800, -1548 }, - { 1800, 1800, -1547 }, { 1800, 1800, -1546 }, { 1800, 1800, -1545 }, { 1800, 1800, -1544 }, - { 1800, 1800, -1543 }, { 1800, 1800, -1542 }, { 1800, 1800, -1540 }, { 1800, 1800, -1539 }, - { 1800, 1800, -1537 }, { 1800, 1800, -1535 }, { 1800, 1800, -1534 }, { 1800, 1800, -1532 }, - { 1800, 1800, -1529 }, { 1800, 1800, -1527 }, { 1800, 1800, -1523 }, { 1800, 1800, -1520 }, - { 1800, 1800, -1516 }, { 1800, 1800, -1511 }, { 1800, 1800, -1507 }, { 1800, 1800, -1502 }, - { 1800, 1800, -1498 }, { 1800, 1800, -1493 }, { 1800, 1800, -1489 }, { 1800, 1800, -1484 }, - { 1800, 1800, -1480 }, { 1800, 1800, -1475 }, { 1800, 1800, -1472 }, { 1800, 1800, -1468 }, - { 1800, 1800, -1465 }, { 1800, 1800, -1462 }, { 1800, 1800, -1459 }, { 1800, 1800, -1457 }, - { 1800, 1800, -1455 }, { 1800, 1800, -1454 }, { 1800, 1800, -1452 }, { 1800, 1800, -1451 }, - { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, - { 1800, 1800, -1450 }, { 1800, 1800, -1451 }, { 1800, 1800, -1453 }, { 1800, 1800, -1454 }, - { 1800, 1800, -1457 }, { 1800, 1800, -1459 }, { 1800, 1800, -1463 }, { 1800, 1800, -1468 }, - { 1800, 1800, -1474 }, { 1800, 1800, -1480 }, { 1800, 1800, -1488 }, { 1800, 1800, -1496 }, - { 1800, 1800, -1505 }, { 1800, 1800, -1514 }, { 1800, 1800, -1524 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1544 }, { 1800, 1800, -1555 }, { 1800, 1800, -1567 }, { 1800, 1800, -1579 }, - { 1800, 1800, -1592 }, { 1800, 1800, -1604 }, { 1800, 1800, -1617 }, { 1800, 1800, -1630 }, - { 1800, 1800, -1642 }, { 1800, 1800, -1655 }, { 1800, 1800, -1666 }, { 1800, 1800, -1677 }, - { 1800, 1800, -1689 }, { 1800, 1800, -1704 }, { 1800, 1800, -1718 }, { 1800, 1800, -1730 }, - { 1800, 1800, -1739 }, { 1800, 1800, -1741 }, { 1800, 1800, -1734 }, { 1800, 1800, -1713 }, - { 1800, 1800, -1676 }, { 1800, 1800, -1632 }, { 1800, 1800, -1588 }, { 1800, 1800, -1553 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1527 }, { 1800, 1800, -1521 }, { 1800, 1800, -1517 }, - { 1800, 1800, -1514 }, { 1800, 1800, -1512 }, { 1800, 1800, -1511 }, { 1800, 1800, -1511 }, - { 1800, 1800, -1512 }, { 1800, 1800, -1513 }, { 1800, 1800, -1515 }, { 1800, 1800, -1517 }, - { 1800, 1800, -1519 }, { 1800, 1800, -1522 }, { 1800, 1800, -1524 }, { 1800, 1800, -1527 }, - { 1800, 1800, -1529 }, { 1800, 1800, -1531 }, { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1535 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, - { 1800, 1800, -1537 }, { 1800, 1800, -1538 }, { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, - { 1800, 1800, -1541 }, { 1800, 1800, -1542 }, { 1800, 1800, -1544 }, { 1800, 1800, -1545 }, - { 1800, 1800, -1546 }, { 1800, 1800, -1548 }, { 1800, 1800, -1549 }, { 1800, 1800, -1550 }, - { 1800, 1800, -1552 }, { 1800, 1800, -1553 }, { 1800, 1800, -1554 }, { 1800, 1800, -1555 }, - { 1800, 1800, -1557 }, { 1800, 1800, -1558 }, { 1800, 1800, -1559 }, { 1800, 1800, -1560 }, - { 1800, 1800, -1561 }, { 1800, 1800, -1562 }, { 1800, 1800, -1563 }, { 1800, 1800, -1564 }, - { 1800, 1800, -1564 }, { 1800, 1800, -1565 }, { 1800, 1800, -1565 }, { 1800, 1800, -1566 }, - { 1800, 1800, -1566 }, { 1800, 1800, -1566 }, { 1800, 1800, -1565 }, { 1800, 1800, -1565 }, - { 1800, 1800, -1565 }, { 1800, 1800, -1564 }, { 1800, 1800, -1563 }, { 1800, 1800, -1562 }, - { 1800, 1800, -1561 }, { 1800, 1800, -1559 }, { 1800, 1800, -1557 }, { 1800, 1800, -1555 }, - { 1800, 1800, -1553 }, { 1800, 1800, -1550 }, { 1800, 1800, -1548 }, { 1800, 1800, -1545 }, - { 1800, 1800, -1541 }, { 1800, 1800, -1538 }, { 1800, 1800, -1534 }, { 1800, 1800, -1507 }, - { 1800, 1800, -1448 }, { 1800, 1800, -1380 }, { 1800, 1800, -1323 }, { 1800, 1800, -1299 }, - { 1800, 1800, -1300 }, { 1800, 1800, -1304 }, { 1800, 1800, -1309 }, { 1800, 1800, -1317 }, - { 1800, 1800, -1326 }, { 1800, 1800, -1337 }, { 1800, 1800, -1349 }, { 1800, 1800, -1362 }, - { 1800, 1800, -1376 }, { 1800, 1800, -1392 }, { 1800, 1800, -1407 }, { 1800, 1800, -1423 }, - { 1800, 1800, -1440 }, { 1800, 1800, -1456 }, { 1800, 1800, -1473 }, { 1800, 1800, -1489 }, - { 1800, 1800, -1505 }, { 1800, 1800, -1520 }, { 1800, 1800, -1534 }, { 1800, 1800, -1555 }, - { 1800, 1800, -1583 }, { 1800, 1800, -1607 }, { 1800, 1800, -1614 }, { 1800, 1800, -1595 }, - { 1800, 1800, -1557 }, { 1800, 1800, -1520 }, { 1800, 1800, -1499 }, { 1800, 1800, -1514 }, - { 1800, 1800, -1549 }, { 1800, 1800, -1574 }, { 1800, 1800, -1580 }, { 1800, 1800, -1581 }, - { 1800, 1800, -1578 }, { 1800, 1800, -1575 }, { 1800, 1800, -1574 }, { 1800, 1799, -1574 }, - { 1800, 1799, -1574 }, { 1800, 1798, -1574 }, { 1800, 1797, -1574 }, { 1800, 1797, -1574 }, - { 1800, 1796, -1574 }, { 1800, 1795, -1574 }, { 1800, 1794, -1574 }, { 1800, 1794, -1574 }, - { 1800, 1794, -1574 }, { 1800, 1795, -1574 }, { 1800, 1796, -1574 }, { 1800, 1797, -1574 }, - { 1800, 1800, -1574 }, { 1799, 1803, -1574 }, { 1799, 1807, -1574 }, { 1799, 1812, -1574 }, - { 1799, 1818, -1574 }, { 1799, 1825, -1574 }, { 1799, 1831, -1574 }, { 1799, 1838, -1574 }, - { 1799, 1845, -1574 }, { 1799, 1851, -1574 }, { 1799, 1858, -1574 }, { 1799, 1863, -1574 }, - { 1799, 1867, -1574 }, { 1799, 1871, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, - { 1799, 1873, -1574 }, { 1799, 1870, -1574 }, { 1799, 1865, -1574 }, { 1799, 1859, -1574 }, - { 1799, 1852, -1574 }, { 1799, 1845, -1574 }, { 1799, 1837, -1574 }, { 1799, 1829, -1574 }, - { 1799, 1821, -1574 }, { 1799, 1814, -1574 }, { 1799, 1808, -1574 }, { 1799, 1804, -1574 }, - { 1799, 1801, -1574 }, { 1800, 1800, -1574 }, { 1799, 1800, -1574 }, { 1799, 1803, -1574 }, - { 1799, 1807, -1574 }, { 1799, 1813, -1574 }, { 1799, 1819, -1574 }, { 1799, 1826, -1574 }, - { 1799, 1833, -1574 }, { 1799, 1840, -1574 }, { 1799, 1848, -1574 }, { 1799, 1855, -1574 }, - { 1799, 1861, -1574 }, { 1799, 1866, -1574 }, { 1799, 1870, -1574 }, { 1799, 1873, -1574 }, - { 1799, 1874, -1574 }, { 1799, 1873, -1574 }, { 1799, 1870, -1574 }, { 1799, 1865, -1574 }, - { 1799, 1859, -1574 }, { 1799, 1852, -1574 }, { 1799, 1845, -1574 }, { 1799, 1837, -1574 }, - { 1799, 1829, -1574 }, { 1799, 1821, -1574 }, { 1799, 1814, -1574 }, { 1799, 1808, -1574 }, - { 1799, 1804, -1574 }, { 1799, 1801, -1574 }, { 1800, 1800, -1574 }, { 1799, 1801, -1574 }, - { 1799, 1804, -1574 }, { 1799, 1810, -1574 }, { 1799, 1816, -1574 }, { 1799, 1824, -1574 }, - { 1799, 1832, -1574 }, { 1799, 1841, -1574 }, { 1799, 1849, -1574 }, { 1799, 1857, -1574 }, - { 1799, 1864, -1574 }, { 1799, 1869, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, - { 1799, 1873, -1574 }, { 1799, 1871, -1574 }, { 1799, 1867, -1574 }, { 1799, 1862, -1574 }, - { 1799, 1856, -1575 }, { 1799, 1850, -1575 }, { 1799, 1843, -1575 }, { 1799, 1835, -1575 }, - { 1799, 1828, -1575 }, { 1799, 1822, -1575 }, { 1799, 1815, -1575 }, { 1799, 1810, -1575 }, - { 1799, 1805, -1575 }, { 1799, 1802, -1575 }, { 1800, 1800, -1574 }, { 1800, 1798, -1573 }, - { 1800, 1797, -1573 }, { 1800, 1796, -1572 }, { 1800, 1795, -1571 }, { 1800, 1795, -1570 }, - { 1800, 1794, -1569 }, { 1800, 1793, -1569 }, { 1800, 1793, -1568 }, { 1800, 1792, -1567 }, - { 1800, 1792, -1566 }, { 1800, 1792, -1565 }, { 1800, 1791, -1564 }, { 1800, 1791, -1563 }, - { 1800, 1791, -1562 }, { 1800, 1791, -1561 }, { 1800, 1791, -1560 }, { 1800, 1791, -1559 }, - { 1800, 1791, -1558 }, { 1800, 1792, -1557 }, { 1800, 1792, -1556 }, { 1800, 1792, -1555 }, - { 1800, 1792, -1554 }, { 1800, 1793, -1553 }, { 1800, 1793, -1552 }, { 1800, 1793, -1551 }, - { 1800, 1794, -1550 }, { 1800, 1794, -1549 }, { 1800, 1795, -1548 }, { 1800, 1795, -1547 }, - { 1800, 1795, -1546 }, { 1800, 1796, -1545 }, { 1800, 1796, -1544 }, { 1800, 1797, -1543 }, - { 1800, 1797, -1542 }, { 1800, 1797, -1541 }, { 1800, 1798, -1541 }, { 1800, 1798, -1540 }, - { 1800, 1798, -1539 }, { 1800, 1799, -1538 }, { 1800, 1799, -1537 }, { 1800, 1799, -1537 }, - { 1800, 1799, -1536 }, { 1800, 1799, -1535 }, { 1800, 1799, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1532 }, - { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, - { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, - { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1533 }, { 1800, 1800, -1532 }, { 1800, 1800, -1531 }, { 1800, 1800, -1529 }, - { 1800, 1800, -1527 }, { 1800, 1800, -1525 }, { 1800, 1800, -1523 }, { 1800, 1800, -1522 }, - { 1800, 1800, -1522 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, { 1800, 1800, -1529 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1541 }, { 1800, 1800, -1549 }, { 1800, 1800, -1559 }, - { 1800, 1800, -1569 }, { 1800, 1800, -1581 }, { 1800, 1800, -1593 }, { 1800, 1800, -1605 }, - { 1800, 1800, -1618 }, { 1800, 1800, -1631 }, { 1800, 1800, -1644 }, { 1800, 1800, -1657 }, - { 1800, 1800, -1669 }, { 1800, 1800, -1681 }, { 1800, 1800, -1691 }, { 1800, 1800, -1701 }, - { 1800, 1800, -1710 }, { 1800, 1800, -1717 }, { 1800, 1800, -1723 }, { 1800, 1800, -1728 }, - { 1800, 1800, -1732 }, { 1800, 1800, -1735 }, { 1800, 1800, -1736 }, { 1800, 1800, -1737 }, - { 1800, 1800, -1736 }, { 1800, 1800, -1733 }, { 1800, 1800, -1729 }, { 1800, 1800, -1724 }, - { 1800, 1800, -1717 }, { 1800, 1800, -1708 }, { 1800, 1800, -1696 }, { 1800, 1800, -1682 }, - { 1800, 1800, -1667 }, { 1800, 1800, -1650 }, { 1800, 1800, -1632 }, { 1800, 1800, -1615 }, - { 1800, 1800, -1597 }, { 1800, 1800, -1581 }, { 1800, 1800, -1566 }, { 1800, 1800, -1553 }, - { 1800, 1800, -1542 }, { 1800, 1800, -1534 }, { 1800, 1800, -1528 }, { 1800, 1800, -1524 }, - { 1800, 1800, -1521 }, { 1800, 1800, -1520 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, - { 1800, 1800, -1520 }, { 1800, 1800, -1521 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, - { 1800, 1800, -1527 }, { 1800, 1800, -1529 }, { 1800, 1800, -1531 }, { 1800, 1800, -1532 }, - { 1800, 1800, -1533 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, - { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1535 }, + { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, + { 1800, 1800, -1535 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, + { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, { 1800, 1800, -1537 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, + { 1800, 1800, -1538 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, + { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, + { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, + { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1545 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1544 }, { 1800, 1800, -1544 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, + { 1800, 1800, -1543 }, { 1800, 1800, -1543 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1541 }, { 1800, 1800, -1540 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1539 }, { 1800, 1800, -1539 }, { 1800, 1800, -1538 }, { 1800, 1800, -1538 }, { 1800, 1800, -1537 }, + { 1800, 1800, -1537 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1535 }, { 1800, 1800, -1535 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1510 }, { 1800, 1800, -1469 }, { 1800, 1800, -1459 }, { 1800, 1800, -1497 }, + { 1800, 1800, -1557 }, { 1800, 1800, -1622 }, { 1800, 1800, -1676 }, { 1800, 1800, -1703 }, { 1800, 1800, -1691 }, + { 1800, 1800, -1651 }, { 1800, 1800, -1601 }, { 1800, 1800, -1556 }, { 1800, 1800, -1534 }, { 1800, 1800, -1529 }, + { 1800, 1800, -1525 }, { 1800, 1800, -1522 }, { 1800, 1800, -1520 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, + { 1800, 1800, -1519 }, { 1800, 1800, -1520 }, { 1800, 1800, -1521 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, + { 1800, 1800, -1528 }, { 1800, 1800, -1530 }, { 1800, 1800, -1532 }, { 1800, 1800, -1535 }, { 1800, 1800, -1537 }, + { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, { 1800, 1800, -1542 }, + { 1800, 1800, -1541 }, { 1800, 1800, -1540 }, { 1800, 1800, -1537 }, { 1800, 1800, -1534 }, { 1800, 1800, -1519 }, + { 1800, 1800, -1489 }, { 1800, 1800, -1454 }, { 1800, 1800, -1425 }, { 1800, 1800, -1414 }, { 1800, 1800, -1415 }, + { 1800, 1800, -1419 }, { 1800, 1800, -1425 }, { 1800, 1800, -1432 }, { 1800, 1800, -1441 }, { 1800, 1800, -1452 }, + { 1800, 1800, -1462 }, { 1800, 1800, -1474 }, { 1800, 1800, -1485 }, { 1800, 1800, -1496 }, { 1800, 1800, -1506 }, + { 1800, 1800, -1516 }, { 1800, 1800, -1523 }, { 1800, 1800, -1530 }, { 1800, 1800, -1534 }, { 1800, 1800, -1537 }, + { 1800, 1800, -1539 }, { 1800, 1800, -1541 }, { 1800, 1800, -1543 }, { 1800, 1800, -1545 }, { 1800, 1800, -1546 }, + { 1800, 1800, -1547 }, { 1800, 1800, -1548 }, { 1800, 1800, -1548 }, { 1800, 1800, -1549 }, { 1800, 1800, -1549 }, + { 1800, 1800, -1549 }, { 1800, 1800, -1548 }, { 1800, 1800, -1548 }, { 1800, 1800, -1547 }, { 1800, 1800, -1546 }, + { 1800, 1800, -1545 }, { 1800, 1800, -1544 }, { 1800, 1800, -1543 }, { 1800, 1800, -1542 }, { 1800, 1800, -1540 }, + { 1800, 1800, -1539 }, { 1800, 1800, -1537 }, { 1800, 1800, -1535 }, { 1800, 1800, -1534 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1529 }, { 1800, 1800, -1527 }, { 1800, 1800, -1523 }, { 1800, 1800, -1520 }, { 1800, 1800, -1516 }, + { 1800, 1800, -1511 }, { 1800, 1800, -1507 }, { 1800, 1800, -1502 }, { 1800, 1800, -1498 }, { 1800, 1800, -1493 }, + { 1800, 1800, -1489 }, { 1800, 1800, -1484 }, { 1800, 1800, -1480 }, { 1800, 1800, -1475 }, { 1800, 1800, -1472 }, + { 1800, 1800, -1468 }, { 1800, 1800, -1465 }, { 1800, 1800, -1462 }, { 1800, 1800, -1459 }, { 1800, 1800, -1457 }, + { 1800, 1800, -1455 }, { 1800, 1800, -1454 }, { 1800, 1800, -1452 }, { 1800, 1800, -1451 }, { 1800, 1800, -1450 }, + { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1450 }, { 1800, 1800, -1451 }, + { 1800, 1800, -1453 }, { 1800, 1800, -1454 }, { 1800, 1800, -1457 }, { 1800, 1800, -1459 }, { 1800, 1800, -1463 }, + { 1800, 1800, -1468 }, { 1800, 1800, -1474 }, { 1800, 1800, -1480 }, { 1800, 1800, -1488 }, { 1800, 1800, -1496 }, + { 1800, 1800, -1505 }, { 1800, 1800, -1514 }, { 1800, 1800, -1524 }, { 1800, 1800, -1534 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1555 }, { 1800, 1800, -1567 }, { 1800, 1800, -1579 }, { 1800, 1800, -1592 }, { 1800, 1800, -1604 }, + { 1800, 1800, -1617 }, { 1800, 1800, -1630 }, { 1800, 1800, -1642 }, { 1800, 1800, -1655 }, { 1800, 1800, -1666 }, + { 1800, 1800, -1677 }, { 1800, 1800, -1689 }, { 1800, 1800, -1704 }, { 1800, 1800, -1718 }, { 1800, 1800, -1730 }, + { 1800, 1800, -1739 }, { 1800, 1800, -1741 }, { 1800, 1800, -1734 }, { 1800, 1800, -1713 }, { 1800, 1800, -1676 }, + { 1800, 1800, -1632 }, { 1800, 1800, -1588 }, { 1800, 1800, -1553 }, { 1800, 1800, -1534 }, { 1800, 1800, -1527 }, + { 1800, 1800, -1521 }, { 1800, 1800, -1517 }, { 1800, 1800, -1514 }, { 1800, 1800, -1512 }, { 1800, 1800, -1511 }, + { 1800, 1800, -1511 }, { 1800, 1800, -1512 }, { 1800, 1800, -1513 }, { 1800, 1800, -1515 }, { 1800, 1800, -1517 }, + { 1800, 1800, -1519 }, { 1800, 1800, -1522 }, { 1800, 1800, -1524 }, { 1800, 1800, -1527 }, { 1800, 1800, -1529 }, + { 1800, 1800, -1531 }, { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1535 }, { 1800, 1800, -1536 }, { 1800, 1800, -1536 }, { 1800, 1800, -1537 }, { 1800, 1800, -1538 }, + { 1800, 1800, -1539 }, { 1800, 1800, -1540 }, { 1800, 1800, -1541 }, { 1800, 1800, -1542 }, { 1800, 1800, -1544 }, + { 1800, 1800, -1545 }, { 1800, 1800, -1546 }, { 1800, 1800, -1548 }, { 1800, 1800, -1549 }, { 1800, 1800, -1550 }, + { 1800, 1800, -1552 }, { 1800, 1800, -1553 }, { 1800, 1800, -1554 }, { 1800, 1800, -1555 }, { 1800, 1800, -1557 }, + { 1800, 1800, -1558 }, { 1800, 1800, -1559 }, { 1800, 1800, -1560 }, { 1800, 1800, -1561 }, { 1800, 1800, -1562 }, + { 1800, 1800, -1563 }, { 1800, 1800, -1564 }, { 1800, 1800, -1564 }, { 1800, 1800, -1565 }, { 1800, 1800, -1565 }, + { 1800, 1800, -1566 }, { 1800, 1800, -1566 }, { 1800, 1800, -1566 }, { 1800, 1800, -1565 }, { 1800, 1800, -1565 }, + { 1800, 1800, -1565 }, { 1800, 1800, -1564 }, { 1800, 1800, -1563 }, { 1800, 1800, -1562 }, { 1800, 1800, -1561 }, + { 1800, 1800, -1559 }, { 1800, 1800, -1557 }, { 1800, 1800, -1555 }, { 1800, 1800, -1553 }, { 1800, 1800, -1550 }, + { 1800, 1800, -1548 }, { 1800, 1800, -1545 }, { 1800, 1800, -1541 }, { 1800, 1800, -1538 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1507 }, { 1800, 1800, -1448 }, { 1800, 1800, -1380 }, { 1800, 1800, -1323 }, { 1800, 1800, -1299 }, + { 1800, 1800, -1300 }, { 1800, 1800, -1304 }, { 1800, 1800, -1309 }, { 1800, 1800, -1317 }, { 1800, 1800, -1326 }, + { 1800, 1800, -1337 }, { 1800, 1800, -1349 }, { 1800, 1800, -1362 }, { 1800, 1800, -1376 }, { 1800, 1800, -1392 }, + { 1800, 1800, -1407 }, { 1800, 1800, -1423 }, { 1800, 1800, -1440 }, { 1800, 1800, -1456 }, { 1800, 1800, -1473 }, + { 1800, 1800, -1489 }, { 1800, 1800, -1505 }, { 1800, 1800, -1520 }, { 1800, 1800, -1534 }, { 1800, 1800, -1555 }, + { 1800, 1800, -1583 }, { 1800, 1800, -1607 }, { 1800, 1800, -1614 }, { 1800, 1800, -1595 }, { 1800, 1800, -1557 }, + { 1800, 1800, -1520 }, { 1800, 1800, -1499 }, { 1800, 1800, -1514 }, { 1800, 1800, -1549 }, { 1800, 1800, -1574 }, + { 1800, 1800, -1580 }, { 1800, 1800, -1581 }, { 1800, 1800, -1578 }, { 1800, 1800, -1575 }, { 1800, 1800, -1574 }, + { 1800, 1799, -1574 }, { 1800, 1799, -1574 }, { 1800, 1798, -1574 }, { 1800, 1797, -1574 }, { 1800, 1797, -1574 }, + { 1800, 1796, -1574 }, { 1800, 1795, -1574 }, { 1800, 1794, -1574 }, { 1800, 1794, -1574 }, { 1800, 1794, -1574 }, + { 1800, 1795, -1574 }, { 1800, 1796, -1574 }, { 1800, 1797, -1574 }, { 1800, 1800, -1574 }, { 1799, 1803, -1574 }, + { 1799, 1807, -1574 }, { 1799, 1812, -1574 }, { 1799, 1818, -1574 }, { 1799, 1825, -1574 }, { 1799, 1831, -1574 }, + { 1799, 1838, -1574 }, { 1799, 1845, -1574 }, { 1799, 1851, -1574 }, { 1799, 1858, -1574 }, { 1799, 1863, -1574 }, + { 1799, 1867, -1574 }, { 1799, 1871, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, { 1799, 1873, -1574 }, + { 1799, 1870, -1574 }, { 1799, 1865, -1574 }, { 1799, 1859, -1574 }, { 1799, 1852, -1574 }, { 1799, 1845, -1574 }, + { 1799, 1837, -1574 }, { 1799, 1829, -1574 }, { 1799, 1821, -1574 }, { 1799, 1814, -1574 }, { 1799, 1808, -1574 }, + { 1799, 1804, -1574 }, { 1799, 1801, -1574 }, { 1800, 1800, -1574 }, { 1799, 1800, -1574 }, { 1799, 1803, -1574 }, + { 1799, 1807, -1574 }, { 1799, 1813, -1574 }, { 1799, 1819, -1574 }, { 1799, 1826, -1574 }, { 1799, 1833, -1574 }, + { 1799, 1840, -1574 }, { 1799, 1848, -1574 }, { 1799, 1855, -1574 }, { 1799, 1861, -1574 }, { 1799, 1866, -1574 }, + { 1799, 1870, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, { 1799, 1873, -1574 }, { 1799, 1870, -1574 }, + { 1799, 1865, -1574 }, { 1799, 1859, -1574 }, { 1799, 1852, -1574 }, { 1799, 1845, -1574 }, { 1799, 1837, -1574 }, + { 1799, 1829, -1574 }, { 1799, 1821, -1574 }, { 1799, 1814, -1574 }, { 1799, 1808, -1574 }, { 1799, 1804, -1574 }, + { 1799, 1801, -1574 }, { 1800, 1800, -1574 }, { 1799, 1801, -1574 }, { 1799, 1804, -1574 }, { 1799, 1810, -1574 }, + { 1799, 1816, -1574 }, { 1799, 1824, -1574 }, { 1799, 1832, -1574 }, { 1799, 1841, -1574 }, { 1799, 1849, -1574 }, + { 1799, 1857, -1574 }, { 1799, 1864, -1574 }, { 1799, 1869, -1574 }, { 1799, 1873, -1574 }, { 1799, 1874, -1574 }, + { 1799, 1873, -1574 }, { 1799, 1871, -1574 }, { 1799, 1867, -1574 }, { 1799, 1862, -1574 }, { 1799, 1856, -1575 }, + { 1799, 1850, -1575 }, { 1799, 1843, -1575 }, { 1799, 1835, -1575 }, { 1799, 1828, -1575 }, { 1799, 1822, -1575 }, + { 1799, 1815, -1575 }, { 1799, 1810, -1575 }, { 1799, 1805, -1575 }, { 1799, 1802, -1575 }, { 1800, 1800, -1574 }, + { 1800, 1798, -1573 }, { 1800, 1797, -1573 }, { 1800, 1796, -1572 }, { 1800, 1795, -1571 }, { 1800, 1795, -1570 }, + { 1800, 1794, -1569 }, { 1800, 1793, -1569 }, { 1800, 1793, -1568 }, { 1800, 1792, -1567 }, { 1800, 1792, -1566 }, + { 1800, 1792, -1565 }, { 1800, 1791, -1564 }, { 1800, 1791, -1563 }, { 1800, 1791, -1562 }, { 1800, 1791, -1561 }, + { 1800, 1791, -1560 }, { 1800, 1791, -1559 }, { 1800, 1791, -1558 }, { 1800, 1792, -1557 }, { 1800, 1792, -1556 }, + { 1800, 1792, -1555 }, { 1800, 1792, -1554 }, { 1800, 1793, -1553 }, { 1800, 1793, -1552 }, { 1800, 1793, -1551 }, + { 1800, 1794, -1550 }, { 1800, 1794, -1549 }, { 1800, 1795, -1548 }, { 1800, 1795, -1547 }, { 1800, 1795, -1546 }, + { 1800, 1796, -1545 }, { 1800, 1796, -1544 }, { 1800, 1797, -1543 }, { 1800, 1797, -1542 }, { 1800, 1797, -1541 }, + { 1800, 1798, -1541 }, { 1800, 1798, -1540 }, { 1800, 1798, -1539 }, { 1800, 1799, -1538 }, { 1800, 1799, -1537 }, + { 1800, 1799, -1537 }, { 1800, 1799, -1536 }, { 1800, 1799, -1535 }, { 1800, 1799, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, { 1800, 1800, -1532 }, + { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, { 1800, 1800, -1533 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1533 }, { 1800, 1800, -1532 }, { 1800, 1800, -1531 }, { 1800, 1800, -1529 }, { 1800, 1800, -1527 }, + { 1800, 1800, -1525 }, { 1800, 1800, -1523 }, { 1800, 1800, -1522 }, { 1800, 1800, -1522 }, { 1800, 1800, -1523 }, + { 1800, 1800, -1525 }, { 1800, 1800, -1529 }, { 1800, 1800, -1534 }, { 1800, 1800, -1541 }, { 1800, 1800, -1549 }, + { 1800, 1800, -1559 }, { 1800, 1800, -1569 }, { 1800, 1800, -1581 }, { 1800, 1800, -1593 }, { 1800, 1800, -1605 }, + { 1800, 1800, -1618 }, { 1800, 1800, -1631 }, { 1800, 1800, -1644 }, { 1800, 1800, -1657 }, { 1800, 1800, -1669 }, + { 1800, 1800, -1681 }, { 1800, 1800, -1691 }, { 1800, 1800, -1701 }, { 1800, 1800, -1710 }, { 1800, 1800, -1717 }, + { 1800, 1800, -1723 }, { 1800, 1800, -1728 }, { 1800, 1800, -1732 }, { 1800, 1800, -1735 }, { 1800, 1800, -1736 }, + { 1800, 1800, -1737 }, { 1800, 1800, -1736 }, { 1800, 1800, -1733 }, { 1800, 1800, -1729 }, { 1800, 1800, -1724 }, + { 1800, 1800, -1717 }, { 1800, 1800, -1708 }, { 1800, 1800, -1696 }, { 1800, 1800, -1682 }, { 1800, 1800, -1667 }, + { 1800, 1800, -1650 }, { 1800, 1800, -1632 }, { 1800, 1800, -1615 }, { 1800, 1800, -1597 }, { 1800, 1800, -1581 }, + { 1800, 1800, -1566 }, { 1800, 1800, -1553 }, { 1800, 1800, -1542 }, { 1800, 1800, -1534 }, { 1800, 1800, -1528 }, + { 1800, 1800, -1524 }, { 1800, 1800, -1521 }, { 1800, 1800, -1520 }, { 1800, 1800, -1519 }, { 1800, 1800, -1519 }, + { 1800, 1800, -1520 }, { 1800, 1800, -1521 }, { 1800, 1800, -1523 }, { 1800, 1800, -1525 }, { 1800, 1800, -1527 }, + { 1800, 1800, -1529 }, { 1800, 1800, -1531 }, { 1800, 1800, -1532 }, { 1800, 1800, -1533 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, + { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, { 1800, 1800, -1534 }, }; struct AnimDataInfo anim_mario_ear_left[] = { diff --git a/src/goddard/dynlists/anim_group_2.c b/src/goddard/dynlists/anim_group_2.c index 47ecd26f..549181f5 100644 --- a/src/goddard/dynlists/anim_group_2.c +++ b/src/goddard/dynlists/anim_group_2.c @@ -5,170 +5,143 @@ #include "../gd_types.h" static s16 animdata_mario_ear_right_1[][3] = { - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, - { 0, 0, 264 }, { 0, 0, 263 }, { 0, 0, 263 }, { 0, 0, 263 }, { 0, 0, 263 }, - { 0, 0, 262 }, { 0, 0, 262 }, { 0, 0, 262 }, { 0, 0, 261 }, { 0, 0, 261 }, - { 0, 0, 261 }, { 0, 0, 260 }, { 0, 0, 260 }, { 0, 0, 260 }, { 0, 0, 259 }, - { 0, 0, 259 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 257 }, - { 0, 0, 257 }, { 0, 0, 256 }, { 0, 0, 256 }, { 0, 0, 256 }, { 0, 0, 255 }, - { 0, 0, 255 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 253 }, - { 0, 0, 253 }, { 0, 0, 252 }, { 0, 0, 252 }, { 0, 0, 252 }, { 0, 0, 251 }, - { 0, 0, 251 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 249 }, - { 0, 0, 249 }, { 0, 0, 249 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, - { 0, 0, 248 }, { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 247 }, - { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, - { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, - { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, - { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 247 }, - { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, - { 0, 0, 249 }, { 0, 0, 249 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 251 }, - { 0, 0, 251 }, { 0, 0, 252 }, { 0, 0, 253 }, { 0, 0, 253 }, { 0, 0, 254 }, - { 0, 0, 255 }, { 0, 0, 256 }, { 0, 0, 257 }, { 0, 0, 258 }, { 0, 0, 259 }, - { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 262 }, { 0, 0, 263 }, { 0, 0, 264 }, - { 0, 0, 265 }, { 0, 0, 289 }, { 0, 0, 338 }, { 0, 0, 385 }, { 0, 0, 403 }, - { 0, 0, 381 }, { 0, 0, 337 }, { 0, 0, 284 }, { 0, 0, 237 }, { 0, 0, 208 }, - { 0, 0, 208 }, { 0, 0, 228 }, { 0, 0, 252 }, { 0, 0, 265 }, { 0, 0, 267 }, - { 0, 0, 268 }, { 0, 0, 269 }, { 0, 0, 269 }, { 0, 0, 268 }, { 0, 0, 268 }, - { 0, 0, 267 }, { 0, 0, 266 }, { 0, 0, 265 }, { 0, 0, 263 }, { 0, 0, 262 }, - { 0, 0, 260 }, { 0, 0, 259 }, { 0, 0, 257 }, { 0, 0, 256 }, { 0, 0, 255 }, - { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 255 }, { 0, 0, 255 }, - { 0, 0, 257 }, { 0, 0, 259 }, { 0, 0, 262 }, { 0, 0, 265 }, { 0, 0, 280 }, - { 0, 0, 308 }, { 0, 0, 341 }, { 0, 0, 368 }, { 0, 0, 380 }, { 0, 0, 378 }, - { 0, 0, 375 }, { 0, 0, 369 }, { 0, 0, 362 }, { 0, 0, 353 }, { 0, 0, 344 }, - { 0, 0, 333 }, { 0, 0, 322 }, { 0, 0, 312 }, { 0, 0, 301 }, { 0, 0, 291 }, - { 0, 0, 283 }, { 0, 0, 275 }, { 0, 0, 269 }, { 0, 0, 265 }, { 0, 0, 263 }, - { 0, 0, 261 }, { 0, 0, 259 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 258 }, - { 0, 0, 258 }, { 0, 0, 259 }, { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 262 }, - { 0, 0, 263 }, { 0, 0, 265 }, { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 269 }, - { 0, 0, 270 }, { 0, 0, 270 }, { 0, 0, 271 }, { 0, 0, 271 }, { 0, 0, 271 }, - { 0, 0, 270 }, { 0, 0, 269 }, { 0, 0, 267 }, { 0, 0, 265 }, { 0, 0, 262 }, - { 0, 0, 258 }, { 0, 0, 254 }, { 0, 0, 249 }, { 0, 0, 243 }, { 0, 0, 237 }, - { 0, 0, 231 }, { 0, 0, 224 }, { 0, 0, 217 }, { 0, 0, 210 }, { 0, 0, 203 }, - { 0, 0, 195 }, { 0, 0, 188 }, { 0, 0, 182 }, { 0, 0, 175 }, { 0, 0, 169 }, - { 0, 0, 164 }, { 0, 0, 159 }, { 0, 0, 154 }, { 0, 0, 151 }, { 0, 0, 147 }, - { 0, 0, 145 }, { 0, 0, 142 }, { 0, 0, 140 }, { 0, 0, 138 }, { 0, 0, 137 }, - { 0, 0, 136 }, { 0, 0, 136 }, { 0, 0, 136 }, { 0, 0, 137 }, { 0, 0, 138 }, - { 0, 0, 140 }, { 0, 0, 143 }, { 0, 0, 146 }, { 0, 0, 151 }, { 0, 0, 157 }, - { 0, 0, 166 }, { 0, 0, 177 }, { 0, 0, 189 }, { 0, 0, 203 }, { 0, 0, 217 }, - { 0, 0, 231 }, { 0, 0, 244 }, { 0, 0, 255 }, { 0, 0, 265 }, { 0, 0, 274 }, - { 0, 0, 283 }, { 0, 0, 291 }, { 0, 0, 300 }, { 0, 0, 308 }, { 0, 0, 315 }, - { 0, 0, 322 }, { 0, 0, 328 }, { 0, 0, 333 }, { 0, 0, 337 }, { 0, 0, 339 }, - { 0, 0, 340 }, { 0, 0, 336 }, { 0, 0, 327 }, { 0, 0, 315 }, { 0, 0, 300 }, - { 0, 0, 286 }, { 0, 0, 273 }, { 0, 0, 265 }, { 0, 0, 261 }, { 0, 0, 260 }, - { 0, 0, 261 }, { 0, 0, 263 }, { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 266 }, - { 0, 0, 266 }, { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 267 }, { 0, 0, 268 }, - { 0, 0, 269 }, { 0, 0, 269 }, { 0, 0, 270 }, { 0, 0, 271 }, { 0, 0, 272 }, - { 0, 0, 273 }, { 0, 0, 274 }, { 0, 0, 274 }, { 0, 0, 275 }, { 0, 0, 276 }, - { 0, 0, 277 }, { 0, 0, 278 }, { 0, 0, 279 }, { 0, 0, 280 }, { 0, 0, 281 }, - { 0, 0, 282 }, { 0, 0, 282 }, { 0, 0, 283 }, { 0, 0, 284 }, { 0, 0, 284 }, - { 0, 0, 285 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 287 }, - { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 286 }, - { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 285 }, { 0, 0, 284 }, { 0, 0, 283 }, - { 0, 0, 282 }, { 0, 0, 281 }, { 0, 0, 280 }, { 0, 0, 278 }, { 0, 0, 276 }, - { 0, 0, 275 }, { 0, 0, 273 }, { 0, 0, 270 }, { 0, 0, 268 }, { 0, 0, 265 }, - { 0, 0, 246 }, { 0, 0, 205 }, { 0, 0, 158 }, { 0, 0, 119 }, { 0, 0, 105 }, - { 0, 0, 109 }, { 0, 0, 116 }, { 0, 0, 125 }, { 0, 0, 136 }, { 0, 0, 148 }, - { 0, 0, 162 }, { 0, 0, 177 }, { 0, 0, 193 }, { 0, 0, 209 }, { 0, 0, 225 }, - { 0, 0, 242 }, { 0, 0, 258 }, { 0, 0, 273 }, { 0, 0, 288 }, { 0, 0, 302 }, - { 0, 0, 314 }, { 0, 0, 325 }, { 0, 0, 333 }, { 0, 0, 340 }, { 0, 0, 325 }, - { 0, 0, 287 }, { 0, 0, 246 }, { 0, 0, 225 }, { 0, 0, 243 }, { 0, 0, 283 }, - { 0, 0, 311 }, { 0, 0, 312 }, { 0, 0, 302 }, { 0, 0, 294 }, { 0, 0, 292 }, - { 0, 0, 292 }, { 0, 0, 292 }, { 0, 0, 293 }, { 0, 0, 294 }, { 0, 0, 294 }, - { 0, 0, 294 }, { 0, -1, 294 }, { 0, -2, 294 }, { 0, -3, 294 }, { 0, -4, 294 }, - { 0, -6, 294 }, { 0, -7, 294 }, { 0, -8, 294 }, { 0, -8, 294 }, { 0, -8, 294 }, - { 0, -7, 294 }, { 0, -6, 294 }, { 0, -3, 294 }, { 0, 0, 294 }, { 0, 5, 294 }, - { 0, 12, 294 }, { 0, 20, 294 }, { 0, 30, 294 }, { 0, 40, 294 }, { 0, 51, 294 }, - { 0, 62, 294 }, { 0, 73, 294 }, { 0, 83, 294 }, { 0, 93, 294 }, { 0, 102, 294 }, - { 0, 109, 294 }, { 0, 115, 294 }, { 0, 119, 294 }, { 0, 120, 294 }, { 0, 118, 294 }, - { 0, 113, 294 }, { 0, 106, 294 }, { 0, 96, 294 }, { 0, 85, 294 }, { 0, 72, 294 }, - { 0, 60, 294 }, { 0, 47, 294 }, { 0, 35, 294 }, { 0, 23, 294 }, { 0, 14, 294 }, - { 0, 6, 294 }, { 0, 1, 294 }, { 0, 0, 294 }, { 0, 1, 294 }, { 0, 5, 294 }, - { 0, 12, 294 }, { 0, 21, 294 }, { 0, 31, 294 }, { 0, 42, 294 }, { 0, 54, 294 }, - { 0, 66, 294 }, { 0, 77, 294 }, { 0, 89, 294 }, { 0, 99, 294 }, { 0, 107, 294 }, - { 0, 114, 294 }, { 0, 118, 294 }, { 0, 120, 294 }, { 0, 118, 294 }, { 0, 113, 294 }, - { 0, 106, 294 }, { 0, 96, 294 }, { 0, 85, 294 }, { 0, 72, 294 }, { 0, 60, 294 }, - { 0, 47, 294 }, { 0, 35, 294 }, { 0, 23, 294 }, { 0, 14, 294 }, { 0, 6, 294 }, - { 0, 1, 294 }, { 0, 0, 294 }, { 0, 2, 294 }, { 0, 7, 294 }, { 0, 16, 294 }, - { 0, 27, 294 }, { 0, 39, 294 }, { 0, 53, 294 }, { 0, 67, 294 }, { 0, 80, 294 }, - { 0, 93, 294 }, { 0, 104, 294 }, { 0, 112, 294 }, { 0, 118, 294 }, { 0, 120, 294 }, - { 0, 118, 294 }, { 0, 114, 294 }, { 0, 108, 294 }, { 0, 100, 294 }, { 0, 91, 294 }, - { 0, 80, 294 }, { 0, 69, 295 }, { 0, 58, 295 }, { 0, 46, 295 }, { 0, 35, 295 }, - { 0, 25, 295 }, { 0, 16, 295 }, { 0, 8, 295 }, { 0, 3, 294 }, { 0, 0, 294 }, - { 0, -1, 293 }, { 0, -3, 293 }, { 0, -5, 292 }, { 0, -6, 292 }, { 0, -7, 291 }, - { 0, -9, 291 }, { 0, -10, 290 }, { 0, -10, 289 }, { 0, -11, 289 }, { 0, -12, 288 }, - { 0, -12, 287 }, { 0, -12, 287 }, { 0, -13, 286 }, { 0, -13, 285 }, { 0, -13, 285 }, - { 0, -13, 284 }, { 0, -13, 283 }, { 0, -12, 283 }, { 0, -12, 282 }, { 0, -12, 281 }, - { 0, -11, 280 }, { 0, -11, 280 }, { 0, -11, 279 }, { 0, -10, 278 }, { 0, -9, 277 }, - { 0, -9, 277 }, { 0, -8, 276 }, { 0, -8, 275 }, { 0, -7, 275 }, { 0, -6, 274 }, - { 0, -6, 273 }, { 0, -5, 273 }, { 0, -4, 272 }, { 0, -4, 271 }, { 0, -3, 271 }, - { 0, -2, 270 }, { 0, -2, 269 }, { 0, -1, 269 }, { 0, -1, 268 }, { 0, 0, 268 }, - { 0, 0, 267 }, { 0, 0, 267 }, { 0, 0, 266 }, { 0, 0, 266 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, - { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, - { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 268 }, { 0, 0, 270 }, { 0, 0, 272 }, - { 0, 0, 274 }, { 0, 0, 276 }, { 0, 0, 277 }, { 0, 0, 277 }, { 0, 0, 276 }, - { 0, 0, 274 }, { 0, 0, 270 }, { 0, 0, 265 }, { 0, 0, 258 }, { 0, 0, 250 }, - { 0, 0, 240 }, { 0, 0, 230 }, { 0, 0, 218 }, { 0, 0, 206 }, { 0, 0, 194 }, - { 0, 0, 181 }, { 0, 0, 168 }, { 0, 0, 155 }, { 0, 0, 142 }, { 0, 0, 130 }, - { 0, 0, 118 }, { 0, 0, 108 }, { 0, 0, 98 }, { 0, 0, 89 }, { 0, 0, 82 }, - { 0, 0, 76 }, { 0, 0, 71 }, { 0, 0, 67 }, { 0, 0, 64 }, { 0, 0, 63 }, - { 0, 0, 62 }, { 0, 0, 63 }, { 0, 0, 66 }, { 0, 0, 70 }, { 0, 0, 75 }, - { 0, 0, 82 }, { 0, 0, 91 }, { 0, 0, 103 }, { 0, 0, 116 }, { 0, 0, 132 }, - { 0, 0, 148 }, { 0, 0, 165 }, { 0, 0, 183 }, { 0, 0, 200 }, { 0, 0, 216 }, - { 0, 0, 231 }, { 0, 0, 245 }, { 0, 0, 256 }, { 0, 0, 265 }, { 0, 0, 271 }, - { 0, 0, 275 }, { 0, 0, 278 }, { 0, 0, 278 }, { 0, 0, 278 }, { 0, 0, 276 }, - { 0, 0, 274 }, { 0, 0, 272 }, { 0, 0, 269 }, { 0, 0, 267 }, { 0, 0, 266 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, - { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 264 }, { 0, 0, 264 }, + { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 263 }, { 0, 0, 263 }, { 0, 0, 263 }, + { 0, 0, 263 }, { 0, 0, 262 }, { 0, 0, 262 }, { 0, 0, 262 }, { 0, 0, 261 }, { 0, 0, 261 }, + { 0, 0, 261 }, { 0, 0, 260 }, { 0, 0, 260 }, { 0, 0, 260 }, { 0, 0, 259 }, { 0, 0, 259 }, + { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 257 }, { 0, 0, 257 }, { 0, 0, 256 }, + { 0, 0, 256 }, { 0, 0, 256 }, { 0, 0, 255 }, { 0, 0, 255 }, { 0, 0, 254 }, { 0, 0, 254 }, + { 0, 0, 254 }, { 0, 0, 253 }, { 0, 0, 253 }, { 0, 0, 252 }, { 0, 0, 252 }, { 0, 0, 252 }, + { 0, 0, 251 }, { 0, 0, 251 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 249 }, + { 0, 0, 249 }, { 0, 0, 249 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, + { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 246 }, { 0, 0, 246 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, + { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 246 }, { 0, 0, 247 }, + { 0, 0, 247 }, { 0, 0, 247 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 248 }, { 0, 0, 249 }, + { 0, 0, 249 }, { 0, 0, 250 }, { 0, 0, 250 }, { 0, 0, 251 }, { 0, 0, 251 }, { 0, 0, 252 }, + { 0, 0, 253 }, { 0, 0, 253 }, { 0, 0, 254 }, { 0, 0, 255 }, { 0, 0, 256 }, { 0, 0, 257 }, + { 0, 0, 258 }, { 0, 0, 259 }, { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 262 }, { 0, 0, 263 }, + { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 289 }, { 0, 0, 338 }, { 0, 0, 385 }, { 0, 0, 403 }, + { 0, 0, 381 }, { 0, 0, 337 }, { 0, 0, 284 }, { 0, 0, 237 }, { 0, 0, 208 }, { 0, 0, 208 }, + { 0, 0, 228 }, { 0, 0, 252 }, { 0, 0, 265 }, { 0, 0, 267 }, { 0, 0, 268 }, { 0, 0, 269 }, + { 0, 0, 269 }, { 0, 0, 268 }, { 0, 0, 268 }, { 0, 0, 267 }, { 0, 0, 266 }, { 0, 0, 265 }, + { 0, 0, 263 }, { 0, 0, 262 }, { 0, 0, 260 }, { 0, 0, 259 }, { 0, 0, 257 }, { 0, 0, 256 }, + { 0, 0, 255 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 254 }, { 0, 0, 255 }, { 0, 0, 255 }, + { 0, 0, 257 }, { 0, 0, 259 }, { 0, 0, 262 }, { 0, 0, 265 }, { 0, 0, 280 }, { 0, 0, 308 }, + { 0, 0, 341 }, { 0, 0, 368 }, { 0, 0, 380 }, { 0, 0, 378 }, { 0, 0, 375 }, { 0, 0, 369 }, + { 0, 0, 362 }, { 0, 0, 353 }, { 0, 0, 344 }, { 0, 0, 333 }, { 0, 0, 322 }, { 0, 0, 312 }, + { 0, 0, 301 }, { 0, 0, 291 }, { 0, 0, 283 }, { 0, 0, 275 }, { 0, 0, 269 }, { 0, 0, 265 }, + { 0, 0, 263 }, { 0, 0, 261 }, { 0, 0, 259 }, { 0, 0, 258 }, { 0, 0, 258 }, { 0, 0, 258 }, + { 0, 0, 258 }, { 0, 0, 259 }, { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 262 }, { 0, 0, 263 }, + { 0, 0, 265 }, { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 269 }, { 0, 0, 270 }, { 0, 0, 270 }, + { 0, 0, 271 }, { 0, 0, 271 }, { 0, 0, 271 }, { 0, 0, 270 }, { 0, 0, 269 }, { 0, 0, 267 }, + { 0, 0, 265 }, { 0, 0, 262 }, { 0, 0, 258 }, { 0, 0, 254 }, { 0, 0, 249 }, { 0, 0, 243 }, + { 0, 0, 237 }, { 0, 0, 231 }, { 0, 0, 224 }, { 0, 0, 217 }, { 0, 0, 210 }, { 0, 0, 203 }, + { 0, 0, 195 }, { 0, 0, 188 }, { 0, 0, 182 }, { 0, 0, 175 }, { 0, 0, 169 }, { 0, 0, 164 }, + { 0, 0, 159 }, { 0, 0, 154 }, { 0, 0, 151 }, { 0, 0, 147 }, { 0, 0, 145 }, { 0, 0, 142 }, + { 0, 0, 140 }, { 0, 0, 138 }, { 0, 0, 137 }, { 0, 0, 136 }, { 0, 0, 136 }, { 0, 0, 136 }, + { 0, 0, 137 }, { 0, 0, 138 }, { 0, 0, 140 }, { 0, 0, 143 }, { 0, 0, 146 }, { 0, 0, 151 }, + { 0, 0, 157 }, { 0, 0, 166 }, { 0, 0, 177 }, { 0, 0, 189 }, { 0, 0, 203 }, { 0, 0, 217 }, + { 0, 0, 231 }, { 0, 0, 244 }, { 0, 0, 255 }, { 0, 0, 265 }, { 0, 0, 274 }, { 0, 0, 283 }, + { 0, 0, 291 }, { 0, 0, 300 }, { 0, 0, 308 }, { 0, 0, 315 }, { 0, 0, 322 }, { 0, 0, 328 }, + { 0, 0, 333 }, { 0, 0, 337 }, { 0, 0, 339 }, { 0, 0, 340 }, { 0, 0, 336 }, { 0, 0, 327 }, + { 0, 0, 315 }, { 0, 0, 300 }, { 0, 0, 286 }, { 0, 0, 273 }, { 0, 0, 265 }, { 0, 0, 261 }, + { 0, 0, 260 }, { 0, 0, 261 }, { 0, 0, 263 }, { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 266 }, { 0, 0, 266 }, + { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 267 }, { 0, 0, 268 }, { 0, 0, 269 }, { 0, 0, 269 }, + { 0, 0, 270 }, { 0, 0, 271 }, { 0, 0, 272 }, { 0, 0, 273 }, { 0, 0, 274 }, { 0, 0, 274 }, + { 0, 0, 275 }, { 0, 0, 276 }, { 0, 0, 277 }, { 0, 0, 278 }, { 0, 0, 279 }, { 0, 0, 280 }, + { 0, 0, 281 }, { 0, 0, 282 }, { 0, 0, 282 }, { 0, 0, 283 }, { 0, 0, 284 }, { 0, 0, 284 }, + { 0, 0, 285 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 287 }, { 0, 0, 287 }, + { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 287 }, { 0, 0, 286 }, { 0, 0, 286 }, { 0, 0, 286 }, + { 0, 0, 285 }, { 0, 0, 284 }, { 0, 0, 283 }, { 0, 0, 282 }, { 0, 0, 281 }, { 0, 0, 280 }, + { 0, 0, 278 }, { 0, 0, 276 }, { 0, 0, 275 }, { 0, 0, 273 }, { 0, 0, 270 }, { 0, 0, 268 }, + { 0, 0, 265 }, { 0, 0, 246 }, { 0, 0, 205 }, { 0, 0, 158 }, { 0, 0, 119 }, { 0, 0, 105 }, + { 0, 0, 109 }, { 0, 0, 116 }, { 0, 0, 125 }, { 0, 0, 136 }, { 0, 0, 148 }, { 0, 0, 162 }, + { 0, 0, 177 }, { 0, 0, 193 }, { 0, 0, 209 }, { 0, 0, 225 }, { 0, 0, 242 }, { 0, 0, 258 }, + { 0, 0, 273 }, { 0, 0, 288 }, { 0, 0, 302 }, { 0, 0, 314 }, { 0, 0, 325 }, { 0, 0, 333 }, + { 0, 0, 340 }, { 0, 0, 325 }, { 0, 0, 287 }, { 0, 0, 246 }, { 0, 0, 225 }, { 0, 0, 243 }, + { 0, 0, 283 }, { 0, 0, 311 }, { 0, 0, 312 }, { 0, 0, 302 }, { 0, 0, 294 }, { 0, 0, 292 }, + { 0, 0, 292 }, { 0, 0, 292 }, { 0, 0, 293 }, { 0, 0, 294 }, { 0, 0, 294 }, { 0, 0, 294 }, + { 0, -1, 294 }, { 0, -2, 294 }, { 0, -3, 294 }, { 0, -4, 294 }, { 0, -6, 294 }, { 0, -7, 294 }, + { 0, -8, 294 }, { 0, -8, 294 }, { 0, -8, 294 }, { 0, -7, 294 }, { 0, -6, 294 }, { 0, -3, 294 }, + { 0, 0, 294 }, { 0, 5, 294 }, { 0, 12, 294 }, { 0, 20, 294 }, { 0, 30, 294 }, { 0, 40, 294 }, + { 0, 51, 294 }, { 0, 62, 294 }, { 0, 73, 294 }, { 0, 83, 294 }, { 0, 93, 294 }, { 0, 102, 294 }, + { 0, 109, 294 }, { 0, 115, 294 }, { 0, 119, 294 }, { 0, 120, 294 }, { 0, 118, 294 }, { 0, 113, 294 }, + { 0, 106, 294 }, { 0, 96, 294 }, { 0, 85, 294 }, { 0, 72, 294 }, { 0, 60, 294 }, { 0, 47, 294 }, + { 0, 35, 294 }, { 0, 23, 294 }, { 0, 14, 294 }, { 0, 6, 294 }, { 0, 1, 294 }, { 0, 0, 294 }, + { 0, 1, 294 }, { 0, 5, 294 }, { 0, 12, 294 }, { 0, 21, 294 }, { 0, 31, 294 }, { 0, 42, 294 }, + { 0, 54, 294 }, { 0, 66, 294 }, { 0, 77, 294 }, { 0, 89, 294 }, { 0, 99, 294 }, { 0, 107, 294 }, + { 0, 114, 294 }, { 0, 118, 294 }, { 0, 120, 294 }, { 0, 118, 294 }, { 0, 113, 294 }, { 0, 106, 294 }, + { 0, 96, 294 }, { 0, 85, 294 }, { 0, 72, 294 }, { 0, 60, 294 }, { 0, 47, 294 }, { 0, 35, 294 }, + { 0, 23, 294 }, { 0, 14, 294 }, { 0, 6, 294 }, { 0, 1, 294 }, { 0, 0, 294 }, { 0, 2, 294 }, + { 0, 7, 294 }, { 0, 16, 294 }, { 0, 27, 294 }, { 0, 39, 294 }, { 0, 53, 294 }, { 0, 67, 294 }, + { 0, 80, 294 }, { 0, 93, 294 }, { 0, 104, 294 }, { 0, 112, 294 }, { 0, 118, 294 }, { 0, 120, 294 }, + { 0, 118, 294 }, { 0, 114, 294 }, { 0, 108, 294 }, { 0, 100, 294 }, { 0, 91, 294 }, { 0, 80, 294 }, + { 0, 69, 295 }, { 0, 58, 295 }, { 0, 46, 295 }, { 0, 35, 295 }, { 0, 25, 295 }, { 0, 16, 295 }, + { 0, 8, 295 }, { 0, 3, 294 }, { 0, 0, 294 }, { 0, -1, 293 }, { 0, -3, 293 }, { 0, -5, 292 }, + { 0, -6, 292 }, { 0, -7, 291 }, { 0, -9, 291 }, { 0, -10, 290 }, { 0, -10, 289 }, { 0, -11, 289 }, + { 0, -12, 288 }, { 0, -12, 287 }, { 0, -12, 287 }, { 0, -13, 286 }, { 0, -13, 285 }, { 0, -13, 285 }, + { 0, -13, 284 }, { 0, -13, 283 }, { 0, -12, 283 }, { 0, -12, 282 }, { 0, -12, 281 }, { 0, -11, 280 }, + { 0, -11, 280 }, { 0, -11, 279 }, { 0, -10, 278 }, { 0, -9, 277 }, { 0, -9, 277 }, { 0, -8, 276 }, + { 0, -8, 275 }, { 0, -7, 275 }, { 0, -6, 274 }, { 0, -6, 273 }, { 0, -5, 273 }, { 0, -4, 272 }, + { 0, -4, 271 }, { 0, -3, 271 }, { 0, -2, 270 }, { 0, -2, 269 }, { 0, -1, 269 }, { 0, -1, 268 }, + { 0, 0, 268 }, { 0, 0, 267 }, { 0, 0, 267 }, { 0, 0, 266 }, { 0, 0, 266 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, + { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, { 0, 0, 264 }, + { 0, 0, 264 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 266 }, { 0, 0, 267 }, { 0, 0, 268 }, { 0, 0, 270 }, + { 0, 0, 272 }, { 0, 0, 274 }, { 0, 0, 276 }, { 0, 0, 277 }, { 0, 0, 277 }, { 0, 0, 276 }, + { 0, 0, 274 }, { 0, 0, 270 }, { 0, 0, 265 }, { 0, 0, 258 }, { 0, 0, 250 }, { 0, 0, 240 }, + { 0, 0, 230 }, { 0, 0, 218 }, { 0, 0, 206 }, { 0, 0, 194 }, { 0, 0, 181 }, { 0, 0, 168 }, + { 0, 0, 155 }, { 0, 0, 142 }, { 0, 0, 130 }, { 0, 0, 118 }, { 0, 0, 108 }, { 0, 0, 98 }, + { 0, 0, 89 }, { 0, 0, 82 }, { 0, 0, 76 }, { 0, 0, 71 }, { 0, 0, 67 }, { 0, 0, 64 }, + { 0, 0, 63 }, { 0, 0, 62 }, { 0, 0, 63 }, { 0, 0, 66 }, { 0, 0, 70 }, { 0, 0, 75 }, + { 0, 0, 82 }, { 0, 0, 91 }, { 0, 0, 103 }, { 0, 0, 116 }, { 0, 0, 132 }, { 0, 0, 148 }, + { 0, 0, 165 }, { 0, 0, 183 }, { 0, 0, 200 }, { 0, 0, 216 }, { 0, 0, 231 }, { 0, 0, 245 }, + { 0, 0, 256 }, { 0, 0, 265 }, { 0, 0, 271 }, { 0, 0, 275 }, { 0, 0, 278 }, { 0, 0, 278 }, + { 0, 0, 278 }, { 0, 0, 276 }, { 0, 0, 274 }, { 0, 0, 272 }, { 0, 0, 269 }, { 0, 0, 267 }, + { 0, 0, 266 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, + { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, { 0, 0, 265 }, }; struct AnimDataInfo anim_mario_ear_right[] = { @@ -345,40 +318,34 @@ static s16 animdata_mario_nose_1[][3] = { }; static s16 animdata_mario_nose_2[][3] = { - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1784 }, { 0, 0, -1783 }, - { 0, 0, -1782 }, { 0, 0, -1780 }, { 0, 0, -1779 }, { 0, 0, -1777 }, { 0, 0, -1776 }, - { 0, 0, -1775 }, { 0, 0, -1774 }, { 0, 0, -1773 }, { 0, 0, -1772 }, { 0, 0, -1772 }, - { 0, 0, -1772 }, { 0, 0, -1773 }, { 0, 0, -1774 }, { 0, 0, -1776 }, { 0, 0, -1778 }, - { 0, 0, -1782 }, { 0, 0, -1785 }, { 0, 0, -1839 }, { 0, 0, -1883 }, { 0, 0, -1835 }, - { 0, 0, -1760 }, { 0, 0, -1717 }, { 0, 0, -1745 }, { 0, 0, -1807 }, { 0, 0, -1844 }, - { 0, 0, -1827 }, { 0, 0, -1786 }, { 0, 0, -1759 }, { 0, 0, -1766 }, { 0, 0, -1787 }, - { 0, 0, -1797 }, { 0, 0, -1783 }, { 0, 0, -1759 }, { 0, 0, -1745 }, { 0, 0, -1765 }, - { 0, 0, -1789 }, { 0, 0, -1792 }, { 0, 0, -1790 }, { 0, 0, -1787 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, - { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1784 }, { 0, 0, -1783 }, { 0, 0, -1782 }, + { 0, 0, -1780 }, { 0, 0, -1779 }, { 0, 0, -1777 }, { 0, 0, -1776 }, { 0, 0, -1775 }, { 0, 0, -1774 }, + { 0, 0, -1773 }, { 0, 0, -1772 }, { 0, 0, -1772 }, { 0, 0, -1772 }, { 0, 0, -1773 }, { 0, 0, -1774 }, + { 0, 0, -1776 }, { 0, 0, -1778 }, { 0, 0, -1782 }, { 0, 0, -1785 }, { 0, 0, -1839 }, { 0, 0, -1883 }, + { 0, 0, -1835 }, { 0, 0, -1760 }, { 0, 0, -1717 }, { 0, 0, -1745 }, { 0, 0, -1807 }, { 0, 0, -1844 }, + { 0, 0, -1827 }, { 0, 0, -1786 }, { 0, 0, -1759 }, { 0, 0, -1766 }, { 0, 0, -1787 }, { 0, 0, -1797 }, + { 0, 0, -1783 }, { 0, 0, -1759 }, { 0, 0, -1745 }, { 0, 0, -1765 }, { 0, 0, -1789 }, { 0, 0, -1792 }, + { 0, 0, -1790 }, { 0, 0, -1787 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, + { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, { 0, 0, -1785 }, }; struct AnimDataInfo anim_mario_nose[] = { @@ -388,174 +355,151 @@ struct AnimDataInfo anim_mario_nose[] = { }; static s16 animdata_mario_lips_5_1[][3] = { - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -310 }, { 0, 0, -310 }, { 0, 0, -309 }, { 0, 0, -307 }, - { 0, 0, -306 }, { 0, 0, -304 }, { 0, 0, -302 }, { 0, 0, -300 }, { 0, 0, -297 }, { 0, 0, -295 }, - { 0, 0, -292 }, { 0, 0, -289 }, { 0, 0, -286 }, { 0, 0, -283 }, { 0, 0, -280 }, { 0, 0, -276 }, - { 0, 0, -273 }, { 0, 0, -269 }, { 0, 0, -266 }, { 0, 0, -262 }, { 0, 0, -258 }, { 0, 0, -255 }, - { 0, 0, -251 }, { 0, 0, -248 }, { 0, 0, -244 }, { 0, 0, -240 }, { 0, 0, -237 }, { 0, 0, -234 }, - { 0, 0, -230 }, { 0, 0, -227 }, { 0, 0, -224 }, { 0, 0, -221 }, { 0, 0, -218 }, { 0, 0, -216 }, - { 0, 0, -213 }, { 0, 0, -211 }, { 0, 0, -209 }, { 0, 0, -207 }, { 0, 0, -206 }, { 0, 0, -205 }, - { 0, 0, -204 }, { 0, 0, -203 }, { 0, 0, -202 }, { 0, 0, -202 }, { 0, 0, -203 }, { 0, 0, -204 }, - { 0, 0, -207 }, { 0, 0, -211 }, { 0, 0, -215 }, { 0, 0, -221 }, { 0, 0, -226 }, { 0, 0, -233 }, - { 0, 0, -239 }, { 0, 0, -246 }, { 0, 0, -253 }, { 0, 0, -260 }, { 0, 0, -267 }, { 0, 0, -274 }, - { 0, 0, -281 }, { 0, 0, -287 }, { 0, 0, -293 }, { 0, 0, -298 }, { 0, 0, -302 }, { 0, 0, -306 }, - { 0, 0, -309 }, { 0, 0, -310 }, { 0, 0, -311 }, { 0, 0, -302 }, { 0, 0, -277 }, { 0, 0, -242 }, - { 0, 0, -202 }, { 0, 0, -163 }, { 0, 0, -131 }, { 0, 0, -101 }, { 0, 0, -70 }, { 0, 0, -40 }, - { 0, 0, -12 }, { 0, 0, 10 }, { 0, 0, 26 }, { 0, 0, 37 }, { 0, 0, 44 }, { 0, 0, 49 }, - { 0, 0, 49 }, { 0, 0, 46 }, { 0, 0, 38 }, { 0, 0, 26 }, { 0, 0, 3 }, { 0, 0, -31 }, - { 0, 0, -73 }, { 0, 0, -113 }, { 0, 0, -145 }, { 0, 0, -162 }, { 0, 0, -169 }, { 0, 0, -173 }, - { 0, 0, -176 }, { 0, 0, -177 }, { 0, 0, -176 }, { 0, 0, -175 }, { 0, 0, -172 }, { 0, 0, -169 }, - { 0, 0, -166 }, { 0, 0, -162 }, { 0, 0, -159 }, { 0, 0, -156 }, { 0, 0, -154 }, { 0, 0, -152 }, - { 0, 0, -152 }, { 0, 0, -154 }, { 0, 0, -157 }, { 0, 0, -162 }, { 0, 0, -176 }, { 0, 0, -201 }, - { 0, 0, -233 }, { 0, 0, -265 }, { 0, 0, -293 }, { 0, 0, -311 }, { 0, 0, -322 }, { 0, 0, -333 }, - { 0, 0, -343 }, { 0, 0, -353 }, { 0, 0, -362 }, { 0, 0, -371 }, { 0, 0, -378 }, { 0, 0, -386 }, - { 0, 0, -392 }, { 0, 0, -398 }, { 0, 0, -403 }, { 0, 0, -407 }, { 0, 0, -410 }, { 0, 0, -412 }, - { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -413 }, { 0, 0, -412 }, - { 0, 0, -411 }, { 0, 0, -409 }, { 0, 0, -408 }, { 0, 0, -406 }, { 0, 0, -404 }, { 0, 0, -401 }, - { 0, 0, -399 }, { 0, 0, -396 }, { 0, 0, -394 }, { 0, 0, -391 }, { 0, 0, -388 }, { 0, 0, -385 }, - { 0, 0, -381 }, { 0, 0, -378 }, { 0, 0, -375 }, { 0, 0, -371 }, { 0, 0, -368 }, { 0, 0, -365 }, - { 0, 0, -361 }, { 0, 0, -358 }, { 0, 0, -354 }, { 0, 0, -351 }, { 0, 0, -348 }, { 0, 0, -344 }, - { 0, 0, -341 }, { 0, 0, -338 }, { 0, 0, -335 }, { 0, 0, -332 }, { 0, 0, -329 }, { 0, 0, -326 }, - { 0, 0, -324 }, { 0, 0, -321 }, { 0, 0, -319 }, { 0, 0, -317 }, { 0, 0, -315 }, { 0, 0, -314 }, - { 0, 0, -312 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -313 }, { 0, 0, -316 }, { 0, 0, -320 }, - { 0, 0, -325 }, { 0, 0, -331 }, { 0, 0, -336 }, { 0, 0, -342 }, { 0, 0, -347 }, { 0, 0, -351 }, - { 0, 0, -355 }, { 0, 0, -357 }, { 0, 0, -357 }, { 0, 0, -356 }, { 0, 0, -355 }, { 0, 0, -354 }, - { 0, 0, -353 }, { 0, 0, -352 }, { 0, 0, -350 }, { 0, 0, -349 }, { 0, 0, -347 }, { 0, 0, -345 }, - { 0, 0, -343 }, { 0, 0, -340 }, { 0, 0, -338 }, { 0, 0, -335 }, { 0, 0, -332 }, { 0, 0, -329 }, - { 0, 0, -325 }, { 0, 0, -322 }, { 0, 0, -318 }, { 0, 0, -314 }, { 0, 0, -309 }, { 0, 0, -304 }, - { 0, 0, -299 }, { 0, 0, -294 }, { 0, 0, -288 }, { 0, 0, -282 }, { 0, 0, -268 }, { 0, 0, -243 }, - { 0, 0, -213 }, { 0, 0, -188 }, { 0, 0, -174 }, { 0, 0, -168 }, { 0, 0, -164 }, { 0, 0, -160 }, - { 0, 0, -158 }, { 0, 0, -156 }, { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -155 }, - { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -158 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, - { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -161 }, - { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -163 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -165 }, - { 0, 0, -166 }, { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -169 }, { 0, 0, -170 }, - { 0, 0, -171 }, { 0, 0, -171 }, { 0, 0, -172 }, { 0, 0, -172 }, { 0, 0, -173 }, { 0, 0, -173 }, - { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, - { 0, 0, -174 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, - { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, - { 0, 0, -175 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, - { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, - { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, - { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, - { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, - { 0, 0, -175 }, { 0, 0, -176 }, { 0, 0, -178 }, { 0, 0, -179 }, { 0, 0, -180 }, { 0, 0, -182 }, - { 0, 0, -183 }, { 0, 0, -184 }, { 0, 0, -185 }, { 0, 0, -185 }, { 0, 0, -185 }, { 0, 0, -185 }, - { 0, 0, -184 }, { 0, 0, -182 }, { 0, 0, -180 }, { 0, 0, -177 }, { 0, 0, -174 }, { 0, 0, -148 }, - { 0, 0, -105 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -77 }, - { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, - { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, - { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, - { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -70 }, - { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -71 }, - { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -73 }, { 0, 0, -73 }, { 0, 0, -74 }, - { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, { 0, 0, -76 }, { 0, 0, -76 }, - { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -79 }, - { 0, 0, -79 }, { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, - { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, - { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, { 0, 0, -80 }, - { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, - { 0, 0, -80 }, { 0, 0, -82 }, { 0, 0, -85 }, { 0, 0, -88 }, { 0, 0, -93 }, { 0, 0, -97 }, - { 0, 0, -102 }, { 0, 0, -107 }, { 0, 0, -113 }, { 0, 0, -118 }, { 0, 0, -124 }, { 0, 0, -129 }, - { 0, 0, -135 }, { 0, 0, -140 }, { 0, 0, -145 }, { 0, 0, -149 }, { 0, 0, -152 }, { 0, 0, -155 }, - { 0, 0, -158 }, { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -162 }, { 0, 0, -163 }, - { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -166 }, - { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, - { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, - { 0, 0, -168 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -166 }, - { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -164 }, - { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -163 }, { 0, 0, -163 }, { 0, 0, -163 }, { 0, 0, -162 }, - { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -160 }, - { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -159 }, - { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, - { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -163 }, - { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -166 }, { 0, 0, -167 }, - { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -169 }, { 0, 0, -169 }, { 0, 0, -170 }, - { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, - { 0, 0, -170 }, { 0, 0, -169 }, { 0, 0, -169 }, { 0, 0, -168 }, { 0, 0, -167 }, { 0, 0, -167 }, - { 0, 0, -165 }, { 0, 0, -164 }, { 0, 0, -163 }, { 0, 0, -161 }, { 0, 0, -159 }, { 0, 0, -157 }, - { 0, 0, -152 }, { 0, 0, -146 }, { 0, 0, -139 }, { 0, 0, -132 }, { 0, 0, -123 }, { 0, 0, -114 }, - { 0, 0, -105 }, { 0, 0, -96 }, { 0, 0, -87 }, { 0, 0, -79 }, { 0, 0, -71 }, { 0, 0, -64 }, - { 0, 0, -59 }, { 0, 0, -54 }, { 0, 0, -50 }, { 0, 0, -46 }, { 0, 0, -42 }, { 0, 0, -39 }, - { 0, 0, -36 }, { 0, 0, -33 }, { 0, 0, -30 }, { 0, 0, -28 }, { 0, 0, -26 }, { 0, 0, -25 }, - { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -24 }, - { 0, 0, -26 }, { 0, 0, -29 }, { 0, 0, -33 }, { 0, 0, -36 }, { 0, 0, -40 }, { 0, 0, -44 }, - { 0, 0, -48 }, { 0, 0, -52 }, { 0, 0, -55 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -59 }, - { 0, 0, -58 }, { 0, 0, -57 }, { 0, 0, -55 }, { 0, 0, -52 }, { 0, 0, -49 }, { 0, 0, -46 }, - { 0, 0, -42 }, { 0, 0, -39 }, { 0, 0, -35 }, { 0, 0, -31 }, { 0, 0, -28 }, { 0, 0, -26 }, - { 0, 0, -24 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -24 }, { 0, 0, -26 }, - { 0, 0, -29 }, { 0, 0, -33 }, { 0, 0, -36 }, { 0, 0, -40 }, { 0, 0, -44 }, { 0, 0, -48 }, - { 0, 0, -52 }, { 0, 0, -55 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -58 }, - { 0, 0, -57 }, { 0, 0, -54 }, { 0, 0, -51 }, { 0, 0, -47 }, { 0, 0, -43 }, { 0, 0, -38 }, - { 0, 0, -34 }, { 0, 0, -30 }, { 0, 0, -27 }, { 0, 0, -24 }, { 0, 0, -22 }, { 0, 0, -22 }, - { 0, 0, -22 }, { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -28 }, - { 0, 0, -30 }, { 0, 0, -33 }, { 0, 0, -35 }, { 0, 0, -39 }, { 0, 0, -42 }, { 0, 0, -46 }, - { 0, 0, -50 }, { 0, 0, -54 }, { 0, 0, -59 }, { 0, 0, -64 }, { 0, 0, -69 }, { 0, 0, -74 }, - { 0, 0, -79 }, { 0, 0, -85 }, { 0, 0, -90 }, { 0, 0, -96 }, { 0, 0, -102 }, { 0, 0, -107 }, - { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -137 }, { 0, 0, -144 }, - { 0, 0, -150 }, { 0, 0, -156 }, { 0, 0, -162 }, { 0, 0, -168 }, { 0, 0, -175 }, { 0, 0, -181 }, - { 0, 0, -187 }, { 0, 0, -193 }, { 0, 0, -200 }, { 0, 0, -206 }, { 0, 0, -212 }, { 0, 0, -218 }, - { 0, 0, -224 }, { 0, 0, -230 }, { 0, 0, -236 }, { 0, 0, -242 }, { 0, 0, -247 }, { 0, 0, -253 }, - { 0, 0, -259 }, { 0, 0, -264 }, { 0, 0, -269 }, { 0, 0, -275 }, { 0, 0, -280 }, { 0, 0, -285 }, - { 0, 0, -289 }, { 0, 0, -294 }, { 0, 0, -299 }, { 0, 0, -303 }, { 0, 0, -307 }, { 0, 0, -311 }, - { 0, 0, -315 }, { 0, 0, -318 }, { 0, 0, -321 }, { 0, 0, -324 }, { 0, 0, -326 }, { 0, 0, -329 }, - { 0, 0, -330 }, { 0, 0, -331 }, { 0, 0, -332 }, { 0, 0, -333 }, { 0, 0, -333 }, { 0, 0, -332 }, - { 0, 0, -331 }, { 0, 0, -330 }, { 0, 0, -328 }, { 0, 0, -326 }, { 0, 0, -323 }, { 0, 0, -320 }, - { 0, 0, -316 }, { 0, 0, -311 }, { 0, 0, -305 }, { 0, 0, -296 }, { 0, 0, -285 }, { 0, 0, -272 }, - { 0, 0, -258 }, { 0, 0, -243 }, { 0, 0, -228 }, { 0, 0, -212 }, { 0, 0, -197 }, { 0, 0, -182 }, - { 0, 0, -168 }, { 0, 0, -156 }, { 0, 0, -144 }, { 0, 0, -130 }, { 0, 0, -116 }, { 0, 0, -104 }, - { 0, 0, -93 }, { 0, 0, -86 }, { 0, 0, -84 }, { 0, 0, -88 }, { 0, 0, -100 }, { 0, 0, -123 }, - { 0, 0, -151 }, { 0, 0, -182 }, { 0, 0, -213 }, { 0, 0, -240 }, { 0, 0, -261 }, { 0, 0, -271 }, - { 0, 0, -275 }, { 0, 0, -278 }, { 0, 0, -281 }, { 0, 0, -284 }, { 0, 0, -286 }, { 0, 0, -288 }, - { 0, 0, -289 }, { 0, 0, -291 }, { 0, 0, -292 }, { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -293 }, - { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -292 }, { 0, 0, -292 }, { 0, 0, -291 }, - { 0, 0, -290 }, { 0, 0, -289 }, { 0, 0, -288 }, { 0, 0, -286 }, { 0, 0, -285 }, { 0, 0, -284 }, - { 0, 0, -283 }, { 0, 0, -281 }, { 0, 0, -280 }, { 0, 0, -279 }, { 0, 0, -277 }, { 0, 0, -276 }, - { 0, 0, -275 }, { 0, 0, -274 }, { 0, 0, -273 }, { 0, 0, -272 }, { 0, 0, -272 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, - { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -270 }, { 0, 0, -271 }, - { 0, 0, -275 }, { 0, 0, -279 }, { 0, 0, -284 }, { 0, 0, -290 }, { 0, 0, -295 }, { 0, 0, -300 }, - { 0, 0, -304 }, { 0, 0, -308 }, { 0, 0, -310 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -310 }, { 0, 0, -310 }, { 0, 0, -309 }, { 0, 0, -307 }, { 0, 0, -306 }, + { 0, 0, -304 }, { 0, 0, -302 }, { 0, 0, -300 }, { 0, 0, -297 }, { 0, 0, -295 }, { 0, 0, -292 }, { 0, 0, -289 }, + { 0, 0, -286 }, { 0, 0, -283 }, { 0, 0, -280 }, { 0, 0, -276 }, { 0, 0, -273 }, { 0, 0, -269 }, { 0, 0, -266 }, + { 0, 0, -262 }, { 0, 0, -258 }, { 0, 0, -255 }, { 0, 0, -251 }, { 0, 0, -248 }, { 0, 0, -244 }, { 0, 0, -240 }, + { 0, 0, -237 }, { 0, 0, -234 }, { 0, 0, -230 }, { 0, 0, -227 }, { 0, 0, -224 }, { 0, 0, -221 }, { 0, 0, -218 }, + { 0, 0, -216 }, { 0, 0, -213 }, { 0, 0, -211 }, { 0, 0, -209 }, { 0, 0, -207 }, { 0, 0, -206 }, { 0, 0, -205 }, + { 0, 0, -204 }, { 0, 0, -203 }, { 0, 0, -202 }, { 0, 0, -202 }, { 0, 0, -203 }, { 0, 0, -204 }, { 0, 0, -207 }, + { 0, 0, -211 }, { 0, 0, -215 }, { 0, 0, -221 }, { 0, 0, -226 }, { 0, 0, -233 }, { 0, 0, -239 }, { 0, 0, -246 }, + { 0, 0, -253 }, { 0, 0, -260 }, { 0, 0, -267 }, { 0, 0, -274 }, { 0, 0, -281 }, { 0, 0, -287 }, { 0, 0, -293 }, + { 0, 0, -298 }, { 0, 0, -302 }, { 0, 0, -306 }, { 0, 0, -309 }, { 0, 0, -310 }, { 0, 0, -311 }, { 0, 0, -302 }, + { 0, 0, -277 }, { 0, 0, -242 }, { 0, 0, -202 }, { 0, 0, -163 }, { 0, 0, -131 }, { 0, 0, -101 }, { 0, 0, -70 }, + { 0, 0, -40 }, { 0, 0, -12 }, { 0, 0, 10 }, { 0, 0, 26 }, { 0, 0, 37 }, { 0, 0, 44 }, { 0, 0, 49 }, + { 0, 0, 49 }, { 0, 0, 46 }, { 0, 0, 38 }, { 0, 0, 26 }, { 0, 0, 3 }, { 0, 0, -31 }, { 0, 0, -73 }, + { 0, 0, -113 }, { 0, 0, -145 }, { 0, 0, -162 }, { 0, 0, -169 }, { 0, 0, -173 }, { 0, 0, -176 }, { 0, 0, -177 }, + { 0, 0, -176 }, { 0, 0, -175 }, { 0, 0, -172 }, { 0, 0, -169 }, { 0, 0, -166 }, { 0, 0, -162 }, { 0, 0, -159 }, + { 0, 0, -156 }, { 0, 0, -154 }, { 0, 0, -152 }, { 0, 0, -152 }, { 0, 0, -154 }, { 0, 0, -157 }, { 0, 0, -162 }, + { 0, 0, -176 }, { 0, 0, -201 }, { 0, 0, -233 }, { 0, 0, -265 }, { 0, 0, -293 }, { 0, 0, -311 }, { 0, 0, -322 }, + { 0, 0, -333 }, { 0, 0, -343 }, { 0, 0, -353 }, { 0, 0, -362 }, { 0, 0, -371 }, { 0, 0, -378 }, { 0, 0, -386 }, + { 0, 0, -392 }, { 0, 0, -398 }, { 0, 0, -403 }, { 0, 0, -407 }, { 0, 0, -410 }, { 0, 0, -412 }, { 0, 0, -414 }, + { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -414 }, { 0, 0, -413 }, { 0, 0, -412 }, { 0, 0, -411 }, { 0, 0, -409 }, + { 0, 0, -408 }, { 0, 0, -406 }, { 0, 0, -404 }, { 0, 0, -401 }, { 0, 0, -399 }, { 0, 0, -396 }, { 0, 0, -394 }, + { 0, 0, -391 }, { 0, 0, -388 }, { 0, 0, -385 }, { 0, 0, -381 }, { 0, 0, -378 }, { 0, 0, -375 }, { 0, 0, -371 }, + { 0, 0, -368 }, { 0, 0, -365 }, { 0, 0, -361 }, { 0, 0, -358 }, { 0, 0, -354 }, { 0, 0, -351 }, { 0, 0, -348 }, + { 0, 0, -344 }, { 0, 0, -341 }, { 0, 0, -338 }, { 0, 0, -335 }, { 0, 0, -332 }, { 0, 0, -329 }, { 0, 0, -326 }, + { 0, 0, -324 }, { 0, 0, -321 }, { 0, 0, -319 }, { 0, 0, -317 }, { 0, 0, -315 }, { 0, 0, -314 }, { 0, 0, -312 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -313 }, { 0, 0, -316 }, { 0, 0, -320 }, { 0, 0, -325 }, { 0, 0, -331 }, + { 0, 0, -336 }, { 0, 0, -342 }, { 0, 0, -347 }, { 0, 0, -351 }, { 0, 0, -355 }, { 0, 0, -357 }, { 0, 0, -357 }, + { 0, 0, -356 }, { 0, 0, -355 }, { 0, 0, -354 }, { 0, 0, -353 }, { 0, 0, -352 }, { 0, 0, -350 }, { 0, 0, -349 }, + { 0, 0, -347 }, { 0, 0, -345 }, { 0, 0, -343 }, { 0, 0, -340 }, { 0, 0, -338 }, { 0, 0, -335 }, { 0, 0, -332 }, + { 0, 0, -329 }, { 0, 0, -325 }, { 0, 0, -322 }, { 0, 0, -318 }, { 0, 0, -314 }, { 0, 0, -309 }, { 0, 0, -304 }, + { 0, 0, -299 }, { 0, 0, -294 }, { 0, 0, -288 }, { 0, 0, -282 }, { 0, 0, -268 }, { 0, 0, -243 }, { 0, 0, -213 }, + { 0, 0, -188 }, { 0, 0, -174 }, { 0, 0, -168 }, { 0, 0, -164 }, { 0, 0, -160 }, { 0, 0, -158 }, { 0, 0, -156 }, + { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -155 }, { 0, 0, -156 }, { 0, 0, -157 }, { 0, 0, -158 }, + { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, + { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -163 }, { 0, 0, -164 }, { 0, 0, -165 }, + { 0, 0, -165 }, { 0, 0, -166 }, { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -169 }, { 0, 0, -170 }, + { 0, 0, -171 }, { 0, 0, -171 }, { 0, 0, -172 }, { 0, 0, -172 }, { 0, 0, -173 }, { 0, 0, -173 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -175 }, + { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, + { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -175 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, + { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -174 }, { 0, 0, -175 }, { 0, 0, -176 }, + { 0, 0, -178 }, { 0, 0, -179 }, { 0, 0, -180 }, { 0, 0, -182 }, { 0, 0, -183 }, { 0, 0, -184 }, { 0, 0, -185 }, + { 0, 0, -185 }, { 0, 0, -185 }, { 0, 0, -185 }, { 0, 0, -184 }, { 0, 0, -182 }, { 0, 0, -180 }, { 0, 0, -177 }, + { 0, 0, -174 }, { 0, 0, -148 }, { 0, 0, -105 }, { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -79 }, { 0, 0, -78 }, + { 0, 0, -77 }, { 0, 0, -76 }, { 0, 0, -75 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -73 }, { 0, 0, -72 }, + { 0, 0, -72 }, { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -69 }, + { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, + { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -69 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, { 0, 0, -70 }, + { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -71 }, { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -72 }, { 0, 0, -73 }, + { 0, 0, -73 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -74 }, { 0, 0, -75 }, { 0, 0, -75 }, { 0, 0, -76 }, + { 0, 0, -76 }, { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -78 }, { 0, 0, -79 }, + { 0, 0, -79 }, { 0, 0, -79 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -81 }, { 0, 0, -81 }, + { 0, 0, -81 }, { 0, 0, -81 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, { 0, 0, -82 }, + { 0, 0, -82 }, { 0, 0, -81 }, { 0, 0, -80 }, { 0, 0, -80 }, { 0, 0, -79 }, { 0, 0, -78 }, { 0, 0, -77 }, + { 0, 0, -77 }, { 0, 0, -77 }, { 0, 0, -78 }, { 0, 0, -80 }, { 0, 0, -82 }, { 0, 0, -85 }, { 0, 0, -88 }, + { 0, 0, -93 }, { 0, 0, -97 }, { 0, 0, -102 }, { 0, 0, -107 }, { 0, 0, -113 }, { 0, 0, -118 }, { 0, 0, -124 }, + { 0, 0, -129 }, { 0, 0, -135 }, { 0, 0, -140 }, { 0, 0, -145 }, { 0, 0, -149 }, { 0, 0, -152 }, { 0, 0, -155 }, + { 0, 0, -158 }, { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -162 }, { 0, 0, -163 }, { 0, 0, -164 }, + { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -167 }, { 0, 0, -167 }, + { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, + { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -167 }, + { 0, 0, -167 }, { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -166 }, { 0, 0, -165 }, { 0, 0, -165 }, { 0, 0, -165 }, + { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -163 }, { 0, 0, -163 }, { 0, 0, -163 }, { 0, 0, -162 }, + { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -161 }, { 0, 0, -160 }, { 0, 0, -160 }, + { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -159 }, { 0, 0, -159 }, { 0, 0, -159 }, + { 0, 0, -159 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -160 }, { 0, 0, -161 }, { 0, 0, -161 }, + { 0, 0, -162 }, { 0, 0, -162 }, { 0, 0, -163 }, { 0, 0, -164 }, { 0, 0, -164 }, { 0, 0, -165 }, { 0, 0, -165 }, + { 0, 0, -166 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -168 }, { 0, 0, -168 }, { 0, 0, -169 }, { 0, 0, -169 }, + { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, { 0, 0, -170 }, + { 0, 0, -170 }, { 0, 0, -169 }, { 0, 0, -169 }, { 0, 0, -168 }, { 0, 0, -167 }, { 0, 0, -167 }, { 0, 0, -165 }, + { 0, 0, -164 }, { 0, 0, -163 }, { 0, 0, -161 }, { 0, 0, -159 }, { 0, 0, -157 }, { 0, 0, -152 }, { 0, 0, -146 }, + { 0, 0, -139 }, { 0, 0, -132 }, { 0, 0, -123 }, { 0, 0, -114 }, { 0, 0, -105 }, { 0, 0, -96 }, { 0, 0, -87 }, + { 0, 0, -79 }, { 0, 0, -71 }, { 0, 0, -64 }, { 0, 0, -59 }, { 0, 0, -54 }, { 0, 0, -50 }, { 0, 0, -46 }, + { 0, 0, -42 }, { 0, 0, -39 }, { 0, 0, -36 }, { 0, 0, -33 }, { 0, 0, -30 }, { 0, 0, -28 }, { 0, 0, -26 }, + { 0, 0, -25 }, { 0, 0, -23 }, { 0, 0, -23 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -24 }, + { 0, 0, -26 }, { 0, 0, -29 }, { 0, 0, -33 }, { 0, 0, -36 }, { 0, 0, -40 }, { 0, 0, -44 }, { 0, 0, -48 }, + { 0, 0, -52 }, { 0, 0, -55 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -58 }, { 0, 0, -57 }, + { 0, 0, -55 }, { 0, 0, -52 }, { 0, 0, -49 }, { 0, 0, -46 }, { 0, 0, -42 }, { 0, 0, -39 }, { 0, 0, -35 }, + { 0, 0, -31 }, { 0, 0, -28 }, { 0, 0, -26 }, { 0, 0, -24 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, + { 0, 0, -24 }, { 0, 0, -26 }, { 0, 0, -29 }, { 0, 0, -33 }, { 0, 0, -36 }, { 0, 0, -40 }, { 0, 0, -44 }, + { 0, 0, -48 }, { 0, 0, -52 }, { 0, 0, -55 }, { 0, 0, -57 }, { 0, 0, -58 }, { 0, 0, -59 }, { 0, 0, -58 }, + { 0, 0, -57 }, { 0, 0, -54 }, { 0, 0, -51 }, { 0, 0, -47 }, { 0, 0, -43 }, { 0, 0, -38 }, { 0, 0, -34 }, + { 0, 0, -30 }, { 0, 0, -27 }, { 0, 0, -24 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -22 }, { 0, 0, -23 }, + { 0, 0, -23 }, { 0, 0, -25 }, { 0, 0, -26 }, { 0, 0, -28 }, { 0, 0, -30 }, { 0, 0, -33 }, { 0, 0, -35 }, + { 0, 0, -39 }, { 0, 0, -42 }, { 0, 0, -46 }, { 0, 0, -50 }, { 0, 0, -54 }, { 0, 0, -59 }, { 0, 0, -64 }, + { 0, 0, -69 }, { 0, 0, -74 }, { 0, 0, -79 }, { 0, 0, -85 }, { 0, 0, -90 }, { 0, 0, -96 }, { 0, 0, -102 }, + { 0, 0, -107 }, { 0, 0, -113 }, { 0, 0, -119 }, { 0, 0, -125 }, { 0, 0, -131 }, { 0, 0, -137 }, { 0, 0, -144 }, + { 0, 0, -150 }, { 0, 0, -156 }, { 0, 0, -162 }, { 0, 0, -168 }, { 0, 0, -175 }, { 0, 0, -181 }, { 0, 0, -187 }, + { 0, 0, -193 }, { 0, 0, -200 }, { 0, 0, -206 }, { 0, 0, -212 }, { 0, 0, -218 }, { 0, 0, -224 }, { 0, 0, -230 }, + { 0, 0, -236 }, { 0, 0, -242 }, { 0, 0, -247 }, { 0, 0, -253 }, { 0, 0, -259 }, { 0, 0, -264 }, { 0, 0, -269 }, + { 0, 0, -275 }, { 0, 0, -280 }, { 0, 0, -285 }, { 0, 0, -289 }, { 0, 0, -294 }, { 0, 0, -299 }, { 0, 0, -303 }, + { 0, 0, -307 }, { 0, 0, -311 }, { 0, 0, -315 }, { 0, 0, -318 }, { 0, 0, -321 }, { 0, 0, -324 }, { 0, 0, -326 }, + { 0, 0, -329 }, { 0, 0, -330 }, { 0, 0, -331 }, { 0, 0, -332 }, { 0, 0, -333 }, { 0, 0, -333 }, { 0, 0, -332 }, + { 0, 0, -331 }, { 0, 0, -330 }, { 0, 0, -328 }, { 0, 0, -326 }, { 0, 0, -323 }, { 0, 0, -320 }, { 0, 0, -316 }, + { 0, 0, -311 }, { 0, 0, -305 }, { 0, 0, -296 }, { 0, 0, -285 }, { 0, 0, -272 }, { 0, 0, -258 }, { 0, 0, -243 }, + { 0, 0, -228 }, { 0, 0, -212 }, { 0, 0, -197 }, { 0, 0, -182 }, { 0, 0, -168 }, { 0, 0, -156 }, { 0, 0, -144 }, + { 0, 0, -130 }, { 0, 0, -116 }, { 0, 0, -104 }, { 0, 0, -93 }, { 0, 0, -86 }, { 0, 0, -84 }, { 0, 0, -88 }, + { 0, 0, -100 }, { 0, 0, -123 }, { 0, 0, -151 }, { 0, 0, -182 }, { 0, 0, -213 }, { 0, 0, -240 }, { 0, 0, -261 }, + { 0, 0, -271 }, { 0, 0, -275 }, { 0, 0, -278 }, { 0, 0, -281 }, { 0, 0, -284 }, { 0, 0, -286 }, { 0, 0, -288 }, + { 0, 0, -289 }, { 0, 0, -291 }, { 0, 0, -292 }, { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -293 }, + { 0, 0, -293 }, { 0, 0, -293 }, { 0, 0, -292 }, { 0, 0, -292 }, { 0, 0, -291 }, { 0, 0, -290 }, { 0, 0, -289 }, + { 0, 0, -288 }, { 0, 0, -286 }, { 0, 0, -285 }, { 0, 0, -284 }, { 0, 0, -283 }, { 0, 0, -281 }, { 0, 0, -280 }, + { 0, 0, -279 }, { 0, 0, -277 }, { 0, 0, -276 }, { 0, 0, -275 }, { 0, 0, -274 }, { 0, 0, -273 }, { 0, 0, -272 }, + { 0, 0, -272 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, + { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -271 }, { 0, 0, -270 }, { 0, 0, -271 }, { 0, 0, -275 }, { 0, 0, -279 }, + { 0, 0, -284 }, { 0, 0, -290 }, { 0, 0, -295 }, { 0, 0, -300 }, { 0, 0, -304 }, { 0, 0, -308 }, { 0, 0, -310 }, + { 0, 0, -311 }, }; static s16 animdata_mario_lips_5_2[][3] = { - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -310 }, { 0, 0, -309 }, { 0, 0, -308 }, - { 0, 0, -307 }, { 0, 0, -306 }, { 0, 0, -305 }, { 0, 0, -303 }, { 0, 0, -302 }, { 0, 0, -300 }, - { 0, 0, -299 }, { 0, 0, -297 }, { 0, 0, -296 }, { 0, 0, -294 }, { 0, 0, -293 }, { 0, 0, -292 }, - { 0, 0, -290 }, { 0, 0, -289 }, { 0, 0, -289 }, { 0, 0, -288 }, { 0, 0, -287 }, { 0, 0, -287 }, - { 0, 0, -287 }, { 0, 0, -288 }, { 0, 0, -288 }, { 0, 0, -289 }, { 0, 0, -290 }, { 0, 0, -292 }, - { 0, 0, -294 }, { 0, 0, -297 }, { 0, 0, -300 }, { 0, 0, -303 }, { 0, 0, -307 }, { 0, 0, -311 }, - { 0, 0, -333 }, { 0, 0, -379 }, { 0, 0, -432 }, { 0, 0, -476 }, { 0, 0, -494 }, { 0, 0, -466 }, - { 0, 0, -403 }, { 0, 0, -340 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, - { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -310 }, { 0, 0, -309 }, { 0, 0, -308 }, { 0, 0, -307 }, + { 0, 0, -306 }, { 0, 0, -305 }, { 0, 0, -303 }, { 0, 0, -302 }, { 0, 0, -300 }, { 0, 0, -299 }, { 0, 0, -297 }, + { 0, 0, -296 }, { 0, 0, -294 }, { 0, 0, -293 }, { 0, 0, -292 }, { 0, 0, -290 }, { 0, 0, -289 }, { 0, 0, -289 }, + { 0, 0, -288 }, { 0, 0, -287 }, { 0, 0, -287 }, { 0, 0, -287 }, { 0, 0, -288 }, { 0, 0, -288 }, { 0, 0, -289 }, + { 0, 0, -290 }, { 0, 0, -292 }, { 0, 0, -294 }, { 0, 0, -297 }, { 0, 0, -300 }, { 0, 0, -303 }, { 0, 0, -307 }, + { 0, 0, -311 }, { 0, 0, -333 }, { 0, 0, -379 }, { 0, 0, -432 }, { 0, 0, -476 }, { 0, 0, -494 }, { 0, 0, -466 }, + { 0, 0, -403 }, { 0, 0, -340 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, + { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, { 0, 0, -311 }, }; struct AnimDataInfo anim_mario_lips_5[] = { @@ -565,256 +509,207 @@ struct AnimDataInfo anim_mario_lips_5[] = { }; static s16 animdata_mario_lip_6_1[][3] = { - { 0, 0, -1115 }, { 0, 0, -1116 }, { 0, 0, -1117 }, { 0, 0, -1119 }, - { 0, 0, -1122 }, { 0, 0, -1125 }, { 0, 0, -1129 }, { 0, 0, -1133 }, - { 0, 0, -1137 }, { 0, 0, -1142 }, { 0, 0, -1146 }, { 0, 0, -1151 }, - { 0, 0, -1155 }, { 0, 0, -1159 }, { 0, 0, -1163 }, { 0, 0, -1166 }, - { 0, 0, -1169 }, { 0, 0, -1171 }, { 0, 0, -1172 }, { 0, 0, -1171 }, - { 0, 0, -1167 }, { 0, 0, -1160 }, { 0, 0, -1152 }, { 0, 0, -1143 }, - { 0, 0, -1136 }, { 0, 0, -1131 }, { 0, 0, -1129 }, { 0, 0, -1131 }, - { 0, 0, -1138 }, { 0, 0, -1150 }, { 0, 0, -1167 }, { 0, 0, -1187 }, - { 0, 0, -1209 }, { 0, 0, -1233 }, { 0, 0, -1259 }, { 0, 0, -1285 }, - { 0, 0, -1310 }, { 0, 0, -1335 }, { 0, 0, -1358 }, { 0, 0, -1378 }, - { 0, 0, -1395 }, { 0, 0, -1408 }, { 0, 0, -1417 }, { 0, 0, -1374 }, - { 0, 0, -1287 }, { 0, 0, -1241 }, { 1, 1, -1247 }, { 3, 3, -1257 }, - { 4, 4, -1272 }, { 6, 6, -1290 }, { 8, 8, -1310 }, { 10, 10, -1332 }, - { 13, 12, -1355 }, { 15, 14, -1378 }, { 16, 16, -1400 }, { 18, 18, -1420 }, - { 20, 19, -1438 }, { 21, 21, -1451 }, { 22, 22, -1461 }, { 23, 22, -1465 }, - { 23, 22, -1463 }, { 22, 21, -1444 }, { 19, 19, -1402 }, { 15, 15, -1346 }, - { 11, 11, -1283 }, { 7, 7, -1221 }, { 3, 3, -1167 }, { 0, 0, -1129 }, - { 0, 0, -1115 }, { 0, 0, -1106 }, { 0, 0, -1115 }, { 0, 0, -1154 }, - { 0, 0, -1199 }, { 0, 0, -1246 }, { 0, 0, -1296 }, { 0, 0, -1346 }, - { 0, 0, -1395 }, { 0, 0, -1442 }, { 0, 0, -1484 }, { 0, 0, -1521 }, - { 0, 0, -1551 }, { 0, 0, -1572 }, { 2, 2, -1586 }, { 3, 4, -1592 }, - { 4, 5, -1591 }, { 5, 5, -1584 }, { 3, 4, -1570 }, { 0, 0, -1551 }, - { -7, -9, -1515 }, { -19, -23, -1461 }, { -33, -40, -1397 }, { -47, -56, -1336 }, - { -58, -69, -1286 }, { -64, -76, -1260 }, { -66, -79, -1249 }, { -68, -82, -1242 }, - { -70, -84, -1237 }, { -72, -86, -1234 }, { -73, -87, -1234 }, { -74, -89, -1235 }, - { -75, -89, -1238 }, { -75, -90, -1242 }, { -76, -90, -1246 }, { -75, -90, -1251 }, - { -75, -89, -1255 }, { -74, -89, -1260 }, { -73, -87, -1263 }, { -72, -86, -1266 }, - { -70, -84, -1267 }, { -68, -82, -1267 }, { -66, -79, -1264 }, { -64, -76, -1260 }, - { -57, -68, -1244 }, { -46, -55, -1215 }, { -32, -38, -1180 }, { -18, -21, -1146 }, - { -6, -7, -1122 }, { 0, 0, -1115 }, { 2, 3, -1121 }, { 4, 5, -1131 }, - { 5, 6, -1143 }, { 6, 7, -1159 }, { 6, 8, -1176 }, { 6, 8, -1195 }, - { 6, 7, -1214 }, { 5, 6, -1235 }, { 5, 5, -1255 }, { 4, 4, -1274 }, - { 3, 3, -1293 }, { 2, 2, -1309 }, { 1, 1, -1324 }, { 0, 0, -1336 }, - { 0, 0, -1345 }, { 0, 0, -1350 }, { 0, 0, -1353 }, { 0, 0, -1355 }, - { 0, 0, -1356 }, { 0, 0, -1356 }, { 0, 0, -1356 }, { 0, 0, -1355 }, - { 0, 0, -1354 }, { 0, 0, -1352 }, { 0, 0, -1349 }, { 0, 0, -1346 }, - { 0, 0, -1342 }, { 0, 0, -1338 }, { 0, 0, -1334 }, { 0, 0, -1329 }, - { 0, 0, -1324 }, { 0, 0, -1319 }, { 0, 0, -1313 }, { 0, 0, -1307 }, - { 0, 0, -1301 }, { 0, 0, -1295 }, { 0, 0, -1288 }, { 0, 0, -1282 }, - { 0, 0, -1275 }, { 0, 0, -1269 }, { 0, 0, -1262 }, { 0, 0, -1255 }, - { 0, 0, -1249 }, { 0, 0, -1217 }, { 0, 0, -1169 }, { 0, 0, -1157 }, - { 0, 0, -1231 }, { 0, 0, -1341 }, { 0, 0, -1396 }, { 0, 0, -1387 }, - { 0, 0, -1367 }, { 0, 0, -1339 }, { 0, 0, -1306 }, { 0, 0, -1268 }, - { 0, 0, -1228 }, { 0, 0, -1188 }, { 0, 0, -1149 }, { 0, 0, -1115 }, - { 0, 0, -1078 }, { 0, 0, -1035 }, { 0, 0, -995 }, { 0, 0, -965 }, - { 0, 0, -953 }, { 0, 0, -960 }, { 0, 0, -977 }, { 0, 0, -1001 }, - { 0, 0, -1029 }, { 0, 0, -1058 }, { 0, 0, -1084 }, { 0, 0, -1104 }, - { 0, 0, -1115 }, { 0, 0, -1120 }, { 0, 0, -1123 }, { 0, 0, -1126 }, - { 0, 0, -1128 }, { 0, 0, -1129 }, { 0, 0, -1130 }, { 0, 0, -1130 }, - { 0, 0, -1130 }, { 0, 0, -1130 }, { 0, 0, -1129 }, { 0, 0, -1127 }, - { 0, 0, -1126 }, { 0, 0, -1124 }, { 0, 0, -1122 }, { 0, 0, -1121 }, - { 0, 0, -1119 }, { 0, 0, -1117 }, { 0, 0, -1116 }, { 0, 0, -1114 }, - { 0, 0, -1114 }, { 0, 0, -1113 }, { 0, 0, -1113 }, { 0, 0, -1113 }, - { 0, 0, -1114 }, { 0, 0, -1115 }, { 0, 0, -1123 }, { 0, 0, -1137 }, - { 0, 0, -1154 }, { 0, 0, -1166 }, { 0, 0, -1167 }, { 0, 0, -1157 }, - { 0, 0, -1143 }, { 0, 0, -1125 }, { 0, 0, -1105 }, { 0, 0, -1084 }, - { 0, 0, -1064 }, { 0, 0, -1048 }, { 0, 0, -1035 }, { 0, 0, -1026 }, - { 0, 0, -1021 }, { 0, -1, -1018 }, { 1, -1, -1016 }, { 1, -2, -1016 }, - { 1, -2, -1016 }, { 1, -3, -1016 }, { 2, -3, -1016 }, { 2, -3, -1016 }, - { 2, -3, -1015 }, { 2, -4, -1015 }, { 3, -5, -1014 }, { 3, -5, -1013 }, - { 4, -6, -1013 }, { 4, -7, -1012 }, { 5, -8, -1011 }, { 5, -9, -1011 }, - { 6, -9, -1010 }, { 6, -10, -1010 }, { 7, -11, -1010 }, { 7, -11, -1010 }, - { 7, -11, -1010 }, { 7, -11, -1011 }, { 7, -11, -1012 }, { 7, -11, -1013 }, - { 7, -10, -1015 }, { 6, -9, -1017 }, { 5, -8, -1019 }, { 4, -7, -1022 }, - { 3, -5, -1026 }, { 1, -2, -1030 }, { 0, 0, -1035 }, { -2, 3, -1041 }, - { -5, 7, -1048 }, { -8, 12, -1058 }, { -12, 18, -1068 }, { -17, 24, -1080 }, - { -22, 31, -1092 }, { -27, 38, -1105 }, { -33, 46, -1119 }, { -38, 54, -1133 }, - { -44, 62, -1147 }, { -49, 70, -1161 }, { -55, 78, -1174 }, { -60, 86, -1187 }, - { -65, 93, -1199 }, { -70, 101, -1210 }, { -74, 108, -1219 }, { -78, 114, -1228 }, - { -81, 120, -1234 }, { -83, 126, -1239 }, { -85, 130, -1242 }, { -86, 135, -1241 }, - { -86, 139, -1235 }, { -86, 143, -1226 }, { -84, 147, -1213 }, { -82, 150, -1199 }, - { -80, 153, -1182 }, { -77, 156, -1165 }, { -74, 158, -1148 }, { -71, 159, -1132 }, - { -67, 160, -1117 }, { -63, 159, -1104 }, { -59, 158, -1094 }, { -55, 156, -1088 }, - { -52, 152, -1086 }, { -48, 148, -1089 }, { -44, 140, -1102 }, { -38, 128, -1127 }, - { -32, 113, -1161 }, { -25, 95, -1201 }, { -18, 76, -1243 }, { -11, 57, -1286 }, - { -6, 39, -1326 }, { -2, 22, -1359 }, { 0, 9, -1383 }, { 0, 0, -1396 }, - { -2, -6, -1397 }, { -6, -10, -1392 }, { -12, -12, -1381 }, { -19, -13, -1365 }, - { -27, -13, -1346 }, { -35, -13, -1324 }, { -44, -11, -1301 }, { -53, -10, -1278 }, - { -61, -8, -1256 }, { -68, -7, -1236 }, { -74, -6, -1219 }, { -79, -6, -1206 }, - { -83, -6, -1200 }, { -86, -6, -1198 }, { -88, -7, -1200 }, { -89, -7, -1203 }, - { -87, -7, -1207 }, { -84, -6, -1208 }, { -79, -6, -1206 }, { -70, -5, -1200 }, - { -55, -4, -1190 }, { -37, -2, -1179 }, { -20, -1, -1167 }, { -7, 0, -1157 }, - { 0, 0, -1149 }, { 2, 0, -1144 }, { 4, 0, -1137 }, { 6, 0, -1131 }, - { 7, 0, -1124 }, { 8, 0, -1117 }, { 9, 0, -1110 }, { 9, 0, -1103 }, - { 9, 0, -1096 }, { 8, 0, -1089 }, { 8, 0, -1082 }, { 7, 0, -1076 }, - { 7, 0, -1070 }, { 6, 0, -1064 }, { 5, 0, -1059 }, { 4, 0, -1055 }, - { 3, 0, -1051 }, { 2, 0, -1048 }, { 1, 0, -1046 }, { 1, 0, -1044 }, - { 0, 0, -1044 }, { 0, 0, -1045 }, { 0, 0, -1046 }, { 0, 0, -1049 }, - { 0, 0, -1053 }, { 0, 0, -1058 }, { 0, 0, -1063 }, { 0, 0, -1069 }, - { 0, 0, -1076 }, { 0, 0, -1084 }, { 0, 0, -1092 }, { 0, 0, -1100 }, - { 0, 0, -1109 }, { 0, 0, -1119 }, { 0, 0, -1128 }, { 0, 0, -1138 }, - { 0, 0, -1148 }, { 0, 0, -1158 }, { 0, 0, -1169 }, { 0, 0, -1179 }, - { 0, 0, -1189 }, { 0, 0, -1199 }, { 0, 0, -1208 }, { 0, 0, -1218 }, - { 0, 0, -1227 }, { 0, 0, -1235 }, { 0, 0, -1243 }, { 0, 0, -1251 }, - { 0, 0, -1258 }, { 0, 0, -1264 }, { 0, 0, -1270 }, { 0, 0, -1276 }, - { 0, 0, -1281 }, { 0, 0, -1285 }, { 0, 0, -1288 }, { 0, 0, -1288 }, - { 0, 0, -1287 }, { 0, 0, -1282 }, { 0, 0, -1275 }, { 0, 0, -1264 }, - { 0, 0, -1231 }, { 0, 0, -1173 }, { 0, 0, -1116 }, { 0, 0, -1084 }, - { 0, 0, -1073 }, { 0, 0, -1062 }, { 0, 0, -1052 }, { 0, 0, -1043 }, - { 0, 0, -1036 }, { 0, 0, -1032 }, { 0, 0, -1030 }, { 0, 0, -1032 }, - { 0, 0, -1038 }, { 0, 0, -1048 }, { 0, 0, -1063 }, { 0, 0, -1084 }, - { 0, 0, -1132 }, { 0, 0, -1215 }, { 0, 0, -1315 }, { 0, 0, -1409 }, - { 0, 0, -1479 }, { 0, 0, -1505 }, { 0, 0, -1493 }, { 0, 0, -1468 }, - { 0, 0, -1432 }, { 0, 0, -1387 }, { 0, -1, -1336 }, { 1, -1, -1281 }, - { 1, -1, -1225 }, { 1, -2, -1170 }, { 1, -2, -1120 }, { 1, -2, -1075 }, - { 1, -2, -1040 }, { 1, -3, -1016 }, { 2, -3, -1001 }, { 2, -3, -989 }, - { 2, -3, -980 }, { 2, -3, -974 }, { 2, -3, -971 }, { 2, -3, -971 }, - { 2, -3, -972 }, { 2, -3, -975 }, { 2, -3, -979 }, { 2, -3, -984 }, - { 2, -3, -990 }, { 1, -3, -996 }, { 1, -3, -1002 }, { 1, -3, -1007 }, - { 1, -3, -1012 }, { 1, -3, -1016 }, { 1, -3, -1019 }, { 2, -2, -1021 }, - { 2, -2, -1024 }, { 2, -2, -1027 }, { 2, -2, -1030 }, { 2, -2, -1035 }, - { 2, -2, -1041 }, { 2, -2, -1049 }, { 2, -2, -1059 }, { 2, -2, -1072 }, - { 2, -2, -1088 }, { 2, -2, -1108 }, { 2, -2, -1139 }, { 2, -2, -1185 }, - { 2, -1, -1241 }, { 3, -1, -1300 }, { 3, -1, -1356 }, { 3, -1, -1403 }, - { 3, 0, -1434 }, { 3, 0, -1443 }, { 3, -1, -1416 }, { 3, -1, -1351 }, - { 2, -1, -1266 }, { 2, -2, -1178 }, { 2, -2, -1104 }, { 2, -2, -1062 }, - { 2, -2, -1045 }, { 2, -2, -1036 }, { 2, -3, -1033 }, { 2, -3, -1036 }, - { 2, -2, -1042 }, { 2, -2, -1050 }, { 2, -2, -1058 }, { 2, -2, -1066 }, - { 2, -2, -1072 }, { 2, -2, -1074 }, { 2, -2, -1071 }, { 2, -2, -1062 }, - { 1, -3, -1005 }, { 1, -3, -914 }, { 1, -3, -867 }, { 1, -3, -870 }, - { 1, -3, -875 }, { 1, -3, -883 }, { 1, -3, -894 }, { 1, -3, -906 }, - { 1, -3, -920 }, { 1, -3, -935 }, { 1, -3, -951 }, { 1, -3, -968 }, - { 1, -3, -986 }, { 1, -2, -1003 }, { 1, -2, -1021 }, { 2, -2, -1038 }, - { 2, -2, -1055 }, { 2, -2, -1071 }, { 2, -2, -1086 }, { 2, -2, -1102 }, - { 2, -2, -1119 }, { 2, -2, -1135 }, { 2, -2, -1148 }, { 2, -2, -1158 }, - { 2, -2, -1167 }, { 2, -2, -1177 }, { 2, -2, -1186 }, { 2, -2, -1195 }, - { 2, -2, -1203 }, { 2, -2, -1212 }, { 2, -2, -1220 }, { 2, -2, -1228 }, - { 2, -2, -1235 }, { 2, -2, -1243 }, { 2, -1, -1250 }, { 3, -1, -1257 }, - { 3, -1, -1263 }, { 3, -1, -1265 }, { 3, -1, -1257 }, { 2, -2, -1240 }, - { 2, -2, -1220 }, { 2, -2, -1198 }, { 2, -2, -1174 }, { 2, -2, -1149 }, - { 2, -2, -1123 }, { 2, -2, -1099 }, { 2, -2, -1076 }, { 2, -2, -1054 }, - { 2, -2, -1036 }, { 2, -2, -1022 }, { 1, -3, -1013 }, { 1, -3, -1008 }, - { 1, -3, -1010 }, { 1, -2, -1020 }, { 2, -2, -1038 }, { 2, -2, -1062 }, - { 2, -2, -1092 }, { 2, -2, -1126 }, { 2, -2, -1163 }, { 2, -2, -1201 }, - { 2, -1, -1240 }, { 2, -1, -1278 }, { 3, -1, -1313 }, { 3, -1, -1345 }, - { 3, -1, -1372 }, { 3, -1, -1393 }, { 3, -1, -1407 }, { 3, -1, -1411 }, - { 3, -1, -1406 }, { 3, -1, -1389 }, { 3, -1, -1364 }, { 3, -1, -1332 }, - { 3, -1, -1294 }, { 2, -1, -1254 }, { 2, -2, -1211 }, { 2, -2, -1168 }, - { 2, -2, -1127 }, { 2, -2, -1090 }, { 2, -2, -1058 }, { 2, -2, -1033 }, - { 1, -3, -1016 }, { 1, -3, -1010 }, { 1, -3, -1015 }, { 2, -2, -1030 }, - { 2, -2, -1052 }, { 2, -2, -1081 }, { 2, -2, -1114 }, { 2, -2, -1151 }, - { 2, -2, -1191 }, { 2, -1, -1231 }, { 2, -1, -1270 }, { 3, -1, -1307 }, - { 3, -1, -1341 }, { 3, -1, -1370 }, { 3, -1, -1392 }, { 3, -1, -1406 }, - { 3, -1, -1411 }, { 3, -1, -1406 }, { 3, -1, -1389 }, { 3, -1, -1364 }, - { 3, -1, -1332 }, { 3, -1, -1294 }, { 2, -1, -1254 }, { 2, -2, -1211 }, - { 2, -2, -1168 }, { 2, -2, -1127 }, { 2, -2, -1090 }, { 2, -2, -1058 }, - { 2, -2, -1033 }, { 1, -3, -1016 }, { 1, -3, -1010 }, { 1, -2, -1017 }, - { 2, -2, -1036 }, { 2, -2, -1065 }, { 2, -2, -1101 }, { 2, -2, -1143 }, - { 2, -2, -1188 }, { 2, -1, -1234 }, { 2, -1, -1279 }, { 3, -1, -1321 }, - { 3, -1, -1357 }, { 3, -1, -1386 }, { 3, -1, -1405 }, { 3, -1, -1411 }, - { 3, -1, -1407 }, { 3, -1, -1393 }, { 3, -1, -1372 }, { 3, -1, -1345 }, - { 3, -1, -1313 }, { 2, -1, -1277 }, { 2, -1, -1239 }, { 2, -2, -1201 }, - { 2, -2, -1162 }, { 2, -2, -1125 }, { 2, -2, -1091 }, { 2, -2, -1062 }, - { 2, -2, -1037 }, { 2, -3, -1020 }, { 1, -3, -1010 }, { 1, -3, -1006 }, - { 1, -2, -1002 }, { 1, -2, -998 }, { 1, -2, -996 }, { 1, -2, -994 }, - { 1, -2, -992 }, { 1, -2, -991 }, { 1, -2, -990 }, { 1, -2, -990 }, - { 1, -2, -991 }, { 1, -2, -992 }, { 1, -2, -993 }, { 1, -2, -995 }, - { 1, -2, -997 }, { 1, -2, -999 }, { 1, -2, -1002 }, { 1, -2, -1005 }, - { 1, -2, -1008 }, { 0, -1, -1012 }, { 0, -1, -1016 }, { 0, -1, -1020 }, - { 0, -1, -1024 }, { 0, -1, -1028 }, { 0, -1, -1032 }, { 0, -1, -1037 }, - { 0, -1, -1042 }, { 0, -1, -1046 }, { 0, -1, -1051 }, { 0, -1, -1056 }, - { 0, -1, -1061 }, { 0, 0, -1065 }, { 0, 0, -1070 }, { 0, 0, -1075 }, - { 0, 0, -1079 }, { 0, 0, -1084 }, { 0, 0, -1088 }, { 0, 0, -1092 }, - { 0, 0, -1096 }, { 0, 0, -1099 }, { 0, 0, -1103 }, { 0, 0, -1106 }, - { 0, 0, -1109 }, { 0, 0, -1111 }, { 0, 0, -1113 }, { 0, 0, -1115 }, - { 0, 0, -1116 }, { 0, 0, -1116 }, { 0, 0, -1115 }, { 0, 0, -1114 }, - { 0, 0, -1112 }, { 0, 0, -1109 }, { 0, 0, -1107 }, { 0, 0, -1104 }, - { 0, 0, -1101 }, { 0, 0, -1098 }, { 0, 0, -1096 }, { 0, 0, -1094 }, - { 0, 0, -1093 }, { 0, 0, -1092 }, { 0, 0, -1093 }, { 0, 0, -1095 }, - { 0, 0, -1098 }, { 0, 0, -1102 }, { 0, 0, -1108 }, { 0, 0, -1115 }, - { 0, 0, -1128 }, { 0, 0, -1148 }, { 0, 0, -1174 }, { 0, 0, -1205 }, - { 0, 0, -1237 }, { 0, 0, -1270 }, { 0, 0, -1301 }, { 0, 0, -1329 }, - { 0, 0, -1352 }, { 0, 0, -1368 }, { 0, 0, -1375 }, { 0, 0, -1372 }, - { 0, 0, -1361 }, { 0, 0, -1342 }, { 0, 0, -1318 }, { 0, 0, -1290 }, - { 0, 0, -1258 }, { 0, 0, -1225 }, { 0, 0, -1192 }, { 0, 0, -1161 }, - { 0, 0, -1127 }, { 0, 0, -1086 }, { 0, 0, -1041 }, { 0, 0, -996 }, - { 0, 0, -953 }, { 0, 0, -914 }, { 0, 0, -883 }, { 0, 0, -863 }, - { 0, 0, -849 }, { 0, 0, -836 }, { 0, 0, -823 }, { 0, 0, -813 }, - { 0, 0, -804 }, { 0, 0, -798 }, { 0, 0, -795 }, { 0, 0, -795 }, - { 0, 0, -799 }, { 0, 0, -807 }, { 0, 0, -821 }, { 0, 0, -839 }, - { 0, 0, -863 }, { 0, 0, -928 }, { 0, 0, -1045 }, { 0, 0, -1178 }, - { 0, 0, -1291 }, { 0, 0, -1350 }, { 0, 0, -1368 }, { 0, 0, -1382 }, - { 0, 0, -1392 }, { 0, 0, -1400 }, { 0, 0, -1405 }, { 0, 0, -1407 }, - { 0, 0, -1408 }, { 0, 0, -1406 }, { 0, 0, -1403 }, { 0, 0, -1399 }, - { 0, 0, -1393 }, { 0, 0, -1387 }, { 0, 0, -1381 }, { 0, 0, -1375 }, - { 0, 0, -1368 }, { 0, 0, -1362 }, { 0, 0, -1357 }, { 0, 0, -1354 }, - { 0, 0, -1351 }, { 0, 0, -1350 }, { 0, 0, -1350 }, { 0, 0, -1350 }, - { 0, 0, -1350 }, { 0, 0, -1351 }, { 0, 0, -1351 }, { 0, 0, -1352 }, - { 0, 0, -1352 }, { 0, 0, -1353 }, { 0, 0, -1353 }, { 0, 0, -1354 }, - { 0, 0, -1355 }, { 0, 0, -1356 }, { 0, 0, -1357 }, { 0, 0, -1358 }, - { 0, 0, -1359 }, { 0, 0, -1360 }, { 0, 0, -1361 }, { 0, 0, -1362 }, - { 0, 0, -1363 }, { 0, 0, -1364 }, { 0, 0, -1365 }, { 0, 0, -1366 }, - { 0, 0, -1367 }, { 0, 0, -1368 }, { 0, 0, -1369 }, { 0, 0, -1370 }, - { 0, 0, -1371 }, { 0, 0, -1372 }, { 0, 0, -1373 }, { 0, 0, -1374 }, - { 0, 0, -1375 }, { 0, 0, -1375 }, { 0, 0, -1376 }, { 0, 0, -1377 }, - { 0, 0, -1378 }, { 0, 0, -1378 }, { 0, 0, -1379 }, { 0, 0, -1379 }, - { 0, 0, -1379 }, { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, - { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, - { 0, 0, -1379 }, { 0, 0, -1379 }, { 0, 0, -1378 }, { 0, 0, -1377 }, - { 0, 0, -1376 }, { 0, 0, -1375 }, { 0, 0, -1374 }, { 0, 0, -1373 }, - { 0, 0, -1371 }, { 0, 0, -1369 }, { 0, 0, -1368 }, { 0, 0, -1366 }, - { 0, 0, -1363 }, { 0, 0, -1361 }, { 0, 0, -1359 }, { 0, 0, -1356 }, - { 0, 0, -1353 }, { 0, 0, -1350 }, { 0, 0, -1341 }, { 0, 0, -1322 }, - { 0, 0, -1295 }, { 0, 0, -1263 }, { 0, 0, -1229 }, { 0, 0, -1195 }, - { 0, 0, -1164 }, { 0, 0, -1139 }, { 0, 0, -1121 }, { 0, 0, -1115 }, + { 0, 0, -1115 }, { 0, 0, -1116 }, { 0, 0, -1117 }, { 0, 0, -1119 }, { 0, 0, -1122 }, + { 0, 0, -1125 }, { 0, 0, -1129 }, { 0, 0, -1133 }, { 0, 0, -1137 }, { 0, 0, -1142 }, + { 0, 0, -1146 }, { 0, 0, -1151 }, { 0, 0, -1155 }, { 0, 0, -1159 }, { 0, 0, -1163 }, + { 0, 0, -1166 }, { 0, 0, -1169 }, { 0, 0, -1171 }, { 0, 0, -1172 }, { 0, 0, -1171 }, + { 0, 0, -1167 }, { 0, 0, -1160 }, { 0, 0, -1152 }, { 0, 0, -1143 }, { 0, 0, -1136 }, + { 0, 0, -1131 }, { 0, 0, -1129 }, { 0, 0, -1131 }, { 0, 0, -1138 }, { 0, 0, -1150 }, + { 0, 0, -1167 }, { 0, 0, -1187 }, { 0, 0, -1209 }, { 0, 0, -1233 }, { 0, 0, -1259 }, + { 0, 0, -1285 }, { 0, 0, -1310 }, { 0, 0, -1335 }, { 0, 0, -1358 }, { 0, 0, -1378 }, + { 0, 0, -1395 }, { 0, 0, -1408 }, { 0, 0, -1417 }, { 0, 0, -1374 }, { 0, 0, -1287 }, + { 0, 0, -1241 }, { 1, 1, -1247 }, { 3, 3, -1257 }, { 4, 4, -1272 }, { 6, 6, -1290 }, + { 8, 8, -1310 }, { 10, 10, -1332 }, { 13, 12, -1355 }, { 15, 14, -1378 }, { 16, 16, -1400 }, + { 18, 18, -1420 }, { 20, 19, -1438 }, { 21, 21, -1451 }, { 22, 22, -1461 }, { 23, 22, -1465 }, + { 23, 22, -1463 }, { 22, 21, -1444 }, { 19, 19, -1402 }, { 15, 15, -1346 }, { 11, 11, -1283 }, + { 7, 7, -1221 }, { 3, 3, -1167 }, { 0, 0, -1129 }, { 0, 0, -1115 }, { 0, 0, -1106 }, + { 0, 0, -1115 }, { 0, 0, -1154 }, { 0, 0, -1199 }, { 0, 0, -1246 }, { 0, 0, -1296 }, + { 0, 0, -1346 }, { 0, 0, -1395 }, { 0, 0, -1442 }, { 0, 0, -1484 }, { 0, 0, -1521 }, + { 0, 0, -1551 }, { 0, 0, -1572 }, { 2, 2, -1586 }, { 3, 4, -1592 }, { 4, 5, -1591 }, + { 5, 5, -1584 }, { 3, 4, -1570 }, { 0, 0, -1551 }, { -7, -9, -1515 }, { -19, -23, -1461 }, + { -33, -40, -1397 }, { -47, -56, -1336 }, { -58, -69, -1286 }, { -64, -76, -1260 }, { -66, -79, -1249 }, + { -68, -82, -1242 }, { -70, -84, -1237 }, { -72, -86, -1234 }, { -73, -87, -1234 }, { -74, -89, -1235 }, + { -75, -89, -1238 }, { -75, -90, -1242 }, { -76, -90, -1246 }, { -75, -90, -1251 }, { -75, -89, -1255 }, + { -74, -89, -1260 }, { -73, -87, -1263 }, { -72, -86, -1266 }, { -70, -84, -1267 }, { -68, -82, -1267 }, + { -66, -79, -1264 }, { -64, -76, -1260 }, { -57, -68, -1244 }, { -46, -55, -1215 }, { -32, -38, -1180 }, + { -18, -21, -1146 }, { -6, -7, -1122 }, { 0, 0, -1115 }, { 2, 3, -1121 }, { 4, 5, -1131 }, + { 5, 6, -1143 }, { 6, 7, -1159 }, { 6, 8, -1176 }, { 6, 8, -1195 }, { 6, 7, -1214 }, + { 5, 6, -1235 }, { 5, 5, -1255 }, { 4, 4, -1274 }, { 3, 3, -1293 }, { 2, 2, -1309 }, + { 1, 1, -1324 }, { 0, 0, -1336 }, { 0, 0, -1345 }, { 0, 0, -1350 }, { 0, 0, -1353 }, + { 0, 0, -1355 }, { 0, 0, -1356 }, { 0, 0, -1356 }, { 0, 0, -1356 }, { 0, 0, -1355 }, + { 0, 0, -1354 }, { 0, 0, -1352 }, { 0, 0, -1349 }, { 0, 0, -1346 }, { 0, 0, -1342 }, + { 0, 0, -1338 }, { 0, 0, -1334 }, { 0, 0, -1329 }, { 0, 0, -1324 }, { 0, 0, -1319 }, + { 0, 0, -1313 }, { 0, 0, -1307 }, { 0, 0, -1301 }, { 0, 0, -1295 }, { 0, 0, -1288 }, + { 0, 0, -1282 }, { 0, 0, -1275 }, { 0, 0, -1269 }, { 0, 0, -1262 }, { 0, 0, -1255 }, + { 0, 0, -1249 }, { 0, 0, -1217 }, { 0, 0, -1169 }, { 0, 0, -1157 }, { 0, 0, -1231 }, + { 0, 0, -1341 }, { 0, 0, -1396 }, { 0, 0, -1387 }, { 0, 0, -1367 }, { 0, 0, -1339 }, + { 0, 0, -1306 }, { 0, 0, -1268 }, { 0, 0, -1228 }, { 0, 0, -1188 }, { 0, 0, -1149 }, + { 0, 0, -1115 }, { 0, 0, -1078 }, { 0, 0, -1035 }, { 0, 0, -995 }, { 0, 0, -965 }, + { 0, 0, -953 }, { 0, 0, -960 }, { 0, 0, -977 }, { 0, 0, -1001 }, { 0, 0, -1029 }, + { 0, 0, -1058 }, { 0, 0, -1084 }, { 0, 0, -1104 }, { 0, 0, -1115 }, { 0, 0, -1120 }, + { 0, 0, -1123 }, { 0, 0, -1126 }, { 0, 0, -1128 }, { 0, 0, -1129 }, { 0, 0, -1130 }, + { 0, 0, -1130 }, { 0, 0, -1130 }, { 0, 0, -1130 }, { 0, 0, -1129 }, { 0, 0, -1127 }, + { 0, 0, -1126 }, { 0, 0, -1124 }, { 0, 0, -1122 }, { 0, 0, -1121 }, { 0, 0, -1119 }, + { 0, 0, -1117 }, { 0, 0, -1116 }, { 0, 0, -1114 }, { 0, 0, -1114 }, { 0, 0, -1113 }, + { 0, 0, -1113 }, { 0, 0, -1113 }, { 0, 0, -1114 }, { 0, 0, -1115 }, { 0, 0, -1123 }, + { 0, 0, -1137 }, { 0, 0, -1154 }, { 0, 0, -1166 }, { 0, 0, -1167 }, { 0, 0, -1157 }, + { 0, 0, -1143 }, { 0, 0, -1125 }, { 0, 0, -1105 }, { 0, 0, -1084 }, { 0, 0, -1064 }, + { 0, 0, -1048 }, { 0, 0, -1035 }, { 0, 0, -1026 }, { 0, 0, -1021 }, { 0, -1, -1018 }, + { 1, -1, -1016 }, { 1, -2, -1016 }, { 1, -2, -1016 }, { 1, -3, -1016 }, { 2, -3, -1016 }, + { 2, -3, -1016 }, { 2, -3, -1015 }, { 2, -4, -1015 }, { 3, -5, -1014 }, { 3, -5, -1013 }, + { 4, -6, -1013 }, { 4, -7, -1012 }, { 5, -8, -1011 }, { 5, -9, -1011 }, { 6, -9, -1010 }, + { 6, -10, -1010 }, { 7, -11, -1010 }, { 7, -11, -1010 }, { 7, -11, -1010 }, { 7, -11, -1011 }, + { 7, -11, -1012 }, { 7, -11, -1013 }, { 7, -10, -1015 }, { 6, -9, -1017 }, { 5, -8, -1019 }, + { 4, -7, -1022 }, { 3, -5, -1026 }, { 1, -2, -1030 }, { 0, 0, -1035 }, { -2, 3, -1041 }, + { -5, 7, -1048 }, { -8, 12, -1058 }, { -12, 18, -1068 }, { -17, 24, -1080 }, { -22, 31, -1092 }, + { -27, 38, -1105 }, { -33, 46, -1119 }, { -38, 54, -1133 }, { -44, 62, -1147 }, { -49, 70, -1161 }, + { -55, 78, -1174 }, { -60, 86, -1187 }, { -65, 93, -1199 }, { -70, 101, -1210 }, { -74, 108, -1219 }, + { -78, 114, -1228 }, { -81, 120, -1234 }, { -83, 126, -1239 }, { -85, 130, -1242 }, { -86, 135, -1241 }, + { -86, 139, -1235 }, { -86, 143, -1226 }, { -84, 147, -1213 }, { -82, 150, -1199 }, { -80, 153, -1182 }, + { -77, 156, -1165 }, { -74, 158, -1148 }, { -71, 159, -1132 }, { -67, 160, -1117 }, { -63, 159, -1104 }, + { -59, 158, -1094 }, { -55, 156, -1088 }, { -52, 152, -1086 }, { -48, 148, -1089 }, { -44, 140, -1102 }, + { -38, 128, -1127 }, { -32, 113, -1161 }, { -25, 95, -1201 }, { -18, 76, -1243 }, { -11, 57, -1286 }, + { -6, 39, -1326 }, { -2, 22, -1359 }, { 0, 9, -1383 }, { 0, 0, -1396 }, { -2, -6, -1397 }, + { -6, -10, -1392 }, { -12, -12, -1381 }, { -19, -13, -1365 }, { -27, -13, -1346 }, { -35, -13, -1324 }, + { -44, -11, -1301 }, { -53, -10, -1278 }, { -61, -8, -1256 }, { -68, -7, -1236 }, { -74, -6, -1219 }, + { -79, -6, -1206 }, { -83, -6, -1200 }, { -86, -6, -1198 }, { -88, -7, -1200 }, { -89, -7, -1203 }, + { -87, -7, -1207 }, { -84, -6, -1208 }, { -79, -6, -1206 }, { -70, -5, -1200 }, { -55, -4, -1190 }, + { -37, -2, -1179 }, { -20, -1, -1167 }, { -7, 0, -1157 }, { 0, 0, -1149 }, { 2, 0, -1144 }, + { 4, 0, -1137 }, { 6, 0, -1131 }, { 7, 0, -1124 }, { 8, 0, -1117 }, { 9, 0, -1110 }, + { 9, 0, -1103 }, { 9, 0, -1096 }, { 8, 0, -1089 }, { 8, 0, -1082 }, { 7, 0, -1076 }, + { 7, 0, -1070 }, { 6, 0, -1064 }, { 5, 0, -1059 }, { 4, 0, -1055 }, { 3, 0, -1051 }, + { 2, 0, -1048 }, { 1, 0, -1046 }, { 1, 0, -1044 }, { 0, 0, -1044 }, { 0, 0, -1045 }, + { 0, 0, -1046 }, { 0, 0, -1049 }, { 0, 0, -1053 }, { 0, 0, -1058 }, { 0, 0, -1063 }, + { 0, 0, -1069 }, { 0, 0, -1076 }, { 0, 0, -1084 }, { 0, 0, -1092 }, { 0, 0, -1100 }, + { 0, 0, -1109 }, { 0, 0, -1119 }, { 0, 0, -1128 }, { 0, 0, -1138 }, { 0, 0, -1148 }, + { 0, 0, -1158 }, { 0, 0, -1169 }, { 0, 0, -1179 }, { 0, 0, -1189 }, { 0, 0, -1199 }, + { 0, 0, -1208 }, { 0, 0, -1218 }, { 0, 0, -1227 }, { 0, 0, -1235 }, { 0, 0, -1243 }, + { 0, 0, -1251 }, { 0, 0, -1258 }, { 0, 0, -1264 }, { 0, 0, -1270 }, { 0, 0, -1276 }, + { 0, 0, -1281 }, { 0, 0, -1285 }, { 0, 0, -1288 }, { 0, 0, -1288 }, { 0, 0, -1287 }, + { 0, 0, -1282 }, { 0, 0, -1275 }, { 0, 0, -1264 }, { 0, 0, -1231 }, { 0, 0, -1173 }, + { 0, 0, -1116 }, { 0, 0, -1084 }, { 0, 0, -1073 }, { 0, 0, -1062 }, { 0, 0, -1052 }, + { 0, 0, -1043 }, { 0, 0, -1036 }, { 0, 0, -1032 }, { 0, 0, -1030 }, { 0, 0, -1032 }, + { 0, 0, -1038 }, { 0, 0, -1048 }, { 0, 0, -1063 }, { 0, 0, -1084 }, { 0, 0, -1132 }, + { 0, 0, -1215 }, { 0, 0, -1315 }, { 0, 0, -1409 }, { 0, 0, -1479 }, { 0, 0, -1505 }, + { 0, 0, -1493 }, { 0, 0, -1468 }, { 0, 0, -1432 }, { 0, 0, -1387 }, { 0, -1, -1336 }, + { 1, -1, -1281 }, { 1, -1, -1225 }, { 1, -2, -1170 }, { 1, -2, -1120 }, { 1, -2, -1075 }, + { 1, -2, -1040 }, { 1, -3, -1016 }, { 2, -3, -1001 }, { 2, -3, -989 }, { 2, -3, -980 }, + { 2, -3, -974 }, { 2, -3, -971 }, { 2, -3, -971 }, { 2, -3, -972 }, { 2, -3, -975 }, + { 2, -3, -979 }, { 2, -3, -984 }, { 2, -3, -990 }, { 1, -3, -996 }, { 1, -3, -1002 }, + { 1, -3, -1007 }, { 1, -3, -1012 }, { 1, -3, -1016 }, { 1, -3, -1019 }, { 2, -2, -1021 }, + { 2, -2, -1024 }, { 2, -2, -1027 }, { 2, -2, -1030 }, { 2, -2, -1035 }, { 2, -2, -1041 }, + { 2, -2, -1049 }, { 2, -2, -1059 }, { 2, -2, -1072 }, { 2, -2, -1088 }, { 2, -2, -1108 }, + { 2, -2, -1139 }, { 2, -2, -1185 }, { 2, -1, -1241 }, { 3, -1, -1300 }, { 3, -1, -1356 }, + { 3, -1, -1403 }, { 3, 0, -1434 }, { 3, 0, -1443 }, { 3, -1, -1416 }, { 3, -1, -1351 }, + { 2, -1, -1266 }, { 2, -2, -1178 }, { 2, -2, -1104 }, { 2, -2, -1062 }, { 2, -2, -1045 }, + { 2, -2, -1036 }, { 2, -3, -1033 }, { 2, -3, -1036 }, { 2, -2, -1042 }, { 2, -2, -1050 }, + { 2, -2, -1058 }, { 2, -2, -1066 }, { 2, -2, -1072 }, { 2, -2, -1074 }, { 2, -2, -1071 }, + { 2, -2, -1062 }, { 1, -3, -1005 }, { 1, -3, -914 }, { 1, -3, -867 }, { 1, -3, -870 }, + { 1, -3, -875 }, { 1, -3, -883 }, { 1, -3, -894 }, { 1, -3, -906 }, { 1, -3, -920 }, + { 1, -3, -935 }, { 1, -3, -951 }, { 1, -3, -968 }, { 1, -3, -986 }, { 1, -2, -1003 }, + { 1, -2, -1021 }, { 2, -2, -1038 }, { 2, -2, -1055 }, { 2, -2, -1071 }, { 2, -2, -1086 }, + { 2, -2, -1102 }, { 2, -2, -1119 }, { 2, -2, -1135 }, { 2, -2, -1148 }, { 2, -2, -1158 }, + { 2, -2, -1167 }, { 2, -2, -1177 }, { 2, -2, -1186 }, { 2, -2, -1195 }, { 2, -2, -1203 }, + { 2, -2, -1212 }, { 2, -2, -1220 }, { 2, -2, -1228 }, { 2, -2, -1235 }, { 2, -2, -1243 }, + { 2, -1, -1250 }, { 3, -1, -1257 }, { 3, -1, -1263 }, { 3, -1, -1265 }, { 3, -1, -1257 }, + { 2, -2, -1240 }, { 2, -2, -1220 }, { 2, -2, -1198 }, { 2, -2, -1174 }, { 2, -2, -1149 }, + { 2, -2, -1123 }, { 2, -2, -1099 }, { 2, -2, -1076 }, { 2, -2, -1054 }, { 2, -2, -1036 }, + { 2, -2, -1022 }, { 1, -3, -1013 }, { 1, -3, -1008 }, { 1, -3, -1010 }, { 1, -2, -1020 }, + { 2, -2, -1038 }, { 2, -2, -1062 }, { 2, -2, -1092 }, { 2, -2, -1126 }, { 2, -2, -1163 }, + { 2, -2, -1201 }, { 2, -1, -1240 }, { 2, -1, -1278 }, { 3, -1, -1313 }, { 3, -1, -1345 }, + { 3, -1, -1372 }, { 3, -1, -1393 }, { 3, -1, -1407 }, { 3, -1, -1411 }, { 3, -1, -1406 }, + { 3, -1, -1389 }, { 3, -1, -1364 }, { 3, -1, -1332 }, { 3, -1, -1294 }, { 2, -1, -1254 }, + { 2, -2, -1211 }, { 2, -2, -1168 }, { 2, -2, -1127 }, { 2, -2, -1090 }, { 2, -2, -1058 }, + { 2, -2, -1033 }, { 1, -3, -1016 }, { 1, -3, -1010 }, { 1, -3, -1015 }, { 2, -2, -1030 }, + { 2, -2, -1052 }, { 2, -2, -1081 }, { 2, -2, -1114 }, { 2, -2, -1151 }, { 2, -2, -1191 }, + { 2, -1, -1231 }, { 2, -1, -1270 }, { 3, -1, -1307 }, { 3, -1, -1341 }, { 3, -1, -1370 }, + { 3, -1, -1392 }, { 3, -1, -1406 }, { 3, -1, -1411 }, { 3, -1, -1406 }, { 3, -1, -1389 }, + { 3, -1, -1364 }, { 3, -1, -1332 }, { 3, -1, -1294 }, { 2, -1, -1254 }, { 2, -2, -1211 }, + { 2, -2, -1168 }, { 2, -2, -1127 }, { 2, -2, -1090 }, { 2, -2, -1058 }, { 2, -2, -1033 }, + { 1, -3, -1016 }, { 1, -3, -1010 }, { 1, -2, -1017 }, { 2, -2, -1036 }, { 2, -2, -1065 }, + { 2, -2, -1101 }, { 2, -2, -1143 }, { 2, -2, -1188 }, { 2, -1, -1234 }, { 2, -1, -1279 }, + { 3, -1, -1321 }, { 3, -1, -1357 }, { 3, -1, -1386 }, { 3, -1, -1405 }, { 3, -1, -1411 }, + { 3, -1, -1407 }, { 3, -1, -1393 }, { 3, -1, -1372 }, { 3, -1, -1345 }, { 3, -1, -1313 }, + { 2, -1, -1277 }, { 2, -1, -1239 }, { 2, -2, -1201 }, { 2, -2, -1162 }, { 2, -2, -1125 }, + { 2, -2, -1091 }, { 2, -2, -1062 }, { 2, -2, -1037 }, { 2, -3, -1020 }, { 1, -3, -1010 }, + { 1, -3, -1006 }, { 1, -2, -1002 }, { 1, -2, -998 }, { 1, -2, -996 }, { 1, -2, -994 }, + { 1, -2, -992 }, { 1, -2, -991 }, { 1, -2, -990 }, { 1, -2, -990 }, { 1, -2, -991 }, + { 1, -2, -992 }, { 1, -2, -993 }, { 1, -2, -995 }, { 1, -2, -997 }, { 1, -2, -999 }, + { 1, -2, -1002 }, { 1, -2, -1005 }, { 1, -2, -1008 }, { 0, -1, -1012 }, { 0, -1, -1016 }, + { 0, -1, -1020 }, { 0, -1, -1024 }, { 0, -1, -1028 }, { 0, -1, -1032 }, { 0, -1, -1037 }, + { 0, -1, -1042 }, { 0, -1, -1046 }, { 0, -1, -1051 }, { 0, -1, -1056 }, { 0, -1, -1061 }, + { 0, 0, -1065 }, { 0, 0, -1070 }, { 0, 0, -1075 }, { 0, 0, -1079 }, { 0, 0, -1084 }, + { 0, 0, -1088 }, { 0, 0, -1092 }, { 0, 0, -1096 }, { 0, 0, -1099 }, { 0, 0, -1103 }, + { 0, 0, -1106 }, { 0, 0, -1109 }, { 0, 0, -1111 }, { 0, 0, -1113 }, { 0, 0, -1115 }, + { 0, 0, -1116 }, { 0, 0, -1116 }, { 0, 0, -1115 }, { 0, 0, -1114 }, { 0, 0, -1112 }, + { 0, 0, -1109 }, { 0, 0, -1107 }, { 0, 0, -1104 }, { 0, 0, -1101 }, { 0, 0, -1098 }, + { 0, 0, -1096 }, { 0, 0, -1094 }, { 0, 0, -1093 }, { 0, 0, -1092 }, { 0, 0, -1093 }, + { 0, 0, -1095 }, { 0, 0, -1098 }, { 0, 0, -1102 }, { 0, 0, -1108 }, { 0, 0, -1115 }, + { 0, 0, -1128 }, { 0, 0, -1148 }, { 0, 0, -1174 }, { 0, 0, -1205 }, { 0, 0, -1237 }, + { 0, 0, -1270 }, { 0, 0, -1301 }, { 0, 0, -1329 }, { 0, 0, -1352 }, { 0, 0, -1368 }, + { 0, 0, -1375 }, { 0, 0, -1372 }, { 0, 0, -1361 }, { 0, 0, -1342 }, { 0, 0, -1318 }, + { 0, 0, -1290 }, { 0, 0, -1258 }, { 0, 0, -1225 }, { 0, 0, -1192 }, { 0, 0, -1161 }, + { 0, 0, -1127 }, { 0, 0, -1086 }, { 0, 0, -1041 }, { 0, 0, -996 }, { 0, 0, -953 }, + { 0, 0, -914 }, { 0, 0, -883 }, { 0, 0, -863 }, { 0, 0, -849 }, { 0, 0, -836 }, + { 0, 0, -823 }, { 0, 0, -813 }, { 0, 0, -804 }, { 0, 0, -798 }, { 0, 0, -795 }, + { 0, 0, -795 }, { 0, 0, -799 }, { 0, 0, -807 }, { 0, 0, -821 }, { 0, 0, -839 }, + { 0, 0, -863 }, { 0, 0, -928 }, { 0, 0, -1045 }, { 0, 0, -1178 }, { 0, 0, -1291 }, + { 0, 0, -1350 }, { 0, 0, -1368 }, { 0, 0, -1382 }, { 0, 0, -1392 }, { 0, 0, -1400 }, + { 0, 0, -1405 }, { 0, 0, -1407 }, { 0, 0, -1408 }, { 0, 0, -1406 }, { 0, 0, -1403 }, + { 0, 0, -1399 }, { 0, 0, -1393 }, { 0, 0, -1387 }, { 0, 0, -1381 }, { 0, 0, -1375 }, + { 0, 0, -1368 }, { 0, 0, -1362 }, { 0, 0, -1357 }, { 0, 0, -1354 }, { 0, 0, -1351 }, + { 0, 0, -1350 }, { 0, 0, -1350 }, { 0, 0, -1350 }, { 0, 0, -1350 }, { 0, 0, -1351 }, + { 0, 0, -1351 }, { 0, 0, -1352 }, { 0, 0, -1352 }, { 0, 0, -1353 }, { 0, 0, -1353 }, + { 0, 0, -1354 }, { 0, 0, -1355 }, { 0, 0, -1356 }, { 0, 0, -1357 }, { 0, 0, -1358 }, + { 0, 0, -1359 }, { 0, 0, -1360 }, { 0, 0, -1361 }, { 0, 0, -1362 }, { 0, 0, -1363 }, + { 0, 0, -1364 }, { 0, 0, -1365 }, { 0, 0, -1366 }, { 0, 0, -1367 }, { 0, 0, -1368 }, + { 0, 0, -1369 }, { 0, 0, -1370 }, { 0, 0, -1371 }, { 0, 0, -1372 }, { 0, 0, -1373 }, + { 0, 0, -1374 }, { 0, 0, -1375 }, { 0, 0, -1375 }, { 0, 0, -1376 }, { 0, 0, -1377 }, + { 0, 0, -1378 }, { 0, 0, -1378 }, { 0, 0, -1379 }, { 0, 0, -1379 }, { 0, 0, -1379 }, + { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1380 }, + { 0, 0, -1380 }, { 0, 0, -1380 }, { 0, 0, -1379 }, { 0, 0, -1379 }, { 0, 0, -1378 }, + { 0, 0, -1377 }, { 0, 0, -1376 }, { 0, 0, -1375 }, { 0, 0, -1374 }, { 0, 0, -1373 }, + { 0, 0, -1371 }, { 0, 0, -1369 }, { 0, 0, -1368 }, { 0, 0, -1366 }, { 0, 0, -1363 }, + { 0, 0, -1361 }, { 0, 0, -1359 }, { 0, 0, -1356 }, { 0, 0, -1353 }, { 0, 0, -1350 }, + { 0, 0, -1341 }, { 0, 0, -1322 }, { 0, 0, -1295 }, { 0, 0, -1263 }, { 0, 0, -1229 }, + { 0, 0, -1195 }, { 0, 0, -1164 }, { 0, 0, -1139 }, { 0, 0, -1121 }, { 0, 0, -1115 }, }; static s16 animdata_mario_lip_6_2[][3] = { - { 60, -96, -1085 }, { 59, -96, -1084 }, { 59, -97, -1081 }, { 58, -97, -1076 }, - { 57, -98, -1070 }, { 56, -99, -1062 }, { 55, -99, -1054 }, { 53, -100, -1045 }, - { 52, -101, -1036 }, { 50, -102, -1027 }, { 49, -103, -1018 }, { 47, -104, -1009 }, - { 46, -105, -1002 }, { 45, -105, -995 }, { 44, -105, -990 }, { 43, -106, -987 }, - { 43, -106, -985 }, { 43, -105, -986 }, { 43, -105, -989 }, { 44, -104, -995 }, - { 45, -102, -1004 }, { 51, -97, -1047 }, { 64, -86, -1133 }, { 79, -74, -1232 }, - { 91, -63, -1316 }, { 97, -59, -1354 }, { 96, -59, -1352 }, { 94, -61, -1336 }, - { 90, -65, -1309 }, { 85, -69, -1275 }, { 80, -74, -1236 }, { 74, -79, -1196 }, - { 68, -84, -1158 }, { 64, -89, -1125 }, { 60, -92, -1099 }, { 58, -94, -1084 }, - { 57, -95, -1081 }, { 58, -95, -1088 }, { 59, -94, -1101 }, { 61, -93, -1120 }, - { 64, -91, -1140 }, { 67, -89, -1160 }, { 70, -87, -1177 }, { 73, -85, -1190 }, - { 77, -83, -1194 }, { 80, -82, -1193 }, { 84, -80, -1191 }, { 88, -78, -1187 }, - { 92, -76, -1181 }, { 97, -74, -1175 }, { 102, -72, -1168 }, { 106, -70, -1160 }, - { 111, -68, -1151 }, { 116, -66, -1142 }, { 120, -64, -1134 }, { 125, -62, -1125 }, - { 129, -61, -1117 }, { 133, -59, -1109 }, { 136, -58, -1102 }, { 139, -56, -1096 }, - { 141, -55, -1091 }, { 143, -55, -1087 }, { 144, -54, -1085 }, { 145, -54, -1083 }, - { 146, -54, -1082 }, { 146, -53, -1081 }, { 147, -53, -1080 }, { 148, -53, -1079 }, - { 149, -53, -1078 }, { 149, -53, -1077 }, { 150, -53, -1076 }, { 151, -52, -1076 }, - { 152, -52, -1075 }, { 152, -52, -1074 }, { 153, -52, -1074 }, { 154, -52, -1073 }, - { 154, -52, -1073 }, { 155, -53, -1072 }, { 156, -53, -1072 }, { 156, -53, -1072 }, - { 157, -53, -1071 }, { 157, -53, -1071 }, { 158, -53, -1071 }, { 158, -53, -1071 }, - { 159, -53, -1070 }, { 159, -54, -1070 }, { 160, -54, -1070 }, { 160, -54, -1070 }, - { 160, -54, -1070 }, { 161, -54, -1070 }, { 161, -55, -1070 }, { 161, -55, -1071 }, - { 162, -55, -1071 }, { 162, -55, -1071 }, { 162, -56, -1071 }, { 162, -56, -1071 }, - { 163, -56, -1072 }, { 163, -56, -1072 }, { 163, -56, -1072 }, { 163, -57, -1072 }, - { 163, -57, -1073 }, { 163, -57, -1073 }, { 163, -57, -1074 }, { 163, -57, -1074 }, - { 163, -57, -1074 }, { 162, -58, -1075 }, { 162, -58, -1075 }, { 162, -58, -1076 }, - { 162, -58, -1076 }, { 161, -58, -1076 }, { 161, -58, -1077 }, { 160, -58, -1077 }, - { 160, -58, -1078 }, { 159, -58, -1078 }, { 159, -58, -1079 }, { 158, -58, -1079 }, - { 158, -58, -1080 }, { 157, -58, -1080 }, { 156, -58, -1081 }, { 155, -58, -1081 }, - { 154, -57, -1081 }, { 153, -57, -1082 }, { 152, -57, -1082 }, { 151, -57, -1083 }, - { 150, -56, -1083 }, { 149, -56, -1083 }, { 148, -56, -1084 }, { 147, -55, -1084 }, - { 145, -55, -1084 }, { 144, -54, -1085 }, { 142, -54, -1085 }, { 140, -53, -1086 }, - { 138, -52, -1086 }, { 135, -51, -1087 }, { 131, -49, -1087 }, { 128, -48, -1088 }, - { 123, -46, -1089 }, { 119, -45, -1090 }, { 114, -43, -1091 }, { 109, -41, -1092 }, - { 104, -39, -1093 }, { 99, -37, -1094 }, { 94, -35, -1095 }, { 88, -33, -1096 }, - { 83, -31, -1098 }, { 77, -29, -1099 }, { 71, -27, -1100 }, { 65, -24, -1101 }, - { 60, -22, -1102 }, { 54, -20, -1104 }, { 49, -18, -1105 }, { 43, -16, -1106 }, - { 38, -14, -1107 }, { 33, -12, -1108 }, { 28, -10, -1109 }, { 24, -9, -1110 }, - { 20, -7, -1111 }, { 16, -6, -1112 }, { 12, -4, -1112 }, { 9, -3, -1113 }, - { 6, -2, -1114 }, { 4, -1, -1114 }, { 2, 0, -1115 }, { 1, 0, -1115 }, - { 0, 0, -1115 }, { 0, 0, -1115 }, + { 60, -96, -1085 }, { 59, -96, -1084 }, { 59, -97, -1081 }, { 58, -97, -1076 }, { 57, -98, -1070 }, + { 56, -99, -1062 }, { 55, -99, -1054 }, { 53, -100, -1045 }, { 52, -101, -1036 }, { 50, -102, -1027 }, + { 49, -103, -1018 }, { 47, -104, -1009 }, { 46, -105, -1002 }, { 45, -105, -995 }, { 44, -105, -990 }, + { 43, -106, -987 }, { 43, -106, -985 }, { 43, -105, -986 }, { 43, -105, -989 }, { 44, -104, -995 }, + { 45, -102, -1004 }, { 51, -97, -1047 }, { 64, -86, -1133 }, { 79, -74, -1232 }, { 91, -63, -1316 }, + { 97, -59, -1354 }, { 96, -59, -1352 }, { 94, -61, -1336 }, { 90, -65, -1309 }, { 85, -69, -1275 }, + { 80, -74, -1236 }, { 74, -79, -1196 }, { 68, -84, -1158 }, { 64, -89, -1125 }, { 60, -92, -1099 }, + { 58, -94, -1084 }, { 57, -95, -1081 }, { 58, -95, -1088 }, { 59, -94, -1101 }, { 61, -93, -1120 }, + { 64, -91, -1140 }, { 67, -89, -1160 }, { 70, -87, -1177 }, { 73, -85, -1190 }, { 77, -83, -1194 }, + { 80, -82, -1193 }, { 84, -80, -1191 }, { 88, -78, -1187 }, { 92, -76, -1181 }, { 97, -74, -1175 }, + { 102, -72, -1168 }, { 106, -70, -1160 }, { 111, -68, -1151 }, { 116, -66, -1142 }, { 120, -64, -1134 }, + { 125, -62, -1125 }, { 129, -61, -1117 }, { 133, -59, -1109 }, { 136, -58, -1102 }, { 139, -56, -1096 }, + { 141, -55, -1091 }, { 143, -55, -1087 }, { 144, -54, -1085 }, { 145, -54, -1083 }, { 146, -54, -1082 }, + { 146, -53, -1081 }, { 147, -53, -1080 }, { 148, -53, -1079 }, { 149, -53, -1078 }, { 149, -53, -1077 }, + { 150, -53, -1076 }, { 151, -52, -1076 }, { 152, -52, -1075 }, { 152, -52, -1074 }, { 153, -52, -1074 }, + { 154, -52, -1073 }, { 154, -52, -1073 }, { 155, -53, -1072 }, { 156, -53, -1072 }, { 156, -53, -1072 }, + { 157, -53, -1071 }, { 157, -53, -1071 }, { 158, -53, -1071 }, { 158, -53, -1071 }, { 159, -53, -1070 }, + { 159, -54, -1070 }, { 160, -54, -1070 }, { 160, -54, -1070 }, { 160, -54, -1070 }, { 161, -54, -1070 }, + { 161, -55, -1070 }, { 161, -55, -1071 }, { 162, -55, -1071 }, { 162, -55, -1071 }, { 162, -56, -1071 }, + { 162, -56, -1071 }, { 163, -56, -1072 }, { 163, -56, -1072 }, { 163, -56, -1072 }, { 163, -57, -1072 }, + { 163, -57, -1073 }, { 163, -57, -1073 }, { 163, -57, -1074 }, { 163, -57, -1074 }, { 163, -57, -1074 }, + { 162, -58, -1075 }, { 162, -58, -1075 }, { 162, -58, -1076 }, { 162, -58, -1076 }, { 161, -58, -1076 }, + { 161, -58, -1077 }, { 160, -58, -1077 }, { 160, -58, -1078 }, { 159, -58, -1078 }, { 159, -58, -1079 }, + { 158, -58, -1079 }, { 158, -58, -1080 }, { 157, -58, -1080 }, { 156, -58, -1081 }, { 155, -58, -1081 }, + { 154, -57, -1081 }, { 153, -57, -1082 }, { 152, -57, -1082 }, { 151, -57, -1083 }, { 150, -56, -1083 }, + { 149, -56, -1083 }, { 148, -56, -1084 }, { 147, -55, -1084 }, { 145, -55, -1084 }, { 144, -54, -1085 }, + { 142, -54, -1085 }, { 140, -53, -1086 }, { 138, -52, -1086 }, { 135, -51, -1087 }, { 131, -49, -1087 }, + { 128, -48, -1088 }, { 123, -46, -1089 }, { 119, -45, -1090 }, { 114, -43, -1091 }, { 109, -41, -1092 }, + { 104, -39, -1093 }, { 99, -37, -1094 }, { 94, -35, -1095 }, { 88, -33, -1096 }, { 83, -31, -1098 }, + { 77, -29, -1099 }, { 71, -27, -1100 }, { 65, -24, -1101 }, { 60, -22, -1102 }, { 54, -20, -1104 }, + { 49, -18, -1105 }, { 43, -16, -1106 }, { 38, -14, -1107 }, { 33, -12, -1108 }, { 28, -10, -1109 }, + { 24, -9, -1110 }, { 20, -7, -1111 }, { 16, -6, -1112 }, { 12, -4, -1112 }, { 9, -3, -1113 }, + { 6, -2, -1114 }, { 4, -1, -1114 }, { 2, 0, -1115 }, { 1, 0, -1115 }, { 0, 0, -1115 }, + { 0, 0, -1115 }, }; struct AnimDataInfo anim_mario_lips_6[] = { @@ -824,201 +719,170 @@ struct AnimDataInfo anim_mario_lips_6[] = { }; static s16 animdata_mario_eyelid_left_1[][3] = { - { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1611 }, - { 0, 0, 1607 }, { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1593 }, { 0, 0, 1589 }, - { 0, 0, 1585 }, { 0, 0, 1581 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, - { 0, 0, 1577 }, { 0, 0, 1579 }, { 0, 0, 1583 }, { 0, 0, 1589 }, { 0, 0, 1597 }, - { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1783 }, { 0, 0, 1940 }, { 0, 0, 1936 }, - { 0, 0, 1924 }, { 0, 0, 1906 }, { 0, 0, 1883 }, { 0, 0, 1855 }, { 0, 0, 1825 }, - { 0, 0, 1792 }, { 0, 0, 1760 }, { 0, 0, 1728 }, { 0, 0, 1698 }, { 0, 0, 1671 }, - { 0, 0, 1648 }, { 0, 0, 1630 }, { 0, 0, 1620 }, { 0, 0, 1613 }, { 0, 0, 1607 }, - { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1594 }, { 0, 0, 1592 }, { 0, 0, 1590 }, - { 0, 0, 1588 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, - { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1595 }, - { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1602 }, { 0, 0, 1604 }, { 0, 0, 1606 }, - { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1616 }, - { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1637 }, { 0, 0, 1683 }, { 0, 0, 1746 }, - { 0, 0, 1814 }, { 0, 0, 1877 }, { 0, 0, 1923 }, { 0, 0, 1940 }, { 0, 0, 1909 }, - { 0, 0, 1834 }, { 0, 0, 1743 }, { 0, 0, 1662 }, { 0, 0, 1620 }, { 0, 0, 1607 }, - { 0, 0, 1598 }, { 0, 0, 1591 }, { 0, 0, 1586 }, { 0, 0, 1583 }, { 0, 0, 1582 }, - { 0, 0, 1583 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1592 }, { 0, 0, 1596 }, - { 0, 0, 1601 }, { 0, 0, 1606 }, { 0, 0, 1610 }, { 0, 0, 1614 }, { 0, 0, 1617 }, - { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1611 }, { 0, 0, 1606 }, - { 0, 0, 1603 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1642 }, { 0, 0, 1672 }, - { 0, 0, 1707 }, { 0, 0, 1744 }, { 0, 0, 1783 }, { 0, 0, 1822 }, { 0, 0, 1857 }, - { 0, 0, 1888 }, { 0, 0, 1913 }, { 0, 0, 1929 }, { 0, 0, 1935 }, { 0, 0, 1903 }, - { 0, 0, 1828 }, { 0, 0, 1736 }, { 0, 0, 1658 }, { 0, 0, 1620 }, { 0, 0, 1612 }, - { 0, 0, 1604 }, { 0, 0, 1597 }, { 0, 0, 1590 }, { 0, 0, 1583 }, { 0, 0, 1577 }, - { 0, 0, 1571 }, { 0, 0, 1565 }, { 0, 0, 1560 }, { 0, 0, 1555 }, { 0, 0, 1551 }, - { 0, 0, 1547 }, { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1538 }, { 0, 0, 1536 }, - { 0, 0, 1534 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1532 }, - { 0, 0, 1533 }, { 0, 0, 1534 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1541 }, - { 0, 0, 1544 }, { 0, 0, 1548 }, { 0, 0, 1552 }, { 0, 0, 1558 }, { 0, 0, 1563 }, - { 0, 0, 1569 }, { 0, 0, 1576 }, { 0, 0, 1584 }, { 0, 0, 1592 }, { 0, 0, 1600 }, - { 0, 0, 1951 }, { 0, 0, 1922 }, { 0, 0, 1846 }, { 0, 0, 1751 }, { 0, 0, 1666 }, - { 0, 0, 1620 }, { 0, 0, 1604 }, { 0, 0, 1593 }, { 0, 0, 1587 }, { 0, 0, 1584 }, - { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1593 }, { 0, 0, 1598 }, { 0, 0, 1604 }, - { 0, 0, 1610 }, { 0, 0, 1615 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1619 }, - { 0, 0, 1617 }, { 0, 0, 1615 }, { 0, 0, 1612 }, { 0, 0, 1609 }, { 0, 0, 1605 }, - { 0, 0, 1601 }, { 0, 0, 1597 }, { 0, 0, 1592 }, { 0, 0, 1588 }, { 0, 0, 1584 }, - { 0, 0, 1581 }, { 0, 0, 1577 }, { 0, 0, 1574 }, { 0, 0, 1572 }, { 0, 0, 1571 }, - { 0, 0, 1570 }, { 0, 0, 1570 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1578 }, - { 0, 0, 1583 }, { 0, 0, 1590 }, { 0, 0, 1598 }, { 0, 0, 1608 }, { 0, 0, 1648 }, - { 0, 0, 1729 }, { 0, 0, 1824 }, { 0, 0, 1905 }, { 0, 0, 1946 }, { 0, 0, 1948 }, - { 0, 0, 1932 }, { 0, 0, 1905 }, { 0, 0, 1870 }, { 0, 0, 1834 }, { 0, 0, 1801 }, - { 0, 0, 1778 }, { 0, 0, 1769 }, { 0, 0, 1799 }, { 0, 0, 1866 }, { 0, 0, 1926 }, - { 0, 0, 1940 }, { 0, 0, 1844 }, { 0, 0, 1689 }, { 0, 0, 1608 }, { 0, 0, 1662 }, - { 0, 0, 1778 }, { 0, 0, 1894 }, { 0, 0, 1946 }, { 0, 0, 1897 }, { 0, 0, 1786 }, - { 0, 0, 1668 }, { 0, 0, 1597 }, { 0, 0, 1575 }, { 0, 0, 1567 }, { 0, 0, 1571 }, - { 0, 0, 1580 }, { 0, 0, 1593 }, { 0, 0, 1603 }, { 0, 0, 1608 }, { 0, 0, 1607 }, - { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1594 }, { 0, 0, 1589 }, { 0, 0, 1586 }, - { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1595 }, { 0, 0, 1608 }, { 0, 0, 1630 }, - { 0, 0, 1663 }, { 0, 1, 1702 }, { 0, 1, 1746 }, { 0, 2, 1790 }, { 0, 2, 1831 }, - { 0, 2, 1867 }, { 0, 1, 1893 }, { 0, 0, 1906 }, { 0, -2, 1908 }, { 0, -4, 1901 }, - { 0, -8, 1889 }, { 0, -11, 1871 }, { 0, -15, 1850 }, { 1, -19, 1827 }, { 1, -23, 1803 }, - { 1, -26, 1779 }, { 1, -30, 1758 }, { 2, -32, 1741 }, { 2, -34, 1728 }, { 2, -35, 1719 }, - { 2, -36, 1712 }, { 3, -37, 1705 }, { 3, -38, 1699 }, { 4, -38, 1693 }, { 4, -38, 1689 }, - { 4, -39, 1685 }, { 5, -38, 1681 }, { 5, -38, 1678 }, { 5, -38, 1675 }, { 6, -37, 1672 }, - { 6, -37, 1669 }, { 6, -36, 1666 }, { 6, -35, 1663 }, { 6, -33, 1659 }, { 6, -31, 1656 }, - { 5, -28, 1653 }, { 5, -25, 1650 }, { 4, -21, 1648 }, { 3, -17, 1646 }, { 2, -12, 1644 }, - { 1, -8, 1642 }, { 1, -5, 1640 }, { 0, -2, 1639 }, { 0, 0, 1637 }, { 0, 1, 1635 }, - { 0, 2, 1633 }, { 0, 2, 1632 }, { 0, 2, 1630 }, { 0, 2, 1629 }, { 0, 2, 1628 }, - { 0, 1, 1626 }, { 0, 1, 1625 }, { 0, 0, 1624 }, { 0, 0, 1622 }, { 0, 0, 1621 }, - { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1610 }, { 0, 0, 1607 }, - { 0, 0, 1605 }, { 0, 0, 1605 }, { 0, 0, 1608 }, { 0, 0, 1624 }, { 0, 0, 1649 }, - { 0, 0, 1662 }, { 0, 0, 1647 }, { 0, 0, 1619 }, { 0, 0, 1602 }, { 0, 0, 1599 }, - { 0, 0, 1595 }, { 0, 0, 1592 }, { 0, 0, 1589 }, { 0, 0, 1587 }, { 0, 0, 1584 }, - { 0, 0, 1582 }, { 0, 0, 1580 }, { 0, 0, 1578 }, { 0, 0, 1577 }, { 0, 0, 1576 }, - { 0, 0, 1575 }, { 0, 0, 1574 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, - { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1574 }, { 0, 0, 1576 }, - { 0, 0, 1581 }, { 0, 0, 1589 }, { 0, 0, 1597 }, { 0, 0, 1605 }, { 0, 0, 1612 }, - { 0, 0, 1617 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1619 }, - { 0, 0, 1618 }, { 0, 0, 1617 }, { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1615 }, - { 0, 0, 1614 }, { 0, 0, 1612 }, { 0, 0, 1611 }, { 0, 0, 1610 }, { 0, 0, 1609 }, - { 0, 0, 1608 }, { 0, 0, 1607 }, { 0, 0, 1605 }, { 0, 0, 1604 }, { 0, 0, 1603 }, - { 0, 0, 1602 }, { 0, 0, 1601 }, { 0, 0, 1599 }, { 0, 0, 1598 }, { 0, 0, 1597 }, - { 0, 0, 1596 }, { 0, 0, 1595 }, { 0, 0, 1594 }, { 0, 0, 1593 }, { 0, 0, 1592 }, - { 0, 0, 1592 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1585 }, { 0, 0, 1580 }, - { 0, 0, 1573 }, { 0, 0, 1567 }, { 0, 0, 1562 }, { 0, 0, 1559 }, { 0, 0, 1558 }, - { 0, 0, 1559 }, { 0, 0, 1565 }, { 0, 0, 1575 }, { 0, 0, 1591 }, { 0, 0, 1628 }, - { 0, 0, 1693 }, { 0, 0, 1770 }, { 0, 0, 1844 }, { 0, 0, 1901 }, { 0, 0, 1923 }, - { 0, 0, 1918 }, { 0, 0, 1903 }, { 0, 0, 1878 }, { 0, 0, 1847 }, { 0, 0, 1812 }, - { 0, 0, 1774 }, { 0, 0, 1736 }, { 0, 0, 1699 }, { 0, 0, 1666 }, { 0, 0, 1638 }, - { 0, 0, 1618 }, { 0, 0, 1608 }, { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1595 }, - { 0, 0, 1592 }, { 0, 0, 1589 }, { 0, 0, 1586 }, { 0, 0, 1584 }, { 0, 0, 1581 }, - { 0, 0, 1580 }, { 0, 0, 1578 }, { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1575 }, - { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, - { 0, 0, 1574 }, { 0, 0, 1575 }, { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1578 }, - { 0, 0, 1579 }, { 0, 0, 1580 }, { 0, 0, 1581 }, { 0, 0, 1583 }, { 0, 0, 1584 }, - { 0, 0, 1586 }, { 0, 0, 1587 }, { 0, 0, 1589 }, { 0, 0, 1591 }, { 0, 0, 1592 }, - { 0, 0, 1594 }, { 0, 0, 1595 }, { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1600 }, - { 0, 0, 1602 }, { 0, 0, 1603 }, { 0, 0, 1604 }, { 0, 0, 1606 }, { 0, 0, 1607 }, - { 0, 0, 1608 }, { 0, 0, 1608 }, { 0, 0, 1609 }, { 0, 0, 1610 }, { 0, 0, 1610 }, - { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1609 }, - { 0, 0, 1608 }, { 0, 0, 1593 }, { 0, 0, 1566 }, { 0, 0, 1551 }, { 0, 0, 1549 }, - { 0, 0, 1546 }, { 0, 0, 1544 }, { 0, 0, 1542 }, { 0, 0, 1540 }, { 0, 0, 1538 }, - { 0, 0, 1536 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1536 }, - { 0, 0, 1539 }, { 0, 0, 1542 }, { 0, 0, 1547 }, { 0, 0, 1553 }, { 0, 0, 1560 }, - { 0, 0, 1570 }, { 0, 0, 1618 }, { 0, 0, 1700 }, { 0, 0, 1751 }, { 0, 0, 1765 }, - { 0, 0, 1774 }, { 0, 0, 1779 }, { 0, 0, 1782 }, { 0, 0, 1783 }, { 0, 0, 1783 }, - { 0, 0, 1783 }, { 0, 0, 1783 }, { 0, 0, 1784 }, { 0, 0, 1788 }, { 0, 0, 1794 }, - { 0, 0, 1805 }, { 0, 0, 1834 }, { 0, 0, 1881 }, { 0, 0, 1926 }, { 0, 0, 1946 }, - { 0, 0, 1941 }, { 0, 0, 1928 }, { 0, 0, 1907 }, { 0, 0, 1881 }, { 0, 0, 1849 }, - { 0, 0, 1815 }, { 0, 0, 1779 }, { 0, 0, 1742 }, { 0, 0, 1707 }, { 0, 0, 1673 }, - { 0, 0, 1644 }, { 0, 0, 1619 }, { 0, 0, 1601 }, { 0, 0, 1591 }, { 0, 0, 1588 }, - { 0, 0, 1590 }, { 0, 0, 1596 }, { 0, 0, 1606 }, { 0, 0, 1619 }, { 0, 0, 1635 }, - { 0, 0, 1652 }, { 0, 0, 1670 }, { 0, 0, 1689 }, { 0, 0, 1708 }, { 0, 0, 1726 }, - { 0, 0, 1742 }, { 0, 0, 1756 }, { 0, 0, 1767 }, { 0, 0, 1774 }, { 0, 0, 1779 }, - { 0, 0, 1781 }, { 0, 0, 1782 }, { 0, 0, 1781 }, { 0, 0, 1779 }, { 0, 0, 1776 }, - { 0, 0, 1772 }, { 0, 0, 1768 }, { 0, 0, 1764 }, { 0, 0, 1760 }, { 0, 0, 1757 }, - { 0, 0, 1754 }, { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1752 }, - { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1757 }, { 0, 0, 1759 }, { 0, 0, 1762 }, - { 0, 0, 1764 }, { 0, 0, 1766 }, { 0, 0, 1768 }, { 0, 0, 1770 }, { 0, 0, 1772 }, - { 0, 0, 1773 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1773 }, - { 0, 0, 1772 }, { 0, 0, 1770 }, { 0, 0, 1768 }, { 0, 0, 1765 }, { 0, 0, 1763 }, - { 0, 0, 1760 }, { 0, 0, 1758 }, { 0, 0, 1756 }, { 0, 0, 1754 }, { 0, 0, 1753 }, - { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, - { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1754 }, - { 0, 0, 1756 }, { 0, 0, 1759 }, { 0, 0, 1763 }, { 0, 0, 1768 }, { 0, 0, 1774 }, - { 0, 0, 1783 }, { 0, 0, 1794 }, { 0, 0, 1808 }, { 0, 0, 1823 }, { 0, 0, 1840 }, - { 0, 0, 1857 }, { 0, 0, 1874 }, { 0, 0, 1891 }, { 0, 0, 1906 }, { 0, 0, 1920 }, - { 0, 0, 1932 }, { 0, 0, 1941 }, { 0, 0, 1947 }, { 0, 0, 1949 }, { 0, 0, 1946 }, - { 0, 0, 1939 }, { 0, 0, 1929 }, { 0, 0, 1915 }, { 0, 0, 1898 }, { 0, 0, 1878 }, - { 0, 0, 1857 }, { 0, 0, 1834 }, { 0, 0, 1810 }, { 0, 0, 1786 }, { 0, 0, 1761 }, - { 0, 0, 1737 }, { 0, 0, 1713 }, { 0, 0, 1691 }, { 0, 0, 1671 }, { 0, 0, 1652 }, - { 0, 0, 1636 }, { 0, 0, 1624 }, { 0, 0, 1615 }, { 0, 0, 1608 }, { 0, 0, 1602 }, - { 0, 0, 1598 }, { 0, 0, 1594 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1587 }, - { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1589 }, - { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1596 }, { 0, 0, 1598 }, { 0, 0, 1601 }, - { 0, 0, 1603 }, { 0, 0, 1606 }, { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, - { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1617 }, - { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1613 }, { 0, 0, 1613 }, - { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1611 }, { 0, 0, 1611 }, { 0, 0, 1612 }, - { 0, 0, 1612 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1620 }, - { 0, 0, 1622 }, { 0, 0, 1626 }, { 0, 0, 1629 }, { 0, 0, 1633 }, { 0, 0, 1638 }, - { 0, 0, 1644 }, { 0, 0, 1651 }, { 0, 0, 1659 }, { 0, 0, 1670 }, { 0, 0, 1681 }, - { 0, 0, 1695 }, { 0, 0, 1711 }, { 0, 0, 1735 }, { 0, 0, 1768 }, { 0, 0, 1808 }, - { 0, 0, 1851 }, { 0, 0, 1891 }, { 0, 0, 1926 }, { 0, 0, 1951 }, { 0, 0, 1963 }, - { 0, 0, 1960 }, { 0, 0, 1943 }, { 0, 0, 1916 }, { 0, 0, 1884 }, { 0, 0, 1850 }, - { 0, 0, 1818 }, { 0, 0, 1792 }, { 0, 0, 1774 }, { 0, 0, 1764 }, { 0, 0, 1757 }, - { 0, 0, 1753 }, { 0, 0, 1750 }, { 0, 0, 1750 }, { 0, 0, 1750 }, { 0, 0, 1751 }, - { 0, 0, 1753 }, { 0, 0, 1754 }, { 0, 0, 1754 }, { 0, 0, 1754 }, { 0, 0, 1753 }, - { 0, 0, 1753 }, { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1759 }, { 0, 0, 1765 }, - { 0, 0, 1774 }, { 0, 0, 1787 }, { 0, 0, 1805 }, { 0, 0, 1826 }, { 0, 0, 1848 }, - { 0, 0, 1870 }, { 0, 0, 1891 }, { 0, 0, 1910 }, { 0, 0, 1925 }, { 0, 0, 1935 }, - { 0, 0, 1941 }, { 0, 0, 1945 }, { 0, 0, 1948 }, { 0, 0, 1949 }, { 0, 0, 1950 }, - { 0, 0, 1949 }, { 0, 0, 1948 }, { 0, 0, 1946 }, { 0, 0, 1944 }, { 0, 0, 1942 }, - { 0, 0, 1940 }, { 0, 0, 1938 }, { 0, 0, 1936 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, - { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1941 }, { 0, 0, 1935 }, - { 0, 0, 1897 }, { 0, 0, 1848 }, { 0, 0, 1798 }, { 0, 0, 1760 }, { 0, 0, 1744 }, - { 0, 0, 1846 }, { 0, 0, 1936 }, { 0, 0, 1843 }, { 0, 0, 1696 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1611 }, { 0, 0, 1607 }, + { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1593 }, { 0, 0, 1589 }, { 0, 0, 1585 }, { 0, 0, 1581 }, + { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1579 }, { 0, 0, 1583 }, + { 0, 0, 1589 }, { 0, 0, 1597 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1783 }, { 0, 0, 1940 }, + { 0, 0, 1936 }, { 0, 0, 1924 }, { 0, 0, 1906 }, { 0, 0, 1883 }, { 0, 0, 1855 }, { 0, 0, 1825 }, + { 0, 0, 1792 }, { 0, 0, 1760 }, { 0, 0, 1728 }, { 0, 0, 1698 }, { 0, 0, 1671 }, { 0, 0, 1648 }, + { 0, 0, 1630 }, { 0, 0, 1620 }, { 0, 0, 1613 }, { 0, 0, 1607 }, { 0, 0, 1602 }, { 0, 0, 1598 }, + { 0, 0, 1594 }, { 0, 0, 1592 }, { 0, 0, 1590 }, { 0, 0, 1588 }, { 0, 0, 1587 }, { 0, 0, 1587 }, + { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1591 }, { 0, 0, 1593 }, + { 0, 0, 1595 }, { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1602 }, { 0, 0, 1604 }, { 0, 0, 1606 }, + { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1616 }, { 0, 0, 1618 }, + { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1637 }, { 0, 0, 1683 }, + { 0, 0, 1746 }, { 0, 0, 1814 }, { 0, 0, 1877 }, { 0, 0, 1923 }, { 0, 0, 1940 }, { 0, 0, 1909 }, + { 0, 0, 1834 }, { 0, 0, 1743 }, { 0, 0, 1662 }, { 0, 0, 1620 }, { 0, 0, 1607 }, { 0, 0, 1598 }, + { 0, 0, 1591 }, { 0, 0, 1586 }, { 0, 0, 1583 }, { 0, 0, 1582 }, { 0, 0, 1583 }, { 0, 0, 1585 }, + { 0, 0, 1588 }, { 0, 0, 1592 }, { 0, 0, 1596 }, { 0, 0, 1601 }, { 0, 0, 1606 }, { 0, 0, 1610 }, + { 0, 0, 1614 }, { 0, 0, 1617 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1611 }, + { 0, 0, 1606 }, { 0, 0, 1603 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1642 }, { 0, 0, 1672 }, + { 0, 0, 1707 }, { 0, 0, 1744 }, { 0, 0, 1783 }, { 0, 0, 1822 }, { 0, 0, 1857 }, { 0, 0, 1888 }, + { 0, 0, 1913 }, { 0, 0, 1929 }, { 0, 0, 1935 }, { 0, 0, 1903 }, { 0, 0, 1828 }, { 0, 0, 1736 }, + { 0, 0, 1658 }, { 0, 0, 1620 }, { 0, 0, 1612 }, { 0, 0, 1604 }, { 0, 0, 1597 }, { 0, 0, 1590 }, + { 0, 0, 1583 }, { 0, 0, 1577 }, { 0, 0, 1571 }, { 0, 0, 1565 }, { 0, 0, 1560 }, { 0, 0, 1555 }, + { 0, 0, 1551 }, { 0, 0, 1547 }, { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1538 }, { 0, 0, 1536 }, + { 0, 0, 1534 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1533 }, + { 0, 0, 1534 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1541 }, { 0, 0, 1544 }, { 0, 0, 1548 }, + { 0, 0, 1552 }, { 0, 0, 1558 }, { 0, 0, 1563 }, { 0, 0, 1569 }, { 0, 0, 1576 }, { 0, 0, 1584 }, + { 0, 0, 1592 }, { 0, 0, 1600 }, { 0, 0, 1951 }, { 0, 0, 1922 }, { 0, 0, 1846 }, { 0, 0, 1751 }, + { 0, 0, 1666 }, { 0, 0, 1620 }, { 0, 0, 1604 }, { 0, 0, 1593 }, { 0, 0, 1587 }, { 0, 0, 1584 }, + { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1593 }, { 0, 0, 1598 }, { 0, 0, 1604 }, { 0, 0, 1610 }, + { 0, 0, 1615 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1615 }, + { 0, 0, 1612 }, { 0, 0, 1609 }, { 0, 0, 1605 }, { 0, 0, 1601 }, { 0, 0, 1597 }, { 0, 0, 1592 }, + { 0, 0, 1588 }, { 0, 0, 1584 }, { 0, 0, 1581 }, { 0, 0, 1577 }, { 0, 0, 1574 }, { 0, 0, 1572 }, + { 0, 0, 1571 }, { 0, 0, 1570 }, { 0, 0, 1570 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1578 }, + { 0, 0, 1583 }, { 0, 0, 1590 }, { 0, 0, 1598 }, { 0, 0, 1608 }, { 0, 0, 1648 }, { 0, 0, 1729 }, + { 0, 0, 1824 }, { 0, 0, 1905 }, { 0, 0, 1946 }, { 0, 0, 1948 }, { 0, 0, 1932 }, { 0, 0, 1905 }, + { 0, 0, 1870 }, { 0, 0, 1834 }, { 0, 0, 1801 }, { 0, 0, 1778 }, { 0, 0, 1769 }, { 0, 0, 1799 }, + { 0, 0, 1866 }, { 0, 0, 1926 }, { 0, 0, 1940 }, { 0, 0, 1844 }, { 0, 0, 1689 }, { 0, 0, 1608 }, + { 0, 0, 1662 }, { 0, 0, 1778 }, { 0, 0, 1894 }, { 0, 0, 1946 }, { 0, 0, 1897 }, { 0, 0, 1786 }, + { 0, 0, 1668 }, { 0, 0, 1597 }, { 0, 0, 1575 }, { 0, 0, 1567 }, { 0, 0, 1571 }, { 0, 0, 1580 }, + { 0, 0, 1593 }, { 0, 0, 1603 }, { 0, 0, 1608 }, { 0, 0, 1607 }, { 0, 0, 1604 }, { 0, 0, 1599 }, + { 0, 0, 1594 }, { 0, 0, 1589 }, { 0, 0, 1586 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1595 }, + { 0, 0, 1608 }, { 0, 0, 1630 }, { 0, 0, 1663 }, { 0, 1, 1702 }, { 0, 1, 1746 }, { 0, 2, 1790 }, + { 0, 2, 1831 }, { 0, 2, 1867 }, { 0, 1, 1893 }, { 0, 0, 1906 }, { 0, -2, 1908 }, { 0, -4, 1901 }, + { 0, -8, 1889 }, { 0, -11, 1871 }, { 0, -15, 1850 }, { 1, -19, 1827 }, { 1, -23, 1803 }, { 1, -26, 1779 }, + { 1, -30, 1758 }, { 2, -32, 1741 }, { 2, -34, 1728 }, { 2, -35, 1719 }, { 2, -36, 1712 }, { 3, -37, 1705 }, + { 3, -38, 1699 }, { 4, -38, 1693 }, { 4, -38, 1689 }, { 4, -39, 1685 }, { 5, -38, 1681 }, { 5, -38, 1678 }, + { 5, -38, 1675 }, { 6, -37, 1672 }, { 6, -37, 1669 }, { 6, -36, 1666 }, { 6, -35, 1663 }, { 6, -33, 1659 }, + { 6, -31, 1656 }, { 5, -28, 1653 }, { 5, -25, 1650 }, { 4, -21, 1648 }, { 3, -17, 1646 }, { 2, -12, 1644 }, + { 1, -8, 1642 }, { 1, -5, 1640 }, { 0, -2, 1639 }, { 0, 0, 1637 }, { 0, 1, 1635 }, { 0, 2, 1633 }, + { 0, 2, 1632 }, { 0, 2, 1630 }, { 0, 2, 1629 }, { 0, 2, 1628 }, { 0, 1, 1626 }, { 0, 1, 1625 }, + { 0, 0, 1624 }, { 0, 0, 1622 }, { 0, 0, 1621 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1614 }, + { 0, 0, 1610 }, { 0, 0, 1607 }, { 0, 0, 1605 }, { 0, 0, 1605 }, { 0, 0, 1608 }, { 0, 0, 1624 }, + { 0, 0, 1649 }, { 0, 0, 1662 }, { 0, 0, 1647 }, { 0, 0, 1619 }, { 0, 0, 1602 }, { 0, 0, 1599 }, + { 0, 0, 1595 }, { 0, 0, 1592 }, { 0, 0, 1589 }, { 0, 0, 1587 }, { 0, 0, 1584 }, { 0, 0, 1582 }, + { 0, 0, 1580 }, { 0, 0, 1578 }, { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1575 }, { 0, 0, 1574 }, + { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, { 0, 0, 1573 }, + { 0, 0, 1574 }, { 0, 0, 1576 }, { 0, 0, 1581 }, { 0, 0, 1589 }, { 0, 0, 1597 }, { 0, 0, 1605 }, + { 0, 0, 1612 }, { 0, 0, 1617 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, + { 0, 0, 1617 }, { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1612 }, + { 0, 0, 1611 }, { 0, 0, 1610 }, { 0, 0, 1609 }, { 0, 0, 1608 }, { 0, 0, 1607 }, { 0, 0, 1605 }, + { 0, 0, 1604 }, { 0, 0, 1603 }, { 0, 0, 1602 }, { 0, 0, 1601 }, { 0, 0, 1599 }, { 0, 0, 1598 }, + { 0, 0, 1597 }, { 0, 0, 1596 }, { 0, 0, 1595 }, { 0, 0, 1594 }, { 0, 0, 1593 }, { 0, 0, 1592 }, + { 0, 0, 1592 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1585 }, { 0, 0, 1580 }, { 0, 0, 1573 }, + { 0, 0, 1567 }, { 0, 0, 1562 }, { 0, 0, 1559 }, { 0, 0, 1558 }, { 0, 0, 1559 }, { 0, 0, 1565 }, + { 0, 0, 1575 }, { 0, 0, 1591 }, { 0, 0, 1628 }, { 0, 0, 1693 }, { 0, 0, 1770 }, { 0, 0, 1844 }, + { 0, 0, 1901 }, { 0, 0, 1923 }, { 0, 0, 1918 }, { 0, 0, 1903 }, { 0, 0, 1878 }, { 0, 0, 1847 }, + { 0, 0, 1812 }, { 0, 0, 1774 }, { 0, 0, 1736 }, { 0, 0, 1699 }, { 0, 0, 1666 }, { 0, 0, 1638 }, + { 0, 0, 1618 }, { 0, 0, 1608 }, { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1595 }, { 0, 0, 1592 }, + { 0, 0, 1589 }, { 0, 0, 1586 }, { 0, 0, 1584 }, { 0, 0, 1581 }, { 0, 0, 1580 }, { 0, 0, 1578 }, + { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1575 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, + { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1575 }, { 0, 0, 1576 }, { 0, 0, 1577 }, + { 0, 0, 1578 }, { 0, 0, 1579 }, { 0, 0, 1580 }, { 0, 0, 1581 }, { 0, 0, 1583 }, { 0, 0, 1584 }, + { 0, 0, 1586 }, { 0, 0, 1587 }, { 0, 0, 1589 }, { 0, 0, 1591 }, { 0, 0, 1592 }, { 0, 0, 1594 }, + { 0, 0, 1595 }, { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1600 }, { 0, 0, 1602 }, { 0, 0, 1603 }, + { 0, 0, 1604 }, { 0, 0, 1606 }, { 0, 0, 1607 }, { 0, 0, 1608 }, { 0, 0, 1608 }, { 0, 0, 1609 }, + { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, { 0, 0, 1610 }, + { 0, 0, 1609 }, { 0, 0, 1608 }, { 0, 0, 1593 }, { 0, 0, 1566 }, { 0, 0, 1551 }, { 0, 0, 1549 }, + { 0, 0, 1546 }, { 0, 0, 1544 }, { 0, 0, 1542 }, { 0, 0, 1540 }, { 0, 0, 1538 }, { 0, 0, 1536 }, + { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1535 }, { 0, 0, 1536 }, { 0, 0, 1539 }, { 0, 0, 1542 }, + { 0, 0, 1547 }, { 0, 0, 1553 }, { 0, 0, 1560 }, { 0, 0, 1570 }, { 0, 0, 1618 }, { 0, 0, 1700 }, + { 0, 0, 1751 }, { 0, 0, 1765 }, { 0, 0, 1774 }, { 0, 0, 1779 }, { 0, 0, 1782 }, { 0, 0, 1783 }, + { 0, 0, 1783 }, { 0, 0, 1783 }, { 0, 0, 1783 }, { 0, 0, 1784 }, { 0, 0, 1788 }, { 0, 0, 1794 }, + { 0, 0, 1805 }, { 0, 0, 1834 }, { 0, 0, 1881 }, { 0, 0, 1926 }, { 0, 0, 1946 }, { 0, 0, 1941 }, + { 0, 0, 1928 }, { 0, 0, 1907 }, { 0, 0, 1881 }, { 0, 0, 1849 }, { 0, 0, 1815 }, { 0, 0, 1779 }, + { 0, 0, 1742 }, { 0, 0, 1707 }, { 0, 0, 1673 }, { 0, 0, 1644 }, { 0, 0, 1619 }, { 0, 0, 1601 }, + { 0, 0, 1591 }, { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1596 }, { 0, 0, 1606 }, { 0, 0, 1619 }, + { 0, 0, 1635 }, { 0, 0, 1652 }, { 0, 0, 1670 }, { 0, 0, 1689 }, { 0, 0, 1708 }, { 0, 0, 1726 }, + { 0, 0, 1742 }, { 0, 0, 1756 }, { 0, 0, 1767 }, { 0, 0, 1774 }, { 0, 0, 1779 }, { 0, 0, 1781 }, + { 0, 0, 1782 }, { 0, 0, 1781 }, { 0, 0, 1779 }, { 0, 0, 1776 }, { 0, 0, 1772 }, { 0, 0, 1768 }, + { 0, 0, 1764 }, { 0, 0, 1760 }, { 0, 0, 1757 }, { 0, 0, 1754 }, { 0, 0, 1752 }, { 0, 0, 1751 }, + { 0, 0, 1752 }, { 0, 0, 1752 }, { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1757 }, { 0, 0, 1759 }, + { 0, 0, 1762 }, { 0, 0, 1764 }, { 0, 0, 1766 }, { 0, 0, 1768 }, { 0, 0, 1770 }, { 0, 0, 1772 }, + { 0, 0, 1773 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1773 }, { 0, 0, 1772 }, + { 0, 0, 1770 }, { 0, 0, 1768 }, { 0, 0, 1765 }, { 0, 0, 1763 }, { 0, 0, 1760 }, { 0, 0, 1758 }, + { 0, 0, 1756 }, { 0, 0, 1754 }, { 0, 0, 1753 }, { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1751 }, + { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1752 }, + { 0, 0, 1754 }, { 0, 0, 1756 }, { 0, 0, 1759 }, { 0, 0, 1763 }, { 0, 0, 1768 }, { 0, 0, 1774 }, + { 0, 0, 1783 }, { 0, 0, 1794 }, { 0, 0, 1808 }, { 0, 0, 1823 }, { 0, 0, 1840 }, { 0, 0, 1857 }, + { 0, 0, 1874 }, { 0, 0, 1891 }, { 0, 0, 1906 }, { 0, 0, 1920 }, { 0, 0, 1932 }, { 0, 0, 1941 }, + { 0, 0, 1947 }, { 0, 0, 1949 }, { 0, 0, 1946 }, { 0, 0, 1939 }, { 0, 0, 1929 }, { 0, 0, 1915 }, + { 0, 0, 1898 }, { 0, 0, 1878 }, { 0, 0, 1857 }, { 0, 0, 1834 }, { 0, 0, 1810 }, { 0, 0, 1786 }, + { 0, 0, 1761 }, { 0, 0, 1737 }, { 0, 0, 1713 }, { 0, 0, 1691 }, { 0, 0, 1671 }, { 0, 0, 1652 }, + { 0, 0, 1636 }, { 0, 0, 1624 }, { 0, 0, 1615 }, { 0, 0, 1608 }, { 0, 0, 1602 }, { 0, 0, 1598 }, + { 0, 0, 1594 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, + { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1589 }, { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1596 }, + { 0, 0, 1598 }, { 0, 0, 1601 }, { 0, 0, 1603 }, { 0, 0, 1606 }, { 0, 0, 1609 }, { 0, 0, 1611 }, + { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1617 }, { 0, 0, 1616 }, + { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1613 }, { 0, 0, 1613 }, { 0, 0, 1612 }, { 0, 0, 1612 }, + { 0, 0, 1611 }, { 0, 0, 1611 }, { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1613 }, { 0, 0, 1615 }, + { 0, 0, 1617 }, { 0, 0, 1620 }, { 0, 0, 1622 }, { 0, 0, 1626 }, { 0, 0, 1629 }, { 0, 0, 1633 }, + { 0, 0, 1638 }, { 0, 0, 1644 }, { 0, 0, 1651 }, { 0, 0, 1659 }, { 0, 0, 1670 }, { 0, 0, 1681 }, + { 0, 0, 1695 }, { 0, 0, 1711 }, { 0, 0, 1735 }, { 0, 0, 1768 }, { 0, 0, 1808 }, { 0, 0, 1851 }, + { 0, 0, 1891 }, { 0, 0, 1926 }, { 0, 0, 1951 }, { 0, 0, 1963 }, { 0, 0, 1960 }, { 0, 0, 1943 }, + { 0, 0, 1916 }, { 0, 0, 1884 }, { 0, 0, 1850 }, { 0, 0, 1818 }, { 0, 0, 1792 }, { 0, 0, 1774 }, + { 0, 0, 1764 }, { 0, 0, 1757 }, { 0, 0, 1753 }, { 0, 0, 1750 }, { 0, 0, 1750 }, { 0, 0, 1750 }, + { 0, 0, 1751 }, { 0, 0, 1753 }, { 0, 0, 1754 }, { 0, 0, 1754 }, { 0, 0, 1754 }, { 0, 0, 1753 }, + { 0, 0, 1753 }, { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1759 }, { 0, 0, 1765 }, { 0, 0, 1774 }, + { 0, 0, 1787 }, { 0, 0, 1805 }, { 0, 0, 1826 }, { 0, 0, 1848 }, { 0, 0, 1870 }, { 0, 0, 1891 }, + { 0, 0, 1910 }, { 0, 0, 1925 }, { 0, 0, 1935 }, { 0, 0, 1941 }, { 0, 0, 1945 }, { 0, 0, 1948 }, + { 0, 0, 1949 }, { 0, 0, 1950 }, { 0, 0, 1949 }, { 0, 0, 1948 }, { 0, 0, 1946 }, { 0, 0, 1944 }, + { 0, 0, 1942 }, { 0, 0, 1940 }, { 0, 0, 1938 }, { 0, 0, 1936 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, + { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1935 }, { 0, 0, 1941 }, { 0, 0, 1935 }, + { 0, 0, 1897 }, { 0, 0, 1848 }, { 0, 0, 1798 }, { 0, 0, 1760 }, { 0, 0, 1744 }, { 0, 0, 1846 }, + { 0, 0, 1936 }, { 0, 0, 1843 }, { 0, 0, 1696 }, { 0, 0, 1620 }, }; static s16 animdata_mario_eyelid_left_2[][3] = { - { 0, 0, 1717 }, { 0, 0, 1717 }, { 0, 0, 1715 }, { 0, 0, 1714 }, { 0, 0, 1711 }, { 0, 0, 1708 }, - { 0, 0, 1705 }, { 0, 0, 1702 }, { 0, 0, 1699 }, { 0, 0, 1696 }, { 0, 0, 1694 }, { 0, 0, 1691 }, - { 0, 0, 1689 }, { 0, 0, 1688 }, { 0, 0, 1688 }, { 0, 0, 1688 }, { 0, 0, 1690 }, { 0, 0, 1692 }, - { 0, 0, 1696 }, { 0, 0, 1702 }, { 0, 0, 1708 }, { 0, 0, 1717 }, { 0, 0, 1759 }, { 0, 0, 1839 }, - { 0, 0, 1917 }, { 0, 0, 1952 }, { 0, 0, 1927 }, { 0, 0, 1869 }, { 0, 0, 1800 }, { 0, 0, 1741 }, - { 0, 0, 1717 }, { 0, 0, 1713 }, { 0, 0, 1703 }, { 0, 0, 1691 }, { 0, 0, 1681 }, { 0, 0, 1677 }, - { 0, 0, 1678 }, { 0, 0, 1682 }, { 0, 0, 1687 }, { 0, 0, 1694 }, { 0, 0, 1700 }, { 0, 0, 1707 }, - { 0, 0, 1712 }, { 0, 0, 1716 }, { 0, 0, 1717 }, { 0, 0, 1717 }, { 0, 0, 1718 }, { 0, 0, 1720 }, - { 0, 0, 1722 }, { 0, 0, 1725 }, { 0, 0, 1728 }, { 0, 0, 1731 }, { 0, 0, 1735 }, { 0, 0, 1739 }, - { 0, 0, 1744 }, { 0, 0, 1748 }, { 0, 0, 1754 }, { 0, 0, 1759 }, { 0, 0, 1764 }, { 0, 0, 1769 }, - { 0, 0, 1775 }, { 0, 0, 1780 }, { 0, 0, 1786 }, { 0, 0, 1794 }, { 0, 0, 1806 }, { 0, 0, 1820 }, - { 0, 0, 1833 }, { 0, 0, 1843 }, { 0, 0, 1847 }, { 0, 0, 1848 }, { 0, 0, 1849 }, { 0, 0, 1849 }, - { 0, 0, 1850 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1852 }, - { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1851 }, { 0, 0, 1851 }, - { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1850 }, { 0, 0, 1850 }, { 0, 0, 1849 }, { 0, 0, 1849 }, - { 0, 0, 1848 }, { 0, 0, 1848 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1846 }, { 0, 0, 1846 }, - { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1844 }, { 0, 0, 1843 }, { 0, 0, 1843 }, { 0, 0, 1842 }, - { 0, 0, 1842 }, { 0, 0, 1841 }, { 0, 0, 1841 }, { 0, 0, 1840 }, { 0, 0, 1840 }, { 0, 0, 1839 }, - { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, - { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1839 }, - { 0, 0, 1839 }, { 0, 0, 1840 }, { 0, 0, 1840 }, { 0, 0, 1841 }, { 0, 0, 1842 }, { 0, 0, 1843 }, - { 0, 0, 1844 }, { 0, 0, 1845 }, { 0, 0, 1846 }, { 0, 0, 1847 }, { 0, 0, 1853 }, { 0, 0, 1866 }, - { 0, 0, 1883 }, { 0, 0, 1902 }, { 0, 0, 1921 }, { 0, 0, 1935 }, { 0, 0, 1943 }, { 0, 0, 1942 }, - { 0, 0, 1935 }, { 0, 0, 1927 }, { 0, 0, 1917 }, { 0, 0, 1906 }, { 0, 0, 1894 }, { 0, 0, 1881 }, - { 0, 0, 1867 }, { 0, 0, 1853 }, { 0, 0, 1837 }, { 0, 0, 1822 }, { 0, 0, 1806 }, { 0, 0, 1790 }, - { 0, 0, 1775 }, { 0, 0, 1759 }, { 0, 0, 1743 }, { 0, 0, 1728 }, { 0, 0, 1713 }, { 0, 0, 1699 }, - { 0, 0, 1686 }, { 0, 0, 1673 }, { 0, 0, 1662 }, { 0, 0, 1651 }, { 0, 0, 1642 }, { 0, 0, 1634 }, - { 0, 0, 1628 }, { 0, 0, 1623 }, { 0, 0, 1621 }, { 0, 0, 1620 }, + { 0, 0, 1717 }, { 0, 0, 1717 }, { 0, 0, 1715 }, { 0, 0, 1714 }, { 0, 0, 1711 }, { 0, 0, 1708 }, { 0, 0, 1705 }, + { 0, 0, 1702 }, { 0, 0, 1699 }, { 0, 0, 1696 }, { 0, 0, 1694 }, { 0, 0, 1691 }, { 0, 0, 1689 }, { 0, 0, 1688 }, + { 0, 0, 1688 }, { 0, 0, 1688 }, { 0, 0, 1690 }, { 0, 0, 1692 }, { 0, 0, 1696 }, { 0, 0, 1702 }, { 0, 0, 1708 }, + { 0, 0, 1717 }, { 0, 0, 1759 }, { 0, 0, 1839 }, { 0, 0, 1917 }, { 0, 0, 1952 }, { 0, 0, 1927 }, { 0, 0, 1869 }, + { 0, 0, 1800 }, { 0, 0, 1741 }, { 0, 0, 1717 }, { 0, 0, 1713 }, { 0, 0, 1703 }, { 0, 0, 1691 }, { 0, 0, 1681 }, + { 0, 0, 1677 }, { 0, 0, 1678 }, { 0, 0, 1682 }, { 0, 0, 1687 }, { 0, 0, 1694 }, { 0, 0, 1700 }, { 0, 0, 1707 }, + { 0, 0, 1712 }, { 0, 0, 1716 }, { 0, 0, 1717 }, { 0, 0, 1717 }, { 0, 0, 1718 }, { 0, 0, 1720 }, { 0, 0, 1722 }, + { 0, 0, 1725 }, { 0, 0, 1728 }, { 0, 0, 1731 }, { 0, 0, 1735 }, { 0, 0, 1739 }, { 0, 0, 1744 }, { 0, 0, 1748 }, + { 0, 0, 1754 }, { 0, 0, 1759 }, { 0, 0, 1764 }, { 0, 0, 1769 }, { 0, 0, 1775 }, { 0, 0, 1780 }, { 0, 0, 1786 }, + { 0, 0, 1794 }, { 0, 0, 1806 }, { 0, 0, 1820 }, { 0, 0, 1833 }, { 0, 0, 1843 }, { 0, 0, 1847 }, { 0, 0, 1848 }, + { 0, 0, 1849 }, { 0, 0, 1849 }, { 0, 0, 1850 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1851 }, + { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1852 }, { 0, 0, 1851 }, { 0, 0, 1851 }, + { 0, 0, 1851 }, { 0, 0, 1851 }, { 0, 0, 1850 }, { 0, 0, 1850 }, { 0, 0, 1849 }, { 0, 0, 1849 }, { 0, 0, 1848 }, + { 0, 0, 1848 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1846 }, { 0, 0, 1846 }, { 0, 0, 1845 }, { 0, 0, 1845 }, + { 0, 0, 1844 }, { 0, 0, 1843 }, { 0, 0, 1843 }, { 0, 0, 1842 }, { 0, 0, 1842 }, { 0, 0, 1841 }, { 0, 0, 1841 }, + { 0, 0, 1840 }, { 0, 0, 1840 }, { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1838 }, + { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, { 0, 0, 1838 }, + { 0, 0, 1839 }, { 0, 0, 1839 }, { 0, 0, 1840 }, { 0, 0, 1840 }, { 0, 0, 1841 }, { 0, 0, 1842 }, { 0, 0, 1843 }, + { 0, 0, 1844 }, { 0, 0, 1845 }, { 0, 0, 1846 }, { 0, 0, 1847 }, { 0, 0, 1853 }, { 0, 0, 1866 }, { 0, 0, 1883 }, + { 0, 0, 1902 }, { 0, 0, 1921 }, { 0, 0, 1935 }, { 0, 0, 1943 }, { 0, 0, 1942 }, { 0, 0, 1935 }, { 0, 0, 1927 }, + { 0, 0, 1917 }, { 0, 0, 1906 }, { 0, 0, 1894 }, { 0, 0, 1881 }, { 0, 0, 1867 }, { 0, 0, 1853 }, { 0, 0, 1837 }, + { 0, 0, 1822 }, { 0, 0, 1806 }, { 0, 0, 1790 }, { 0, 0, 1775 }, { 0, 0, 1759 }, { 0, 0, 1743 }, { 0, 0, 1728 }, + { 0, 0, 1713 }, { 0, 0, 1699 }, { 0, 0, 1686 }, { 0, 0, 1673 }, { 0, 0, 1662 }, { 0, 0, 1651 }, { 0, 0, 1642 }, + { 0, 0, 1634 }, { 0, 0, 1628 }, { 0, 0, 1623 }, { 0, 0, 1621 }, { 0, 0, 1620 }, }; struct AnimDataInfo anim_mario_eyelid_left[] = { @@ -1028,201 +892,170 @@ struct AnimDataInfo anim_mario_eyelid_left[] = { }; static s16 animdata_mario_eyelid_right_1[][3] = { - { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1611 }, - { 0, 0, 1607 }, { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1593 }, { 0, 0, 1589 }, - { 0, 0, 1585 }, { 0, 0, 1581 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, - { 0, 0, 1577 }, { 0, 0, 1579 }, { 0, 0, 1583 }, { 0, 0, 1589 }, { 0, 0, 1597 }, - { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1783 }, { 0, 0, 1940 }, { 0, 0, 1936 }, - { 0, 0, 1925 }, { 0, 0, 1907 }, { 0, 0, 1885 }, { 0, 0, 1858 }, { 0, 0, 1828 }, - { 0, 0, 1797 }, { 0, 0, 1764 }, { 0, 0, 1733 }, { 0, 0, 1702 }, { 0, 0, 1675 }, - { 0, 0, 1651 }, { 0, 0, 1632 }, { 0, 0, 1620 }, { 0, 0, 1610 }, { 0, 0, 1602 }, - { 0, 0, 1594 }, { 0, 0, 1587 }, { 0, 0, 1580 }, { 0, 0, 1574 }, { 0, 0, 1570 }, - { 0, 0, 1566 }, { 0, 0, 1563 }, { 0, 0, 1561 }, { 0, 0, 1561 }, { 0, 0, 1562 }, - { 0, 0, 1564 }, { 0, 0, 1567 }, { 0, 0, 1572 }, { 0, 0, 1578 }, { 0, 0, 1586 }, - { 0, 0, 1595 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1679 }, { 0, 0, 1793 }, - { 0, 0, 1903 }, { 0, 0, 1952 }, { 0, 0, 1925 }, { 0, 0, 1858 }, { 0, 0, 1771 }, - { 0, 0, 1685 }, { 0, 0, 1620 }, { 0, 0, 1608 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1637 }, { 0, 0, 1683 }, { 0, 0, 1746 }, - { 0, 0, 1814 }, { 0, 0, 1877 }, { 0, 0, 1923 }, { 0, 0, 1940 }, { 0, 0, 1909 }, - { 0, 0, 1834 }, { 0, 0, 1743 }, { 0, 0, 1662 }, { 0, 0, 1620 }, { 0, 0, 1607 }, - { 0, 0, 1598 }, { 0, 0, 1591 }, { 0, 0, 1586 }, { 0, 0, 1583 }, { 0, 0, 1582 }, - { 0, 0, 1583 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1592 }, { 0, 0, 1596 }, - { 0, 0, 1601 }, { 0, 0, 1606 }, { 0, 0, 1610 }, { 0, 0, 1614 }, { 0, 0, 1617 }, - { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1611 }, { 0, 0, 1606 }, - { 0, 0, 1603 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1642 }, { 0, 0, 1672 }, - { 0, 0, 1707 }, { 0, 0, 1744 }, { 0, 0, 1783 }, { 0, 0, 1822 }, { 0, 0, 1857 }, - { 0, 0, 1888 }, { 0, 0, 1913 }, { 0, 0, 1929 }, { 0, 0, 1935 }, { 0, 0, 1903 }, - { 0, 0, 1828 }, { 0, 0, 1736 }, { 0, 0, 1658 }, { 0, 0, 1620 }, { 0, 0, 1612 }, - { 0, 0, 1604 }, { 0, 0, 1597 }, { 0, 0, 1590 }, { 0, 0, 1583 }, { 0, 0, 1577 }, - { 0, 0, 1571 }, { 0, 0, 1565 }, { 0, 0, 1560 }, { 0, 0, 1555 }, { 0, 0, 1551 }, - { 0, 0, 1547 }, { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1538 }, { 0, 0, 1536 }, - { 0, 0, 1534 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1532 }, - { 0, 0, 1533 }, { 0, 0, 1534 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1541 }, - { 0, 0, 1544 }, { 0, 0, 1548 }, { 0, 0, 1552 }, { 0, 0, 1558 }, { 0, 0, 1563 }, - { 0, 0, 1569 }, { 0, 0, 1576 }, { 0, 0, 1584 }, { 0, 0, 1592 }, { 0, 0, 1600 }, - { 0, 0, 1951 }, { 0, 0, 1922 }, { 0, 0, 1846 }, { 0, 0, 1751 }, { 0, 0, 1666 }, - { 0, 0, 1620 }, { 0, 0, 1604 }, { 0, 0, 1593 }, { 0, 0, 1587 }, { 0, 0, 1584 }, - { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1593 }, { 0, 0, 1598 }, { 0, 0, 1604 }, - { 0, 0, 1610 }, { 0, 0, 1615 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1619 }, - { 0, 0, 1617 }, { 0, 0, 1615 }, { 0, 0, 1612 }, { 0, 0, 1609 }, { 0, 0, 1605 }, - { 0, 0, 1601 }, { 0, 0, 1597 }, { 0, 0, 1592 }, { 0, 0, 1588 }, { 0, 0, 1584 }, - { 0, 0, 1581 }, { 0, 0, 1577 }, { 0, 0, 1574 }, { 0, 0, 1572 }, { 0, 0, 1571 }, - { 0, 0, 1570 }, { 0, 0, 1570 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1578 }, - { 0, 0, 1583 }, { 0, 0, 1590 }, { 0, 0, 1598 }, { 0, 0, 1608 }, { 0, 0, 1648 }, - { 0, 0, 1729 }, { 0, 0, 1824 }, { 0, 0, 1905 }, { 0, 0, 1946 }, { 0, 0, 1948 }, - { 0, 0, 1932 }, { 0, 0, 1905 }, { 0, 0, 1870 }, { 0, 0, 1834 }, { 0, 0, 1801 }, - { 0, 0, 1778 }, { 0, 0, 1769 }, { 0, 0, 1799 }, { 0, 0, 1866 }, { 0, 0, 1926 }, - { 0, 0, 1940 }, { 0, 0, 1844 }, { 0, 0, 1689 }, { 0, 0, 1608 }, { 0, 0, 1662 }, - { 0, 0, 1778 }, { 0, 0, 1894 }, { 0, 0, 1946 }, { 0, 0, 1897 }, { 0, 0, 1786 }, - { 0, 0, 1668 }, { 0, 0, 1597 }, { 0, 0, 1575 }, { 0, 0, 1567 }, { 0, 0, 1571 }, - { 0, 0, 1580 }, { 0, 0, 1593 }, { 0, 0, 1603 }, { 0, 0, 1608 }, { 0, 0, 1607 }, - { 0, 0, 1604 }, { 0, 0, 1599 }, { 0, 0, 1594 }, { 0, 0, 1589 }, { 0, 0, 1586 }, - { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1595 }, { 0, 0, 1608 }, { 0, 0, 1631 }, - { 0, 0, 1665 }, { 0, 0, 1706 }, { 0, 0, 1752 }, { 0, 0, 1797 }, { 0, 0, 1839 }, - { 0, 0, 1874 }, { 0, 0, 1897 }, { 0, 0, 1906 }, { 0, 0, 1900 }, { 0, 0, 1884 }, - { 0, 0, 1859 }, { 0, 0, 1828 }, { 0, 0, 1792 }, { 0, 0, 1755 }, { 0, 0, 1717 }, - { 0, 0, 1681 }, { 0, 0, 1650 }, { 0, 0, 1625 }, { 0, 0, 1608 }, { 0, 0, 1597 }, - { 0, 0, 1589 }, { 0, 0, 1583 }, { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, - { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1580 }, { 0, 0, 1582 }, { 0, 0, 1585 }, - { 0, 0, 1589 }, { 0, 0, 1592 }, { 0, 0, 1594 }, { 0, 0, 1597 }, { 0, 0, 1599 }, - { 1, 0, 1602 }, { 2, 0, 1607 }, { 3, 0, 1612 }, { 4, 0, 1618 }, { 5, 0, 1624 }, - { 5, 0, 1631 }, { 4, 0, 1639 }, { 3, 0, 1646 }, { 0, 0, 1654 }, { -4, 0, 1662 }, - { -9, 0, 1671 }, { -15, 0, 1680 }, { -22, 0, 1690 }, { -30, 0, 1700 }, { -37, 0, 1710 }, - { -45, 0, 1720 }, { -53, 0, 1731 }, { -61, 0, 1740 }, { -68, 0, 1750 }, { -74, 0, 1759 }, - { -80, 0, 1767 }, { -85, 0, 1774 }, { -90, 0, 1782 }, { -93, 0, 1790 }, { -94, 0, 1796 }, - { -94, 1, 1798 }, { -91, 1, 1796 }, { -85, 1, 1786 }, { -75, 1, 1763 }, { -58, 1, 1729 }, - { -40, 0, 1689 }, { -22, 0, 1651 }, { -7, 0, 1620 }, { 0, 0, 1602 }, { 2, 0, 1595 }, - { 5, 0, 1589 }, { 7, 0, 1583 }, { 8, 0, 1579 }, { 9, 0, 1576 }, { 9, 0, 1574 }, - { 9, 0, 1572 }, { 9, 0, 1571 }, { 8, 0, 1570 }, { 8, 0, 1570 }, { 7, 0, 1571 }, - { 6, 0, 1571 }, { 5, 0, 1572 }, { 4, 0, 1573 }, { 3, 0, 1573 }, { 2, 0, 1574 }, - { 1, 0, 1575 }, { 0, 0, 1575 }, { 0, 0, 1574 }, { 0, 0, 1574 }, { 0, 0, 1573 }, - { 0, 0, 1572 }, { 0, 0, 1571 }, { 0, 0, 1571 }, { 0, 0, 1571 }, { 0, 0, 1572 }, - { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1576 }, { 0, 0, 1578 }, { 0, 0, 1580 }, - { 0, 0, 1582 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1591 }, { 0, 0, 1594 }, - { 0, 0, 1597 }, { 0, 0, 1600 }, { 0, 0, 1602 }, { 0, 0, 1605 }, { 0, 0, 1608 }, - { 0, 0, 1610 }, { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1616 }, { 0, 0, 1618 }, - { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1618 }, - { 0, 0, 1616 }, { 0, 0, 1614 }, { 0, 0, 1612 }, { 0, 0, 1610 }, { 0, 0, 1607 }, - { 0, 0, 1604 }, { 0, 0, 1601 }, { 0, 0, 1599 }, { 0, 0, 1596 }, { 0, 0, 1594 }, - { 0, 0, 1592 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1584 }, { 0, 0, 1579 }, - { 0, 0, 1573 }, { 0, 0, 1567 }, { 0, 0, 1562 }, { 0, 0, 1558 }, { 0, 0, 1557 }, - { 0, 0, 1559 }, { 0, 0, 1565 }, { 0, 0, 1575 }, { 0, 0, 1591 }, { 0, 0, 1628 }, - { 0, 0, 1693 }, { 0, 0, 1770 }, { 0, 0, 1844 }, { 0, 0, 1901 }, { 0, 0, 1923 }, - { 0, 0, 1918 }, { 0, 0, 1903 }, { 0, 0, 1878 }, { 0, 0, 1847 }, { 0, 0, 1812 }, - { 0, 0, 1774 }, { 0, 0, 1736 }, { 0, 0, 1699 }, { 0, 0, 1666 }, { 0, 0, 1638 }, - { 0, 0, 1618 }, { 0, 0, 1608 }, { 0, 0, 1603 }, { 0, 0, 1599 }, { 0, 0, 1595 }, - { 0, 0, 1591 }, { 0, 0, 1588 }, { 0, 0, 1584 }, { 0, 0, 1581 }, { 0, 0, 1578 }, - { 0, 0, 1576 }, { 0, 0, 1573 }, { 0, 0, 1571 }, { 0, 0, 1569 }, { 0, 0, 1567 }, - { 0, 0, 1565 }, { 0, 0, 1564 }, { 0, 0, 1563 }, { 0, 0, 1562 }, { 0, 0, 1561 }, - { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1559 }, { 0, 0, 1559 }, - { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1561 }, { 0, 0, 1562 }, - { 0, 0, 1562 }, { 0, 0, 1563 }, { 0, 0, 1564 }, { 0, 0, 1566 }, { 0, 0, 1567 }, - { 0, 0, 1568 }, { 0, 0, 1570 }, { 0, 0, 1571 }, { 0, 0, 1573 }, { 0, 0, 1575 }, - { 0, 0, 1576 }, { 0, 0, 1578 }, { 0, 0, 1580 }, { 0, 0, 1582 }, { 0, 0, 1584 }, - { 0, 0, 1586 }, { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1593 }, { 0, 0, 1595 }, - { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1601 }, { 0, 0, 1604 }, { 0, 0, 1606 }, - { 0, 0, 1608 }, { 0, 0, 1642 }, { 0, 0, 1703 }, { 0, 0, 1734 }, { 0, 0, 1731 }, - { 0, 0, 1726 }, { 0, 0, 1718 }, { 0, 0, 1709 }, { 0, 0, 1698 }, { 0, 0, 1686 }, - { 0, 0, 1673 }, { 0, 0, 1659 }, { 0, 0, 1646 }, { 0, 0, 1633 }, { 0, 0, 1621 }, - { 0, 0, 1609 }, { 0, 0, 1599 }, { 0, 0, 1591 }, { 0, 0, 1585 }, { 0, 0, 1581 }, - { 0, 0, 1581 }, { 0, 0, 1622 }, { 0, 0, 1701 }, { 0, 0, 1751 }, { 0, 0, 1764 }, - { 0, 0, 1773 }, { 0, 0, 1778 }, { 0, 0, 1781 }, { 0, 0, 1782 }, { 0, 0, 1782 }, - { 0, 0, 1782 }, { 0, 0, 1782 }, { 0, 0, 1784 }, { 0, 0, 1787 }, { 0, 0, 1794 }, - { 0, 0, 1804 }, { 0, 0, 1833 }, { 0, 0, 1881 }, { 0, 0, 1926 }, { 0, 0, 1946 }, - { 0, 0, 1941 }, { 0, 0, 1928 }, { 0, 0, 1907 }, { 0, 0, 1881 }, { 0, 0, 1849 }, - { 0, 0, 1815 }, { 0, 0, 1779 }, { 0, 0, 1742 }, { 0, 0, 1707 }, { 0, 0, 1673 }, - { 0, 0, 1644 }, { 0, 0, 1619 }, { 0, 0, 1601 }, { 0, 0, 1591 }, { 0, 0, 1588 }, - { 0, 0, 1590 }, { 0, 0, 1596 }, { 0, 0, 1606 }, { 0, 0, 1619 }, { 0, 0, 1635 }, - { 0, 0, 1652 }, { 0, 0, 1670 }, { 0, 0, 1689 }, { 0, 0, 1708 }, { 0, 0, 1726 }, - { 0, 0, 1742 }, { 0, 0, 1756 }, { 0, 0, 1767 }, { 0, 0, 1774 }, { 0, 0, 1779 }, - { 0, 0, 1781 }, { 0, 0, 1782 }, { 0, 0, 1781 }, { 0, 0, 1779 }, { 0, 0, 1776 }, - { 0, 0, 1772 }, { 0, 0, 1768 }, { 0, 0, 1764 }, { 0, 0, 1760 }, { 0, 0, 1757 }, - { 0, 0, 1754 }, { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1752 }, - { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1757 }, { 0, 0, 1759 }, { 0, 0, 1762 }, - { 0, 0, 1764 }, { 0, 0, 1766 }, { 0, 0, 1768 }, { 0, 0, 1770 }, { 0, 0, 1772 }, - { 0, 0, 1773 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1773 }, - { 0, 0, 1772 }, { 0, 0, 1770 }, { 0, 0, 1768 }, { 0, 0, 1765 }, { 0, 0, 1763 }, - { 0, 0, 1760 }, { 0, 0, 1758 }, { 0, 0, 1756 }, { 0, 0, 1754 }, { 0, 0, 1753 }, - { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, - { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1752 }, { 0, 0, 1754 }, - { 0, 0, 1756 }, { 0, 0, 1759 }, { 0, 0, 1763 }, { 0, 0, 1768 }, { 0, 0, 1774 }, - { 0, 0, 1783 }, { 0, 0, 1794 }, { 0, 0, 1808 }, { 0, 0, 1823 }, { 0, 0, 1840 }, - { 0, 0, 1857 }, { 0, 0, 1874 }, { 0, 0, 1891 }, { 0, 0, 1906 }, { 0, 0, 1920 }, - { 0, 0, 1932 }, { 0, 0, 1941 }, { 0, 0, 1947 }, { 0, 0, 1949 }, { 0, 0, 1946 }, - { 0, 0, 1939 }, { 0, 0, 1929 }, { 0, 0, 1915 }, { 0, 0, 1898 }, { 0, 0, 1878 }, - { 0, 0, 1857 }, { 0, 0, 1834 }, { 0, 0, 1810 }, { 0, 0, 1786 }, { 0, 0, 1761 }, - { 0, 0, 1737 }, { 0, 0, 1713 }, { 0, 0, 1691 }, { 0, 0, 1671 }, { 0, 0, 1652 }, - { 0, 0, 1636 }, { 0, 0, 1624 }, { 0, 0, 1615 }, { 0, 0, 1608 }, { 0, 0, 1602 }, - { 0, 0, 1598 }, { 0, 0, 1594 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1587 }, - { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1589 }, - { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1596 }, { 0, 0, 1598 }, { 0, 0, 1601 }, - { 0, 0, 1603 }, { 0, 0, 1606 }, { 0, 0, 1609 }, { 0, 0, 1611 }, { 0, 0, 1613 }, - { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, - { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1617 }, - { 0, 0, 1616 }, { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1613 }, - { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, - { 0, 0, 1613 }, { 0, 0, 1614 }, { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1620 }, - { 0, 0, 1622 }, { 0, 0, 1625 }, { 0, 0, 1628 }, { 0, 0, 1632 }, { 0, 0, 1637 }, - { 0, 0, 1642 }, { 0, 0, 1649 }, { 0, 0, 1657 }, { 0, 0, 1666 }, { 0, 0, 1677 }, - { 0, 0, 1690 }, { 0, 0, 1706 }, { 0, 0, 1728 }, { 0, 0, 1760 }, { 0, 0, 1798 }, - { 0, 0, 1838 }, { 0, 0, 1877 }, { 0, 0, 1910 }, { 0, 0, 1935 }, { 0, 0, 1946 }, - { 0, 0, 1943 }, { 0, 0, 1927 }, { 0, 0, 1902 }, { 0, 0, 1873 }, { 0, 0, 1841 }, - { 0, 0, 1810 }, { 0, 0, 1785 }, { 0, 0, 1769 }, { 0, 0, 1759 }, { 0, 0, 1752 }, - { 0, 0, 1747 }, { 0, 0, 1744 }, { 0, 0, 1742 }, { 0, 0, 1742 }, { 0, 0, 1742 }, - { 0, 0, 1743 }, { 0, 0, 1743 }, { 0, 0, 1744 }, { 0, 0, 1743 }, { 0, 0, 1743 }, - { 0, 0, 1743 }, { 0, 0, 1744 }, { 0, 0, 1747 }, { 0, 0, 1752 }, { 0, 0, 1759 }, - { 0, 0, 1769 }, { 0, 0, 1783 }, { 0, 0, 1801 }, { 0, 0, 1823 }, { 0, 0, 1846 }, - { 0, 0, 1870 }, { 0, 0, 1892 }, { 0, 0, 1912 }, { 0, 0, 1929 }, { 0, 0, 1940 }, - { 0, 0, 1948 }, { 0, 0, 1952 }, { 0, 0, 1954 }, { 0, 0, 1954 }, { 0, 0, 1953 }, - { 0, 0, 1951 }, { 0, 0, 1948 }, { 0, 0, 1946 }, { 0, 0, 1943 }, { 0, 0, 1941 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, - { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1947 }, { 0, 0, 1940 }, - { 0, 0, 1902 }, { 0, 0, 1852 }, { 0, 0, 1801 }, { 0, 0, 1762 }, { 0, 0, 1747 }, - { 0, 0, 1851 }, { 0, 0, 1942 }, { 0, 0, 1847 }, { 0, 0, 1698 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1614 }, { 0, 0, 1611 }, { 0, 0, 1607 }, + { 0, 0, 1602 }, { 0, 0, 1598 }, { 0, 0, 1593 }, { 0, 0, 1589 }, { 0, 0, 1585 }, { 0, 0, 1581 }, + { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1579 }, { 0, 0, 1583 }, + { 0, 0, 1589 }, { 0, 0, 1597 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1783 }, { 0, 0, 1940 }, + { 0, 0, 1936 }, { 0, 0, 1925 }, { 0, 0, 1907 }, { 0, 0, 1885 }, { 0, 0, 1858 }, { 0, 0, 1828 }, + { 0, 0, 1797 }, { 0, 0, 1764 }, { 0, 0, 1733 }, { 0, 0, 1702 }, { 0, 0, 1675 }, { 0, 0, 1651 }, + { 0, 0, 1632 }, { 0, 0, 1620 }, { 0, 0, 1610 }, { 0, 0, 1602 }, { 0, 0, 1594 }, { 0, 0, 1587 }, + { 0, 0, 1580 }, { 0, 0, 1574 }, { 0, 0, 1570 }, { 0, 0, 1566 }, { 0, 0, 1563 }, { 0, 0, 1561 }, + { 0, 0, 1561 }, { 0, 0, 1562 }, { 0, 0, 1564 }, { 0, 0, 1567 }, { 0, 0, 1572 }, { 0, 0, 1578 }, + { 0, 0, 1586 }, { 0, 0, 1595 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1679 }, { 0, 0, 1793 }, + { 0, 0, 1903 }, { 0, 0, 1952 }, { 0, 0, 1925 }, { 0, 0, 1858 }, { 0, 0, 1771 }, { 0, 0, 1685 }, + { 0, 0, 1620 }, { 0, 0, 1608 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1620 }, { 0, 0, 1637 }, { 0, 0, 1683 }, + { 0, 0, 1746 }, { 0, 0, 1814 }, { 0, 0, 1877 }, { 0, 0, 1923 }, { 0, 0, 1940 }, { 0, 0, 1909 }, + { 0, 0, 1834 }, { 0, 0, 1743 }, { 0, 0, 1662 }, { 0, 0, 1620 }, { 0, 0, 1607 }, { 0, 0, 1598 }, + { 0, 0, 1591 }, { 0, 0, 1586 }, { 0, 0, 1583 }, { 0, 0, 1582 }, { 0, 0, 1583 }, { 0, 0, 1585 }, + { 0, 0, 1588 }, { 0, 0, 1592 }, { 0, 0, 1596 }, { 0, 0, 1601 }, { 0, 0, 1606 }, { 0, 0, 1610 }, + { 0, 0, 1614 }, { 0, 0, 1617 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1617 }, { 0, 0, 1611 }, + { 0, 0, 1606 }, { 0, 0, 1603 }, { 0, 0, 1607 }, { 0, 0, 1620 }, { 0, 0, 1642 }, { 0, 0, 1672 }, + { 0, 0, 1707 }, { 0, 0, 1744 }, { 0, 0, 1783 }, { 0, 0, 1822 }, { 0, 0, 1857 }, { 0, 0, 1888 }, + { 0, 0, 1913 }, { 0, 0, 1929 }, { 0, 0, 1935 }, { 0, 0, 1903 }, { 0, 0, 1828 }, { 0, 0, 1736 }, + { 0, 0, 1658 }, { 0, 0, 1620 }, { 0, 0, 1612 }, { 0, 0, 1604 }, { 0, 0, 1597 }, { 0, 0, 1590 }, + { 0, 0, 1583 }, { 0, 0, 1577 }, { 0, 0, 1571 }, { 0, 0, 1565 }, { 0, 0, 1560 }, { 0, 0, 1555 }, + { 0, 0, 1551 }, { 0, 0, 1547 }, { 0, 0, 1544 }, { 0, 0, 1541 }, { 0, 0, 1538 }, { 0, 0, 1536 }, + { 0, 0, 1534 }, { 0, 0, 1533 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1532 }, { 0, 0, 1533 }, + { 0, 0, 1534 }, { 0, 0, 1536 }, { 0, 0, 1538 }, { 0, 0, 1541 }, { 0, 0, 1544 }, { 0, 0, 1548 }, + { 0, 0, 1552 }, { 0, 0, 1558 }, { 0, 0, 1563 }, { 0, 0, 1569 }, { 0, 0, 1576 }, { 0, 0, 1584 }, + { 0, 0, 1592 }, { 0, 0, 1600 }, { 0, 0, 1951 }, { 0, 0, 1922 }, { 0, 0, 1846 }, { 0, 0, 1751 }, + { 0, 0, 1666 }, { 0, 0, 1620 }, { 0, 0, 1604 }, { 0, 0, 1593 }, { 0, 0, 1587 }, { 0, 0, 1584 }, + { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1593 }, { 0, 0, 1598 }, { 0, 0, 1604 }, { 0, 0, 1610 }, + { 0, 0, 1615 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1617 }, { 0, 0, 1615 }, + { 0, 0, 1612 }, { 0, 0, 1609 }, { 0, 0, 1605 }, { 0, 0, 1601 }, { 0, 0, 1597 }, { 0, 0, 1592 }, + { 0, 0, 1588 }, { 0, 0, 1584 }, { 0, 0, 1581 }, { 0, 0, 1577 }, { 0, 0, 1574 }, { 0, 0, 1572 }, + { 0, 0, 1571 }, { 0, 0, 1570 }, { 0, 0, 1570 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1578 }, + { 0, 0, 1583 }, { 0, 0, 1590 }, { 0, 0, 1598 }, { 0, 0, 1608 }, { 0, 0, 1648 }, { 0, 0, 1729 }, + { 0, 0, 1824 }, { 0, 0, 1905 }, { 0, 0, 1946 }, { 0, 0, 1948 }, { 0, 0, 1932 }, { 0, 0, 1905 }, + { 0, 0, 1870 }, { 0, 0, 1834 }, { 0, 0, 1801 }, { 0, 0, 1778 }, { 0, 0, 1769 }, { 0, 0, 1799 }, + { 0, 0, 1866 }, { 0, 0, 1926 }, { 0, 0, 1940 }, { 0, 0, 1844 }, { 0, 0, 1689 }, { 0, 0, 1608 }, + { 0, 0, 1662 }, { 0, 0, 1778 }, { 0, 0, 1894 }, { 0, 0, 1946 }, { 0, 0, 1897 }, { 0, 0, 1786 }, + { 0, 0, 1668 }, { 0, 0, 1597 }, { 0, 0, 1575 }, { 0, 0, 1567 }, { 0, 0, 1571 }, { 0, 0, 1580 }, + { 0, 0, 1593 }, { 0, 0, 1603 }, { 0, 0, 1608 }, { 0, 0, 1607 }, { 0, 0, 1604 }, { 0, 0, 1599 }, + { 0, 0, 1594 }, { 0, 0, 1589 }, { 0, 0, 1586 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1595 }, + { 0, 0, 1608 }, { 0, 0, 1631 }, { 0, 0, 1665 }, { 0, 0, 1706 }, { 0, 0, 1752 }, { 0, 0, 1797 }, + { 0, 0, 1839 }, { 0, 0, 1874 }, { 0, 0, 1897 }, { 0, 0, 1906 }, { 0, 0, 1900 }, { 0, 0, 1884 }, + { 0, 0, 1859 }, { 0, 0, 1828 }, { 0, 0, 1792 }, { 0, 0, 1755 }, { 0, 0, 1717 }, { 0, 0, 1681 }, + { 0, 0, 1650 }, { 0, 0, 1625 }, { 0, 0, 1608 }, { 0, 0, 1597 }, { 0, 0, 1589 }, { 0, 0, 1583 }, + { 0, 0, 1579 }, { 0, 0, 1577 }, { 0, 0, 1576 }, { 0, 0, 1576 }, { 0, 0, 1577 }, { 0, 0, 1580 }, + { 0, 0, 1582 }, { 0, 0, 1585 }, { 0, 0, 1589 }, { 0, 0, 1592 }, { 0, 0, 1594 }, { 0, 0, 1597 }, + { 0, 0, 1599 }, { 1, 0, 1602 }, { 2, 0, 1607 }, { 3, 0, 1612 }, { 4, 0, 1618 }, { 5, 0, 1624 }, + { 5, 0, 1631 }, { 4, 0, 1639 }, { 3, 0, 1646 }, { 0, 0, 1654 }, { -4, 0, 1662 }, { -9, 0, 1671 }, + { -15, 0, 1680 }, { -22, 0, 1690 }, { -30, 0, 1700 }, { -37, 0, 1710 }, { -45, 0, 1720 }, { -53, 0, 1731 }, + { -61, 0, 1740 }, { -68, 0, 1750 }, { -74, 0, 1759 }, { -80, 0, 1767 }, { -85, 0, 1774 }, { -90, 0, 1782 }, + { -93, 0, 1790 }, { -94, 0, 1796 }, { -94, 1, 1798 }, { -91, 1, 1796 }, { -85, 1, 1786 }, { -75, 1, 1763 }, + { -58, 1, 1729 }, { -40, 0, 1689 }, { -22, 0, 1651 }, { -7, 0, 1620 }, { 0, 0, 1602 }, { 2, 0, 1595 }, + { 5, 0, 1589 }, { 7, 0, 1583 }, { 8, 0, 1579 }, { 9, 0, 1576 }, { 9, 0, 1574 }, { 9, 0, 1572 }, + { 9, 0, 1571 }, { 8, 0, 1570 }, { 8, 0, 1570 }, { 7, 0, 1571 }, { 6, 0, 1571 }, { 5, 0, 1572 }, + { 4, 0, 1573 }, { 3, 0, 1573 }, { 2, 0, 1574 }, { 1, 0, 1575 }, { 0, 0, 1575 }, { 0, 0, 1574 }, + { 0, 0, 1574 }, { 0, 0, 1573 }, { 0, 0, 1572 }, { 0, 0, 1571 }, { 0, 0, 1571 }, { 0, 0, 1571 }, + { 0, 0, 1572 }, { 0, 0, 1572 }, { 0, 0, 1574 }, { 0, 0, 1576 }, { 0, 0, 1578 }, { 0, 0, 1580 }, + { 0, 0, 1582 }, { 0, 0, 1585 }, { 0, 0, 1588 }, { 0, 0, 1591 }, { 0, 0, 1594 }, { 0, 0, 1597 }, + { 0, 0, 1600 }, { 0, 0, 1602 }, { 0, 0, 1605 }, { 0, 0, 1608 }, { 0, 0, 1610 }, { 0, 0, 1613 }, + { 0, 0, 1615 }, { 0, 0, 1616 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, { 0, 0, 1620 }, + { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1616 }, { 0, 0, 1614 }, { 0, 0, 1612 }, { 0, 0, 1610 }, + { 0, 0, 1607 }, { 0, 0, 1604 }, { 0, 0, 1601 }, { 0, 0, 1599 }, { 0, 0, 1596 }, { 0, 0, 1594 }, + { 0, 0, 1592 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1584 }, { 0, 0, 1579 }, { 0, 0, 1573 }, + { 0, 0, 1567 }, { 0, 0, 1562 }, { 0, 0, 1558 }, { 0, 0, 1557 }, { 0, 0, 1559 }, { 0, 0, 1565 }, + { 0, 0, 1575 }, { 0, 0, 1591 }, { 0, 0, 1628 }, { 0, 0, 1693 }, { 0, 0, 1770 }, { 0, 0, 1844 }, + { 0, 0, 1901 }, { 0, 0, 1923 }, { 0, 0, 1918 }, { 0, 0, 1903 }, { 0, 0, 1878 }, { 0, 0, 1847 }, + { 0, 0, 1812 }, { 0, 0, 1774 }, { 0, 0, 1736 }, { 0, 0, 1699 }, { 0, 0, 1666 }, { 0, 0, 1638 }, + { 0, 0, 1618 }, { 0, 0, 1608 }, { 0, 0, 1603 }, { 0, 0, 1599 }, { 0, 0, 1595 }, { 0, 0, 1591 }, + { 0, 0, 1588 }, { 0, 0, 1584 }, { 0, 0, 1581 }, { 0, 0, 1578 }, { 0, 0, 1576 }, { 0, 0, 1573 }, + { 0, 0, 1571 }, { 0, 0, 1569 }, { 0, 0, 1567 }, { 0, 0, 1565 }, { 0, 0, 1564 }, { 0, 0, 1563 }, + { 0, 0, 1562 }, { 0, 0, 1561 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1559 }, + { 0, 0, 1559 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1560 }, { 0, 0, 1561 }, { 0, 0, 1562 }, + { 0, 0, 1562 }, { 0, 0, 1563 }, { 0, 0, 1564 }, { 0, 0, 1566 }, { 0, 0, 1567 }, { 0, 0, 1568 }, + { 0, 0, 1570 }, { 0, 0, 1571 }, { 0, 0, 1573 }, { 0, 0, 1575 }, { 0, 0, 1576 }, { 0, 0, 1578 }, + { 0, 0, 1580 }, { 0, 0, 1582 }, { 0, 0, 1584 }, { 0, 0, 1586 }, { 0, 0, 1588 }, { 0, 0, 1590 }, + { 0, 0, 1593 }, { 0, 0, 1595 }, { 0, 0, 1597 }, { 0, 0, 1599 }, { 0, 0, 1601 }, { 0, 0, 1604 }, + { 0, 0, 1606 }, { 0, 0, 1608 }, { 0, 0, 1642 }, { 0, 0, 1703 }, { 0, 0, 1734 }, { 0, 0, 1731 }, + { 0, 0, 1726 }, { 0, 0, 1718 }, { 0, 0, 1709 }, { 0, 0, 1698 }, { 0, 0, 1686 }, { 0, 0, 1673 }, + { 0, 0, 1659 }, { 0, 0, 1646 }, { 0, 0, 1633 }, { 0, 0, 1621 }, { 0, 0, 1609 }, { 0, 0, 1599 }, + { 0, 0, 1591 }, { 0, 0, 1585 }, { 0, 0, 1581 }, { 0, 0, 1581 }, { 0, 0, 1622 }, { 0, 0, 1701 }, + { 0, 0, 1751 }, { 0, 0, 1764 }, { 0, 0, 1773 }, { 0, 0, 1778 }, { 0, 0, 1781 }, { 0, 0, 1782 }, + { 0, 0, 1782 }, { 0, 0, 1782 }, { 0, 0, 1782 }, { 0, 0, 1784 }, { 0, 0, 1787 }, { 0, 0, 1794 }, + { 0, 0, 1804 }, { 0, 0, 1833 }, { 0, 0, 1881 }, { 0, 0, 1926 }, { 0, 0, 1946 }, { 0, 0, 1941 }, + { 0, 0, 1928 }, { 0, 0, 1907 }, { 0, 0, 1881 }, { 0, 0, 1849 }, { 0, 0, 1815 }, { 0, 0, 1779 }, + { 0, 0, 1742 }, { 0, 0, 1707 }, { 0, 0, 1673 }, { 0, 0, 1644 }, { 0, 0, 1619 }, { 0, 0, 1601 }, + { 0, 0, 1591 }, { 0, 0, 1588 }, { 0, 0, 1590 }, { 0, 0, 1596 }, { 0, 0, 1606 }, { 0, 0, 1619 }, + { 0, 0, 1635 }, { 0, 0, 1652 }, { 0, 0, 1670 }, { 0, 0, 1689 }, { 0, 0, 1708 }, { 0, 0, 1726 }, + { 0, 0, 1742 }, { 0, 0, 1756 }, { 0, 0, 1767 }, { 0, 0, 1774 }, { 0, 0, 1779 }, { 0, 0, 1781 }, + { 0, 0, 1782 }, { 0, 0, 1781 }, { 0, 0, 1779 }, { 0, 0, 1776 }, { 0, 0, 1772 }, { 0, 0, 1768 }, + { 0, 0, 1764 }, { 0, 0, 1760 }, { 0, 0, 1757 }, { 0, 0, 1754 }, { 0, 0, 1752 }, { 0, 0, 1751 }, + { 0, 0, 1752 }, { 0, 0, 1752 }, { 0, 0, 1754 }, { 0, 0, 1755 }, { 0, 0, 1757 }, { 0, 0, 1759 }, + { 0, 0, 1762 }, { 0, 0, 1764 }, { 0, 0, 1766 }, { 0, 0, 1768 }, { 0, 0, 1770 }, { 0, 0, 1772 }, + { 0, 0, 1773 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1774 }, { 0, 0, 1773 }, { 0, 0, 1772 }, + { 0, 0, 1770 }, { 0, 0, 1768 }, { 0, 0, 1765 }, { 0, 0, 1763 }, { 0, 0, 1760 }, { 0, 0, 1758 }, + { 0, 0, 1756 }, { 0, 0, 1754 }, { 0, 0, 1753 }, { 0, 0, 1752 }, { 0, 0, 1751 }, { 0, 0, 1751 }, + { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1751 }, { 0, 0, 1752 }, + { 0, 0, 1754 }, { 0, 0, 1756 }, { 0, 0, 1759 }, { 0, 0, 1763 }, { 0, 0, 1768 }, { 0, 0, 1774 }, + { 0, 0, 1783 }, { 0, 0, 1794 }, { 0, 0, 1808 }, { 0, 0, 1823 }, { 0, 0, 1840 }, { 0, 0, 1857 }, + { 0, 0, 1874 }, { 0, 0, 1891 }, { 0, 0, 1906 }, { 0, 0, 1920 }, { 0, 0, 1932 }, { 0, 0, 1941 }, + { 0, 0, 1947 }, { 0, 0, 1949 }, { 0, 0, 1946 }, { 0, 0, 1939 }, { 0, 0, 1929 }, { 0, 0, 1915 }, + { 0, 0, 1898 }, { 0, 0, 1878 }, { 0, 0, 1857 }, { 0, 0, 1834 }, { 0, 0, 1810 }, { 0, 0, 1786 }, + { 0, 0, 1761 }, { 0, 0, 1737 }, { 0, 0, 1713 }, { 0, 0, 1691 }, { 0, 0, 1671 }, { 0, 0, 1652 }, + { 0, 0, 1636 }, { 0, 0, 1624 }, { 0, 0, 1615 }, { 0, 0, 1608 }, { 0, 0, 1602 }, { 0, 0, 1598 }, + { 0, 0, 1594 }, { 0, 0, 1591 }, { 0, 0, 1589 }, { 0, 0, 1587 }, { 0, 0, 1587 }, { 0, 0, 1587 }, + { 0, 0, 1587 }, { 0, 0, 1588 }, { 0, 0, 1589 }, { 0, 0, 1591 }, { 0, 0, 1593 }, { 0, 0, 1596 }, + { 0, 0, 1598 }, { 0, 0, 1601 }, { 0, 0, 1603 }, { 0, 0, 1606 }, { 0, 0, 1609 }, { 0, 0, 1611 }, + { 0, 0, 1613 }, { 0, 0, 1615 }, { 0, 0, 1617 }, { 0, 0, 1618 }, { 0, 0, 1619 }, { 0, 0, 1620 }, + { 0, 0, 1620 }, { 0, 0, 1619 }, { 0, 0, 1619 }, { 0, 0, 1618 }, { 0, 0, 1617 }, { 0, 0, 1616 }, + { 0, 0, 1616 }, { 0, 0, 1615 }, { 0, 0, 1614 }, { 0, 0, 1613 }, { 0, 0, 1612 }, { 0, 0, 1612 }, + { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1612 }, { 0, 0, 1613 }, { 0, 0, 1614 }, { 0, 0, 1615 }, + { 0, 0, 1617 }, { 0, 0, 1620 }, { 0, 0, 1622 }, { 0, 0, 1625 }, { 0, 0, 1628 }, { 0, 0, 1632 }, + { 0, 0, 1637 }, { 0, 0, 1642 }, { 0, 0, 1649 }, { 0, 0, 1657 }, { 0, 0, 1666 }, { 0, 0, 1677 }, + { 0, 0, 1690 }, { 0, 0, 1706 }, { 0, 0, 1728 }, { 0, 0, 1760 }, { 0, 0, 1798 }, { 0, 0, 1838 }, + { 0, 0, 1877 }, { 0, 0, 1910 }, { 0, 0, 1935 }, { 0, 0, 1946 }, { 0, 0, 1943 }, { 0, 0, 1927 }, + { 0, 0, 1902 }, { 0, 0, 1873 }, { 0, 0, 1841 }, { 0, 0, 1810 }, { 0, 0, 1785 }, { 0, 0, 1769 }, + { 0, 0, 1759 }, { 0, 0, 1752 }, { 0, 0, 1747 }, { 0, 0, 1744 }, { 0, 0, 1742 }, { 0, 0, 1742 }, + { 0, 0, 1742 }, { 0, 0, 1743 }, { 0, 0, 1743 }, { 0, 0, 1744 }, { 0, 0, 1743 }, { 0, 0, 1743 }, + { 0, 0, 1743 }, { 0, 0, 1744 }, { 0, 0, 1747 }, { 0, 0, 1752 }, { 0, 0, 1759 }, { 0, 0, 1769 }, + { 0, 0, 1783 }, { 0, 0, 1801 }, { 0, 0, 1823 }, { 0, 0, 1846 }, { 0, 0, 1870 }, { 0, 0, 1892 }, + { 0, 0, 1912 }, { 0, 0, 1929 }, { 0, 0, 1940 }, { 0, 0, 1948 }, { 0, 0, 1952 }, { 0, 0, 1954 }, + { 0, 0, 1954 }, { 0, 0, 1953 }, { 0, 0, 1951 }, { 0, 0, 1948 }, { 0, 0, 1946 }, { 0, 0, 1943 }, + { 0, 0, 1941 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, + { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1940 }, { 0, 0, 1947 }, { 0, 0, 1940 }, + { 0, 0, 1902 }, { 0, 0, 1852 }, { 0, 0, 1801 }, { 0, 0, 1762 }, { 0, 0, 1747 }, { 0, 0, 1851 }, + { 0, 0, 1942 }, { 0, 0, 1847 }, { 0, 0, 1698 }, { 0, 0, 1620 }, }; static s16 animdata_mario_eyelid_right_2[][3] = { - { 0, 0, 1763 }, { 0, 0, 1762 }, { 0, 0, 1761 }, { 0, 0, 1760 }, { 0, 0, 1757 }, { 0, 0, 1755 }, - { 0, 0, 1752 }, { 0, 0, 1749 }, { 0, 0, 1746 }, { 0, 0, 1744 }, { 0, 0, 1741 }, { 0, 0, 1739 }, - { 0, 0, 1737 }, { 0, 0, 1736 }, { 0, 0, 1736 }, { 0, 0, 1736 }, { 0, 0, 1738 }, { 0, 0, 1740 }, - { 0, 0, 1744 }, { 0, 0, 1749 }, { 0, 0, 1755 }, { 0, 0, 1763 }, { 0, 0, 1802 }, { 0, 0, 1876 }, - { 0, 0, 1948 }, { 0, 0, 1981 }, { 0, 0, 1958 }, { 0, 0, 1904 }, { 0, 0, 1839 }, { 0, 0, 1785 }, - { 0, 0, 1763 }, { 0, 0, 1757 }, { 0, 0, 1743 }, { 0, 0, 1726 }, { 0, 0, 1711 }, { 0, 0, 1706 }, - { 0, 0, 1707 }, { 0, 0, 1713 }, { 0, 0, 1720 }, { 0, 0, 1729 }, { 0, 0, 1739 }, { 0, 0, 1748 }, - { 0, 0, 1756 }, { 0, 0, 1761 }, { 0, 0, 1763 }, { 0, 0, 1762 }, { 0, 0, 1760 }, { 0, 0, 1758 }, - { 0, 0, 1754 }, { 0, 0, 1750 }, { 0, 0, 1745 }, { 0, 0, 1740 }, { 0, 0, 1734 }, { 0, 0, 1729 }, - { 0, 0, 1724 }, { 0, 0, 1719 }, { 0, 0, 1715 }, { 0, 0, 1712 }, { 0, 0, 1710 }, { 0, 0, 1708 }, - { 0, 0, 1708 }, { 0, 0, 1709 }, { 0, 0, 1712 }, { 0, 0, 1725 }, { 0, 0, 1751 }, { 0, 0, 1784 }, - { 0, 0, 1816 }, { 0, 0, 1842 }, { 0, 0, 1853 }, { 0, 0, 1855 }, { 0, 0, 1857 }, { 0, 0, 1859 }, - { 0, 0, 1860 }, { 0, 0, 1861 }, { 0, 0, 1863 }, { 0, 0, 1864 }, { 0, 0, 1864 }, { 0, 0, 1865 }, - { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1867 }, { 0, 0, 1867 }, { 0, 0, 1867 }, - { 0, 0, 1867 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1865 }, { 0, 0, 1865 }, - { 0, 0, 1864 }, { 0, 0, 1863 }, { 0, 0, 1863 }, { 0, 0, 1862 }, { 0, 0, 1861 }, { 0, 0, 1860 }, - { 0, 0, 1859 }, { 0, 0, 1858 }, { 0, 0, 1858 }, { 0, 0, 1857 }, { 0, 0, 1856 }, { 0, 0, 1855 }, - { 0, 0, 1854 }, { 0, 0, 1853 }, { 0, 0, 1852 }, { 0, 0, 1851 }, { 0, 0, 1850 }, { 0, 0, 1850 }, - { 0, 0, 1849 }, { 0, 0, 1848 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1846 }, { 0, 0, 1846 }, - { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, - { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1846 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1848 }, - { 0, 0, 1849 }, { 0, 0, 1850 }, { 0, 0, 1852 }, { 0, 0, 1853 }, { 0, 0, 1860 }, { 0, 0, 1875 }, - { 0, 0, 1894 }, { 0, 0, 1916 }, { 0, 0, 1937 }, { 0, 0, 1954 }, { 0, 0, 1964 }, { 0, 0, 1963 }, - { 0, 0, 1956 }, { 0, 0, 1947 }, { 0, 0, 1937 }, { 0, 0, 1925 }, { 0, 0, 1912 }, { 0, 0, 1899 }, - { 0, 0, 1884 }, { 0, 0, 1869 }, { 0, 0, 1853 }, { 0, 0, 1836 }, { 0, 0, 1819 }, { 0, 0, 1803 }, - { 0, 0, 1786 }, { 0, 0, 1769 }, { 0, 0, 1752 }, { 0, 0, 1736 }, { 0, 0, 1720 }, { 0, 0, 1705 }, - { 0, 0, 1691 }, { 0, 0, 1677 }, { 0, 0, 1665 }, { 0, 0, 1654 }, { 0, 0, 1644 }, { 0, 0, 1635 }, - { 0, 0, 1629 }, { 0, 0, 1624 }, { 0, 0, 1621 }, { 0, 0, 1620 }, + { 0, 0, 1763 }, { 0, 0, 1762 }, { 0, 0, 1761 }, { 0, 0, 1760 }, { 0, 0, 1757 }, { 0, 0, 1755 }, { 0, 0, 1752 }, + { 0, 0, 1749 }, { 0, 0, 1746 }, { 0, 0, 1744 }, { 0, 0, 1741 }, { 0, 0, 1739 }, { 0, 0, 1737 }, { 0, 0, 1736 }, + { 0, 0, 1736 }, { 0, 0, 1736 }, { 0, 0, 1738 }, { 0, 0, 1740 }, { 0, 0, 1744 }, { 0, 0, 1749 }, { 0, 0, 1755 }, + { 0, 0, 1763 }, { 0, 0, 1802 }, { 0, 0, 1876 }, { 0, 0, 1948 }, { 0, 0, 1981 }, { 0, 0, 1958 }, { 0, 0, 1904 }, + { 0, 0, 1839 }, { 0, 0, 1785 }, { 0, 0, 1763 }, { 0, 0, 1757 }, { 0, 0, 1743 }, { 0, 0, 1726 }, { 0, 0, 1711 }, + { 0, 0, 1706 }, { 0, 0, 1707 }, { 0, 0, 1713 }, { 0, 0, 1720 }, { 0, 0, 1729 }, { 0, 0, 1739 }, { 0, 0, 1748 }, + { 0, 0, 1756 }, { 0, 0, 1761 }, { 0, 0, 1763 }, { 0, 0, 1762 }, { 0, 0, 1760 }, { 0, 0, 1758 }, { 0, 0, 1754 }, + { 0, 0, 1750 }, { 0, 0, 1745 }, { 0, 0, 1740 }, { 0, 0, 1734 }, { 0, 0, 1729 }, { 0, 0, 1724 }, { 0, 0, 1719 }, + { 0, 0, 1715 }, { 0, 0, 1712 }, { 0, 0, 1710 }, { 0, 0, 1708 }, { 0, 0, 1708 }, { 0, 0, 1709 }, { 0, 0, 1712 }, + { 0, 0, 1725 }, { 0, 0, 1751 }, { 0, 0, 1784 }, { 0, 0, 1816 }, { 0, 0, 1842 }, { 0, 0, 1853 }, { 0, 0, 1855 }, + { 0, 0, 1857 }, { 0, 0, 1859 }, { 0, 0, 1860 }, { 0, 0, 1861 }, { 0, 0, 1863 }, { 0, 0, 1864 }, { 0, 0, 1864 }, + { 0, 0, 1865 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1867 }, { 0, 0, 1867 }, { 0, 0, 1867 }, + { 0, 0, 1867 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1866 }, { 0, 0, 1865 }, { 0, 0, 1865 }, { 0, 0, 1864 }, + { 0, 0, 1863 }, { 0, 0, 1863 }, { 0, 0, 1862 }, { 0, 0, 1861 }, { 0, 0, 1860 }, { 0, 0, 1859 }, { 0, 0, 1858 }, + { 0, 0, 1858 }, { 0, 0, 1857 }, { 0, 0, 1856 }, { 0, 0, 1855 }, { 0, 0, 1854 }, { 0, 0, 1853 }, { 0, 0, 1852 }, + { 0, 0, 1851 }, { 0, 0, 1850 }, { 0, 0, 1850 }, { 0, 0, 1849 }, { 0, 0, 1848 }, { 0, 0, 1847 }, { 0, 0, 1847 }, + { 0, 0, 1846 }, { 0, 0, 1846 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, + { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1845 }, { 0, 0, 1846 }, { 0, 0, 1847 }, { 0, 0, 1847 }, { 0, 0, 1848 }, + { 0, 0, 1849 }, { 0, 0, 1850 }, { 0, 0, 1852 }, { 0, 0, 1853 }, { 0, 0, 1860 }, { 0, 0, 1875 }, { 0, 0, 1894 }, + { 0, 0, 1916 }, { 0, 0, 1937 }, { 0, 0, 1954 }, { 0, 0, 1964 }, { 0, 0, 1963 }, { 0, 0, 1956 }, { 0, 0, 1947 }, + { 0, 0, 1937 }, { 0, 0, 1925 }, { 0, 0, 1912 }, { 0, 0, 1899 }, { 0, 0, 1884 }, { 0, 0, 1869 }, { 0, 0, 1853 }, + { 0, 0, 1836 }, { 0, 0, 1819 }, { 0, 0, 1803 }, { 0, 0, 1786 }, { 0, 0, 1769 }, { 0, 0, 1752 }, { 0, 0, 1736 }, + { 0, 0, 1720 }, { 0, 0, 1705 }, { 0, 0, 1691 }, { 0, 0, 1677 }, { 0, 0, 1665 }, { 0, 0, 1654 }, { 0, 0, 1644 }, + { 0, 0, 1635 }, { 0, 0, 1629 }, { 0, 0, 1624 }, { 0, 0, 1621 }, { 0, 0, 1620 }, }; struct AnimDataInfo anim_mario_eyelid_right[] = { diff --git a/src/goddard/dynlists/anim_mario_eyebrows_1.c b/src/goddard/dynlists/anim_mario_eyebrows_1.c index f0984144..cfaf25d3 100644 --- a/src/goddard/dynlists/anim_mario_eyebrows_1.c +++ b/src/goddard/dynlists/anim_mario_eyebrows_1.c @@ -172,40 +172,34 @@ static s16 animdata_mario_eyebrows_1_1[][3] = { }; static s16 animdata_mario_eyebrows_1_2[][3] = { - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, - { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1819 }, { -68, 5, 1818 }, { -68, 5, 1817 }, - { -68, 5, 1816 }, { -68, 4, 1815 }, { -68, 4, 1814 }, { -68, 4, 1813 }, { -68, 4, 1811 }, - { -68, 4, 1810 }, { -68, 4, 1809 }, { -68, 3, 1808 }, { -68, 3, 1807 }, { -68, 3, 1806 }, - { -68, 3, 1805 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, - { -68, 3, 1804 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, - { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, - { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, - { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1804 }, { -68, 3, 1804 }, - { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, - { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1805 }, { -68, 3, 1805 }, - { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, - { -68, 3, 1805 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, - { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, - { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, - { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, - { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1805 }, { -68, 3, 1805 }, - { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1804 }, { -68, 3, 1804 }, - { -68, 3, 1804 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1802 }, { -68, 3, 1801 }, - { -68, 3, 1801 }, { -68, 3, 1800 }, { -68, 2, 1799 }, { -68, 2, 1798 }, { -68, 2, 1797 }, - { -68, 2, 1796 }, { -68, 2, 1795 }, { -68, 2, 1794 }, { -68, 2, 1793 }, { -68, 2, 1792 }, - { -68, 1, 1790 }, { -68, 1, 1789 }, { -68, 1, 1788 }, { -68, 1, 1787 }, { -68, 1, 1786 }, - { -68, 1, 1785 }, { -68, 1, 1784 }, { -68, 0, 1783 }, { -68, 0, 1781 }, { -68, 0, 1781 }, - { -68, 0, 1780 }, { -68, 0, 1779 }, { -68, 0, 1778 }, { -68, 0, 1777 }, { -68, 0, 1777 }, - { -68, 0, 1776 }, { -68, 0, 1776 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, - { -68, 0, 1775 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, + { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1820 }, { -68, 5, 1819 }, + { -68, 5, 1818 }, { -68, 5, 1817 }, { -68, 5, 1816 }, { -68, 4, 1815 }, { -68, 4, 1814 }, { -68, 4, 1813 }, + { -68, 4, 1811 }, { -68, 4, 1810 }, { -68, 4, 1809 }, { -68, 3, 1808 }, { -68, 3, 1807 }, { -68, 3, 1806 }, + { -68, 3, 1805 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, + { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, + { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, + { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1803 }, { -68, 3, 1804 }, + { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, + { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, + { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, + { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1806 }, { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1805 }, + { -68, 3, 1805 }, { -68, 3, 1805 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1804 }, { -68, 3, 1803 }, + { -68, 3, 1803 }, { -68, 3, 1802 }, { -68, 3, 1801 }, { -68, 3, 1801 }, { -68, 3, 1800 }, { -68, 2, 1799 }, + { -68, 2, 1798 }, { -68, 2, 1797 }, { -68, 2, 1796 }, { -68, 2, 1795 }, { -68, 2, 1794 }, { -68, 2, 1793 }, + { -68, 2, 1792 }, { -68, 1, 1790 }, { -68, 1, 1789 }, { -68, 1, 1788 }, { -68, 1, 1787 }, { -68, 1, 1786 }, + { -68, 1, 1785 }, { -68, 1, 1784 }, { -68, 0, 1783 }, { -68, 0, 1781 }, { -68, 0, 1781 }, { -68, 0, 1780 }, + { -68, 0, 1779 }, { -68, 0, 1778 }, { -68, 0, 1777 }, { -68, 0, 1777 }, { -68, 0, 1776 }, { -68, 0, 1776 }, + { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, { -68, 0, 1775 }, }; struct AnimDataInfo anim_mario_eyebrows_1[] = { diff --git a/src/goddard/dynlists/anim_mario_lips_1.c b/src/goddard/dynlists/anim_mario_lips_1.c index 1d6d0e31..0c0f5978 100644 --- a/src/goddard/dynlists/anim_mario_lips_1.c +++ b/src/goddard/dynlists/anim_mario_lips_1.c @@ -5,211 +5,170 @@ #include "../gd_types.h" static s16 animdata_mario_lips_1_1[][3] = { - { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1817 }, - { -80, -6, 1817 }, { -80, -6, 1816 }, { -80, -6, 1815 }, { -80, -6, 1815 }, - { -80, -6, 1814 }, { -80, -6, 1813 }, { -80, -6, 1812 }, { -80, -6, 1812 }, - { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, - { -80, -7, 1812 }, { -80, -6, 1812 }, { -80, -6, 1813 }, { -80, -6, 1814 }, - { -80, -6, 1816 }, { -80, -6, 1818 }, { -80, -5, 1823 }, { -80, -4, 1833 }, - { -80, -2, 1845 }, { -80, 0, 1857 }, { -80, 1, 1869 }, { -80, 2, 1877 }, - { -80, 2, 1880 }, { -80, 2, 1879 }, { -80, 1, 1874 }, { -80, 0, 1868 }, - { -80, 0, 1860 }, { -80, -1, 1851 }, { -80, -2, 1842 }, { -80, -3, 1834 }, - { -80, -4, 1826 }, { -80, -5, 1821 }, { -80, -6, 1818 }, { -80, -6, 1817 }, - { -80, -6, 1815 }, { -80, -6, 1814 }, { -80, -6, 1813 }, { -80, -6, 1813 }, - { -80, -6, 1812 }, { -80, -7, 1812 }, { -80, -7, 1811 }, { -80, -7, 1811 }, - { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, - { -80, -6, 1812 }, { -80, -6, 1812 }, { -80, -6, 1813 }, { -80, -6, 1813 }, - { -80, -6, 1813 }, { -80, -6, 1814 }, { -80, -6, 1815 }, { -80, -6, 1815 }, - { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1817 }, - { -80, -6, 1817 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, - { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -81, -6, 1818 }, - { -82, -6, 1818 }, { -84, -6, 1818 }, { -85, -6, 1819 }, { -87, -6, 1819 }, - { -88, -6, 1819 }, { -90, -6, 1819 }, { -91, -6, 1819 }, { -92, -6, 1819 }, - { -93, -6, 1819 }, { -93, -6, 1819 }, { -93, -6, 1819 }, { -92, -6, 1819 }, - { -91, -6, 1819 }, { -89, -6, 1819 }, { -87, -6, 1819 }, { -84, -6, 1818 }, - { -80, -6, 1818 }, { -65, -5, 1817 }, { -38, -3, 1814 }, { -7, -2, 1811 }, - { 20, 0, 1808 }, { 34, 0, 1806 }, { 39, 0, 1806 }, { 43, 0, 1805 }, - { 46, 0, 1805 }, { 49, 1, 1805 }, { 52, 1, 1804 }, { 54, 1, 1804 }, - { 55, 1, 1804 }, { 56, 1, 1804 }, { 56, 1, 1804 }, { 56, 1, 1804 }, - { 55, 1, 1804 }, { 53, 1, 1804 }, { 51, 1, 1805 }, { 49, 1, 1805 }, - { 46, 0, 1805 }, { 42, 0, 1805 }, { 38, 0, 1806 }, { 34, 0, 1806 }, - { 23, 0, 1807 }, { 3, -1, 1809 }, { -21, -2, 1812 }, { -46, -4, 1815 }, - { -67, -5, 1817 }, { -80, -6, 1818 }, { -85, -6, 1819 }, { -89, -6, 1819 }, - { -90, -6, 1820 }, { -90, -6, 1820 }, { -90, -6, 1820 }, { -88, -6, 1820 }, - { -86, -6, 1820 }, { -84, -6, 1820 }, { -82, -6, 1820 }, { -80, -6, 1819 }, - { -80, -6, 1818 }, { -80, -6, 1816 }, { -79, -6, 1814 }, { -79, -6, 1812 }, - { -79, -7, 1809 }, { -79, -7, 1806 }, { -79, -8, 1803 }, { -79, -8, 1800 }, - { -79, -8, 1798 }, { -79, -9, 1796 }, { -79, -9, 1795 }, { -79, -9, 1795 }, - { -79, -9, 1795 }, { -79, -9, 1795 }, { -79, -9, 1796 }, { -79, -9, 1796 }, - { -79, -9, 1797 }, { -79, -8, 1797 }, { -79, -8, 1798 }, { -79, -8, 1799 }, - { -79, -8, 1800 }, { -79, -8, 1801 }, { -79, -8, 1802 }, { -79, -8, 1803 }, - { -79, -8, 1804 }, { -79, -7, 1805 }, { -79, -7, 1806 }, { -79, -7, 1806 }, - { -79, -7, 1807 }, { -79, -7, 1808 }, { -79, -7, 1808 }, { -79, -7, 1809 }, - { -79, -7, 1809 }, { -79, -7, 1809 }, { -79, -7, 1809 }, { -79, -7, 1806 }, - { -79, -8, 1801 }, { -79, -9, 1794 }, { -79, -10, 1790 }, { -79, -10, 1790 }, - { -79, -8, 1799 }, { -79, -6, 1814 }, { -80, -4, 1829 }, { -80, -3, 1837 }, - { -80, -3, 1837 }, { -80, -4, 1830 }, { -80, -5, 1822 }, { -80, -6, 1818 }, - { -80, -6, 1817 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, - { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1817 }, - { -80, -6, 1817 }, { -80, -6, 1817 }, { -80, -6, 1818 }, { -80, -6, 1818 }, - { -80, -6, 1818 }, { -79, -6, 1818 }, { -79, -6, 1816 }, { -79, -7, 1814 }, - { -79, -7, 1812 }, { -78, -8, 1809 }, { -78, -9, 1805 }, { -77, -10, 1802 }, - { -77, -11, 1798 }, { -76, -12, 1794 }, { -75, -13, 1791 }, { -75, -14, 1787 }, - { -74, -15, 1784 }, { -74, -16, 1781 }, { -74, -17, 1778 }, { -73, -17, 1777 }, - { -73, -18, 1776 }, { -73, -18, 1776 }, { -73, -18, 1776 }, { -74, -17, 1778 }, - { -74, -16, 1781 }, { -75, -15, 1786 }, { -76, -13, 1791 }, { -77, -11, 1799 }, - { -78, -9, 1807 }, { -80, -6, 1818 }, { -86, 6, 1861 }, { -99, 30, 1947 }, - { -114, 59, 2046 }, { -126, 82, 2127 }, { -131, 92, 2161 }, { -130, 88, 2149 }, - { -127, 79, 2117 }, { -123, 65, 2070 }, { -117, 49, 2014 }, { -110, 32, 1955 }, - { -101, 16, 1899 }, { -91, 3, 1851 }, { -80, -6, 1818 }, { -64, -11, 1799 }, - { -42, -13, 1789 }, { -18, -13, 1786 }, { 5, -12, 1787 }, { 27, -11, 1790 }, - { 43, -9, 1794 }, { 52, -9, 1795 }, { 55, -9, 1795 }, { 57, -9, 1794 }, - { 59, -9, 1793 }, { 60, -9, 1793 }, { 62, -9, 1792 }, { 62, -9, 1792 }, - { 63, -9, 1791 }, { 63, -9, 1790 }, { 62, -9, 1790 }, { 62, -9, 1789 }, - { 61, -9, 1789 }, { 60, -9, 1788 }, { 59, -9, 1787 }, { 58, -9, 1787 }, - { 56, -9, 1787 }, { 55, -9, 1786 }, { 53, -8, 1786 }, { 52, -8, 1786 }, - { 51, -8, 1785 }, { 49, -8, 1785 }, { 48, -8, 1785 }, { 46, -8, 1785 }, - { 45, -8, 1786 }, { 44, -8, 1786 }, { 44, -8, 1786 }, { 43, -8, 1787 }, - { 43, -8, 1787 }, { 43, -8, 1788 }, { 44, -8, 1789 }, { 44, -8, 1790 }, - { 45, -8, 1791 }, { 47, -9, 1792 }, { 49, -9, 1794 }, { 52, -9, 1795 }, - { 57, -9, 1798 }, { 66, -9, 1803 }, { 79, -10, 1810 }, { 94, -10, 1818 }, - { 110, -11, 1827 }, { 126, -11, 1836 }, { 142, -12, 1845 }, { 156, -13, 1853 }, - { 167, -14, 1860 }, { 174, -14, 1866 }, { 176, -15, 1869 }, { 174, -17, 1871 }, - { 170, -18, 1873 }, { 163, -20, 1874 }, { 155, -21, 1874 }, { 145, -23, 1874 }, - { 134, -25, 1874 }, { 123, -27, 1873 }, { 110, -29, 1872 }, { 98, -31, 1870 }, - { 86, -32, 1868 }, { 74, -34, 1866 }, { 64, -35, 1864 }, { 54, -36, 1861 }, - { 46, -36, 1858 }, { 40, -36, 1855 }, { 36, -35, 1852 }, { 35, -33, 1847 }, - { 35, -31, 1841 }, { 36, -27, 1834 }, { 39, -24, 1828 }, { 42, -20, 1820 }, - { 45, -17, 1813 }, { 48, -13, 1807 }, { 50, -11, 1801 }, { 52, -9, 1795 }, - { 52, -8, 1791 }, { 52, -7, 1786 }, { 53, -6, 1782 }, { 53, -5, 1778 }, - { 53, -5, 1774 }, { 53, -5, 1770 }, { 53, -5, 1767 }, { 52, -5, 1763 }, - { 52, -5, 1760 }, { 52, -5, 1756 }, { 52, -5, 1753 }, { 52, -5, 1750 }, - { 54, -4, 1746 }, { 58, -3, 1742 }, { 63, -2, 1738 }, { 66, -1, 1734 }, - { 67, -1, 1732 }, { 63, -1, 1731 }, { 52, -3, 1733 }, { 30, -7, 1738 }, - { -4, -13, 1749 }, { -45, -20, 1761 }, { -84, -26, 1773 }, { -116, -32, 1782 }, - { -132, -35, 1787 }, { -139, -36, 1788 }, { -144, -37, 1788 }, { -148, -38, 1788 }, - { -150, -39, 1788 }, { -152, -39, 1787 }, { -153, -40, 1786 }, { -153, -40, 1785 }, - { -152, -41, 1783 }, { -151, -41, 1781 }, { -149, -41, 1779 }, { -147, -41, 1778 }, - { -145, -41, 1776 }, { -143, -41, 1774 }, { -140, -40, 1772 }, { -138, -40, 1770 }, - { -136, -40, 1768 }, { -134, -40, 1767 }, { -132, -40, 1766 }, { -131, -40, 1765 }, - { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1763 }, - { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, - { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, - { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, - { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, - { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1763 }, - { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, - { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, - { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, - { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, - { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, - { -131, -40, 1763 }, { -131, -41, 1761 }, { -131, -42, 1757 }, { -131, -43, 1753 }, - { -131, -44, 1749 }, { -131, -45, 1745 }, { -131, -45, 1742 }, { -131, -46, 1741 }, - { -131, -45, 1743 }, { -131, -44, 1746 }, { -131, -43, 1753 }, { -131, -40, 1764 }, - { -131, -31, 1802 }, { -132, -15, 1869 }, { -134, 0, 1935 }, { -134, 9, 1971 }, - { -136, 10, 1978 }, { -140, 10, 1980 }, { -144, 9, 1976 }, { -149, 6, 1969 }, - { -153, 3, 1958 }, { -154, 0, 1945 }, { -153, -2, 1931 }, { -147, -5, 1917 }, - { -137, -7, 1904 }, { -109, -8, 1885 }, { -61, -8, 1857 }, { -9, -9, 1828 }, - { 33, -9, 1805 }, { 52, -9, 1795 }, { 53, -9, 1794 }, { 55, -9, 1793 }, - { 57, -9, 1792 }, { 59, -9, 1791 }, { 60, -9, 1790 }, { 62, -9, 1789 }, - { 63, -9, 1789 }, { 64, -9, 1788 }, { 66, -9, 1787 }, { 67, -9, 1786 }, - { 68, -9, 1786 }, { 69, -9, 1785 }, { 70, -9, 1785 }, { 71, -9, 1784 }, - { 72, -9, 1784 }, { 73, -9, 1783 }, { 73, -9, 1783 }, { 74, -9, 1782 }, - { 75, -9, 1782 }, { 75, -9, 1782 }, { 76, -9, 1781 }, { 76, -9, 1781 }, - { 77, -9, 1781 }, { 77, -9, 1781 }, { 77, -9, 1780 }, { 78, -9, 1780 }, - { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, - { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, - { 78, -9, 1780 }, { 78, -9, 1780 }, { 77, -9, 1780 }, { 77, -9, 1781 }, - { 77, -9, 1781 }, { 77, -9, 1781 }, { 76, -9, 1781 }, { 76, -9, 1781 }, - { 76, -9, 1782 }, { 75, -9, 1782 }, { 75, -9, 1782 }, { 74, -9, 1782 }, - { 74, -9, 1783 }, { 73, -9, 1783 }, { 73, -9, 1783 }, { 72, -9, 1783 }, - { 72, -9, 1784 }, { 71, -9, 1784 }, { 70, -9, 1784 }, { 70, -9, 1785 }, - { 69, -9, 1785 }, { 69, -9, 1785 }, { 68, -9, 1786 }, { 67, -9, 1786 }, - { 67, -9, 1787 }, { 66, -9, 1787 }, { 65, -9, 1787 }, { 65, -9, 1788 }, - { 64, -9, 1788 }, { 64, -9, 1788 }, { 63, -9, 1789 }, { 62, -9, 1789 }, - { 62, -9, 1789 }, { 61, -9, 1790 }, { 60, -9, 1790 }, { 60, -9, 1791 }, - { 59, -9, 1791 }, { 59, -9, 1791 }, { 58, -9, 1792 }, { 58, -9, 1792 }, - { 57, -9, 1792 }, { 56, -9, 1792 }, { 56, -9, 1793 }, { 55, -9, 1793 }, - { 55, -9, 1793 }, { 55, -9, 1794 }, { 54, -9, 1794 }, { 54, -9, 1794 }, - { 53, -9, 1794 }, { 53, -9, 1794 }, { 53, -9, 1795 }, { 52, -9, 1795 }, - { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, - { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, - { 52, -9, 1795 }, { 53, -9, 1795 }, { 54, -9, 1794 }, { 55, -9, 1794 }, - { 56, -9, 1794 }, { 57, -9, 1794 }, { 57, -9, 1793 }, { 58, -9, 1793 }, - { 58, -9, 1793 }, { 57, -9, 1793 }, { 56, -9, 1794 }, { 54, -9, 1794 }, - { 52, -9, 1795 }, { 48, -9, 1796 }, { 43, -9, 1798 }, { 37, -9, 1800 }, - { 30, -9, 1802 }, { 23, -10, 1805 }, { 15, -10, 1807 }, { 7, -10, 1810 }, - { 0, -10, 1813 }, { -8, -11, 1815 }, { -15, -11, 1818 }, { -21, -11, 1820 }, - { -26, -11, 1821 }, { -30, -11, 1823 }, { -33, -11, 1824 }, { -34, -11, 1824 }, - { -33, -11, 1823 }, { -29, -11, 1822 }, { -24, -11, 1820 }, { -17, -11, 1818 }, - { -9, -11, 1815 }, { 0, -10, 1813 }, { 8, -10, 1810 }, { 18, -10, 1807 }, - { 26, -10, 1804 }, { 34, -9, 1801 }, { 41, -9, 1799 }, { 47, -9, 1797 }, - { 50, -9, 1796 }, { 52, -9, 1795 }, { 50, -9, 1796 }, { 47, -9, 1797 }, - { 43, -9, 1798 }, { 36, -9, 1800 }, { 29, -9, 1803 }, { 21, -10, 1805 }, - { 13, -10, 1808 }, { 4, -10, 1811 }, { -3, -10, 1814 }, { -11, -11, 1816 }, - { -19, -11, 1819 }, { -25, -11, 1821 }, { -30, -11, 1822 }, { -33, -11, 1823 }, - { -34, -11, 1824 }, { -33, -11, 1823 }, { -29, -11, 1822 }, { -24, -11, 1820 }, - { -17, -11, 1818 }, { -9, -11, 1815 }, { 0, -10, 1813 }, { 8, -10, 1810 }, - { 18, -10, 1807 }, { 26, -10, 1804 }, { 34, -9, 1801 }, { 41, -9, 1799 }, - { 47, -9, 1797 }, { 50, -9, 1796 }, { 52, -9, 1795 }, { 50, -9, 1796 }, - { 46, -9, 1797 }, { 40, -9, 1799 }, { 32, -9, 1802 }, { 23, -10, 1805 }, - { 13, -10, 1808 }, { 3, -10, 1811 }, { -5, -11, 1814 }, { -14, -11, 1817 }, - { -22, -11, 1820 }, { -28, -11, 1822 }, { -32, -11, 1823 }, { -34, -11, 1824 }, - { -33, -11, 1824 }, { -30, -11, 1823 }, { -25, -11, 1821 }, { -18, -11, 1820 }, - { -11, -11, 1818 }, { -3, -11, 1816 }, { 5, -10, 1813 }, { 14, -10, 1811 }, - { 22, -10, 1808 }, { 31, -10, 1805 }, { 38, -9, 1803 }, { 44, -9, 1801 }, - { 48, -9, 1798 }, { 51, -9, 1797 }, { 52, -9, 1795 }, { 50, -9, 1794 }, - { 47, -9, 1793 }, { 43, -9, 1792 }, { 37, -9, 1791 }, { 31, -9, 1789 }, - { 24, -9, 1788 }, { 16, -9, 1787 }, { 8, -9, 1787 }, { 0, -9, 1786 }, - { -8, -9, 1785 }, { -17, -9, 1785 }, { -25, -9, 1784 }, { -32, -9, 1784 }, - { -39, -9, 1784 }, { -45, -9, 1784 }, { -50, -9, 1784 }, { -54, -9, 1785 }, - { -56, -9, 1785 }, { -59, -9, 1786 }, { -61, -9, 1787 }, { -63, -8, 1788 }, - { -65, -8, 1789 }, { -67, -8, 1790 }, { -69, -8, 1791 }, { -70, -8, 1792 }, - { -71, -8, 1793 }, { -72, -8, 1795 }, { -73, -8, 1796 }, { -74, -7, 1798 }, - { -74, -7, 1799 }, { -75, -7, 1801 }, { -75, -7, 1802 }, { -76, -7, 1804 }, - { -76, -7, 1805 }, { -77, -7, 1807 }, { -77, -7, 1808 }, { -77, -6, 1809 }, - { -77, -6, 1811 }, { -77, -6, 1812 }, { -78, -6, 1813 }, { -78, -6, 1814 }, - { -78, -6, 1815 }, { -79, -6, 1816 }, { -79, -6, 1817 }, { -80, -6, 1818 }, - { -80, -6, 1819 }, { -82, -6, 1819 }, { -84, -6, 1819 }, { -86, -6, 1819 }, - { -89, -6, 1819 }, { -92, -6, 1819 }, { -94, -6, 1819 }, { -97, -6, 1819 }, - { -99, -6, 1818 }, { -102, -6, 1818 }, { -103, -6, 1818 }, { -104, -6, 1817 }, - { -105, -6, 1817 }, { -104, -6, 1817 }, { -103, -6, 1817 }, { -101, -6, 1817 }, - { -98, -6, 1817 }, { -93, -6, 1817 }, { -87, -6, 1817 }, { -80, -6, 1818 }, - { -68, -5, 1819 }, { -51, -5, 1821 }, { -30, -5, 1823 }, { -5, -4, 1826 }, - { 21, -4, 1829 }, { 50, -3, 1831 }, { 78, -3, 1834 }, { 105, -3, 1836 }, - { 131, -2, 1838 }, { 153, -2, 1839 }, { 171, -1, 1840 }, { 184, -1, 1839 }, - { 193, -1, 1837 }, { 200, -1, 1834 }, { 206, -1, 1831 }, { 210, 0, 1827 }, - { 214, 0, 1822 }, { 216, 0, 1818 }, { 217, 0, 1813 }, { 218, 0, 1808 }, - { 218, 0, 1803 }, { 217, 0, 1798 }, { 216, 0, 1793 }, { 215, 0, 1788 }, - { 214, 0, 1784 }, { 212, 0, 1781 }, { 211, 0, 1778 }, { 210, 0, 1775 }, - { 209, 0, 1774 }, { 209, 0, 1773 }, { 208, 0, 1774 }, { 208, 0, 1774 }, - { 208, 0, 1776 }, { 207, 0, 1778 }, { 206, 0, 1780 }, { 205, 0, 1783 }, - { 204, 0, 1786 }, { 203, 0, 1789 }, { 202, -1, 1792 }, { 201, -1, 1796 }, - { 199, -1, 1800 }, { 198, -1, 1804 }, { 197, -1, 1808 }, { 195, -2, 1812 }, - { 194, -2, 1816 }, { 192, -2, 1819 }, { 191, -2, 1823 }, { 190, -2, 1826 }, - { 188, -2, 1830 }, { 187, -2, 1832 }, { 186, -2, 1835 }, { 185, -1, 1837 }, - { 184, -1, 1839 }, { 183, 0, 1835 }, { 183, 2, 1826 }, { 183, 6, 1816 }, - { 184, 7, 1811 }, { 184, 5, 1818 }, { 184, 0, 1831 }, { 184, -1, 1839 }, - { 184, 0, 1834 }, { 184, 3, 1824 }, { 184, 5, 1817 }, { 184, 5, 1819 }, - { 184, 3, 1824 }, { 184, 1, 1828 }, { 184, 1, 1829 }, { 184, 1, 1829 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, - { 189, 2, 1828 }, { 184, 1, 1828 }, { 158, 1, 1827 }, { 128, 0, 1826 }, - { 94, 0, 1824 }, { 59, -1, 1823 }, { 24, -2, 1822 }, { -8, -3, 1821 }, - { -36, -4, 1820 }, { -59, -5, 1819 }, { -74, -5, 1818 }, { -80, -6, 1818 }, + { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1817 }, { -80, -6, 1817 }, + { -80, -6, 1816 }, { -80, -6, 1815 }, { -80, -6, 1815 }, { -80, -6, 1814 }, { -80, -6, 1813 }, + { -80, -6, 1812 }, { -80, -6, 1812 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, + { -80, -7, 1811 }, { -80, -7, 1812 }, { -80, -6, 1812 }, { -80, -6, 1813 }, { -80, -6, 1814 }, + { -80, -6, 1816 }, { -80, -6, 1818 }, { -80, -5, 1823 }, { -80, -4, 1833 }, { -80, -2, 1845 }, + { -80, 0, 1857 }, { -80, 1, 1869 }, { -80, 2, 1877 }, { -80, 2, 1880 }, { -80, 2, 1879 }, + { -80, 1, 1874 }, { -80, 0, 1868 }, { -80, 0, 1860 }, { -80, -1, 1851 }, { -80, -2, 1842 }, + { -80, -3, 1834 }, { -80, -4, 1826 }, { -80, -5, 1821 }, { -80, -6, 1818 }, { -80, -6, 1817 }, + { -80, -6, 1815 }, { -80, -6, 1814 }, { -80, -6, 1813 }, { -80, -6, 1813 }, { -80, -6, 1812 }, + { -80, -7, 1812 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -7, 1811 }, + { -80, -7, 1811 }, { -80, -7, 1811 }, { -80, -6, 1812 }, { -80, -6, 1812 }, { -80, -6, 1813 }, + { -80, -6, 1813 }, { -80, -6, 1813 }, { -80, -6, 1814 }, { -80, -6, 1815 }, { -80, -6, 1815 }, + { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1817 }, { -80, -6, 1817 }, + { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, + { -80, -6, 1818 }, { -81, -6, 1818 }, { -82, -6, 1818 }, { -84, -6, 1818 }, { -85, -6, 1819 }, + { -87, -6, 1819 }, { -88, -6, 1819 }, { -90, -6, 1819 }, { -91, -6, 1819 }, { -92, -6, 1819 }, + { -93, -6, 1819 }, { -93, -6, 1819 }, { -93, -6, 1819 }, { -92, -6, 1819 }, { -91, -6, 1819 }, + { -89, -6, 1819 }, { -87, -6, 1819 }, { -84, -6, 1818 }, { -80, -6, 1818 }, { -65, -5, 1817 }, + { -38, -3, 1814 }, { -7, -2, 1811 }, { 20, 0, 1808 }, { 34, 0, 1806 }, { 39, 0, 1806 }, + { 43, 0, 1805 }, { 46, 0, 1805 }, { 49, 1, 1805 }, { 52, 1, 1804 }, { 54, 1, 1804 }, + { 55, 1, 1804 }, { 56, 1, 1804 }, { 56, 1, 1804 }, { 56, 1, 1804 }, { 55, 1, 1804 }, + { 53, 1, 1804 }, { 51, 1, 1805 }, { 49, 1, 1805 }, { 46, 0, 1805 }, { 42, 0, 1805 }, + { 38, 0, 1806 }, { 34, 0, 1806 }, { 23, 0, 1807 }, { 3, -1, 1809 }, { -21, -2, 1812 }, + { -46, -4, 1815 }, { -67, -5, 1817 }, { -80, -6, 1818 }, { -85, -6, 1819 }, { -89, -6, 1819 }, + { -90, -6, 1820 }, { -90, -6, 1820 }, { -90, -6, 1820 }, { -88, -6, 1820 }, { -86, -6, 1820 }, + { -84, -6, 1820 }, { -82, -6, 1820 }, { -80, -6, 1819 }, { -80, -6, 1818 }, { -80, -6, 1816 }, + { -79, -6, 1814 }, { -79, -6, 1812 }, { -79, -7, 1809 }, { -79, -7, 1806 }, { -79, -8, 1803 }, + { -79, -8, 1800 }, { -79, -8, 1798 }, { -79, -9, 1796 }, { -79, -9, 1795 }, { -79, -9, 1795 }, + { -79, -9, 1795 }, { -79, -9, 1795 }, { -79, -9, 1796 }, { -79, -9, 1796 }, { -79, -9, 1797 }, + { -79, -8, 1797 }, { -79, -8, 1798 }, { -79, -8, 1799 }, { -79, -8, 1800 }, { -79, -8, 1801 }, + { -79, -8, 1802 }, { -79, -8, 1803 }, { -79, -8, 1804 }, { -79, -7, 1805 }, { -79, -7, 1806 }, + { -79, -7, 1806 }, { -79, -7, 1807 }, { -79, -7, 1808 }, { -79, -7, 1808 }, { -79, -7, 1809 }, + { -79, -7, 1809 }, { -79, -7, 1809 }, { -79, -7, 1809 }, { -79, -7, 1806 }, { -79, -8, 1801 }, + { -79, -9, 1794 }, { -79, -10, 1790 }, { -79, -10, 1790 }, { -79, -8, 1799 }, { -79, -6, 1814 }, + { -80, -4, 1829 }, { -80, -3, 1837 }, { -80, -3, 1837 }, { -80, -4, 1830 }, { -80, -5, 1822 }, + { -80, -6, 1818 }, { -80, -6, 1817 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, + { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1816 }, { -80, -6, 1817 }, { -80, -6, 1817 }, + { -80, -6, 1817 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -80, -6, 1818 }, { -79, -6, 1818 }, + { -79, -6, 1816 }, { -79, -7, 1814 }, { -79, -7, 1812 }, { -78, -8, 1809 }, { -78, -9, 1805 }, + { -77, -10, 1802 }, { -77, -11, 1798 }, { -76, -12, 1794 }, { -75, -13, 1791 }, { -75, -14, 1787 }, + { -74, -15, 1784 }, { -74, -16, 1781 }, { -74, -17, 1778 }, { -73, -17, 1777 }, { -73, -18, 1776 }, + { -73, -18, 1776 }, { -73, -18, 1776 }, { -74, -17, 1778 }, { -74, -16, 1781 }, { -75, -15, 1786 }, + { -76, -13, 1791 }, { -77, -11, 1799 }, { -78, -9, 1807 }, { -80, -6, 1818 }, { -86, 6, 1861 }, + { -99, 30, 1947 }, { -114, 59, 2046 }, { -126, 82, 2127 }, { -131, 92, 2161 }, { -130, 88, 2149 }, + { -127, 79, 2117 }, { -123, 65, 2070 }, { -117, 49, 2014 }, { -110, 32, 1955 }, { -101, 16, 1899 }, + { -91, 3, 1851 }, { -80, -6, 1818 }, { -64, -11, 1799 }, { -42, -13, 1789 }, { -18, -13, 1786 }, + { 5, -12, 1787 }, { 27, -11, 1790 }, { 43, -9, 1794 }, { 52, -9, 1795 }, { 55, -9, 1795 }, + { 57, -9, 1794 }, { 59, -9, 1793 }, { 60, -9, 1793 }, { 62, -9, 1792 }, { 62, -9, 1792 }, + { 63, -9, 1791 }, { 63, -9, 1790 }, { 62, -9, 1790 }, { 62, -9, 1789 }, { 61, -9, 1789 }, + { 60, -9, 1788 }, { 59, -9, 1787 }, { 58, -9, 1787 }, { 56, -9, 1787 }, { 55, -9, 1786 }, + { 53, -8, 1786 }, { 52, -8, 1786 }, { 51, -8, 1785 }, { 49, -8, 1785 }, { 48, -8, 1785 }, + { 46, -8, 1785 }, { 45, -8, 1786 }, { 44, -8, 1786 }, { 44, -8, 1786 }, { 43, -8, 1787 }, + { 43, -8, 1787 }, { 43, -8, 1788 }, { 44, -8, 1789 }, { 44, -8, 1790 }, { 45, -8, 1791 }, + { 47, -9, 1792 }, { 49, -9, 1794 }, { 52, -9, 1795 }, { 57, -9, 1798 }, { 66, -9, 1803 }, + { 79, -10, 1810 }, { 94, -10, 1818 }, { 110, -11, 1827 }, { 126, -11, 1836 }, { 142, -12, 1845 }, + { 156, -13, 1853 }, { 167, -14, 1860 }, { 174, -14, 1866 }, { 176, -15, 1869 }, { 174, -17, 1871 }, + { 170, -18, 1873 }, { 163, -20, 1874 }, { 155, -21, 1874 }, { 145, -23, 1874 }, { 134, -25, 1874 }, + { 123, -27, 1873 }, { 110, -29, 1872 }, { 98, -31, 1870 }, { 86, -32, 1868 }, { 74, -34, 1866 }, + { 64, -35, 1864 }, { 54, -36, 1861 }, { 46, -36, 1858 }, { 40, -36, 1855 }, { 36, -35, 1852 }, + { 35, -33, 1847 }, { 35, -31, 1841 }, { 36, -27, 1834 }, { 39, -24, 1828 }, { 42, -20, 1820 }, + { 45, -17, 1813 }, { 48, -13, 1807 }, { 50, -11, 1801 }, { 52, -9, 1795 }, { 52, -8, 1791 }, + { 52, -7, 1786 }, { 53, -6, 1782 }, { 53, -5, 1778 }, { 53, -5, 1774 }, { 53, -5, 1770 }, + { 53, -5, 1767 }, { 52, -5, 1763 }, { 52, -5, 1760 }, { 52, -5, 1756 }, { 52, -5, 1753 }, + { 52, -5, 1750 }, { 54, -4, 1746 }, { 58, -3, 1742 }, { 63, -2, 1738 }, { 66, -1, 1734 }, + { 67, -1, 1732 }, { 63, -1, 1731 }, { 52, -3, 1733 }, { 30, -7, 1738 }, { -4, -13, 1749 }, + { -45, -20, 1761 }, { -84, -26, 1773 }, { -116, -32, 1782 }, { -132, -35, 1787 }, { -139, -36, 1788 }, + { -144, -37, 1788 }, { -148, -38, 1788 }, { -150, -39, 1788 }, { -152, -39, 1787 }, { -153, -40, 1786 }, + { -153, -40, 1785 }, { -152, -41, 1783 }, { -151, -41, 1781 }, { -149, -41, 1779 }, { -147, -41, 1778 }, + { -145, -41, 1776 }, { -143, -41, 1774 }, { -140, -40, 1772 }, { -138, -40, 1770 }, { -136, -40, 1768 }, + { -134, -40, 1767 }, { -132, -40, 1766 }, { -131, -40, 1765 }, { -131, -40, 1764 }, { -131, -40, 1764 }, + { -131, -40, 1764 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, + { -131, -40, 1763 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, + { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, { -131, -41, 1762 }, + { -131, -41, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, { -131, -40, 1762 }, + { -131, -40, 1762 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, + { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, { -131, -40, 1763 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1764 }, + { -131, -40, 1764 }, { -131, -40, 1764 }, { -131, -40, 1763 }, { -131, -41, 1761 }, { -131, -42, 1757 }, + { -131, -43, 1753 }, { -131, -44, 1749 }, { -131, -45, 1745 }, { -131, -45, 1742 }, { -131, -46, 1741 }, + { -131, -45, 1743 }, { -131, -44, 1746 }, { -131, -43, 1753 }, { -131, -40, 1764 }, { -131, -31, 1802 }, + { -132, -15, 1869 }, { -134, 0, 1935 }, { -134, 9, 1971 }, { -136, 10, 1978 }, { -140, 10, 1980 }, + { -144, 9, 1976 }, { -149, 6, 1969 }, { -153, 3, 1958 }, { -154, 0, 1945 }, { -153, -2, 1931 }, + { -147, -5, 1917 }, { -137, -7, 1904 }, { -109, -8, 1885 }, { -61, -8, 1857 }, { -9, -9, 1828 }, + { 33, -9, 1805 }, { 52, -9, 1795 }, { 53, -9, 1794 }, { 55, -9, 1793 }, { 57, -9, 1792 }, + { 59, -9, 1791 }, { 60, -9, 1790 }, { 62, -9, 1789 }, { 63, -9, 1789 }, { 64, -9, 1788 }, + { 66, -9, 1787 }, { 67, -9, 1786 }, { 68, -9, 1786 }, { 69, -9, 1785 }, { 70, -9, 1785 }, + { 71, -9, 1784 }, { 72, -9, 1784 }, { 73, -9, 1783 }, { 73, -9, 1783 }, { 74, -9, 1782 }, + { 75, -9, 1782 }, { 75, -9, 1782 }, { 76, -9, 1781 }, { 76, -9, 1781 }, { 77, -9, 1781 }, + { 77, -9, 1781 }, { 77, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, + { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, + { 78, -9, 1780 }, { 78, -9, 1780 }, { 78, -9, 1780 }, { 77, -9, 1780 }, { 77, -9, 1781 }, + { 77, -9, 1781 }, { 77, -9, 1781 }, { 76, -9, 1781 }, { 76, -9, 1781 }, { 76, -9, 1782 }, + { 75, -9, 1782 }, { 75, -9, 1782 }, { 74, -9, 1782 }, { 74, -9, 1783 }, { 73, -9, 1783 }, + { 73, -9, 1783 }, { 72, -9, 1783 }, { 72, -9, 1784 }, { 71, -9, 1784 }, { 70, -9, 1784 }, + { 70, -9, 1785 }, { 69, -9, 1785 }, { 69, -9, 1785 }, { 68, -9, 1786 }, { 67, -9, 1786 }, + { 67, -9, 1787 }, { 66, -9, 1787 }, { 65, -9, 1787 }, { 65, -9, 1788 }, { 64, -9, 1788 }, + { 64, -9, 1788 }, { 63, -9, 1789 }, { 62, -9, 1789 }, { 62, -9, 1789 }, { 61, -9, 1790 }, + { 60, -9, 1790 }, { 60, -9, 1791 }, { 59, -9, 1791 }, { 59, -9, 1791 }, { 58, -9, 1792 }, + { 58, -9, 1792 }, { 57, -9, 1792 }, { 56, -9, 1792 }, { 56, -9, 1793 }, { 55, -9, 1793 }, + { 55, -9, 1793 }, { 55, -9, 1794 }, { 54, -9, 1794 }, { 54, -9, 1794 }, { 53, -9, 1794 }, + { 53, -9, 1794 }, { 53, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, + { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, { 52, -9, 1795 }, + { 52, -9, 1795 }, { 52, -9, 1795 }, { 53, -9, 1795 }, { 54, -9, 1794 }, { 55, -9, 1794 }, + { 56, -9, 1794 }, { 57, -9, 1794 }, { 57, -9, 1793 }, { 58, -9, 1793 }, { 58, -9, 1793 }, + { 57, -9, 1793 }, { 56, -9, 1794 }, { 54, -9, 1794 }, { 52, -9, 1795 }, { 48, -9, 1796 }, + { 43, -9, 1798 }, { 37, -9, 1800 }, { 30, -9, 1802 }, { 23, -10, 1805 }, { 15, -10, 1807 }, + { 7, -10, 1810 }, { 0, -10, 1813 }, { -8, -11, 1815 }, { -15, -11, 1818 }, { -21, -11, 1820 }, + { -26, -11, 1821 }, { -30, -11, 1823 }, { -33, -11, 1824 }, { -34, -11, 1824 }, { -33, -11, 1823 }, + { -29, -11, 1822 }, { -24, -11, 1820 }, { -17, -11, 1818 }, { -9, -11, 1815 }, { 0, -10, 1813 }, + { 8, -10, 1810 }, { 18, -10, 1807 }, { 26, -10, 1804 }, { 34, -9, 1801 }, { 41, -9, 1799 }, + { 47, -9, 1797 }, { 50, -9, 1796 }, { 52, -9, 1795 }, { 50, -9, 1796 }, { 47, -9, 1797 }, + { 43, -9, 1798 }, { 36, -9, 1800 }, { 29, -9, 1803 }, { 21, -10, 1805 }, { 13, -10, 1808 }, + { 4, -10, 1811 }, { -3, -10, 1814 }, { -11, -11, 1816 }, { -19, -11, 1819 }, { -25, -11, 1821 }, + { -30, -11, 1822 }, { -33, -11, 1823 }, { -34, -11, 1824 }, { -33, -11, 1823 }, { -29, -11, 1822 }, + { -24, -11, 1820 }, { -17, -11, 1818 }, { -9, -11, 1815 }, { 0, -10, 1813 }, { 8, -10, 1810 }, + { 18, -10, 1807 }, { 26, -10, 1804 }, { 34, -9, 1801 }, { 41, -9, 1799 }, { 47, -9, 1797 }, + { 50, -9, 1796 }, { 52, -9, 1795 }, { 50, -9, 1796 }, { 46, -9, 1797 }, { 40, -9, 1799 }, + { 32, -9, 1802 }, { 23, -10, 1805 }, { 13, -10, 1808 }, { 3, -10, 1811 }, { -5, -11, 1814 }, + { -14, -11, 1817 }, { -22, -11, 1820 }, { -28, -11, 1822 }, { -32, -11, 1823 }, { -34, -11, 1824 }, + { -33, -11, 1824 }, { -30, -11, 1823 }, { -25, -11, 1821 }, { -18, -11, 1820 }, { -11, -11, 1818 }, + { -3, -11, 1816 }, { 5, -10, 1813 }, { 14, -10, 1811 }, { 22, -10, 1808 }, { 31, -10, 1805 }, + { 38, -9, 1803 }, { 44, -9, 1801 }, { 48, -9, 1798 }, { 51, -9, 1797 }, { 52, -9, 1795 }, + { 50, -9, 1794 }, { 47, -9, 1793 }, { 43, -9, 1792 }, { 37, -9, 1791 }, { 31, -9, 1789 }, + { 24, -9, 1788 }, { 16, -9, 1787 }, { 8, -9, 1787 }, { 0, -9, 1786 }, { -8, -9, 1785 }, + { -17, -9, 1785 }, { -25, -9, 1784 }, { -32, -9, 1784 }, { -39, -9, 1784 }, { -45, -9, 1784 }, + { -50, -9, 1784 }, { -54, -9, 1785 }, { -56, -9, 1785 }, { -59, -9, 1786 }, { -61, -9, 1787 }, + { -63, -8, 1788 }, { -65, -8, 1789 }, { -67, -8, 1790 }, { -69, -8, 1791 }, { -70, -8, 1792 }, + { -71, -8, 1793 }, { -72, -8, 1795 }, { -73, -8, 1796 }, { -74, -7, 1798 }, { -74, -7, 1799 }, + { -75, -7, 1801 }, { -75, -7, 1802 }, { -76, -7, 1804 }, { -76, -7, 1805 }, { -77, -7, 1807 }, + { -77, -7, 1808 }, { -77, -6, 1809 }, { -77, -6, 1811 }, { -77, -6, 1812 }, { -78, -6, 1813 }, + { -78, -6, 1814 }, { -78, -6, 1815 }, { -79, -6, 1816 }, { -79, -6, 1817 }, { -80, -6, 1818 }, + { -80, -6, 1819 }, { -82, -6, 1819 }, { -84, -6, 1819 }, { -86, -6, 1819 }, { -89, -6, 1819 }, + { -92, -6, 1819 }, { -94, -6, 1819 }, { -97, -6, 1819 }, { -99, -6, 1818 }, { -102, -6, 1818 }, + { -103, -6, 1818 }, { -104, -6, 1817 }, { -105, -6, 1817 }, { -104, -6, 1817 }, { -103, -6, 1817 }, + { -101, -6, 1817 }, { -98, -6, 1817 }, { -93, -6, 1817 }, { -87, -6, 1817 }, { -80, -6, 1818 }, + { -68, -5, 1819 }, { -51, -5, 1821 }, { -30, -5, 1823 }, { -5, -4, 1826 }, { 21, -4, 1829 }, + { 50, -3, 1831 }, { 78, -3, 1834 }, { 105, -3, 1836 }, { 131, -2, 1838 }, { 153, -2, 1839 }, + { 171, -1, 1840 }, { 184, -1, 1839 }, { 193, -1, 1837 }, { 200, -1, 1834 }, { 206, -1, 1831 }, + { 210, 0, 1827 }, { 214, 0, 1822 }, { 216, 0, 1818 }, { 217, 0, 1813 }, { 218, 0, 1808 }, + { 218, 0, 1803 }, { 217, 0, 1798 }, { 216, 0, 1793 }, { 215, 0, 1788 }, { 214, 0, 1784 }, + { 212, 0, 1781 }, { 211, 0, 1778 }, { 210, 0, 1775 }, { 209, 0, 1774 }, { 209, 0, 1773 }, + { 208, 0, 1774 }, { 208, 0, 1774 }, { 208, 0, 1776 }, { 207, 0, 1778 }, { 206, 0, 1780 }, + { 205, 0, 1783 }, { 204, 0, 1786 }, { 203, 0, 1789 }, { 202, -1, 1792 }, { 201, -1, 1796 }, + { 199, -1, 1800 }, { 198, -1, 1804 }, { 197, -1, 1808 }, { 195, -2, 1812 }, { 194, -2, 1816 }, + { 192, -2, 1819 }, { 191, -2, 1823 }, { 190, -2, 1826 }, { 188, -2, 1830 }, { 187, -2, 1832 }, + { 186, -2, 1835 }, { 185, -1, 1837 }, { 184, -1, 1839 }, { 183, 0, 1835 }, { 183, 2, 1826 }, + { 183, 6, 1816 }, { 184, 7, 1811 }, { 184, 5, 1818 }, { 184, 0, 1831 }, { 184, -1, 1839 }, + { 184, 0, 1834 }, { 184, 3, 1824 }, { 184, 5, 1817 }, { 184, 5, 1819 }, { 184, 3, 1824 }, + { 184, 1, 1828 }, { 184, 1, 1829 }, { 184, 1, 1829 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, + { 184, 1, 1828 }, { 184, 1, 1828 }, { 184, 1, 1828 }, { 189, 2, 1828 }, { 184, 1, 1828 }, + { 158, 1, 1827 }, { 128, 0, 1826 }, { 94, 0, 1824 }, { 59, -1, 1823 }, { 24, -2, 1822 }, + { -8, -3, 1821 }, { -36, -4, 1820 }, { -59, -5, 1819 }, { -74, -5, 1818 }, { -80, -6, 1818 }, }; static s16 animdata_mario_lips_1_2[][3] = { diff --git a/src/goddard/dynlists/anim_mario_lips_2.c b/src/goddard/dynlists/anim_mario_lips_2.c index e82e0a89..89f2897c 100644 --- a/src/goddard/dynlists/anim_mario_lips_2.c +++ b/src/goddard/dynlists/anim_mario_lips_2.c @@ -5,256 +5,207 @@ #include "../gd_types.h" static s16 animdata_mario_lips_2_1[][3] = { - { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -3, -1772 }, { -97, -4, -1773 }, - { -97, -4, -1773 }, { -97, -4, -1774 }, { -97, -4, -1775 }, { -97, -4, -1776 }, - { -97, -4, -1777 }, { -97, -5, -1778 }, { -97, -5, -1779 }, { -97, -5, -1780 }, - { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, - { -97, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1778 }, { -97, -4, -1777 }, - { -97, -4, -1774 }, { -97, -3, -1771 }, { -97, -2, -1764 }, { -97, 0, -1750 }, - { -97, 2, -1733 }, { -96, 5, -1714 }, { -96, 8, -1698 }, { -96, 10, -1686 }, - { -96, 11, -1681 }, { -96, 11, -1683 }, { -96, 10, -1690 }, { -96, 8, -1699 }, - { -96, 6, -1711 }, { -97, 4, -1723 }, { -97, 2, -1736 }, { -97, 0, -1748 }, - { -97, -1, -1759 }, { -97, -3, -1767 }, { -97, -3, -1771 }, { -97, -4, -1773 }, - { -97, -4, -1775 }, { -97, -4, -1777 }, { -97, -5, -1778 }, { -97, -5, -1779 }, - { -97, -5, -1780 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, - { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, - { -97, -5, -1780 }, { -97, -5, -1780 }, { -97, -5, -1779 }, { -97, -5, -1779 }, - { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1776 }, - { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1774 }, { -97, -4, -1773 }, - { -97, -4, -1772 }, { -97, -3, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1773 }, { -97, -4, -1775 }, - { -97, -4, -1776 }, { -97, -4, -1777 }, { -97, -4, -1777 }, { -97, -4, -1777 }, - { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -5, -1778 }, - { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, - { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, - { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1777 }, { -97, -4, -1777 }, - { -97, -4, -1776 }, { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1773 }, - { -97, -3, -1772 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1773 }, { -97, -4, -1775 }, - { -97, -4, -1778 }, { -97, -5, -1781 }, { -97, -5, -1784 }, { -98, -6, -1788 }, - { -98, -7, -1791 }, { -98, -7, -1795 }, { -98, -8, -1799 }, { -98, -8, -1803 }, - { -98, -9, -1806 }, { -98, -9, -1809 }, { -99, -10, -1811 }, { -99, -10, -1813 }, - { -99, -10, -1814 }, { -99, -10, -1814 }, { -99, -10, -1813 }, { -99, -10, -1811 }, - { -98, -9, -1808 }, { -98, -9, -1804 }, { -98, -8, -1798 }, { -98, -7, -1791 }, - { -97, -5, -1782 }, { -97, -3, -1771 }, { -95, 3, -1728 }, { -91, 17, -1641 }, - { -87, 33, -1542 }, { -83, 46, -1460 }, { -82, 52, -1426 }, { -82, 50, -1438 }, - { -84, 45, -1470 }, { -86, 37, -1517 }, { -88, 28, -1573 }, { -91, 18, -1632 }, - { -93, 9, -1689 }, { -95, 1, -1737 }, { -97, -3, -1771 }, { -98, -7, -1792 }, - { -98, -9, -1804 }, { -99, -10, -1810 }, { -99, -10, -1811 }, { -99, -10, -1809 }, - { -99, -9, -1807 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -100, -9, -1805 }, { -100, -9, -1804 }, { -100, -9, -1804 }, - { -100, -9, -1803 }, { -100, -9, -1802 }, { -101, -9, -1801 }, { -101, -9, -1800 }, - { -101, -9, -1799 }, { -101, -8, -1798 }, { -102, -8, -1797 }, { -102, -8, -1796 }, - { -102, -8, -1795 }, { -102, -8, -1794 }, { -103, -8, -1793 }, { -103, -8, -1791 }, - { -103, -7, -1790 }, { -103, -7, -1789 }, { -103, -7, -1787 }, { -103, -7, -1786 }, - { -103, -7, -1785 }, { -103, -6, -1783 }, { -102, -6, -1782 }, { -102, -6, -1781 }, - { -102, -6, -1779 }, { -101, -5, -1778 }, { -101, -5, -1777 }, { -100, -5, -1776 }, - { -100, -4, -1775 }, { -99, -4, -1773 }, { -98, -4, -1772 }, { -97, -3, -1771 }, - { -95, -3, -1770 }, { -92, -2, -1769 }, { -88, -1, -1769 }, { -83, 0, -1768 }, - { -78, 0, -1767 }, { -72, 1, -1766 }, { -67, 2, -1765 }, { -62, 3, -1764 }, - { -57, 4, -1763 }, { -54, 5, -1762 }, { -51, 6, -1761 }, { -50, 6, -1759 }, - { -48, 6, -1758 }, { -47, 7, -1756 }, { -46, 7, -1754 }, { -45, 8, -1752 }, - { -45, 8, -1749 }, { -45, 8, -1747 }, { -45, 8, -1745 }, { -45, 8, -1743 }, - { -45, 8, -1741 }, { -46, 8, -1740 }, { -47, 8, -1739 }, { -48, 8, -1738 }, - { -49, 8, -1738 }, { -51, 8, -1738 }, { -54, 7, -1739 }, { -58, 6, -1742 }, - { -63, 5, -1745 }, { -68, 3, -1749 }, { -74, 2, -1754 }, { -80, 0, -1758 }, - { -86, 0, -1763 }, { -91, -2, -1767 }, { -94, -3, -1770 }, { -97, -3, -1771 }, - { -98, -4, -1772 }, { -100, -4, -1773 }, { -101, -4, -1774 }, { -102, -5, -1774 }, - { -103, -5, -1774 }, { -104, -5, -1774 }, { -104, -5, -1774 }, { -105, -5, -1773 }, - { -105, -5, -1773 }, { -105, -5, -1773 }, { -105, -5, -1772 }, { -104, -5, -1772 }, - { -104, -5, -1771 }, { -103, -5, -1771 }, { -102, -4, -1771 }, { -101, -4, -1771 }, - { -100, -4, -1771 }, { -99, -4, -1771 }, { -97, -3, -1771 }, { -92, -3, -1773 }, - { -84, -1, -1775 }, { -74, 0, -1777 }, { -64, 1, -1780 }, { -56, 3, -1782 }, - { -52, 3, -1784 }, { -50, 4, -1784 }, { -49, 4, -1784 }, { -48, 4, -1785 }, - { -47, 4, -1785 }, { -47, 4, -1785 }, { -46, 4, -1785 }, { -46, 4, -1785 }, - { -47, 4, -1785 }, { -47, 4, -1785 }, { -47, 4, -1785 }, { -48, 4, -1785 }, - { -48, 4, -1784 }, { -49, 4, -1784 }, { -49, 4, -1784 }, { -50, 4, -1784 }, - { -50, 4, -1784 }, { -51, 4, -1784 }, { -51, 4, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, - { -52, 3, -1785 }, { -52, 3, -1787 }, { -52, 3, -1791 }, { -52, 2, -1795 }, - { -52, 2, -1800 }, { -52, 2, -1803 }, { -52, 2, -1806 }, { -52, 1, -1807 }, - { -52, 2, -1806 }, { -52, 2, -1802 }, { -52, 2, -1795 }, { -52, 3, -1784 }, - { -51, 7, -1744 }, { -49, 13, -1674 }, { -47, 19, -1606 }, { -46, 22, -1572 }, - { -46, 22, -1570 }, { -45, 22, -1576 }, { -44, 21, -1589 }, { -44, 20, -1606 }, - { -44, 18, -1626 }, { -44, 16, -1648 }, { -45, 15, -1670 }, { -47, 12, -1691 }, - { -51, 10, -1709 }, { -58, 7, -1730 }, { -70, 2, -1755 }, { -84, -3, -1779 }, - { -94, -7, -1798 }, { -99, -9, -1805 }, { -100, -9, -1806 }, { -100, -9, -1807 }, - { -101, -10, -1808 }, { -101, -10, -1809 }, { -101, -10, -1810 }, { -102, -10, -1811 }, - { -102, -10, -1811 }, { -102, -10, -1812 }, { -103, -11, -1813 }, { -103, -11, -1813 }, - { -103, -11, -1814 }, { -104, -11, -1814 }, { -104, -11, -1815 }, { -104, -11, -1815 }, - { -104, -11, -1816 }, { -105, -11, -1816 }, { -105, -11, -1817 }, { -105, -12, -1817 }, - { -105, -12, -1817 }, { -105, -12, -1818 }, { -105, -12, -1818 }, { -106, -12, -1818 }, - { -106, -12, -1818 }, { -106, -12, -1818 }, { -106, -12, -1819 }, { -106, -12, -1819 }, - { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, - { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, - { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, - { -106, -12, -1818 }, { -106, -12, -1818 }, { -106, -12, -1818 }, { -105, -12, -1818 }, - { -105, -12, -1818 }, { -105, -12, -1817 }, { -105, -12, -1817 }, { -105, -12, -1817 }, - { -105, -11, -1817 }, { -105, -11, -1817 }, { -105, -11, -1816 }, { -104, -11, -1816 }, - { -104, -11, -1816 }, { -104, -11, -1815 }, { -104, -11, -1815 }, { -104, -11, -1815 }, - { -104, -11, -1815 }, { -104, -11, -1814 }, { -103, -11, -1814 }, { -103, -11, -1814 }, - { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1812 }, - { -102, -10, -1812 }, { -102, -10, -1812 }, { -102, -10, -1811 }, { -102, -10, -1811 }, - { -102, -10, -1811 }, { -102, -10, -1810 }, { -101, -10, -1810 }, { -101, -10, -1810 }, - { -101, -10, -1809 }, { -101, -10, -1809 }, { -101, -10, -1809 }, { -101, -10, -1809 }, - { -101, -10, -1808 }, { -100, -10, -1808 }, { -100, -10, -1808 }, { -100, -10, -1807 }, - { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1807 }, - { -100, -9, -1806 }, { -100, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, - { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, - { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1806 }, - { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, - { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, - { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, - { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, - { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, - { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, - { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1805 }, { -99, -9, -1805 }, - { -99, -9, -1804 }, { -99, -9, -1804 }, { -99, -9, -1803 }, { -99, -9, -1803 }, - { -99, -9, -1802 }, { -99, -8, -1801 }, { -99, -8, -1801 }, { -99, -8, -1800 }, - { -99, -8, -1799 }, { -99, -8, -1799 }, { -99, -8, -1798 }, { -99, -8, -1797 }, - { -99, -8, -1796 }, { -98, -7, -1795 }, { -98, -7, -1794 }, { -98, -7, -1794 }, - { -98, -7, -1793 }, { -98, -7, -1792 }, { -98, -7, -1791 }, { -98, -7, -1790 }, - { -98, -6, -1789 }, { -98, -6, -1788 }, { -98, -6, -1787 }, { -98, -6, -1787 }, - { -98, -6, -1786 }, { -98, -6, -1785 }, { -98, -5, -1784 }, { -98, -5, -1783 }, - { -98, -5, -1782 }, { -98, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1780 }, - { -97, -5, -1779 }, { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1777 }, - { -97, -4, -1776 }, { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1774 }, - { -97, -4, -1773 }, { -97, -4, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1770 }, { -97, -3, -1770 }, - { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, - { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -3, -1772 }, { -97, -4, -1773 }, { -97, -4, -1773 }, + { -97, -4, -1774 }, { -97, -4, -1775 }, { -97, -4, -1776 }, { -97, -4, -1777 }, { -97, -5, -1778 }, + { -97, -5, -1779 }, { -97, -5, -1780 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, + { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1778 }, { -97, -4, -1777 }, + { -97, -4, -1774 }, { -97, -3, -1771 }, { -97, -2, -1764 }, { -97, 0, -1750 }, { -97, 2, -1733 }, + { -96, 5, -1714 }, { -96, 8, -1698 }, { -96, 10, -1686 }, { -96, 11, -1681 }, { -96, 11, -1683 }, + { -96, 10, -1690 }, { -96, 8, -1699 }, { -96, 6, -1711 }, { -97, 4, -1723 }, { -97, 2, -1736 }, + { -97, 0, -1748 }, { -97, -1, -1759 }, { -97, -3, -1767 }, { -97, -3, -1771 }, { -97, -4, -1773 }, + { -97, -4, -1775 }, { -97, -4, -1777 }, { -97, -5, -1778 }, { -97, -5, -1779 }, { -97, -5, -1780 }, + { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1781 }, + { -97, -5, -1781 }, { -97, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1780 }, { -97, -5, -1779 }, + { -97, -5, -1779 }, { -97, -4, -1778 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1776 }, + { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -4, -1772 }, + { -97, -3, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1772 }, + { -97, -4, -1773 }, { -97, -4, -1775 }, { -97, -4, -1776 }, { -97, -4, -1777 }, { -97, -4, -1777 }, + { -97, -4, -1777 }, { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -5, -1778 }, + { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, { -97, -5, -1778 }, + { -97, -5, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -4, -1778 }, { -97, -4, -1777 }, + { -97, -4, -1777 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1775 }, { -97, -4, -1774 }, + { -97, -4, -1773 }, { -97, -3, -1772 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1772 }, + { -97, -4, -1773 }, { -97, -4, -1775 }, { -97, -4, -1778 }, { -97, -5, -1781 }, { -97, -5, -1784 }, + { -98, -6, -1788 }, { -98, -7, -1791 }, { -98, -7, -1795 }, { -98, -8, -1799 }, { -98, -8, -1803 }, + { -98, -9, -1806 }, { -98, -9, -1809 }, { -99, -10, -1811 }, { -99, -10, -1813 }, { -99, -10, -1814 }, + { -99, -10, -1814 }, { -99, -10, -1813 }, { -99, -10, -1811 }, { -98, -9, -1808 }, { -98, -9, -1804 }, + { -98, -8, -1798 }, { -98, -7, -1791 }, { -97, -5, -1782 }, { -97, -3, -1771 }, { -95, 3, -1728 }, + { -91, 17, -1641 }, { -87, 33, -1542 }, { -83, 46, -1460 }, { -82, 52, -1426 }, { -82, 50, -1438 }, + { -84, 45, -1470 }, { -86, 37, -1517 }, { -88, 28, -1573 }, { -91, 18, -1632 }, { -93, 9, -1689 }, + { -95, 1, -1737 }, { -97, -3, -1771 }, { -98, -7, -1792 }, { -98, -9, -1804 }, { -99, -10, -1810 }, + { -99, -10, -1811 }, { -99, -10, -1809 }, { -99, -9, -1807 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -100, -9, -1805 }, { -100, -9, -1804 }, { -100, -9, -1804 }, + { -100, -9, -1803 }, { -100, -9, -1802 }, { -101, -9, -1801 }, { -101, -9, -1800 }, { -101, -9, -1799 }, + { -101, -8, -1798 }, { -102, -8, -1797 }, { -102, -8, -1796 }, { -102, -8, -1795 }, { -102, -8, -1794 }, + { -103, -8, -1793 }, { -103, -8, -1791 }, { -103, -7, -1790 }, { -103, -7, -1789 }, { -103, -7, -1787 }, + { -103, -7, -1786 }, { -103, -7, -1785 }, { -103, -6, -1783 }, { -102, -6, -1782 }, { -102, -6, -1781 }, + { -102, -6, -1779 }, { -101, -5, -1778 }, { -101, -5, -1777 }, { -100, -5, -1776 }, { -100, -4, -1775 }, + { -99, -4, -1773 }, { -98, -4, -1772 }, { -97, -3, -1771 }, { -95, -3, -1770 }, { -92, -2, -1769 }, + { -88, -1, -1769 }, { -83, 0, -1768 }, { -78, 0, -1767 }, { -72, 1, -1766 }, { -67, 2, -1765 }, + { -62, 3, -1764 }, { -57, 4, -1763 }, { -54, 5, -1762 }, { -51, 6, -1761 }, { -50, 6, -1759 }, + { -48, 6, -1758 }, { -47, 7, -1756 }, { -46, 7, -1754 }, { -45, 8, -1752 }, { -45, 8, -1749 }, + { -45, 8, -1747 }, { -45, 8, -1745 }, { -45, 8, -1743 }, { -45, 8, -1741 }, { -46, 8, -1740 }, + { -47, 8, -1739 }, { -48, 8, -1738 }, { -49, 8, -1738 }, { -51, 8, -1738 }, { -54, 7, -1739 }, + { -58, 6, -1742 }, { -63, 5, -1745 }, { -68, 3, -1749 }, { -74, 2, -1754 }, { -80, 0, -1758 }, + { -86, 0, -1763 }, { -91, -2, -1767 }, { -94, -3, -1770 }, { -97, -3, -1771 }, { -98, -4, -1772 }, + { -100, -4, -1773 }, { -101, -4, -1774 }, { -102, -5, -1774 }, { -103, -5, -1774 }, { -104, -5, -1774 }, + { -104, -5, -1774 }, { -105, -5, -1773 }, { -105, -5, -1773 }, { -105, -5, -1773 }, { -105, -5, -1772 }, + { -104, -5, -1772 }, { -104, -5, -1771 }, { -103, -5, -1771 }, { -102, -4, -1771 }, { -101, -4, -1771 }, + { -100, -4, -1771 }, { -99, -4, -1771 }, { -97, -3, -1771 }, { -92, -3, -1773 }, { -84, -1, -1775 }, + { -74, 0, -1777 }, { -64, 1, -1780 }, { -56, 3, -1782 }, { -52, 3, -1784 }, { -50, 4, -1784 }, + { -49, 4, -1784 }, { -48, 4, -1785 }, { -47, 4, -1785 }, { -47, 4, -1785 }, { -46, 4, -1785 }, + { -46, 4, -1785 }, { -47, 4, -1785 }, { -47, 4, -1785 }, { -47, 4, -1785 }, { -48, 4, -1785 }, + { -48, 4, -1784 }, { -49, 4, -1784 }, { -49, 4, -1784 }, { -50, 4, -1784 }, { -50, 4, -1784 }, + { -51, 4, -1784 }, { -51, 4, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1784 }, + { -52, 3, -1784 }, { -52, 3, -1784 }, { -52, 3, -1785 }, { -52, 3, -1787 }, { -52, 3, -1791 }, + { -52, 2, -1795 }, { -52, 2, -1800 }, { -52, 2, -1803 }, { -52, 2, -1806 }, { -52, 1, -1807 }, + { -52, 2, -1806 }, { -52, 2, -1802 }, { -52, 2, -1795 }, { -52, 3, -1784 }, { -51, 7, -1744 }, + { -49, 13, -1674 }, { -47, 19, -1606 }, { -46, 22, -1572 }, { -46, 22, -1570 }, { -45, 22, -1576 }, + { -44, 21, -1589 }, { -44, 20, -1606 }, { -44, 18, -1626 }, { -44, 16, -1648 }, { -45, 15, -1670 }, + { -47, 12, -1691 }, { -51, 10, -1709 }, { -58, 7, -1730 }, { -70, 2, -1755 }, { -84, -3, -1779 }, + { -94, -7, -1798 }, { -99, -9, -1805 }, { -100, -9, -1806 }, { -100, -9, -1807 }, { -101, -10, -1808 }, + { -101, -10, -1809 }, { -101, -10, -1810 }, { -102, -10, -1811 }, { -102, -10, -1811 }, { -102, -10, -1812 }, + { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1814 }, { -104, -11, -1814 }, { -104, -11, -1815 }, + { -104, -11, -1815 }, { -104, -11, -1816 }, { -105, -11, -1816 }, { -105, -11, -1817 }, { -105, -12, -1817 }, + { -105, -12, -1817 }, { -105, -12, -1818 }, { -105, -12, -1818 }, { -106, -12, -1818 }, { -106, -12, -1818 }, + { -106, -12, -1818 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, { -106, -12, -1819 }, + { -106, -12, -1818 }, { -106, -12, -1818 }, { -106, -12, -1818 }, { -105, -12, -1818 }, { -105, -12, -1818 }, + { -105, -12, -1817 }, { -105, -12, -1817 }, { -105, -12, -1817 }, { -105, -11, -1817 }, { -105, -11, -1817 }, + { -105, -11, -1816 }, { -104, -11, -1816 }, { -104, -11, -1816 }, { -104, -11, -1815 }, { -104, -11, -1815 }, + { -104, -11, -1815 }, { -104, -11, -1815 }, { -104, -11, -1814 }, { -103, -11, -1814 }, { -103, -11, -1814 }, + { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1813 }, { -103, -11, -1812 }, { -102, -10, -1812 }, + { -102, -10, -1812 }, { -102, -10, -1811 }, { -102, -10, -1811 }, { -102, -10, -1811 }, { -102, -10, -1810 }, + { -101, -10, -1810 }, { -101, -10, -1810 }, { -101, -10, -1809 }, { -101, -10, -1809 }, { -101, -10, -1809 }, + { -101, -10, -1809 }, { -101, -10, -1808 }, { -100, -10, -1808 }, { -100, -10, -1808 }, { -100, -10, -1807 }, + { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1807 }, { -100, -9, -1806 }, + { -100, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1805 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1806 }, + { -99, -9, -1806 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1807 }, + { -99, -9, -1807 }, { -99, -9, -1807 }, { -99, -9, -1806 }, { -99, -9, -1806 }, { -99, -9, -1805 }, + { -99, -9, -1805 }, { -99, -9, -1804 }, { -99, -9, -1804 }, { -99, -9, -1803 }, { -99, -9, -1803 }, + { -99, -9, -1802 }, { -99, -8, -1801 }, { -99, -8, -1801 }, { -99, -8, -1800 }, { -99, -8, -1799 }, + { -99, -8, -1799 }, { -99, -8, -1798 }, { -99, -8, -1797 }, { -99, -8, -1796 }, { -98, -7, -1795 }, + { -98, -7, -1794 }, { -98, -7, -1794 }, { -98, -7, -1793 }, { -98, -7, -1792 }, { -98, -7, -1791 }, + { -98, -7, -1790 }, { -98, -6, -1789 }, { -98, -6, -1788 }, { -98, -6, -1787 }, { -98, -6, -1787 }, + { -98, -6, -1786 }, { -98, -6, -1785 }, { -98, -5, -1784 }, { -98, -5, -1783 }, { -98, -5, -1782 }, + { -98, -5, -1781 }, { -97, -5, -1780 }, { -97, -5, -1780 }, { -97, -5, -1779 }, { -97, -4, -1778 }, + { -97, -4, -1777 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1775 }, { -97, -4, -1774 }, + { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -4, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, + { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1770 }, + { -97, -3, -1770 }, { -97, -3, -1770 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, }; static s16 animdata_mario_lips_2_2[][3] = { - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, - { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1838 }, - { -96, -15, -1837 }, { -96, -14, -1836 }, { -96, -14, -1835 }, { -96, -14, -1834 }, - { -96, -14, -1832 }, { -96, -13, -1831 }, { -96, -13, -1829 }, { -96, -13, -1827 }, - { -96, -13, -1825 }, { -96, -12, -1824 }, { -96, -12, -1822 }, { -96, -12, -1820 }, - { -96, -11, -1818 }, { -96, -11, -1817 }, { -96, -11, -1815 }, { -96, -11, -1814 }, - { -96, -10, -1812 }, { -96, -10, -1810 }, { -96, -10, -1808 }, { -96, -9, -1807 }, - { -96, -9, -1805 }, { -96, -9, -1803 }, { -96, -8, -1800 }, { -96, -8, -1798 }, - { -96, -8, -1796 }, { -96, -7, -1794 }, { -96, -7, -1792 }, { -96, -7, -1790 }, - { -96, -6, -1788 }, { -96, -6, -1786 }, { -97, -6, -1784 }, { -97, -5, -1782 }, - { -97, -5, -1780 }, { -97, -5, -1779 }, { -97, -4, -1777 }, { -97, -4, -1776 }, - { -97, -4, -1775 }, { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -3, -1772 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, - { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1772 }, { -97, -4, -1773 }, - { -97, -4, -1774 }, { -97, -4, -1775 }, { -97, -4, -1776 }, { -97, -4, -1777 }, - { -97, -5, -1778 }, { -97, -5, -1779 }, { -97, -5, -1781 }, { -97, -5, -1782 }, - { -96, -6, -1784 }, { -96, -6, -1786 }, { -96, -6, -1787 }, { -96, -6, -1789 }, - { -96, -7, -1790 }, { -96, -7, -1792 }, { -96, -7, -1794 }, { -96, -8, -1796 }, - { -96, -8, -1797 }, { -96, -8, -1799 }, { -96, -8, -1801 }, { -96, -9, -1802 }, - { -96, -9, -1804 }, { -96, -9, -1805 }, { -96, -9, -1807 }, { -96, -10, -1808 }, - { -96, -10, -1809 }, { -96, -10, -1810 }, { -96, -10, -1811 }, { -96, -10, -1812 }, - { -96, -11, -1813 }, { -96, -11, -1814 }, { -96, -11, -1815 }, { -96, -11, -1815 }, - { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1815 }, - { -96, -11, -1814 }, { -96, -11, -1814 }, { -96, -10, -1813 }, { -96, -10, -1812 }, - { -96, -10, -1811 }, { -96, -10, -1810 }, { -96, -10, -1808 }, { -96, -9, -1807 }, - { -96, -9, -1806 }, { -96, -9, -1804 }, { -96, -9, -1802 }, { -96, -8, -1801 }, - { -96, -8, -1799 }, { -96, -8, -1797 }, { -96, -7, -1795 }, { -96, -7, -1793 }, - { -96, -7, -1792 }, { -97, -7, -1790 }, { -97, -6, -1788 }, { -97, -6, -1786 }, - { -97, -6, -1784 }, { -97, -5, -1783 }, { -97, -5, -1781 }, { -97, -5, -1780 }, - { -97, -5, -1778 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1775 }, - { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -4, -1772 }, { -97, -3, -1772 }, - { -97, -3, -1771 }, { -97, -3, -1771 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1839 }, + { -96, -15, -1839 }, { -96, -15, -1839 }, { -96, -15, -1838 }, { -96, -15, -1837 }, { -96, -14, -1836 }, + { -96, -14, -1835 }, { -96, -14, -1834 }, { -96, -14, -1832 }, { -96, -13, -1831 }, { -96, -13, -1829 }, + { -96, -13, -1827 }, { -96, -13, -1825 }, { -96, -12, -1824 }, { -96, -12, -1822 }, { -96, -12, -1820 }, + { -96, -11, -1818 }, { -96, -11, -1817 }, { -96, -11, -1815 }, { -96, -11, -1814 }, { -96, -10, -1812 }, + { -96, -10, -1810 }, { -96, -10, -1808 }, { -96, -9, -1807 }, { -96, -9, -1805 }, { -96, -9, -1803 }, + { -96, -8, -1800 }, { -96, -8, -1798 }, { -96, -8, -1796 }, { -96, -7, -1794 }, { -96, -7, -1792 }, + { -96, -7, -1790 }, { -96, -6, -1788 }, { -96, -6, -1786 }, { -97, -6, -1784 }, { -97, -5, -1782 }, + { -97, -5, -1780 }, { -97, -5, -1779 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1775 }, + { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -3, -1772 }, { -97, -3, -1771 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1771 }, { -97, -3, -1772 }, { -97, -4, -1772 }, + { -97, -4, -1773 }, { -97, -4, -1774 }, { -97, -4, -1775 }, { -97, -4, -1776 }, { -97, -4, -1777 }, + { -97, -5, -1778 }, { -97, -5, -1779 }, { -97, -5, -1781 }, { -97, -5, -1782 }, { -96, -6, -1784 }, + { -96, -6, -1786 }, { -96, -6, -1787 }, { -96, -6, -1789 }, { -96, -7, -1790 }, { -96, -7, -1792 }, + { -96, -7, -1794 }, { -96, -8, -1796 }, { -96, -8, -1797 }, { -96, -8, -1799 }, { -96, -8, -1801 }, + { -96, -9, -1802 }, { -96, -9, -1804 }, { -96, -9, -1805 }, { -96, -9, -1807 }, { -96, -10, -1808 }, + { -96, -10, -1809 }, { -96, -10, -1810 }, { -96, -10, -1811 }, { -96, -10, -1812 }, { -96, -11, -1813 }, + { -96, -11, -1814 }, { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1815 }, + { -96, -11, -1815 }, { -96, -11, -1815 }, { -96, -11, -1814 }, { -96, -11, -1814 }, { -96, -10, -1813 }, + { -96, -10, -1812 }, { -96, -10, -1811 }, { -96, -10, -1810 }, { -96, -10, -1808 }, { -96, -9, -1807 }, + { -96, -9, -1806 }, { -96, -9, -1804 }, { -96, -9, -1802 }, { -96, -8, -1801 }, { -96, -8, -1799 }, + { -96, -8, -1797 }, { -96, -7, -1795 }, { -96, -7, -1793 }, { -96, -7, -1792 }, { -97, -7, -1790 }, + { -97, -6, -1788 }, { -97, -6, -1786 }, { -97, -6, -1784 }, { -97, -5, -1783 }, { -97, -5, -1781 }, + { -97, -5, -1780 }, { -97, -5, -1778 }, { -97, -4, -1777 }, { -97, -4, -1776 }, { -97, -4, -1775 }, + { -97, -4, -1774 }, { -97, -4, -1773 }, { -97, -4, -1772 }, { -97, -3, -1772 }, { -97, -3, -1771 }, + { -97, -3, -1771 }, }; struct AnimDataInfo anim_mario_lips_2[] = { diff --git a/src/goddard/dynlists/anim_mario_mustache_right.c b/src/goddard/dynlists/anim_mario_mustache_right.c index 51d7b3e2..467bc928 100644 --- a/src/goddard/dynlists/anim_mario_mustache_right.c +++ b/src/goddard/dynlists/anim_mario_mustache_right.c @@ -172,40 +172,34 @@ static s16 animdata_mario_mustache_right_1[][3] = { }; static s16 animdata_mario_mustache_right_2[][3] = { - { 23, 152, 1595 }, { 23, 152, 1595 }, { 23, 152, 1596 }, { 24, 152, 1597 }, { 24, 152, 1598 }, - { 24, 152, 1600 }, { 25, 152, 1602 }, { 25, 152, 1604 }, { 26, 152, 1605 }, { 26, 152, 1607 }, - { 27, 152, 1609 }, { 27, 152, 1610 }, { 28, 152, 1611 }, { 28, 152, 1612 }, { 28, 152, 1613 }, - { 28, 152, 1613 }, { 28, 152, 1613 }, { 28, 152, 1612 }, { 27, 152, 1610 }, { 26, 152, 1607 }, - { 26, 152, 1604 }, { 25, 152, 1600 }, { 23, 152, 1595 }, { 13, 153, 1557 }, { -3, 153, 1493 }, - { -12, 154, 1459 }, { -3, 153, 1493 }, { 13, 153, 1557 }, { 23, 152, 1595 }, { 23, 153, 1596 }, - { 22, 153, 1590 }, { 19, 153, 1578 }, { 15, 154, 1563 }, { 11, 154, 1548 }, { 7, 154, 1534 }, - { 4, 155, 1524 }, { 3, 155, 1520 }, { 4, 155, 1524 }, { 6, 154, 1532 }, { 10, 154, 1544 }, - { 13, 154, 1558 }, { 17, 153, 1572 }, { 20, 153, 1584 }, { 22, 153, 1592 }, { 23, 152, 1595 }, - { 23, 152, 1595 }, { 23, 152, 1596 }, { 24, 152, 1597 }, { 24, 152, 1598 }, { 24, 152, 1599 }, - { 25, 152, 1601 }, { 25, 152, 1602 }, { 25, 152, 1604 }, { 26, 152, 1606 }, { 26, 152, 1608 }, - { 27, 152, 1610 }, { 27, 151, 1612 }, { 28, 151, 1614 }, { 28, 151, 1615 }, { 29, 151, 1617 }, - { 29, 151, 1619 }, { 30, 151, 1620 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, - { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, - { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, - { 30, 151, 1620 }, { 30, 151, 1620 }, { 30, 151, 1620 }, { 30, 151, 1621 }, { 30, 151, 1621 }, - { 30, 151, 1621 }, { 30, 151, 1622 }, { 30, 151, 1622 }, { 30, 151, 1622 }, { 30, 151, 1623 }, - { 30, 151, 1623 }, { 31, 151, 1623 }, { 31, 151, 1624 }, { 31, 151, 1624 }, { 31, 151, 1625 }, - { 31, 151, 1625 }, { 31, 151, 1625 }, { 31, 151, 1626 }, { 31, 151, 1626 }, { 31, 151, 1626 }, - { 31, 151, 1626 }, { 31, 151, 1627 }, { 31, 151, 1627 }, { 32, 151, 1627 }, { 32, 151, 1627 }, - { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, - { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, - { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, - { 32, 151, 1627 }, { 31, 151, 1627 }, { 31, 151, 1627 }, { 31, 151, 1626 }, { 31, 151, 1626 }, - { 31, 151, 1625 }, { 31, 151, 1625 }, { 31, 151, 1624 }, { 30, 151, 1623 }, { 30, 151, 1622 }, - { 30, 151, 1622 }, { 30, 151, 1621 }, { 30, 151, 1620 }, { 29, 151, 1619 }, { 29, 151, 1618 }, - { 29, 151, 1617 }, { 28, 151, 1615 }, { 28, 151, 1613 }, { 27, 151, 1611 }, { 26, 151, 1608 }, - { 26, 151, 1605 }, { 25, 151, 1602 }, { 24, 152, 1598 }, { 23, 152, 1595 }, { 22, 152, 1591 }, - { 21, 152, 1587 }, { 20, 152, 1583 }, { 19, 152, 1579 }, { 18, 152, 1575 }, { 16, 152, 1570 }, - { 15, 152, 1566 }, { 14, 153, 1561 }, { 13, 153, 1557 }, { 12, 153, 1553 }, { 11, 153, 1548 }, - { 10, 153, 1544 }, { 8, 153, 1540 }, { 7, 153, 1536 }, { 6, 153, 1532 }, { 5, 154, 1528 }, - { 4, 154, 1525 }, { 4, 154, 1522 }, { 3, 154, 1519 }, { 2, 154, 1516 }, { 1, 154, 1513 }, - { 1, 154, 1511 }, { 0, 154, 1510 }, { 0, 154, 1508 }, { 0, 154, 1507 }, { 0, 154, 1506 }, - { 0, 154, 1506 }, + { 23, 152, 1595 }, { 23, 152, 1595 }, { 23, 152, 1596 }, { 24, 152, 1597 }, { 24, 152, 1598 }, { 24, 152, 1600 }, + { 25, 152, 1602 }, { 25, 152, 1604 }, { 26, 152, 1605 }, { 26, 152, 1607 }, { 27, 152, 1609 }, { 27, 152, 1610 }, + { 28, 152, 1611 }, { 28, 152, 1612 }, { 28, 152, 1613 }, { 28, 152, 1613 }, { 28, 152, 1613 }, { 28, 152, 1612 }, + { 27, 152, 1610 }, { 26, 152, 1607 }, { 26, 152, 1604 }, { 25, 152, 1600 }, { 23, 152, 1595 }, { 13, 153, 1557 }, + { -3, 153, 1493 }, { -12, 154, 1459 }, { -3, 153, 1493 }, { 13, 153, 1557 }, { 23, 152, 1595 }, { 23, 153, 1596 }, + { 22, 153, 1590 }, { 19, 153, 1578 }, { 15, 154, 1563 }, { 11, 154, 1548 }, { 7, 154, 1534 }, { 4, 155, 1524 }, + { 3, 155, 1520 }, { 4, 155, 1524 }, { 6, 154, 1532 }, { 10, 154, 1544 }, { 13, 154, 1558 }, { 17, 153, 1572 }, + { 20, 153, 1584 }, { 22, 153, 1592 }, { 23, 152, 1595 }, { 23, 152, 1595 }, { 23, 152, 1596 }, { 24, 152, 1597 }, + { 24, 152, 1598 }, { 24, 152, 1599 }, { 25, 152, 1601 }, { 25, 152, 1602 }, { 25, 152, 1604 }, { 26, 152, 1606 }, + { 26, 152, 1608 }, { 27, 152, 1610 }, { 27, 151, 1612 }, { 28, 151, 1614 }, { 28, 151, 1615 }, { 29, 151, 1617 }, + { 29, 151, 1619 }, { 30, 151, 1620 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, + { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1618 }, { 29, 151, 1619 }, { 29, 151, 1619 }, + { 29, 151, 1619 }, { 29, 151, 1619 }, { 29, 151, 1619 }, { 30, 151, 1620 }, { 30, 151, 1620 }, { 30, 151, 1620 }, + { 30, 151, 1621 }, { 30, 151, 1621 }, { 30, 151, 1621 }, { 30, 151, 1622 }, { 30, 151, 1622 }, { 30, 151, 1622 }, + { 30, 151, 1623 }, { 30, 151, 1623 }, { 31, 151, 1623 }, { 31, 151, 1624 }, { 31, 151, 1624 }, { 31, 151, 1625 }, + { 31, 151, 1625 }, { 31, 151, 1625 }, { 31, 151, 1626 }, { 31, 151, 1626 }, { 31, 151, 1626 }, { 31, 151, 1626 }, + { 31, 151, 1627 }, { 31, 151, 1627 }, { 32, 151, 1627 }, { 32, 151, 1627 }, { 32, 151, 1628 }, { 32, 151, 1628 }, + { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, + { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, { 32, 151, 1628 }, + { 32, 151, 1628 }, { 32, 151, 1627 }, { 31, 151, 1627 }, { 31, 151, 1627 }, { 31, 151, 1626 }, { 31, 151, 1626 }, + { 31, 151, 1625 }, { 31, 151, 1625 }, { 31, 151, 1624 }, { 30, 151, 1623 }, { 30, 151, 1622 }, { 30, 151, 1622 }, + { 30, 151, 1621 }, { 30, 151, 1620 }, { 29, 151, 1619 }, { 29, 151, 1618 }, { 29, 151, 1617 }, { 28, 151, 1615 }, + { 28, 151, 1613 }, { 27, 151, 1611 }, { 26, 151, 1608 }, { 26, 151, 1605 }, { 25, 151, 1602 }, { 24, 152, 1598 }, + { 23, 152, 1595 }, { 22, 152, 1591 }, { 21, 152, 1587 }, { 20, 152, 1583 }, { 19, 152, 1579 }, { 18, 152, 1575 }, + { 16, 152, 1570 }, { 15, 152, 1566 }, { 14, 153, 1561 }, { 13, 153, 1557 }, { 12, 153, 1553 }, { 11, 153, 1548 }, + { 10, 153, 1544 }, { 8, 153, 1540 }, { 7, 153, 1536 }, { 6, 153, 1532 }, { 5, 154, 1528 }, { 4, 154, 1525 }, + { 4, 154, 1522 }, { 3, 154, 1519 }, { 2, 154, 1516 }, { 1, 154, 1513 }, { 1, 154, 1511 }, { 0, 154, 1510 }, + { 0, 154, 1508 }, { 0, 154, 1507 }, { 0, 154, 1506 }, { 0, 154, 1506 }, }; struct AnimDataInfo anim_mario_mustache_right[3] = { diff --git a/src/goddard/dynlists/dynlist_mario_face.c b/src/goddard/dynlists/dynlist_mario_face.c index 72730254..6f531d13 100644 --- a/src/goddard/dynlists/dynlist_mario_face.c +++ b/src/goddard/dynlists/dynlist_mario_face.c @@ -6,341 +6,275 @@ #include "../dynlist_proc.h" static s16 mario_Face_VtxData[][3] = { - { 434, 326, -209 }, { 283, 371, -268 }, { 344, 531, -97 }, { 360, 187, -363 }, - { 162, -260, 265 }, { 172, -251, 175 }, { 218, -191, 287 }, { 173, 279, 296 }, - { 192, 226, 279 }, { 233, 346, 216 }, { 135, -283, 182 }, { 165, -299, 114 }, - { 283, -7, -283 }, { 252, -41, -396 }, { 339, 63, -209 }, { 128, 20, 390 }, - { 203, -50, 366 }, { 219, 24, 358 }, { 127, -74, 423 }, { 0, -125, 459 }, - { 125, -76, 401 }, { 83, 86, 359 }, { 124, 85, 409 }, { 144, 91, 567 }, - { 151, 5, 459 }, { 65, -67, 636 }, { 106, -104, 567 }, { 117, 1, 636 }, - { 0, 141, 459 }, { 0, 139, 567 }, { 66, 80, 636 }, { 99, -284, 284 }, - { 125, -295, 252 }, { 343, -31, 227 }, { 296, 35, 287 }, { 267, -115, 314 }, - { 374, -65, 73 }, { 366, -103, 153 }, { 369, -90, 62 }, { 77, -339, 122 }, - { 94, -363, 22 }, { 0, -123, 567 }, { 63, -198, 357 }, { 115, -178, 351 }, - { 53, -167, 398 }, { 311, 79, 200 }, { 265, 141, 195 }, { 242, 98, 288 }, - { 54, 306, 339 }, { 127, 314, 325 }, { 123, 383, 276 }, { 195, 158, 286 }, - { 490, 222, -179 }, { 410, 149, -123 }, { 281, 383, 493 }, { 349, 313, 311 }, - { 243, 407, 458 }, { 323, 286, 131 }, { 445, 241, -29 }, { 466, 126, -176 }, - { 432, 145, -125 }, { 465, 96, -107 }, { 327, -122, -180 }, { 348, -73, -156 }, - { 297, -152, -126 }, { 496, 52, -220 }, { 424, 90, -198 }, { 431, 480, -59 }, - { 356, 611, 78 }, { 119, 770, 199 }, { 243, 714, 165 }, { 183, 744, 77 }, - { 117, 190, -556 }, { 206, 36, -541 }, { 273, -85, -230 }, { 132, 423, 573 }, - { 263, 636, 246 }, { 236, 536, 288 }, { 318, 452, 218 }, { 114, 573, -114 }, - { 49, 394, -230 }, { 127, 365, -303 }, { 41, 126, 357 }, { 0, 127, 368 }, - { 342, -114, -82 }, { 144, -241, 291 }, { 128, -226, 276 }, { 0, -112, 421 }, - { 385, 17, -116 }, { 430, 29, -155 }, { 484, -69, -165 }, { 436, -20, -205 }, - { 504, 4, -195 }, { 308, -167, 222 }, { 288, -237, 119 }, { 341, -164, 56 }, - { 257, -234, -64 }, { 143, 91, 333 }, { 35, -227, 201 }, { 0, -293, 274 }, - { 66, -283, 272 }, { 91, -149, 273 }, { 50, -217, 325 }, { 74, -107, 155 }, - { 75, -227, 201 }, { 74, -321, 190 }, { 186, -226, -173 }, { 97, -313, -200 }, - { 159, -331, 5 }, { 157, -164, 336 }, { 162, -139, 369 }, { 164, -190, 319 }, - { 156, -150, 317 }, { 41, -314, 282 }, { 62, -329, 252 }, { 0, -342, 252 }, - { 0, -339, 190 }, { 0, -371, 136 }, { 379, 21, -58 }, { 345, -32, -2 }, - { 375, -21, -59 }, { 314, 331, 289 }, { 425, -38, -132 }, { 483, 49, -147 }, - { 177, 107, 315 }, { 311, 216, 143 }, { 56, 131, 305 }, { 82, 87, 283 }, - { 59, 268, 295 }, { 0, 383, 308 }, { 46, 224, 357 }, { 73, 297, 289 }, - { 124, 305, 270 }, { 161, 275, 258 }, { 181, 226, 248 }, { 167, 123, 248 }, - { 138, 92, 249 }, { 348, -76, -25 }, { 416, -115, -95 }, { 396, 155, -77 }, - { 345, 5, -6 }, { 407, 80, -78 }, { 399, 192, -5 }, { 351, 211, 49 }, - { 385, -16, 93 }, { 471, 410, 0 }, { 406, 344, 72 }, { 299, 642, -9 }, - { 99, 678, -16 }, { 61, 746, 77 }, { 0, 662, 326 }, { 144, 693, 290 }, - { 367, 553, 169 }, { 246, -69, -335 }, { 179, 521, 305 }, { 145, 447, 317 }, - { 67, 655, 314 }, { 148, 624, 303 }, { 237, 378, 229 }, { 127, -190, 213 }, - { 168, 2, 567 }, { 0, 1, 662 }, { 209, 314, -391 }, { 41, 354, -332 }, - { 406, 115, -313 }, { 260, -175, -198 }, { 90, -361, -92 }, { 401, -99, -132 }, - { 470, -19, -130 }, { 355, 55, 133 }, { 325, 107, 130 }, { 411, 73, 85 }, - { 362, 145, 57 }, { 83, 298, -450 }, { -41, 354, -332 }, { -83, 298, -450 }, - { -112, 190, -556 }, { -2, -382, 60 }, { -90, -361, -92 }, { -97, -313, -200 }, - { 108, -241, -280 }, { 0, -238, -280 }, { -67, 80, 636 }, { -66, -67, 636 }, - { -113, 529, 326 }, { -179, 521, 305 }, { -145, 447, 317 }, { -74, -107, 155 }, - { -50, -217, 325 }, { -35, -227, 201 }, { 0, 3, -569 }, { 0, -42, -443 }, - { -119, 770, 199 }, { -99, 678, -16 }, { -114, 573, -114 }, { -61, 746, 77 }, - { -54, 306, 339 }, { -46, 224, 357 }, { -63, -198, 357 }, { -53, -167, 398 }, - { 98, -67, -392 }, { 127, 441, 523 }, { 0, 423, 573 }, { 292, -219, -231 }, - { 78, -230, -456 }, { 56, -257, -404 }, { 32, -210, -431 }, { 124, -217, -428 }, - { 125, -185, -370 }, { 97, -166, -483 }, { 56, -159, -486 }, { -3, -72, -404 }, - { -3, -174, -377 }, { 303, -200, -423 }, { 243, -262, -358 }, { 204, -203, -428 }, - { 241, -139, -464 }, { 166, -110, -445 }, { 277, -93, -416 }, { 174, -205, -404 }, - { 294, -239, -381 }, { 258, -243, -302 }, { 345, -172, -370 }, { 342, -132, -280 }, - { 382, 54, -197 }, { 439, 41, -227 }, { 389, 29, -202 }, { 390, -13, -203 }, - { 412, -69, -184 }, { 422, -63, -95 }, { 0, 440, 529 }, { 364, 16, 148 }, - { 424, 39, 39 }, { 401, 29, 97 }, { 391, 132, 5 }, { 395, 101, -33 }, - { 172, -260, -335 }, { 103, -257, -404 }, { 295, -131, -457 }, { 403, 171, -41 }, - { -471, 410, 0 }, { -490, 222, -179 }, { -445, 241, -29 }, { -410, 149, -123 }, - { -396, 155, -77 }, { -403, 171, -41 }, { -323, 286, 131 }, { -406, 344, 72 }, - { -399, 192, -5 }, { -318, 452, 218 }, { -209, 314, -391 }, { -283, 371, -268 }, - { -127, 365, -303 }, { -98, -67, -392 }, { -125, -185, -370 }, { -166, -110, -445 }, - { -246, -69, -335 }, { -277, -93, -416 }, { -342, -132, -280 }, { -292, -219, -231 }, - { -258, -243, -302 }, { -113, -243, -280 }, { -172, -260, -335 }, { -358, 57, 132 }, - { -363, 17, 151 }, { -311, 79, 200 }, { -407, 29, 97 }, { -345, 5, -6 }, - { -395, 101, -33 }, { -391, 132, 5 }, { -351, 211, 49 }, { -362, 145, 57 }, - { -385, -16, 93 }, { -343, -31, 227 }, { -283, -7, -287 }, { -273, -85, -230 }, - { -360, 187, -363 }, { -206, 36, -541 }, { -406, 115, -313 }, { -303, -200, -423 }, - { -345, -172, -370 }, { -295, -131, -457 }, { -241, -139, -464 }, { -204, -203, -428 }, - { -294, -239, -381 }, { -243, -262, -358 }, { -78, -230, -456 }, { -56, -159, -486 }, - { -32, -210, -431 }, { -97, -166, -483 }, { -124, -217, -428 }, { -103, -257, -404 }, - { -56, -257, -404 }, { -174, -205, -404 }, { -311, 216, 143 }, { -418, 39, 39 }, - { -411, 73, 85 }, { -327, 106, 129 }, { -374, -65, 73 }, { -348, -76, -25 }, - { -345, -167, 56 }, { -369, -90, 62 }, { -345, -32, -2 }, { -237, 378, 229 }, - { -314, 331, 289 }, { -243, 407, 458 }, { -127, 441, 523 }, { -439, 41, -227 }, - { -436, -20, -205 }, { -504, 4, -195 }, { -416, -115, -95 }, { -422, -63, -95 }, - { -339, 63, -209 }, { -348, -73, -156 }, { -390, -13, -203 }, { -401, -99, -132 }, - { -342, -114, -82 }, { -484, -69, -165 }, { -412, -69, -184 }, { -470, -19, -130 }, - { -425, -38, -132 }, { -375, -21, -59 }, { -407, 80, -78 }, { -385, 17, -116 }, - { -379, 21, -58 }, { -424, 90, -198 }, { -382, 54, -197 }, { -389, 29, -202 }, - { -496, 52, -220 }, { -483, 49, -147 }, { -466, 126, -176 }, { -432, 145, -125 }, - { -465, 96, -107 }, { -186, -226, -173 }, { -260, -175, -198 }, { -132, 423, 573 }, - { -94, -363, 22 }, { -77, -339, 122 }, { -123, 383, 276 }, { -252, -20, -373 }, - { -430, 29, -155 }, { -254, -230, -63 }, { -159, -331, 5 }, { -297, -152, -126 }, - { -322, -122, -180 }, { -49, 394, -230 }, { -145, 91, 567 }, { -124, 85, 409 }, - { -169, 2, 567 }, { -151, 5, 459 }, { -119, -69, 429 }, { -106, -104, 567 }, - { -118, 1, 636 }, { -128, 20, 390 }, { -115, -178, 351 }, { -157, -164, 336 }, - { -155, -149, 317 }, { -127, -190, 214 }, { -75, -227, 201 }, { -367, 553, 169 }, - { -236, 536, 288 }, { -263, 636, 246 }, { -148, 624, 303 }, { -144, 693, 290 }, - { -67, 655, 314 }, { -434, 326, -209 }, { -243, 714, 165 }, { -356, 611, 78 }, - { -183, 744, 77 }, { -299, 642, -9 }, { -344, 531, -97 }, { -366, -103, 153 }, - { -267, -115, 314 }, { -296, 35, 287 }, { -242, 98, 288 }, { -192, 221, 279 }, - { -162, -139, 369 }, { -91, -147, 273 }, { -288, -237, 119 }, { -165, -299, 114 }, - { -172, -251, 176 }, { -219, 24, 358 }, { -143, 91, 333 }, { -203, -50, 366 }, - { -125, -76, 401 }, { -82, 87, 288 }, { -83, 86, 359 }, { -41, 126, 357 }, - { -138, 92, 254 }, { -177, 107, 311 }, { -167, 120, 250 }, { -198, 155, 286 }, - { -181, 221, 239 }, { -161, 268, 247 }, { -169, 277, 296 }, { -124, 298, 270 }, - { -127, 314, 325 }, { -73, 290, 291 }, { -56, 128, 309 }, { -59, 261, 299 }, - { -265, 141, 195 }, { -233, 346, 207 }, { -281, 383, 493 }, { -349, 313, 311 }, - { -308, -167, 222 }, { -135, -283, 182 }, { -74, -321, 190 }, { -218, -191, 287 }, - { -164, -187, 321 }, { -162, -260, 265 }, { -144, -241, 291 }, { -99, -284, 283 }, - { -62, -329, 252 }, { -41, -314, 282 }, { -66, -284, 272 }, { -125, -295, 252 }, - { -127, -226, 276 }, { -431, 480, -59 }, { 0, -320, 282 }, { -181, 161, 238 }, - { 0, 461, 348 }, { -72, 454, 336 }, { 72, 454, 336 }, { 181, 165, 241 }, - { 0, 529, 345 }, { 113, 529, 326 }, { -59, 524, 333 }, { 59, 524, 333 }, - { 0, 306, 339 }, { 0, 224, 357 }, { 162, 48, 567 }, { 156, -52, 567 }, - { -77, 126, 434 }, { -156, -52, 567 }, { -90, 127, 567 }, { 88, 127, 567 }, - { -67, -114, 567 }, { 66, -114, 567 }, { 76, 126, 434 }, { -157, 46, 567 }, + { 434, 326, -209 }, { 283, 371, -268 }, { 344, 531, -97 }, { 360, 187, -363 }, { 162, -260, 265 }, + { 172, -251, 175 }, { 218, -191, 287 }, { 173, 279, 296 }, { 192, 226, 279 }, { 233, 346, 216 }, + { 135, -283, 182 }, { 165, -299, 114 }, { 283, -7, -283 }, { 252, -41, -396 }, { 339, 63, -209 }, + { 128, 20, 390 }, { 203, -50, 366 }, { 219, 24, 358 }, { 127, -74, 423 }, { 0, -125, 459 }, + { 125, -76, 401 }, { 83, 86, 359 }, { 124, 85, 409 }, { 144, 91, 567 }, { 151, 5, 459 }, + { 65, -67, 636 }, { 106, -104, 567 }, { 117, 1, 636 }, { 0, 141, 459 }, { 0, 139, 567 }, + { 66, 80, 636 }, { 99, -284, 284 }, { 125, -295, 252 }, { 343, -31, 227 }, { 296, 35, 287 }, + { 267, -115, 314 }, { 374, -65, 73 }, { 366, -103, 153 }, { 369, -90, 62 }, { 77, -339, 122 }, + { 94, -363, 22 }, { 0, -123, 567 }, { 63, -198, 357 }, { 115, -178, 351 }, { 53, -167, 398 }, + { 311, 79, 200 }, { 265, 141, 195 }, { 242, 98, 288 }, { 54, 306, 339 }, { 127, 314, 325 }, + { 123, 383, 276 }, { 195, 158, 286 }, { 490, 222, -179 }, { 410, 149, -123 }, { 281, 383, 493 }, + { 349, 313, 311 }, { 243, 407, 458 }, { 323, 286, 131 }, { 445, 241, -29 }, { 466, 126, -176 }, + { 432, 145, -125 }, { 465, 96, -107 }, { 327, -122, -180 }, { 348, -73, -156 }, { 297, -152, -126 }, + { 496, 52, -220 }, { 424, 90, -198 }, { 431, 480, -59 }, { 356, 611, 78 }, { 119, 770, 199 }, + { 243, 714, 165 }, { 183, 744, 77 }, { 117, 190, -556 }, { 206, 36, -541 }, { 273, -85, -230 }, + { 132, 423, 573 }, { 263, 636, 246 }, { 236, 536, 288 }, { 318, 452, 218 }, { 114, 573, -114 }, + { 49, 394, -230 }, { 127, 365, -303 }, { 41, 126, 357 }, { 0, 127, 368 }, { 342, -114, -82 }, + { 144, -241, 291 }, { 128, -226, 276 }, { 0, -112, 421 }, { 385, 17, -116 }, { 430, 29, -155 }, + { 484, -69, -165 }, { 436, -20, -205 }, { 504, 4, -195 }, { 308, -167, 222 }, { 288, -237, 119 }, + { 341, -164, 56 }, { 257, -234, -64 }, { 143, 91, 333 }, { 35, -227, 201 }, { 0, -293, 274 }, + { 66, -283, 272 }, { 91, -149, 273 }, { 50, -217, 325 }, { 74, -107, 155 }, { 75, -227, 201 }, + { 74, -321, 190 }, { 186, -226, -173 }, { 97, -313, -200 }, { 159, -331, 5 }, { 157, -164, 336 }, + { 162, -139, 369 }, { 164, -190, 319 }, { 156, -150, 317 }, { 41, -314, 282 }, { 62, -329, 252 }, + { 0, -342, 252 }, { 0, -339, 190 }, { 0, -371, 136 }, { 379, 21, -58 }, { 345, -32, -2 }, + { 375, -21, -59 }, { 314, 331, 289 }, { 425, -38, -132 }, { 483, 49, -147 }, { 177, 107, 315 }, + { 311, 216, 143 }, { 56, 131, 305 }, { 82, 87, 283 }, { 59, 268, 295 }, { 0, 383, 308 }, + { 46, 224, 357 }, { 73, 297, 289 }, { 124, 305, 270 }, { 161, 275, 258 }, { 181, 226, 248 }, + { 167, 123, 248 }, { 138, 92, 249 }, { 348, -76, -25 }, { 416, -115, -95 }, { 396, 155, -77 }, + { 345, 5, -6 }, { 407, 80, -78 }, { 399, 192, -5 }, { 351, 211, 49 }, { 385, -16, 93 }, + { 471, 410, 0 }, { 406, 344, 72 }, { 299, 642, -9 }, { 99, 678, -16 }, { 61, 746, 77 }, + { 0, 662, 326 }, { 144, 693, 290 }, { 367, 553, 169 }, { 246, -69, -335 }, { 179, 521, 305 }, + { 145, 447, 317 }, { 67, 655, 314 }, { 148, 624, 303 }, { 237, 378, 229 }, { 127, -190, 213 }, + { 168, 2, 567 }, { 0, 1, 662 }, { 209, 314, -391 }, { 41, 354, -332 }, { 406, 115, -313 }, + { 260, -175, -198 }, { 90, -361, -92 }, { 401, -99, -132 }, { 470, -19, -130 }, { 355, 55, 133 }, + { 325, 107, 130 }, { 411, 73, 85 }, { 362, 145, 57 }, { 83, 298, -450 }, { -41, 354, -332 }, + { -83, 298, -450 }, { -112, 190, -556 }, { -2, -382, 60 }, { -90, -361, -92 }, { -97, -313, -200 }, + { 108, -241, -280 }, { 0, -238, -280 }, { -67, 80, 636 }, { -66, -67, 636 }, { -113, 529, 326 }, + { -179, 521, 305 }, { -145, 447, 317 }, { -74, -107, 155 }, { -50, -217, 325 }, { -35, -227, 201 }, + { 0, 3, -569 }, { 0, -42, -443 }, { -119, 770, 199 }, { -99, 678, -16 }, { -114, 573, -114 }, + { -61, 746, 77 }, { -54, 306, 339 }, { -46, 224, 357 }, { -63, -198, 357 }, { -53, -167, 398 }, + { 98, -67, -392 }, { 127, 441, 523 }, { 0, 423, 573 }, { 292, -219, -231 }, { 78, -230, -456 }, + { 56, -257, -404 }, { 32, -210, -431 }, { 124, -217, -428 }, { 125, -185, -370 }, { 97, -166, -483 }, + { 56, -159, -486 }, { -3, -72, -404 }, { -3, -174, -377 }, { 303, -200, -423 }, { 243, -262, -358 }, + { 204, -203, -428 }, { 241, -139, -464 }, { 166, -110, -445 }, { 277, -93, -416 }, { 174, -205, -404 }, + { 294, -239, -381 }, { 258, -243, -302 }, { 345, -172, -370 }, { 342, -132, -280 }, { 382, 54, -197 }, + { 439, 41, -227 }, { 389, 29, -202 }, { 390, -13, -203 }, { 412, -69, -184 }, { 422, -63, -95 }, + { 0, 440, 529 }, { 364, 16, 148 }, { 424, 39, 39 }, { 401, 29, 97 }, { 391, 132, 5 }, + { 395, 101, -33 }, { 172, -260, -335 }, { 103, -257, -404 }, { 295, -131, -457 }, { 403, 171, -41 }, + { -471, 410, 0 }, { -490, 222, -179 }, { -445, 241, -29 }, { -410, 149, -123 }, { -396, 155, -77 }, + { -403, 171, -41 }, { -323, 286, 131 }, { -406, 344, 72 }, { -399, 192, -5 }, { -318, 452, 218 }, + { -209, 314, -391 }, { -283, 371, -268 }, { -127, 365, -303 }, { -98, -67, -392 }, { -125, -185, -370 }, + { -166, -110, -445 }, { -246, -69, -335 }, { -277, -93, -416 }, { -342, -132, -280 }, { -292, -219, -231 }, + { -258, -243, -302 }, { -113, -243, -280 }, { -172, -260, -335 }, { -358, 57, 132 }, { -363, 17, 151 }, + { -311, 79, 200 }, { -407, 29, 97 }, { -345, 5, -6 }, { -395, 101, -33 }, { -391, 132, 5 }, + { -351, 211, 49 }, { -362, 145, 57 }, { -385, -16, 93 }, { -343, -31, 227 }, { -283, -7, -287 }, + { -273, -85, -230 }, { -360, 187, -363 }, { -206, 36, -541 }, { -406, 115, -313 }, { -303, -200, -423 }, + { -345, -172, -370 }, { -295, -131, -457 }, { -241, -139, -464 }, { -204, -203, -428 }, { -294, -239, -381 }, + { -243, -262, -358 }, { -78, -230, -456 }, { -56, -159, -486 }, { -32, -210, -431 }, { -97, -166, -483 }, + { -124, -217, -428 }, { -103, -257, -404 }, { -56, -257, -404 }, { -174, -205, -404 }, { -311, 216, 143 }, + { -418, 39, 39 }, { -411, 73, 85 }, { -327, 106, 129 }, { -374, -65, 73 }, { -348, -76, -25 }, + { -345, -167, 56 }, { -369, -90, 62 }, { -345, -32, -2 }, { -237, 378, 229 }, { -314, 331, 289 }, + { -243, 407, 458 }, { -127, 441, 523 }, { -439, 41, -227 }, { -436, -20, -205 }, { -504, 4, -195 }, + { -416, -115, -95 }, { -422, -63, -95 }, { -339, 63, -209 }, { -348, -73, -156 }, { -390, -13, -203 }, + { -401, -99, -132 }, { -342, -114, -82 }, { -484, -69, -165 }, { -412, -69, -184 }, { -470, -19, -130 }, + { -425, -38, -132 }, { -375, -21, -59 }, { -407, 80, -78 }, { -385, 17, -116 }, { -379, 21, -58 }, + { -424, 90, -198 }, { -382, 54, -197 }, { -389, 29, -202 }, { -496, 52, -220 }, { -483, 49, -147 }, + { -466, 126, -176 }, { -432, 145, -125 }, { -465, 96, -107 }, { -186, -226, -173 }, { -260, -175, -198 }, + { -132, 423, 573 }, { -94, -363, 22 }, { -77, -339, 122 }, { -123, 383, 276 }, { -252, -20, -373 }, + { -430, 29, -155 }, { -254, -230, -63 }, { -159, -331, 5 }, { -297, -152, -126 }, { -322, -122, -180 }, + { -49, 394, -230 }, { -145, 91, 567 }, { -124, 85, 409 }, { -169, 2, 567 }, { -151, 5, 459 }, + { -119, -69, 429 }, { -106, -104, 567 }, { -118, 1, 636 }, { -128, 20, 390 }, { -115, -178, 351 }, + { -157, -164, 336 }, { -155, -149, 317 }, { -127, -190, 214 }, { -75, -227, 201 }, { -367, 553, 169 }, + { -236, 536, 288 }, { -263, 636, 246 }, { -148, 624, 303 }, { -144, 693, 290 }, { -67, 655, 314 }, + { -434, 326, -209 }, { -243, 714, 165 }, { -356, 611, 78 }, { -183, 744, 77 }, { -299, 642, -9 }, + { -344, 531, -97 }, { -366, -103, 153 }, { -267, -115, 314 }, { -296, 35, 287 }, { -242, 98, 288 }, + { -192, 221, 279 }, { -162, -139, 369 }, { -91, -147, 273 }, { -288, -237, 119 }, { -165, -299, 114 }, + { -172, -251, 176 }, { -219, 24, 358 }, { -143, 91, 333 }, { -203, -50, 366 }, { -125, -76, 401 }, + { -82, 87, 288 }, { -83, 86, 359 }, { -41, 126, 357 }, { -138, 92, 254 }, { -177, 107, 311 }, + { -167, 120, 250 }, { -198, 155, 286 }, { -181, 221, 239 }, { -161, 268, 247 }, { -169, 277, 296 }, + { -124, 298, 270 }, { -127, 314, 325 }, { -73, 290, 291 }, { -56, 128, 309 }, { -59, 261, 299 }, + { -265, 141, 195 }, { -233, 346, 207 }, { -281, 383, 493 }, { -349, 313, 311 }, { -308, -167, 222 }, + { -135, -283, 182 }, { -74, -321, 190 }, { -218, -191, 287 }, { -164, -187, 321 }, { -162, -260, 265 }, + { -144, -241, 291 }, { -99, -284, 283 }, { -62, -329, 252 }, { -41, -314, 282 }, { -66, -284, 272 }, + { -125, -295, 252 }, { -127, -226, 276 }, { -431, 480, -59 }, { 0, -320, 282 }, { -181, 161, 238 }, + { 0, 461, 348 }, { -72, 454, 336 }, { 72, 454, 336 }, { 181, 165, 241 }, { 0, 529, 345 }, + { 113, 529, 326 }, { -59, 524, 333 }, { 59, 524, 333 }, { 0, 306, 339 }, { 0, 224, 357 }, + { 162, 48, 567 }, { 156, -52, 567 }, { -77, 126, 434 }, { -156, -52, 567 }, { -90, 127, 567 }, + { 88, 127, 567 }, { -67, -114, 567 }, { 66, -114, 567 }, { 76, 126, 434 }, { -157, 46, 567 }, }; static struct GdVtxData mario_Face_VtxInfo = { ARRAY_COUNT(mario_Face_VtxData), 0x1, mario_Face_VtxData }; static u16 mario_Face_FaceData[][4] = { - { 0, 43, 102, 112 }, { 0, 102, 42, 188 }, { 0, 354, 356, 188 }, { 0, 188, 198, 354 }, - { 0, 198, 188, 42 }, { 0, 43, 42, 102 }, { 1, 4, 5, 6 }, { 1, 7, 8, 9 }, - { 1, 10, 11, 5 }, { 1, 15, 16, 17 }, { 1, 18, 19, 20 }, { 1, 21, 22, 15 }, - { 1, 23, 24, 22 }, { 1, 27, 25, 26 }, { 1, 27, 26, 431 }, { 1, 435, 23, 22 }, - { 1, 30, 23, 435 }, { 1, 4, 31, 32 }, { 1, 33, 34, 35 }, { 1, 36, 37, 38 }, - { 1, 11, 39, 40 }, { 1, 437, 26, 25 }, { 1, 18, 26, 19 }, { 1, 42, 43, 44 }, - { 1, 45, 46, 47 }, { 1, 48, 49, 50 }, { 1, 47, 46, 51 }, { 1, 59, 60, 61 }, - { 1, 62, 63, 64 }, { 1, 59, 65, 66 }, { 1, 34, 33, 45 }, { 1, 24, 15, 22 }, - { 1, 20, 15, 18 }, { 1, 82, 83, 28 }, { 1, 82, 28, 438 }, { 1, 84, 64, 63 }, - { 1, 85, 86, 31 }, { 1, 87, 20, 19 }, { 1, 35, 16, 20 }, { 1, 88, 89, 61 }, - { 1, 90, 91, 92 }, { 1, 6, 5, 93 }, { 1, 94, 95, 37 }, { 1, 96, 95, 94 }, - { 1, 21, 15, 97 }, { 1, 10, 32, 105 }, { 1, 87, 44, 20 }, { 1, 106, 96, 107 }, - { 1, 96, 64, 95 }, { 1, 94, 108, 96 }, { 1, 109, 35, 110 }, { 1, 35, 109, 6 }, - { 1, 111, 109, 112 }, { 1, 100, 99, 113 }, { 1, 114, 113, 115 }, { 1, 114, 32, 31 }, - { 1, 113, 31, 100 }, { 1, 5, 4, 10 }, { 1, 105, 114, 116 }, { 1, 4, 85, 31 }, - { 1, 109, 111, 6 }, { 1, 6, 85, 4 }, { 1, 37, 93, 94 }, { 1, 35, 6, 93 }, - { 1, 35, 93, 37 }, { 1, 20, 44, 110 }, { 1, 20, 110, 35 }, { 1, 38, 37, 95 }, - { 1, 84, 95, 64 }, { 1, 105, 117, 39 }, { 1, 10, 39, 11 }, { 1, 108, 94, 11 }, - { 1, 94, 93, 5 }, { 1, 118, 119, 120 }, { 1, 57, 9, 8 }, { 1, 88, 122, 89 }, - { 1, 123, 59, 61 }, { 1, 49, 7, 9 }, { 1, 47, 51, 124 }, { 1, 47, 124, 97 }, - { 1, 125, 8, 46 }, { 1, 50, 129, 48 }, { 1, 126, 130, 82 }, { 1, 128, 131, 48 }, - { 1, 131, 49, 48 }, { 1, 132, 7, 49 }, { 1, 133, 8, 7 }, { 1, 134, 51, 8 }, - { 1, 135, 124, 51 }, { 1, 136, 97, 124 }, { 1, 127, 21, 97 }, { 1, 127, 82, 21 }, - { 1, 34, 17, 35 }, { 1, 35, 17, 16 }, { 1, 15, 20, 16 }, { 1, 97, 15, 17 }, - { 1, 47, 97, 17 }, { 1, 34, 47, 17 }, { 1, 137, 84, 138 }, { 1, 88, 120, 122 }, - { 1, 84, 137, 95 }, { 1, 94, 5, 11 }, { 1, 110, 44, 43 }, { 1, 60, 53, 139 }, - { 1, 140, 141, 139 }, { 1, 57, 8, 125 }, { 1, 118, 140, 119 }, { 1, 34, 45, 47 }, - { 1, 37, 144, 33 }, { 1, 37, 33, 35 }, { 1, 18, 15, 24 }, { 1, 431, 26, 18 }, - { 1, 30, 27, 23 }, { 1, 161, 27, 30 }, { 1, 161, 25, 27 }, { 1, 430, 23, 27 }, - { 1, 431, 160, 27 }, { 1, 19, 26, 437 }, { 1, 19, 437, 41 }, { 1, 430, 160, 24 }, - { 1, 106, 64, 96 }, { 1, 40, 166, 108 }, { 1, 166, 107, 108 }, { 1, 96, 108, 107 }, - { 1, 84, 63, 167 }, { 1, 89, 168, 123 }, { 1, 123, 61, 89 }, { 1, 59, 123, 65 }, - { 1, 88, 118, 120 }, { 1, 59, 66, 53 }, { 1, 61, 139, 141 }, { 1, 61, 141, 88 }, - { 1, 169, 170, 45 }, { 1, 39, 177, 40 }, { 1, 178, 166, 177 }, { 1, 107, 166, 179 }, - { 1, 180, 107, 181 }, { 1, 161, 30, 182 }, { 1, 183, 25, 161 }, { 1, 129, 196, 428 }, - { 1, 428, 196, 197 }, { 1, 429, 197, 387 }, { 1, 198, 44, 199 }, { 1, 199, 44, 87 }, - { 1, 182, 30, 29 }, { 1, 41, 25, 183 }, { 1, 180, 165, 106 }, { 1, 180, 106, 107 }, - { 1, 139, 61, 60 }, { 1, 59, 53, 60 }, { 1, 65, 123, 92 }, { 1, 224, 66, 225 }, - { 1, 226, 225, 91 }, { 1, 227, 91, 228 }, { 1, 63, 227, 228 }, { 1, 63, 228, 167 }, - { 1, 91, 90, 228 }, { 1, 66, 224, 53 }, { 1, 118, 141, 140 }, { 1, 141, 118, 88 }, - { 1, 90, 92, 168 }, { 1, 120, 229, 122 }, { 1, 119, 137, 120 }, { 1, 90, 229, 138 }, - { 1, 168, 122, 229 }, { 1, 90, 167, 228 }, { 1, 90, 138, 167 }, { 1, 167, 138, 84 }, - { 1, 138, 229, 137 }, { 1, 225, 92, 91 }, { 1, 231, 45, 33 }, { 1, 140, 144, 119 }, - { 1, 137, 119, 38 }, { 1, 137, 38, 95 }, { 1, 125, 170, 172 }, { 1, 36, 119, 144 }, - { 1, 57, 125, 143 }, { 1, 144, 231, 33 }, { 1, 169, 45, 231 }, { 1, 263, 264, 265 }, - { 1, 272, 273, 264 }, { 1, 246, 270, 294 }, { 1, 298, 272, 267 }, { 1, 294, 271, 297 }, - { 1, 299, 300, 301 }, { 1, 299, 301, 302 }, { 1, 302, 298, 267 }, { 1, 264, 273, 265 }, - { 1, 307, 308, 309 }, { 1, 310, 299, 311 }, { 1, 315, 316, 310 }, { 1, 317, 315, 310 }, - { 1, 317, 318, 315 }, { 1, 319, 311, 320 }, { 1, 317, 310, 311 }, { 1, 302, 321, 299 }, - { 1, 321, 320, 311 }, { 1, 317, 319, 309 }, { 1, 322, 323, 324 }, { 1, 324, 267, 322 }, - { 1, 325, 243, 326 }, { 1, 308, 318, 317 }, { 1, 313, 315, 318 }, { 1, 313, 318, 314 }, - { 1, 314, 318, 308 }, { 1, 327, 308, 307 }, { 1, 326, 307, 325 }, { 1, 328, 309, 329 }, - { 1, 330, 331, 243 }, { 1, 244, 331, 332 }, { 1, 261, 179, 333 }, { 1, 261, 333, 334 }, - { 1, 336, 177, 337 }, { 1, 178, 177, 336 }, { 1, 263, 265, 297 }, { 1, 332, 323, 322 }, - { 1, 332, 322, 244 }, { 1, 330, 243, 325 }, { 1, 323, 321, 324 }, { 1, 330, 328, 329 }, - { 1, 329, 340, 332 }, { 1, 340, 329, 319 }, { 1, 316, 315, 313 }, { 1, 341, 179, 342 }, - { 1, 178, 342, 179 }, { 1, 336, 342, 178 }, { 1, 333, 341, 343 }, { 1, 434, 29, 28 }, - { 1, 349, 350, 433 }, { 1, 436, 351, 19 }, { 1, 436, 19, 41 }, { 1, 433, 351, 352 }, - { 1, 161, 352, 183 }, { 1, 161, 182, 352 }, { 1, 350, 349, 353 }, { 1, 354, 355, 356 }, - { 1, 371, 372, 273 }, { 1, 371, 273, 272 }, { 1, 373, 374, 265 }, { 1, 324, 302, 267 }, - { 1, 246, 294, 375 }, { 1, 267, 244, 322 }, { 1, 331, 244, 243 }, { 1, 376, 354, 199 }, - { 1, 378, 379, 380 }, { 1, 316, 300, 299 }, { 1, 323, 320, 321 }, { 1, 299, 310, 316 }, - { 1, 373, 381, 374 }, { 1, 374, 381, 382 }, { 1, 382, 381, 353 }, { 1, 353, 383, 384 }, - { 1, 372, 383, 381 }, { 1, 373, 372, 381 }, { 1, 385, 386, 387 }, { 1, 385, 382, 386 }, - { 1, 388, 389, 382 }, { 1, 390, 391, 389 }, { 1, 392, 375, 391 }, { 1, 393, 394, 375 }, - { 1, 395, 396, 394 }, { 1, 397, 196, 396 }, { 1, 399, 197, 196 }, { 1, 398, 387, 197 }, - { 1, 338, 196, 129 }, { 1, 401, 394, 396 }, { 1, 294, 400, 375 }, { 1, 374, 382, 389 }, - { 1, 374, 389, 391 }, { 1, 329, 332, 330 }, { 1, 323, 340, 320 }, { 1, 246, 375, 401 }, - { 1, 324, 321, 302 }, { 1, 378, 380, 404 }, { 1, 342, 379, 378 }, { 1, 405, 379, 337 }, - { 1, 406, 337, 117 }, { 1, 316, 343, 300 }, { 1, 301, 300, 371 }, { 1, 384, 372, 376 }, - { 1, 384, 376, 199 }, { 1, 372, 371, 404 }, { 1, 372, 404, 407 }, { 1, 371, 378, 404 }, - { 1, 356, 355, 408 }, { 1, 407, 409, 410 }, { 1, 355, 407, 408 }, { 1, 409, 411, 410 }, - { 1, 406, 116, 412 }, { 1, 380, 405, 409 }, { 1, 413, 414, 411 }, { 1, 412, 411, 415 }, - { 1, 412, 115, 413 }, { 1, 414, 413, 99 }, { 1, 372, 407, 355 }, { 1, 355, 376, 372 }, - { 1, 300, 341, 378 }, { 1, 341, 300, 343 }, { 1, 333, 179, 341 }, { 1, 87, 384, 199 }, - { 1, 405, 406, 415 }, { 1, 386, 382, 353 }, { 1, 342, 378, 341 }, { 1, 378, 371, 300 }, - { 1, 407, 404, 380 }, { 1, 317, 309, 308 }, { 1, 323, 332, 340 }, { 1, 372, 384, 383 }, - { 1, 87, 19, 384 }, { 1, 347, 432, 387 }, { 1, 410, 411, 416 }, { 1, 384, 350, 353 }, - { 1, 349, 347, 353 }, { 1, 373, 265, 273 }, { 1, 330, 325, 328 }, { 1, 343, 316, 313 }, - { 1, 330, 332, 331 }, { 1, 374, 391, 400 }, { 1, 196, 338, 396 }, { 1, 265, 374, 400 }, - { 1, 198, 199, 354 }, { 1, 350, 19, 351 }, { 1, 436, 41, 183 }, { 1, 379, 336, 337 }, - { 1, 298, 301, 371 }, { 1, 273, 372, 373 }, { 1, 409, 415, 411 }, { 1, 434, 346, 182 }, - { 1, 183, 352, 351 }, { 1, 346, 347, 349 }, { 1, 386, 353, 347 }, { 1, 350, 384, 19 }, - { 1, 353, 381, 383 }, { 1, 405, 380, 379 }, { 1, 394, 401, 375 }, { 1, 409, 407, 380 }, - { 1, 342, 336, 379 }, { 1, 307, 328, 325 }, { 1, 414, 416, 411 }, { 1, 412, 415, 406 }, - { 1, 418, 99, 413 }, { 1, 418, 413, 115 }, { 1, 413, 411, 412 }, { 1, 415, 409, 405 }, - { 1, 115, 412, 116 }, { 1, 116, 406, 117 }, { 1, 406, 405, 337 }, { 1, 391, 375, 400 }, - { 1, 399, 398, 197 }, { 1, 395, 397, 396 }, { 1, 393, 395, 394 }, { 1, 392, 393, 375 }, - { 1, 419, 392, 391 }, { 1, 419, 391, 390 }, { 1, 390, 389, 388 }, { 1, 388, 382, 385 }, - { 1, 398, 385, 387 }, { 1, 355, 354, 376 }, { 1, 298, 371, 272 }, { 1, 334, 333, 343 }, - { 1, 320, 340, 319 }, { 1, 400, 297, 265 }, { 1, 117, 337, 177 }, { 1, 327, 307, 326 }, - { 1, 314, 308, 327 }, { 1, 329, 309, 319 }, { 1, 319, 317, 311 }, { 1, 321, 311, 299 }, - { 1, 328, 307, 309 }, { 1, 298, 302, 301 }, { 1, 400, 294, 297 }, { 1, 271, 294, 270 }, - { 1, 172, 143, 125 }, { 1, 46, 170, 125 }, { 1, 36, 38, 119 }, { 1, 65, 92, 225 }, - { 1, 120, 137, 229 }, { 1, 168, 229, 90 }, { 1, 123, 168, 92 }, { 1, 227, 226, 91 }, - { 1, 226, 224, 225 }, { 1, 42, 44, 198 }, { 1, 117, 177, 39 }, { 1, 179, 181, 107 }, - { 1, 261, 181, 179 }, { 1, 178, 179, 166 }, { 1, 46, 45, 170 }, { 1, 122, 168, 89 }, - { 1, 165, 64, 106 }, { 1, 112, 109, 43 }, { 1, 36, 144, 37 }, { 1, 109, 110, 43 }, - { 1, 126, 82, 127 }, { 1, 136, 127, 97 }, { 1, 135, 136, 124 }, { 1, 423, 135, 51 }, - { 1, 423, 51, 134 }, { 1, 134, 8, 133 }, { 1, 133, 7, 132 }, { 1, 132, 49, 131 }, - { 1, 128, 130, 126 }, { 1, 51, 46, 8 }, { 1, 105, 39, 10 }, { 1, 116, 117, 105 }, - { 1, 115, 116, 114 }, { 1, 32, 10, 4 }, { 1, 113, 114, 31 }, { 1, 418, 115, 113 }, - { 1, 418, 113, 99 }, { 1, 114, 105, 32 }, { 1, 100, 31, 86 }, { 1, 225, 66, 65 }, - { 1, 108, 11, 40 }, { 1, 166, 40, 177 }, { 1, 64, 165, 62 }, { 1, 343, 313, 344 }, - { 1, 343, 344, 334 }, { 1, 111, 85, 6 }, { 1, 112, 86, 111 }, { 1, 408, 410, 416 }, - { 1, 407, 410, 408 }, { 1, 416, 356, 408 }, { 1, 86, 85, 111 }, { 1, 428, 48, 129 }, - { 1, 428, 429, 130 }, { 1, 130, 429, 83 }, { 1, 387, 83, 429 }, { 1, 83, 82, 130 }, - { 1, 130, 48, 428 }, { 1, 197, 429, 428 }, { 1, 438, 22, 21 }, { 1, 432, 28, 83 }, - { 1, 432, 83, 387 }, { 1, 387, 386, 347 }, { 1, 21, 82, 438 }, { 1, 347, 346, 434 }, - { 1, 28, 29, 435 }, { 1, 183, 351, 436 }, { 1, 25, 41, 437 }, { 1, 27, 160, 430 }, - { 1, 24, 23, 430 }, { 1, 431, 18, 24 }, { 1, 24, 160, 431 }, { 1, 350, 351, 433 }, - { 1, 433, 348, 349 }, { 1, 352, 348, 433 }, { 1, 435, 29, 30 }, { 1, 182, 29, 434 }, - { 1, 28, 432, 434 }, { 1, 435, 438, 28 }, { 1, 434, 432, 347 }, { 1, 22, 438, 435 }, - { 1, 396, 338, 401 }, { 1, 9, 50, 49 }, { 1, 196, 397, 399 }, { 1, 48, 130, 128 }, - { 1, 349, 348, 439 }, { 1, 439, 348, 352 }, { 1, 439, 346, 349 }, { 1, 439, 348, 352 }, - { 1, 439, 352, 182 }, { 1, 182, 346, 439 }, { 2, 12, 13, 14 }, { 2, 153, 13, 12 }, - { 2, 153, 191, 13 }, { 2, 153, 200, 191 }, { 2, 256, 191, 253 }, { 2, 256, 274, 339 }, - { 2, 274, 312, 339 }, { 2, 256, 339, 191 }, { 3, 184, 185, 186 }, { 3, 156, 150, 424 }, - { 3, 155, 154, 425 }, { 3, 426, 421, 420 }, { 3, 420, 422, 427 }, { 3, 184, 364, 362 }, - { 3, 157, 156, 425 }, { 3, 150, 364, 424 }, { 3, 362, 185, 184 }, { 3, 425, 154, 157 }, - { 4, 126, 127, 128 }, { 4, 398, 399, 385 }, { 4, 388, 385, 399 }, { 4, 390, 388, 399 }, - { 4, 419, 390, 399 }, { 4, 392, 419, 399 }, { 4, 393, 392, 399 }, { 4, 395, 393, 399 }, - { 4, 397, 395, 399 }, { 4, 136, 128, 127 }, { 4, 135, 128, 136 }, { 4, 423, 128, 135 }, - { 4, 134, 128, 423 }, { 4, 133, 128, 134 }, { 4, 132, 128, 133 }, { 4, 131, 128, 132 }, - { 5, 14, 63, 74 }, { 5, 14, 74, 12 }, { 5, 142, 57, 143 }, { 5, 74, 62, 165 }, - { 5, 170, 171, 172 }, { 5, 180, 203, 165 }, { 5, 204, 205, 206 }, { 5, 207, 200, 208 }, - { 5, 209, 210, 200 }, { 5, 211, 206, 212 }, { 5, 181, 212, 206 }, { 5, 213, 214, 215 }, - { 5, 216, 217, 218 }, { 5, 216, 219, 217 }, { 5, 220, 221, 214 }, { 5, 222, 223, 221 }, - { 5, 222, 218, 223 }, { 5, 14, 224, 226 }, { 5, 14, 226, 227 }, { 5, 14, 53, 224 }, - { 5, 14, 227, 63 }, { 5, 232, 171, 233 }, { 5, 232, 233, 144 }, { 5, 234, 172, 171 }, - { 5, 233, 231, 144 }, { 5, 171, 170, 169 }, { 5, 232, 234, 171 }, { 5, 140, 235, 232 }, - { 5, 140, 232, 144 }, { 5, 210, 206, 211 }, { 5, 180, 207, 208 }, { 5, 236, 219, 214 }, - { 5, 205, 181, 206 }, { 5, 209, 200, 207 }, { 5, 237, 207, 180 }, { 5, 205, 180, 181 }, - { 5, 237, 180, 205 }, { 5, 211, 200, 210 }, { 5, 204, 237, 205 }, { 5, 204, 207, 237 }, - { 5, 204, 209, 207 }, { 5, 204, 210, 209 }, { 5, 204, 206, 210 }, { 5, 213, 220, 214 }, - { 5, 213, 222, 220 }, { 5, 216, 238, 213 }, { 5, 213, 215, 216 }, { 5, 213, 238, 222 }, - { 5, 12, 74, 153 }, { 5, 143, 172, 234 }, { 5, 239, 234, 235 }, { 5, 239, 235, 139 }, - { 5, 139, 235, 140 }, { 5, 169, 231, 233 }, { 5, 180, 208, 236 }, { 5, 180, 236, 203 }, - { 5, 203, 221, 223 }, { 5, 153, 223, 218 }, { 5, 200, 153, 217 }, { 5, 200, 217, 208 }, - { 5, 253, 254, 255 }, { 5, 253, 255, 256 }, { 5, 256, 257, 258 }, { 5, 259, 258, 260 }, - { 5, 261, 259, 262 }, { 5, 261, 262, 254 }, { 5, 263, 266, 264 }, { 5, 244, 267, 268 }, - { 5, 245, 244, 268 }, { 5, 245, 268, 269 }, { 5, 270, 269, 271 }, { 5, 274, 256, 275 }, - { 5, 279, 280, 281 }, { 5, 279, 282, 283 }, { 5, 282, 279, 281 }, { 5, 279, 284, 280 }, - { 5, 279, 285, 284 }, { 5, 286, 287, 288 }, { 5, 286, 289, 287 }, { 5, 286, 290, 289 }, - { 5, 286, 291, 290 }, { 5, 286, 292, 291 }, { 5, 211, 287, 253 }, { 5, 291, 292, 261 }, - { 5, 292, 181, 261 }, { 5, 291, 261, 290 }, { 5, 289, 290, 253 }, { 5, 292, 288, 181 }, - { 5, 212, 288, 211 }, { 5, 262, 285, 293 }, { 5, 261, 254, 290 }, { 5, 287, 211, 288 }, - { 5, 267, 272, 295 }, { 5, 267, 295, 268 }, { 5, 295, 296, 269 }, { 5, 296, 263, 297 }, - { 5, 266, 272, 264 }, { 5, 269, 296, 271 }, { 5, 295, 272, 266 }, { 5, 295, 266, 296 }, - { 5, 312, 313, 314 }, { 5, 312, 326, 243 }, { 5, 312, 314, 327 }, { 5, 312, 327, 326 }, - { 5, 280, 258, 257 }, { 5, 280, 260, 258 }, { 5, 285, 262, 260 }, { 5, 282, 255, 293 }, - { 5, 282, 257, 255 }, { 5, 279, 283, 285 }, { 5, 181, 288, 212 }, { 5, 289, 253, 287 }, - { 5, 290, 254, 253 }, { 5, 286, 288, 292 }, { 5, 261, 334, 259 }, { 5, 297, 271, 296 }, - { 5, 275, 334, 344 }, { 5, 312, 275, 313 }, { 5, 248, 270, 246 }, { 5, 275, 344, 313 }, - { 5, 312, 274, 275 }, { 5, 284, 285, 260 }, { 5, 236, 214, 221 }, { 5, 259, 334, 275 }, - { 5, 211, 253, 191 }, { 5, 281, 257, 282 }, { 5, 283, 282, 293 }, { 5, 284, 260, 280 }, - { 5, 281, 280, 257 }, { 5, 266, 263, 296 }, { 5, 268, 295, 269 }, { 5, 283, 293, 285 }, - { 5, 248, 269, 270 }, { 5, 248, 245, 269 }, { 5, 293, 254, 262 }, { 5, 260, 262, 259 }, - { 5, 275, 258, 259 }, { 5, 275, 256, 258 }, { 5, 257, 256, 255 }, { 5, 293, 255, 254 }, - { 5, 219, 208, 217 }, { 5, 218, 217, 153 }, { 5, 74, 223, 153 }, { 5, 74, 203, 223 }, - { 5, 221, 203, 236 }, { 5, 219, 236, 208 }, { 5, 142, 234, 239 }, { 5, 142, 143, 234 }, - { 5, 191, 200, 211 }, { 5, 215, 214, 219 }, { 5, 235, 234, 232 }, { 5, 233, 171, 169 }, - { 5, 238, 218, 222 }, { 5, 220, 222, 221 }, { 5, 215, 219, 216 }, { 5, 238, 216, 218 }, - { 5, 203, 74, 165 }, { 5, 74, 63, 62 }, { 6, 98, 99, 100 }, { 6, 101, 102, 103 }, - { 6, 104, 100, 86 }, { 6, 112, 101, 103 }, { 6, 103, 98, 104 }, { 6, 103, 104, 159 }, - { 6, 103, 159, 112 }, { 6, 102, 101, 112 }, { 6, 103, 102, 187 }, { 6, 99, 98, 189 }, - { 6, 189, 98, 103 }, { 6, 189, 103, 187 }, { 6, 187, 356, 357 }, { 6, 187, 357, 358 }, - { 6, 187, 358, 189 }, { 6, 356, 187, 377 }, { 6, 358, 416, 414 }, { 6, 377, 187, 188 }, - { 6, 189, 414, 99 }, { 6, 358, 414, 189 }, { 6, 357, 416, 358 }, { 6, 357, 356, 416 }, - { 6, 356, 377, 188 }, { 6, 188, 187, 102 }, { 6, 159, 86, 112 }, { 6, 159, 104, 86 }, - { 6, 104, 98, 100 }, { 7, 0, 1, 2 }, { 7, 3, 1, 0 }, { 7, 52, 53, 14 }, - { 7, 54, 55, 56 }, { 7, 55, 9, 57 }, { 7, 53, 52, 58 }, { 7, 67, 2, 68 }, - { 7, 69, 70, 71 }, { 7, 72, 3, 73 }, { 7, 54, 56, 75 }, { 7, 76, 77, 78 }, - { 7, 2, 1, 79 }, { 7, 80, 1, 81 }, { 7, 75, 50, 54 }, { 7, 57, 121, 55 }, - { 7, 54, 50, 55 }, { 7, 145, 78, 146 }, { 7, 2, 79, 147 }, { 7, 71, 70, 147 }, - { 7, 147, 148, 71 }, { 7, 71, 149, 69 }, { 7, 150, 151, 69 }, { 7, 52, 0, 145 }, - { 7, 152, 145, 68 }, { 7, 76, 68, 70 }, { 7, 151, 70, 69 }, { 7, 52, 3, 0 }, - { 7, 80, 79, 1 }, { 7, 77, 154, 155 }, { 7, 151, 156, 157 }, { 7, 151, 157, 76 }, - { 7, 155, 158, 77 }, { 7, 158, 57, 78 }, { 7, 152, 78, 145 }, { 7, 72, 162, 3 }, - { 7, 80, 81, 163 }, { 7, 52, 14, 164 }, { 7, 52, 164, 3 }, { 7, 72, 173, 162 }, - { 7, 173, 174, 163 }, { 7, 175, 72, 176 }, { 7, 72, 73, 190 }, { 7, 150, 69, 192 }, - { 7, 69, 149, 192 }, { 7, 193, 79, 194 }, { 7, 195, 148, 193 }, { 7, 79, 80, 194 }, - { 7, 50, 75, 129 }, { 7, 75, 201, 202 }, { 7, 155, 230, 201 }, { 7, 155, 201, 56 }, - { 7, 155, 56, 121 }, { 7, 158, 121, 57 }, { 7, 3, 164, 73 }, { 7, 175, 174, 173 }, - { 7, 162, 173, 81 }, { 7, 162, 81, 1 }, { 7, 57, 146, 78 }, { 7, 239, 58, 142 }, - { 7, 57, 142, 146 }, { 7, 139, 58, 239 }, { 7, 53, 58, 139 }, { 7, 145, 58, 52 }, - { 7, 240, 241, 242 }, { 7, 243, 244, 242 }, { 7, 244, 245, 242 }, { 7, 246, 247, 248 }, - { 7, 245, 248, 242 }, { 7, 246, 249, 247 }, { 7, 250, 251, 252 }, { 7, 250, 252, 175 }, - { 7, 276, 277, 278 }, { 7, 303, 246, 304 }, { 7, 186, 304, 305 }, { 7, 186, 305, 306 }, - { 7, 186, 306, 230 }, { 7, 335, 202, 306 }, { 7, 338, 129, 335 }, { 7, 339, 277, 191 }, - { 7, 176, 250, 175 }, { 7, 241, 276, 278 }, { 7, 241, 278, 312 }, { 7, 345, 174, 252 }, - { 7, 176, 276, 250 }, { 7, 359, 240, 249 }, { 7, 303, 249, 246 }, { 7, 186, 360, 303 }, - { 7, 361, 185, 362 }, { 7, 363, 364, 150 }, { 7, 360, 186, 185 }, { 7, 345, 251, 194 }, - { 7, 241, 365, 276 }, { 7, 339, 278, 277 }, { 7, 363, 192, 366 }, { 7, 361, 366, 367 }, - { 7, 359, 367, 240 }, { 7, 241, 240, 365 }, { 7, 150, 192, 363 }, { 7, 368, 192, 195 }, - { 7, 369, 368, 193 }, { 7, 368, 369, 366 }, { 7, 370, 369, 194 }, { 7, 240, 247, 249 }, - { 7, 402, 403, 338 }, { 7, 246, 403, 304 }, { 7, 335, 402, 338 }, { 7, 345, 252, 251 }, - { 7, 370, 194, 251 }, { 7, 361, 249, 360 }, { 7, 402, 335, 305 }, { 7, 176, 277, 276 }, - { 7, 192, 368, 366 }, { 7, 417, 367, 370 }, { 7, 243, 242, 241 }, { 7, 403, 246, 401 }, - { 7, 402, 305, 403 }, { 7, 241, 312, 243 }, { 7, 276, 365, 251 }, { 7, 365, 370, 251 }, - { 7, 417, 370, 365 }, { 7, 250, 276, 251 }, { 7, 304, 403, 305 }, { 7, 369, 370, 367 }, - { 7, 306, 305, 335 }, { 7, 359, 249, 361 }, { 7, 401, 338, 403 }, { 7, 193, 194, 369 }, - { 7, 367, 366, 369 }, { 7, 195, 193, 368 }, { 7, 417, 365, 240 }, { 7, 417, 240, 367 }, - { 7, 359, 361, 367 }, { 7, 361, 363, 366 }, { 7, 360, 185, 361 }, { 7, 249, 303, 360 }, - { 7, 163, 174, 80 }, { 7, 190, 191, 277 }, { 7, 202, 335, 129 }, { 7, 230, 306, 202 }, - { 7, 421, 186, 230 }, { 7, 421, 230, 420 }, { 7, 303, 304, 186 }, { 7, 174, 175, 252 }, - { 7, 242, 248, 247 }, { 7, 247, 240, 242 }, { 7, 146, 58, 145 }, { 7, 58, 146, 142 }, - { 7, 163, 81, 173 }, { 7, 158, 155, 121 }, { 7, 230, 155, 422 }, { 7, 230, 422, 420 }, - { 7, 230, 202, 201 }, { 7, 202, 129, 75 }, { 7, 345, 194, 80 }, { 7, 149, 148, 195 }, - { 7, 148, 79, 193 }, { 7, 195, 192, 149 }, { 7, 190, 73, 191 }, { 7, 176, 72, 190 }, - { 7, 277, 176, 190 }, { 7, 173, 72, 175 }, { 7, 78, 77, 158 }, { 7, 77, 76, 154 }, - { 7, 76, 70, 151 }, { 7, 152, 68, 76 }, { 7, 67, 68, 145 }, { 7, 67, 145, 0 }, - { 7, 149, 71, 148 }, { 7, 68, 147, 70 }, { 7, 148, 147, 79 }, { 7, 9, 55, 50 }, - { 7, 152, 76, 78 }, { 7, 201, 75, 56 }, { 7, 147, 68, 2 }, { 7, 121, 56, 55 }, - { 7, 164, 14, 13 }, { 7, 162, 1, 3 }, { 7, 67, 0, 2 }, { 7, 345, 80, 174 }, - { 7, 73, 13, 191 }, { 7, 73, 164, 13 }, { 7, 312, 278, 339 }, { 7, 186, 421, 184 }, - { 7, 420, 424, 426 }, { 7, 422, 425, 427 }, { 7, 426, 424, 364 }, { 7, 425, 156, 427 }, - { 7, 363, 361, 362 }, { 7, 362, 364, 363 }, { 7, 157, 154, 76 }, { 7, 151, 150, 156 }, - { 7, 421, 426, 184 }, { 7, 422, 155, 425 }, { 7, 420, 427, 424 }, { 7, 364, 184, 426 }, - { 7, 156, 424, 427 }, + { 0, 43, 102, 112 }, { 0, 102, 42, 188 }, { 0, 354, 356, 188 }, { 0, 188, 198, 354 }, { 0, 198, 188, 42 }, + { 0, 43, 42, 102 }, { 1, 4, 5, 6 }, { 1, 7, 8, 9 }, { 1, 10, 11, 5 }, { 1, 15, 16, 17 }, + { 1, 18, 19, 20 }, { 1, 21, 22, 15 }, { 1, 23, 24, 22 }, { 1, 27, 25, 26 }, { 1, 27, 26, 431 }, + { 1, 435, 23, 22 }, { 1, 30, 23, 435 }, { 1, 4, 31, 32 }, { 1, 33, 34, 35 }, { 1, 36, 37, 38 }, + { 1, 11, 39, 40 }, { 1, 437, 26, 25 }, { 1, 18, 26, 19 }, { 1, 42, 43, 44 }, { 1, 45, 46, 47 }, + { 1, 48, 49, 50 }, { 1, 47, 46, 51 }, { 1, 59, 60, 61 }, { 1, 62, 63, 64 }, { 1, 59, 65, 66 }, + { 1, 34, 33, 45 }, { 1, 24, 15, 22 }, { 1, 20, 15, 18 }, { 1, 82, 83, 28 }, { 1, 82, 28, 438 }, + { 1, 84, 64, 63 }, { 1, 85, 86, 31 }, { 1, 87, 20, 19 }, { 1, 35, 16, 20 }, { 1, 88, 89, 61 }, + { 1, 90, 91, 92 }, { 1, 6, 5, 93 }, { 1, 94, 95, 37 }, { 1, 96, 95, 94 }, { 1, 21, 15, 97 }, + { 1, 10, 32, 105 }, { 1, 87, 44, 20 }, { 1, 106, 96, 107 }, { 1, 96, 64, 95 }, { 1, 94, 108, 96 }, + { 1, 109, 35, 110 }, { 1, 35, 109, 6 }, { 1, 111, 109, 112 }, { 1, 100, 99, 113 }, { 1, 114, 113, 115 }, + { 1, 114, 32, 31 }, { 1, 113, 31, 100 }, { 1, 5, 4, 10 }, { 1, 105, 114, 116 }, { 1, 4, 85, 31 }, + { 1, 109, 111, 6 }, { 1, 6, 85, 4 }, { 1, 37, 93, 94 }, { 1, 35, 6, 93 }, { 1, 35, 93, 37 }, + { 1, 20, 44, 110 }, { 1, 20, 110, 35 }, { 1, 38, 37, 95 }, { 1, 84, 95, 64 }, { 1, 105, 117, 39 }, + { 1, 10, 39, 11 }, { 1, 108, 94, 11 }, { 1, 94, 93, 5 }, { 1, 118, 119, 120 }, { 1, 57, 9, 8 }, + { 1, 88, 122, 89 }, { 1, 123, 59, 61 }, { 1, 49, 7, 9 }, { 1, 47, 51, 124 }, { 1, 47, 124, 97 }, + { 1, 125, 8, 46 }, { 1, 50, 129, 48 }, { 1, 126, 130, 82 }, { 1, 128, 131, 48 }, { 1, 131, 49, 48 }, + { 1, 132, 7, 49 }, { 1, 133, 8, 7 }, { 1, 134, 51, 8 }, { 1, 135, 124, 51 }, { 1, 136, 97, 124 }, + { 1, 127, 21, 97 }, { 1, 127, 82, 21 }, { 1, 34, 17, 35 }, { 1, 35, 17, 16 }, { 1, 15, 20, 16 }, + { 1, 97, 15, 17 }, { 1, 47, 97, 17 }, { 1, 34, 47, 17 }, { 1, 137, 84, 138 }, { 1, 88, 120, 122 }, + { 1, 84, 137, 95 }, { 1, 94, 5, 11 }, { 1, 110, 44, 43 }, { 1, 60, 53, 139 }, { 1, 140, 141, 139 }, + { 1, 57, 8, 125 }, { 1, 118, 140, 119 }, { 1, 34, 45, 47 }, { 1, 37, 144, 33 }, { 1, 37, 33, 35 }, + { 1, 18, 15, 24 }, { 1, 431, 26, 18 }, { 1, 30, 27, 23 }, { 1, 161, 27, 30 }, { 1, 161, 25, 27 }, + { 1, 430, 23, 27 }, { 1, 431, 160, 27 }, { 1, 19, 26, 437 }, { 1, 19, 437, 41 }, { 1, 430, 160, 24 }, + { 1, 106, 64, 96 }, { 1, 40, 166, 108 }, { 1, 166, 107, 108 }, { 1, 96, 108, 107 }, { 1, 84, 63, 167 }, + { 1, 89, 168, 123 }, { 1, 123, 61, 89 }, { 1, 59, 123, 65 }, { 1, 88, 118, 120 }, { 1, 59, 66, 53 }, + { 1, 61, 139, 141 }, { 1, 61, 141, 88 }, { 1, 169, 170, 45 }, { 1, 39, 177, 40 }, { 1, 178, 166, 177 }, + { 1, 107, 166, 179 }, { 1, 180, 107, 181 }, { 1, 161, 30, 182 }, { 1, 183, 25, 161 }, { 1, 129, 196, 428 }, + { 1, 428, 196, 197 }, { 1, 429, 197, 387 }, { 1, 198, 44, 199 }, { 1, 199, 44, 87 }, { 1, 182, 30, 29 }, + { 1, 41, 25, 183 }, { 1, 180, 165, 106 }, { 1, 180, 106, 107 }, { 1, 139, 61, 60 }, { 1, 59, 53, 60 }, + { 1, 65, 123, 92 }, { 1, 224, 66, 225 }, { 1, 226, 225, 91 }, { 1, 227, 91, 228 }, { 1, 63, 227, 228 }, + { 1, 63, 228, 167 }, { 1, 91, 90, 228 }, { 1, 66, 224, 53 }, { 1, 118, 141, 140 }, { 1, 141, 118, 88 }, + { 1, 90, 92, 168 }, { 1, 120, 229, 122 }, { 1, 119, 137, 120 }, { 1, 90, 229, 138 }, { 1, 168, 122, 229 }, + { 1, 90, 167, 228 }, { 1, 90, 138, 167 }, { 1, 167, 138, 84 }, { 1, 138, 229, 137 }, { 1, 225, 92, 91 }, + { 1, 231, 45, 33 }, { 1, 140, 144, 119 }, { 1, 137, 119, 38 }, { 1, 137, 38, 95 }, { 1, 125, 170, 172 }, + { 1, 36, 119, 144 }, { 1, 57, 125, 143 }, { 1, 144, 231, 33 }, { 1, 169, 45, 231 }, { 1, 263, 264, 265 }, + { 1, 272, 273, 264 }, { 1, 246, 270, 294 }, { 1, 298, 272, 267 }, { 1, 294, 271, 297 }, { 1, 299, 300, 301 }, + { 1, 299, 301, 302 }, { 1, 302, 298, 267 }, { 1, 264, 273, 265 }, { 1, 307, 308, 309 }, { 1, 310, 299, 311 }, + { 1, 315, 316, 310 }, { 1, 317, 315, 310 }, { 1, 317, 318, 315 }, { 1, 319, 311, 320 }, { 1, 317, 310, 311 }, + { 1, 302, 321, 299 }, { 1, 321, 320, 311 }, { 1, 317, 319, 309 }, { 1, 322, 323, 324 }, { 1, 324, 267, 322 }, + { 1, 325, 243, 326 }, { 1, 308, 318, 317 }, { 1, 313, 315, 318 }, { 1, 313, 318, 314 }, { 1, 314, 318, 308 }, + { 1, 327, 308, 307 }, { 1, 326, 307, 325 }, { 1, 328, 309, 329 }, { 1, 330, 331, 243 }, { 1, 244, 331, 332 }, + { 1, 261, 179, 333 }, { 1, 261, 333, 334 }, { 1, 336, 177, 337 }, { 1, 178, 177, 336 }, { 1, 263, 265, 297 }, + { 1, 332, 323, 322 }, { 1, 332, 322, 244 }, { 1, 330, 243, 325 }, { 1, 323, 321, 324 }, { 1, 330, 328, 329 }, + { 1, 329, 340, 332 }, { 1, 340, 329, 319 }, { 1, 316, 315, 313 }, { 1, 341, 179, 342 }, { 1, 178, 342, 179 }, + { 1, 336, 342, 178 }, { 1, 333, 341, 343 }, { 1, 434, 29, 28 }, { 1, 349, 350, 433 }, { 1, 436, 351, 19 }, + { 1, 436, 19, 41 }, { 1, 433, 351, 352 }, { 1, 161, 352, 183 }, { 1, 161, 182, 352 }, { 1, 350, 349, 353 }, + { 1, 354, 355, 356 }, { 1, 371, 372, 273 }, { 1, 371, 273, 272 }, { 1, 373, 374, 265 }, { 1, 324, 302, 267 }, + { 1, 246, 294, 375 }, { 1, 267, 244, 322 }, { 1, 331, 244, 243 }, { 1, 376, 354, 199 }, { 1, 378, 379, 380 }, + { 1, 316, 300, 299 }, { 1, 323, 320, 321 }, { 1, 299, 310, 316 }, { 1, 373, 381, 374 }, { 1, 374, 381, 382 }, + { 1, 382, 381, 353 }, { 1, 353, 383, 384 }, { 1, 372, 383, 381 }, { 1, 373, 372, 381 }, { 1, 385, 386, 387 }, + { 1, 385, 382, 386 }, { 1, 388, 389, 382 }, { 1, 390, 391, 389 }, { 1, 392, 375, 391 }, { 1, 393, 394, 375 }, + { 1, 395, 396, 394 }, { 1, 397, 196, 396 }, { 1, 399, 197, 196 }, { 1, 398, 387, 197 }, { 1, 338, 196, 129 }, + { 1, 401, 394, 396 }, { 1, 294, 400, 375 }, { 1, 374, 382, 389 }, { 1, 374, 389, 391 }, { 1, 329, 332, 330 }, + { 1, 323, 340, 320 }, { 1, 246, 375, 401 }, { 1, 324, 321, 302 }, { 1, 378, 380, 404 }, { 1, 342, 379, 378 }, + { 1, 405, 379, 337 }, { 1, 406, 337, 117 }, { 1, 316, 343, 300 }, { 1, 301, 300, 371 }, { 1, 384, 372, 376 }, + { 1, 384, 376, 199 }, { 1, 372, 371, 404 }, { 1, 372, 404, 407 }, { 1, 371, 378, 404 }, { 1, 356, 355, 408 }, + { 1, 407, 409, 410 }, { 1, 355, 407, 408 }, { 1, 409, 411, 410 }, { 1, 406, 116, 412 }, { 1, 380, 405, 409 }, + { 1, 413, 414, 411 }, { 1, 412, 411, 415 }, { 1, 412, 115, 413 }, { 1, 414, 413, 99 }, { 1, 372, 407, 355 }, + { 1, 355, 376, 372 }, { 1, 300, 341, 378 }, { 1, 341, 300, 343 }, { 1, 333, 179, 341 }, { 1, 87, 384, 199 }, + { 1, 405, 406, 415 }, { 1, 386, 382, 353 }, { 1, 342, 378, 341 }, { 1, 378, 371, 300 }, { 1, 407, 404, 380 }, + { 1, 317, 309, 308 }, { 1, 323, 332, 340 }, { 1, 372, 384, 383 }, { 1, 87, 19, 384 }, { 1, 347, 432, 387 }, + { 1, 410, 411, 416 }, { 1, 384, 350, 353 }, { 1, 349, 347, 353 }, { 1, 373, 265, 273 }, { 1, 330, 325, 328 }, + { 1, 343, 316, 313 }, { 1, 330, 332, 331 }, { 1, 374, 391, 400 }, { 1, 196, 338, 396 }, { 1, 265, 374, 400 }, + { 1, 198, 199, 354 }, { 1, 350, 19, 351 }, { 1, 436, 41, 183 }, { 1, 379, 336, 337 }, { 1, 298, 301, 371 }, + { 1, 273, 372, 373 }, { 1, 409, 415, 411 }, { 1, 434, 346, 182 }, { 1, 183, 352, 351 }, { 1, 346, 347, 349 }, + { 1, 386, 353, 347 }, { 1, 350, 384, 19 }, { 1, 353, 381, 383 }, { 1, 405, 380, 379 }, { 1, 394, 401, 375 }, + { 1, 409, 407, 380 }, { 1, 342, 336, 379 }, { 1, 307, 328, 325 }, { 1, 414, 416, 411 }, { 1, 412, 415, 406 }, + { 1, 418, 99, 413 }, { 1, 418, 413, 115 }, { 1, 413, 411, 412 }, { 1, 415, 409, 405 }, { 1, 115, 412, 116 }, + { 1, 116, 406, 117 }, { 1, 406, 405, 337 }, { 1, 391, 375, 400 }, { 1, 399, 398, 197 }, { 1, 395, 397, 396 }, + { 1, 393, 395, 394 }, { 1, 392, 393, 375 }, { 1, 419, 392, 391 }, { 1, 419, 391, 390 }, { 1, 390, 389, 388 }, + { 1, 388, 382, 385 }, { 1, 398, 385, 387 }, { 1, 355, 354, 376 }, { 1, 298, 371, 272 }, { 1, 334, 333, 343 }, + { 1, 320, 340, 319 }, { 1, 400, 297, 265 }, { 1, 117, 337, 177 }, { 1, 327, 307, 326 }, { 1, 314, 308, 327 }, + { 1, 329, 309, 319 }, { 1, 319, 317, 311 }, { 1, 321, 311, 299 }, { 1, 328, 307, 309 }, { 1, 298, 302, 301 }, + { 1, 400, 294, 297 }, { 1, 271, 294, 270 }, { 1, 172, 143, 125 }, { 1, 46, 170, 125 }, { 1, 36, 38, 119 }, + { 1, 65, 92, 225 }, { 1, 120, 137, 229 }, { 1, 168, 229, 90 }, { 1, 123, 168, 92 }, { 1, 227, 226, 91 }, + { 1, 226, 224, 225 }, { 1, 42, 44, 198 }, { 1, 117, 177, 39 }, { 1, 179, 181, 107 }, { 1, 261, 181, 179 }, + { 1, 178, 179, 166 }, { 1, 46, 45, 170 }, { 1, 122, 168, 89 }, { 1, 165, 64, 106 }, { 1, 112, 109, 43 }, + { 1, 36, 144, 37 }, { 1, 109, 110, 43 }, { 1, 126, 82, 127 }, { 1, 136, 127, 97 }, { 1, 135, 136, 124 }, + { 1, 423, 135, 51 }, { 1, 423, 51, 134 }, { 1, 134, 8, 133 }, { 1, 133, 7, 132 }, { 1, 132, 49, 131 }, + { 1, 128, 130, 126 }, { 1, 51, 46, 8 }, { 1, 105, 39, 10 }, { 1, 116, 117, 105 }, { 1, 115, 116, 114 }, + { 1, 32, 10, 4 }, { 1, 113, 114, 31 }, { 1, 418, 115, 113 }, { 1, 418, 113, 99 }, { 1, 114, 105, 32 }, + { 1, 100, 31, 86 }, { 1, 225, 66, 65 }, { 1, 108, 11, 40 }, { 1, 166, 40, 177 }, { 1, 64, 165, 62 }, + { 1, 343, 313, 344 }, { 1, 343, 344, 334 }, { 1, 111, 85, 6 }, { 1, 112, 86, 111 }, { 1, 408, 410, 416 }, + { 1, 407, 410, 408 }, { 1, 416, 356, 408 }, { 1, 86, 85, 111 }, { 1, 428, 48, 129 }, { 1, 428, 429, 130 }, + { 1, 130, 429, 83 }, { 1, 387, 83, 429 }, { 1, 83, 82, 130 }, { 1, 130, 48, 428 }, { 1, 197, 429, 428 }, + { 1, 438, 22, 21 }, { 1, 432, 28, 83 }, { 1, 432, 83, 387 }, { 1, 387, 386, 347 }, { 1, 21, 82, 438 }, + { 1, 347, 346, 434 }, { 1, 28, 29, 435 }, { 1, 183, 351, 436 }, { 1, 25, 41, 437 }, { 1, 27, 160, 430 }, + { 1, 24, 23, 430 }, { 1, 431, 18, 24 }, { 1, 24, 160, 431 }, { 1, 350, 351, 433 }, { 1, 433, 348, 349 }, + { 1, 352, 348, 433 }, { 1, 435, 29, 30 }, { 1, 182, 29, 434 }, { 1, 28, 432, 434 }, { 1, 435, 438, 28 }, + { 1, 434, 432, 347 }, { 1, 22, 438, 435 }, { 1, 396, 338, 401 }, { 1, 9, 50, 49 }, { 1, 196, 397, 399 }, + { 1, 48, 130, 128 }, { 1, 349, 348, 439 }, { 1, 439, 348, 352 }, { 1, 439, 346, 349 }, { 1, 439, 348, 352 }, + { 1, 439, 352, 182 }, { 1, 182, 346, 439 }, { 2, 12, 13, 14 }, { 2, 153, 13, 12 }, { 2, 153, 191, 13 }, + { 2, 153, 200, 191 }, { 2, 256, 191, 253 }, { 2, 256, 274, 339 }, { 2, 274, 312, 339 }, { 2, 256, 339, 191 }, + { 3, 184, 185, 186 }, { 3, 156, 150, 424 }, { 3, 155, 154, 425 }, { 3, 426, 421, 420 }, { 3, 420, 422, 427 }, + { 3, 184, 364, 362 }, { 3, 157, 156, 425 }, { 3, 150, 364, 424 }, { 3, 362, 185, 184 }, { 3, 425, 154, 157 }, + { 4, 126, 127, 128 }, { 4, 398, 399, 385 }, { 4, 388, 385, 399 }, { 4, 390, 388, 399 }, { 4, 419, 390, 399 }, + { 4, 392, 419, 399 }, { 4, 393, 392, 399 }, { 4, 395, 393, 399 }, { 4, 397, 395, 399 }, { 4, 136, 128, 127 }, + { 4, 135, 128, 136 }, { 4, 423, 128, 135 }, { 4, 134, 128, 423 }, { 4, 133, 128, 134 }, { 4, 132, 128, 133 }, + { 4, 131, 128, 132 }, { 5, 14, 63, 74 }, { 5, 14, 74, 12 }, { 5, 142, 57, 143 }, { 5, 74, 62, 165 }, + { 5, 170, 171, 172 }, { 5, 180, 203, 165 }, { 5, 204, 205, 206 }, { 5, 207, 200, 208 }, { 5, 209, 210, 200 }, + { 5, 211, 206, 212 }, { 5, 181, 212, 206 }, { 5, 213, 214, 215 }, { 5, 216, 217, 218 }, { 5, 216, 219, 217 }, + { 5, 220, 221, 214 }, { 5, 222, 223, 221 }, { 5, 222, 218, 223 }, { 5, 14, 224, 226 }, { 5, 14, 226, 227 }, + { 5, 14, 53, 224 }, { 5, 14, 227, 63 }, { 5, 232, 171, 233 }, { 5, 232, 233, 144 }, { 5, 234, 172, 171 }, + { 5, 233, 231, 144 }, { 5, 171, 170, 169 }, { 5, 232, 234, 171 }, { 5, 140, 235, 232 }, { 5, 140, 232, 144 }, + { 5, 210, 206, 211 }, { 5, 180, 207, 208 }, { 5, 236, 219, 214 }, { 5, 205, 181, 206 }, { 5, 209, 200, 207 }, + { 5, 237, 207, 180 }, { 5, 205, 180, 181 }, { 5, 237, 180, 205 }, { 5, 211, 200, 210 }, { 5, 204, 237, 205 }, + { 5, 204, 207, 237 }, { 5, 204, 209, 207 }, { 5, 204, 210, 209 }, { 5, 204, 206, 210 }, { 5, 213, 220, 214 }, + { 5, 213, 222, 220 }, { 5, 216, 238, 213 }, { 5, 213, 215, 216 }, { 5, 213, 238, 222 }, { 5, 12, 74, 153 }, + { 5, 143, 172, 234 }, { 5, 239, 234, 235 }, { 5, 239, 235, 139 }, { 5, 139, 235, 140 }, { 5, 169, 231, 233 }, + { 5, 180, 208, 236 }, { 5, 180, 236, 203 }, { 5, 203, 221, 223 }, { 5, 153, 223, 218 }, { 5, 200, 153, 217 }, + { 5, 200, 217, 208 }, { 5, 253, 254, 255 }, { 5, 253, 255, 256 }, { 5, 256, 257, 258 }, { 5, 259, 258, 260 }, + { 5, 261, 259, 262 }, { 5, 261, 262, 254 }, { 5, 263, 266, 264 }, { 5, 244, 267, 268 }, { 5, 245, 244, 268 }, + { 5, 245, 268, 269 }, { 5, 270, 269, 271 }, { 5, 274, 256, 275 }, { 5, 279, 280, 281 }, { 5, 279, 282, 283 }, + { 5, 282, 279, 281 }, { 5, 279, 284, 280 }, { 5, 279, 285, 284 }, { 5, 286, 287, 288 }, { 5, 286, 289, 287 }, + { 5, 286, 290, 289 }, { 5, 286, 291, 290 }, { 5, 286, 292, 291 }, { 5, 211, 287, 253 }, { 5, 291, 292, 261 }, + { 5, 292, 181, 261 }, { 5, 291, 261, 290 }, { 5, 289, 290, 253 }, { 5, 292, 288, 181 }, { 5, 212, 288, 211 }, + { 5, 262, 285, 293 }, { 5, 261, 254, 290 }, { 5, 287, 211, 288 }, { 5, 267, 272, 295 }, { 5, 267, 295, 268 }, + { 5, 295, 296, 269 }, { 5, 296, 263, 297 }, { 5, 266, 272, 264 }, { 5, 269, 296, 271 }, { 5, 295, 272, 266 }, + { 5, 295, 266, 296 }, { 5, 312, 313, 314 }, { 5, 312, 326, 243 }, { 5, 312, 314, 327 }, { 5, 312, 327, 326 }, + { 5, 280, 258, 257 }, { 5, 280, 260, 258 }, { 5, 285, 262, 260 }, { 5, 282, 255, 293 }, { 5, 282, 257, 255 }, + { 5, 279, 283, 285 }, { 5, 181, 288, 212 }, { 5, 289, 253, 287 }, { 5, 290, 254, 253 }, { 5, 286, 288, 292 }, + { 5, 261, 334, 259 }, { 5, 297, 271, 296 }, { 5, 275, 334, 344 }, { 5, 312, 275, 313 }, { 5, 248, 270, 246 }, + { 5, 275, 344, 313 }, { 5, 312, 274, 275 }, { 5, 284, 285, 260 }, { 5, 236, 214, 221 }, { 5, 259, 334, 275 }, + { 5, 211, 253, 191 }, { 5, 281, 257, 282 }, { 5, 283, 282, 293 }, { 5, 284, 260, 280 }, { 5, 281, 280, 257 }, + { 5, 266, 263, 296 }, { 5, 268, 295, 269 }, { 5, 283, 293, 285 }, { 5, 248, 269, 270 }, { 5, 248, 245, 269 }, + { 5, 293, 254, 262 }, { 5, 260, 262, 259 }, { 5, 275, 258, 259 }, { 5, 275, 256, 258 }, { 5, 257, 256, 255 }, + { 5, 293, 255, 254 }, { 5, 219, 208, 217 }, { 5, 218, 217, 153 }, { 5, 74, 223, 153 }, { 5, 74, 203, 223 }, + { 5, 221, 203, 236 }, { 5, 219, 236, 208 }, { 5, 142, 234, 239 }, { 5, 142, 143, 234 }, { 5, 191, 200, 211 }, + { 5, 215, 214, 219 }, { 5, 235, 234, 232 }, { 5, 233, 171, 169 }, { 5, 238, 218, 222 }, { 5, 220, 222, 221 }, + { 5, 215, 219, 216 }, { 5, 238, 216, 218 }, { 5, 203, 74, 165 }, { 5, 74, 63, 62 }, { 6, 98, 99, 100 }, + { 6, 101, 102, 103 }, { 6, 104, 100, 86 }, { 6, 112, 101, 103 }, { 6, 103, 98, 104 }, { 6, 103, 104, 159 }, + { 6, 103, 159, 112 }, { 6, 102, 101, 112 }, { 6, 103, 102, 187 }, { 6, 99, 98, 189 }, { 6, 189, 98, 103 }, + { 6, 189, 103, 187 }, { 6, 187, 356, 357 }, { 6, 187, 357, 358 }, { 6, 187, 358, 189 }, { 6, 356, 187, 377 }, + { 6, 358, 416, 414 }, { 6, 377, 187, 188 }, { 6, 189, 414, 99 }, { 6, 358, 414, 189 }, { 6, 357, 416, 358 }, + { 6, 357, 356, 416 }, { 6, 356, 377, 188 }, { 6, 188, 187, 102 }, { 6, 159, 86, 112 }, { 6, 159, 104, 86 }, + { 6, 104, 98, 100 }, { 7, 0, 1, 2 }, { 7, 3, 1, 0 }, { 7, 52, 53, 14 }, { 7, 54, 55, 56 }, + { 7, 55, 9, 57 }, { 7, 53, 52, 58 }, { 7, 67, 2, 68 }, { 7, 69, 70, 71 }, { 7, 72, 3, 73 }, + { 7, 54, 56, 75 }, { 7, 76, 77, 78 }, { 7, 2, 1, 79 }, { 7, 80, 1, 81 }, { 7, 75, 50, 54 }, + { 7, 57, 121, 55 }, { 7, 54, 50, 55 }, { 7, 145, 78, 146 }, { 7, 2, 79, 147 }, { 7, 71, 70, 147 }, + { 7, 147, 148, 71 }, { 7, 71, 149, 69 }, { 7, 150, 151, 69 }, { 7, 52, 0, 145 }, { 7, 152, 145, 68 }, + { 7, 76, 68, 70 }, { 7, 151, 70, 69 }, { 7, 52, 3, 0 }, { 7, 80, 79, 1 }, { 7, 77, 154, 155 }, + { 7, 151, 156, 157 }, { 7, 151, 157, 76 }, { 7, 155, 158, 77 }, { 7, 158, 57, 78 }, { 7, 152, 78, 145 }, + { 7, 72, 162, 3 }, { 7, 80, 81, 163 }, { 7, 52, 14, 164 }, { 7, 52, 164, 3 }, { 7, 72, 173, 162 }, + { 7, 173, 174, 163 }, { 7, 175, 72, 176 }, { 7, 72, 73, 190 }, { 7, 150, 69, 192 }, { 7, 69, 149, 192 }, + { 7, 193, 79, 194 }, { 7, 195, 148, 193 }, { 7, 79, 80, 194 }, { 7, 50, 75, 129 }, { 7, 75, 201, 202 }, + { 7, 155, 230, 201 }, { 7, 155, 201, 56 }, { 7, 155, 56, 121 }, { 7, 158, 121, 57 }, { 7, 3, 164, 73 }, + { 7, 175, 174, 173 }, { 7, 162, 173, 81 }, { 7, 162, 81, 1 }, { 7, 57, 146, 78 }, { 7, 239, 58, 142 }, + { 7, 57, 142, 146 }, { 7, 139, 58, 239 }, { 7, 53, 58, 139 }, { 7, 145, 58, 52 }, { 7, 240, 241, 242 }, + { 7, 243, 244, 242 }, { 7, 244, 245, 242 }, { 7, 246, 247, 248 }, { 7, 245, 248, 242 }, { 7, 246, 249, 247 }, + { 7, 250, 251, 252 }, { 7, 250, 252, 175 }, { 7, 276, 277, 278 }, { 7, 303, 246, 304 }, { 7, 186, 304, 305 }, + { 7, 186, 305, 306 }, { 7, 186, 306, 230 }, { 7, 335, 202, 306 }, { 7, 338, 129, 335 }, { 7, 339, 277, 191 }, + { 7, 176, 250, 175 }, { 7, 241, 276, 278 }, { 7, 241, 278, 312 }, { 7, 345, 174, 252 }, { 7, 176, 276, 250 }, + { 7, 359, 240, 249 }, { 7, 303, 249, 246 }, { 7, 186, 360, 303 }, { 7, 361, 185, 362 }, { 7, 363, 364, 150 }, + { 7, 360, 186, 185 }, { 7, 345, 251, 194 }, { 7, 241, 365, 276 }, { 7, 339, 278, 277 }, { 7, 363, 192, 366 }, + { 7, 361, 366, 367 }, { 7, 359, 367, 240 }, { 7, 241, 240, 365 }, { 7, 150, 192, 363 }, { 7, 368, 192, 195 }, + { 7, 369, 368, 193 }, { 7, 368, 369, 366 }, { 7, 370, 369, 194 }, { 7, 240, 247, 249 }, { 7, 402, 403, 338 }, + { 7, 246, 403, 304 }, { 7, 335, 402, 338 }, { 7, 345, 252, 251 }, { 7, 370, 194, 251 }, { 7, 361, 249, 360 }, + { 7, 402, 335, 305 }, { 7, 176, 277, 276 }, { 7, 192, 368, 366 }, { 7, 417, 367, 370 }, { 7, 243, 242, 241 }, + { 7, 403, 246, 401 }, { 7, 402, 305, 403 }, { 7, 241, 312, 243 }, { 7, 276, 365, 251 }, { 7, 365, 370, 251 }, + { 7, 417, 370, 365 }, { 7, 250, 276, 251 }, { 7, 304, 403, 305 }, { 7, 369, 370, 367 }, { 7, 306, 305, 335 }, + { 7, 359, 249, 361 }, { 7, 401, 338, 403 }, { 7, 193, 194, 369 }, { 7, 367, 366, 369 }, { 7, 195, 193, 368 }, + { 7, 417, 365, 240 }, { 7, 417, 240, 367 }, { 7, 359, 361, 367 }, { 7, 361, 363, 366 }, { 7, 360, 185, 361 }, + { 7, 249, 303, 360 }, { 7, 163, 174, 80 }, { 7, 190, 191, 277 }, { 7, 202, 335, 129 }, { 7, 230, 306, 202 }, + { 7, 421, 186, 230 }, { 7, 421, 230, 420 }, { 7, 303, 304, 186 }, { 7, 174, 175, 252 }, { 7, 242, 248, 247 }, + { 7, 247, 240, 242 }, { 7, 146, 58, 145 }, { 7, 58, 146, 142 }, { 7, 163, 81, 173 }, { 7, 158, 155, 121 }, + { 7, 230, 155, 422 }, { 7, 230, 422, 420 }, { 7, 230, 202, 201 }, { 7, 202, 129, 75 }, { 7, 345, 194, 80 }, + { 7, 149, 148, 195 }, { 7, 148, 79, 193 }, { 7, 195, 192, 149 }, { 7, 190, 73, 191 }, { 7, 176, 72, 190 }, + { 7, 277, 176, 190 }, { 7, 173, 72, 175 }, { 7, 78, 77, 158 }, { 7, 77, 76, 154 }, { 7, 76, 70, 151 }, + { 7, 152, 68, 76 }, { 7, 67, 68, 145 }, { 7, 67, 145, 0 }, { 7, 149, 71, 148 }, { 7, 68, 147, 70 }, + { 7, 148, 147, 79 }, { 7, 9, 55, 50 }, { 7, 152, 76, 78 }, { 7, 201, 75, 56 }, { 7, 147, 68, 2 }, + { 7, 121, 56, 55 }, { 7, 164, 14, 13 }, { 7, 162, 1, 3 }, { 7, 67, 0, 2 }, { 7, 345, 80, 174 }, + { 7, 73, 13, 191 }, { 7, 73, 164, 13 }, { 7, 312, 278, 339 }, { 7, 186, 421, 184 }, { 7, 420, 424, 426 }, + { 7, 422, 425, 427 }, { 7, 426, 424, 364 }, { 7, 425, 156, 427 }, { 7, 363, 361, 362 }, { 7, 362, 364, 363 }, + { 7, 157, 154, 76 }, { 7, 151, 150, 156 }, { 7, 421, 426, 184 }, { 7, 422, 155, 425 }, { 7, 420, 427, 424 }, + { 7, 364, 184, 426 }, { 7, 156, 424, 427 }, }; static struct GdFaceData mario_Face_FaceInfo = { ARRAY_COUNT(mario_Face_FaceData), 0x1, mario_Face_FaceData }; @@ -349,58 +283,58 @@ struct DynList dynlist_mario_face_shape[] = { BeginList(), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_FACE_VTX_GROUP), - LinkWithPtr(&mario_Face_VtxInfo), + LinkWithPtr(&mario_Face_VtxInfo), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_FACE_TRI_GROUP), - LinkWithPtr(&mario_Face_FaceInfo), + LinkWithPtr(&mario_Face_FaceInfo), StartGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), - // Teeth color - MakeDynObj(D_MATERIAL, 0), - SetId(0), - SetAmbient(1.0, 1.0, 1.0), - SetDiffuse(1.0, 1.0, 1.0), - // Face color - MakeDynObj(D_MATERIAL, 0), - SetId(1), - SetAmbient(0.883, 0.602, 0.408), - SetDiffuse(0.883, 0.602, 0.408), - // Shadow on back of hat - MakeDynObj(D_MATERIAL, 0), - SetId(2), - SetAmbient(0.362, 0.0, 0.0), - SetDiffuse(0.362, 0.0, 0.0), - // Cap emblem color - MakeDynObj(D_MATERIAL, 0), - SetId(3), - SetAmbient(1.0, 1.0, 1.0), - SetDiffuse(1.0, 1.0, 1.0), - // Eye color - MakeDynObj(D_MATERIAL, 0), - SetId(4), - SetAmbient(1.0, 1.0, 1.0), - SetDiffuse(1.0, 1.0, 1.0), - // Hair color - MakeDynObj(D_MATERIAL, 0), - SetId(5), - SetAmbient(0.362, 0.0, 0.0), - SetDiffuse(0.362, 0.0, 0.0), - // Mouth color - MakeDynObj(D_MATERIAL, 0), - SetId(6), - SetAmbient(0.526, 0.0, 0.0), - SetDiffuse(0.526, 0.0, 0.0), - // Cap color - MakeDynObj(D_MATERIAL, 0), - SetId(7), - SetAmbient(1.0, 0.0, 0.0), - SetDiffuse(1.0, 0.0, 0.0), + // Teeth color + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + // Face color + MakeDynObj(D_MATERIAL, 0), + SetId(1), + SetAmbient(0.883, 0.602, 0.408), + SetDiffuse(0.883, 0.602, 0.408), + // Shadow on back of hat + MakeDynObj(D_MATERIAL, 0), + SetId(2), + SetAmbient(0.362, 0.0, 0.0), + SetDiffuse(0.362, 0.0, 0.0), + // Cap emblem color + MakeDynObj(D_MATERIAL, 0), + SetId(3), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + // Eye color + MakeDynObj(D_MATERIAL, 0), + SetId(4), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), + // Hair color + MakeDynObj(D_MATERIAL, 0), + SetId(5), + SetAmbient(0.362, 0.0, 0.0), + SetDiffuse(0.362, 0.0, 0.0), + // Mouth color + MakeDynObj(D_MATERIAL, 0), + SetId(6), + SetAmbient(0.526, 0.0, 0.0), + SetDiffuse(0.526, 0.0, 0.0), + // Cap color + MakeDynObj(D_MATERIAL, 0), + SetId(7), + SetAmbient(1.0, 0.0, 0.0), + SetDiffuse(1.0, 0.0, 0.0), EndGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), MakeDynObj(D_SHAPE, DYNOBJ_MARIO_FACE_SHAPE), - SetNodeGroup(DYNOBJ_MARIO_FACE_VTX_GROUP), - SetPlaneGroup(DYNOBJ_MARIO_FACE_TRI_GROUP), - SetMaterialGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), + SetNodeGroup(DYNOBJ_MARIO_FACE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_FACE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_FACE_MTL_GROUP), EndList(), }; diff --git a/src/goddard/dynlists/dynlist_mario_master.c b/src/goddard/dynlists/dynlist_mario_master.c index 0d88f163..b6c9e98d 100644 --- a/src/goddard/dynlists/dynlist_mario_master.c +++ b/src/goddard/dynlists/dynlist_mario_master.c @@ -9,1111 +9,1111 @@ struct DynList dynlist_mario_master[] = { BeginList(), - UseIntegerNames(TRUE), // Specify all object names as integers + UseIntegerNames(TRUE), // Specify all object names as integers StartGroup(DYNOBJ_MARIO_MAIN_SHAPES_GROUP), - CallList(dynlist_mario_face_shape), - CallList(dynlist_mario_eye_right_shape), - CallList(dynlist_mario_eye_left_shape), - CallList(dynlist_mario_eyebrow_right_shape), - CallList(dynlist_mario_eyebrow_left_shape), - CallList(dynlist_mario_mustache_shape), + CallList(dynlist_mario_face_shape), + CallList(dynlist_mario_eye_right_shape), + CallList(dynlist_mario_eye_left_shape), + CallList(dynlist_mario_eyebrow_right_shape), + CallList(dynlist_mario_eyebrow_left_shape), + CallList(dynlist_mario_mustache_shape), EndGroup(DYNOBJ_MARIO_MAIN_SHAPES_GROUP), MakeDynObj(D_LIGHT, DYNOBJ_SILVER_STAR_LIGHT), - SetId(1), - SetDiffuse(1.0, 1.0, 1.0), - SetFlag(0x20), - SetShapePtrPtr(&gShapeSilverStar), + SetId(1), + SetDiffuse(1.0, 1.0, 1.0), + SetFlag(0x20), + SetShapePtrPtr(&gShapeSilverStar), MakeDynObj(D_LIGHT, DYNOBJ_RED_STAR_LIGHT), - SetId(0), - SetDiffuse(1.0, 0.0, 0.0), - SetShapePtrPtr(&gShapeRedStar), + SetId(0), + SetDiffuse(1.0, 0.0, 0.0), + SetShapePtrPtr(&gShapeRedStar), StartGroup(0x1), - MakeDynObj(D_NET, DYNOBJ_MARIO_MAIN_NET), - SetType(2), - SetFlag(0x2), - SetShapePtr(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(112.873, 0.0, 0.0), - SetAttachOffset(0.0, 0.0, -20010.0), + MakeDynObj(D_NET, DYNOBJ_MARIO_MAIN_NET), + SetType(2), + SetFlag(0x2), + SetShapePtr(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(112.873, 0.0, 0.0), + SetAttachOffset(0.0, 0.0, -20010.0), - // right eyelid skinning - MakeNetWithSubGroup(DYNOBJ_RIGHT_EYELID_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(116.3, 182.6, -70.2), - MakeAttachedJoint(DYNOBJ_RIGHT_EYELID_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 162.007), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(7, 95.0), - SetSkinWeight(8, 70.0), - SetSkinWeight(48, 90.0), - SetSkinWeight(49, 100.0), - SetSkinWeight(128, 60.0), - SetSkinWeight(131, 90.0), - SetSkinWeight(132, 100.0), - SetSkinWeight(133, 95.0), - SetSkinWeight(134, 70.0), - SetSkinWeight(428, 50.0), - SetSkinWeight(429, 20.0), - SetSkinWeight(51, 35.0), - SetSkinWeight(124, 10.0), - SetSkinWeight(126, 10.0), - SetSkinWeight(127, 5.0), - SetSkinWeight(130, 50.0), - SetSkinWeight(135, 20.0), - SetSkinWeight(136, 10.0), - SetSkinWeight(423, 35.0), - SetSkinWeight(46, 40.0), - SetSkinWeight(47, 10.0), - SetSkinWeight(82, 10.0), - MakeAttachedJoint(DYNOBJ_RIGHT_EYELID_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(382.3, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_RIGHT_EYELID_SKIN_NET), + // right eyelid skinning + MakeNetWithSubGroup(DYNOBJ_RIGHT_EYELID_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(116.3, 182.6, -70.2), + MakeAttachedJoint(DYNOBJ_RIGHT_EYELID_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 162.007), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(7, 95.0), + SetSkinWeight(8, 70.0), + SetSkinWeight(48, 90.0), + SetSkinWeight(49, 100.0), + SetSkinWeight(128, 60.0), + SetSkinWeight(131, 90.0), + SetSkinWeight(132, 100.0), + SetSkinWeight(133, 95.0), + SetSkinWeight(134, 70.0), + SetSkinWeight(428, 50.0), + SetSkinWeight(429, 20.0), + SetSkinWeight(51, 35.0), + SetSkinWeight(124, 10.0), + SetSkinWeight(126, 10.0), + SetSkinWeight(127, 5.0), + SetSkinWeight(130, 50.0), + SetSkinWeight(135, 20.0), + SetSkinWeight(136, 10.0), + SetSkinWeight(423, 35.0), + SetSkinWeight(46, 40.0), + SetSkinWeight(47, 10.0), + SetSkinWeight(82, 10.0), + MakeAttachedJoint(DYNOBJ_RIGHT_EYELID_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(382.3, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_RIGHT_EYELID_SKIN_NET), - // left eyelid skinning - MakeNetWithSubGroup(DYNOBJ_LEFT_EYELID_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(-116.3, 182.6, -70.2), - MakeAttachedJoint(DYNOBJ_LEFT_EYELID_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 162.007), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(196, 90.0), - SetSkinWeight(375, 70.0), - SetSkinWeight(392, 70.0), - SetSkinWeight(393, 95.0), - SetSkinWeight(394, 95.0), - SetSkinWeight(395, 100.0), - SetSkinWeight(396, 100.0), - SetSkinWeight(397, 90.0), - SetSkinWeight(399, 60.0), - SetSkinWeight(428, 50.0), - SetSkinWeight(429, 20.0), - SetSkinWeight(197, 50.0), - SetSkinWeight(385, 5.0), - SetSkinWeight(388, 10.0), - SetSkinWeight(389, 10.0), - SetSkinWeight(390, 20.0), - SetSkinWeight(391, 35.0), - SetSkinWeight(398, 10.0), - SetSkinWeight(419, 35.0), - SetSkinWeight(400, 40.0), - SetSkinWeight(374, 10.0), - SetSkinWeight(387, 10.0), - MakeAttachedJoint(DYNOBJ_LEFT_EYELID_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(420.0, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_LEFT_EYELID_SKIN_NET), + // left eyelid skinning + MakeNetWithSubGroup(DYNOBJ_LEFT_EYELID_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-116.3, 182.6, -70.2), + MakeAttachedJoint(DYNOBJ_LEFT_EYELID_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 162.007), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(196, 90.0), + SetSkinWeight(375, 70.0), + SetSkinWeight(392, 70.0), + SetSkinWeight(393, 95.0), + SetSkinWeight(394, 95.0), + SetSkinWeight(395, 100.0), + SetSkinWeight(396, 100.0), + SetSkinWeight(397, 90.0), + SetSkinWeight(399, 60.0), + SetSkinWeight(428, 50.0), + SetSkinWeight(429, 20.0), + SetSkinWeight(197, 50.0), + SetSkinWeight(385, 5.0), + SetSkinWeight(388, 10.0), + SetSkinWeight(389, 10.0), + SetSkinWeight(390, 20.0), + SetSkinWeight(391, 35.0), + SetSkinWeight(398, 10.0), + SetSkinWeight(419, 35.0), + SetSkinWeight(400, 40.0), + SetSkinWeight(374, 10.0), + SetSkinWeight(387, 10.0), + MakeAttachedJoint(DYNOBJ_LEFT_EYELID_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(420.0, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_LEFT_EYELID_SKIN_NET), - // right jaw skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_JAW_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(0.0, -154.9, 118.5), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_JAW_JOINT), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, -111.558), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(98, 100.0), - SetSkinWeight(104, 100.0), - SetSkinWeight(189, 100.0), - SetSkinWeight(358, 100.0), - SetSkinWeight(5, 40.0), - SetSkinWeight(10, 38.0), - SetSkinWeight(380, 40.0), - SetSkinWeight(405, 38.0), - SetSkinWeight(39, 50.0), - SetSkinWeight(117, 50.0), - SetSkinWeight(337, 50.0), - SetSkinWeight(11, 40.0), - SetSkinWeight(379, 40.0), - SetSkinWeight(105, 50.0), - SetSkinWeight(116, 50.0), - SetSkinWeight(406, 50.0), - SetSkinWeight(85, 70.0), - SetSkinWeight(86, 60.0), - SetSkinWeight(111, 30.0), - SetSkinWeight(159, 50.0), - SetSkinWeight(357, 50.0), - SetSkinWeight(416, 60.0), - SetSkinWeight(6, 25.0), - SetSkinWeight(407, 25.0), - SetSkinWeight(408, 30.0), - SetSkinWeight(4, 30.0), - SetSkinWeight(410, 70.0), - SetSkinWeight(409, 30.0), - SetSkinWeight(109, 15.0), - SetSkinWeight(355, 15.0), - SetSkinWeight(35, 5.0), - SetSkinWeight(372, 5.0), - SetSkinWeight(376, 5.0), - SetSkinWeight(110, 5.0), - SetSkinWeight(16, 3.0), - SetSkinWeight(17, 3.0), - SetSkinWeight(34, 3.0), - SetSkinWeight(373, 3.0), - SetSkinWeight(381, 3.0), - SetSkinWeight(383, 3.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_JAW_JOINT), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, -31.153), - SetAttachOffset(141.0, 0.0, 0.0), - SetSkinWeight(31, 80.0), - SetSkinWeight(32, 80.0), - SetSkinWeight(39, 30.0), - SetSkinWeight(40, 10.0), - SetSkinWeight(99, 100.0), - SetSkinWeight(100, 100.0), - SetSkinWeight(105, 50.0), - SetSkinWeight(113, 100.0), - SetSkinWeight(114, 100.0), - SetSkinWeight(115, 100.0), - SetSkinWeight(116, 50.0), - SetSkinWeight(117, 20.0), - SetSkinWeight(177, 20.0), - SetSkinWeight(336, 10.0), - SetSkinWeight(337, 30.0), - SetSkinWeight(406, 50.0), - SetSkinWeight(411, 80.0), - SetSkinWeight(412, 100.0), - SetSkinWeight(413, 100.0), - SetSkinWeight(414, 100.0), - SetSkinWeight(415, 80.0), - SetSkinWeight(418, 100.0), - SetSkinWeight(409, 28.0), - SetSkinWeight(86, 8.0), - SetSkinWeight(416, 4.0), - SetSkinWeight(4, 28.0), - SetSkinWeight(5, 3.0), - SetSkinWeight(10, 5.0), - SetSkinWeight(380, 5.0), - SetSkinWeight(405, 5.0), - MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_191), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(80.1, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_JAW_SKIN_NET), + // right jaw skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_JAW_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, -154.9, 118.5), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_JAW_JOINT), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -111.558), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(98, 100.0), + SetSkinWeight(104, 100.0), + SetSkinWeight(189, 100.0), + SetSkinWeight(358, 100.0), + SetSkinWeight(5, 40.0), + SetSkinWeight(10, 38.0), + SetSkinWeight(380, 40.0), + SetSkinWeight(405, 38.0), + SetSkinWeight(39, 50.0), + SetSkinWeight(117, 50.0), + SetSkinWeight(337, 50.0), + SetSkinWeight(11, 40.0), + SetSkinWeight(379, 40.0), + SetSkinWeight(105, 50.0), + SetSkinWeight(116, 50.0), + SetSkinWeight(406, 50.0), + SetSkinWeight(85, 70.0), + SetSkinWeight(86, 60.0), + SetSkinWeight(111, 30.0), + SetSkinWeight(159, 50.0), + SetSkinWeight(357, 50.0), + SetSkinWeight(416, 60.0), + SetSkinWeight(6, 25.0), + SetSkinWeight(407, 25.0), + SetSkinWeight(408, 30.0), + SetSkinWeight(4, 30.0), + SetSkinWeight(410, 70.0), + SetSkinWeight(409, 30.0), + SetSkinWeight(109, 15.0), + SetSkinWeight(355, 15.0), + SetSkinWeight(35, 5.0), + SetSkinWeight(372, 5.0), + SetSkinWeight(376, 5.0), + SetSkinWeight(110, 5.0), + SetSkinWeight(16, 3.0), + SetSkinWeight(17, 3.0), + SetSkinWeight(34, 3.0), + SetSkinWeight(373, 3.0), + SetSkinWeight(381, 3.0), + SetSkinWeight(383, 3.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_JAW_JOINT), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -31.153), + SetAttachOffset(141.0, 0.0, 0.0), + SetSkinWeight(31, 80.0), + SetSkinWeight(32, 80.0), + SetSkinWeight(39, 30.0), + SetSkinWeight(40, 10.0), + SetSkinWeight(99, 100.0), + SetSkinWeight(100, 100.0), + SetSkinWeight(105, 50.0), + SetSkinWeight(113, 100.0), + SetSkinWeight(114, 100.0), + SetSkinWeight(115, 100.0), + SetSkinWeight(116, 50.0), + SetSkinWeight(117, 20.0), + SetSkinWeight(177, 20.0), + SetSkinWeight(336, 10.0), + SetSkinWeight(337, 30.0), + SetSkinWeight(406, 50.0), + SetSkinWeight(411, 80.0), + SetSkinWeight(412, 100.0), + SetSkinWeight(413, 100.0), + SetSkinWeight(414, 100.0), + SetSkinWeight(415, 80.0), + SetSkinWeight(418, 100.0), + SetSkinWeight(409, 28.0), + SetSkinWeight(86, 8.0), + SetSkinWeight(416, 4.0), + SetSkinWeight(4, 28.0), + SetSkinWeight(5, 3.0), + SetSkinWeight(10, 5.0), + SetSkinWeight(380, 5.0), + SetSkinWeight(405, 5.0), + MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_191), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(80.1, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_JAW_SKIN_NET), - // nose skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_NOSE_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(0.0, 15.3, 295.1), - MakeAttachedJoint(DYNOBJ_MARIO_NOSE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, -178.586), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(15, 5.0), - SetSkinWeight(18, 30.0), - SetSkinWeight(23, 70.0), - SetSkinWeight(24, 40.0), - SetSkinWeight(25, 90.0), - SetSkinWeight(26, 70.0), - SetSkinWeight(27, 90.0), - SetSkinWeight(28, 40.0), - SetSkinWeight(29, 70.0), - SetSkinWeight(30, 90.0), - SetSkinWeight(41, 70.0), - SetSkinWeight(160, 70.0), - SetSkinWeight(161, 100.0), - SetSkinWeight(182, 90.0), - SetSkinWeight(183, 90.0), - SetSkinWeight(346, 70.0), - SetSkinWeight(347, 30.0), - SetSkinWeight(348, 70.0), - SetSkinWeight(349, 40.0), - SetSkinWeight(350, 30.0), - SetSkinWeight(351, 70.0), - SetSkinWeight(352, 90.0), - SetSkinWeight(353, 5.0), - SetSkinWeight(386, 5.0), - SetSkinWeight(430, 70.0), - SetSkinWeight(431, 70.0), - SetSkinWeight(433, 70.0), - SetSkinWeight(434, 70.0), - SetSkinWeight(435, 70.0), - SetSkinWeight(436, 70.0), - SetSkinWeight(437, 70.0), - SetSkinWeight(439, 70.0), - SetSkinWeight(19, 40.0), - SetSkinWeight(20, 5.0), - SetSkinWeight(21, 5.0), - SetSkinWeight(22, 30.0), - SetSkinWeight(82, 5.0), - SetSkinWeight(83, 5.0), - SetSkinWeight(87, 5.0), - SetSkinWeight(384, 5.0), - SetSkinWeight(387, 5.0), - SetSkinWeight(432, 40.0), - SetSkinWeight(438, 40.0), - MakeAttachedJoint(DYNOBJ_MARIO_NOSE_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(276.6, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_NOSE_SKIN_NET), + // nose skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_NOSE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, 15.3, 295.1), + MakeAttachedJoint(DYNOBJ_MARIO_NOSE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -178.586), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(15, 5.0), + SetSkinWeight(18, 30.0), + SetSkinWeight(23, 70.0), + SetSkinWeight(24, 40.0), + SetSkinWeight(25, 90.0), + SetSkinWeight(26, 70.0), + SetSkinWeight(27, 90.0), + SetSkinWeight(28, 40.0), + SetSkinWeight(29, 70.0), + SetSkinWeight(30, 90.0), + SetSkinWeight(41, 70.0), + SetSkinWeight(160, 70.0), + SetSkinWeight(161, 100.0), + SetSkinWeight(182, 90.0), + SetSkinWeight(183, 90.0), + SetSkinWeight(346, 70.0), + SetSkinWeight(347, 30.0), + SetSkinWeight(348, 70.0), + SetSkinWeight(349, 40.0), + SetSkinWeight(350, 30.0), + SetSkinWeight(351, 70.0), + SetSkinWeight(352, 90.0), + SetSkinWeight(353, 5.0), + SetSkinWeight(386, 5.0), + SetSkinWeight(430, 70.0), + SetSkinWeight(431, 70.0), + SetSkinWeight(433, 70.0), + SetSkinWeight(434, 70.0), + SetSkinWeight(435, 70.0), + SetSkinWeight(436, 70.0), + SetSkinWeight(437, 70.0), + SetSkinWeight(439, 70.0), + SetSkinWeight(19, 40.0), + SetSkinWeight(20, 5.0), + SetSkinWeight(21, 5.0), + SetSkinWeight(22, 30.0), + SetSkinWeight(82, 5.0), + SetSkinWeight(83, 5.0), + SetSkinWeight(87, 5.0), + SetSkinWeight(384, 5.0), + SetSkinWeight(387, 5.0), + SetSkinWeight(432, 40.0), + SetSkinWeight(438, 40.0), + MakeAttachedJoint(DYNOBJ_MARIO_NOSE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(276.6, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_NOSE_SKIN_NET), - // right ear skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(-90.0, 0.0, 0.0), - SetAttachOffset(294.7, 13.1, -82.1), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EAR_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 26.565), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(59, 80.0), - SetSkinWeight(60, 50.0), - SetSkinWeight(61, 60.0), - SetSkinWeight(65, 100.0), - SetSkinWeight(66, 60.0), - SetSkinWeight(88, 10.0), - SetSkinWeight(89, 60.0), - SetSkinWeight(90, 80.0), - SetSkinWeight(91, 70.0), - SetSkinWeight(92, 100.0), - SetSkinWeight(118, 15.0), - SetSkinWeight(119, 5.0), - SetSkinWeight(120, 15.0), - SetSkinWeight(122, 60.0), - SetSkinWeight(123, 70.0), - SetSkinWeight(137, 10.0), - SetSkinWeight(138, 60.0), - SetSkinWeight(139, 10.0), - SetSkinWeight(140, 5.0), - SetSkinWeight(141, 10.0), - SetSkinWeight(167, 60.0), - SetSkinWeight(168, 70.0), - SetSkinWeight(224, 50.0), - SetSkinWeight(225, 70.0), - SetSkinWeight(226, 50.0), - SetSkinWeight(227, 50.0), - SetSkinWeight(228, 60.0), - SetSkinWeight(229, 60.0), - SetSkinWeight(235, 10.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EAR_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(200.9, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET), + // right ear skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 0.0, 0.0), + SetAttachOffset(294.7, 13.1, -82.1), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EAR_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 26.565), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(59, 80.0), + SetSkinWeight(60, 50.0), + SetSkinWeight(61, 60.0), + SetSkinWeight(65, 100.0), + SetSkinWeight(66, 60.0), + SetSkinWeight(88, 10.0), + SetSkinWeight(89, 60.0), + SetSkinWeight(90, 80.0), + SetSkinWeight(91, 70.0), + SetSkinWeight(92, 100.0), + SetSkinWeight(118, 15.0), + SetSkinWeight(119, 5.0), + SetSkinWeight(120, 15.0), + SetSkinWeight(122, 60.0), + SetSkinWeight(123, 70.0), + SetSkinWeight(137, 10.0), + SetSkinWeight(138, 60.0), + SetSkinWeight(139, 10.0), + SetSkinWeight(140, 5.0), + SetSkinWeight(141, 10.0), + SetSkinWeight(167, 60.0), + SetSkinWeight(168, 70.0), + SetSkinWeight(224, 50.0), + SetSkinWeight(225, 70.0), + SetSkinWeight(226, 50.0), + SetSkinWeight(227, 50.0), + SetSkinWeight(228, 60.0), + SetSkinWeight(229, 60.0), + SetSkinWeight(235, 10.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EAR_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(200.9, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EAR_SKIN_NET), - // left ear skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EAR_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(90.0, 180.0, 0.0), - SetAttachOffset(-294.7, 13.1, -82.1), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EAR_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(180.0, 180.0, -153.435), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(244, 5.0), - SetSkinWeight(267, 5.0), - SetSkinWeight(268, 5.0), - SetSkinWeight(299, 5.0), - SetSkinWeight(302, 5.0), - SetSkinWeight(307, 70.0), - SetSkinWeight(308, 70.0), - SetSkinWeight(309, 100.0), - SetSkinWeight(310, 70.0), - SetSkinWeight(311, 70.0), - SetSkinWeight(314, 100.0), - SetSkinWeight(315, 70.0), - SetSkinWeight(317, 80.0), - SetSkinWeight(318, 70.0), - SetSkinWeight(319, 80.0), - SetSkinWeight(320, 70.0), - SetSkinWeight(321, 10.0), - SetSkinWeight(322, 10.0), - SetSkinWeight(323, 10.0), - SetSkinWeight(324, 10.0), - SetSkinWeight(325, 60.0), - SetSkinWeight(326, 100.0), - SetSkinWeight(327, 100.0), - SetSkinWeight(328, 100.0), - SetSkinWeight(329, 80.0), - SetSkinWeight(330, 80.0), - SetSkinWeight(331, 60.0), - SetSkinWeight(332, 70.0), - SetSkinWeight(340, 70.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EAR_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.02), - SetAttachOffset(200.9, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EAR_SKIN_NET), + // left ear skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EAR_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(90.0, 180.0, 0.0), + SetAttachOffset(-294.7, 13.1, -82.1), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EAR_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(180.0, 180.0, -153.435), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(244, 5.0), + SetSkinWeight(267, 5.0), + SetSkinWeight(268, 5.0), + SetSkinWeight(299, 5.0), + SetSkinWeight(302, 5.0), + SetSkinWeight(307, 70.0), + SetSkinWeight(308, 70.0), + SetSkinWeight(309, 100.0), + SetSkinWeight(310, 70.0), + SetSkinWeight(311, 70.0), + SetSkinWeight(314, 100.0), + SetSkinWeight(315, 70.0), + SetSkinWeight(317, 80.0), + SetSkinWeight(318, 70.0), + SetSkinWeight(319, 80.0), + SetSkinWeight(320, 70.0), + SetSkinWeight(321, 10.0), + SetSkinWeight(322, 10.0), + SetSkinWeight(323, 10.0), + SetSkinWeight(324, 10.0), + SetSkinWeight(325, 60.0), + SetSkinWeight(326, 100.0), + SetSkinWeight(327, 100.0), + SetSkinWeight(328, 100.0), + SetSkinWeight(329, 80.0), + SetSkinWeight(330, 80.0), + SetSkinWeight(331, 60.0), + SetSkinWeight(332, 70.0), + SetSkinWeight(340, 70.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EAR_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.02), + SetAttachOffset(200.9, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EAR_SKIN_NET), - // right lip corner skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(-90.0, 0.0, 0.0), - SetAttachOffset(119.7, -161.4, 125.5), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-0.02, 0.0, -66.509), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(4, 42.0), - SetSkinWeight(5, 40.0), - SetSkinWeight(6, 75.0), - SetSkinWeight(10, 30.0), - SetSkinWeight(11, 40.0), - SetSkinWeight(16, 20.0), - SetSkinWeight(17, 15.0), - SetSkinWeight(33, 30.0), - SetSkinWeight(34, 20.0), - SetSkinWeight(35, 60.0), - SetSkinWeight(37, 10.0), - SetSkinWeight(43, 40.0), - SetSkinWeight(85, 30.0), - SetSkinWeight(86, 30.0), - SetSkinWeight(93, 30.0), - SetSkinWeight(94, 10.0), - SetSkinWeight(101, 100.0), - SetSkinWeight(103, 100.0), - SetSkinWeight(108, 10.0), - SetSkinWeight(109, 70.0), - SetSkinWeight(110, 80.0), - SetSkinWeight(111, 60.0), - SetSkinWeight(112, 70.0), - SetSkinWeight(159, 50.0), - SetSkinWeight(42, 30.0), - SetSkinWeight(102, 30.0), - SetSkinWeight(31, 20.0), - SetSkinWeight(32, 20.0), - SetSkinWeight(44, 15.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.028, 0.0, 0.0), - SetAttachOffset(184.5, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET), + // right lip corner skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 0.0, 0.0), + SetAttachOffset(119.7, -161.4, 125.5), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-0.02, 0.0, -66.509), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(4, 42.0), + SetSkinWeight(5, 40.0), + SetSkinWeight(6, 75.0), + SetSkinWeight(10, 30.0), + SetSkinWeight(11, 40.0), + SetSkinWeight(16, 20.0), + SetSkinWeight(17, 15.0), + SetSkinWeight(33, 30.0), + SetSkinWeight(34, 20.0), + SetSkinWeight(35, 60.0), + SetSkinWeight(37, 10.0), + SetSkinWeight(43, 40.0), + SetSkinWeight(85, 30.0), + SetSkinWeight(86, 30.0), + SetSkinWeight(93, 30.0), + SetSkinWeight(94, 10.0), + SetSkinWeight(101, 100.0), + SetSkinWeight(103, 100.0), + SetSkinWeight(108, 10.0), + SetSkinWeight(109, 70.0), + SetSkinWeight(110, 80.0), + SetSkinWeight(111, 60.0), + SetSkinWeight(112, 70.0), + SetSkinWeight(159, 50.0), + SetSkinWeight(42, 30.0), + SetSkinWeight(102, 30.0), + SetSkinWeight(31, 20.0), + SetSkinWeight(32, 20.0), + SetSkinWeight(44, 15.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.028, 0.0, 0.0), + SetAttachOffset(184.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_SKIN_NET), - // left lip corner skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(90.0, 180.0, 0.0), - SetAttachOffset(-119.7, -161.4, 125.5), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.02, 0.0, -66.509), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(187, 100.0), - SetSkinWeight(273, 30.0), - SetSkinWeight(342, 10.0), - SetSkinWeight(354, 40.0), - SetSkinWeight(355, 70.0), - SetSkinWeight(356, 70.0), - SetSkinWeight(357, 50.0), - SetSkinWeight(371, 10.0), - SetSkinWeight(372, 60.0), - SetSkinWeight(373, 20.0), - SetSkinWeight(376, 80.0), - SetSkinWeight(377, 100.0), - SetSkinWeight(378, 10.0), - SetSkinWeight(379, 40.0), - SetSkinWeight(380, 30.0), - SetSkinWeight(381, 15.0), - SetSkinWeight(383, 20.0), - SetSkinWeight(404, 30.0), - SetSkinWeight(405, 30.0), - SetSkinWeight(407, 75.0), - SetSkinWeight(408, 60.0), - SetSkinWeight(409, 42.0), - SetSkinWeight(410, 30.0), - SetSkinWeight(416, 36.0), - SetSkinWeight(199, 15.0), - SetSkinWeight(415, 20.0), - SetSkinWeight(411, 20.0), - SetSkinWeight(188, 20.0), - SetSkinWeight(198, 20.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(-0.028, 0.0, 0.0), - SetAttachOffset(184.5, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET), + // left lip corner skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(90.0, 180.0, 0.0), + SetAttachOffset(-119.7, -161.4, 125.5), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.02, 0.0, -66.509), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(187, 100.0), + SetSkinWeight(273, 30.0), + SetSkinWeight(342, 10.0), + SetSkinWeight(354, 40.0), + SetSkinWeight(355, 70.0), + SetSkinWeight(356, 70.0), + SetSkinWeight(357, 50.0), + SetSkinWeight(371, 10.0), + SetSkinWeight(372, 60.0), + SetSkinWeight(373, 20.0), + SetSkinWeight(376, 80.0), + SetSkinWeight(377, 100.0), + SetSkinWeight(378, 10.0), + SetSkinWeight(379, 40.0), + SetSkinWeight(380, 30.0), + SetSkinWeight(381, 15.0), + SetSkinWeight(383, 20.0), + SetSkinWeight(404, 30.0), + SetSkinWeight(405, 30.0), + SetSkinWeight(407, 75.0), + SetSkinWeight(408, 60.0), + SetSkinWeight(409, 42.0), + SetSkinWeight(410, 30.0), + SetSkinWeight(416, 36.0), + SetSkinWeight(199, 15.0), + SetSkinWeight(415, 20.0), + SetSkinWeight(411, 20.0), + SetSkinWeight(188, 20.0), + SetSkinWeight(198, 20.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(-0.028, 0.0, 0.0), + SetAttachOffset(184.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_SKIN_NET), - // ??? - MakeNetWithSubGroup(0x8F), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(0.0, -162.2, 121.0), - MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_140), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, -176.775), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(42, 70.0), - SetSkinWeight(44, 85.0), - SetSkinWeight(102, 70.0), - SetSkinWeight(188, 80.0), - SetSkinWeight(198, 80.0), - SetSkinWeight(199, 85.0), - MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_137), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(242.8, 0.0, 0.0), - EndNetWithSubGroup(0x8F), + // ??? + MakeNetWithSubGroup(0x8F), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, -162.2, 121.0), + MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_140), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, -176.775), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(42, 70.0), + SetSkinWeight(44, 85.0), + SetSkinWeight(102, 70.0), + SetSkinWeight(188, 80.0), + SetSkinWeight(198, 80.0), + SetSkinWeight(199, 85.0), + MakeAttachedJoint(DYNOBJ_MARIO_UNKNOWN_137), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(242.8, 0.0, 0.0), + EndNetWithSubGroup(0x8F), - // cap skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_CAP_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(0.0, 233.8, -148.8), - MakeAttachedJoint(DYNOBJ_MARIO_CAP_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 153.932), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(68, 90.0), - SetSkinWeight(69, 100.0), - SetSkinWeight(70, 100.0), - SetSkinWeight(71, 100.0), - SetSkinWeight(75, 100.0), - SetSkinWeight(76, 100.0), - SetSkinWeight(77, 100.0), - SetSkinWeight(79, 80.0), - SetSkinWeight(129, 100.0), - SetSkinWeight(147, 90.0), - SetSkinWeight(148, 90.0), - SetSkinWeight(149, 100.0), - SetSkinWeight(150, 100.0), - SetSkinWeight(151, 100.0), - SetSkinWeight(154, 100.0), - SetSkinWeight(155, 100.0), - SetSkinWeight(156, 100.0), - SetSkinWeight(157, 100.0), - SetSkinWeight(184, 100.0), - SetSkinWeight(185, 100.0), - SetSkinWeight(192, 100.0), - SetSkinWeight(193, 90.0), - SetSkinWeight(194, 80.0), - SetSkinWeight(195, 100.0), - SetSkinWeight(201, 100.0), - SetSkinWeight(202, 100.0), - SetSkinWeight(230, 100.0), - SetSkinWeight(360, 100.0), - SetSkinWeight(361, 100.0), - SetSkinWeight(362, 100.0), - SetSkinWeight(363, 100.0), - SetSkinWeight(364, 100.0), - SetSkinWeight(366, 100.0), - SetSkinWeight(367, 90.0), - SetSkinWeight(368, 100.0), - SetSkinWeight(369, 90.0), - SetSkinWeight(420, 100.0), - SetSkinWeight(421, 100.0), - SetSkinWeight(422, 100.0), - SetSkinWeight(424, 100.0), - SetSkinWeight(425, 100.0), - SetSkinWeight(426, 100.0), - SetSkinWeight(427, 100.0), - SetSkinWeight(58, 100.0), - SetSkinWeight(242, 100.0), - SetSkinWeight(0, 100.0), - SetSkinWeight(1, 100.0), - SetSkinWeight(2, 80.0), - SetSkinWeight(9, 100.0), - SetSkinWeight(50, 100.0), - SetSkinWeight(54, 100.0), - SetSkinWeight(55, 100.0), - SetSkinWeight(56, 100.0), - SetSkinWeight(57, 100.0), - SetSkinWeight(67, 80.0), - SetSkinWeight(78, 90.0), - SetSkinWeight(80, 100.0), - SetSkinWeight(121, 100.0), - SetSkinWeight(142, 50.0), - SetSkinWeight(145, 80.0), - SetSkinWeight(146, 100.0), - SetSkinWeight(152, 90.0), - SetSkinWeight(158, 90.0), - SetSkinWeight(186, 100.0), - SetSkinWeight(240, 80.0), - SetSkinWeight(246, 100.0), - SetSkinWeight(247, 100.0), - SetSkinWeight(248, 50.0), - SetSkinWeight(249, 90.0), - SetSkinWeight(251, 100.0), - SetSkinWeight(303, 90.0), - SetSkinWeight(304, 100.0), - SetSkinWeight(305, 100.0), - SetSkinWeight(306, 100.0), - SetSkinWeight(335, 100.0), - SetSkinWeight(338, 100.0), - SetSkinWeight(345, 100.0), - SetSkinWeight(359, 90.0), - SetSkinWeight(365, 100.0), - SetSkinWeight(370, 80.0), - SetSkinWeight(401, 100.0), - SetSkinWeight(402, 100.0), - SetSkinWeight(403, 100.0), - SetSkinWeight(417, 80.0), - SetSkinWeight(125, 60.0), - SetSkinWeight(143, 50.0), - SetSkinWeight(270, 50.0), - SetSkinWeight(294, 60.0), - SetSkinWeight(239, 50.0), - SetSkinWeight(245, 50.0), - MakeAttachedJoint(DYNOBJ_MARIO_CAP_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(528.3, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_CAP_SKIN_NET), + // cap skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_CAP_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(0.0, 233.8, -148.8), + MakeAttachedJoint(DYNOBJ_MARIO_CAP_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 153.932), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(68, 90.0), + SetSkinWeight(69, 100.0), + SetSkinWeight(70, 100.0), + SetSkinWeight(71, 100.0), + SetSkinWeight(75, 100.0), + SetSkinWeight(76, 100.0), + SetSkinWeight(77, 100.0), + SetSkinWeight(79, 80.0), + SetSkinWeight(129, 100.0), + SetSkinWeight(147, 90.0), + SetSkinWeight(148, 90.0), + SetSkinWeight(149, 100.0), + SetSkinWeight(150, 100.0), + SetSkinWeight(151, 100.0), + SetSkinWeight(154, 100.0), + SetSkinWeight(155, 100.0), + SetSkinWeight(156, 100.0), + SetSkinWeight(157, 100.0), + SetSkinWeight(184, 100.0), + SetSkinWeight(185, 100.0), + SetSkinWeight(192, 100.0), + SetSkinWeight(193, 90.0), + SetSkinWeight(194, 80.0), + SetSkinWeight(195, 100.0), + SetSkinWeight(201, 100.0), + SetSkinWeight(202, 100.0), + SetSkinWeight(230, 100.0), + SetSkinWeight(360, 100.0), + SetSkinWeight(361, 100.0), + SetSkinWeight(362, 100.0), + SetSkinWeight(363, 100.0), + SetSkinWeight(364, 100.0), + SetSkinWeight(366, 100.0), + SetSkinWeight(367, 90.0), + SetSkinWeight(368, 100.0), + SetSkinWeight(369, 90.0), + SetSkinWeight(420, 100.0), + SetSkinWeight(421, 100.0), + SetSkinWeight(422, 100.0), + SetSkinWeight(424, 100.0), + SetSkinWeight(425, 100.0), + SetSkinWeight(426, 100.0), + SetSkinWeight(427, 100.0), + SetSkinWeight(58, 100.0), + SetSkinWeight(242, 100.0), + SetSkinWeight(0, 100.0), + SetSkinWeight(1, 100.0), + SetSkinWeight(2, 80.0), + SetSkinWeight(9, 100.0), + SetSkinWeight(50, 100.0), + SetSkinWeight(54, 100.0), + SetSkinWeight(55, 100.0), + SetSkinWeight(56, 100.0), + SetSkinWeight(57, 100.0), + SetSkinWeight(67, 80.0), + SetSkinWeight(78, 90.0), + SetSkinWeight(80, 100.0), + SetSkinWeight(121, 100.0), + SetSkinWeight(142, 50.0), + SetSkinWeight(145, 80.0), + SetSkinWeight(146, 100.0), + SetSkinWeight(152, 90.0), + SetSkinWeight(158, 90.0), + SetSkinWeight(186, 100.0), + SetSkinWeight(240, 80.0), + SetSkinWeight(246, 100.0), + SetSkinWeight(247, 100.0), + SetSkinWeight(248, 50.0), + SetSkinWeight(249, 90.0), + SetSkinWeight(251, 100.0), + SetSkinWeight(303, 90.0), + SetSkinWeight(304, 100.0), + SetSkinWeight(305, 100.0), + SetSkinWeight(306, 100.0), + SetSkinWeight(335, 100.0), + SetSkinWeight(338, 100.0), + SetSkinWeight(345, 100.0), + SetSkinWeight(359, 90.0), + SetSkinWeight(365, 100.0), + SetSkinWeight(370, 80.0), + SetSkinWeight(401, 100.0), + SetSkinWeight(402, 100.0), + SetSkinWeight(403, 100.0), + SetSkinWeight(417, 80.0), + SetSkinWeight(125, 60.0), + SetSkinWeight(143, 50.0), + SetSkinWeight(270, 50.0), + SetSkinWeight(294, 60.0), + SetSkinWeight(239, 50.0), + SetSkinWeight(245, 50.0), + MakeAttachedJoint(DYNOBJ_MARIO_CAP_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(528.3, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_CAP_SKIN_NET), - // right eye skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(90.0, 180.0, 0.0), - SetAttachOffset(29.7, 192.4, -3.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(184.483, -178.885, 82.485), - SetAttachOffset(0.0, 0.0, 0.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYE_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(329.8, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET), - MakeDynObj(D_NET, DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET), - SetType(3), - SetShapePtr(DYNOBJ_MARIO_RIGHT_EYE_SHAPE), - AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(0.0, 0.0, 0.0), + // right eye skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(90.0, 180.0, 0.0), + SetAttachOffset(29.7, 192.4, -3.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(184.483, -178.885, 82.485), + SetAttachOffset(0.0, 0.0, 0.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(329.8, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYE_SKIN_NET), + MakeDynObj(D_NET, DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET), + SetType(3), + SetShapePtr(DYNOBJ_MARIO_RIGHT_EYE_SHAPE), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(0.0, 0.0, 0.0), - // left eye skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYE_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(-90.0, 0.0, 0.0), - SetAttachOffset(-29.0, 192.3, -2.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-6.873, 0.206, -97.461), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(429, 16.0), - MakeAttachedJoint(DYNOMJ_MARIO_LEFT_EYE_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(329.8, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYE_SKIN_NET), - MakeDynObj(D_NET, DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET), - SetType(3), - SetShapePtr(DYNOBJ_MARIO_LEFT_EYE_SHAPE), - AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(0.0, 0.0, 0.0), + // left eye skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetSkinShape(DYNOBJ_MARIO_FACE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 0.0, 0.0), + SetAttachOffset(-29.0, 192.3, -2.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-6.873, 0.206, -97.461), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(429, 16.0), + MakeAttachedJoint(DYNOMJ_MARIO_LEFT_EYE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(329.8, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYE_SKIN_NET), + MakeDynObj(D_NET, DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET), + SetType(3), + SetShapePtr(DYNOBJ_MARIO_LEFT_EYE_SHAPE), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(0.0, 0.0, 0.0), - // right eyebrow net (attaches to head) - MakeDynObj(D_NET, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), - SetType(2), - SetShapePtr(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), - // attach right eyebrow to head - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(20.8, 0.0, -8.5), - // right part of right eyebrow skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), - SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(-90.0, 90.0, -90.0), - SetAttachOffset(231.3, 287.1, -51.4), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(10.886, 0.0, 177.51), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(5, 70.0), - SetSkinWeight(6, 80.0), - SetSkinWeight(7, 70.0), - SetSkinWeight(8, 50.0), - SetSkinWeight(11, 70.0), - SetSkinWeight(12, 100.0), - SetSkinWeight(19, 50.0), - SetSkinWeight(20, 80.0), - SetSkinWeight(23, 70.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(345.5, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET), - // left part of right eyebrow skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), - SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(-90.0, 90.0, -90.0), - SetAttachOffset(23.0, 305.5, -44.6), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-3.437, -0.069, -177.758), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(16, 80.0), - SetSkinWeight(17, 100.0), - SetSkinWeight(18, 80.0), - SetSkinWeight(22, 70.0), - SetSkinWeight(24, 50.0), - SetSkinWeight(25, 80.0), - SetSkinWeight(15, 30.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(399.5, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET), - // middle part of right eyebrow skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), - SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(-90.0, 90.0, -90.0), - SetAttachOffset(123.1, 385.5, -46.4), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(2.865, 0.029, 182.377), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(0, 100.0), - SetSkinWeight(1, 100.0), - SetSkinWeight(2, 100.0), - SetSkinWeight(3, 100.0), - SetSkinWeight(4, 100.0), - SetSkinWeight(9, 100.0), - SetSkinWeight(10, 100.0), - SetSkinWeight(13, 100.0), - SetSkinWeight(14, 100.0), - SetSkinWeight(15, 70.0), - SetSkinWeight(21, 100.0), - SetSkinWeight(16, 20.0), - SetSkinWeight(18, 20.0), - SetSkinWeight(22, 30.0), - SetSkinWeight(25, 20.0), - SetSkinWeight(6, 20.0), - SetSkinWeight(11, 30.0), - SetSkinWeight(20, 20.0), - SetSkinWeight(23, 30.0), - SetSkinWeight(5, 30.0), - SetSkinWeight(7, 30.0), - SetSkinWeight(8, 50.0), - SetSkinWeight(19, 50.0), - SetSkinWeight(24, 50.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(388.6, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET), + // right eyebrow net (attaches to head) + MakeDynObj(D_NET, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetType(2), + SetShapePtr(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + // attach right eyebrow to head + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(20.8, 0.0, -8.5), + // right part of right eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 90.0, -90.0), + SetAttachOffset(231.3, 287.1, -51.4), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(10.886, 0.0, 177.51), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(5, 70.0), + SetSkinWeight(6, 80.0), + SetSkinWeight(7, 70.0), + SetSkinWeight(8, 50.0), + SetSkinWeight(11, 70.0), + SetSkinWeight(12, 100.0), + SetSkinWeight(19, 50.0), + SetSkinWeight(20, 80.0), + SetSkinWeight(23, 70.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(345.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_SKIN_NET), + // left part of right eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 90.0, -90.0), + SetAttachOffset(23.0, 305.5, -44.6), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-3.437, -0.069, -177.758), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(16, 80.0), + SetSkinWeight(17, 100.0), + SetSkinWeight(18, 80.0), + SetSkinWeight(22, 70.0), + SetSkinWeight(24, 50.0), + SetSkinWeight(25, 80.0), + SetSkinWeight(15, 30.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(399.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_SKIN_NET), + // middle part of right eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_RIGHT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(-90.0, 90.0, -90.0), + SetAttachOffset(123.1, 385.5, -46.4), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(2.865, 0.029, 182.377), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(0, 100.0), + SetSkinWeight(1, 100.0), + SetSkinWeight(2, 100.0), + SetSkinWeight(3, 100.0), + SetSkinWeight(4, 100.0), + SetSkinWeight(9, 100.0), + SetSkinWeight(10, 100.0), + SetSkinWeight(13, 100.0), + SetSkinWeight(14, 100.0), + SetSkinWeight(15, 70.0), + SetSkinWeight(21, 100.0), + SetSkinWeight(16, 20.0), + SetSkinWeight(18, 20.0), + SetSkinWeight(22, 30.0), + SetSkinWeight(25, 20.0), + SetSkinWeight(6, 20.0), + SetSkinWeight(11, 30.0), + SetSkinWeight(20, 20.0), + SetSkinWeight(23, 30.0), + SetSkinWeight(5, 30.0), + SetSkinWeight(7, 30.0), + SetSkinWeight(8, 50.0), + SetSkinWeight(19, 50.0), + SetSkinWeight(24, 50.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(388.6, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_SKIN_NET), - // left eyebrow net (attaches to head) - MakeDynObj(D_NET, DYNOBJ_MARIO_LEFT_EYEBROW_NET), - SetType(2), - SetShapePtr(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), - // attach left eyebrow to head - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(-18.5, 0.0, -1.0), - // left part of left eyebrow skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), - SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(-233.6, 287.1, -51.4), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-6.876, 0.0, 177.51), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(9, 100.0), - SetSkinWeight(10, 80.0), - SetSkinWeight(11, 80.0), - SetSkinWeight(13, 80.0), - SetSkinWeight(14, 80.0), - SetSkinWeight(18, 60.0), - SetSkinWeight(21, 60.0), - SetSkinWeight(25, 60.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(345.5, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET), - // right part of left eyebrow skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), - SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(-25.3, 305.5, -44.6), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-9.733, -0.388, -177.186), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(0, 70.0), - SetSkinWeight(1, 100.0), - SetSkinWeight(2, 70.0), - SetSkinWeight(3, 70.0), - SetSkinWeight(5, 50.0), - SetSkinWeight(12, 70.0), - SetSkinWeight(19, 30.0), - SetSkinWeight(15, 30.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(399.5, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET), - // middle part of left eyebrow skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), - SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 90.0, 0.0), - SetAttachOffset(-125.4, 385.5, -46.4), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-8.004, -0.61, 181.847), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(4, 70.0), - SetSkinWeight(6, 100.0), - SetSkinWeight(7, 100.0), - SetSkinWeight(8, 80.0), - SetSkinWeight(15, 70.0), - SetSkinWeight(16, 80.0), - SetSkinWeight(17, 100.0), - SetSkinWeight(19, 70.0), - SetSkinWeight(20, 80.0), - SetSkinWeight(22, 80.0), - SetSkinWeight(23, 60.0), - SetSkinWeight(24, 100.0), - SetSkinWeight(5, 50.0), - SetSkinWeight(0, 30.0), - SetSkinWeight(2, 30.0), - SetSkinWeight(10, 20.0), - SetSkinWeight(11, 20.0), - SetSkinWeight(13, 20.0), - SetSkinWeight(14, 20.0), - SetSkinWeight(18, 40.0), - SetSkinWeight(21, 40.0), - SetSkinWeight(25, 40.0), - SetSkinWeight(3, 30.0), - SetSkinWeight(12, 30.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(388.6, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET), + // left eyebrow net (attaches to head) + MakeDynObj(D_NET, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetType(2), + SetShapePtr(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + // attach left eyebrow to head + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(-18.5, 0.0, -1.0), + // left part of left eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-233.6, 287.1, -51.4), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-6.876, 0.0, 177.51), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(9, 100.0), + SetSkinWeight(10, 80.0), + SetSkinWeight(11, 80.0), + SetSkinWeight(13, 80.0), + SetSkinWeight(14, 80.0), + SetSkinWeight(18, 60.0), + SetSkinWeight(21, 60.0), + SetSkinWeight(25, 60.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(345.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_SKIN_NET), + // right part of left eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-25.3, 305.5, -44.6), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-9.733, -0.388, -177.186), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(0, 70.0), + SetSkinWeight(1, 100.0), + SetSkinWeight(2, 70.0), + SetSkinWeight(3, 70.0), + SetSkinWeight(5, 50.0), + SetSkinWeight(12, 70.0), + SetSkinWeight(19, 30.0), + SetSkinWeight(15, 30.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(399.5, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_SKIN_NET), + // middle part of left eyebrow skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_LEFT_EYEBROW_NET), + SetSkinShape(DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 90.0, 0.0), + SetAttachOffset(-125.4, 385.5, -46.4), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-8.004, -0.61, 181.847), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(4, 70.0), + SetSkinWeight(6, 100.0), + SetSkinWeight(7, 100.0), + SetSkinWeight(8, 80.0), + SetSkinWeight(15, 70.0), + SetSkinWeight(16, 80.0), + SetSkinWeight(17, 100.0), + SetSkinWeight(19, 70.0), + SetSkinWeight(20, 80.0), + SetSkinWeight(22, 80.0), + SetSkinWeight(23, 60.0), + SetSkinWeight(24, 100.0), + SetSkinWeight(5, 50.0), + SetSkinWeight(0, 30.0), + SetSkinWeight(2, 30.0), + SetSkinWeight(10, 20.0), + SetSkinWeight(11, 20.0), + SetSkinWeight(13, 20.0), + SetSkinWeight(14, 20.0), + SetSkinWeight(18, 40.0), + SetSkinWeight(21, 40.0), + SetSkinWeight(25, 40.0), + SetSkinWeight(3, 30.0), + SetSkinWeight(12, 30.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(388.6, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_SKIN_NET), - // mustache net (attaches to head) - MakeDynObj(D_NET, DYNOBJ_MARIO_MUSTACHE_NET), - SetType(2), - SetShapePtr(DYNOBJ_MARIO_MUSTACHE_SHAPE), - // attach mustache to head - AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.02, -0.002, 0.04), - SetAttachOffset(0.0, 0.0, 0.0), - // left mustache skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MUSTACHE_NET), - SetSkinShape(DYNOBJ_MARIO_MUSTACHE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 180.0, 0.0), - SetAttachOffset(4.2, -86.5, 415.5), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(-179.98, -164.53, -29.34), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(3, 50.0), - SetSkinWeight(4, 50.0), - SetSkinWeight(5, 50.0), - SetSkinWeight(11, 70.0), - SetSkinWeight(12, 80.0), - SetSkinWeight(13, 70.0), - SetSkinWeight(18, 80.0), - SetSkinWeight(19, 80.0), - SetSkinWeight(20, 80.0), - SetSkinWeight(21, 100.0), - SetSkinWeight(22, 100.0), - SetSkinWeight(23, 100.0), - SetSkinWeight(25, 100.0), - SetSkinWeight(27, 100.0), - SetSkinWeight(28, 50.0), - SetSkinWeight(29, 40.0), - SetSkinWeight(30, 40.0), - SetSkinWeight(31, 100.0), - SetSkinWeight(36, 50.0), - SetSkinWeight(37, 50.0), - SetSkinWeight(42, 40.0), - SetSkinWeight(45, 50.0), - SetSkinWeight(46, 50.0), - SetSkinWeight(47, 80.0), - SetSkinWeight(50, 40.0), - SetSkinWeight(51, 100.0), - SetSkinWeight(53, 40.0), - SetSkinWeight(54, 80.0), - MakeAttachedJoint(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(-0.028, 0.0, 0.02), - SetAttachOffset(292.7, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET), - // right mustache skinning - MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET), - AttachTo(0xd, DYNOBJ_MARIO_MUSTACHE_NET), - SetSkinShape(DYNOBJ_MARIO_MUSTACHE_SHAPE), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(-4.2, -86.5, 415.5), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1), - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 15.47, 150.66), - SetAttachOffset(0.0, 0.0, 0.0), - SetSkinWeight(0, 100.0), - SetSkinWeight(1, 80.0), - SetSkinWeight(2, 80.0), - SetSkinWeight(6, 100.0), - SetSkinWeight(7, 100.0), - SetSkinWeight(8, 50.0), - SetSkinWeight(9, 50.0), - SetSkinWeight(10, 50.0), - SetSkinWeight(14, 50.0), - SetSkinWeight(15, 50.0), - SetSkinWeight(16, 50.0), - SetSkinWeight(17, 80.0), - SetSkinWeight(24, 100.0), - SetSkinWeight(26, 100.0), - SetSkinWeight(32, 80.0), - SetSkinWeight(33, 100.0), - SetSkinWeight(34, 70.0), - SetSkinWeight(35, 50.0), - SetSkinWeight(38, 40.0), - SetSkinWeight(39, 40.0), - SetSkinWeight(40, 40.0), - SetSkinWeight(41, 50.0), - SetSkinWeight(43, 50.0), - SetSkinWeight(44, 50.0), - SetSkinWeight(48, 80.0), - SetSkinWeight(49, 70.0), - SetSkinWeight(52, 40.0), - SetSkinWeight(55, 80.0), - MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_2), // What is this joint for? - SetScale(1.0, 1.0, 1.0), - SetRotation(0.0, 0.0, 0.0), - SetAttachOffset(292.7, 0.0, 0.0), - EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET), + // mustache net (attaches to head) + MakeDynObj(D_NET, DYNOBJ_MARIO_MUSTACHE_NET), + SetType(2), + SetShapePtr(DYNOBJ_MARIO_MUSTACHE_SHAPE), + // attach mustache to head + AttachTo(0xd, DYNOBJ_MARIO_MAIN_NET), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.02, -0.002, 0.04), + SetAttachOffset(0.0, 0.0, 0.0), + // left mustache skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MUSTACHE_NET), + SetSkinShape(DYNOBJ_MARIO_MUSTACHE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 180.0, 0.0), + SetAttachOffset(4.2, -86.5, 415.5), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(-179.98, -164.53, -29.34), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(3, 50.0), + SetSkinWeight(4, 50.0), + SetSkinWeight(5, 50.0), + SetSkinWeight(11, 70.0), + SetSkinWeight(12, 80.0), + SetSkinWeight(13, 70.0), + SetSkinWeight(18, 80.0), + SetSkinWeight(19, 80.0), + SetSkinWeight(20, 80.0), + SetSkinWeight(21, 100.0), + SetSkinWeight(22, 100.0), + SetSkinWeight(23, 100.0), + SetSkinWeight(25, 100.0), + SetSkinWeight(27, 100.0), + SetSkinWeight(28, 50.0), + SetSkinWeight(29, 40.0), + SetSkinWeight(30, 40.0), + SetSkinWeight(31, 100.0), + SetSkinWeight(36, 50.0), + SetSkinWeight(37, 50.0), + SetSkinWeight(42, 40.0), + SetSkinWeight(45, 50.0), + SetSkinWeight(46, 50.0), + SetSkinWeight(47, 80.0), + SetSkinWeight(50, 40.0), + SetSkinWeight(51, 100.0), + SetSkinWeight(53, 40.0), + SetSkinWeight(54, 80.0), + MakeAttachedJoint(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(-0.028, 0.0, 0.02), + SetAttachOffset(292.7, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_SKIN_NET), + // right mustache skinning + MakeNetWithSubGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET), + AttachTo(0xd, DYNOBJ_MARIO_MUSTACHE_NET), + SetSkinShape(DYNOBJ_MARIO_MUSTACHE_SHAPE), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(-4.2, -86.5, 415.5), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1), + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 15.47, 150.66), + SetAttachOffset(0.0, 0.0, 0.0), + SetSkinWeight(0, 100.0), + SetSkinWeight(1, 80.0), + SetSkinWeight(2, 80.0), + SetSkinWeight(6, 100.0), + SetSkinWeight(7, 100.0), + SetSkinWeight(8, 50.0), + SetSkinWeight(9, 50.0), + SetSkinWeight(10, 50.0), + SetSkinWeight(14, 50.0), + SetSkinWeight(15, 50.0), + SetSkinWeight(16, 50.0), + SetSkinWeight(17, 80.0), + SetSkinWeight(24, 100.0), + SetSkinWeight(26, 100.0), + SetSkinWeight(32, 80.0), + SetSkinWeight(33, 100.0), + SetSkinWeight(34, 70.0), + SetSkinWeight(35, 50.0), + SetSkinWeight(38, 40.0), + SetSkinWeight(39, 40.0), + SetSkinWeight(40, 40.0), + SetSkinWeight(41, 50.0), + SetSkinWeight(43, 50.0), + SetSkinWeight(44, 50.0), + SetSkinWeight(48, 80.0), + SetSkinWeight(49, 70.0), + SetSkinWeight(52, 40.0), + SetSkinWeight(55, 80.0), + MakeAttachedJoint(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_2), // What is this joint for? + SetScale(1.0, 1.0, 1.0), + SetRotation(0.0, 0.0, 0.0), + SetAttachOffset(292.7, 0.0, 0.0), + EndNetWithSubGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_SKIN_NET), - // right mustache animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_mustache_right), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1), + // right mustache animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_mustache_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_MUSTACHE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1), - // left mustache animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_mustache_left), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1), + // left mustache animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_mustache_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_MUSTACHE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1), - // left eyebrow animators - MakeDynObj(D_DATA_GRP, 32), - LinkWithPtr(&anim_mario_lips_1), - MakeDynObj(D_ANIMATOR, 33), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(32), - LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1), - MakeDynObj(D_DATA_GRP, 41), - LinkWithPtr(&anim_mario_lips_2), - MakeDynObj(D_ANIMATOR, 42), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(41), - LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1), - MakeDynObj(D_DATA_GRP, 50), - LinkWithPtr(&anim_mario_eyebrows_1), - MakeDynObj(D_ANIMATOR, 51), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(50), - LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1), + // left eyebrow animators + MakeDynObj(D_DATA_GRP, 32), + LinkWithPtr(&anim_mario_lips_1), + MakeDynObj(D_ANIMATOR, 33), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(32), + LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 41), + LinkWithPtr(&anim_mario_lips_2), + MakeDynObj(D_ANIMATOR, 42), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(41), + LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_RPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 50), + LinkWithPtr(&anim_mario_eyebrows_1), + MakeDynObj(D_ANIMATOR, 51), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(50), + LinkWith(DYNOBJ_MARIO_LEFT_EYEBROW_LPART_JOINT_1), - // right eyebrow animators - MakeDynObj(D_DATA_GRP, 63), - LinkWithPtr(&anim_mario_eyebrows_equalizer), - MakeDynObj(D_ANIMATOR, 64), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(63), - LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2), - MakeDynObj(D_DATA_GRP, 66), - LinkWithPtr(&anim_mario_eyebrows_2), - MakeDynObj(D_ANIMATOR, 67), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(66), - LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1), - MakeDynObj(D_DATA_GRP, 72), - LinkWithPtr(&anim_mario_eyebrows_3), - MakeDynObj(D_ANIMATOR, 73), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(72), - LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2), - MakeDynObj(D_DATA_GRP, 75), - LinkWithPtr(&anim_mario_eyebrows_4), - MakeDynObj(D_ANIMATOR, 76), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(75), - LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1), - MakeDynObj(D_DATA_GRP, 84), - LinkWithPtr(&anim_mario_eyebrows_5), - MakeDynObj(D_ANIMATOR, 85), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(84), - LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1), + // right eyebrow animators + MakeDynObj(D_DATA_GRP, 63), + LinkWithPtr(&anim_mario_eyebrows_equalizer), + MakeDynObj(D_ANIMATOR, 64), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(63), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_2), + MakeDynObj(D_DATA_GRP, 66), + LinkWithPtr(&anim_mario_eyebrows_2), + MakeDynObj(D_ANIMATOR, 67), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(66), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 72), + LinkWithPtr(&anim_mario_eyebrows_3), + MakeDynObj(D_ANIMATOR, 73), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(72), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_2), + MakeDynObj(D_DATA_GRP, 75), + LinkWithPtr(&anim_mario_eyebrows_4), + MakeDynObj(D_ANIMATOR, 76), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(75), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_LPART_JOINT_1), + MakeDynObj(D_DATA_GRP, 84), + LinkWithPtr(&anim_mario_eyebrows_5), + MakeDynObj(D_ANIMATOR, 85), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(84), + LinkWith(DYNOBJ_MARIO_RIGHT_EYEBROW_RPART_JOINT_1), - // left eye animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_eye_left), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_EYE_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_LEFT_EYE_JOINT_1), + // left eye animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eye_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_EYE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EYE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_EYE_JOINT_1), - // right eye animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_eye_right), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_EYE_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), + // right eye animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eye_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_EYE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_EYE_JOINT_1), - // cap animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_CAP_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_cap), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_CAP_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_CAP_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_CAP_JOINT_1), + // cap animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_CAP_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_cap), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_CAP_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_CAP_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_CAP_JOINT_1), - // left lip corner animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_lips_3), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1), + // left lip corner animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_3), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_LIP_CORNER_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1), - // right lip corner animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_lips_4), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1), + // right lip corner animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_4), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_LIP_CORNER_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1), - // left ear animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_ear_left), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_EAR_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_LEFT_EAR_JOINT_1), + // left ear animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_ear_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_EAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EAR_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_EAR_JOINT_1), - // right ear animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP), - LinkWithPtr(&anim_mario_ear_right), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_EAR_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP), - LinkWith(DYNOBJ_MARIO_RIGHT_EAR_JOINT_1), + // right ear animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP), + LinkWithPtr(&anim_mario_ear_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_EAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EAR_ANIMADATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_EAR_JOINT_1), - // nose animator - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_nose), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_NOSE_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_NOSE_JOINT_1), + // nose animator + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_nose), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_NOSE_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_NOSE_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_NOSE_JOINT_1), - // animator for left side of jaw - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_lips_5), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_JAW_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_LEFT_JAW_JOINT), + // animator for left side of jaw + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_5), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_LEFT_JAW_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_LEFT_JAW_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_LEFT_JAW_JOINT), - // animator for right side of jaw - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_lips_6), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_JAW_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_RIGHT_JAW_JOINT), + // animator for right side of jaw + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_lips_6), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_RIGHT_JAW_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_JAW_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_RIGHT_JAW_JOINT), - // left eyelid animator - MakeDynObj(D_DATA_GRP, DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_eyelid_left), - MakeDynObj(D_ANIMATOR, DYNOBJ_LEFT_EYELID_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP), - LinkWith(DYNOBJ_LEFT_EYELID_JOINT_1), + // left eyelid animator + MakeDynObj(D_DATA_GRP, DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eyelid_left), + MakeDynObj(D_ANIMATOR, DYNOBJ_LEFT_EYELID_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_LEFT_EYELID_ANIMDATA_GROUP), + LinkWith(DYNOBJ_LEFT_EYELID_JOINT_1), - // right eyelid animator - MakeDynObj(D_DATA_GRP, DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_eyelid_right), - MakeDynObj(D_ANIMATOR, DYNOBJ_RIGHT_EYELID_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP), - LinkWith(DYNOBJ_RIGHT_EYELID_JOINT_1), + // right eyelid animator + MakeDynObj(D_DATA_GRP, DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_eyelid_right), + MakeDynObj(D_ANIMATOR, DYNOBJ_RIGHT_EYELID_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_RIGHT_EYELID_ANIMDATA_GROUP), + LinkWith(DYNOBJ_RIGHT_EYELID_JOINT_1), - // whole head animator? - MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP), - LinkWithPtr(&anim_mario_intro), - MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_HEAD_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP), - LinkWith(DYNOBJ_MARIO_MAIN_NET), + // whole head animator? + MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP), + LinkWithPtr(&anim_mario_intro), + MakeDynObj(D_ANIMATOR, DYNOBJ_MARIO_HEAD_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_MARIO_HEAD_ANIMDATA_GROUP), + LinkWith(DYNOBJ_MARIO_MAIN_NET), - // silver star animator - MakeDynObj(D_DATA_GRP, DYNOBJ_SILVER_STAR_ANIMDATA_GROUP), - LinkWithPtr(&anim_silver_star), - MakeDynObj(D_ANIMATOR, DYNOBJ_SILVER_STAR_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_SILVER_STAR_ANIMDATA_GROUP), - LinkWith(DYNOBJ_SILVER_STAR_LIGHT), + // silver star animator + MakeDynObj(D_DATA_GRP, DYNOBJ_SILVER_STAR_ANIMDATA_GROUP), + LinkWithPtr(&anim_silver_star), + MakeDynObj(D_ANIMATOR, DYNOBJ_SILVER_STAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_SILVER_STAR_ANIMDATA_GROUP), + LinkWith(DYNOBJ_SILVER_STAR_LIGHT), - // red star animator - MakeDynObj(D_DATA_GRP, DYNOBJ_RED_STAR_ANIMDATA_GROUP), - LinkWithPtr(&anim_red_star), - MakeDynObj(D_ANIMATOR, DYNOBJ_RED_STAR_ANIMATOR), - AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), - SetNodeGroup(DYNOBJ_RED_STAR_ANIMDATA_GROUP), - LinkWith(DYNOBJ_RED_STAR_LIGHT), + // red star animator + MakeDynObj(D_DATA_GRP, DYNOBJ_RED_STAR_ANIMDATA_GROUP), + LinkWithPtr(&anim_red_star), + MakeDynObj(D_ANIMATOR, DYNOBJ_RED_STAR_ANIMATOR), + AttachTo(0x0, DYNOBJ_MARIO_MAIN_ANIMATOR), + SetNodeGroup(DYNOBJ_RED_STAR_ANIMDATA_GROUP), + LinkWith(DYNOBJ_RED_STAR_LIGHT), EndGroup(0x1), diff --git a/src/goddard/dynlists/dynlist_test_cube.c b/src/goddard/dynlists/dynlist_test_cube.c index 31499748..401f9247 100644 --- a/src/goddard/dynlists/dynlist_test_cube.c +++ b/src/goddard/dynlists/dynlist_test_cube.c @@ -10,73 +10,73 @@ struct DynList dynlist_test_cube[] = { BeginList(), StartGroup("ico1vg"), - MakeVertex(-2.0, 0.0, -2.0), - MakeVertex(-2.0, 0.0, 2.0), - MakeVertex(2.0, 0.0, 2.0), - MakeVertex(2.0, 0.0, -2.0), - MakeVertex(0.0, 3.0, 0.0), - MakeVertex(0.0, -3.0, 0.0), + MakeVertex(-2.0, 0.0, -2.0), + MakeVertex(-2.0, 0.0, 2.0), + MakeVertex(2.0, 0.0, 2.0), + MakeVertex(2.0, 0.0, -2.0), + MakeVertex(0.0, 3.0, 0.0), + MakeVertex(0.0, -3.0, 0.0), EndGroup("ico1vg"), StartGroup("ico1pg"), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), EndGroup("ico1pg"), UseObj("ico1pg"), - MapVertices("ico1vg"), + MapVertices("ico1vg"), MakeDynObj(D_SHAPE, "ico1_sh"), - SetNodeGroup("ico1vg"), - SetPlaneGroup("ico1pg"), + SetNodeGroup("ico1vg"), + SetPlaneGroup("ico1pg"), EndList(), }; diff --git a/src/goddard/dynlists/dynlist_unused.c b/src/goddard/dynlists/dynlist_unused.c index 90da4926..77333f42 100644 --- a/src/goddard/dynlists/dynlist_unused.c +++ b/src/goddard/dynlists/dynlist_unused.c @@ -8,68 +8,68 @@ struct DynList dynlist_spot_shape[] = { BeginList(), StartGroup("spotvg"), - MakeVertex(0.0, 0.0, 0.0), - MakeVertex(1.0, -1.0, 1.0), - SetParamF(PARM_F_ALPHA, 0.0), - MakeVertex(1.0, 1.0, 1.0), - SetParamF(PARM_F_ALPHA, 0.0), - MakeVertex(-1.0, 1.0, 1.0), - SetParamF(PARM_F_ALPHA, 0.0), - MakeVertex(-1.0, -1.0, 1.0), - SetParamF(PARM_F_ALPHA, 0.0), - MakeVertex(0.0, 0.0, 0.0), + MakeVertex(0.0, 0.0, 0.0), + MakeVertex(1.0, -1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(1.0, 1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(-1.0, 1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(-1.0, -1.0, 1.0), + SetParamF(PARM_F_ALPHA, 0.0), + MakeVertex(0.0, 0.0, 0.0), EndGroup("spotvg"), StartGroup("spotpg"), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - SetParamPtr(PARM_PTR_OBJ_VTX, 5), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - SetParamPtr(PARM_PTR_OBJ_VTX, 3), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), - SetParamPtr(PARM_PTR_OBJ_VTX, 4), - MakeDynObj(D_FACE, NULL), - SetMaterial(0), - SetParamPtr(PARM_PTR_OBJ_VTX, 0), - SetParamPtr(PARM_PTR_OBJ_VTX, 2), - SetParamPtr(PARM_PTR_OBJ_VTX, 1), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 5), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + SetParamPtr(PARM_PTR_OBJ_VTX, 3), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), + SetParamPtr(PARM_PTR_OBJ_VTX, 4), + MakeDynObj(D_FACE, NULL), + SetMaterial(0), + SetParamPtr(PARM_PTR_OBJ_VTX, 0), + SetParamPtr(PARM_PTR_OBJ_VTX, 2), + SetParamPtr(PARM_PTR_OBJ_VTX, 1), EndGroup("spotpg"), UseObj("spotpg"), - MapVertices("spotvg"), + MapVertices("spotvg"), MakeDynObj(D_SHAPE, "spot_sh"), - SetNodeGroup("spotvg"), - SetPlaneGroup("spotpg"), - SetParamF(PARM_F_ALPHA, 0.1), + SetNodeGroup("spotvg"), + SetPlaneGroup("spotpg"), + SetParamF(PARM_F_ALPHA, 0.1), EndList(), }; diff --git a/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c b/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c index f5cb2a43..37865477 100644 --- a/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c +++ b/src/goddard/dynlists/dynlists_mario_eyebrows_mustache.c @@ -6,49 +6,48 @@ #include "../dynlist_proc.h" static s16 verts_mario_eyebrow_right[][3] = { - { 105, 391, 363 }, { 62, 370, 378 }, { 86, 366, 370 }, { 171, 380, 339 }, { 139, 377, 353 }, - { 193, 353, 331 }, { 204, 314, 297 }, { 175, 342, 305 }, { 209, 361, 291 }, { 124, 360, 323 }, - { 161, 393, 306 }, { 230, 323, 286 }, { 233, 276, 289 }, { 123, 402, 319 }, { 85, 399, 334 }, - { 73, 355, 342 }, { 45, 330, 354 }, { 17, 294, 356 }, { 29, 348, 361 }, { 212, 358, 323 }, - { 214, 324, 318 }, { 139, 394, 353 }, { 57, 339, 377 }, { 231, 330, 311 }, { 58, 384, 349 }, - { 41, 345, 382 }, + { 105, 391, 363 }, { 62, 370, 378 }, { 86, 366, 370 }, { 171, 380, 339 }, { 139, 377, 353 }, { 193, 353, 331 }, + { 204, 314, 297 }, { 175, 342, 305 }, { 209, 361, 291 }, { 124, 360, 323 }, { 161, 393, 306 }, { 230, 323, 286 }, + { 233, 276, 289 }, { 123, 402, 319 }, { 85, 399, 334 }, { 73, 355, 342 }, { 45, 330, 354 }, { 17, 294, 356 }, + { 29, 348, 361 }, { 212, 358, 323 }, { 214, 324, 318 }, { 139, 394, 353 }, { 57, 339, 377 }, { 231, 330, 311 }, + { 58, 384, 349 }, { 41, 345, 382 }, }; -static struct GdVtxData vtx_mario_eyebrow_right = { ARRAY_COUNT(verts_mario_eyebrow_right), 0x1, verts_mario_eyebrow_right }; +static struct GdVtxData vtx_mario_eyebrow_right = { ARRAY_COUNT(verts_mario_eyebrow_right), 0x1, + verts_mario_eyebrow_right }; static u16 facedata_mario_eyebrow_right[][4] = { - { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 20, 23, 19 }, { 0, 1, 25, 22 }, { 0, 0, 21, 13 }, - { 0, 2, 15, 9 }, { 0, 7, 6, 20 }, { 0, 3, 19, 8 }, { 0, 25, 1, 24 }, { 0, 19, 5, 20 }, - { 0, 19, 3, 5 }, { 0, 3, 21, 4 }, { 0, 21, 0, 4 }, { 0, 0, 2, 4 }, { 0, 1, 22, 2 }, - { 0, 20, 12, 23 }, { 0, 13, 14, 0 }, { 0, 4, 2, 9 }, { 0, 20, 5, 7 }, { 0, 22, 17, 16 }, - { 0, 8, 10, 3 }, { 0, 24, 18, 25 }, { 0, 23, 11, 8 }, { 0, 14, 24, 1 }, { 0, 5, 4, 9 }, - { 0, 2, 22, 15 }, { 0, 11, 23, 12 }, { 0, 25, 18, 17 }, { 0, 20, 6, 12 }, { 0, 10, 13, 21 }, - { 0, 8, 19, 23 }, { 0, 25, 17, 22 }, { 0, 1, 0, 14 }, { 0, 21, 3, 10 }, { 0, 22, 16, 15 }, - { 0, 9, 7, 5 }, + { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 20, 23, 19 }, { 0, 1, 25, 22 }, { 0, 0, 21, 13 }, { 0, 2, 15, 9 }, + { 0, 7, 6, 20 }, { 0, 3, 19, 8 }, { 0, 25, 1, 24 }, { 0, 19, 5, 20 }, { 0, 19, 3, 5 }, { 0, 3, 21, 4 }, + { 0, 21, 0, 4 }, { 0, 0, 2, 4 }, { 0, 1, 22, 2 }, { 0, 20, 12, 23 }, { 0, 13, 14, 0 }, { 0, 4, 2, 9 }, + { 0, 20, 5, 7 }, { 0, 22, 17, 16 }, { 0, 8, 10, 3 }, { 0, 24, 18, 25 }, { 0, 23, 11, 8 }, { 0, 14, 24, 1 }, + { 0, 5, 4, 9 }, { 0, 2, 22, 15 }, { 0, 11, 23, 12 }, { 0, 25, 18, 17 }, { 0, 20, 6, 12 }, { 0, 10, 13, 21 }, + { 0, 8, 19, 23 }, { 0, 25, 17, 22 }, { 0, 1, 0, 14 }, { 0, 21, 3, 10 }, { 0, 22, 16, 15 }, { 0, 9, 7, 5 }, }; -static struct GdFaceData faces_mario_eyebrow_right = { ARRAY_COUNT(facedata_mario_eyebrow_right), 0x1, facedata_mario_eyebrow_right }; +static struct GdFaceData faces_mario_eyebrow_right = { ARRAY_COUNT(facedata_mario_eyebrow_right), 0x1, + facedata_mario_eyebrow_right }; struct DynList dynlist_mario_eyebrow_right_shape[] = { BeginList(), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYEBROW_VTX_GROUP), - LinkWithPtr(&vtx_mario_eyebrow_right), + LinkWithPtr(&vtx_mario_eyebrow_right), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYEBROW_TRI_GROUP), - LinkWithPtr(&faces_mario_eyebrow_right), + LinkWithPtr(&faces_mario_eyebrow_right), StartGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), - MakeDynObj(D_MATERIAL, 0), - SetId(0), - SetAmbient(0.0, 0.005, 0.0), // Why is green 0.005 on the right eyebrow, but 0.0 on the left eyebrow? - SetDiffuse(0.0, 0.0, 0.0), + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.005, 0.0), // Why is green 0.005 on the right eyebrow, but 0.0 on the left eyebrow? + SetDiffuse(0.0, 0.0, 0.0), EndGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), MakeDynObj(D_SHAPE, DYNOBJ_MARIO_RIGHT_EYEBROW_SHAPE), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_VTX_GROUP), - SetPlaneGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_TRI_GROUP), - SetMaterialGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_RIGHT_EYEBROW_MTL_GROUP), EndList(), }; @@ -62,85 +61,80 @@ static s16 verts_mario_eyebrow_left[][3] = { { -212, 358, 323 }, }; -static struct GdVtxData vtx_mario_eyebrow_left = { ARRAY_COUNT(verts_mario_eyebrow_left), 0x1, verts_mario_eyebrow_left }; +static struct GdVtxData vtx_mario_eyebrow_left = { ARRAY_COUNT(verts_mario_eyebrow_left), 0x1, + verts_mario_eyebrow_left }; static u16 facedata_mario_eyebrow_left[][4] = { - { 0, 0, 1, 2 }, { 0, 8, 22, 6 }, { 0, 6, 7, 8 }, { 0, 9, 10, 11 }, { 0, 1, 12, 2 }, - { 0, 9, 13, 14 }, { 0, 4, 0, 15 }, { 0, 16, 17, 18 }, { 0, 19, 5, 20 }, { 0, 21, 14, 13 }, - { 0, 2, 12, 5 }, { 0, 22, 8, 21 }, { 0, 3, 1, 0 }, { 0, 23, 18, 11 }, { 0, 16, 15, 17 }, - { 0, 24, 20, 7 }, { 0, 13, 9, 11 }, { 0, 15, 0, 19 }, { 0, 17, 15, 24 }, { 0, 17, 24, 6 }, - { 0, 17, 6, 22 }, { 0, 18, 22, 25 }, { 0, 11, 18, 25 }, { 0, 4, 3, 0 }, { 0, 18, 23, 16 }, - { 0, 20, 24, 19 }, { 0, 13, 25, 21 }, { 0, 5, 19, 2 }, { 0, 21, 25, 22 }, { 0, 11, 10, 23 }, - { 0, 18, 17, 22 }, { 0, 15, 19, 24 }, { 0, 16, 4, 15 }, { 0, 7, 6, 24 }, { 0, 0, 2, 19 }, - { 0, 25, 13, 11 }, + { 0, 0, 1, 2 }, { 0, 8, 22, 6 }, { 0, 6, 7, 8 }, { 0, 9, 10, 11 }, { 0, 1, 12, 2 }, { 0, 9, 13, 14 }, + { 0, 4, 0, 15 }, { 0, 16, 17, 18 }, { 0, 19, 5, 20 }, { 0, 21, 14, 13 }, { 0, 2, 12, 5 }, { 0, 22, 8, 21 }, + { 0, 3, 1, 0 }, { 0, 23, 18, 11 }, { 0, 16, 15, 17 }, { 0, 24, 20, 7 }, { 0, 13, 9, 11 }, { 0, 15, 0, 19 }, + { 0, 17, 15, 24 }, { 0, 17, 24, 6 }, { 0, 17, 6, 22 }, { 0, 18, 22, 25 }, { 0, 11, 18, 25 }, { 0, 4, 3, 0 }, + { 0, 18, 23, 16 }, { 0, 20, 24, 19 }, { 0, 13, 25, 21 }, { 0, 5, 19, 2 }, { 0, 21, 25, 22 }, { 0, 11, 10, 23 }, + { 0, 18, 17, 22 }, { 0, 15, 19, 24 }, { 0, 16, 4, 15 }, { 0, 7, 6, 24 }, { 0, 0, 2, 19 }, { 0, 25, 13, 11 }, }; -static struct GdFaceData faces_mario_eyebrow_left = { ARRAY_COUNT(facedata_mario_eyebrow_left), 0x1, facedata_mario_eyebrow_left }; +static struct GdFaceData faces_mario_eyebrow_left = { ARRAY_COUNT(facedata_mario_eyebrow_left), 0x1, + facedata_mario_eyebrow_left }; struct DynList dynlist_mario_eyebrow_left_shape[] = { BeginList(), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYEBROW_VTX_GROUP), - LinkWithPtr(&vtx_mario_eyebrow_left), + LinkWithPtr(&vtx_mario_eyebrow_left), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYEBROW_TRI_GROUP), - LinkWithPtr(&faces_mario_eyebrow_left), + LinkWithPtr(&faces_mario_eyebrow_left), StartGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), - MakeDynObj(D_MATERIAL, 0), - SetId(0), - SetAmbient(0.0, 0.0, 0.0), - SetDiffuse(0.0, 0.0, 0.0), + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), EndGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), MakeDynObj(D_SHAPE, DYNOBJ_MARIO_LEFT_EYEBROW_SHAPE), - SetNodeGroup(DYNOBJ_MARIO_LEFT_EYEBROW_VTX_GROUP), - SetPlaneGroup(DYNOBJ_MARIO_LEFT_EYEBROW_TRI_GROUP), - SetMaterialGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EYEBROW_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_LEFT_EYEBROW_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_LEFT_EYEBROW_MTL_GROUP), EndList(), }; static s16 verts_mario_mustache[][3] = { - { -202, 15, 400 }, { -295, -13, 358 }, { -287, -45, 362 }, { 229, -89, 385 }, - { 214, -126, 385 }, { 221, -131, 360 }, { -266, 73, 363 }, { -202, 15, 375 }, - { -154, -160, 372 }, { -154, -148, 397 }, { -191, -150, 387 }, { 276, -74, 345 }, - { 287, -45, 362 }, { 276, -74, 370 }, { -221, -131, 360 }, { -214, -126, 385 }, - { -229, -89, 385 }, { -298, -45, 337 }, { 293, 20, 357 }, { 295, -13, 358 }, - { 307, -13, 333 }, { 202, 15, 400 }, { 266, 73, 363 }, { 202, 15, 375 }, - { -95, -25, 457 }, { 95, -25, 457 }, { -95, -25, 406 }, { 95, -25, 406 }, - { 154, -148, 397 }, { 110, -178, 416 }, { 121, -188, 384 }, { 266, 88, 338 }, - { -293, 20, 357 }, { -266, 88, 338 }, { -276, -74, 370 }, { -239, -95, 359 }, - { 197, -155, 362 }, { 191, -150, 387 }, { -68, -181, 427 }, { -110, -178, 416 }, - { -75, -191, 396 }, { -4, -157, 406 }, { 4, -157, 406 }, { -4, -157, 444 }, - { -197, -155, 362 }, { 154, -160, 372 }, { 239, -95, 359 }, { 298, -45, 337 }, - { -307, -13, 333 }, { -276, -74, 345 }, { 68, -181, 427 }, { 4, -157, 444 }, - { -121, -188, 384 }, { 75, -191, 396 }, { 304, 20, 332 }, { -304, 20, 332 }, + { -202, 15, 400 }, { -295, -13, 358 }, { -287, -45, 362 }, { 229, -89, 385 }, { 214, -126, 385 }, + { 221, -131, 360 }, { -266, 73, 363 }, { -202, 15, 375 }, { -154, -160, 372 }, { -154, -148, 397 }, + { -191, -150, 387 }, { 276, -74, 345 }, { 287, -45, 362 }, { 276, -74, 370 }, { -221, -131, 360 }, + { -214, -126, 385 }, { -229, -89, 385 }, { -298, -45, 337 }, { 293, 20, 357 }, { 295, -13, 358 }, + { 307, -13, 333 }, { 202, 15, 400 }, { 266, 73, 363 }, { 202, 15, 375 }, { -95, -25, 457 }, + { 95, -25, 457 }, { -95, -25, 406 }, { 95, -25, 406 }, { 154, -148, 397 }, { 110, -178, 416 }, + { 121, -188, 384 }, { 266, 88, 338 }, { -293, 20, 357 }, { -266, 88, 338 }, { -276, -74, 370 }, + { -239, -95, 359 }, { 197, -155, 362 }, { 191, -150, 387 }, { -68, -181, 427 }, { -110, -178, 416 }, + { -75, -191, 396 }, { -4, -157, 406 }, { 4, -157, 406 }, { -4, -157, 444 }, { -197, -155, 362 }, + { 154, -160, 372 }, { 239, -95, 359 }, { 298, -45, 337 }, { -307, -13, 333 }, { -276, -74, 345 }, + { 68, -181, 427 }, { 4, -157, 444 }, { -121, -188, 384 }, { 75, -191, 396 }, { 304, 20, 332 }, + { -304, 20, 332 }, }; static struct GdVtxData vtx_mario_mustache = { ARRAY_COUNT(verts_mario_mustache), 0x1, verts_mario_mustache }; static u16 facedata_mario_mustache[][4] = { - { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 3, 5, 46 }, { 0, 6, 0, 7 }, { 0, 6, 7, 33 }, - { 0, 8, 9, 10 }, { 0, 8, 10, 44 }, { 0, 11, 47, 12 }, { 0, 11, 12, 13 }, { 0, 14, 15, 16 }, - { 0, 14, 16, 35 }, { 0, 2, 1, 48 }, { 0, 2, 48, 17 }, { 0, 18, 19, 20 }, { 0, 18, 20, 54 }, - { 0, 21, 22, 31 }, { 0, 21, 31, 23 }, { 0, 24, 25, 27 }, { 0, 24, 27, 26 }, { 0, 27, 25, 21 }, - { 0, 27, 21, 23 }, { 0, 0, 24, 26 }, { 0, 0, 26, 7 }, { 0, 28, 29, 30 }, { 0, 28, 30, 45 }, - { 0, 31, 22, 18 }, { 0, 31, 18, 54 }, { 0, 32, 6, 33 }, { 0, 32, 33, 55 }, { 0, 16, 34, 49 }, - { 0, 16, 49, 35 }, { 0, 36, 5, 4 }, { 0, 36, 4, 37 }, { 0, 38, 39, 52 }, { 0, 38, 52, 40 }, - { 0, 41, 42, 51 }, { 0, 41, 51, 43 }, { 0, 10, 15, 14 }, { 0, 10, 14, 44 }, { 0, 37, 28, 45 }, - { 0, 37, 45, 36 }, { 0, 35, 7, 26 }, { 0, 13, 3, 46 }, { 0, 13, 46, 11 }, { 0, 19, 12, 47 }, - { 0, 19, 47, 20 }, { 0, 1, 32, 55 }, { 0, 1, 55, 48 }, { 0, 34, 2, 17 }, { 0, 34, 17, 49 }, - { 0, 43, 38, 40 }, { 0, 43, 40, 41 }, { 0, 42, 53, 50 }, { 0, 42, 50, 51 }, { 0, 39, 9, 8 }, - { 0, 39, 8, 52 }, { 0, 29, 50, 53 }, { 0, 29, 53, 30 }, { 0, 51, 50, 25 }, { 0, 43, 51, 25 }, - { 0, 43, 25, 24 }, { 0, 29, 28, 25 }, { 0, 3, 13, 12 }, { 0, 3, 12, 21 }, { 0, 3, 21, 25 }, - { 0, 50, 29, 25 }, { 0, 25, 37, 4 }, { 0, 25, 28, 37 }, { 0, 25, 4, 3 }, { 0, 9, 39, 24 }, - { 0, 16, 15, 24 }, { 0, 39, 38, 24 }, { 0, 38, 43, 24 }, { 0, 10, 9, 24 }, { 0, 24, 0, 16 }, - { 0, 15, 10, 24 }, { 0, 8, 44, 14 }, { 0, 18, 22, 21 }, { 0, 19, 18, 21 }, { 0, 12, 19, 21 }, - { 0, 0, 6, 32 }, { 0, 0, 32, 1 }, { 0, 2, 34, 16 }, { 0, 2, 16, 0 }, { 0, 23, 11, 46 }, - { 0, 8, 14, 35 }, { 0, 23, 31, 54 }, { 0, 46, 27, 23 }, { 0, 8, 35, 26 }, { 0, 27, 46, 45 }, - { 0, 54, 20, 47 }, { 0, 54, 47, 11 }, { 0, 55, 33, 7 }, { 0, 7, 49, 55 }, { 0, 49, 17, 55 }, - { 0, 17, 48, 55 }, { 0, 35, 49, 7 }, { 0, 54, 11, 23 }, { 0, 46, 5, 45 }, { 0, 5, 36, 45 }, + { 0, 0, 1, 2 }, { 0, 3, 4, 5 }, { 0, 3, 5, 46 }, { 0, 6, 0, 7 }, { 0, 6, 7, 33 }, { 0, 8, 9, 10 }, + { 0, 8, 10, 44 }, { 0, 11, 47, 12 }, { 0, 11, 12, 13 }, { 0, 14, 15, 16 }, { 0, 14, 16, 35 }, { 0, 2, 1, 48 }, + { 0, 2, 48, 17 }, { 0, 18, 19, 20 }, { 0, 18, 20, 54 }, { 0, 21, 22, 31 }, { 0, 21, 31, 23 }, { 0, 24, 25, 27 }, + { 0, 24, 27, 26 }, { 0, 27, 25, 21 }, { 0, 27, 21, 23 }, { 0, 0, 24, 26 }, { 0, 0, 26, 7 }, { 0, 28, 29, 30 }, + { 0, 28, 30, 45 }, { 0, 31, 22, 18 }, { 0, 31, 18, 54 }, { 0, 32, 6, 33 }, { 0, 32, 33, 55 }, { 0, 16, 34, 49 }, + { 0, 16, 49, 35 }, { 0, 36, 5, 4 }, { 0, 36, 4, 37 }, { 0, 38, 39, 52 }, { 0, 38, 52, 40 }, { 0, 41, 42, 51 }, + { 0, 41, 51, 43 }, { 0, 10, 15, 14 }, { 0, 10, 14, 44 }, { 0, 37, 28, 45 }, { 0, 37, 45, 36 }, { 0, 35, 7, 26 }, + { 0, 13, 3, 46 }, { 0, 13, 46, 11 }, { 0, 19, 12, 47 }, { 0, 19, 47, 20 }, { 0, 1, 32, 55 }, { 0, 1, 55, 48 }, + { 0, 34, 2, 17 }, { 0, 34, 17, 49 }, { 0, 43, 38, 40 }, { 0, 43, 40, 41 }, { 0, 42, 53, 50 }, { 0, 42, 50, 51 }, + { 0, 39, 9, 8 }, { 0, 39, 8, 52 }, { 0, 29, 50, 53 }, { 0, 29, 53, 30 }, { 0, 51, 50, 25 }, { 0, 43, 51, 25 }, + { 0, 43, 25, 24 }, { 0, 29, 28, 25 }, { 0, 3, 13, 12 }, { 0, 3, 12, 21 }, { 0, 3, 21, 25 }, { 0, 50, 29, 25 }, + { 0, 25, 37, 4 }, { 0, 25, 28, 37 }, { 0, 25, 4, 3 }, { 0, 9, 39, 24 }, { 0, 16, 15, 24 }, { 0, 39, 38, 24 }, + { 0, 38, 43, 24 }, { 0, 10, 9, 24 }, { 0, 24, 0, 16 }, { 0, 15, 10, 24 }, { 0, 8, 44, 14 }, { 0, 18, 22, 21 }, + { 0, 19, 18, 21 }, { 0, 12, 19, 21 }, { 0, 0, 6, 32 }, { 0, 0, 32, 1 }, { 0, 2, 34, 16 }, { 0, 2, 16, 0 }, + { 0, 23, 11, 46 }, { 0, 8, 14, 35 }, { 0, 23, 31, 54 }, { 0, 46, 27, 23 }, { 0, 8, 35, 26 }, { 0, 27, 46, 45 }, + { 0, 54, 20, 47 }, { 0, 54, 47, 11 }, { 0, 55, 33, 7 }, { 0, 7, 49, 55 }, { 0, 49, 17, 55 }, { 0, 17, 48, 55 }, + { 0, 35, 49, 7 }, { 0, 54, 11, 23 }, { 0, 46, 5, 45 }, { 0, 5, 36, 45 }, }; static struct GdFaceData faces_mario_mustache = { ARRAY_COUNT(facedata_mario_mustache), 0x1, facedata_mario_mustache }; @@ -149,22 +143,22 @@ struct DynList dynlist_mario_mustache_shape[] = { BeginList(), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_MUSTACHE_VTX_GROUP), - LinkWithPtr(&vtx_mario_mustache), + LinkWithPtr(&vtx_mario_mustache), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_MUSTACHE_TRI_GROUP), - LinkWithPtr(&faces_mario_mustache), + LinkWithPtr(&faces_mario_mustache), StartGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), - MakeDynObj(D_MATERIAL, 0), - SetId(0), - SetAmbient(0.0, 0.0, 0.0), - SetDiffuse(0.0, 0.0, 0.0), + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), EndGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), MakeDynObj(D_SHAPE, DYNOBJ_MARIO_MUSTACHE_SHAPE), - SetNodeGroup(DYNOBJ_MARIO_MUSTACHE_VTX_GROUP), - SetPlaneGroup(DYNOBJ_MARIO_MUSTACHE_TRI_GROUP), - SetMaterialGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), + SetNodeGroup(DYNOBJ_MARIO_MUSTACHE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_MUSTACHE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_MUSTACHE_MTL_GROUP), EndList(), }; diff --git a/src/goddard/dynlists/dynlists_mario_eyes.c b/src/goddard/dynlists/dynlists_mario_eyes.c index cbf9bc9f..eae007a8 100644 --- a/src/goddard/dynlists/dynlists_mario_eyes.c +++ b/src/goddard/dynlists/dynlists_mario_eyes.c @@ -6,115 +6,106 @@ #include "../dynlist_proc.h" static s16 verts_mario_eye_right[][3] = { - { 306, 26, 83 }, { 318, 18, 81 }, { 312, -13, 94 }, { 308, 43, 53 }, { 320, 35, 50 }, - { 308, 47, 12 }, { 320, 39, 9 }, { 316, 31, -30 }, { 304, 39, -27 }, { 311, 11, -58 }, - { 299, 19, -55 }, { 304, -21, -66 }, { 287, -46, -51 }, { 299, -54, -53 }, { 285, -64, -20 }, - { 297, -72, -23 }, { 286, -69, 20 }, { 299, -76, 17 }, { 301, -68, 57 }, { 289, -60, 60 }, - { 305, -47, 85 }, { 294, -40, 88 }, { 315, -35, 13 }, { 316, -33, 21 }, { 317, -28, 25 }, - { 293, -14, -64 }, { 316, -17, 67 }, { 312, -37, 61 }, { 310, -50, 44 }, { 307, -53, -14 }, - { 308, -42, -33 }, { 311, -22, -41 }, { 315, -2, -36 }, { 319, 10, -18 }, { 322, 13, 39 }, - { 320, 2, 59 }, { 318, -20, 29 }, { 308, -57, 15 }, { 315, -34, 4 }, { 315, -30, 0 }, - { 316, -22, -4 }, { 318, -14, -1 }, { 319, -9, 2 }, { 322, 16, 10 }, { 320, -8, 20 }, - { 319, -13, 24 }, { 320, -7, 11 }, { 301, -6, 96 }, + { 306, 26, 83 }, { 318, 18, 81 }, { 312, -13, 94 }, { 308, 43, 53 }, { 320, 35, 50 }, { 308, 47, 12 }, + { 320, 39, 9 }, { 316, 31, -30 }, { 304, 39, -27 }, { 311, 11, -58 }, { 299, 19, -55 }, { 304, -21, -66 }, + { 287, -46, -51 }, { 299, -54, -53 }, { 285, -64, -20 }, { 297, -72, -23 }, { 286, -69, 20 }, { 299, -76, 17 }, + { 301, -68, 57 }, { 289, -60, 60 }, { 305, -47, 85 }, { 294, -40, 88 }, { 315, -35, 13 }, { 316, -33, 21 }, + { 317, -28, 25 }, { 293, -14, -64 }, { 316, -17, 67 }, { 312, -37, 61 }, { 310, -50, 44 }, { 307, -53, -14 }, + { 308, -42, -33 }, { 311, -22, -41 }, { 315, -2, -36 }, { 319, 10, -18 }, { 322, 13, 39 }, { 320, 2, 59 }, + { 318, -20, 29 }, { 308, -57, 15 }, { 315, -34, 4 }, { 315, -30, 0 }, { 316, -22, -4 }, { 318, -14, -1 }, + { 319, -9, 2 }, { 322, 16, 10 }, { 320, -8, 20 }, { 319, -13, 24 }, { 320, -7, 11 }, { 301, -6, 96 }, }; static struct GdVtxData vtx_mario_eye_right = { ARRAY_COUNT(verts_mario_eye_right), 0x1, verts_mario_eye_right }; static u16 facedata_mario_eye_right[][4] = { - { 1, 2, 1, 0 }, { 1, 1, 4, 3 }, { 1, 4, 6, 5 }, { 1, 6, 7, 5 }, { 1, 7, 9, 8 }, - { 1, 9, 11, 10 }, { 1, 11, 13, 12 }, { 1, 13, 15, 14 }, { 1, 15, 17, 16 }, { 1, 17, 18, 16 }, - { 1, 18, 20, 19 }, { 1, 20, 2, 21 }, { 1, 0, 47, 2 }, { 1, 2, 26, 1 }, { 1, 20, 26, 2 }, - { 1, 18, 27, 20 }, { 1, 17, 28, 18 }, { 1, 15, 29, 17 }, { 1, 13, 30, 15 }, { 1, 11, 31, 13 }, - { 1, 9, 31, 11 }, { 1, 7, 32, 9 }, { 1, 6, 33, 7 }, { 1, 4, 34, 6 }, { 1, 1, 35, 4 }, - { 1, 35, 34, 4 }, { 1, 34, 43, 6 }, { 1, 6, 43, 33 }, { 1, 7, 33, 32 }, { 1, 9, 32, 31 }, - { 1, 31, 30, 13 }, { 1, 30, 29, 15 }, { 1, 29, 37, 17 }, { 1, 17, 37, 28 }, { 1, 18, 28, 27 }, - { 1, 20, 27, 26 }, { 1, 26, 35, 1 }, { 1, 3, 0, 1 }, { 1, 5, 3, 4 }, { 1, 7, 8, 5 }, - { 1, 9, 10, 8 }, { 1, 11, 25, 10 }, { 1, 12, 25, 11 }, { 1, 14, 12, 13 }, { 1, 16, 14, 15 }, - { 1, 18, 19, 16 }, { 1, 2, 47, 21 }, { 1, 20, 21, 19 }, { 2, 26, 36, 35 }, { 2, 27, 36, 26 }, - { 2, 28, 24, 27 }, { 2, 37, 23, 28 }, { 2, 29, 38, 37 }, { 2, 30, 39, 29 }, { 2, 31, 40, 30 }, - { 2, 32, 40, 31 }, { 2, 33, 41, 32 }, { 2, 43, 42, 33 }, { 2, 34, 44, 43 }, { 2, 35, 45, 34 }, - { 2, 45, 44, 34 }, { 2, 44, 46, 43 }, { 2, 43, 46, 42 }, { 2, 33, 42, 41 }, { 2, 32, 41, 40 }, - { 2, 40, 39, 30 }, { 2, 39, 38, 29 }, { 2, 38, 22, 37 }, { 2, 37, 22, 23 }, { 2, 28, 23, 24 }, - { 2, 27, 24, 36 }, { 2, 36, 45, 35 }, { 3, 24, 23, 22 }, { 3, 22, 36, 24 }, { 3, 22, 38, 36 }, - { 3, 38, 39, 36 }, { 3, 39, 40, 36 }, { 3, 40, 41, 36 }, { 3, 41, 45, 36 }, { 3, 41, 42, 45 }, - { 3, 42, 46, 45 }, { 3, 46, 44, 45 }, + { 1, 2, 1, 0 }, { 1, 1, 4, 3 }, { 1, 4, 6, 5 }, { 1, 6, 7, 5 }, { 1, 7, 9, 8 }, { 1, 9, 11, 10 }, + { 1, 11, 13, 12 }, { 1, 13, 15, 14 }, { 1, 15, 17, 16 }, { 1, 17, 18, 16 }, { 1, 18, 20, 19 }, { 1, 20, 2, 21 }, + { 1, 0, 47, 2 }, { 1, 2, 26, 1 }, { 1, 20, 26, 2 }, { 1, 18, 27, 20 }, { 1, 17, 28, 18 }, { 1, 15, 29, 17 }, + { 1, 13, 30, 15 }, { 1, 11, 31, 13 }, { 1, 9, 31, 11 }, { 1, 7, 32, 9 }, { 1, 6, 33, 7 }, { 1, 4, 34, 6 }, + { 1, 1, 35, 4 }, { 1, 35, 34, 4 }, { 1, 34, 43, 6 }, { 1, 6, 43, 33 }, { 1, 7, 33, 32 }, { 1, 9, 32, 31 }, + { 1, 31, 30, 13 }, { 1, 30, 29, 15 }, { 1, 29, 37, 17 }, { 1, 17, 37, 28 }, { 1, 18, 28, 27 }, { 1, 20, 27, 26 }, + { 1, 26, 35, 1 }, { 1, 3, 0, 1 }, { 1, 5, 3, 4 }, { 1, 7, 8, 5 }, { 1, 9, 10, 8 }, { 1, 11, 25, 10 }, + { 1, 12, 25, 11 }, { 1, 14, 12, 13 }, { 1, 16, 14, 15 }, { 1, 18, 19, 16 }, { 1, 2, 47, 21 }, { 1, 20, 21, 19 }, + { 2, 26, 36, 35 }, { 2, 27, 36, 26 }, { 2, 28, 24, 27 }, { 2, 37, 23, 28 }, { 2, 29, 38, 37 }, { 2, 30, 39, 29 }, + { 2, 31, 40, 30 }, { 2, 32, 40, 31 }, { 2, 33, 41, 32 }, { 2, 43, 42, 33 }, { 2, 34, 44, 43 }, { 2, 35, 45, 34 }, + { 2, 45, 44, 34 }, { 2, 44, 46, 43 }, { 2, 43, 46, 42 }, { 2, 33, 42, 41 }, { 2, 32, 41, 40 }, { 2, 40, 39, 30 }, + { 2, 39, 38, 29 }, { 2, 38, 22, 37 }, { 2, 37, 22, 23 }, { 2, 28, 23, 24 }, { 2, 27, 24, 36 }, { 2, 36, 45, 35 }, + { 3, 24, 23, 22 }, { 3, 22, 36, 24 }, { 3, 22, 38, 36 }, { 3, 38, 39, 36 }, { 3, 39, 40, 36 }, { 3, 40, 41, 36 }, + { 3, 41, 45, 36 }, { 3, 41, 42, 45 }, { 3, 42, 46, 45 }, { 3, 46, 44, 45 }, }; -static struct GdFaceData faces_mario_eye_right = { ARRAY_COUNT(facedata_mario_eye_right), 0x1, facedata_mario_eye_right }; +static struct GdFaceData faces_mario_eye_right = { ARRAY_COUNT(facedata_mario_eye_right), 0x1, + facedata_mario_eye_right }; struct DynList dynlist_mario_eye_right_shape[] = { BeginList(), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_VTX_GROUP), - LinkWithPtr(&vtx_mario_eye_right), + LinkWithPtr(&vtx_mario_eye_right), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_RIGHT_EYE_TRI_GROUP), - LinkWithPtr(&faces_mario_eye_right), + LinkWithPtr(&faces_mario_eye_right), StartGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), - // ??? - MakeDynObj(D_MATERIAL, 0), - SetId(0), - SetAmbient(0.0, 0.291, 1.0), - SetDiffuse(0.0, 0.291, 1.0), - // Iris color - MakeDynObj(D_MATERIAL, 0), - SetId(1), - SetAmbient(0.0, 0.576, 1.0), - SetDiffuse(0.0, 0.576, 1.0), - // Pupil color - MakeDynObj(D_MATERIAL, 0), - SetId(2), - SetAmbient(0.0, 0.0, 0.0), - SetDiffuse(0.0, 0.0, 0.0), - // Color of spot in the middle of pupil - MakeDynObj(D_MATERIAL, 0), - SetId(3), - SetAmbient(1.0, 1.0, 1.0), - SetDiffuse(1.0, 1.0, 1.0), + // ??? + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.291, 1.0), + SetDiffuse(0.0, 0.291, 1.0), + // Iris color + MakeDynObj(D_MATERIAL, 0), + SetId(1), + SetAmbient(0.0, 0.576, 1.0), + SetDiffuse(0.0, 0.576, 1.0), + // Pupil color + MakeDynObj(D_MATERIAL, 0), + SetId(2), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), + // Color of spot in the middle of pupil + MakeDynObj(D_MATERIAL, 0), + SetId(3), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), EndGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), MakeDynObj(D_SHAPE, DYNOBJ_MARIO_RIGHT_EYE_SHAPE), - SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYE_VTX_GROUP), - SetPlaneGroup(DYNOBJ_MARIO_RIGHT_EYE_TRI_GROUP), - SetMaterialGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), + SetNodeGroup(DYNOBJ_MARIO_RIGHT_EYE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_RIGHT_EYE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_RIGHT_EYE_MTL_GROUP), EndList(), }; static s16 verts_mario_eye_left[][3] = { - { 302, 35, -81 }, { 316, 28, -79 }, { 311, -2, -97 }, { 304, 48, -48 }, { 318, 40, -46 }, - { 302, 46, -7 }, { 316, 38, -5 }, { 311, 24, 32 }, { 297, 32, 30 }, { 305, 0, 56 }, - { 291, 7, 55 }, { 298, -34, 60 }, { 280, -57, 40 }, { 294, -64, 42 }, { 279, -70, 7 }, - { 294, -78, 9 }, { 282, -68, -33 }, { 296, -76, -31 }, { 300, -62, -69 }, { 286, -54, -71 }, - { 305, -37, -94 }, { 291, -29, -96 }, { 314, -35, -20 }, { 315, -32, -28 }, { 316, -27, -32 }, - { 285, -26, 58 }, { 316, -9, -71 }, { 312, -30, -69 }, { 310, -46, -53 }, { 305, -58, 3 }, - { 305, -49, 24 }, { 307, -30, 35 }, { 311, -10, 33 }, { 316, 4, 17 }, { 321, 16, -39 }, - { 319, 8, -60 }, { 318, -18, -34 }, { 307, -56, -25 }, { 313, -35, -11 }, { 314, -32, -6 }, - { 315, -25, 0 }, { 316, -17, -3 }, { 318, -11, -6 }, { 320, 14, -9 }, { 319, -8, -23 }, - { 319, -11, -28 }, { 319, -8, -14 }, { 297, 5, -99 }, + { 302, 35, -81 }, { 316, 28, -79 }, { 311, -2, -97 }, { 304, 48, -48 }, { 318, 40, -46 }, { 302, 46, -7 }, + { 316, 38, -5 }, { 311, 24, 32 }, { 297, 32, 30 }, { 305, 0, 56 }, { 291, 7, 55 }, { 298, -34, 60 }, + { 280, -57, 40 }, { 294, -64, 42 }, { 279, -70, 7 }, { 294, -78, 9 }, { 282, -68, -33 }, { 296, -76, -31 }, + { 300, -62, -69 }, { 286, -54, -71 }, { 305, -37, -94 }, { 291, -29, -96 }, { 314, -35, -20 }, { 315, -32, -28 }, + { 316, -27, -32 }, { 285, -26, 58 }, { 316, -9, -71 }, { 312, -30, -69 }, { 310, -46, -53 }, { 305, -58, 3 }, + { 305, -49, 24 }, { 307, -30, 35 }, { 311, -10, 33 }, { 316, 4, 17 }, { 321, 16, -39 }, { 319, 8, -60 }, + { 318, -18, -34 }, { 307, -56, -25 }, { 313, -35, -11 }, { 314, -32, -6 }, { 315, -25, 0 }, { 316, -17, -3 }, + { 318, -11, -6 }, { 320, 14, -9 }, { 319, -8, -23 }, { 319, -11, -28 }, { 319, -8, -14 }, { 297, 5, -99 }, }; static struct GdVtxData vtx_mario_eye_left = { ARRAY_COUNT(verts_mario_eye_left), 0x1, verts_mario_eye_left }; static u16 facedata_mario_eye_left[][4] = { - { 1, 0, 1, 2 }, { 1, 3, 4, 1 }, { 1, 5, 6, 4 }, { 1, 5, 7, 6 }, { 1, 8, 9, 7 }, - { 1, 10, 11, 9 }, { 1, 12, 13, 11 }, { 1, 14, 15, 13 }, { 1, 16, 17, 15 }, { 1, 16, 18, 17 }, - { 1, 19, 20, 18 }, { 1, 21, 2, 20 }, { 1, 2, 47, 0 }, { 1, 1, 26, 2 }, { 1, 2, 26, 20 }, - { 1, 20, 27, 18 }, { 1, 18, 28, 17 }, { 1, 17, 29, 15 }, { 1, 15, 30, 13 }, { 1, 13, 31, 11 }, - { 1, 11, 31, 9 }, { 1, 9, 32, 7 }, { 1, 7, 33, 6 }, { 1, 6, 34, 4 }, { 1, 4, 35, 1 }, - { 1, 4, 34, 35 }, { 1, 6, 43, 34 }, { 1, 33, 43, 6 }, { 1, 32, 33, 7 }, { 1, 31, 32, 9 }, - { 1, 13, 30, 31 }, { 1, 15, 29, 30 }, { 1, 17, 37, 29 }, { 1, 28, 37, 17 }, { 1, 27, 28, 18 }, - { 1, 26, 27, 20 }, { 1, 1, 35, 26 }, { 1, 1, 0, 3 }, { 1, 4, 3, 5 }, { 1, 5, 8, 7 }, - { 1, 8, 10, 9 }, { 1, 10, 25, 11 }, { 1, 11, 25, 12 }, { 1, 13, 12, 14 }, { 1, 15, 14, 16 }, - { 1, 16, 19, 18 }, { 1, 21, 47, 2 }, { 1, 19, 21, 20 }, { 2, 35, 36, 26 }, { 2, 26, 36, 27 }, - { 2, 27, 24, 28 }, { 2, 28, 23, 37 }, { 2, 37, 38, 29 }, { 2, 29, 39, 30 }, { 2, 30, 40, 31 }, - { 2, 31, 40, 32 }, { 2, 32, 41, 33 }, { 2, 33, 42, 43 }, { 2, 43, 44, 34 }, { 2, 34, 45, 35 }, - { 2, 34, 44, 45 }, { 2, 43, 46, 44 }, { 2, 42, 46, 43 }, { 2, 41, 42, 33 }, { 2, 40, 41, 32 }, - { 2, 30, 39, 40 }, { 2, 29, 38, 39 }, { 2, 37, 22, 38 }, { 2, 23, 22, 37 }, { 2, 24, 23, 28 }, - { 2, 36, 24, 27 }, { 2, 35, 45, 36 }, { 3, 22, 23, 24 }, { 3, 24, 36, 22 }, { 3, 36, 38, 22 }, - { 3, 36, 39, 38 }, { 3, 36, 40, 39 }, { 3, 36, 41, 40 }, { 3, 36, 45, 41 }, { 3, 45, 42, 41 }, - { 3, 45, 46, 42 }, { 3, 45, 44, 46 }, + { 1, 0, 1, 2 }, { 1, 3, 4, 1 }, { 1, 5, 6, 4 }, { 1, 5, 7, 6 }, { 1, 8, 9, 7 }, { 1, 10, 11, 9 }, + { 1, 12, 13, 11 }, { 1, 14, 15, 13 }, { 1, 16, 17, 15 }, { 1, 16, 18, 17 }, { 1, 19, 20, 18 }, { 1, 21, 2, 20 }, + { 1, 2, 47, 0 }, { 1, 1, 26, 2 }, { 1, 2, 26, 20 }, { 1, 20, 27, 18 }, { 1, 18, 28, 17 }, { 1, 17, 29, 15 }, + { 1, 15, 30, 13 }, { 1, 13, 31, 11 }, { 1, 11, 31, 9 }, { 1, 9, 32, 7 }, { 1, 7, 33, 6 }, { 1, 6, 34, 4 }, + { 1, 4, 35, 1 }, { 1, 4, 34, 35 }, { 1, 6, 43, 34 }, { 1, 33, 43, 6 }, { 1, 32, 33, 7 }, { 1, 31, 32, 9 }, + { 1, 13, 30, 31 }, { 1, 15, 29, 30 }, { 1, 17, 37, 29 }, { 1, 28, 37, 17 }, { 1, 27, 28, 18 }, { 1, 26, 27, 20 }, + { 1, 1, 35, 26 }, { 1, 1, 0, 3 }, { 1, 4, 3, 5 }, { 1, 5, 8, 7 }, { 1, 8, 10, 9 }, { 1, 10, 25, 11 }, + { 1, 11, 25, 12 }, { 1, 13, 12, 14 }, { 1, 15, 14, 16 }, { 1, 16, 19, 18 }, { 1, 21, 47, 2 }, { 1, 19, 21, 20 }, + { 2, 35, 36, 26 }, { 2, 26, 36, 27 }, { 2, 27, 24, 28 }, { 2, 28, 23, 37 }, { 2, 37, 38, 29 }, { 2, 29, 39, 30 }, + { 2, 30, 40, 31 }, { 2, 31, 40, 32 }, { 2, 32, 41, 33 }, { 2, 33, 42, 43 }, { 2, 43, 44, 34 }, { 2, 34, 45, 35 }, + { 2, 34, 44, 45 }, { 2, 43, 46, 44 }, { 2, 42, 46, 43 }, { 2, 41, 42, 33 }, { 2, 40, 41, 32 }, { 2, 30, 39, 40 }, + { 2, 29, 38, 39 }, { 2, 37, 22, 38 }, { 2, 23, 22, 37 }, { 2, 24, 23, 28 }, { 2, 36, 24, 27 }, { 2, 35, 45, 36 }, + { 3, 22, 23, 24 }, { 3, 24, 36, 22 }, { 3, 36, 38, 22 }, { 3, 36, 39, 38 }, { 3, 36, 40, 39 }, { 3, 36, 41, 40 }, + { 3, 36, 45, 41 }, { 3, 45, 42, 41 }, { 3, 45, 46, 42 }, { 3, 45, 44, 46 }, }; static struct GdFaceData faces_mario_eye_left = { ARRAY_COUNT(facedata_mario_eye_left), 0x1, facedata_mario_eye_left }; @@ -123,38 +114,38 @@ struct DynList dynlist_mario_eye_left_shape[28] = { BeginList(), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_VTX_GROUP), - LinkWithPtr(&vtx_mario_eye_left), + LinkWithPtr(&vtx_mario_eye_left), MakeDynObj(D_DATA_GRP, DYNOBJ_MARIO_LEFT_EYE_TRI_GROUP), - LinkWithPtr(&faces_mario_eye_left), + LinkWithPtr(&faces_mario_eye_left), StartGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), - // ??? - MakeDynObj(D_MATERIAL, 0), - SetId(0), - SetAmbient(0.0, 0.291, 1.0), - SetDiffuse(0.0, 0.291, 1.0), - // Iris color - MakeDynObj(D_MATERIAL, 0), - SetId(1), - SetAmbient(0.0, 0.576, 1.0), - SetDiffuse(0.0, 0.576, 1.0), - // Pupil color - MakeDynObj(D_MATERIAL, 0), - SetId(2), - SetAmbient(0.0, 0.0, 0.0), - SetDiffuse(0.0, 0.0, 0.0), - // Color of spot in the middle of pupil - MakeDynObj(D_MATERIAL, 0), - SetId(3), - SetAmbient(1.0, 1.0, 1.0), - SetDiffuse(1.0, 1.0, 1.0), + // ??? + MakeDynObj(D_MATERIAL, 0), + SetId(0), + SetAmbient(0.0, 0.291, 1.0), + SetDiffuse(0.0, 0.291, 1.0), + // Iris color + MakeDynObj(D_MATERIAL, 0), + SetId(1), + SetAmbient(0.0, 0.576, 1.0), + SetDiffuse(0.0, 0.576, 1.0), + // Pupil color + MakeDynObj(D_MATERIAL, 0), + SetId(2), + SetAmbient(0.0, 0.0, 0.0), + SetDiffuse(0.0, 0.0, 0.0), + // Color of spot in the middle of pupil + MakeDynObj(D_MATERIAL, 0), + SetId(3), + SetAmbient(1.0, 1.0, 1.0), + SetDiffuse(1.0, 1.0, 1.0), EndGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), MakeDynObj(D_SHAPE, DYNOBJ_MARIO_LEFT_EYE_SHAPE), - SetNodeGroup(DYNOBJ_MARIO_LEFT_EYE_VTX_GROUP), - SetPlaneGroup(DYNOBJ_MARIO_LEFT_EYE_TRI_GROUP), - SetMaterialGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), + SetNodeGroup(DYNOBJ_MARIO_LEFT_EYE_VTX_GROUP), + SetPlaneGroup(DYNOBJ_MARIO_LEFT_EYE_TRI_GROUP), + SetMaterialGroup(DYNOBJ_MARIO_LEFT_EYE_MTL_GROUP), EndList(), }; diff --git a/src/goddard/gd_main.c b/src/goddard/gd_main.c index a33910fa..1d869dc3 100644 --- a/src/goddard/gd_main.c +++ b/src/goddard/gd_main.c @@ -30,7 +30,7 @@ struct GdControl gGdCtrlPrev; // @ 801B9A18; previous frame's controller info u32 __main__(void) { UNUSED u8 filler[4]; - gd_printf("%x, %x\n", (u32) (uintptr_t) &D_801A8058, (u32) (uintptr_t) &gGdMoveScene); + gd_printf("%x, %x\n", (u32)(uintptr_t)&D_801A8058, (u32)(uintptr_t)&gGdMoveScene); imin("main"); gd_init(); @@ -42,7 +42,7 @@ u32 __main__(void) { gGdCtrl.prevFrame = &gGdCtrlPrev; imin("main - make_scene"); - make_scene(); // make_scene does nothing, though + make_scene(); // make_scene does nothing, though imout(); gd_init_controllers(); diff --git a/src/goddard/gd_math.c b/src/goddard/gd_math.c index cae7804a..29bcacf3 100644 --- a/src/goddard/gd_math.c +++ b/src/goddard/gd_math.c @@ -13,7 +13,7 @@ * it as a double and finding the square root from there. */ f32 gd_sqrt_f(f32 val) { - return (f32) gd_sqrt_d(val); + return (f32)gd_sqrt_d(val); } /** @@ -22,8 +22,8 @@ f32 gd_sqrt_f(f32 val) { * at the position 'to'. * An effective goddard copy of mtxf_lookat. */ -void gd_mat4f_lookat(Mat4f *mtx, f32 xFrom, f32 yFrom, f32 zFrom, f32 xTo, f32 yTo, f32 zTo, - f32 zColY, f32 yColY, f32 xColY) { +void gd_mat4f_lookat(Mat4f* mtx, f32 xFrom, f32 yFrom, f32 zFrom, f32 xTo, f32 yTo, f32 zTo, f32 zColY, f32 yColY, + f32 xColY) { f32 invLength; struct GdVec3f d; @@ -104,7 +104,7 @@ void gd_mat4f_lookat(Mat4f *mtx, f32 xFrom, f32 yFrom, f32 zFrom, f32 xTo, f32 y /** * Scales a mat4f in each dimension by a vector. */ -void gd_scale_mat4f_by_vec3f(Mat4f *mtx, struct GdVec3f *vec) { +void gd_scale_mat4f_by_vec3f(Mat4f* mtx, struct GdVec3f* vec) { (*mtx)[0][0] *= vec->x; (*mtx)[0][1] *= vec->x; (*mtx)[0][2] *= vec->x; @@ -119,7 +119,7 @@ void gd_scale_mat4f_by_vec3f(Mat4f *mtx, struct GdVec3f *vec) { /** * Rotates the matrix 'mtx' about the vector given. */ -void gd_rot_mat_about_vec(Mat4f *mtx, struct GdVec3f *vec) { +void gd_rot_mat_about_vec(Mat4f* mtx, struct GdVec3f* vec) { if (vec->x != 0.0f) { gd_absrot_mat4(mtx, GD_X_AXIS, vec->x); } @@ -135,7 +135,7 @@ void gd_rot_mat_about_vec(Mat4f *mtx, struct GdVec3f *vec) { * Adds each component of a vector to the * translation column of a mat4f matrix. */ -void gd_add_vec3f_to_mat4f_offset(Mat4f *mtx, struct GdVec3f *vec) { +void gd_add_vec3f_to_mat4f_offset(Mat4f* mtx, struct GdVec3f* vec) { UNUSED Mat4f temp; f32 z, y, x; @@ -157,7 +157,7 @@ void gd_add_vec3f_to_mat4f_offset(Mat4f *mtx, struct GdVec3f *vec) { * | -x -y -z 0 | * | 0 0 0 1 | */ -void gd_create_origin_lookat(Mat4f *mtx, struct GdVec3f *vec, f32 roll) { +void gd_create_origin_lookat(Mat4f* mtx, struct GdVec3f* vec, f32 roll) { f32 invertedHMag; f32 hMag; f32 c; @@ -237,7 +237,7 @@ f32 gd_clamp_f32(f32 a, f32 b) { /** * Clamps a vector within a set range about zero. */ -void gd_clamp_vec3f(struct GdVec3f *vec, f32 limit) { +void gd_clamp_vec3f(struct GdVec3f* vec, f32 limit) { if (vec->x > limit) { vec->x = limit; } else if (vec->x < -limit) { @@ -260,7 +260,7 @@ void gd_clamp_vec3f(struct GdVec3f *vec, f32 limit) { /** * Rotates a 2D vector by some angle in degrees. */ -void gd_rot_2d_vec(f32 deg, f32 *x, f32 *y) { +void gd_rot_2d_vec(f32 deg, f32* x, f32* y) { f32 xP; f32 yP; f32 rad; @@ -275,7 +275,7 @@ void gd_rot_2d_vec(f32 deg, f32 *x, f32 *y) { /** * Rotates a matrix about one of its rows. */ -void UNUSED gd_rot_mat_about_row(Mat4f *mat, s32 row, f32 ang) { +void UNUSED gd_rot_mat_about_row(Mat4f* mat, s32 row, f32 ang) { Mat4f rot; struct GdVec3f vec; @@ -291,7 +291,7 @@ void UNUSED gd_rot_mat_about_row(Mat4f *mat, s32 row, f32 ang) { * Rotates a mat4f matrix about a given axis * by a set angle in degrees. */ -void gd_absrot_mat4(Mat4f *mtx, s32 axisnum, f32 ang) { +void gd_absrot_mat4(Mat4f* mtx, s32 axisnum, f32 ang) { Mat4f rMat; struct GdVec3f rot; @@ -319,15 +319,14 @@ void gd_absrot_mat4(Mat4f *mtx, s32 axisnum, f32 ang) { gd_mult_mat4f(mtx, &rMat, mtx); } - -f32 gd_vec3f_magnitude(struct GdVec3f *vec) { +f32 gd_vec3f_magnitude(struct GdVec3f* vec) { return gd_sqrt_f(SQ(vec->x) + SQ(vec->y) + SQ(vec->z)); } /** * Normalizes a vec3f to have a length of 1. */ -s32 gd_normalize_vec3f(struct GdVec3f *vec) { +s32 gd_normalize_vec3f(struct GdVec3f* vec) { f32 mag; if ((mag = SQ(vec->x) + SQ(vec->y) + SQ(vec->z)) == 0.0f) { return FALSE; @@ -352,7 +351,7 @@ s32 gd_normalize_vec3f(struct GdVec3f *vec) { /** * Stores the cross product of 'a' x 'b' in 'dst'. */ -void gd_cross_vec3f(struct GdVec3f *a, struct GdVec3f *b, struct GdVec3f *dst) { +void gd_cross_vec3f(struct GdVec3f* a, struct GdVec3f* b, struct GdVec3f* dst) { struct GdVec3f result; result.x = (a->y * b->z) - (a->z * b->y); @@ -367,14 +366,14 @@ void gd_cross_vec3f(struct GdVec3f *a, struct GdVec3f *b, struct GdVec3f *dst) { /** * Returns the dot product of 'a' and 'b'. */ -f32 gd_dot_vec3f(struct GdVec3f *a, struct GdVec3f *b) { +f32 gd_dot_vec3f(struct GdVec3f* a, struct GdVec3f* b) { return (a->x * b->x) + (a->y * b->y) + (a->z * b->z); } /** * Inverts each element of src into dst. */ -void UNUSED gd_invert_elements_mat4f(Mat4f *src, Mat4f *dst) { +void UNUSED gd_invert_elements_mat4f(Mat4f* src, Mat4f* dst) { s32 i; s32 j; @@ -389,7 +388,7 @@ void UNUSED gd_invert_elements_mat4f(Mat4f *src, Mat4f *dst) { * Inverts a matrix from src and stores it into dst. * Reaches a fatal_print if the determinant is 0. */ -void gd_inverse_mat4f(Mat4f *src, Mat4f *dst) { +void gd_inverse_mat4f(Mat4f* src, Mat4f* dst) { s32 i; s32 j; f32 determinant; @@ -411,7 +410,7 @@ void gd_inverse_mat4f(Mat4f *src, Mat4f *dst) { /** * Takes a matrix from src and converts it into its adjunct in dst. */ -void gd_adjunct_mat4f(Mat4f *src, Mat4f *dst) { +void gd_adjunct_mat4f(Mat4f* src, Mat4f* dst) { struct InvMat4 inv; inv.r3.c3 = (*src)[0][0]; @@ -431,44 +430,44 @@ void gd_adjunct_mat4f(Mat4f *src, Mat4f *dst) { inv.r1.c0 = (*src)[3][2]; inv.r0.c0 = (*src)[3][3]; - (*dst)[0][0] = gd_3x3_det(inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, - inv.r0.c2, inv.r0.c1, inv.r0.c0); - (*dst)[1][0] = -gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, - inv.r0.c2, inv.r0.c1, inv.r0.c0); - (*dst)[2][0] = gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, - inv.r0.c2, inv.r0.c1, inv.r0.c0); - (*dst)[3][0] = -gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, - inv.r1.c2, inv.r1.c1, inv.r1.c0); - (*dst)[0][1] = -gd_3x3_det(inv.r2.c3, inv.r2.c1, inv.r2.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0, - inv.r0.c3, inv.r0.c1, inv.r0.c0); - (*dst)[1][1] = gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0, - inv.r0.c3, inv.r0.c1, inv.r0.c0); - (*dst)[2][1] = -gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r2.c3, inv.r2.c1, inv.r2.c0, - inv.r0.c3, inv.r0.c1, inv.r0.c0); - (*dst)[3][1] = gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r2.c3, inv.r2.c1, inv.r2.c0, - inv.r1.c3, inv.r1.c1, inv.r1.c0); - (*dst)[0][2] = gd_3x3_det(inv.r2.c3, inv.r2.c2, inv.r2.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0, - inv.r0.c3, inv.r0.c2, inv.r0.c0); - (*dst)[1][2] = -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0, - inv.r0.c3, inv.r0.c2, inv.r0.c0); - (*dst)[2][2] = gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r2.c3, inv.r2.c2, inv.r2.c0, - inv.r0.c3, inv.r0.c2, inv.r0.c0); - (*dst)[3][2] = -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r2.c3, inv.r2.c2, inv.r2.c0, - inv.r1.c3, inv.r1.c2, inv.r1.c0); - (*dst)[0][3] = -gd_3x3_det(inv.r2.c3, inv.r2.c2, inv.r2.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1, - inv.r0.c3, inv.r0.c2, inv.r0.c1); - (*dst)[1][3] = gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1, - inv.r0.c3, inv.r0.c2, inv.r0.c1); - (*dst)[2][3] = -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r2.c3, inv.r2.c2, inv.r2.c1, - inv.r0.c3, inv.r0.c2, inv.r0.c1); - (*dst)[3][3] = gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r2.c3, inv.r2.c2, inv.r2.c1, - inv.r1.c3, inv.r1.c2, inv.r1.c1); + (*dst)[0][0] = + gd_3x3_det(inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, inv.r0.c2, inv.r0.c1, inv.r0.c0); + (*dst)[1][0] = + -gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, inv.r0.c2, inv.r0.c1, inv.r0.c0); + (*dst)[2][0] = + gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r0.c2, inv.r0.c1, inv.r0.c0); + (*dst)[3][0] = + -gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0); + (*dst)[0][1] = + -gd_3x3_det(inv.r2.c3, inv.r2.c1, inv.r2.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0, inv.r0.c3, inv.r0.c1, inv.r0.c0); + (*dst)[1][1] = + gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0, inv.r0.c3, inv.r0.c1, inv.r0.c0); + (*dst)[2][1] = + -gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r2.c3, inv.r2.c1, inv.r2.c0, inv.r0.c3, inv.r0.c1, inv.r0.c0); + (*dst)[3][1] = + gd_3x3_det(inv.r3.c3, inv.r3.c1, inv.r3.c0, inv.r2.c3, inv.r2.c1, inv.r2.c0, inv.r1.c3, inv.r1.c1, inv.r1.c0); + (*dst)[0][2] = + gd_3x3_det(inv.r2.c3, inv.r2.c2, inv.r2.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0, inv.r0.c3, inv.r0.c2, inv.r0.c0); + (*dst)[1][2] = + -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0, inv.r0.c3, inv.r0.c2, inv.r0.c0); + (*dst)[2][2] = + gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r2.c3, inv.r2.c2, inv.r2.c0, inv.r0.c3, inv.r0.c2, inv.r0.c0); + (*dst)[3][2] = + -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c0, inv.r2.c3, inv.r2.c2, inv.r2.c0, inv.r1.c3, inv.r1.c2, inv.r1.c0); + (*dst)[0][3] = + -gd_3x3_det(inv.r2.c3, inv.r2.c2, inv.r2.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1, inv.r0.c3, inv.r0.c2, inv.r0.c1); + (*dst)[1][3] = + gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1, inv.r0.c3, inv.r0.c2, inv.r0.c1); + (*dst)[2][3] = + -gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r2.c3, inv.r2.c2, inv.r2.c1, inv.r0.c3, inv.r0.c2, inv.r0.c1); + (*dst)[3][3] = + gd_3x3_det(inv.r3.c3, inv.r3.c2, inv.r3.c1, inv.r2.c3, inv.r2.c2, inv.r2.c1, inv.r1.c3, inv.r1.c2, inv.r1.c1); } /** * Returns the determinant of a mat4f matrix. */ -f32 gd_mat4f_det(Mat4f *mtx) { +f32 gd_mat4f_det(Mat4f* mtx) { f32 det; struct InvMat4 inv; @@ -489,22 +488,14 @@ f32 gd_mat4f_det(Mat4f *mtx) { inv.r1.c0 = (*mtx)[3][2]; inv.r0.c0 = (*mtx)[3][3]; - det = (inv.r3.c3 - * gd_3x3_det(inv.r2.c2, inv.r2.c1, inv.r2.c0, - inv.r1.c2, inv.r1.c1, inv.r1.c0, - inv.r0.c2, inv.r0.c1, inv.r0.c0) - - inv.r2.c3 - * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, - inv.r1.c2, inv.r1.c1, inv.r1.c0, - inv.r0.c2, inv.r0.c1, inv.r0.c0)) - + inv.r1.c3 - * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, - inv.r2.c2, inv.r2.c1, inv.r2.c0, - inv.r0.c2, inv.r0.c1, inv.r0.c0) - - inv.r0.c3 - * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, - inv.r2.c2, inv.r2.c1, inv.r2.c0, - inv.r1.c2, inv.r1.c1, inv.r1.c0); + det = (inv.r3.c3 * gd_3x3_det(inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, inv.r0.c2, + inv.r0.c1, inv.r0.c0) - + inv.r2.c3 * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r1.c2, inv.r1.c1, inv.r1.c0, inv.r0.c2, + inv.r0.c1, inv.r0.c0)) + + inv.r1.c3 * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r0.c2, inv.r0.c1, + inv.r0.c0) - + inv.r0.c3 * gd_3x3_det(inv.r3.c2, inv.r3.c1, inv.r3.c0, inv.r2.c2, inv.r2.c1, inv.r2.c0, inv.r1.c2, inv.r1.c1, + inv.r1.c0); return det; } @@ -513,13 +504,11 @@ f32 gd_mat4f_det(Mat4f *mtx) { * Takes the individual values of a 3 by 3 matrix and * returns the determinant. */ -f32 gd_3x3_det(f32 r0c0, f32 r0c1, f32 r0c2, - f32 r1c0, f32 r1c1, f32 r1c2, - f32 r2c0, f32 r2c1, f32 r2c2) { +f32 gd_3x3_det(f32 r0c0, f32 r0c1, f32 r0c2, f32 r1c0, f32 r1c1, f32 r1c2, f32 r2c0, f32 r2c1, f32 r2c2) { f32 det; - det = r0c0 * gd_2x2_det(r1c1, r1c2, r2c1, r2c2) - r1c0 * gd_2x2_det(r0c1, r0c2, r2c1, r2c2) - + r2c0 * gd_2x2_det(r0c1, r0c2, r1c1, r1c2); + det = r0c0 * gd_2x2_det(r1c1, r1c2, r2c1, r2c2) - r1c0 * gd_2x2_det(r0c1, r0c2, r2c1, r2c2) + + r2c0 * gd_2x2_det(r0c1, r0c2, r1c1, r1c2); return det; } @@ -539,7 +528,7 @@ f32 gd_2x2_det(f32 a, f32 b, f32 c, f32 d) { * to 1 0 0 0. Perhaps meant to be used at the end of gd_create_quat_rot_mat? Not * sure of the purpose of the vector portion, though. */ -void UNUSED gd_create_neg_vec_zero_first_mat_row(Mat4f *mtx, struct GdVec3f *vec, f32 x, f32 y, f32 z) { +void UNUSED gd_create_neg_vec_zero_first_mat_row(Mat4f* mtx, struct GdVec3f* vec, f32 x, f32 y, f32 z) { s32 i; vec->x = -x; @@ -557,7 +546,7 @@ void UNUSED gd_create_neg_vec_zero_first_mat_row(Mat4f *mtx, struct GdVec3f *vec * This function quite literally does nothing. * Seems to have been meant to create a vector from a quaternion? */ -void UNUSED gd_broken_quat_to_vec3f(f32 quat[4], struct GdVec3f *vec, f32 zHalf, s32 i, s32 run) { +void UNUSED gd_broken_quat_to_vec3f(f32 quat[4], struct GdVec3f* vec, f32 zHalf, s32 i, s32 run) { s32 j; s32 k; UNUSED f32 jVal; @@ -622,7 +611,7 @@ void UNUSED gd_quat_rotation(f32 quat[4], UNUSED s32 unused, f32 c, f32 s, s32 i /** * Shifts a matrix up by one row, putting the top row on bottom. */ -void gd_shift_mat_up(Mat4f *mtx) { +void gd_shift_mat_up(Mat4f* mtx) { s32 i; s32 j; f32 temp[3]; @@ -657,7 +646,7 @@ void gd_shift_mat_up(Mat4f *mtx) { * * Potentially broken if 'mtx' is not an identity matrix/zero'ed. */ -void UNUSED gd_create_quat_rot_mat(f32 quat[4], UNUSED s32 unused, Mat4f *mtx) { +void UNUSED gd_create_quat_rot_mat(f32 quat[4], UNUSED s32 unused, Mat4f* mtx) { f32 twoIJ; f32 two0K; f32 sqQuat[4]; @@ -706,7 +695,7 @@ void UNUSED gd_create_quat_rot_mat(f32 quat[4], UNUSED s32 unused, Mat4f *mtx) { * | (1-c)xz-sy (1-c)xy-sz (1-c)x^2+c 0 | * | 0 0 0 1 | */ -void gd_create_rot_matrix(Mat4f *mtx, struct GdVec3f *vec, f32 s, f32 c) { +void gd_create_rot_matrix(Mat4f* mtx, struct GdVec3f* vec, f32 s, f32 c) { f32 oneMinusCos; struct GdVec3f rev; @@ -740,7 +729,7 @@ void gd_create_rot_matrix(Mat4f *mtx, struct GdVec3f *vec, f32 s, f32 c) { /** * Creates a rotation matrix about vector 'vec' with ang in degrees. */ -void gd_create_rot_mat_angular(Mat4f *mtx, struct GdVec3f *vec, f32 ang) { +void gd_create_rot_mat_angular(Mat4f* mtx, struct GdVec3f* vec, f32 ang) { f32 s; f32 c; @@ -753,7 +742,7 @@ void gd_create_rot_mat_angular(Mat4f *mtx, struct GdVec3f *vec, f32 ang) { /** * Sets a mat4f matrix to an identity matrix. */ -void gd_set_identity_mat4(Mat4f *mtx) { +void gd_set_identity_mat4(Mat4f* mtx) { (*mtx)[0][0] = 1.0f; (*mtx)[0][1] = 0.0f; (*mtx)[0][2] = 0.0f; @@ -775,7 +764,7 @@ void gd_set_identity_mat4(Mat4f *mtx) { /** * Copies a mat4f from src to dst. */ -void gd_copy_mat4f(const Mat4f *src, Mat4f *dst) { +void gd_copy_mat4f(const Mat4f* src, Mat4f* dst) { (*dst)[0][0] = (*src)[0][0]; (*dst)[0][1] = (*src)[0][1]; (*dst)[0][2] = (*src)[0][2]; @@ -798,7 +787,7 @@ void gd_copy_mat4f(const Mat4f *src, Mat4f *dst) { * Transforms a vec3f, rotating with the main 3x3 portion of the mat4f * and translating with the 4th column. */ -void gd_rotate_and_translate_vec3f(struct GdVec3f *vec, const Mat4f *mtx) { +void gd_rotate_and_translate_vec3f(struct GdVec3f* vec, const Mat4f* mtx) { struct GdVec3f out; out.x = (*mtx)[0][0] * vec->x + (*mtx)[1][0] * vec->y + (*mtx)[2][0] * vec->z; @@ -816,7 +805,7 @@ void gd_rotate_and_translate_vec3f(struct GdVec3f *vec, const Mat4f *mtx) { /** * Multiples a vec3f by the main 3x3 portion of a mat4f matrix. */ -void gd_mat4f_mult_vec3f(struct GdVec3f *vec, const Mat4f *mtx) { +void gd_mat4f_mult_vec3f(struct GdVec3f* vec, const Mat4f* mtx) { struct GdVec3f out; out.x = (*mtx)[0][0] * vec->x + (*mtx)[1][0] * vec->y + (*mtx)[2][0] * vec->z; @@ -828,38 +817,38 @@ void gd_mat4f_mult_vec3f(struct GdVec3f *vec, const Mat4f *mtx) { vec->z = out.z; } -#define MAT4_DOT_PROD(A, B, R, row, col) \ - { \ - (R)[(row)][(col)] = (A)[(row)][0] * (B)[0][(col)]; \ - (R)[(row)][(col)] += (A)[(row)][1] * (B)[1][(col)]; \ - (R)[(row)][(col)] += (A)[(row)][2] * (B)[2][(col)]; \ - (R)[(row)][(col)] += (A)[(row)][3] * (B)[3][(col)]; \ +#define MAT4_DOT_PROD(A, B, R, row, col) \ + { \ + (R)[(row)][(col)] = (A)[(row)][0] * (B)[0][(col)]; \ + (R)[(row)][(col)] += (A)[(row)][1] * (B)[1][(col)]; \ + (R)[(row)][(col)] += (A)[(row)][2] * (B)[2][(col)]; \ + (R)[(row)][(col)] += (A)[(row)][3] * (B)[3][(col)]; \ } -#define MAT4_MULTIPLY(A, B, R) \ - { \ - MAT4_DOT_PROD((A), (B), (R), 0, 0); \ - MAT4_DOT_PROD((A), (B), (R), 0, 1); \ - MAT4_DOT_PROD((A), (B), (R), 0, 2); \ - MAT4_DOT_PROD((A), (B), (R), 0, 3); \ - MAT4_DOT_PROD((A), (B), (R), 1, 0); \ - MAT4_DOT_PROD((A), (B), (R), 1, 1); \ - MAT4_DOT_PROD((A), (B), (R), 1, 2); \ - MAT4_DOT_PROD((A), (B), (R), 1, 3); \ - MAT4_DOT_PROD((A), (B), (R), 2, 0); \ - MAT4_DOT_PROD((A), (B), (R), 2, 1); \ - MAT4_DOT_PROD((A), (B), (R), 2, 2); \ - MAT4_DOT_PROD((A), (B), (R), 2, 3); \ - MAT4_DOT_PROD((A), (B), (R), 3, 0); \ - MAT4_DOT_PROD((A), (B), (R), 3, 1); \ - MAT4_DOT_PROD((A), (B), (R), 3, 2); \ - MAT4_DOT_PROD((A), (B), (R), 3, 3); \ +#define MAT4_MULTIPLY(A, B, R) \ + { \ + MAT4_DOT_PROD((A), (B), (R), 0, 0); \ + MAT4_DOT_PROD((A), (B), (R), 0, 1); \ + MAT4_DOT_PROD((A), (B), (R), 0, 2); \ + MAT4_DOT_PROD((A), (B), (R), 0, 3); \ + MAT4_DOT_PROD((A), (B), (R), 1, 0); \ + MAT4_DOT_PROD((A), (B), (R), 1, 1); \ + MAT4_DOT_PROD((A), (B), (R), 1, 2); \ + MAT4_DOT_PROD((A), (B), (R), 1, 3); \ + MAT4_DOT_PROD((A), (B), (R), 2, 0); \ + MAT4_DOT_PROD((A), (B), (R), 2, 1); \ + MAT4_DOT_PROD((A), (B), (R), 2, 2); \ + MAT4_DOT_PROD((A), (B), (R), 2, 3); \ + MAT4_DOT_PROD((A), (B), (R), 3, 0); \ + MAT4_DOT_PROD((A), (B), (R), 3, 1); \ + MAT4_DOT_PROD((A), (B), (R), 3, 2); \ + MAT4_DOT_PROD((A), (B), (R), 3, 3); \ } /** * Multiplies two Mat4f matrices and puts it in dst. */ -void gd_mult_mat4f(const Mat4f *mA, const Mat4f *mB, Mat4f *dst) { +void gd_mult_mat4f(const Mat4f* mA, const Mat4f* mB, Mat4f* dst) { Mat4f res; MAT4_MULTIPLY((*mA), (*mB), res); @@ -874,7 +863,7 @@ void gd_mult_mat4f(const Mat4f *mA, const Mat4f *mB, Mat4f *dst) { * * Printed the prefix at some point, as shown by how the function is used. */ -void gd_print_vec(UNUSED const char *prefix, const struct GdVec3f *vec) { +void gd_print_vec(UNUSED const char* prefix, const struct GdVec3f* vec) { UNUSED u8 filler[8]; printf("%f,%f,%f\n", vec->x, vec->y, vec->z); @@ -886,7 +875,7 @@ void gd_print_vec(UNUSED const char *prefix, const struct GdVec3f *vec) { * * Printed a prefix at some point, as shone by how the function is used. */ -void gd_print_bounding_box(UNUSED const char *prefix, UNUSED const struct GdBoundingBox *p) { +void gd_print_bounding_box(UNUSED const char* prefix, UNUSED const struct GdBoundingBox* p) { UNUSED u8 filler[8]; printf("Min X = %f, Max X = %f \n", p->minX, p->maxX); @@ -901,7 +890,7 @@ void gd_print_bounding_box(UNUSED const char *prefix, UNUSED const struct GdBoun * Although the prefix input is unused, the one usage of this function * does have a "Matrix:" prefix, so it was definitely used at one point. */ -void gd_print_mtx(UNUSED const char *prefix, const Mat4f *mtx) { +void gd_print_mtx(UNUSED const char* prefix, const Mat4f* mtx) { s32 i; s32 j; @@ -916,7 +905,7 @@ void gd_print_mtx(UNUSED const char *prefix, const Mat4f *mtx) { /** * Prints a quaternion along with a prefix. */ -void UNUSED gd_print_quat(const char *prefix, const f32 f[4]) { +void UNUSED gd_print_quat(const char* prefix, const f32 f[4]) { s32 i; gd_printf(prefix); @@ -930,7 +919,7 @@ void UNUSED gd_print_quat(const char *prefix, const f32 f[4]) { * Rotates a matrix or creates a rotation matrix about a vector made from an offset * of 100 and the passed in x, y, and z values. */ -void UNUSED gd_rot_mat_offset(Mat4f *dst, f32 x, f32 y, f32 z, s32 copy) { +void UNUSED gd_rot_mat_offset(Mat4f* dst, f32 x, f32 y, f32 z, s32 copy) { f32 adj = 100.0f; Mat4f rot; f32 c; diff --git a/src/goddard/gd_memory.c b/src/goddard/gd_memory.c index 9b2556e4..e98dc79e 100644 --- a/src/goddard/gd_memory.c +++ b/src/goddard/gd_memory.c @@ -15,15 +15,15 @@ */ /* bss */ -static struct GMemBlock *sFreeBlockListHead; -static struct GMemBlock *sUsedBlockListHead; -static struct GMemBlock *sEmptyBlockListHead; +static struct GMemBlock* sFreeBlockListHead; +static struct GMemBlock* sUsedBlockListHead; +static struct GMemBlock* sEmptyBlockListHead; /* Forward Declarations */ -void empty_mem_block(struct GMemBlock *); -struct GMemBlock *into_free_memblock(struct GMemBlock *); -struct GMemBlock *make_mem_block(u32, u8); -u32 print_list_stats(struct GMemBlock *, s32, s32); +void empty_mem_block(struct GMemBlock*); +struct GMemBlock* into_free_memblock(struct GMemBlock*); +struct GMemBlock* make_mem_block(u32, u8); +u32 print_list_stats(struct GMemBlock*, s32, s32); /** * Empty a `GMemBlock` into a default state. This empty block @@ -31,7 +31,7 @@ u32 print_list_stats(struct GMemBlock *, s32, s32); * block is removed from whatever list is was in, and is added * to the empty block list. */ -void empty_mem_block(struct GMemBlock *block) { +void empty_mem_block(struct GMemBlock* block) { if (block->next != NULL) { block->next->prev = block->prev; } @@ -69,9 +69,9 @@ void empty_mem_block(struct GMemBlock *block) { * for allocation. * * @returns pointer to the free `GMemBlock` */ -struct GMemBlock *into_free_memblock(struct GMemBlock *block) { - struct GMemBlock *freeBlock; - void *ptr; +struct GMemBlock* into_free_memblock(struct GMemBlock* block) { + struct GMemBlock* freeBlock; + void* ptr; u8 permanence; u32 space; @@ -98,11 +98,11 @@ struct GMemBlock *into_free_memblock(struct GMemBlock *block) { * four bits imply a temporary block * @returns a pointer to the new `GMemBlock` */ -struct GMemBlock *make_mem_block(u32 blockType, u8 permFlag) { - struct GMemBlock *newMemBlock; +struct GMemBlock* make_mem_block(u32 blockType, u8 permFlag) { + struct GMemBlock* newMemBlock; if (sEmptyBlockListHead == NULL) { - sEmptyBlockListHead = (struct GMemBlock *) gd_allocblock(sizeof(struct GMemBlock)); + sEmptyBlockListHead = (struct GMemBlock*)gd_allocblock(sizeof(struct GMemBlock)); if (sEmptyBlockListHead == NULL) { fatal_printf("MakeMemBlock() unable to allocate"); @@ -136,7 +136,7 @@ struct GMemBlock *make_mem_block(u32 blockType, u8 permFlag) { fatal_printf("unkown memblock type"); } newMemBlock->prev = NULL; - newMemBlock->blockType = (u8) blockType; + newMemBlock->blockType = (u8)blockType; newMemBlock->permFlag = permFlag; return newMemBlock; @@ -149,10 +149,10 @@ struct GMemBlock *make_mem_block(u32 blockType, u8 permFlag) { * @returns size of memory freed * @retval 0 `ptr` did not point to a valid memory block */ -u32 gd_free_mem(void *ptr) { - register struct GMemBlock *curBlock; +u32 gd_free_mem(void* ptr) { + register struct GMemBlock* curBlock; u32 bytesFreed; - register u8 *targetBlock = ptr; + register u8* targetBlock = ptr; for (curBlock = sUsedBlockListHead; curBlock != NULL; curBlock = curBlock->next) { if (targetBlock == curBlock->ptr) { @@ -173,10 +173,10 @@ u32 gd_free_mem(void *ptr) { * @return pointer to heap * @retval NULL could not fulfill the request */ -void *gd_request_mem(u32 size, u8 permanence) { - struct GMemBlock *foundBlock = NULL; - struct GMemBlock *curBlock; - struct GMemBlock *newBlock; +void* gd_request_mem(u32 size, u8 permanence) { + struct GMemBlock* foundBlock = NULL; + struct GMemBlock* curBlock; + struct GMemBlock* newBlock; newBlock = make_mem_block(G_MEM_BLOCK_USED, permanence); curBlock = sFreeBlockListHead; @@ -225,11 +225,11 @@ void *gd_request_mem(u32 size, u8 permanence) { * * @returns `GMemBlock` that contains info about the new heap memory */ -struct GMemBlock *gd_add_mem_to_heap(u32 size, void *addr, u8 permanence) { - struct GMemBlock *newBlock; +struct GMemBlock* gd_add_mem_to_heap(u32 size, void* addr, u8 permanence) { + struct GMemBlock* newBlock; /* eight-byte align the new block's data stats */ size = (size - 8) & ~7; - addr = (void *)(((uintptr_t) addr + 8) & ~7); + addr = (void*)(((uintptr_t)addr + 8) & ~7); newBlock = make_mem_block(G_MEM_BLOCK_FREE, permanence); newBlock->ptr = addr; @@ -257,7 +257,7 @@ void init_mem_block_lists(void) { * @param permanence Limit info printed to blocks with this permanence * @returns number of entries */ -u32 print_list_stats(struct GMemBlock *block, s32 printBlockInfo, s32 permanence) { +u32 print_list_stats(struct GMemBlock* block, s32 printBlockInfo, s32 permanence) { u32 entries = 0; u32 totalSize = 0; @@ -266,7 +266,7 @@ u32 print_list_stats(struct GMemBlock *block, s32 printBlockInfo, s32 permanence entries++; if (printBlockInfo) { gd_printf(" %6.2fk (%d bytes)\n", - (f32) block->size / 1024.0, //? 1024.0f + (f32)block->size / 1024.0, //? 1024.0f block->size); } totalSize += block->size; @@ -275,7 +275,7 @@ u32 print_list_stats(struct GMemBlock *block, s32 printBlockInfo, s32 permanence } gd_printf("Total %6.2fk (%d bytes) in %d entries\n", - (f32) totalSize / 1024.0, //? 1024.0f + (f32)totalSize / 1024.0, //? 1024.0f totalSize, entries); return entries; @@ -286,7 +286,7 @@ u32 print_list_stats(struct GMemBlock *block, s32 printBlockInfo, s32 permanence * `GMemBlock`s. */ void mem_stats(void) { - struct GMemBlock *list; + struct GMemBlock* list; gd_printf("Perm Used blocks:\n"); list = sUsedBlockListHead; diff --git a/src/goddard/joints.c b/src/goddard/joints.c index bd4191b1..85d9b159 100644 --- a/src/goddard/joints.c +++ b/src/goddard/joints.c @@ -21,40 +21,40 @@ // data static s32 D_801A82D0 = 0; -static struct ObjBone *gGdTempBone = NULL; // @ 801A82D4 +static struct ObjBone* gGdTempBone = NULL; // @ 801A82D4 // bss s32 sResetWeightVtxNum; // WTF? why is this not in skin_movement.c? -static Mat4f *D_801BA964; +static Mat4f* D_801BA964; static struct GdVec3f D_801BA968; static s32 sJointCount; // @ 801BA974 static s32 sJointNotF1Count; // @ 801BA978 static s32 sBoneCount; // @ 801BA97C static s32 sJointArrLen; // @ 801BA980 -static struct ObjJoint *sJointArr[10]; // @ 801BA988 +static struct ObjJoint* sJointArr[10]; // @ 801BA988 static struct GdVec3f sJointArrVecs[10]; // @ 801BA9B0 static s32 sJointArr2Len; // @ 801BAA28 -static struct ObjJoint *sJointArr2[10]; // @ 801BAA30 +static struct ObjJoint* sJointArr2[10]; // @ 801BAA30 static struct GdVec3f sJointArr2Vecs[10]; // @ 801BAA58 static struct GdVec3f D_801BAAD0; static struct GdVec3f D_801BAAE0; // forward declarations -void set_joint_vecs(struct ObjJoint *, f32, f32, f32); +void set_joint_vecs(struct ObjJoint*, f32, f32, f32); /** * Controls movement of grabbable joints */ -void grabbable_joint_update_func(struct ObjJoint *self) { +void grabbable_joint_update_func(struct ObjJoint* self) { UNUSED u8 filler1[80]; - Mat4f *attObjMtx; + Mat4f* attObjMtx; UNUSED u8 filler2[4]; - struct GdVec3f offset; // difference between current position and initial position + struct GdVec3f offset; // difference between current position and initial position UNUSED u8 filler3[16]; - register struct ListNode *att; + register struct ListNode* att; UNUSED u8 filler4[8]; - struct GdObj *attobj; + struct GdObj* attobj; // The joint acts somewhat like a spring in that the further it is moved // from its original position, the more resistance it has to moving further @@ -69,7 +69,7 @@ void grabbable_joint_update_func(struct ObjJoint *self) { self->velocity.z = offset.z * -0.25; self->flags |= 0x2000; - ; // needed to match + ; // needed to match } else { if (gGdCtrl.trgR == FALSE) { // R trigger is released // Set velocity so that the joint approaches its initial position @@ -130,13 +130,13 @@ void grabbable_joint_update_func(struct ObjJoint *self) { /** * Update function for Mario's eye joints, which makes them follow the cursor */ -void eye_joint_update_func(struct ObjJoint *self) { - Mat4f *sp5C; +void eye_joint_update_func(struct ObjJoint* self) { + Mat4f* sp5C; struct GdVec3f sp50; struct GdVec3f sp44; UNUSED u8 filler[24]; - register struct ListNode *att; - struct GdObj *attobj; + register struct ListNode* att; + struct GdObj* attobj; if (sCurrentMoveCamera == NULL) { return; @@ -148,7 +148,7 @@ void eye_joint_update_func(struct ObjJoint *self) { } } - set_cur_dynobj((struct GdObj *)self); + set_cur_dynobj((struct GdObj*)self); sp5C = d_get_rot_mtx_ptr(); sp44.x = (*sp5C)[3][0]; sp44.y = (*sp5C)[3][1]; @@ -178,9 +178,9 @@ void eye_joint_update_func(struct ObjJoint *self) { } /* 23D62C -> 23D748; not called */ -void func_8018EE5C(struct ObjJoint *j1, struct ObjJoint *j2, struct ObjJoint *j3) { +void func_8018EE5C(struct ObjJoint* j1, struct ObjJoint* j2, struct ObjJoint* j3) { struct GdVec3f vec; - struct ObjJoint *curj; + struct ObjJoint* curj; if (j3 == NULL) { return; @@ -201,7 +201,7 @@ void func_8018EE5C(struct ObjJoint *j1, struct ObjJoint *j2, struct ObjJoint *j3 } /* 23D748 -> 23D818; orig name: func_8018EF78 */ -void set_joint_vecs(struct ObjJoint *j, f32 x, f32 y, f32 z) { +void set_joint_vecs(struct ObjJoint* j, f32 x, f32 y, f32 z) { j->worldPos.x = x; j->worldPos.y = y; j->worldPos.z = z; @@ -224,12 +224,12 @@ void set_joint_vecs(struct ObjJoint *j, f32 x, f32 y, f32 z) { } /* 23D818 -> 23DA18 */ -struct ObjJoint *make_joint(s32 flags, f32 x, f32 y, f32 z) { - struct ObjJoint *j; // sp24 - struct ObjJoint *oldhead; +struct ObjJoint* make_joint(s32 flags, f32 x, f32 y, f32 z) { + struct ObjJoint* j; // sp24 + struct ObjJoint* oldhead; UNUSED u8 filler[4]; - j = (struct ObjJoint *) make_object(OBJ_TYPE_JOINTS); + j = (struct ObjJoint*)make_object(OBJ_TYPE_JOINTS); sJointCount++; oldhead = gGdJointList; gGdJointList = j; @@ -273,8 +273,8 @@ struct ObjJoint *make_joint(s32 flags, f32 x, f32 y, f32 z) { * drags the joints in its unk1F8 group along with it. The `shape` does not * actually get rendered due to the joint's OBJ_INVISIBLE flag being set. */ -struct ObjJoint *make_grabber_joint(struct ObjShape *shape, s32 flags, f32 x, f32 y, f32 z) { - struct ObjJoint *j; +struct ObjJoint* make_grabber_joint(struct ObjShape* shape, s32 flags, f32 x, f32 y, f32 z) { + struct ObjJoint* j; j = make_joint(0, x, y, z); j->shapePtr = shape; @@ -290,17 +290,17 @@ struct ObjJoint *make_grabber_joint(struct ObjShape *shape, s32 flags, f32 x, f3 } /* 23DAF8 -> 23DC9C */ -void func_8018F328(struct ObjBone *b) { - struct ObjJoint *joint1; - struct ObjJoint *joint2; - struct ObjGroup *grp; // sp1C - struct ListNode *link; // sp18 +void func_8018F328(struct ObjBone* b) { + struct ObjJoint* joint1; + struct ObjJoint* joint2; + struct ObjGroup* grp; // sp1C + struct ListNode* link; // sp18 grp = b->unk10C; link = grp->firstMember; - joint1 = (struct ObjJoint *) link->obj; + joint1 = (struct ObjJoint*)link->obj; link = link->next; - joint2 = (struct ObjJoint *) link->obj; + joint2 = (struct ObjJoint*)link->obj; // bone position is average of two connecting joints b->worldPos.x = (joint1->worldPos.x + joint2->worldPos.x) / 2.0; //?2.0f @@ -316,7 +316,7 @@ void func_8018F328(struct ObjBone *b) { } /* 23DC9C -> 23DCF0 */ -void func_8018F4CC(struct ObjJoint *j) { +void func_8018F4CC(struct ObjJoint* j) { if (j->flags & 0x1000) { j->unkB4.x = D_801BA968.x; j->unkB4.y = D_801BA968.y; @@ -325,9 +325,9 @@ void func_8018F4CC(struct ObjJoint *j) { } /* 23DCF0 -> 23E06C */ -void func_8018F520(struct ObjBone *b) { - struct ObjJoint *joint1; - struct ObjJoint *joint2; +void func_8018F520(struct ObjBone* b) { + struct ObjJoint* joint1; + struct ObjJoint* joint2; UNUSED u8 filler[12]; struct GdVec3f sp90; struct GdVec3f sp84; @@ -335,15 +335,15 @@ void func_8018F520(struct ObjBone *b) { struct GdVec3f sp6C; f32 sp68; f32 sp64; - struct ObjGroup *grp; // sp60 - struct ListNode *link; + struct ObjGroup* grp; // sp60 + struct ListNode* link; Mat4f mtx; // sp1C grp = b->unk10C; link = grp->firstMember; - joint1 = (struct ObjJoint *) link->obj; + joint1 = (struct ObjJoint*)link->obj; link = link->next; - joint2 = (struct ObjJoint *) link->obj; + joint2 = (struct ObjJoint*)link->obj; // bone position is average of two connecting joints b->worldPos.x = (joint1->worldPos.x + joint2->worldPos.x) / 2.0; //? 2.0f; @@ -387,23 +387,23 @@ void func_8018F520(struct ObjBone *b) { D_801BA968.z = b->mat70[2][2]; D_801BA964 = &b->mat70; - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_8018F4CC, b->unk10C); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_8018F4CC, b->unk10C); } /* 23E06C -> 23E238 */ -void func_8018F89C(struct ObjBone *b) { - struct ObjJoint *spAC; - struct ObjJoint *spA8; +void func_8018F89C(struct ObjBone* b) { + struct ObjJoint* spAC; + struct ObjJoint* spA8; UNUSED u8 filler[68]; - struct ObjGroup *grp; // sp60 - struct ListNode *link; // sp5c - Mat4f mtx; // sp1c + struct ObjGroup* grp; // sp60 + struct ListNode* link; // sp5c + Mat4f mtx; // sp1c grp = b->unk10C; link = grp->firstMember; - spAC = (struct ObjJoint *) link->obj; + spAC = (struct ObjJoint*)link->obj; link = link->next; - spA8 = (struct ObjJoint *) link->obj; + spA8 = (struct ObjJoint*)link->obj; b->worldPos.x = (spAC->worldPos.x + spA8->worldPos.x) / 2.0; //? 2.0f; b->worldPos.y = (spAC->worldPos.y + spA8->worldPos.y) / 2.0; //? 2.0f; @@ -417,11 +417,11 @@ void func_8018F89C(struct ObjBone *b) { D_801BA968.z = -b->mat70[2][2]; D_801BA964 = &b->mat70; - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_8018F4CC, b->unk10C); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_8018F4CC, b->unk10C); } /* 23E238 -> 23E298 */ -void func_8018FA68(struct ObjBone *b) { +void func_8018FA68(struct ObjBone* b) { if (b->unk104 & (0x8 | 0x2)) { func_8018F89C(b); } else { @@ -430,8 +430,8 @@ void func_8018FA68(struct ObjBone *b) { } /* 23E298 -> 23E328; orig name: func_8018FAC8 */ -s32 set_skin_weight(struct ObjJoint *j, s32 id, struct ObjVertex *vtx /* always NULL */, f32 weight) { - struct ObjWeight *w; +s32 set_skin_weight(struct ObjJoint* j, s32 id, struct ObjVertex* vtx /* always NULL */, f32 weight) { + struct ObjWeight* w; if (j->weightGrp == NULL) { j->weightGrp = make_group(0); @@ -443,18 +443,18 @@ s32 set_skin_weight(struct ObjJoint *j, s32 id, struct ObjVertex *vtx /* always } /* 23E328 -> 23E474 */ -void func_8018FB58(struct ObjBone *b) { +void func_8018FB58(struct ObjBone* b) { struct GdVec3f vec; // sp2c - struct ObjJoint *j1; // sp28 - struct ObjJoint *j2; - struct ListNode *link; - struct ObjGroup *grp; + struct ObjJoint* j1; // sp28 + struct ObjJoint* j2; + struct ListNode* link; + struct ObjGroup* grp; grp = b->unk10C; link = grp->firstMember; - j1 = (struct ObjJoint *) link->obj; + j1 = (struct ObjJoint*)link->obj; link = link->next; - j2 = (struct ObjJoint *) link->obj; + j2 = (struct ObjJoint*)link->obj; vec.x = j1->worldPos.x - j2->worldPos.x; vec.y = j1->worldPos.y - j2->worldPos.y; @@ -467,7 +467,7 @@ void func_8018FB58(struct ObjBone *b) { } /* 23E474 -> 23E56C */ -void add_joint2bone(struct ObjBone *b, struct ObjJoint *j) { +void add_joint2bone(struct ObjBone* b, struct ObjJoint* j) { if (j->header.type != OBJ_TYPE_JOINTS) { fatal_printf("add_joint2bone(): Can only add Joints to Bones"); } @@ -488,12 +488,12 @@ void add_joint2bone(struct ObjBone *b, struct ObjJoint *j) { } /* 23E56C -> 23E6E4 */ -struct ObjBone *make_bone(s32 a0, struct ObjJoint *j1, struct ObjJoint *j2, UNUSED s32 a3) { - struct ObjBone *b; // sp34 - struct ObjBone *oldhead; +struct ObjBone* make_bone(s32 a0, struct ObjJoint* j1, struct ObjJoint* j2, UNUSED s32 a3) { + struct ObjBone* b; // sp34 + struct ObjBone* oldhead; UNUSED u8 filler[20]; - b = (struct ObjBone *) make_object(OBJ_TYPE_BONES); + b = (struct ObjBone*)make_object(OBJ_TYPE_BONES); sBoneCount++; b->id = sBoneCount; oldhead = gGdBoneList; @@ -526,7 +526,7 @@ void stub_joints_1(UNUSED u32 a0) { } /* 23E6F8 -> 23E758; not called */ -void func_8018FF28(struct ObjJoint *a0, struct ObjJoint *a1) { +void func_8018FF28(struct ObjJoint* a0, struct ObjJoint* a1) { if (a1->flags & 0x1) { a0->unk84.x -= a1->unk84.x; a0->unk84.y -= a1->unk84.y; @@ -547,14 +547,14 @@ void print_some_spaces(s32 size) { } /* 23E7B8 -> 23E938 */ -s32 func_8018FFE8(struct ObjBone **a0, struct ObjJoint **a1, struct ObjJoint *a2, struct ObjJoint *a3) { - struct ObjBone *b; // 1C - struct ObjJoint *sp18; +s32 func_8018FFE8(struct ObjBone** a0, struct ObjJoint** a1, struct ObjJoint* a2, struct ObjJoint* a3) { + struct ObjBone* b; // 1C + struct ObjJoint* sp18; s32 sp14 = 0; - struct ObjGroup *bonegrp; // 10 - struct ObjGroup *grp; // 0c - struct ListNode *bonelink; // 08 - struct ListNode *link; // 04 + struct ObjGroup* bonegrp; // 10 + struct ObjGroup* grp; // 0c + struct ListNode* bonelink; // 08 + struct ListNode* link; // 04 grp = a3->unk1C4; @@ -567,12 +567,12 @@ s32 func_8018FFE8(struct ObjBone **a0, struct ObjJoint **a1, struct ObjJoint *a2 } while (link != NULL) { - if ((b = (struct ObjBone *) link->obj) != NULL) { + if ((b = (struct ObjBone*)link->obj) != NULL) { bonegrp = b->unk10C; bonelink = bonegrp->firstMember; while (bonelink != NULL) { - sp18 = (struct ObjJoint *) bonelink->obj; + sp18 = (struct ObjJoint*)bonelink->obj; if (sp18 != a3 && sp18 != a2) { a1[sp14] = sp18; @@ -590,8 +590,7 @@ s32 func_8018FFE8(struct ObjBone **a0, struct ObjJoint **a1, struct ObjJoint *a2 } /* 23E938 -> 23EBB8 */ -void func_80190168(struct ObjBone *b, UNUSED struct ObjJoint *a1, UNUSED struct ObjJoint *a2, - struct GdVec3f *a3) { +void func_80190168(struct ObjBone* b, UNUSED struct ObjJoint* a1, UNUSED struct ObjJoint* a2, struct GdVec3f* a3) { struct GdVec3f sp7C; UNUSED u8 filler1[24]; f32 sp60; @@ -641,7 +640,7 @@ void func_80190168(struct ObjBone *b, UNUSED struct ObjJoint *a1, UNUSED struct } /* 23EBB8 -> 23ED44 */ -void func_801903E8(struct ObjJoint *j, struct GdVec3f *a1, f32 x, f32 y, f32 z) { +void func_801903E8(struct ObjJoint* j, struct GdVec3f* a1, f32 x, f32 y, f32 z) { f32 sp14; struct GdVec3f sp8; @@ -669,10 +668,10 @@ void func_801903E8(struct ObjJoint *j, struct GdVec3f *a1, f32 x, f32 y, f32 z) } /* 23EBB8 -> 23F184 */ -void func_80190574(s32 a0, struct ObjJoint *a1, struct ObjJoint *a2, f32 x, f32 y, f32 z) { // sp278 - struct ObjJoint *sp274; // = a2? - struct ObjJoint *sp270; // mid-point of stack array? - struct ObjJoint *sp26C; // jointstackarr[i]? curjoint? +void func_80190574(s32 a0, struct ObjJoint* a1, struct ObjJoint* a2, f32 x, f32 y, f32 z) { // sp278 + struct ObjJoint* sp274; // = a2? + struct ObjJoint* sp270; // mid-point of stack array? + struct ObjJoint* sp26C; // jointstackarr[i]? curjoint? UNUSED u8 filler1[4]; UNUSED u32 unused = 0; UNUSED u8 filler2[12]; // unused vec? @@ -685,8 +684,8 @@ void func_80190574(s32 a0, struct ObjJoint *a1, struct ObjJoint *a2, f32 x, f32 UNUSED u8 filler4[4]; s32 sp224; s32 sp220; - struct ObjJoint *sp120[0x40]; - struct ObjBone *sp20[0x40]; + struct ObjJoint* sp120[0x40]; + struct ObjBone* sp20[0x40]; for (sp230 = 1; sp230 < a0; sp230 *= 2) { sp22C = sp22C * 2 + 1; @@ -771,7 +770,7 @@ void func_80190574(s32 a0, struct ObjJoint *a1, struct ObjJoint *a2, f32 x, f32 /* 23F184 -> 23F1F0 */ void func_801909B4(void) { - struct ObjJoint *node; + struct ObjJoint* node; D_801A82D0 = 0; node = gGdJointList; @@ -783,19 +782,19 @@ void func_801909B4(void) { /* 23F1F0 -> 23F324; not called */ void func_80190A20(void) { - struct ObjJoint *j; // sp3c + struct ObjJoint* j; // sp3c UNUSED u8 filler[4]; struct GdVec3f vec; // sp2C - struct ObjGroup *grp; - struct ListNode *link; - struct ObjBone *b; + struct ObjGroup* grp; + struct ListNode* link; + struct ObjBone* b; j = gGdJointList; while (j != NULL) { if (j->flags & 0x40) { grp = j->unk1C4; link = grp->firstMember; - b = (struct ObjBone *) link->obj; + b = (struct ObjBone*)link->obj; vec.z = b->unk40.x * 100.0f; vec.y = b->unk40.y * 100.0f; @@ -808,7 +807,7 @@ void func_80190A20(void) { } /* 23F324 -> 23F638 */ -void func_80190B54(struct ObjJoint *a0, struct ObjJoint *a1, struct GdVec3f *a2) { // b0 +void func_80190B54(struct ObjJoint* a0, struct ObjJoint* a1, struct GdVec3f* a2) { // b0 struct GdVec3f spA4; UNUSED u8 filler1[12]; struct GdVec3f sp8C; @@ -869,9 +868,9 @@ void func_80190B54(struct ObjJoint *a0, struct ObjJoint *a1, struct GdVec3f *a2) } /* 23F638 -> 23F70C; not called */ -void func_80190E68(struct GdObj *obj, f32 x, f32 y, f32 z) { - struct ObjJoint *sp44; - struct GdObj *sp40; +void func_80190E68(struct GdObj* obj, f32 x, f32 y, f32 z) { + struct ObjJoint* sp44; + struct GdObj* sp40; struct GdVec3f vec; UNUSED u8 filler[24]; @@ -886,15 +885,15 @@ void func_80190E68(struct GdObj *obj, f32 x, f32 y, f32 z) { break; } - func_80190B54(((struct ObjJoint *) sp40), sp44, &vec); - sp44 = ((struct ObjJoint *) sp40); - sp40 = ((struct ObjJoint *) sp40)->attachedToObj; + func_80190B54(((struct ObjJoint*)sp40), sp44, &vec); + sp44 = ((struct ObjJoint*)sp40); + sp40 = ((struct ObjJoint*)sp40)->attachedToObj; } } /* 23F70C -> 23F978 */ -f32 func_80190F3C(struct ObjJoint *a0, f32 a1, f32 a2, f32 a3) { - struct ObjJoint *curj; +f32 func_80190F3C(struct ObjJoint* a0, f32 a1, f32 a2, f32 a3) { + struct ObjJoint* curj; s32 i; struct GdVec3f sp24; @@ -932,7 +931,7 @@ f32 func_80190F3C(struct ObjJoint *a0, f32 a1, f32 a2, f32 a3) { } /* 23F978 -> 23F9F0 */ -void func_801911A8(struct ObjJoint *j) { +void func_801911A8(struct ObjJoint* j) { j->unkCC.x = j->shapeOffset.x; j->unkCC.y = j->shapeOffset.y; j->unkCC.z = j->shapeOffset.z; @@ -941,7 +940,7 @@ void func_801911A8(struct ObjJoint *j) { } /* 23F9F0 -> 23FB90 */ -void func_80191220(struct ObjJoint *j) { +void func_80191220(struct ObjJoint* j) { j->unk48.x = j->initPos.x; // storing "attached offset"? j->unk48.y = j->initPos.y; j->unk48.z = j->initPos.z; @@ -962,13 +961,13 @@ void func_80191220(struct ObjJoint *j) { } /* 23FB90 -> 23FBC0 */ -void func_801913C0(struct ObjJoint *j) { +void func_801913C0(struct ObjJoint* j) { UNUSED u8 filler[16]; func_80181894(j); } /* 23FBC0 -> 23FCC8 */ -void func_801913F0(struct ObjJoint *j) { +void func_801913F0(struct ObjJoint* j) { // hmm... j->velocity.x = j->worldPos.x; j->velocity.y = j->worldPos.y; @@ -986,11 +985,11 @@ void func_801913F0(struct ObjJoint *j) { } /* 23FCC8 -> 23FCDC */ -void stub_joints_2(UNUSED struct ObjJoint *j) { +void stub_joints_2(UNUSED struct ObjJoint* j) { } /* 23FCDC -> 23FDD4; not called */ -void func_8019150C(Mat4f *a0, struct GdVec3f *a1) { +void func_8019150C(Mat4f* a0, struct GdVec3f* a1) { struct GdVec3f sp1C; sp1C.x = (*a0)[3][0] / 10.0; //? 10.0f @@ -1004,7 +1003,7 @@ void func_8019150C(Mat4f *a0, struct GdVec3f *a1) { } /* 23FDD4 -> 23FFF4 */ -void reset_joint(struct ObjJoint *j) { +void reset_joint(struct ObjJoint* j) { j->worldPos.x = j->initPos.x; j->worldPos.y = j->initPos.y; j->worldPos.z = j->initPos.z; @@ -1023,8 +1022,8 @@ void reset_joint(struct ObjJoint *j) { j->unk1A8.x = j->unk1A8.y = j->unk1A8.z = 0.0f; gd_set_identity_mat4(&j->mat168); - gd_scale_mat4f_by_vec3f(&j->mat168, (struct GdVec3f *) &j->scale); - gd_rot_mat_about_vec(&j->mat168, (struct GdVec3f *) &j->unk6C); + gd_scale_mat4f_by_vec3f(&j->mat168, (struct GdVec3f*)&j->scale); + gd_rot_mat_about_vec(&j->mat168, (struct GdVec3f*)&j->unk6C); gd_add_vec3f_to_mat4f_offset(&j->mat168, &j->attachOffset); gd_copy_mat4f(&j->mat168, &j->matE8); @@ -1033,8 +1032,8 @@ void reset_joint(struct ObjJoint *j) { } /* 23FFF4 -> 2400C4 */ -void func_80191824(struct ObjJoint *j) { - UNUSED struct ObjNet *sp14; +void func_80191824(struct ObjJoint* j) { + UNUSED struct ObjNet* sp14; UNUSED u8 filler[16]; sp14 = gGdSkinNet->unk1F0; @@ -1050,7 +1049,7 @@ void func_80191824(struct ObjJoint *j) { } /* 2400C4 -> 2401EC; not called */ -void func_801918F4(struct ObjJoint *j) { +void func_801918F4(struct ObjJoint* j) { f32 sp4; j->velocity.x = j->unk3C.x; @@ -1077,11 +1076,11 @@ void func_801918F4(struct ObjJoint *j) { } /* 2401EC -> 2403C8; not called */ -void func_80191A1C(struct ObjBone *a0) { +void func_80191A1C(struct ObjBone* a0) { f32 sp3C; f32 sp38 = 0.0f; - struct GdObj *argjoint; - struct GdObj *tempjoint; + struct GdObj* argjoint; + struct GdObj* tempjoint; struct GdVec3f sp24; struct GdVec3f sp18; @@ -1105,15 +1104,15 @@ void func_80191A1C(struct ObjBone *a0) { gd_normalize_vec3f(&sp24); sp3C = -sp3C * 50.0; //? 50.0f - if (!(((struct ObjJoint *) argjoint)->flags & 0x1)) { - func_80190F3C((struct ObjJoint *) argjoint, sp24.x * sp3C, sp24.y * sp3C, sp24.z * sp3C); + if (!(((struct ObjJoint*)argjoint)->flags & 0x1)) { + func_80190F3C((struct ObjJoint*)argjoint, sp24.x * sp3C, sp24.y * sp3C, sp24.z * sp3C); } } gGdTempBone = a0; } /* 2403C8 -> 240530 */ -void func_80191BF8(struct ObjJoint *j) { +void func_80191BF8(struct ObjJoint* j) { f32 sp1C; f32 sp18 = -2.0f; @@ -1131,7 +1130,7 @@ void func_80191BF8(struct ObjJoint *j) { } /* 240530 -> 240624 */ -void func_80191D60(struct ObjJoint *j) { +void func_80191D60(struct ObjJoint* j) { j->velocity.x += j->unk3C.x - j->worldPos.x; j->velocity.y += j->unk3C.y - j->worldPos.y; j->velocity.z += j->unk3C.z - j->worldPos.z; @@ -1146,17 +1145,17 @@ void func_80191D60(struct ObjJoint *j) { } /* 240624 -> 240658 */ -void func_80191E54(struct ObjJoint *j) { +void func_80191E54(struct ObjJoint* j) { j->unk3C.x = j->worldPos.x; j->unk3C.y = j->worldPos.y; j->unk3C.z = j->worldPos.z; } /* 240658 -> 2406B8 */ -void func_80191E88(struct ObjGroup *grp) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191BF8, grp); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191D60, grp); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191E54, grp); +void func_80191E88(struct ObjGroup* grp) { + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_80191BF8, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_80191D60, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_80191E54, grp); } /* 2406B8 -> 2406E0; orig name: func_80191EE8 */ diff --git a/src/goddard/objects.c b/src/goddard/objects.c index 52e191d2..d89729ea 100644 --- a/src/goddard/objects.c +++ b/src/goddard/objects.c @@ -37,33 +37,33 @@ f32 D_801A81C4 = 0.0f; // bss struct GdBoundingBox gSomeBoundingBox; -struct ObjCamera *sCurrentMoveCamera; // @ 801B9DB8 -struct ObjView *sCurrentMoveView; // @ 801B9DBC +struct ObjCamera* sCurrentMoveCamera; // @ 801B9DB8 +struct ObjView* sCurrentMoveView; // @ 801B9DBC struct DebugCounters gGdCounter; // @ 801B9DC0 Mat4f D_801B9DC8; struct GdVec3f D_801B9E08; -struct ObjGroup *sCurrentMoveGrp; // @ 801B9E14 +struct ObjGroup* sCurrentMoveGrp; // @ 801B9E14 struct GdVec3f D_801B9E18; struct GdVec3f D_801B9E28; f32 D_801B9E34; -Mat4f *D_801B9E38; -struct ObjParticle *D_801B9E3C; +Mat4f* D_801B9E38; +struct ObjParticle* D_801B9E3C; s32 D_801B9E40; s32 D_801B9E44; -Mat4f *D_801B9E48; -struct ObjCamera *gGdCameraList; // @ 801B9E4C -void *D_801B9E50; -struct ObjGroup *gGdGroupList; // @ 801B9E54 +Mat4f* D_801B9E48; +struct ObjCamera* gGdCameraList; // @ 801B9E4C +void* D_801B9E50; +struct ObjGroup* gGdGroupList; // @ 801B9E54 s32 gGdObjCount; // @ 801B9E58 s32 gGdGroupCount; // @ 801B9E5C s32 gGdPlaneCount; // @ 801B9E60 s32 gGdCameraCount; // @ 801B9E64 struct Unk801B9E68 sGdViewInfo; // @ 801B9E68 -void *D_801B9E80; -struct ObjJoint *gGdJointList; // @ 801B9E84 -struct ObjBone *gGdBoneList; // @ 801B9E88 -struct GdObj *gGdObjectList; // head of linked list containing every single GdObj that was created -struct ObjGroup *gGdViewsGroup; // @ 801B9E90 +void* D_801B9E80; +struct ObjJoint* gGdJointList; // @ 801B9E84 +struct ObjBone* gGdBoneList; // @ 801B9E88 +struct GdObj* gGdObjectList; // head of linked list containing every single GdObj that was created +struct ObjGroup* gGdViewsGroup; // @ 801B9E90 /* @ 22A480 for 0x70 */ void reset_bounding_box(void) { /* Initialize Plane? */ @@ -76,7 +76,7 @@ void reset_bounding_box(void) { /* Initialize Plane? */ gSomeBoundingBox.maxZ = -10000000.0f; } -void add_obj_pos_to_bounding_box(struct GdObj *obj) { +void add_obj_pos_to_bounding_box(struct GdObj* obj) { struct GdVec3f pos; set_cur_dynobj(obj); @@ -108,7 +108,7 @@ void add_obj_pos_to_bounding_box(struct GdObj *obj) { } /* @ 22A630 for 0x70 */ -void get_some_bounding_box(struct GdBoundingBox *a0) { +void get_some_bounding_box(struct GdBoundingBox* a0) { a0->minX = gSomeBoundingBox.minX; a0->minY = gSomeBoundingBox.minY; a0->minZ = gSomeBoundingBox.minZ; @@ -119,7 +119,7 @@ void get_some_bounding_box(struct GdBoundingBox *a0) { } /* @ 22A6A0 for 0x24 */ -void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1) { +void stub_objects_1(UNUSED struct ObjGroup* a0, UNUSED struct GdObj* a1) { UNUSED u8 sp00[8]; /* Debug stub? */ return; @@ -128,8 +128,8 @@ void stub_objects_1(UNUSED struct ObjGroup *a0, UNUSED struct GdObj *a1) { /** * Returns a string containing the name of the the object type */ -static const char *get_obj_name_str(enum ObjTypeFlag objFlag) { - const char *objName; +static const char* get_obj_name_str(enum ObjTypeFlag objFlag) { + const char* objName; switch (objFlag) { case OBJ_TYPE_JOINTS: objName = "joints"; @@ -198,14 +198,14 @@ static const char *get_obj_name_str(enum ObjTypeFlag objFlag) { /** * Creates an object of the specified type */ -struct GdObj *make_object(enum ObjTypeFlag objType) { - struct GdObj *newObj; - struct GdObj *objListOldHead; +struct GdObj* make_object(enum ObjTypeFlag objType) { + struct GdObj* newObj; + struct GdObj* objListOldHead; s32 objSize; s32 i; drawmethod_t objDrawFn; - const char *typeName; - u8 *newObjBytes; + const char* typeName; + u8* newObjBytes; s32 objPermanence = 0x10; imin("make_object"); @@ -213,85 +213,85 @@ struct GdObj *make_object(enum ObjTypeFlag objType) { switch (objType) { case OBJ_TYPE_JOINTS: objSize = sizeof(struct ObjJoint); - objDrawFn = (drawmethod_t) draw_joint; + objDrawFn = (drawmethod_t)draw_joint; break; case OBJ_TYPE_BONES: objSize = sizeof(struct ObjBone); - objDrawFn = (drawmethod_t) draw_bone; + objDrawFn = (drawmethod_t)draw_bone; break; case OBJ_TYPE_GROUPS: objSize = sizeof(struct ObjGroup); - objDrawFn = (drawmethod_t) draw_group; + objDrawFn = (drawmethod_t)draw_group; break; case OBJ_TYPE_PARTICLES: objSize = sizeof(struct ObjParticle); - objDrawFn = (drawmethod_t) draw_particle; + objDrawFn = (drawmethod_t)draw_particle; break; case OBJ_TYPE_SHAPES: objSize = sizeof(struct ObjShape); // Shapes get drawn by their parent object instead of automatically. - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_UNK200000: objSize = sizeof(struct ObjUnk200000); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_NETS: objSize = sizeof(struct ObjNet); - objDrawFn = (drawmethod_t) draw_net; + objDrawFn = (drawmethod_t)draw_net; break; case OBJ_TYPE_PLANES: objSize = sizeof(struct ObjPlane); - objDrawFn = (drawmethod_t) draw_plane; + objDrawFn = (drawmethod_t)draw_plane; break; case OBJ_TYPE_VERTICES: objSize = sizeof(struct ObjVertex); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_CAMERAS: objSize = sizeof(struct ObjCamera); - objDrawFn = (drawmethod_t) draw_camera; + objDrawFn = (drawmethod_t)draw_camera; break; case OBJ_TYPE_FACES: objSize = sizeof(struct ObjFace); - objDrawFn = (drawmethod_t) draw_face; + objDrawFn = (drawmethod_t)draw_face; objPermanence = 1; break; case OBJ_TYPE_MATERIALS: objSize = sizeof(struct ObjMaterial); - objDrawFn = (drawmethod_t) draw_material; + objDrawFn = (drawmethod_t)draw_material; break; case OBJ_TYPE_LIGHTS: objSize = sizeof(struct ObjLight); - objDrawFn = (drawmethod_t) draw_light; + objDrawFn = (drawmethod_t)draw_light; break; case OBJ_TYPE_WEIGHTS: objSize = sizeof(struct ObjWeight); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_GADGETS: objSize = sizeof(struct ObjGadget); - objDrawFn = (drawmethod_t) draw_gadget; + objDrawFn = (drawmethod_t)draw_gadget; break; case OBJ_TYPE_VIEWS: objSize = sizeof(struct ObjView); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_LABELS: objSize = sizeof(struct ObjLabel); - objDrawFn = (drawmethod_t) draw_label; + objDrawFn = (drawmethod_t)draw_label; break; case OBJ_TYPE_ANIMATORS: objSize = sizeof(struct ObjAnimator); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_VALPTRS: objSize = sizeof(struct ObjValPtr); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; case OBJ_TYPE_ZONES: objSize = sizeof(struct ObjZone); - objDrawFn = (drawmethod_t) draw_nothing; + objDrawFn = (drawmethod_t)draw_nothing; break; default: fatal_print("make_object() : Unkown object!"); @@ -308,7 +308,7 @@ struct GdObj *make_object(enum ObjTypeFlag objType) { stop_memtracker(typeName); // Zero out the object - newObjBytes = (u8 *) newObj; + newObjBytes = (u8*)newObj; for (i = 0; i < objSize; i++) { newObjBytes[i] = 0; } @@ -334,8 +334,8 @@ struct GdObj *make_object(enum ObjTypeFlag objType) { } /* @ 22AEA0 for 0xD0; orig name: func_8017C6D0 */ -struct ObjZone *make_zone(struct ObjGroup *a0, struct GdBoundingBox *bbox, struct ObjGroup *a2) { - struct ObjZone *newZone = (struct ObjZone *) make_object(OBJ_TYPE_ZONES); +struct ObjZone* make_zone(struct ObjGroup* a0, struct GdBoundingBox* bbox, struct ObjGroup* a2) { + struct ObjZone* newZone = (struct ObjZone*)make_object(OBJ_TYPE_ZONES); newZone->boundingBox.minX = bbox->minX; newZone->boundingBox.minY = bbox->minY; @@ -351,8 +351,8 @@ struct ObjZone *make_zone(struct ObjGroup *a0, struct GdBoundingBox *bbox, struc } /* @ 22AF70 for 0x60 */ -struct ObjUnk200000 *func_8017C7A0(struct ObjVertex *a0, struct ObjFace *a1) { - struct ObjUnk200000 *unk = (struct ObjUnk200000 *) make_object(OBJ_TYPE_UNK200000); +struct ObjUnk200000* func_8017C7A0(struct ObjVertex* a0, struct ObjFace* a1) { + struct ObjUnk200000* unk = (struct ObjUnk200000*)make_object(OBJ_TYPE_UNK200000); unk->unk30 = a0; unk->unk34 = a1; @@ -363,8 +363,8 @@ struct ObjUnk200000 *func_8017C7A0(struct ObjVertex *a0, struct ObjFace *a1) { /** * Creates a ListNode for the object. Adds the new node after `prevNode` if `prevNode` is not NULL. */ -struct ListNode *make_link_to_obj(struct ListNode *prevNode, struct GdObj *obj) { - struct ListNode *newNode; +struct ListNode* make_link_to_obj(struct ListNode* prevNode, struct GdObj* obj) { + struct ListNode* newNode; // Allocate link node start_memtracker("links"); @@ -389,8 +389,8 @@ struct ListNode *make_link_to_obj(struct ListNode *prevNode, struct GdObj *obj) /* * Creates a VtxLink for the vertex. Adds the new node after `prevNode` if `prevNode` is not NULL. */ -struct VtxLink *make_vtx_link(struct VtxLink *prevNode, Vtx *data) { - struct VtxLink *newNode; +struct VtxLink* make_vtx_link(struct VtxLink* prevNode, Vtx* data) { + struct VtxLink* newNode; newNode = gd_malloc_perm(sizeof(struct VtxLink)); if (newNode == NULL) { @@ -415,8 +415,8 @@ struct VtxLink *make_vtx_link(struct VtxLink *prevNode, Vtx *data) { } /* @ 22B154 for 0x88; orig name: func8017C984 */ -struct ObjValPtr *make_valptr(struct GdObj *obj, s32 flag, enum ValPtrType type, size_t offset) { - struct ObjValPtr *sp1C = (struct ObjValPtr *) make_object(OBJ_TYPE_VALPTRS); +struct ObjValPtr* make_valptr(struct GdObj* obj, s32 flag, enum ValPtrType type, size_t offset) { + struct ObjValPtr* sp1C = (struct ObjValPtr*)make_object(OBJ_TYPE_VALPTRS); sp1C->obj = obj; sp1C->flag = flag; @@ -427,8 +427,8 @@ struct ObjValPtr *make_valptr(struct GdObj *obj, s32 flag, enum ValPtrType type, } /* @ 22B1DC for 0x430 */ -void reset_plane(struct ObjPlane *plane) { - struct ObjFace *sp4C; +void reset_plane(struct ObjPlane* plane) { + struct ObjFace* sp4C; f32 sp48; f32 sp44; UNUSED u8 filler[12]; @@ -507,9 +507,9 @@ void reset_plane(struct ObjPlane *plane) { } /* @ 22B60C for 0x94; orig name: func_8017CE3C */ -struct ObjPlane *make_plane(s32 inZone, struct ObjFace *a1) { +struct ObjPlane* make_plane(s32 inZone, struct ObjFace* a1) { UNUSED u8 filler[4]; - struct ObjPlane *newPlane = (struct ObjPlane *) make_object(OBJ_TYPE_PLANES); + struct ObjPlane* newPlane = (struct ObjPlane*)make_object(OBJ_TYPE_PLANES); gGdPlaneCount++; newPlane->id = gGdPlaneCount; @@ -521,11 +521,11 @@ struct ObjPlane *make_plane(s32 inZone, struct ObjFace *a1) { } /* @ 22B6A0 for 0x21C; orig name: func_8017CED0 */ -struct ObjCamera *make_camera(s32 flags, struct GdObj *a1) { - struct ObjCamera *newCam; - struct ObjCamera *oldCameraHead; +struct ObjCamera* make_camera(s32 flags, struct GdObj* a1) { + struct ObjCamera* newCam; + struct ObjCamera* oldCameraHead; - newCam = (struct ObjCamera *) make_object(OBJ_TYPE_CAMERAS); + newCam = (struct ObjCamera*)make_object(OBJ_TYPE_CAMERAS); gGdCameraCount++; newCam->id = gGdCameraCount; @@ -566,10 +566,10 @@ struct ObjCamera *make_camera(s32 flags, struct GdObj *a1) { } /* @ 22B8BC for 0xA8; orig. name: func_8017D0EC */ -struct ObjMaterial *make_material(UNUSED s32 a0, char *name, s32 id) { - struct ObjMaterial *newMtl; +struct ObjMaterial* make_material(UNUSED s32 a0, char* name, s32 id) { + struct ObjMaterial* newMtl; - newMtl = (struct ObjMaterial *) make_object(OBJ_TYPE_MATERIALS); + newMtl = (struct ObjMaterial*)make_object(OBJ_TYPE_MATERIALS); if (name != NULL) { gd_strcpy(newMtl->name, name); @@ -585,10 +585,10 @@ struct ObjMaterial *make_material(UNUSED s32 a0, char *name, s32 id) { } /* @ 22B964 for 0x114; orig name: func_8017D194 */ -struct ObjLight *make_light(s32 flags, char *name, s32 id) { - struct ObjLight *newLight; +struct ObjLight* make_light(s32 flags, char* name, s32 id) { + struct ObjLight* newLight; - newLight = (struct ObjLight *) make_object(OBJ_TYPE_LIGHTS); + newLight = (struct ObjLight*)make_object(OBJ_TYPE_LIGHTS); if (name != NULL) { gd_strcpy(newLight->name, name); @@ -609,9 +609,9 @@ struct ObjLight *make_light(s32 flags, char *name, s32 id) { } /* @ 22BA78 for 0x294; orig name: func_8017D2A8*/ -struct ObjView *make_view(const char *name, s32 flags, s32 projectionType, s32 ulx, s32 uly, s32 lrx, s32 lry, - struct ObjGroup *parts) { - struct ObjView *newView = (struct ObjView *) make_object(OBJ_TYPE_VIEWS); +struct ObjView* make_view(const char* name, s32 flags, s32 projectionType, s32 ulx, s32 uly, s32 lrx, s32 lry, + struct ObjGroup* parts) { + struct ObjView* newView = (struct ObjView*)make_object(OBJ_TYPE_VIEWS); if (gGdViewsGroup == NULL) { gGdViewsGroup = make_group(0); @@ -633,11 +633,11 @@ struct ObjView *make_view(const char *name, s32 flags, s32 projectionType, s32 u newView->clipping.y = 5000.0f; newView->clipping.z = 45.0f; - newView->upperLeft.x = (f32) ulx; - newView->upperLeft.y = (f32) uly; + newView->upperLeft.x = (f32)ulx; + newView->upperLeft.y = (f32)uly; - newView->lowerRight.x = (f32) lrx; - newView->lowerRight.y = (f32) lry; + newView->lowerRight.x = (f32)lrx; + newView->lowerRight.y = (f32)lry; newView->unk48 = 1.0f; newView->unk4C = 1.0f; @@ -660,8 +660,8 @@ struct ObjView *make_view(const char *name, s32 flags, s32 projectionType, s32 u } /* @ 22BD0C for 0x78; orig name: func_8017D53C */ -struct ObjAnimator *make_animator(void) { - struct ObjAnimator *newAnim = (struct ObjAnimator *) make_object(OBJ_TYPE_ANIMATORS); +struct ObjAnimator* make_animator(void) { + struct ObjAnimator* newAnim = (struct ObjAnimator*)make_object(OBJ_TYPE_ANIMATORS); newAnim->unk24 = 1.0f; newAnim->frame = 1.0f; @@ -672,12 +672,12 @@ struct ObjAnimator *make_animator(void) { } /* @ 22BD84 for 0x78; orig name: func_8017D5B4 */ -struct ObjWeight *make_weight(UNUSED s32 a0, s32 vtxId, struct ObjVertex *vtx /* always NULL */, f32 weight) { - struct ObjWeight *newWeight = (struct ObjWeight *) make_object(OBJ_TYPE_WEIGHTS); +struct ObjWeight* make_weight(UNUSED s32 a0, s32 vtxId, struct ObjVertex* vtx /* always NULL */, f32 weight) { + struct ObjWeight* newWeight = (struct ObjWeight*)make_object(OBJ_TYPE_WEIGHTS); newWeight->vtxId = vtxId; newWeight->weightVal = weight; - newWeight->vtx = vtx; // is always NULL here. This vtx field actually gets set in reset_weight_vtx. + newWeight->vtx = vtx; // is always NULL here. This vtx field actually gets set in reset_weight_vtx. return newWeight; } @@ -686,9 +686,9 @@ struct ObjWeight *make_weight(UNUSED s32 a0, s32 vtxId, struct ObjVertex *vtx /* * Makes a group, adding all objects from `fromObj` to `toObj` with type `type` * as members. */ -struct ObjGroup *make_group_of_type(enum ObjTypeFlag type, struct GdObj *fromObj, struct GdObj *toObj) { - struct ObjGroup *newGroup; - struct GdObj *curObj; +struct ObjGroup* make_group_of_type(enum ObjTypeFlag type, struct GdObj* fromObj, struct GdObj* toObj) { + struct ObjGroup* newGroup; + struct GdObj* curObj; newGroup = make_group(0); curObj = fromObj; @@ -711,33 +711,33 @@ struct ObjGroup *make_group_of_type(enum ObjTypeFlag type, struct GdObj *fromObj /** * Converts the object's ID to a string and places it in the buffer pointed to by `str`. */ -void format_object_id(char *str, struct GdObj *obj) { +void format_object_id(char* str, struct GdObj* obj) { enum ObjTypeFlag type = obj->type; switch (type) { case OBJ_TYPE_BONES: - sprintf(str, "b%d ", ((struct ObjBone *) obj)->id); + sprintf(str, "b%d ", ((struct ObjBone*)obj)->id); break; case OBJ_TYPE_JOINTS: - sprintf(str, "j%d ", ((struct ObjJoint *) obj)->id); + sprintf(str, "j%d ", ((struct ObjJoint*)obj)->id); break; case OBJ_TYPE_GROUPS: - sprintf(str, "g%d ", ((struct ObjGroup *) obj)->id); + sprintf(str, "g%d ", ((struct ObjGroup*)obj)->id); break; case OBJ_TYPE_PARTICLES: - sprintf(str, "p%d ", ((struct ObjParticle *) obj)->id); + sprintf(str, "p%d ", ((struct ObjParticle*)obj)->id); break; case OBJ_TYPE_NETS: sprintf(str, "net(no id) "); break; case OBJ_TYPE_CAMERAS: - sprintf(str, "c%d ", ((struct ObjCamera *) obj)->id); + sprintf(str, "c%d ", ((struct ObjCamera*)obj)->id); break; case OBJ_TYPE_VERTICES: sprintf(str, "v(no id) "); break; case OBJ_TYPE_PLANES: - sprintf(str, "pl%d ", ((struct ObjPlane *) obj)->id); + sprintf(str, "pl%d ", ((struct ObjPlane*)obj)->id); break; default: sprintf(str, "?%x ", type); @@ -746,19 +746,19 @@ void format_object_id(char *str, struct GdObj *obj) { } /* @ 22C094 for 0x210 */ -struct ObjGroup *make_group(s32 count, ...) { +struct ObjGroup* make_group(s32 count, ...) { va_list args; s32 i; UNUSED u8 filler1[4]; - struct GdObj *curObj; + struct GdObj* curObj; UNUSED u8 filler2[12]; - struct ObjGroup *newGroup; - struct ObjGroup *oldGroupListHead; - struct GdObj *vargObj; + struct ObjGroup* newGroup; + struct ObjGroup* oldGroupListHead; + struct GdObj* vargObj; char idStrBuf[0x20]; - struct ListNode *curLink; + struct ListNode* curLink; - newGroup = (struct ObjGroup *) make_object(OBJ_TYPE_GROUPS); + newGroup = (struct ObjGroup*)make_object(OBJ_TYPE_GROUPS); newGroup->id = ++gGdGroupCount; newGroup->memberCount = 0; newGroup->firstMember = newGroup->lastMember = NULL; @@ -781,7 +781,7 @@ struct ObjGroup *make_group(s32 count, ...) { for (i = 0; i < count; i++) { // get the next pointer in the struct. - vargObj = va_arg(args, struct GdObj *); + vargObj = va_arg(args, struct GdObj*); if (vargObj == NULL) { // one of our pointers was NULL. raise an error. fatal_printf("make_group() NULL group ptr"); @@ -809,7 +809,7 @@ struct ObjGroup *make_group(s32 count, ...) { /** * Adds the object as a member of the group, placing it at the end of the group's list. */ -void addto_group(struct ObjGroup *group, struct GdObj *obj) { +void addto_group(struct ObjGroup* group, struct GdObj* obj) { char strbuf[0x20]; UNUSED u8 filler[8]; @@ -840,7 +840,7 @@ void addto_group(struct ObjGroup *group, struct GdObj *obj) { /** * Adds the object as a member of the group, placing it at the beginning of the group's list. */ -void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj) { +void addto_groupfirst(struct ObjGroup* group, struct GdObj* obj) { imin("addto_groupfirst"); // Add object to the beginning of group's member list @@ -848,7 +848,7 @@ void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj) { group->firstMember = make_link_to_obj(NULL, obj); group->lastMember = group->firstMember; } else { - struct ListNode *newNode = make_link_to_obj(NULL, obj); + struct ListNode* newNode = make_link_to_obj(NULL, obj); group->firstMember->prev = newNode; newNode->next = group->firstMember; group->firstMember = newNode; @@ -863,8 +863,8 @@ void addto_groupfirst(struct ObjGroup *group, struct GdObj *obj) { /** * Returns TRUE if `obj` is a member of `group`, or FALSE otherwise */ -s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj) { - struct ListNode *node = group->firstMember; +s32 group_contains_obj(struct ObjGroup* group, struct GdObj* obj) { + struct ListNode* node = group->firstMember; while (node != NULL) { if (node->obj->index == obj->index) @@ -880,9 +880,9 @@ s32 group_contains_obj(struct ObjGroup *group, struct GdObj *obj) { */ void show_details(enum ObjTypeFlag type) { enum ObjTypeFlag curObjType; - struct ListNode *curGroupLink; - struct ObjGroup *curSubGroup; - struct GdObj *curObj; + struct ListNode* curGroupLink; + struct ObjGroup* curSubGroup; + struct GdObj* curObj; char idStrBuf[0x24]; s32 curGroupTypes; @@ -913,7 +913,7 @@ void show_details(enum ObjTypeFlag type) { switch (curObjType) { case OBJ_TYPE_GROUPS: gd_printf("Group %s: ", idStrBuf); - curGroupTypes = ((struct ObjGroup *) curObj)->memberTypes; + curGroupTypes = ((struct ObjGroup*)curObj)->memberTypes; if (curGroupTypes & OBJ_TYPE_GROUPS) { gd_printf("groups "); @@ -946,7 +946,7 @@ void show_details(enum ObjTypeFlag type) { gd_printf("vertex "); } - curGroupLink = ((struct ObjGroup *) curObj)->firstMember; + curGroupLink = ((struct ObjGroup*)curObj)->firstMember; while (curGroupLink != NULL) { format_object_id(idStrBuf, curGroupLink->obj); gd_printf("%s", idStrBuf); @@ -956,7 +956,7 @@ void show_details(enum ObjTypeFlag type) { break; case OBJ_TYPE_BONES: gd_printf("Bone %s: ", idStrBuf); - curSubGroup = ((struct ObjBone *) curObj)->unk10C; + curSubGroup = ((struct ObjBone*)curObj)->unk10C; curGroupLink = curSubGroup->firstMember; while (curGroupLink != NULL) { format_object_id(idStrBuf, curGroupLink->obj); @@ -967,7 +967,7 @@ void show_details(enum ObjTypeFlag type) { break; case OBJ_TYPE_JOINTS: gd_printf("Joint %s: ", idStrBuf); - curSubGroup = ((struct ObjJoint *) curObj)->unk1C4; + curSubGroup = ((struct ObjJoint*)curObj)->unk1C4; curGroupLink = curSubGroup->firstMember; while (curGroupLink != NULL) { format_object_id(idStrBuf, curGroupLink->obj); @@ -998,15 +998,15 @@ s32 make_scene(void) { } /* @ 22CA00 for 0x88 */ -static void reset_joint_or_net(struct GdObj *obj) { - struct GdObj *localObjPtr = obj; +static void reset_joint_or_net(struct GdObj* obj) { + struct GdObj* localObjPtr = obj; switch (obj->type) { case OBJ_TYPE_JOINTS: - reset_joint((struct ObjJoint *) localObjPtr); + reset_joint((struct ObjJoint*)localObjPtr); break; case OBJ_TYPE_NETS: - reset_net((struct ObjNet *) localObjPtr); + reset_net((struct ObjNet*)localObjPtr); break; default:; } @@ -1017,22 +1017,22 @@ static void reset_joint_or_net(struct GdObj *obj) { * "Dynamics" menu. */ void menu_cb_reset_positions(void) { - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) reset_joint_or_net, sCurrentMoveGrp); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)reset_joint_or_net, sCurrentMoveGrp); } /** * Unused (not called) - does nothing useful */ -struct GdObj *func_8017E2F0(struct GdObj *obj, enum ObjTypeFlag type) { +struct GdObj* func_8017E2F0(struct GdObj* obj, enum ObjTypeFlag type) { UNUSED u8 filler[4]; enum ObjTypeFlag curObjType; - struct ListNode *node; + struct ListNode* node; curObjType = obj->type; switch (curObjType) { case OBJ_TYPE_GROUPS: - node = ((struct ObjGroup *) obj)->firstMember; + node = ((struct ObjGroup*)obj)->firstMember; while (node != NULL) { func_8017E2F0(node->obj, type); node = node->next; @@ -1055,10 +1055,10 @@ struct GdObj *func_8017E2F0(struct GdObj *obj, enum ObjTypeFlag type) { * `types` bitmask. * Returns the number of objects this function was called on. */ -s32 apply_to_obj_types_in_group(s32 types, applyproc_t func, struct ObjGroup *group) { - struct ListNode *curLink; - struct ListNode *nextLink; - struct GdObj *linkedObj; +s32 apply_to_obj_types_in_group(s32 types, applyproc_t func, struct ObjGroup* group) { + struct ListNode* curLink; + struct ListNode* nextLink; + struct GdObj* linkedObj; enum ObjTypeFlag linkedObjType; applyproc_t objFn; UNUSED u8 filler[32]; @@ -1087,7 +1087,7 @@ s32 apply_to_obj_types_in_group(s32 types, applyproc_t func, struct ObjGroup *gr nextLink = curLink->next; if (linkedObjType == OBJ_TYPE_GROUPS) { - fnAppliedCount += apply_to_obj_types_in_group(types, func, (struct ObjGroup *) linkedObj); + fnAppliedCount += apply_to_obj_types_in_group(types, func, (struct ObjGroup*)linkedObj); } if (linkedObjType & types) { @@ -1101,7 +1101,7 @@ s32 apply_to_obj_types_in_group(s32 types, applyproc_t func, struct ObjGroup *gr } /* @ 22CD54 for 0x2B4 */ -void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { +void func_8017E584(struct ObjNet* a0, struct GdVec3f* a1, struct GdVec3f* a2) { struct GdVec3f sp94; struct GdVec3f sp88; struct GdVec3f sp7C; @@ -1138,7 +1138,7 @@ void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { } gd_cross_vec3f(&sp70, a1, &sp94); - sp2C = (f32) gd_sqrt_d((sp94.x * sp94.x) + (sp94.z * sp94.z)); + sp2C = (f32)gd_sqrt_d((sp94.x * sp94.x) + (sp94.z * sp94.z)); if (sp2C > 1000.0) { //? 1000.0f sp2C = 1000.0f; @@ -1157,7 +1157,7 @@ void func_8017E584(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { } /* @ 22D008 for 0x1B4 */ -void func_8017E838(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { +void func_8017E838(struct ObjNet* a0, struct GdVec3f* a1, struct GdVec3f* a2) { UNUSED u8 filler1[12]; struct GdVec3f sp70; struct GdVec3f sp64; @@ -1191,7 +1191,7 @@ void func_8017E838(struct ObjNet *a0, struct GdVec3f *a1, struct GdVec3f *a2) { } /* @ 22D1BC for 0xA8 */ -void func_8017E9EC(struct ObjNet *net) { +void func_8017E9EC(struct ObjNet* net) { struct GdVec3f sp5C; Mat4f sp1C; f32 sp18; @@ -1209,9 +1209,8 @@ void func_8017E9EC(struct ObjNet *net) { /** * Unused (not called) */ -s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix) { - if (vec->x >= matrix[2][2] && vec->x <= matrix[3][1] && vec->z >= matrix[3][0] - && vec->z <= matrix[3][3]) { +s32 func_8017EA94(struct GdVec3f* vec, Mat4f matrix) { + if (vec->x >= matrix[2][2] && vec->x <= matrix[3][1] && vec->z >= matrix[3][0] && vec->z <= matrix[3][3]) { return 1; } @@ -1221,11 +1220,11 @@ s32 func_8017EA94(struct GdVec3f *vec, Mat4f matrix) { /** * Unused (not called) */ -s32 func_8017EB24(struct GdObj *obj1, struct GdObj *obj2) { +s32 func_8017EB24(struct GdObj* obj1, struct GdObj* obj2) { struct GdVec3f pos1; struct GdVec3f pos2; - struct GdBoundingBox *bbox1; - struct GdBoundingBox *bbox2; + struct GdBoundingBox* bbox1; + struct GdBoundingBox* bbox2; struct GdBoundingBox sp18; set_cur_dynobj(obj1); @@ -1264,7 +1263,7 @@ s32 func_8017EB24(struct GdObj *obj1, struct GdObj *obj2) { /** * Unused (not called) */ -s32 is_obj_xz_in_bounding_box(struct GdObj *obj, struct GdBoundingBox *bbox) { +s32 is_obj_xz_in_bounding_box(struct GdObj* obj, struct GdBoundingBox* bbox) { struct GdVec3f pos; set_cur_dynobj(obj); @@ -1286,7 +1285,7 @@ s32 is_obj_xz_in_bounding_box(struct GdObj *obj, struct GdBoundingBox *bbox) { /** * Unused (not called) */ -s32 is_point_xz_in_bounding_box(struct GdVec3f *point, struct GdBoundingBox *bbox) { +s32 is_point_xz_in_bounding_box(struct GdVec3f* point, struct GdBoundingBox* bbox) { if (point->x >= bbox->minX) { if (point->x <= bbox->maxX) { if (point->z >= bbox->minZ) { @@ -1304,7 +1303,7 @@ s32 is_point_xz_in_bounding_box(struct GdVec3f *point, struct GdBoundingBox *bbo * Unused (called by func_801A71CC) - returns TRUE if any of the four corners of * box1's X-Z plane lie within box2's X-Z plane */ -s32 gd_plane_point_within(struct GdBoundingBox *box1, struct GdBoundingBox *box2) { +s32 gd_plane_point_within(struct GdBoundingBox* box1, struct GdBoundingBox* box2) { // test if min x and min z of box1 are within box2 if (box1->minX >= box2->minX) { if (box1->minX <= box2->maxX) { @@ -1353,26 +1352,26 @@ s32 gd_plane_point_within(struct GdBoundingBox *box1, struct GdBoundingBox *box2 } /* @ 22D824 for 0x1BC */ -s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj) { - struct ListNode *curLink; - struct ObjGroup *curGroup; +s32 transform_child_objects_recursive(struct GdObj* obj, struct GdObj* parentObj) { + struct ListNode* curLink; + struct ObjGroup* curGroup; UNUSED u8 filler1[4]; - Mat4f *parentUnkMtx; - Mat4f *iMtx; - Mat4f *unkMtx; - Mat4f *rotMtx; - Mat4f *rotMtx2; + Mat4f* parentUnkMtx; + Mat4f* iMtx; + Mat4f* unkMtx; + Mat4f* rotMtx; + Mat4f* rotMtx2; UNUSED u8 filler2[24]; struct GdVec3f scale; if (parentObj != NULL) { set_cur_dynobj(parentObj); parentUnkMtx = d_get_matrix_ptr(); - rotMtx = (Mat4f *) d_get_rot_mtx_ptr(); + rotMtx = (Mat4f*)d_get_rot_mtx_ptr(); set_cur_dynobj(obj); iMtx = d_get_i_mtx_ptr(); - rotMtx2 = (Mat4f *) d_get_rot_mtx_ptr(); + rotMtx2 = (Mat4f*)d_get_rot_mtx_ptr(); d_get_scale(&scale); @@ -1385,7 +1384,7 @@ s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj set_cur_dynobj(obj); unkMtx = d_get_matrix_ptr(); iMtx = d_get_i_mtx_ptr(); - rotMtx = (Mat4f *) d_get_rot_mtx_ptr(); + rotMtx = (Mat4f*)d_get_rot_mtx_ptr(); d_get_scale(&scale); gd_set_identity_mat4(unkMtx); @@ -1407,15 +1406,15 @@ s32 transform_child_objects_recursive(struct GdObj *obj, struct GdObj *parentObj } /* @ 22D9E0 for 0x1BC */ -s32 func_8017F210(struct GdObj *a0, struct GdObj *a1) { - struct ListNode *sp6C; - struct ObjGroup *sp68; +s32 func_8017F210(struct GdObj* a0, struct GdObj* a1) { + struct ListNode* sp6C; + struct ObjGroup* sp68; UNUSED u8 filler1[4]; - UNUSED Mat4f *sp60; - Mat4f *sp5C; - UNUSED Mat4f *sp58; - Mat4f *sp54; - Mat4f *sp50; + UNUSED Mat4f* sp60; + Mat4f* sp5C; + UNUSED Mat4f* sp58; + Mat4f* sp54; + Mat4f* sp50; UNUSED u8 filler2[24]; struct GdVec3f sp2C; s32 count = 0; @@ -1425,11 +1424,11 @@ s32 func_8017F210(struct GdObj *a0, struct GdObj *a1) { if (a1 != NULL) { set_cur_dynobj(a1); sp60 = d_get_matrix_ptr(); - sp54 = (Mat4f *) d_get_rot_mtx_ptr(); + sp54 = (Mat4f*)d_get_rot_mtx_ptr(); set_cur_dynobj(a0); sp5C = d_get_i_mtx_ptr(); - sp50 = (Mat4f *) d_get_rot_mtx_ptr(); + sp50 = (Mat4f*)d_get_rot_mtx_ptr(); d_get_scale(&sp2C); gd_mult_mat4f(sp5C, sp54, sp50); @@ -1438,7 +1437,7 @@ s32 func_8017F210(struct GdObj *a0, struct GdObj *a1) { set_cur_dynobj(a0); sp58 = d_get_matrix_ptr(); sp5C = d_get_i_mtx_ptr(); - sp54 = (Mat4f *) d_get_rot_mtx_ptr(); + sp54 = (Mat4f*)d_get_rot_mtx_ptr(); d_get_scale(&sp2C); gd_copy_mat4f(sp5C, sp54); @@ -1459,12 +1458,12 @@ s32 func_8017F210(struct GdObj *a0, struct GdObj *a1) { } /* @ 22DB9C for 0x38; a0 might be ObjUnk200000* */ -void func_8017F3CC(struct Unk8017F3CC *a0) { +void func_8017F3CC(struct Unk8017F3CC* a0) { gd_rotate_and_translate_vec3f(&a0->unk20, D_801B9E48); } /* @ 22DBD4 for 0x20 */ -void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj *a2) { +void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj* a1, UNUSED struct GdObj* a2) { UNUSED u8 filler[48]; } @@ -1473,7 +1472,7 @@ void stub_objects_3(UNUSED f32 a0, UNUSED struct GdObj *a1, UNUSED struct GdObj * the interpolation factor (between 0 and 1). Sets the current dynobj's matrix * as the result of the transformation. */ -void interpolate_animation_transform(struct GdAnimTransform *t1, struct GdAnimTransform *t2, f32 dt) { +void interpolate_animation_transform(struct GdAnimTransform* t1, struct GdAnimTransform* t2, f32 dt) { Mat4f mtx; gd_set_identity_mat4(&mtx); @@ -1505,43 +1504,43 @@ void interpolate_animation_transform(struct GdAnimTransform *t1, struct GdAnimTr } /* @ 22DD94 for 0x1060; orig name: func_8017F5C4 */ -void move_animator(struct ObjAnimator *animObj) { - struct AnimDataInfo *animData; // array? - Mat4f *mtxArr; +void move_animator(struct ObjAnimator* animObj) { + struct AnimDataInfo* animData; // array? + Mat4f* mtxArr; Mat4f localMtx; - struct GdAnimTransform *triPtr; - struct GdAnimTransform currTransform; // transformation for the current keyframe - struct GdAnimTransform nextTransform; // transformation for the next keyframe - s16(*animData9s16)[9]; // GdTriangleH[]? - s16(*animData3s16)[3]; // MyVec3h[]? - s16(*animData6s16)[6]; // GdPlaneH[]? - s16(*animDataCam)[6]; // camera GdPlaneH[]? - struct GdObj *stubObj1 = NULL; // used only for call to stubbed function - struct GdObj *stubObj2 = NULL; // used only for call to stubbed function + struct GdAnimTransform* triPtr; + struct GdAnimTransform currTransform; // transformation for the current keyframe + struct GdAnimTransform nextTransform; // transformation for the next keyframe + s16(*animData9s16)[9]; // GdTriangleH[]? + s16(*animData3s16)[3]; // MyVec3h[]? + s16(*animData6s16)[6]; // GdPlaneH[]? + s16(*animDataCam)[6]; // camera GdPlaneH[]? + struct GdObj* stubObj1 = NULL; // used only for call to stubbed function + struct GdObj* stubObj2 = NULL; // used only for call to stubbed function UNUSED u8 filler[12]; UNUSED struct GdVec3f unusedVec; s32 currKeyFrame; s32 nextKeyFrame; f32 dt; f32 scale = 0.1f; - struct AnimMtxVec *sp28; - register struct ListNode *link; - struct GdObj *linkedObj; + struct AnimMtxVec* sp28; + register struct ListNode* link; + struct GdObj* linkedObj; if (animObj->controlFunc != NULL) { animObj->controlFunc(animObj); } if (animObj->animatedPartsGrp == NULL) { - return; // nothing to animate + return; // nothing to animate } - animData = (struct AnimDataInfo *) animObj->animdataGrp->firstMember->obj; + animData = (struct AnimDataInfo*)animObj->animdataGrp->firstMember->obj; if (animObj->attachedToObj != NULL) { - animObj->frame = ((struct ObjAnimator *) animObj->attachedToObj)->frame - / ((struct ObjAnimator *) animObj->attachedToObj)->unk24; - animData += ((struct ObjAnimator *) animObj->attachedToObj)->animSeqNum; + animObj->frame = + ((struct ObjAnimator*)animObj->attachedToObj)->frame / ((struct ObjAnimator*)animObj->attachedToObj)->unk24; + animData += ((struct ObjAnimator*)animObj->attachedToObj)->animSeqNum; } if (animData->type == 0) { @@ -1552,14 +1551,14 @@ void move_animator(struct ObjAnimator *animObj) { unusedVec.y = 1.0f; unusedVec.z = 1.0f; - if (animObj->frame > (f32) animData->count) { + if (animObj->frame > (f32)animData->count) { animObj->frame = 1.0f; } else if (animObj->frame < 0.0f) { - animObj->frame = (f32) animData->count; + animObj->frame = (f32)animData->count; } - currKeyFrame = (s32) animObj->frame; - dt = animObj->frame - (f32) currKeyFrame; + currKeyFrame = (s32)animObj->frame; + dt = animObj->frame - (f32)currKeyFrame; nextKeyFrame = currKeyFrame + 1; if (nextKeyFrame > animData->count) { @@ -1576,12 +1575,12 @@ void move_animator(struct ObjAnimator *animObj) { set_cur_dynobj(linkedObj); switch (animData->type) { case GD_ANIM_MTX4x4: // data = Mat4f* (f32[4][4]) - mtxArr = (Mat4f *) animData->data; + mtxArr = (Mat4f*)animData->data; /* This needs be be un-dereferenced pointer addition to make the registers match */ - d_set_i_matrix(mtxArr + (s32) animObj->frame); + d_set_i_matrix(mtxArr + (s32)animObj->frame); break; case GD_ANIM_ROT3S: // data = s16(*)[3] - rotation only - animData3s16 = (s16(*)[3]) animData->data; + animData3s16 = (s16(*)[3])animData->data; // keep current object scale d_get_scale(&currTransform.scale); @@ -1596,18 +1595,18 @@ void move_animator(struct ObjAnimator *animObj) { nextTransform.pos.z = currTransform.pos.z; // use animation rotation - currTransform.rotate.x = (f32) animData3s16[currKeyFrame][0] * scale; - currTransform.rotate.y = (f32) animData3s16[currKeyFrame][1] * scale; - currTransform.rotate.z = (f32) animData3s16[currKeyFrame][2] * scale; + currTransform.rotate.x = (f32)animData3s16[currKeyFrame][0] * scale; + currTransform.rotate.y = (f32)animData3s16[currKeyFrame][1] * scale; + currTransform.rotate.z = (f32)animData3s16[currKeyFrame][2] * scale; - nextTransform.rotate.x = (f32) animData3s16[nextKeyFrame][0] * scale; - nextTransform.rotate.y = (f32) animData3s16[nextKeyFrame][1] * scale; - nextTransform.rotate.z = (f32) animData3s16[nextKeyFrame][2] * scale; + nextTransform.rotate.x = (f32)animData3s16[nextKeyFrame][0] * scale; + nextTransform.rotate.y = (f32)animData3s16[nextKeyFrame][1] * scale; + nextTransform.rotate.z = (f32)animData3s16[nextKeyFrame][2] * scale; interpolate_animation_transform(&currTransform, &nextTransform, dt); break; case GD_ANIM_POS3S: // data = s16(*)[3] - position only - animData3s16 = (s16(*)[3]) animData->data; + animData3s16 = (s16(*)[3])animData->data; // keep current object scale d_get_scale(&currTransform.scale); @@ -1622,71 +1621,71 @@ void move_animator(struct ObjAnimator *animObj) { nextTransform.rotate.z = currTransform.rotate.z; // use animation position - currTransform.pos.x = (f32) animData3s16[currKeyFrame][0]; - currTransform.pos.y = (f32) animData3s16[currKeyFrame][1]; - currTransform.pos.z = (f32) animData3s16[currKeyFrame][2]; + currTransform.pos.x = (f32)animData3s16[currKeyFrame][0]; + currTransform.pos.y = (f32)animData3s16[currKeyFrame][1]; + currTransform.pos.z = (f32)animData3s16[currKeyFrame][2]; - nextTransform.pos.x = (f32) animData3s16[nextKeyFrame][0]; - nextTransform.pos.y = (f32) animData3s16[nextKeyFrame][1]; - nextTransform.pos.z = (f32) animData3s16[nextKeyFrame][2]; + nextTransform.pos.x = (f32)animData3s16[nextKeyFrame][0]; + nextTransform.pos.y = (f32)animData3s16[nextKeyFrame][1]; + nextTransform.pos.z = (f32)animData3s16[nextKeyFrame][2]; interpolate_animation_transform(&currTransform, &nextTransform, dt); break; case GD_ANIM_ROT3S_POS3S: // data = s16(*)[6] - rotation and position - animData6s16 = (s16(*)[6]) animData->data; + animData6s16 = (s16(*)[6])animData->data; // keep current object scale d_get_scale(&currTransform.scale); - nextTransform.scale.x = currTransform.scale.x; - nextTransform.scale.y = currTransform.scale.y; - nextTransform.scale.z = currTransform.scale.z; + nextTransform.scale.x = currTransform.scale.x; + nextTransform.scale.y = currTransform.scale.y; + nextTransform.scale.z = currTransform.scale.z; // use animation rotation - currTransform.rotate.x = (f32) animData6s16[currKeyFrame][0] * scale; - currTransform.rotate.y = (f32) animData6s16[currKeyFrame][1] * scale; - currTransform.rotate.z = (f32) animData6s16[currKeyFrame][2] * scale; + currTransform.rotate.x = (f32)animData6s16[currKeyFrame][0] * scale; + currTransform.rotate.y = (f32)animData6s16[currKeyFrame][1] * scale; + currTransform.rotate.z = (f32)animData6s16[currKeyFrame][2] * scale; - nextTransform.rotate.x = (f32) animData6s16[nextKeyFrame][0] * scale; - nextTransform.rotate.y = (f32) animData6s16[nextKeyFrame][1] * scale; - nextTransform.rotate.z = (f32) animData6s16[nextKeyFrame][2] * scale; + nextTransform.rotate.x = (f32)animData6s16[nextKeyFrame][0] * scale; + nextTransform.rotate.y = (f32)animData6s16[nextKeyFrame][1] * scale; + nextTransform.rotate.z = (f32)animData6s16[nextKeyFrame][2] * scale; // use animation position - currTransform.pos.x = (f32) animData6s16[currKeyFrame][3]; - currTransform.pos.y = (f32) animData6s16[currKeyFrame][4]; - currTransform.pos.z = (f32) animData6s16[currKeyFrame][5]; + currTransform.pos.x = (f32)animData6s16[currKeyFrame][3]; + currTransform.pos.y = (f32)animData6s16[currKeyFrame][4]; + currTransform.pos.z = (f32)animData6s16[currKeyFrame][5]; - nextTransform.pos.x = (f32) animData6s16[nextKeyFrame][3]; - nextTransform.pos.y = (f32) animData6s16[nextKeyFrame][4]; - nextTransform.pos.z = (f32) animData6s16[nextKeyFrame][5]; + nextTransform.pos.x = (f32)animData6s16[nextKeyFrame][3]; + nextTransform.pos.y = (f32)animData6s16[nextKeyFrame][4]; + nextTransform.pos.z = (f32)animData6s16[nextKeyFrame][5]; interpolate_animation_transform(&currTransform, &nextTransform, dt); break; case GD_ANIM_SCALE3S_POS3S_ROT3S: // data = s16(*)[9] - scale, position, and rotation - animData9s16 = (s16(*)[9]) animData->data; + animData9s16 = (s16(*)[9])animData->data; - currTransform.scale.x = (f32) animData9s16[currKeyFrame][0] * scale; - currTransform.scale.y = (f32) animData9s16[currKeyFrame][1] * scale; - currTransform.scale.z = (f32) animData9s16[currKeyFrame][2] * scale; + currTransform.scale.x = (f32)animData9s16[currKeyFrame][0] * scale; + currTransform.scale.y = (f32)animData9s16[currKeyFrame][1] * scale; + currTransform.scale.z = (f32)animData9s16[currKeyFrame][2] * scale; - currTransform.rotate.x = (f32) animData9s16[currKeyFrame][3] * scale; - currTransform.rotate.y = (f32) animData9s16[currKeyFrame][4] * scale; - currTransform.rotate.z = (f32) animData9s16[currKeyFrame][5] * scale; + currTransform.rotate.x = (f32)animData9s16[currKeyFrame][3] * scale; + currTransform.rotate.y = (f32)animData9s16[currKeyFrame][4] * scale; + currTransform.rotate.z = (f32)animData9s16[currKeyFrame][5] * scale; - currTransform.pos.x = (f32) animData9s16[currKeyFrame][6]; - currTransform.pos.y = (f32) animData9s16[currKeyFrame][7]; - currTransform.pos.z = (f32) animData9s16[currKeyFrame][8]; + currTransform.pos.x = (f32)animData9s16[currKeyFrame][6]; + currTransform.pos.y = (f32)animData9s16[currKeyFrame][7]; + currTransform.pos.z = (f32)animData9s16[currKeyFrame][8]; - nextTransform.scale.x = (f32) animData9s16[nextKeyFrame][0] * scale; - nextTransform.scale.y = (f32) animData9s16[nextKeyFrame][1] * scale; - nextTransform.scale.z = (f32) animData9s16[nextKeyFrame][2] * scale; + nextTransform.scale.x = (f32)animData9s16[nextKeyFrame][0] * scale; + nextTransform.scale.y = (f32)animData9s16[nextKeyFrame][1] * scale; + nextTransform.scale.z = (f32)animData9s16[nextKeyFrame][2] * scale; - nextTransform.rotate.x = (f32) animData9s16[nextKeyFrame][3] * scale; - nextTransform.rotate.y = (f32) animData9s16[nextKeyFrame][4] * scale; - nextTransform.rotate.z = (f32) animData9s16[nextKeyFrame][5] * scale; + nextTransform.rotate.x = (f32)animData9s16[nextKeyFrame][3] * scale; + nextTransform.rotate.y = (f32)animData9s16[nextKeyFrame][4] * scale; + nextTransform.rotate.z = (f32)animData9s16[nextKeyFrame][5] * scale; - nextTransform.pos.x = (f32) animData9s16[nextKeyFrame][6]; - nextTransform.pos.y = (f32) animData9s16[nextKeyFrame][7]; - nextTransform.pos.z = (f32) animData9s16[nextKeyFrame][8]; + nextTransform.pos.x = (f32)animData9s16[nextKeyFrame][6]; + nextTransform.pos.y = (f32)animData9s16[nextKeyFrame][7]; + nextTransform.pos.z = (f32)animData9s16[nextKeyFrame][8]; interpolate_animation_transform(&currTransform, &nextTransform, dt); break; @@ -1695,35 +1694,36 @@ void move_animator(struct ObjAnimator *animObj) { animDataCam = animData->data; // eye position - currTransform.pos.x = (f32) animDataCam[currKeyFrame][0]; - currTransform.pos.y = (f32) animDataCam[currKeyFrame][1]; - currTransform.pos.z = (f32) animDataCam[currKeyFrame][2]; + currTransform.pos.x = (f32)animDataCam[currKeyFrame][0]; + currTransform.pos.y = (f32)animDataCam[currKeyFrame][1]; + currTransform.pos.z = (f32)animDataCam[currKeyFrame][2]; // lookat position - nextTransform.pos.x = (f32) animDataCam[currKeyFrame][3]; - nextTransform.pos.y = (f32) animDataCam[currKeyFrame][4]; - nextTransform.pos.z = (f32) animDataCam[currKeyFrame][5]; + nextTransform.pos.x = (f32)animDataCam[currKeyFrame][3]; + nextTransform.pos.y = (f32)animDataCam[currKeyFrame][4]; + nextTransform.pos.z = (f32)animDataCam[currKeyFrame][5]; - ((struct ObjCamera *) linkedObj)->worldPos.x = currTransform.pos.x; - ((struct ObjCamera *) linkedObj)->worldPos.y = currTransform.pos.y; - ((struct ObjCamera *) linkedObj)->worldPos.z = currTransform.pos.z; + ((struct ObjCamera*)linkedObj)->worldPos.x = currTransform.pos.x; + ((struct ObjCamera*)linkedObj)->worldPos.y = currTransform.pos.y; + ((struct ObjCamera*)linkedObj)->worldPos.z = currTransform.pos.z; - ((struct ObjCamera *) linkedObj)->lookAt.x = nextTransform.pos.x; - ((struct ObjCamera *) linkedObj)->lookAt.y = nextTransform.pos.y; - ((struct ObjCamera *) linkedObj)->lookAt.z = nextTransform.pos.z; + ((struct ObjCamera*)linkedObj)->lookAt.x = nextTransform.pos.x; + ((struct ObjCamera*)linkedObj)->lookAt.y = nextTransform.pos.y; + ((struct ObjCamera*)linkedObj)->lookAt.z = nextTransform.pos.z; } break; case GD_ANIM_SCALE3F_ROT3F_POS3F: // scale, rotation, and position (as floats) - triPtr = (struct GdAnimTransform *) animData->data; + triPtr = (struct GdAnimTransform*)animData->data; interpolate_animation_transform(&triPtr[currKeyFrame], &triPtr[nextKeyFrame], dt); break; case GD_ANIM_MTX4x4F_SCALE3F: // AnimMtxVec[] - sp28 = &((struct AnimMtxVec *) animData->data)[currKeyFrame]; + sp28 = &((struct AnimMtxVec*)animData->data)[currKeyFrame]; d_set_i_matrix(&sp28->matrix); d_set_scale(sp28->vec.x, sp28->vec.y, sp28->vec.z); break; - case GD_ANIM_SCALE3F_ROT3F_POS3F_2: // similar to GD_ANIM_SCALE3F_ROT3F_POS3F, but no interpolation? what matrix does d_set_i_matrix set? - triPtr = (struct GdAnimTransform *) animData->data; + case GD_ANIM_SCALE3F_ROT3F_POS3F_2: // similar to GD_ANIM_SCALE3F_ROT3F_POS3F, but no interpolation? what + // matrix does d_set_i_matrix set? + triPtr = (struct GdAnimTransform*)animData->data; gd_set_identity_mat4(&localMtx); gd_scale_mat4f_by_vec3f(&localMtx, &triPtr->scale); gd_rot_mat_about_vec(&localMtx, &triPtr->rotate); @@ -1750,15 +1750,15 @@ void move_animator(struct ObjAnimator *animObj) { } /* @ 22EDF4 for 0x300; orig name: func_80180624 */ -void drag_picked_object(struct GdObj *inputObj) { +void drag_picked_object(struct GdObj* inputObj) { UNUSED u8 filler1[12]; struct GdVec3f displacement; struct GdVec3f spC4; - struct GdControl *ctrl; + struct GdControl* ctrl; Mat4f sp80; Mat4f sp40; UNUSED u8 filler2[12]; - struct GdObj *obj; + struct GdObj* obj; UNUSED u8 filler3[4]; f32 dispMag; @@ -1788,22 +1788,22 @@ void drag_picked_object(struct GdObj *inputObj) { switch (inputObj->type) { case OBJ_TYPE_JOINTS: - ((struct ObjJoint *) obj)->mat128[3][0] += displacement.x; - ((struct ObjJoint *) obj)->mat128[3][1] += displacement.y; - ((struct ObjJoint *) obj)->mat128[3][2] += displacement.z; + ((struct ObjJoint*)obj)->mat128[3][0] += displacement.x; + ((struct ObjJoint*)obj)->mat128[3][1] += displacement.y; + ((struct ObjJoint*)obj)->mat128[3][2] += displacement.z; break; case OBJ_TYPE_GADGETS: break; case OBJ_TYPE_NETS: - gd_inverse_mat4f(&((struct ObjNet *) obj)->mat128, &sp80); + gd_inverse_mat4f(&((struct ObjNet*)obj)->mat128, &sp80); spC4.x = displacement.x; spC4.y = displacement.y; spC4.z = displacement.z; gd_mat4f_mult_vec3f(&spC4, &sp80); - ((struct ObjNet *) obj)->matE8[3][0] += displacement.x; - ((struct ObjNet *) obj)->matE8[3][1] += displacement.y; - ((struct ObjNet *) obj)->matE8[3][2] += displacement.z; + ((struct ObjNet*)obj)->matE8[3][0] += displacement.x; + ((struct ObjNet*)obj)->matE8[3][1] += displacement.y; + ((struct ObjNet*)obj)->matE8[3][2] += displacement.z; break; case OBJ_TYPE_PARTICLES: break; @@ -1813,20 +1813,20 @@ void drag_picked_object(struct GdObj *inputObj) { } /* @ 22F0F4 for 0x50; orig name: func_80180924*/ -void move_animators(struct ObjGroup *group) { +void move_animators(struct ObjGroup* group) { restart_timer("move_animators"); - apply_to_obj_types_in_group(OBJ_TYPE_ANIMATORS, (applyproc_t) move_animator, group); + apply_to_obj_types_in_group(OBJ_TYPE_ANIMATORS, (applyproc_t)move_animator, group); split_timer("move_animators"); } /* @ 22F144 for 0x3C; orig name: func_80180974 */ -void find_and_drag_picked_object(struct ObjGroup *group) { - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) drag_picked_object, group); +void find_and_drag_picked_object(struct ObjGroup* group) { + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)drag_picked_object, group); } /* @ 22F180 for 0x624; orig name: func_801809B0 */ -void move_camera(struct ObjCamera *cam) { - struct GdObj *spEC; +void move_camera(struct ObjCamera* cam) { + struct GdObj* spEC; struct GdVec3f spE0; struct GdVec3f spD4; struct GdVec3f spC8; @@ -1834,8 +1834,8 @@ void move_camera(struct ObjCamera *cam) { struct GdVec3f spB0; Mat4f sp70; UNUSED u8 filler2[64]; - Mat4f *sp2C; - struct GdControl *ctrl; + Mat4f* sp2C; + struct GdControl* ctrl; ctrl = &gGdCtrl; if (!(cam->flags & 0x10)) { @@ -1876,7 +1876,7 @@ void move_camera(struct ObjCamera *cam) { sp2C = &cam->unk64; if ((cam->flags & CAMERA_FLAG_CONTROLLABLE) != 0) { - if (ctrl->btnB != FALSE && ctrl->prevFrame->btnB == FALSE) { // new B press + if (ctrl->btnB != FALSE && ctrl->prevFrame->btnB == FALSE) { // new B press cam->zoomLevel++; if (cam->zoomLevel > cam->maxZoomLevel) { cam->zoomLevel = 0; @@ -1946,12 +1946,12 @@ void move_camera(struct ObjCamera *cam) { } /* @ 22F7A4 for 0x38; orig name: func_80180FD4 */ -void move_cameras_in_grp(struct ObjGroup *group) { - apply_to_obj_types_in_group(OBJ_TYPE_CAMERAS, (applyproc_t) move_camera, group); +void move_cameras_in_grp(struct ObjGroup* group) { + apply_to_obj_types_in_group(OBJ_TYPE_CAMERAS, (applyproc_t)move_camera, group); } /* @ 22F7DC for 0x36C*/ -void func_8018100C(struct ObjLight *light) { +void func_8018100C(struct ObjLight* light) { Mat4f mtx; UNUSED u8 filler[12]; @@ -2011,8 +2011,8 @@ void func_8018100C(struct ObjLight *light) { } /* @ 22FB48 for 0x38; orig name: func_80181378 */ -void move_lights_in_grp(struct ObjGroup *group) { - apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t) func_8018100C, group); +void move_lights_in_grp(struct ObjGroup* group) { + apply_to_obj_types_in_group(OBJ_TYPE_LIGHTS, (applyproc_t)func_8018100C, group); } /* @ 22FB80 for 0xAC; orig name: func_801813B0 */ @@ -2034,7 +2034,7 @@ void move_group_members(void) { } /* @ 22FC2C for 0x98; orig name: func_8018145C */ -void proc_view_movement(struct ObjView *view) { +void proc_view_movement(struct ObjView* view) { imin("movement"); sCurrentMoveCamera = view->activeCam; sCurrentMoveView = view; @@ -2048,9 +2048,9 @@ void proc_view_movement(struct ObjView *view) { } /* @ 22FCC4 for 0x44; orig name: func_801814F4 */ -void reset_nets_and_gadgets(struct ObjGroup *group) { +void reset_nets_and_gadgets(struct ObjGroup* group) { func_80193848(group); - apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget, group); + apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t)reset_gadget, group); } /* @ 22FD08 for 0x9C; orig name: func_80181538*/ diff --git a/src/goddard/old_menu.c b/src/goddard/old_menu.c index 5a589fb7..fb6e7d46 100644 --- a/src/goddard/old_menu.c +++ b/src/goddard/old_menu.c @@ -24,14 +24,14 @@ static char sDefSettingsMenuStr[0x100]; static struct GdVec3f sStaticVec; UNUSED static struct GdVec3f unusedVec; -static struct ObjGadget *sCurGadgetPtr; +static struct ObjGadget* sCurGadgetPtr; // forward declarations -static void reset_gadget_default(struct ObjGadget *); +static void reset_gadget_default(struct ObjGadget*); /* 239EC0 -> 239F78 */ -void get_objvalue(union ObjVarVal *dst, enum ValPtrType type, void *base, size_t offset) { - union ObjVarVal *objAddr = (void *) ((u8 *) base + offset); +void get_objvalue(union ObjVarVal* dst, enum ValPtrType type, void* base, size_t offset) { + union ObjVarVal* objAddr = (void*)((u8*)base + offset); switch (type) { case OBJ_VALUE_INT: @@ -46,7 +46,7 @@ void get_objvalue(union ObjVarVal *dst, enum ValPtrType type, void *base, size_t } /* 239F78 -> 23A00C */ -void Unknown8018B7A8(void *a0) { +void Unknown8018B7A8(void* a0) { struct GdVec3f sp1C; set_cur_dynobj(a0); @@ -64,20 +64,20 @@ void Unknown8018B7A8(void *a0) { * @param itemId ID of the menu item that was clicked */ static void menu_cb_default_settings(intptr_t itemId) { - struct ObjGroup *group = (struct ObjGroup *)itemId; // Unpack pointer from menu item ID - apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget_default, group); - apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) stub_renderer_6, gGdViewsGroup); + struct ObjGroup* group = (struct ObjGroup*)itemId; // Unpack pointer from menu item ID + apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t)reset_gadget_default, group); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t)stub_renderer_6, gGdViewsGroup); } /** * Unused - appends a menu item for the group to sDefSettingsMenuStr. */ -static void add_item_to_default_settings_menu(struct ObjGroup *group) { +static void add_item_to_default_settings_menu(struct ObjGroup* group) { char buf[0x100]; if (group->debugPrint == 1) { // Convert pointer to integer and store it as the menu item ID. - sprintf(buf, "| %s %%x%d", group->name, (u32) (intptr_t) group); + sprintf(buf, "| %s %%x%d", group->name, (u32)(intptr_t)group); gd_strcat(sDefSettingsMenuStr, buf); } } @@ -85,37 +85,36 @@ static void add_item_to_default_settings_menu(struct ObjGroup *group) { /** * Unused - creates a popup menu that allows the user to control some settings. */ -long create_gui_menu(struct ObjGroup *grp) { +long create_gui_menu(struct ObjGroup* grp) { long dynamicsMenuId; long defaultSettingMenuId; long contTypeMenuId; gd_strcpy(sDefSettingsMenuStr, "Default Settings %t %F"); - apply_to_obj_types_in_group(OBJ_TYPE_GROUPS, (applyproc_t) add_item_to_default_settings_menu, grp); + apply_to_obj_types_in_group(OBJ_TYPE_GROUPS, (applyproc_t)add_item_to_default_settings_menu, grp); defaultSettingMenuId = defpup(sDefSettingsMenuStr, &menu_cb_default_settings); - contTypeMenuId = defpup( - "Control Type %t %F" - "| U-64 Analogue Joystick %x1 " - "| Keyboard %x2 " - "| Mouse %x3", - &menu_cb_control_type); + contTypeMenuId = defpup("Control Type %t %F" + "| U-64 Analogue Joystick %x1 " + "| Keyboard %x2 " + "| Mouse %x3", + &menu_cb_control_type); - dynamicsMenuId = defpup( - "Dynamics %t " - "|\t\t\tReset Positions %f " - "|\t\t\tSet Defaults %m " - "|\t\t\tSet Controller %m " - "|\t\t\tRe-Calibrate Controller %f " - "|\t\t\tQuit %f", - &menu_cb_reset_positions, defaultSettingMenuId, contTypeMenuId, &menu_cb_recalibrate_controller, &gd_exit); + dynamicsMenuId = defpup("Dynamics %t " + "|\t\t\tReset Positions %f " + "|\t\t\tSet Defaults %m " + "|\t\t\tSet Controller %m " + "|\t\t\tRe-Calibrate Controller %f " + "|\t\t\tQuit %f", + &menu_cb_reset_positions, defaultSettingMenuId, contTypeMenuId, + &menu_cb_recalibrate_controller, &gd_exit); return dynamicsMenuId; } /* 23A190 -> 23A250 */ -struct ObjLabel *make_label(struct ObjValPtr *ptr, char *str, s32 a2, f32 x, f32 y, f32 z) { - struct ObjLabel *label = (struct ObjLabel *) make_object(OBJ_TYPE_LABELS); +struct ObjLabel* make_label(struct ObjValPtr* ptr, char* str, s32 a2, f32 x, f32 y, f32 z) { + struct ObjLabel* label = (struct ObjLabel*)make_object(OBJ_TYPE_LABELS); label->valfn = NULL; label->valptr = ptr; label->fmtstr = str; @@ -129,8 +128,8 @@ struct ObjLabel *make_label(struct ObjValPtr *ptr, char *str, s32 a2, f32 x, f32 } /* 23A250 -> 23A32C */ -struct ObjGadget *make_gadget(UNUSED s32 a0, s32 a1) { - struct ObjGadget *gdgt = (struct ObjGadget *) make_object(OBJ_TYPE_GADGETS); +struct ObjGadget* make_gadget(UNUSED s32 a0, s32 a1) { + struct ObjGadget* gdgt = (struct ObjGadget*)make_object(OBJ_TYPE_GADGETS); gdgt->valueGrp = NULL; gdgt->rangeMax = 1.0f; gdgt->rangeMin = 0.0f; @@ -139,14 +138,14 @@ struct ObjGadget *make_gadget(UNUSED s32 a0, s32 a1) { gdgt->sliderPos = 1.0f; gdgt->size.x = 100.0f; gdgt->size.y = 10.0f; - gdgt->size.z = 10.0f; // how is this useful? + gdgt->size.z = 10.0f; // how is this useful? return gdgt; } /* 23A32C -> 23A3E4 */ -void set_objvalue(union ObjVarVal *src, enum ValPtrType type, void *base, size_t offset) { - union ObjVarVal *dst = (void *) ((u8 *) base + offset); +void set_objvalue(union ObjVarVal* src, enum ValPtrType type, void* base, size_t offset) { + union ObjVarVal* dst = (void*)((u8*)base + offset); switch (type) { case OBJ_VALUE_INT: dst->i = src->i; @@ -160,7 +159,7 @@ void set_objvalue(union ObjVarVal *src, enum ValPtrType type, void *base, size_t } /* 23A3E4 -> 23A488; orig name: Unknown8018BD54 */ -void set_static_gdgt_value(struct ObjValPtr *vp) { +void set_static_gdgt_value(struct ObjValPtr* vp) { switch (vp->datatype) { case OBJ_VALUE_FLOAT: set_objvalue(&sCurGadgetPtr->varval, OBJ_VALUE_FLOAT, vp->obj, vp->offset); @@ -172,18 +171,18 @@ void set_static_gdgt_value(struct ObjValPtr *vp) { } /* 23A488 -> 23A4D0 */ -static void reset_gadget_default(struct ObjGadget *gdgt) { +static void reset_gadget_default(struct ObjGadget* gdgt) { UNUSED u8 filler[4]; sCurGadgetPtr = gdgt; - apply_to_obj_types_in_group(OBJ_TYPE_VALPTRS, (applyproc_t) set_static_gdgt_value, gdgt->valueGrp); + apply_to_obj_types_in_group(OBJ_TYPE_VALPTRS, (applyproc_t)set_static_gdgt_value, gdgt->valueGrp); } /* 23A4D0 -> 23A784 */ -void adjust_gadget(struct ObjGadget *gdgt, s32 a1, s32 a2) { +void adjust_gadget(struct ObjGadget* gdgt, s32 a1, s32 a2) { UNUSED u8 filler[8]; f32 range; - struct ObjValPtr *vp; + struct ObjValPtr* vp; if (gdgt->type == 1) { gdgt->sliderPos += a2 * (-sCurrentMoveCamera->unk40.z * 1.0E-5); @@ -201,7 +200,7 @@ void adjust_gadget(struct ObjGadget *gdgt, s32 a1, s32 a2) { range = gdgt->rangeMax - gdgt->rangeMin; if (gdgt->valueGrp != NULL) { - vp = (struct ObjValPtr *) gdgt->valueGrp->firstMember->obj; + vp = (struct ObjValPtr*)gdgt->valueGrp->firstMember->obj; switch (vp->datatype) { case OBJ_VALUE_FLOAT: @@ -219,10 +218,10 @@ void adjust_gadget(struct ObjGadget *gdgt, s32 a1, s32 a2) { } /* 23A784 -> 23A940; orig name: Unknown8018BFB4 */ -void reset_gadget(struct ObjGadget *gdgt) { +void reset_gadget(struct ObjGadget* gdgt) { UNUSED u8 filler[8]; f32 range; - struct ObjValPtr *vp; + struct ObjValPtr* vp; if (gdgt->rangeMax - gdgt->rangeMin == 0.0f) { fatal_printf("gadget has zero range (%f -> %f)\n", gdgt->rangeMin, gdgt->rangeMax); @@ -231,7 +230,7 @@ void reset_gadget(struct ObjGadget *gdgt) { range = (f32)(1.0 / (gdgt->rangeMax - gdgt->rangeMin)); if (gdgt->valueGrp != NULL) { - vp = (struct ObjValPtr *) gdgt->valueGrp->firstMember->obj; + vp = (struct ObjValPtr*)gdgt->valueGrp->firstMember->obj; switch (vp->datatype) { case OBJ_VALUE_FLOAT: @@ -249,6 +248,6 @@ void reset_gadget(struct ObjGadget *gdgt) { } /* 23A940 -> 23A980 */ -void reset_gadgets_in_grp(struct ObjGroup *grp) { - apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t) reset_gadget, grp); +void reset_gadgets_in_grp(struct ObjGroup* grp) { + apply_to_obj_types_in_group(OBJ_TYPE_GADGETS, (applyproc_t)reset_gadget, grp); } diff --git a/src/goddard/particles.c b/src/goddard/particles.c index 303e13ea..9d3cf3e9 100644 --- a/src/goddard/particles.c +++ b/src/goddard/particles.c @@ -13,25 +13,24 @@ // static types typedef union { - struct ObjVertex *vtx; - struct ObjParticle *ptc; + struct ObjVertex* vtx; + struct ObjParticle* ptc; } VtxPtc; struct Connection { - struct GdObj header; // this header is never used + struct GdObj header; // this header is never used u8 filler[8]; - VtxPtc node1; // first connected vertex or particle - VtxPtc node2; // second connected vertex or particle + VtxPtc node1; // first connected vertex or particle + VtxPtc node2; // second connected vertex or particle f32 unk24; u32 unk28; // union tag? 0 = vertex; 1 = particle? }; // data -UNUSED static void *sUnused801A81D0 = NULL; +UNUSED static void* sUnused801A81D0 = NULL; static s32 D_801A81D4[25] = { /* ID? X Y Z */ - 9, 3, 12, -14, 25, 5, 16, -25, 42, 4, 15, -39, 55, - -6, 20, -23, 70, -2, 20, -23, 135, 0, 16, 0, 0 /* Terminator */ + 9, 3, 12, -14, 25, 5, 16, -25, 42, 4, 15, -39, 55, -6, 20, -23, 70, -2, 20, -23, 135, 0, 16, 0, 0 /* Terminator */ }; static s32 D_801A8238[5] = { /* ID? X Y Z */ @@ -39,23 +38,23 @@ static s32 D_801A8238[5] = { }; // static bss -static struct ObjFace *D_801B9EF0; +static struct ObjFace* D_801B9EF0; // fn declarations -struct Connection *make_connection(struct ObjVertex *, struct ObjVertex *); -void Unknown80181D14(struct ObjFace *); -void func_80181EB0(struct Connection *); -void func_80182088(struct Connection *); -void move_particle(struct ObjParticle *); -struct Connection *make_connection(struct ObjVertex *, struct ObjVertex *); -int func_80182778(struct ObjParticle *); -void func_80182A08(struct ObjParticle *, struct GdVec3f *b); -void func_801838D0(struct ObjParticle *); -void Unknown801835C8(struct ObjParticle *ptc); +struct Connection* make_connection(struct ObjVertex*, struct ObjVertex*); +void Unknown80181D14(struct ObjFace*); +void func_80181EB0(struct Connection*); +void func_80182088(struct Connection*); +void move_particle(struct ObjParticle*); +struct Connection* make_connection(struct ObjVertex*, struct ObjVertex*); +int func_80182778(struct ObjParticle*); +void func_80182A08(struct ObjParticle*, struct GdVec3f* b); +void func_801838D0(struct ObjParticle*); +void Unknown801835C8(struct ObjParticle* ptc); -static void connect_vertices(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { - struct Connection *newConn; - register struct ListNode *link; +static void connect_vertices(struct ObjVertex* vtx1, struct ObjVertex* vtx2) { + struct Connection* newConn; + register struct ListNode* link; if (vtx1 == vtx2) { return; @@ -63,10 +62,10 @@ static void connect_vertices(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { link = gGdSkinNet->unk1C0->firstMember; while (link != NULL) { // FIXME: types - struct Connection *conn = (struct Connection *) link->obj; + struct Connection* conn = (struct Connection*)link->obj; - if ((conn->node1.vtx == vtx1 || conn->node1.vtx == vtx2) - && (conn->node2.vtx == vtx1 || conn->node2.vtx == vtx2)) { + if ((conn->node1.vtx == vtx1 || conn->node1.vtx == vtx2) && + (conn->node2.vtx == vtx1 || conn->node2.vtx == vtx2)) { break; } link = link->next; @@ -79,11 +78,11 @@ static void connect_vertices(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { } /* 2304E4 -> 230680 */ -void Unknown80181D14(struct ObjFace *face) { +void Unknown80181D14(struct ObjFace* face) { s32 i; s32 j; - struct ObjVertex *vtx1; - struct ObjVertex *vtx2; + struct ObjVertex* vtx1; + struct ObjVertex* vtx2; for (i = 0; i < face->vtxCount - 1; i++) { vtx1 = face->vertices[i]; @@ -103,11 +102,11 @@ void Unknown80181D14(struct ObjFace *face) { } /* 230680 -> 230858 */ -void func_80181EB0(struct Connection *cxn) { +void func_80181EB0(struct Connection* cxn) { struct GdVec3f sp34; UNUSED u8 filler[44]; - struct ObjParticle *sp4 = cxn->node1.ptc; - struct ObjParticle *sp0 = cxn->node2.ptc; + struct ObjParticle* sp4 = cxn->node1.ptc; + struct ObjParticle* sp0 = cxn->node2.ptc; sp34.x = 0.0f; sp34.y = sp4->pos.y - sp0->pos.y; @@ -132,13 +131,13 @@ void func_80181EB0(struct Connection *cxn) { } /* @ 230858 -> 230B70 */ -void func_80182088(struct Connection *cxn) { +void func_80182088(struct Connection* cxn) { struct GdVec3f sp4C; UNUSED u8 filler[36]; f32 sp24; f32 sp20; - struct ObjParticle *sp1C; - struct ObjParticle *sp18; + struct ObjParticle* sp1C; + struct ObjParticle* sp18; if (cxn->unk28 & 1) { func_80181EB0(cxn); @@ -176,9 +175,9 @@ void func_80182088(struct Connection *cxn) { } /* 230B70 -> 230CC0 */ -void func_801823A0(struct ObjNet *net) { - register struct ListNode *link; - struct Connection *cxn; +void func_801823A0(struct ObjNet* net) { + register struct ListNode* link; + struct Connection* cxn; gGdSkinNet = net; switch (net->unk3C) { @@ -187,27 +186,26 @@ void func_801823A0(struct ObjNet *net) { net->unk1C0 = make_group(0); D_801B9EF0 = NULL; - apply_to_obj_types_in_group(OBJ_TYPE_FACES, (applyproc_t) Unknown80181D14, - net->shapePtr->faceGroup); + apply_to_obj_types_in_group(OBJ_TYPE_FACES, (applyproc_t)Unknown80181D14, net->shapePtr->faceGroup); net->unk3C = 2; break; case 2: link = net->unk1C0->firstMember; while (link != NULL) { // FIXME: types - cxn = (struct Connection *) link->obj; + cxn = (struct Connection*)link->obj; func_80182088(cxn); link = link->next; } - apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t) move_particle, net->unk1C8); - apply_to_obj_types_in_group(OBJ_TYPE_PLANES, (applyproc_t) reset_plane, net->unk1CC); + apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t)move_particle, net->unk1C8); + apply_to_obj_types_in_group(OBJ_TYPE_PLANES, (applyproc_t)reset_plane, net->unk1CC); break; } } /* 230CC0 -> 230DCC */ -struct ObjParticle *make_particle(u32 flags, s32 colourNum, f32 x, f32 y, f32 z) { - struct ObjParticle *particle = (struct ObjParticle *) make_object(OBJ_TYPE_PARTICLES); +struct ObjParticle* make_particle(u32 flags, s32 colourNum, f32 x, f32 y, f32 z) { + struct ObjParticle* particle = (struct ObjParticle*)make_object(OBJ_TYPE_PARTICLES); UNUSED u8 filler[8]; particle->pos.x = x; @@ -224,8 +222,8 @@ struct ObjParticle *make_particle(u32 flags, s32 colourNum, f32 x, f32 y, f32 z) } /* 230DCC -> 230F48 */ -struct Connection *make_connection(struct ObjVertex *vtx1, struct ObjVertex *vtx2) { - struct Connection *conn = gd_malloc_perm(sizeof(struct Connection)); +struct Connection* make_connection(struct ObjVertex* vtx1, struct ObjVertex* vtx2) { + struct Connection* conn = gd_malloc_perm(sizeof(struct Connection)); struct GdVec3f sp28; struct GdVec3f sp1C; @@ -235,9 +233,9 @@ struct Connection *make_connection(struct ObjVertex *vtx1, struct ObjVertex *vtx conn->node1.vtx = vtx1; conn->node2.vtx = vtx2; d_stash_dynobj(); - set_cur_dynobj((struct GdObj *)vtx1); + set_cur_dynobj((struct GdObj*)vtx1); d_get_world_pos(&sp28); - set_cur_dynobj((struct GdObj *)vtx2); + set_cur_dynobj((struct GdObj*)vtx2); d_get_world_pos(&sp1C); sp28.x -= sp1C.x; sp28.y -= sp1C.y; @@ -246,7 +244,7 @@ struct Connection *make_connection(struct ObjVertex *vtx1, struct ObjVertex *vtx // Duplicate conditional. Possibly should've checked `vtx2`; // Also, this shouldn't be called with particle types... if (vtx1->header.type == OBJ_TYPE_PARTICLES && vtx1->header.type == OBJ_TYPE_PARTICLES) { - if ((((struct ObjParticle *) vtx1)->flags & 4) && (((struct ObjParticle *) vtx2)->flags & 4)) { + if ((((struct ObjParticle*)vtx1)->flags & 4) && (((struct ObjParticle*)vtx2)->flags & 4)) { conn->unk28 |= 1; } } @@ -255,7 +253,7 @@ struct Connection *make_connection(struct ObjVertex *vtx1, struct ObjVertex *vtx } /* 230F48 -> 2311D8 */ -int func_80182778(struct ObjParticle *ptc) { +int func_80182778(struct ObjParticle* ptc) { s32 sp4 = 0; if (ptc->unk7C->animSeqNum == 2 && ptc->unk74 == 1) { @@ -284,15 +282,15 @@ int func_80182778(struct ObjParticle *ptc) { } /* 2311D8 -> 231454 */ -void func_80182A08(struct ObjParticle *ptc, struct GdVec3f *b) { - register struct ListNode *link; - struct ObjParticle *sp20; +void func_80182A08(struct ObjParticle* ptc, struct GdVec3f* b) { + register struct ListNode* link; + struct ObjParticle* sp20; if (ptc->subParticlesGrp != NULL) { link = ptc->subParticlesGrp->firstMember; while (link != NULL) { // FIXME: types - sp20 = (struct ObjParticle *) link->obj; + sp20 = (struct ObjParticle*)link->obj; if (sp20->timeout <= 0) { sp20->pos.x = ptc->pos.x; sp20->pos.y = ptc->pos.y; @@ -315,15 +313,15 @@ void func_80182A08(struct ObjParticle *ptc, struct GdVec3f *b) { } /* 231454 -> 231D40; orig name: Unknown80182C84 */ -void move_particle(struct ObjParticle *ptc) { +void move_particle(struct ObjParticle* ptc) { f32 sp7C; UNUSED u8 filler1[12]; struct GdVec3f sp64; - struct ObjParticle *sp60; + struct ObjParticle* sp60; UNUSED u8 filler2[4]; s32 i; UNUSED u8 filler3[8]; - struct ObjCamera *sp4C; + struct ObjCamera* sp4C; struct GdVec3f sp40; struct GdVec3f sp34; @@ -345,7 +343,7 @@ void move_particle(struct ObjParticle *ptc) { set_cur_dynobj(ptc->attachedToObj); if (ptc->unk60 == 3) { if (ptc->unk64 == 3) { - sp4C = (struct ObjCamera *) ptc->attachedToObj; + sp4C = (struct ObjCamera*)ptc->attachedToObj; // Camera->unk18C = ObjView here if (sp4C->unk18C->pickedObj != NULL) { set_cur_dynobj(sp4C->unk18C->pickedObj); @@ -407,7 +405,7 @@ void move_particle(struct ObjParticle *ptc) { switch (ptc->unk64) { case 1: if (func_80182778(ptc) && ptc->subParticlesGrp != NULL) { - register struct ListNode *link; + register struct ListNode* link; if (ptc->unk80 != NULL) { ptc->unk80->unk3C |= 1; @@ -417,7 +415,7 @@ void move_particle(struct ObjParticle *ptc) { } link = ptc->subParticlesGrp->firstMember; while (link != NULL) { - struct ObjParticle *sp2C = (struct ObjParticle *) link->obj; + struct ObjParticle* sp2C = (struct ObjParticle*)link->obj; sp2C->pos.x = ptc->pos.x; sp2C->pos.y = ptc->pos.y; @@ -445,7 +443,7 @@ void move_particle(struct ObjParticle *ptc) { func_80182A08(ptc, &sp34); break; } - apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t) move_particle, ptc->subParticlesGrp); + apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t)move_particle, ptc->subParticlesGrp); } if (ptc->timeout >= 0) { if (ptc->timeout-- <= 0) { @@ -456,25 +454,25 @@ void move_particle(struct ObjParticle *ptc) { } /* 231D40 -> 231D98; orig name: func_80183570 */ -void move_particles_in_grp(struct ObjGroup *group) { +void move_particles_in_grp(struct ObjGroup* group) { start_timer("particles"); gGdSkinNet = NULL; - apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t) move_particle, group); + apply_to_obj_types_in_group(OBJ_TYPE_PARTICLES, (applyproc_t)move_particle, group); stop_timer("particles"); } #define ABS(x) ((x) < 0.0f ? -(x) : (x)) /* 231D98 -> 232040 */ -void Unknown801835C8(struct ObjParticle *ptc) { +void Unknown801835C8(struct ObjParticle* ptc) { struct GdVec3f sp54; f32 sp50; - register struct ListNode *link; + register struct ListNode* link; gd_printf("p(%d)=", ptc->attachedObjsGrp->memberCount); link = ptc->attachedObjsGrp->firstMember; while (link != NULL) { // FIXME: types - struct ObjParticle *sp48 = (struct ObjParticle *) link->obj; + struct ObjParticle* sp48 = (struct ObjParticle*)link->obj; sp54.x = sp48->pos.x - ptc->pos.x; sp54.y = sp48->pos.y - ptc->pos.y; @@ -518,8 +516,7 @@ void stub_particles_4(UNUSED s32 a, UNUSED s32 b, UNUSED s32 c) { } /* 2320A0 -> 2320D4; pad to 2320E0 */ -void func_801838D0(struct ObjParticle *ptc) { +void func_801838D0(struct ObjParticle* ptc) { D_801B9E3C = ptc; - if (ptc->pos.y < -15.0f) { - } + if (ptc->pos.y < -15.0f) {} } diff --git a/src/goddard/renderer.c b/src/goddard/renderer.c index dfa5d49e..09db2b1e 100644 --- a/src/goddard/renderer.c +++ b/src/goddard/renderer.c @@ -28,45 +28,45 @@ #define GD_LOWER_24(addr) ((uintptr_t)(addr)) #define GD_LOWER_29(addr) (((uintptr_t)(addr))) -#define MTX_INTPART_PACK(w1, w2) (((w1) &0xFFFF0000) | (((w2) >> 16) & 0xFFFF)) -#define MTX_FRACPART_PACK(w1, w2) ((((w1) << 16) & 0xFFFF0000) | ((w2) &0xFFFF)) -#define LOOKAT_PACK(c) ((s32) MIN(((c) * (128.0)), 127.0) & 0xff) +#define MTX_INTPART_PACK(w1, w2) (((w1) & 0xFFFF0000) | (((w2) >> 16) & 0xFFFF)) +#define MTX_FRACPART_PACK(w1, w2) ((((w1) << 16) & 0xFFFF0000) | ((w2) & 0xFFFF)) +#define LOOKAT_PACK(c) ((s32)MIN(((c) * (128.0)), 127.0) & 0xff) // structs struct GdDisplayList { /* Vertices */ /*0x00*/ s32 curVtxIdx; /*0x04*/ s32 totalVtx; - /*0x08*/ Vtx *vtx; + /*0x08*/ Vtx* vtx; /* Matrices */ /*0x0C*/ s32 curMtxIdx; /*0x10*/ s32 totalMtx; - /*0x14*/ Mtx *mtx; + /*0x14*/ Mtx* mtx; /* Lights */ /*0x18*/ s32 curLightIdx; /*0x1C*/ s32 totalLights; - /*0x20*/ Lights4 *light; + /*0x20*/ Lights4* light; /* Gfx-es */ /*0x24*/ s32 curGfxIdx; /*0x28*/ s32 totalGfx; - /*0x2C*/ Gfx *gfx; // active position in DL - /*0x30*/ Gfx **dlptr; // pointer to list/array of display lists for each frame? + /*0x2C*/ Gfx* gfx; // active position in DL + /*0x30*/ Gfx** dlptr; // pointer to list/array of display lists for each frame? /* Viewports */ /*0x34*/ s32 curVpIdx; /*0x38*/ s32 totalVp; - /*0x3C*/ Vp *vp; + /*0x3C*/ Vp* vp; /* GD DL Info */ /*0x40*/ u32 id; // user specified /*0x44*/ u32 number; // count /*0x48*/ u8 filler[4]; - /*0x4C*/ struct GdDisplayList *parent; // not quite sure? -}; /* sizeof = 0x50 */ + /*0x4C*/ struct GdDisplayList* parent; // not quite sure? +}; /* sizeof = 0x50 */ // accessor macros for gd dl -#define DL_CURRENT_VTX(dl) ((dl)->vtx[(dl)->curVtxIdx]) -#define DL_CURRENT_MTX(dl) ((dl)->mtx[(dl)->curMtxIdx]) +#define DL_CURRENT_VTX(dl) ((dl)->vtx[(dl)->curVtxIdx]) +#define DL_CURRENT_MTX(dl) ((dl)->mtx[(dl)->curMtxIdx]) #define DL_CURRENT_LIGHT(dl) ((dl)->light[(dl)->curLightIdx]) -#define DL_CURRENT_GFX(dl) ((dl)->gfx[(dl)->curGfxIdx]) -#define DL_CURRENT_VP(dl) ((dl)->vp[(dl)->curVpIdx]) +#define DL_CURRENT_GFX(dl) ((dl)->gfx[(dl)->curGfxIdx]) +#define DL_CURRENT_VP(dl) ((dl)->vp[(dl)->curVpIdx]) struct LightDirVec { s32 x, y, z; @@ -76,7 +76,7 @@ enum DynListBankFlag { TABLE_END = -1, STD_LIST_BANK = 3 }; struct DynListBankInfo { /* 0x00 */ enum DynListBankFlag flag; - /* 0x04 */ struct DynList *list; + /* 0x04 */ struct DynList* list; }; // bss @@ -94,7 +94,7 @@ static OSMesg sGdMesgBuf[1]; // @ 801BE944 u8 EUpad3[0x34]; static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue static OSIoMesg sGdDMAReqMesg; -static struct ObjView *D_801BE994; // store if View flag 0x40 set +static struct ObjView* D_801BE994; // store if View flag 0x40 set u8 EUpad4[0x88]; #endif @@ -102,36 +102,36 @@ static OSContStatus D_801BAE60[4]; static OSContPad sGdContPads[4]; // @ 801BAE70 static OSContPad sPrevFrameCont[4]; // @ 801BAE88 static u8 D_801BAEA0; -static struct ObjGadget *sTimerGadgets[GD_NUM_TIMERS]; // @ 801BAEA8 +static struct ObjGadget* sTimerGadgets[GD_NUM_TIMERS]; // @ 801BAEA8 static u32 D_801BAF28; // RAM addr offset? -static s16 sTriangleBuf[13][8]; // [[s16; 8]; 13]? vert indices? +static s16 sTriangleBuf[13][8]; // [[s16; 8]; 13]? vert indices? UNUSED static u32 unref_801bb000[3]; -static u8 *sMemBlockPoolBase; // @ 801BB00C +static u8* sMemBlockPoolBase; // @ 801BB00C static u32 sAllocMemory; // @ 801BB010; malloc-ed bytes UNUSED static u32 unref_801bb014; static s32 D_801BB018; static s32 D_801BB01C; -static void *sLoadedTextures[0x10]; // texture pointers -static s32 sTextureDisplayLists[0x10]; // gd_dl indices +static void* sLoadedTextures[0x10]; // texture pointers +static s32 sTextureDisplayLists[0x10]; // gd_dl indices static s16 sVtxCvrtTCBuf[2]; // @ 801BB0A0 static s32 sCarGdDlNum; // @ 801BB0A4 -static struct ObjGroup *sYoshiSceneGrp; // @ 801BB0A8 -static s32 unusedDl801BB0AC; // unused DL number -static struct ObjGroup *sMarioSceneGrp; // @ 801BB0B0 +static struct ObjGroup* sYoshiSceneGrp; // @ 801BB0A8 +static s32 unusedDl801BB0AC; // unused DL number +static struct ObjGroup* sMarioSceneGrp; // @ 801BB0B0 static s32 D_801BB0B4; // second offset into sTriangleBuf -static struct ObjGroup *sCarSceneGrp; // @ 801BB0B8 -static s32 sVertexBufCount; // vtx's to load into RPD? Vtx len in GD Dl and in the lower bank (AF30) -static struct ObjView *sYoshiSceneView; // @ 801BB0C0 -static s32 sTriangleBufCount; // number of triangles in sTriangleBuf -static struct ObjView *sMSceneView; // @ 801BB0C8; Mario scene view -static s32 sVertexBufStartIndex; // Vtx start in GD Dl -static struct ObjView *sCarSceneView; // @ 801BB0D0 +static struct ObjGroup* sCarSceneGrp; // @ 801BB0B8 +static s32 sVertexBufCount; // vtx's to load into RPD? Vtx len in GD Dl and in the lower bank (AF30) +static struct ObjView* sYoshiSceneView; // @ 801BB0C0 +static s32 sTriangleBufCount; // number of triangles in sTriangleBuf +static struct ObjView* sMSceneView; // @ 801BB0C8; Mario scene view +static s32 sVertexBufStartIndex; // Vtx start in GD Dl +static struct ObjView* sCarSceneView; // @ 801BB0D0 static s32 sUpdateYoshiScene; // @ 801BB0D4; update dl Vtx from ObjVertex? static s32 sUpdateMarioScene; // @ 801BB0D8; update dl Vtx from ObjVertex? UNUSED static u32 unref_801bb0dc; static s32 sUpdateCarScene; // @ 801BB0E0; guess, not really used UNUSED static u32 unref_801bb0e4; -static struct GdVec3f sTextDrawPos; // position to draw text? only set in one function, never used +static struct GdVec3f sTextDrawPos; // position to draw text? only set in one function, never used UNUSED static u32 unref_801bb0f8[2]; static Mtx sIdnMtx; // @ 801BB100 static Mat4f sInitIdnMat4; // @ 801BB140 @@ -146,17 +146,18 @@ static Hilite sHilites[600]; static struct GdVec3f D_801BD758; static struct GdVec3f D_801BD768; // had to migrate earlier static u32 D_801BD774; -static struct GdObj *sMenuGadgets[9]; // @ 801BD778; d_obj ptr storage? menu? -static struct ObjView *sDebugViews[2]; // Seems to be a list of ObjViews for displaying debug info -static struct GdDisplayList *sStaticDl; // @ 801BD7A8 -static struct GdDisplayList *sDynamicMainDls[2]; // @ 801BD7B0 -static struct GdDisplayList *sGdDlStash; // @ 801BD7B8 -static struct GdDisplayList *sMHeadMainDls[2]; // @ 801BD7C0; two DLs, double buffered one per frame - seem to be basic dls that branch to actual lists? -static struct GdDisplayList *sViewDls[3][2]; // I guess? 801BD7C8 -> 801BD7E0? -static struct GdDisplayList *sGdDLArray[MAX_GD_DLS]; // @ 801BD7E0; indexed by dl number (gddl+0x44) +static struct GdObj* sMenuGadgets[9]; // @ 801BD778; d_obj ptr storage? menu? +static struct ObjView* sDebugViews[2]; // Seems to be a list of ObjViews for displaying debug info +static struct GdDisplayList* sStaticDl; // @ 801BD7A8 +static struct GdDisplayList* sDynamicMainDls[2]; // @ 801BD7B0 +static struct GdDisplayList* sGdDlStash; // @ 801BD7B8 +static struct GdDisplayList* sMHeadMainDls[2]; // @ 801BD7C0; two DLs, double buffered one per frame - seem to be basic + // dls that branch to actual lists? +static struct GdDisplayList* sViewDls[3][2]; // I guess? 801BD7C8 -> 801BD7E0? +static struct GdDisplayList* sGdDLArray[MAX_GD_DLS]; // @ 801BD7E0; indexed by dl number (gddl+0x44) static s32 sPickBufLen; // @ 801BE780 static s32 sPickBufPosition; // @ 801BE784 -static s16 *sPickBuf; // @ 801BE788 +static s16* sPickBuf; // @ 801BE788 static LookAt D_801BE790[2]; static LookAt D_801BE7D0[3]; #if defined(VERSION_US) @@ -170,7 +171,7 @@ static OSMesg sGdMesgBuf[1]; // @ 801BE944 UNUSED static u32 unref_801be948[13]; static OSMesg sGdDMACompleteMsg; // msg buf for D_801BE8B0 queue static OSIoMesg sGdDMAReqMesg; -static struct ObjView *D_801BE994; // store if View flag 0x40 set +static struct ObjView* D_801BE994; // store if View flag 0x40 set #endif // data @@ -179,35 +180,35 @@ static s32 D_801A8674 = 0; UNUSED static u32 unref_801a8678 = 0; static s32 D_801A867C = 0; static s32 D_801A8680 = 0; -static f32 sTracked1FrameTime = 0.0f; // @ 801A8684 -static f32 sDynamicsTime = 0.0f; // @ 801A8688 -static f32 sDLGenTime = 0.0f; // @ 801A868C -static f32 sRCPTime = 0.0f; // @ 801A8690 -static f32 sTimeScaleFactor = 1.0f; // @ D_801A8694 -static u32 sMemBlockPoolSize = 1; // @ 801A8698 -static s32 sMemBlockPoolUsed = 0; // @ 801A869C -static s32 sTextureCount = 0; // maybe? -static struct GdTimer *D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp -static struct GdTimer *D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp -static struct GdTimer *D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp -s32 gGdFrameBufNum = 0; // @ 801A86B0 +static f32 sTracked1FrameTime = 0.0f; // @ 801A8684 +static f32 sDynamicsTime = 0.0f; // @ 801A8688 +static f32 sDLGenTime = 0.0f; // @ 801A868C +static f32 sRCPTime = 0.0f; // @ 801A8690 +static f32 sTimeScaleFactor = 1.0f; // @ D_801A8694 +static u32 sMemBlockPoolSize = 1; // @ 801A8698 +static s32 sMemBlockPoolUsed = 0; // @ 801A869C +static s32 sTextureCount = 0; // maybe? +static struct GdTimer* D_801A86A4 = NULL; // timer for dlgen, dynamics, or rcp +static struct GdTimer* D_801A86A8 = NULL; // timer for dlgen, dynamics, or rcp +static struct GdTimer* D_801A86AC = NULL; // timer for dlgen, dynamics, or rcp +s32 gGdFrameBufNum = 0; // @ 801A86B0 UNUSED static u32 unref_801a86B4 = 0; -static struct ObjShape *sHandShape = NULL; // @ 801A86B8 +static struct ObjShape* sHandShape = NULL; // @ 801A86B8 static s32 D_801A86BC = 1; static s32 D_801A86C0 = 0; // gd_dl id for something? UNUSED static u32 unref_801a86C4 = 10; static s32 sMtxParamType = G_MTX_PROJECTION; static struct GdVec3f D_801A86CC = { 1.0f, 1.0f, 1.0f }; -static struct ObjView *sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl -static struct ObjView *sScreenView = NULL; // @ 801A86DC -static struct ObjView *D_801A86E0 = NULL; -static struct ObjView *sHandView = NULL; // @ 801A86E4 -static struct ObjView *sMenuView = NULL; // @ 801A86E8 +static struct ObjView* sActiveView = NULL; // @ 801A86D8 current view? used when drawing dl +static struct ObjView* sScreenView = NULL; // @ 801A86DC +static struct ObjView* D_801A86E0 = NULL; +static struct ObjView* sHandView = NULL; // @ 801A86E4 +static struct ObjView* sMenuView = NULL; // @ 801A86E8 static u32 sItemsInMenu = 0; // @ 801A86EC -static s32 sDebugViewsCount = 0; // number of elements in the sDebugViews array -static s32 sCurrDebugViewIndex = 0; // @ 801A86F4; timing activate cool down counter? +static s32 sDebugViewsCount = 0; // number of elements in the sDebugViews array +static s32 sCurrDebugViewIndex = 0; // @ 801A86F4; timing activate cool down counter? UNUSED static u32 unref_801a86F8 = 0; -static struct GdDisplayList *sCurrentGdDl = NULL; // @ 801A86FC +static struct GdDisplayList* sCurrentGdDl = NULL; // @ 801A86FC static u32 sGdDlCount = 0; // @ 801A8700 static struct DynListBankInfo sDynLists[] = { // @ 801A8704 { STD_LIST_BANK, dynlist_test_cube }, @@ -217,15 +218,14 @@ static struct DynListBankInfo sDynLists[] = { // @ 801A8704 }; // textures and display list data -UNUSED static Gfx gd_texture1_dummy_aligner1[] = { // @ 801A8728 +UNUSED static Gfx gd_texture1_dummy_aligner1[] = { + // @ 801A8728 gsSPEndDisplayList(), }; ALIGNED8 static Texture gd_texture_hand_open[] = "__OTR__textures/intro_raw/hand_open"; -UNUSED static Gfx gd_texture2_dummy_aligner1[] = { - gsSPEndDisplayList() -}; +UNUSED static Gfx gd_texture2_dummy_aligner1[] = { gsSPEndDisplayList() }; ALIGNED8 static Texture gd_texture_hand_closed[] = "__OTR__textures/intro_raw/hand_closed"; @@ -262,18 +262,18 @@ ALIGNED8 static Texture gd_texture_white_star_6[] = "__OTR__textures/intro_raw/w ALIGNED8 static Texture gd_texture_white_star_7[] = "__OTR__textures/intro_raw/white_star_7"; static Vtx_t gd_vertex_star[] = { - {{-64, 0, 0}, 0, { 0, 992}, {0x00, 0x00, 0x7F}}, - {{ 64, 0, 0}, 0, {992, 992}, {0x00, 0x00, 0x7F}}, - {{ 64, 128, 0}, 0, {992, 0}, {0x00, 0x00, 0x7F}}, - {{-64, 128, 0}, 0, { 0, 0}, {0x00, 0x00, 0x7F}}, + { { -64, 0, 0 }, 0, { 0, 992 }, { 0x00, 0x00, 0x7F } }, + { { 64, 0, 0 }, 0, { 992, 992 }, { 0x00, 0x00, 0x7F } }, + { { 64, 128, 0 }, 0, { 992, 0 }, { 0x00, 0x00, 0x7F } }, + { { -64, 128, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x7F } }, }; //! no references to these vertices UNUSED static Vtx_t gd_unused_vertex[] = { - {{16384, 0, 0}, 0, {0, 16384}, {0x00, 0x00, 0x00}}, - {{ 0, 0, 16384}, 0, {0, 0}, {0x00, 0x00, 0x40}}, - {{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}}, - {{ 0, 0, 0}, 0, {0, 0}, {0x00, 0x00, 0x00}}, + { { 16384, 0, 0 }, 0, { 0, 16384 }, { 0x00, 0x00, 0x00 } }, + { { 0, 0, 16384 }, 0, { 0, 0 }, { 0x00, 0x00, 0x40 } }, + { { 0, 0, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x00 } }, + { { 0, 0, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x00 } }, }; static Gfx gd_dl_star_common[] = { @@ -281,13 +281,15 @@ static Gfx gd_dl_star_common[] = { gsSPClearGeometryMode(G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR), gsDPSetRenderMode(G_RM_AA_ZB_TEX_EDGE, G_RM_NOOP2), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 0, 0, G_TX_LOADTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, + G_TX_NOLOD), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, G_TX_NOLOD), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_CLAMP, 5, G_TX_NOLOD, G_TX_CLAMP, 5, + G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPVertex(gd_vertex_star, 4, 0), - gsSP2Triangles( 0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSP2Triangles(0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_OFF), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2), @@ -390,42 +392,17 @@ static Gfx gd_dl_silver_star_7[] = { gsSPBranchList(gd_dl_star_common), }; -static Gfx *gd_red_star_dl_array[] = { - gd_dl_red_star_0, - gd_dl_red_star_0, - gd_dl_red_star_1, - gd_dl_red_star_1, - gd_dl_red_star_2, - gd_dl_red_star_2, - gd_dl_red_star_3, - gd_dl_red_star_3, - gd_dl_red_star_4, - gd_dl_red_star_4, - gd_dl_red_star_5, - gd_dl_red_star_5, - gd_dl_red_star_6, - gd_dl_red_star_6, - gd_dl_red_star_7, - gd_dl_red_star_7, +static Gfx* gd_red_star_dl_array[] = { + gd_dl_red_star_0, gd_dl_red_star_0, gd_dl_red_star_1, gd_dl_red_star_1, gd_dl_red_star_2, gd_dl_red_star_2, + gd_dl_red_star_3, gd_dl_red_star_3, gd_dl_red_star_4, gd_dl_red_star_4, gd_dl_red_star_5, gd_dl_red_star_5, + gd_dl_red_star_6, gd_dl_red_star_6, gd_dl_red_star_7, gd_dl_red_star_7, }; -static Gfx *gd_silver_star_dl_array[] = { - gd_dl_silver_star_0, - gd_dl_silver_star_0, - gd_dl_silver_star_1, - gd_dl_silver_star_1, - gd_dl_silver_star_2, - gd_dl_silver_star_2, - gd_dl_silver_star_3, - gd_dl_silver_star_3, - gd_dl_silver_star_4, - gd_dl_silver_star_4, - gd_dl_silver_star_5, - gd_dl_silver_star_5, - gd_dl_silver_star_6, - gd_dl_silver_star_6, - gd_dl_silver_star_7, - gd_dl_silver_star_7, +static Gfx* gd_silver_star_dl_array[] = { + gd_dl_silver_star_0, gd_dl_silver_star_0, gd_dl_silver_star_1, gd_dl_silver_star_1, + gd_dl_silver_star_2, gd_dl_silver_star_2, gd_dl_silver_star_3, gd_dl_silver_star_3, + gd_dl_silver_star_4, gd_dl_silver_star_4, gd_dl_silver_star_5, gd_dl_silver_star_5, + gd_dl_silver_star_6, gd_dl_silver_star_6, gd_dl_silver_star_7, gd_dl_silver_star_7, }; ALIGNED8 static Texture gd_texture_sparkle_0[] = "__OTR__textures/intro_raw/sparkle_0"; @@ -439,10 +416,10 @@ ALIGNED8 static Texture gd_texture_sparkle_3[] = "__OTR__textures/intro_raw/spar ALIGNED8 static Texture gd_texture_sparkle_4[] = "__OTR__textures/intro_raw/sparkle_4"; static Vtx_t gd_vertex_sparkle[] = { - {{ -32, 0, 0}, 0, { 0, 1984}, { 0x00, 0x00, 0x7F, 0x00}}, - {{ 32, 0, 0}, 0, { 1984, 1984}, { 0x00, 0x00, 0x7F, 0x00}}, - {{ 32, 64, 0}, 0, { 1984, 0}, { 0x00, 0x00, 0x7F, 0x00}}, - {{ -32, 64, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x7F, 0x00}}, + { { -32, 0, 0 }, 0, { 0, 1984 }, { 0x00, 0x00, 0x7F, 0x00 } }, + { { 32, 0, 0 }, 0, { 1984, 1984 }, { 0x00, 0x00, 0x7F, 0x00 } }, + { { 32, 64, 0 }, 0, { 1984, 0 }, { 0x00, 0x00, 0x7F, 0x00 } }, + { { -32, 64, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x7F, 0x00 } }, }; static Gfx gd_dl_sparkle[] = { @@ -454,11 +431,11 @@ static Gfx gd_dl_sparkle[] = { G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), gsDPLoadSync(), gsDPLoadBlock(G_TX_LOADTILE, 0, 0, 32 * 32 - 1, CALC_DXT(32, G_IM_SIZ_16b_BYTES)), - gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), + gsDPSetTile(G_IM_FMT_RGBA, G_IM_SIZ_16b, 8, 0, G_TX_RENDERTILE, 0, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, + G_TX_NOLOD, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOLOD), gsDPSetTileSize(0, 0, 0, (32 - 1) << G_TEXTURE_IMAGE_FRAC, (32 - 1) << G_TEXTURE_IMAGE_FRAC), gsSPVertex(gd_vertex_sparkle, 4, 0), - gsSP2Triangles(0, 1, 2, 0x0, 0, 2, 3, 0x0), + gsSP2Triangles(0, 1, 2, 0x0, 0, 2, 3, 0x0), gsSPTexture(0x0001, 0x0001, 0, G_TX_RENDERTILE, G_OFF), gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE), gsDPSetRenderMode(G_RM_AA_ZB_OPA_INTER, G_RM_NOOP2), @@ -510,7 +487,7 @@ static Gfx gd_dl_red_sparkle_4[] = { gsSPBranchList(gd_dl_sparkle), }; -static Gfx gd_dl_red_sparkle_4_dup[] ={ +static Gfx gd_dl_red_sparkle_4_dup[] = { gsDPPipeSync(), gsSPDisplayList(gd_dl_sparkle_red_color), gsDPSetTextureImage(G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, gd_texture_sparkle_4), // 4 again, correct texture would be 5 @@ -559,34 +536,16 @@ static Gfx gd_dl_silver_sparkle_4_dup[] = { gsSPBranchList(gd_dl_sparkle), }; -static Gfx *gd_red_sparkle_dl_array[] = { - gd_dl_red_sparkle_4, - gd_dl_red_sparkle_4, - gd_dl_red_sparkle_3, - gd_dl_red_sparkle_3, - gd_dl_red_sparkle_2, - gd_dl_red_sparkle_2, - gd_dl_red_sparkle_1, - gd_dl_red_sparkle_1, - gd_dl_red_sparkle_0, - gd_dl_red_sparkle_0, - gd_dl_red_sparkle_4_dup, - gd_dl_red_sparkle_4_dup, +static Gfx* gd_red_sparkle_dl_array[] = { + gd_dl_red_sparkle_4, gd_dl_red_sparkle_4, gd_dl_red_sparkle_3, gd_dl_red_sparkle_3, + gd_dl_red_sparkle_2, gd_dl_red_sparkle_2, gd_dl_red_sparkle_1, gd_dl_red_sparkle_1, + gd_dl_red_sparkle_0, gd_dl_red_sparkle_0, gd_dl_red_sparkle_4_dup, gd_dl_red_sparkle_4_dup, }; -static Gfx *gd_silver_sparkle_dl_array[] = { - gd_dl_silver_sparkle_4, - gd_dl_silver_sparkle_4, - gd_dl_silver_sparkle_3, - gd_dl_silver_sparkle_3, - gd_dl_silver_sparkle_2, - gd_dl_silver_sparkle_2, - gd_dl_silver_sparkle_1, - gd_dl_silver_sparkle_1, - gd_dl_silver_sparkle_0, - gd_dl_silver_sparkle_0, - gd_dl_silver_sparkle_4_dup, - gd_dl_silver_sparkle_4_dup, +static Gfx* gd_silver_sparkle_dl_array[] = { + gd_dl_silver_sparkle_4, gd_dl_silver_sparkle_4, gd_dl_silver_sparkle_3, gd_dl_silver_sparkle_3, + gd_dl_silver_sparkle_2, gd_dl_silver_sparkle_2, gd_dl_silver_sparkle_1, gd_dl_silver_sparkle_1, + gd_dl_silver_sparkle_0, gd_dl_silver_sparkle_0, gd_dl_silver_sparkle_4_dup, gd_dl_silver_sparkle_4_dup, }; UNUSED static Gfx gd_texture3_dummy_aligner1[] = { @@ -601,8 +560,8 @@ static Gfx gd_dl_mario_face_shine[] = { gsDPSetTexturePersp(G_TP_PERSP), gsDPSetTextureFilter(G_TF_BILERP), gsDPSetCombineMode(G_CC_HILITERGBA, G_CC_HILITERGBA), - gsDPLoadTextureBlock(gd_texture_mario_face_shine, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, 5, 5, G_TX_NOLOD, G_TX_NOLOD), + gsDPLoadTextureBlock(gd_texture_mario_face_shine, G_IM_FMT_IA, G_IM_SIZ_8b, 32, 32, 0, G_TX_WRAP | G_TX_NOMIRROR, + G_TX_WRAP | G_TX_NOMIRROR, 5, 5, G_TX_NOLOD, G_TX_NOLOD), gsDPPipeSync(), gsSPEndDisplayList(), }; @@ -644,15 +603,15 @@ UNUSED static Gfx gd_texture4_dummy_aligner1[] = { }; static Vtx_t gd_unused_mesh_vertex_group1[] = { - {{-8, 8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, - {{ 8, -2, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, - {{ 2, -8, 0}, 0, { 0, 0}, { 0x00, 0x00, 0x00, 0xFF}}, + { { -8, 8, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x00, 0xFF } }, + { { 8, -2, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x00, 0xFF } }, + { { 2, -8, 0 }, 0, { 0, 0 }, { 0x00, 0x00, 0x00, 0xFF } }, }; static Vtx_t gd_unused_mesh_vertex_group2[] = { - {{-6, 6, 0}, 0, { 0, 0}, { 0xFF, 0xFF, 0xFF, 0xFF}}, - {{ 7, -3, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, - {{ 3, -7, 0}, 0, { 0, 0}, { 0xFF, 0x00, 0x00, 0xFF}}, + { { -6, 6, 0 }, 0, { 0, 0 }, { 0xFF, 0xFF, 0xFF, 0xFF } }, + { { 7, -3, 0 }, 0, { 0, 0 }, { 0xFF, 0x00, 0x00, 0xFF } }, + { { 3, -7, 0 }, 0, { 0, 0 }, { 0xFF, 0x00, 0x00, 0xFF } }, }; UNUSED static Gfx gd_dl_unused_mesh[] = { @@ -662,9 +621,9 @@ UNUSED static Gfx gd_dl_unused_mesh[] = { gsSPSetGeometryMode(G_SHADING_SMOOTH | G_SHADE), gsDPPipeSync(), gsSPVertex(gd_unused_mesh_vertex_group1, 3, 0), - gsSP1Triangle(0, 1, 2, 0x0), + gsSP1Triangle(0, 1, 2, 0x0), gsSPVertex(gd_unused_mesh_vertex_group2, 3, 0), - gsSP1Triangle(0, 1, 2, 0x0), + gsSP1Triangle(0, 1, 2, 0x0), gsSPEndDisplayList(), }; @@ -686,15 +645,15 @@ extern u8 _gd_dynlistsSegmentRomStart[]; extern u8 _gd_dynlistsSegmentRomEnd[]; // forward declarations -u32 new_gddl_from(Gfx *, s32); -void gd_setup_cursor(struct ObjGroup *); +u32 new_gddl_from(Gfx*, s32); +void gd_setup_cursor(struct ObjGroup*); void parse_p1_controller(void); void update_cursor(void); -void update_view_and_dl(struct ObjView *); +void update_view_and_dl(struct ObjView*); static void update_render_mode(void); void gddl_is_loading_shine_dl(s32); void func_801A3370(f32, f32, f32); -void gd_put_sprite(u16 *, s32, s32, s32, s32); +void gd_put_sprite(u16*, s32, s32, s32, s32); void reset_cur_dl_indices(void); // TODO: make a gddl_num_t? @@ -716,16 +675,15 @@ f32 get_time_scale(void) { void dump_disp_list(void) { gd_printf("%d\n", sCurrentGdDl->id); - gd_printf("Vtx=%d/%d, Mtx=%d/%d, Light=%d/%d, Gfx=%d/%d\n", sCurrentGdDl->curVtxIdx, - sCurrentGdDl->totalVtx, sCurrentGdDl->curMtxIdx, sCurrentGdDl->totalMtx, - sCurrentGdDl->curLightIdx, sCurrentGdDl->totalLights, sCurrentGdDl->curGfxIdx, - sCurrentGdDl->totalGfx); + gd_printf("Vtx=%d/%d, Mtx=%d/%d, Light=%d/%d, Gfx=%d/%d\n", sCurrentGdDl->curVtxIdx, sCurrentGdDl->totalVtx, + sCurrentGdDl->curMtxIdx, sCurrentGdDl->totalMtx, sCurrentGdDl->curLightIdx, sCurrentGdDl->totalLights, + sCurrentGdDl->curGfxIdx, sCurrentGdDl->totalGfx); } /** * Increments the current display list's Gfx index list and returns a pointer to the next Gfx element */ -static Gfx *next_gfx(void) { +static Gfx* next_gfx(void) { if (sCurrentGdDl->curGfxIdx >= sCurrentGdDl->totalGfx) { dump_disp_list(); fatal_printf("Gfx list overflow"); @@ -737,7 +695,7 @@ static Gfx *next_gfx(void) { /** * Increments the current display list's Light index list and returns a pointer to the next Light element */ -static Lights4 *next_light(void) { +static Lights4* next_light(void) { if (sCurrentGdDl->curLightIdx >= sCurrentGdDl->totalLights) { dump_disp_list(); fatal_printf("Light list overflow"); @@ -749,7 +707,7 @@ static Lights4 *next_light(void) { /** * Increments the current display list's matrix index list and returns a pointer to the next matrix element */ -static Mtx *next_mtx(void) { +static Mtx* next_mtx(void) { if (sCurrentGdDl->curMtxIdx >= sCurrentGdDl->totalMtx) { dump_disp_list(); fatal_printf("Mtx list overflow"); @@ -761,7 +719,7 @@ static Mtx *next_mtx(void) { /** * Increments the current display list's vertex index list and returns a pointer to the next vertex element */ -static Vtx *next_vtx(void) { +static Vtx* next_vtx(void) { if (sCurrentGdDl->curVtxIdx >= sCurrentGdDl->totalVtx) { dump_disp_list(); fatal_printf("Vtx list overflow"); @@ -773,7 +731,7 @@ static Vtx *next_vtx(void) { /** * Increments the current display list's viewport list and returns a pointer to the next viewport element */ -static Vp *next_vp(void) { +static Vp* next_vp(void) { if (sCurrentGdDl->curVpIdx >= sCurrentGdDl->totalVp) { dump_disp_list(); fatal_printf("Vp list overflow"); @@ -808,15 +766,15 @@ f64 stub_renderer_1(UNUSED f64 x) { } /* 249BCC -> 24A19C */ -void gd_printf(const char *format, ...) { +void gd_printf(const char* format, ...) { s32 i; UNUSED u8 filler1[4]; char c; char f; UNUSED u8 filler2[4]; char buf[0x100]; - char *csr = buf; - char spec[8]; // specifier string + char* csr = buf; + char spec[8]; // specifier string UNUSED u8 filler3[4]; union PrintVal val; va_list args; @@ -861,11 +819,11 @@ void gd_printf(const char *format, ...) { break; break; // needed to match case 'f': - val.f = (f32) va_arg(args, double); + val.f = (f32)va_arg(args, double); csr = sprint_val_withspecifiers(csr, val, spec); break; case 's': - csr = gd_strcat(csr, va_arg(args, char *)); + csr = gd_strcat(csr, va_arg(args, char*)); break; case 'c': //! @bug formatter 'c' uses `s32` for va_arg instead of `char` @@ -875,7 +833,7 @@ void gd_printf(const char *format, ...) { break; default: if (spec[3] == 'f') { - val.f = (f32) va_arg(args, double); + val.f = (f32)va_arg(args, double); csr = sprint_val_withspecifiers(csr, val, spec); } break; @@ -909,24 +867,22 @@ void gd_printf(const char *format, ...) { /* 24A19C -> 24A1D4 */ void gd_exit(UNUSED s32 code) { gd_printf("exit\n"); - while (TRUE) { - } + while (TRUE) {} } /* 24A1D4 -> 24A220; orig name: func_8019BA04 */ -void gd_free(void *ptr) { +void gd_free(void* ptr) { sAllocMemory -= gd_free_mem(ptr); } /* 24A220 -> 24A318 */ -void *gd_allocblock(u32 size) { - void *block; // 1c +void* gd_allocblock(u32 size) { + void* block; // 1c size = ALIGN(size, 8); if ((sMemBlockPoolUsed + size) > sMemBlockPoolSize) { gd_printf("gd_allocblock(): Failed request: %dk (%d bytes)\n", size / 1024, size); - gd_printf("gd_allocblock(): Heap usage: %dk (%d bytes) \n", sMemBlockPoolUsed / 1024, - sMemBlockPoolUsed); + gd_printf("gd_allocblock(): Heap usage: %dk (%d bytes) \n", sMemBlockPoolUsed / 1024, sMemBlockPoolUsed); print_all_memtrackers(); mem_stats(); fatal_printf("exit"); @@ -938,8 +894,8 @@ void *gd_allocblock(u32 size) { } /* 24A318 -> 24A3E8 */ -void *gd_malloc(u32 size, u8 perm) { - void *ptr; // 1c +void* gd_malloc(u32 size, u8 perm) { + void* ptr; // 1c size = ALIGN(size, 8); ptr = gd_request_mem(size, perm); @@ -957,40 +913,40 @@ void *gd_malloc(u32 size, u8 perm) { } /* 24A3E8 -> 24A420; orig name: func_8019BC18 */ -void *gd_malloc_perm(u32 size) { +void* gd_malloc_perm(u32 size) { return gd_malloc(size, PERM_G_MEM_BLOCK); } /* 24A420 -> 24A458; orig name: func_8019BC50 */ -void *gd_malloc_temp(u32 size) { +void* gd_malloc_temp(u32 size) { return gd_malloc(size, TEMP_G_MEM_BLOCK); } /* 24A458 -> 24A4A4 */ -void *Unknown8019BC88(u32 size, u32 count) { +void* Unknown8019BC88(u32 size, u32 count) { return gd_malloc_perm(size * count); } /* 24A4A4 -> 24A4DC */ -void *Unknown8019BCD4(u32 size) { +void* Unknown8019BCD4(u32 size) { return gd_malloc_perm(size); } /* 24A4DC -> 24A598 */ void draw_indexed_dl(s32 dlNum, s32 gfxIdx) { - Gfx *dl; + Gfx* dl; if (gfxIdx != 0) { - dl = sGdDLArray[dlNum]->dlptr[gfxIdx - 1]; // multiple display lists (determined by frame) + dl = sGdDLArray[dlNum]->dlptr[gfxIdx - 1]; // multiple display lists (determined by frame) } else { - dl = sGdDLArray[dlNum]->gfx; // only one display list + dl = sGdDLArray[dlNum]->gfx; // only one display list } gSPDisplayList(next_gfx(), GD_VIRTUAL_TO_PHYSICAL(dl)); } /* 24A598 -> 24A610; orig name: func_8019BDC8 */ void branch_cur_dl_to_num(s32 dlNum) { - Gfx *dl; + Gfx* dl; UNUSED u8 filler[8]; dl = sGdDLArray[dlNum]->gfx; @@ -1000,7 +956,7 @@ void branch_cur_dl_to_num(s32 dlNum) { /** * Unused (not called) */ -Gfx *get_dl_gfx(s32 num) { +Gfx* get_dl_gfx(s32 num) { return sGdDLArray[num]->gfx; } @@ -1070,33 +1026,33 @@ void setup_timers(void) { } /* 24AA40 -> 24AA58 */ -void Unknown8019C270(u8 *buf) { +void Unknown8019C270(u8* buf) { gGdStreamBuffer = buf; } /* 24AA58 -> 24AAA8 */ void Unknown8019C288(s32 stickX, s32 stickY) { - struct GdControl *ctrl = &gGdCtrl; // 4 + struct GdControl* ctrl = &gGdCtrl; // 4 - ctrl->stickXf = (f32) stickX; + ctrl->stickXf = (f32)stickX; ctrl->stickYf = (f32)(stickY / 2); } /* 24AAA8 -> 24AAE0; orig name: func_8019C2D8 */ -void gd_add_to_heap(void *addr, u32 size) { +void gd_add_to_heap(void* addr, u32 size) { // TODO: is this `1` for permanence special? gd_add_mem_to_heap(size, addr, 1); } /* 24AAE0 -> 24AB7C */ -void gdm_init(void *blockpool, u32 size) { +void gdm_init(void* blockpool, u32 size) { UNUSED u8 filler[4]; imin("gdm_init"); // Align downwards? size = (size - 8) & ~7; // Align to next double word boundry? - blockpool = (void *) (((uintptr_t) blockpool + 8) & ~7); + blockpool = (void*)(((uintptr_t)blockpool + 8) & ~7); sMemBlockPoolBase = blockpool; sMemBlockPoolSize = size; sMemBlockPoolUsed = 0; @@ -1141,9 +1097,9 @@ void print_gdm_stats(void) { } /* 24AC80 -> 24AD14; orig name: func_8019C4B0 */ -struct ObjView *make_view_withgrp(char *name, struct ObjGroup *grp) { - struct ObjView *view = make_view(name, (VIEW_DRAW | VIEW_ALLOC_ZBUF | VIEW_MOVEMENT), 1, 0, 0, 320, 240, grp); - UNUSED struct ObjGroup *viewgrp = make_group(2, grp, view); +struct ObjView* make_view_withgrp(char* name, struct ObjGroup* grp) { + struct ObjView* view = make_view(name, (VIEW_DRAW | VIEW_ALLOC_ZBUF | VIEW_MOVEMENT), 1, 0, 0, 320, 240, grp); + UNUSED struct ObjGroup* viewgrp = make_group(2, grp, view); view->lights = gGdLightGroup; return view; @@ -1206,10 +1162,10 @@ void Unknown8019C840(void) { void gd_vblank(void) { gd_sfx_update(); if (sUpdateYoshiScene) { - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) convert_net_verts, sYoshiSceneGrp); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)convert_net_verts, sYoshiSceneGrp); } if (sUpdateMarioScene) { - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) convert_net_verts, sMarioSceneGrp); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)convert_net_verts, sMarioSceneGrp); } sUpdateYoshiScene = FALSE; sUpdateMarioScene = FALSE; @@ -1222,10 +1178,10 @@ void gd_vblank(void) { /** * Copies the player1 controller data from p1cont to sGdContPads[0]. */ -void gd_copy_p1_contpad(OSContPad *p1cont) { - u32 i; // 24 - u8 *src = (u8 *) p1cont; // 20 - u8 *dest = (u8 *) &sGdContPads[0]; // 1c +void gd_copy_p1_contpad(OSContPad* p1cont) { + u32 i; // 24 + u8* src = (u8*)p1cont; // 20 + u8* dest = (u8*)&sGdContPads[0]; // 1c for (i = 0; i < sizeof(OSContPad); i++) { dest[i] = src[i]; @@ -1242,9 +1198,9 @@ s32 gd_sfx_to_play(void) { } /* 24B088 -> 24B418 */ -Gfx *gdm_gettestdl(s32 id) { - struct GdObj *dobj; - struct GdDisplayList *gddl; +Gfx* gdm_gettestdl(s32 id) { + struct GdObj* dobj; + struct GdDisplayList* gddl; UNUSED u8 filler[8]; struct GdVec3f vec; @@ -1258,10 +1214,9 @@ Gfx *gdm_gettestdl(s32 id) { fatal_printf("gdm_gettestdl(): DL number %d undefined", id); } //! @bug Code treats `sYoshiSceneView` as group; not called in game though - apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view, - (struct ObjGroup *) sYoshiSceneView); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t)update_view, (struct ObjGroup*)sYoshiSceneView); dobj = d_use_obj("yoshi_scene"); - gddl = sGdDLArray[((struct ObjView *) dobj)->gdDlNum]; + gddl = sGdDLArray[((struct ObjView*)dobj)->gdDlNum]; sUpdateYoshiScene = TRUE; break; case 1: @@ -1269,7 +1224,7 @@ Gfx *gdm_gettestdl(s32 id) { fatal_printf("gdm_gettestdl(): DL number %d undefined", id); } dobj = d_use_obj("yoshi_sh_l1"); - gddl = sGdDLArray[((struct ObjShape *) dobj)->dlNums[gGdFrameBufNum]]; + gddl = sGdDLArray[((struct ObjShape*)dobj)->dlNums[gGdFrameBufNum]]; sUpdateYoshiScene = TRUE; break; case GD_SCENE_REGULAR_MARIO: @@ -1293,10 +1248,9 @@ Gfx *gdm_gettestdl(s32 id) { fatal_printf("gdm_gettestdl(): DL number %d undefined", id); } //! @bug Code treats `sCarSceneView` as group; not called in game though - apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view, - (struct ObjGroup *) sCarSceneView); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t)update_view, (struct ObjGroup*)sCarSceneView); dobj = d_use_obj("car_scene"); - gddl = sGdDLArray[((struct ObjView *) dobj)->gdDlNum]; + gddl = sGdDLArray[((struct ObjView*)dobj)->gdDlNum]; sUpdateCarScene = TRUE; break; case 5: @@ -1321,19 +1275,19 @@ Gfx *gdm_gettestdl(s32 id) { fatal_printf("no display list"); } stop_timer("dlgen"); - return (void *) osVirtualToPhysical(gddl->gfx); + return (void*)osVirtualToPhysical(gddl->gfx); } /* 24B418 -> 24B4CC; not called */ -void gdm_getpos(s32 id, struct GdVec3f *dst) { - struct GdObj *dobj; // 1c +void gdm_getpos(s32 id, struct GdVec3f* dst) { + struct GdObj* dobj; // 1c switch (id) { case 5: set_gd_mtx_parameters(G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); dobj = d_use_obj("testnet2"); - dst->x = ((struct ObjNet *) dobj)->worldPos.x; - dst->y = ((struct ObjNet *) dobj)->worldPos.y; - dst->z = ((struct ObjNet *) dobj)->worldPos.z; + dst->x = ((struct ObjNet*)dobj)->worldPos.x; + dst->y = ((struct ObjNet*)dobj)->worldPos.y; + dst->z = ((struct ObjNet*)dobj)->worldPos.z; break; default: fatal_printf("gdm_getpos(): %d out of range", id); @@ -1344,8 +1298,8 @@ void gdm_getpos(s32 id, struct GdVec3f *dst) { /** * Clamps the coordinates so that they are within the active view */ -static void clamp_coords_to_active_view(f32 *x, f32 *y) { - struct ObjView *view = sActiveView; +static void clamp_coords_to_active_view(f32* x, f32* y) { + struct ObjView* view = sActiveView; if (*x < 0.0f) { *x = 0.0f; @@ -1366,8 +1320,8 @@ void fatal_no_dl_mem(void) { } /* 24B5D4 -> 24B6AC */ -struct GdDisplayList *alloc_displaylist(u32 id) { - struct GdDisplayList *gdDl; +struct GdDisplayList* alloc_displaylist(u32 id) { + struct GdDisplayList* gdDl; gdDl = gd_malloc_perm(sizeof(struct GdDisplayList)); if (gdDl == NULL) { @@ -1376,8 +1330,7 @@ struct GdDisplayList *alloc_displaylist(u32 id) { gdDl->number = sGdDlCount++; if (sGdDlCount >= MAX_GD_DLS) { - fatal_printf("alloc_displaylist() too many display lists %d (MAX %d)", sGdDlCount + 1, - MAX_GD_DLS); + fatal_printf("alloc_displaylist() too many display lists %d (MAX %d)", sGdDlCount + 1, MAX_GD_DLS); } sGdDLArray[gdDl->number] = gdDl; gdDl->id = id; @@ -1385,7 +1338,7 @@ struct GdDisplayList *alloc_displaylist(u32 id) { } /* 24B6AC -> 24B7A0; orig name: func_8019CEDC */ -void cpy_remaining_gddl(struct GdDisplayList *dst, struct GdDisplayList *src) { +void cpy_remaining_gddl(struct GdDisplayList* dst, struct GdDisplayList* src) { dst->vtx = &DL_CURRENT_VTX(src); dst->mtx = &DL_CURRENT_MTX(src); dst->light = &DL_CURRENT_LIGHT(src); @@ -1404,8 +1357,8 @@ void cpy_remaining_gddl(struct GdDisplayList *dst, struct GdDisplayList *src) { } /* 24B7A0 -> 24B7F8; orig name: func_8019CFD0 */ -struct GdDisplayList *create_child_gdl(s32 id, struct GdDisplayList *srcDl) { - struct GdDisplayList *newDl; +struct GdDisplayList* create_child_gdl(s32 id, struct GdDisplayList* srcDl) { + struct GdDisplayList* newDl; newDl = alloc_displaylist(id); newDl->parent = srcDl; @@ -1414,8 +1367,8 @@ struct GdDisplayList *create_child_gdl(s32 id, struct GdDisplayList *srcDl) { } /* 24B7F8 -> 24BA48; orig name: func_8019D028 */ -struct GdDisplayList *new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 lights, s32 vps) { - struct GdDisplayList *dl; // 24 +struct GdDisplayList* new_gd_dl(s32 id, s32 gfxs, s32 verts, s32 mtxs, s32 lights, s32 vps) { + struct GdDisplayList* dl; // 24 dl = alloc_displaylist(id); dl->parent = NULL; @@ -1486,9 +1439,8 @@ void gd_draw_rect(f32 ulx, f32 uly, f32 lrx, f32 lry) { clamp_coords_to_active_view(&lrx, &lry); if (lrx > ulx && lry > uly) { - gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), - (u32)(uly + sActiveView->upperLeft.y), (u32)(sActiveView->upperLeft.x + lrx), - (u32)(lry + sActiveView->upperLeft.y)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), (u32)(uly + sActiveView->upperLeft.y), + (u32)(sActiveView->upperLeft.x + lrx), (u32)(lry + sActiveView->upperLeft.y)); } gDPPipeSync(next_gfx()); @@ -1502,18 +1454,16 @@ void gd_draw_border_rect(f32 ulx, f32 uly, f32 lrx, f32 lry) { clamp_coords_to_active_view(&lrx, &lry); if (lrx > ulx && lry > uly) { - gDPFillRectangle( - next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), (u32)(uly + sActiveView->upperLeft.y), - (u32)(sActiveView->upperLeft.x + ulx + 5.0f), (u32)(lry + sActiveView->upperLeft.y)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), (u32)(uly + sActiveView->upperLeft.y), + (u32)(sActiveView->upperLeft.x + ulx + 5.0f), (u32)(lry + sActiveView->upperLeft.y)); gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + lrx - 5.0f), (u32)(uly + sActiveView->upperLeft.y), (u32)(sActiveView->upperLeft.x + lrx), (u32)(lry + sActiveView->upperLeft.y)); + gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), (u32)(uly + sActiveView->upperLeft.y), + (u32)(sActiveView->upperLeft.x + lrx), (u32)(uly + sActiveView->upperLeft.y + 5.0f)); gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), - (u32)(uly + sActiveView->upperLeft.y), (u32)(sActiveView->upperLeft.x + lrx), - (u32)(uly + sActiveView->upperLeft.y + 5.0f)); - gDPFillRectangle(next_gfx(), (u32)(sActiveView->upperLeft.x + ulx), - (u32)(lry + sActiveView->upperLeft.y - 5.0f), - (u32)(sActiveView->upperLeft.x + lrx), (u32)(lry + sActiveView->upperLeft.y)); + (u32)(lry + sActiveView->upperLeft.y - 5.0f), (u32)(sActiveView->upperLeft.x + lrx), + (u32)(lry + sActiveView->upperLeft.y)); } gDPPipeSync(next_gfx()); @@ -1522,7 +1472,7 @@ void gd_draw_border_rect(f32 ulx, f32 uly, f32 lrx, f32 lry) { } /* 24CAC8 -> 24CDB4; orig name: func_8019E2F8 */ -void gd_dl_set_fill(struct GdColour *colour) { +void gd_dl_set_fill(struct GdColour* colour) { u8 r, g, b; r = colour->r * 255.0f; @@ -1583,10 +1533,10 @@ s32 gd_startdisplist(s32 memarea) { D_801BB01C = 1; switch (memarea) { - case 7: // Create new display list as a child of sStaticDl + case 7: // Create new display list as a child of sStaticDl sCurrentGdDl = create_child_gdl(0, sStaticDl); break; - case 8: // Use the active view's display list + case 8: // Use the active view's display list if (sActiveView->id > 2) { fatal_printf("gd_startdisplist(): Too many views to display"); } @@ -1618,8 +1568,7 @@ s32 gd_enddlsplist_parent(void) { if (sCurrentGdDl->parent != NULL) { sCurrentGdDl->parent->curVtxIdx = (sCurrentGdDl->parent->curVtxIdx + sCurrentGdDl->curVtxIdx); sCurrentGdDl->parent->curMtxIdx = (sCurrentGdDl->parent->curMtxIdx + sCurrentGdDl->curMtxIdx); - sCurrentGdDl->parent->curLightIdx = - (sCurrentGdDl->parent->curLightIdx + sCurrentGdDl->curLightIdx); + sCurrentGdDl->parent->curLightIdx = (sCurrentGdDl->parent->curLightIdx + sCurrentGdDl->curLightIdx); sCurrentGdDl->parent->curGfxIdx = (sCurrentGdDl->parent->curGfxIdx + sCurrentGdDl->curGfxIdx); sCurrentGdDl->parent->curVpIdx = (sCurrentGdDl->parent->curVpIdx + sCurrentGdDl->curVpIdx); } @@ -1629,21 +1578,21 @@ s32 gd_enddlsplist_parent(void) { /* 24D39C -> 24D3D8 */ void Unknown8019EBCC(s32 num, uintptr_t gfxptr) { - sGdDLArray[num]->gfx = (Gfx *) (GD_LOWER_24(gfxptr) + D_801BAF28); + sGdDLArray[num]->gfx = (Gfx*)(GD_LOWER_24(gfxptr) + D_801BAF28); } /* 24D3D8 -> 24D458; orig name: func_8019EC08 */ -u32 new_gddl_from(Gfx *dl, UNUSED s32 arg1) { - struct GdDisplayList *gddl; +u32 new_gddl_from(Gfx* dl, UNUSED s32 arg1) { + struct GdDisplayList* gddl; gddl = new_gd_dl(0, 0, 0, 0, 0, 0); - gddl->gfx = (Gfx *) (GD_LOWER_24((uintptr_t) dl) + D_801BAF28); + gddl->gfx = (Gfx*)(GD_LOWER_24((uintptr_t)dl) + D_801BAF28); return gddl->number; } /* 24D458 -> 24D4C4 */ -u32 Unknown8019EC88(Gfx *dl, UNUSED s32 arg1) { - struct GdDisplayList *gddl; +u32 Unknown8019EC88(Gfx* dl, UNUSED s32 arg1) { + struct GdDisplayList* gddl; gddl = new_gd_dl(0, 0, 0, 0, 0, 0); gddl->gfx = dl; @@ -1651,14 +1600,14 @@ u32 Unknown8019EC88(Gfx *dl, UNUSED s32 arg1) { } /* 24D4C4 -> 24D63C; orig name: func_8019ECF4 */ -void mat4_to_mtx(Mat4f *src, Mtx *dst) { +void mat4_to_mtx(Mat4f* src, Mtx* dst) { #ifndef GBI_FLOATS s32 i; // 14 s32 j; // 10 s32 w1; s32 w2; - s32 *mtxInt = (s32 *) dst->m[0]; // s32 part - s32 *mtxFrc = (s32 *) dst->m[2]; // frac part + s32* mtxInt = (s32*)dst->m[0]; // s32 part + s32* mtxFrc = (s32*)dst->m[2]; // frac part for (i = 0; i < 4; i++) { for (j = 0; j < 2; j++) { @@ -1680,7 +1629,7 @@ void mat4_to_mtx(Mat4f *src, Mtx *dst) { /** * Adds a display list operation that multiplies the current matrix with `mtx`. */ -void gd_dl_mul_matrix(Mat4f *mtx) { +void gd_dl_mul_matrix(Mat4f* mtx) { mat4_to_mtx(mtx, &DL_CURRENT_MTX(sCurrentGdDl)); gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), sMtxParamType | G_MTX_MUL | G_MTX_NOPUSH); next_mtx(); @@ -1689,7 +1638,7 @@ void gd_dl_mul_matrix(Mat4f *mtx) { /** * Adds a display list operation that replaces the current matrix with `mtx`. */ -void gd_dl_load_matrix(Mat4f *mtx) { +void gd_dl_load_matrix(Mat4f* mtx) { mat4_to_mtx(mtx, &DL_CURRENT_MTX(sCurrentGdDl)); gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), sMtxParamType | G_MTX_LOAD | G_MTX_NOPUSH); @@ -1762,17 +1711,16 @@ void func_8019F2C4(f32 arg0, s8 arg1) { } /* 24DAE8 -> 24E1A8 */ -void gd_dl_lookat(struct ObjCamera *cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { - LookAt *lookat; +void gd_dl_lookat(struct ObjCamera* cam, f32 arg1, f32 arg2, f32 arg3, f32 arg4, f32 arg5, f32 arg6, f32 arg7) { + LookAt* lookat; arg7 *= RAD_PER_DEG; - gd_mat4f_lookat(&cam->unkE8, arg1, arg2, arg3, arg4, arg5, arg6, gd_sin_d(arg7), gd_cos_d(arg7), - 0.0f); + gd_mat4f_lookat(&cam->unkE8, arg1, arg2, arg3, arg4, arg5, arg6, gd_sin_d(arg7), gd_cos_d(arg7), 0.0f); mat4_to_mtx(&cam->unkE8, &DL_CURRENT_MTX(sCurrentGdDl)); gSPMatrix(next_gfx(), osVirtualToPhysical(&DL_CURRENT_MTX(sCurrentGdDl)), - G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); + G_MTX_PROJECTION | G_MTX_MUL | G_MTX_NOPUSH); /* col colc dir 0 1 2 3 4 5 6 7 8 9 10 11 @@ -1853,17 +1801,17 @@ void check_tri_display(s32 vtxcount) { * Adds a vertex to the current display list. Returns a pointer to the vertex if * it is new, or NULL if the vertex already exists. */ -Vtx *gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha) { - Vtx *vtx = NULL; +Vtx* gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha) { + Vtx* vtx = NULL; s32 i; // Add the vertex index to the buffer if it doesn't already exist for (i = sVertexBufStartIndex; i < (sVertexBufStartIndex + sVertexBufCount); i++) { // the ifs need to be separate to match... - if (sCurrentGdDl->vtx[i].n.ob[0] == (s16) x) { - if (sCurrentGdDl->vtx[i].n.ob[1] == (s16) y) { - if (sCurrentGdDl->vtx[i].n.ob[2] == (s16) z) { - sTriangleBuf[sTriangleBufCount][D_801BB0B4++] = (s16) i; + if (sCurrentGdDl->vtx[i].n.ob[0] == (s16)x) { + if (sCurrentGdDl->vtx[i].n.ob[1] == (s16)y) { + if (sCurrentGdDl->vtx[i].n.ob[2] == (s16)z) { + sTriangleBuf[sTriangleBufCount][D_801BB0B4++] = (s16)i; return NULL; } } @@ -1871,11 +1819,11 @@ Vtx *gd_dl_make_vertex(f32 x, f32 y, f32 z, f32 alpha) { } sVertexBufCount++; - sTriangleBuf[sTriangleBufCount][D_801BB0B4++] = (s16) sCurrentGdDl->curVtxIdx; + sTriangleBuf[sTriangleBufCount][D_801BB0B4++] = (s16)sCurrentGdDl->curVtxIdx; - DL_CURRENT_VTX(sCurrentGdDl).n.ob[0] = (s16) x; - DL_CURRENT_VTX(sCurrentGdDl).n.ob[1] = (s16) y; - DL_CURRENT_VTX(sCurrentGdDl).n.ob[2] = (s16) z; + DL_CURRENT_VTX(sCurrentGdDl).n.ob[0] = (s16)x; + DL_CURRENT_VTX(sCurrentGdDl).n.ob[1] = (s16)y; + DL_CURRENT_VTX(sCurrentGdDl).n.ob[2] = (s16)z; DL_CURRENT_VTX(sCurrentGdDl).n.flag = 0; DL_CURRENT_VTX(sCurrentGdDl).n.tc[0] = sVtxCvrtTCBuf[0]; DL_CURRENT_VTX(sCurrentGdDl).n.tc[1] = sVtxCvrtTCBuf[1]; @@ -1903,7 +1851,7 @@ void func_8019FEF0(void) { * Adds a triange to the current display list. */ void gd_dl_make_triangle(f32 x1, f32 y1, f32 z1, f32 x2, f32 y2, f32 z2, f32 x3, f32 y3, f32 z3) { - Vtx *vtx; + Vtx* vtx; vtx = &DL_CURRENT_VTX(sCurrentGdDl); gd_dl_make_vertex(x1, y1, z1, 1.0f); @@ -1932,11 +1880,8 @@ void gd_dl_flush_vertices(void) { gSPVertex(next_gfx(), osVirtualToPhysical(&sCurrentGdDl->vtx[sVertexBufStartIndex]), sVertexBufCount, 0); // load triangle data for (i = 0; i < sTriangleBufCount; i++) { - gSP1Triangle(next_gfx(), - sTriangleBuf[i][0] - sVertexBufStartIndex, - sTriangleBuf[i][1] - sVertexBufStartIndex, - sTriangleBuf[i][2] - sVertexBufStartIndex, - 0); + gSP1Triangle(next_gfx(), sTriangleBuf[i][0] - sVertexBufStartIndex, + sTriangleBuf[i][1] - sVertexBufStartIndex, sTriangleBuf[i][2] - sVertexBufStartIndex, 0); } } func_801A0038(); @@ -2004,12 +1949,12 @@ void branch_to_gddl(s32 dlNum) { /* 24EC48 -> 24F03C */ // phong shading function? void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array - struct ObjCamera *cam, UNUSED struct GdVec3f *arg2, UNUSED struct GdVec3f *arg3, - struct GdVec3f *arg4, // vector to light source? - struct GdColour *colour // light color + struct ObjCamera* cam, UNUSED struct GdVec3f* arg2, UNUSED struct GdVec3f* arg3, + struct GdVec3f* arg4, // vector to light source? + struct GdColour* colour // light color ) { UNUSED u8 filler1[96]; - Hilite *hilite; // 4c + Hilite* hilite; // 4c struct GdVec3f sp40; f32 sp3C; // magnitude of sp40 f32 sp38; @@ -2023,8 +1968,8 @@ void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array } hilite = &sHilites[idx]; - gDPSetPrimColor(next_gfx(), 0, 0, (s32)(colour->r * 255.0f), (s32)(colour->g * 255.0f), - (s32)(colour->b * 255.0f), 255); + gDPSetPrimColor(next_gfx(), 0, 0, (s32)(colour->r * 255.0f), (s32)(colour->g * 255.0f), (s32)(colour->b * 255.0f), + 255); sp40.z = cam->unkE8[0][2] + arg4->x; sp40.y = cam->unkE8[1][2] + arg4->y; sp40.x = cam->unkE8[2][2] + arg4->z; @@ -2036,13 +1981,11 @@ void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array sp40.x *= sp3C; hilite->h.x1 = - (((sp40.z * cam->unkE8[0][0]) + (sp40.y * cam->unkE8[1][0]) + (sp40.x * cam->unkE8[2][0])) - * sp38 * 2.0f) - + (sp38 * 4.0f); + (((sp40.z * cam->unkE8[0][0]) + (sp40.y * cam->unkE8[1][0]) + (sp40.x * cam->unkE8[2][0])) * sp38 * 2.0f) + + (sp38 * 4.0f); hilite->h.y1 = - (((sp40.z * cam->unkE8[0][1]) + (sp40.y * cam->unkE8[1][1]) + (sp40.x * cam->unkE8[2][1])) - * sp34 * 2.0f) - + (sp34 * 4.0f); + (((sp40.z * cam->unkE8[0][1]) + (sp40.y * cam->unkE8[1][1]) + (sp40.x * cam->unkE8[2][1])) * sp34 * 2.0f) + + (sp34 * 4.0f); } else { hilite->h.x1 = sp38 * 2.0f; hilite->h.y1 = sp34 * 2.0f; @@ -2052,7 +1995,7 @@ void gd_dl_hilite(s32 idx, // material GdDl number; offsets into hilite array /** * Adds some display list commands that perform lighting for a material */ -s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { +s32 gd_dl_material_lighting(s32 id, struct GdColour* colour, s32 material) { UNUSED u8 filler[8]; s32 i; s32 numLights = sNumLights; @@ -2161,14 +2104,14 @@ s32 gd_dl_material_lighting(s32 id, struct GdColour *colour, s32 material) { } /* 24FDB8 -> 24FE94; orig name: func_801A15E8; only from faces? */ -void set_Vtx_norm_buf_1(struct GdVec3f *norm) { +void set_Vtx_norm_buf_1(struct GdVec3f* norm) { sVtxCvrtNormBuf[0] = (s8)(norm->x * 127.0f); sVtxCvrtNormBuf[1] = (s8)(norm->y * 127.0f); sVtxCvrtNormBuf[2] = (s8)(norm->z * 127.0f); } /* 24FE94 -> 24FF80; orig name: func_801A16C4; only from verts? */ -void set_Vtx_norm_buf_2(struct GdVec3f *norm) { +void set_Vtx_norm_buf_2(struct GdVec3f* norm) { sVtxCvrtNormBuf[0] = (s8)(norm->x * 127.0f); sVtxCvrtNormBuf[1] = (s8)(norm->y * 127.0f); sVtxCvrtNormBuf[2] = (s8)(norm->z * 127.0f); @@ -2194,18 +2137,18 @@ void set_gd_mtx_parameters(s32 params) { * Adds a viewport to the current display list based on the current active view */ static void gd_dl_viewport(void) { - Vp *vp; + Vp* vp; vp = &DL_CURRENT_VP(sCurrentGdDl); - vp->vp.vscale[0] = (s16)(sActiveView->lowerRight.x * 2.0f); // x scale - vp->vp.vscale[1] = (s16)(sActiveView->lowerRight.y * 2.0f); // y scale - vp->vp.vscale[2] = 0x1FF; // z scale + vp->vp.vscale[0] = (s16)(sActiveView->lowerRight.x * 2.0f); // x scale + vp->vp.vscale[1] = (s16)(sActiveView->lowerRight.y * 2.0f); // y scale + vp->vp.vscale[2] = 0x1FF; // z scale vp->vp.vscale[3] = 0x000; - vp->vp.vtrans[0] = (s16)((sActiveView->upperLeft.x * 4.0f) + (sActiveView->lowerRight.x * 2.0f)); // x offset - vp->vp.vtrans[1] = (s16)((sActiveView->upperLeft.y * 4.0f) + (sActiveView->lowerRight.y * 2.0f)); // y offset - vp->vp.vtrans[2] = 0x1FF; // z offset + vp->vp.vtrans[0] = (s16)((sActiveView->upperLeft.x * 4.0f) + (sActiveView->lowerRight.x * 2.0f)); // x offset + vp->vp.vtrans[1] = (s16)((sActiveView->upperLeft.y * 4.0f) + (sActiveView->lowerRight.y * 2.0f)); // y offset + vp->vp.vtrans[2] = 0x1FF; // z offset vp->vp.vtrans[3] = 0x000; gSPViewport(next_gfx(), osVirtualToPhysical(vp)); @@ -2282,7 +2225,7 @@ void gddl_is_loading_shine_dl(s32 dlLoad) { } /* 250C18 -> 251014; orig name: func_801A2448 */ -void start_view_dl(struct ObjView *view) { +void start_view_dl(struct ObjView* view) { f32 ulx; f32 uly; f32 lrx; @@ -2294,8 +2237,7 @@ void start_view_dl(struct ObjView *view) { ulx = view->upperLeft.x; } - if (view->upperLeft.x + view->lowerRight.x - > view->parent->upperLeft.x + view->parent->lowerRight.x) { + if (view->upperLeft.x + view->lowerRight.x > view->parent->upperLeft.x + view->parent->lowerRight.x) { lrx = view->parent->upperLeft.x + view->parent->lowerRight.x; } else { lrx = view->upperLeft.x + view->lowerRight.x; @@ -2307,8 +2249,7 @@ void start_view_dl(struct ObjView *view) { uly = view->upperLeft.y; } - if (view->upperLeft.y + view->lowerRight.y - > view->parent->upperLeft.y + view->parent->lowerRight.y) { + if (view->upperLeft.y + view->lowerRight.y > view->parent->upperLeft.y + view->parent->lowerRight.y) { lry = view->parent->upperLeft.y + view->parent->lowerRight.y; } else { lry = view->upperLeft.y + view->lowerRight.y; @@ -2334,13 +2275,13 @@ void start_view_dl(struct ObjView *view) { /* 251014 -> 251A1C; orig name: func_801A2844 */ void parse_p1_controller(void) { u32 i; - struct GdControl *gdctrl = &gGdCtrl; - OSContPad *currInputs; - OSContPad *prevInputs; + struct GdControl* gdctrl = &gGdCtrl; + OSContPad* currInputs; + OSContPad* prevInputs; // Copy current inputs to previous - u8 *src = (u8 *) gdctrl; - u8 *dest = (u8 *) gdctrl->prevFrame; + u8* src = (u8*)gdctrl; + u8* dest = (u8*)gdctrl->prevFrame; for (i = 0; i < sizeof(struct GdControl); i++) { *dest++ = *src++; } @@ -2350,28 +2291,28 @@ void parse_p1_controller(void) { currInputs = &sGdContPads[0]; prevInputs = &sPrevFrameCont[0]; // stick values - gdctrl->stickXf = currInputs->stick_x; - gdctrl->stickYf = currInputs->stick_y; + gdctrl->stickXf = currInputs->stick_x; + gdctrl->stickYf = currInputs->stick_y; gdctrl->stickDeltaX = gdctrl->stickX; gdctrl->stickDeltaY = gdctrl->stickY; - gdctrl->stickX = currInputs->stick_x; - gdctrl->stickY = currInputs->stick_y; + gdctrl->stickX = currInputs->stick_x; + gdctrl->stickY = currInputs->stick_y; gdctrl->stickDeltaX -= gdctrl->stickX; gdctrl->stickDeltaY -= gdctrl->stickY; // button values (as bools) - gdctrl->trgL = (currInputs->button & L_TRIG) != 0; - gdctrl->trgR = (currInputs->button & R_TRIG) != 0; - gdctrl->btnA = (currInputs->button & A_BUTTON) != 0; - gdctrl->btnB = (currInputs->button & B_BUTTON) != 0; - gdctrl->cleft = (currInputs->button & L_CBUTTONS) != 0; + gdctrl->trgL = (currInputs->button & L_TRIG) != 0; + gdctrl->trgR = (currInputs->button & R_TRIG) != 0; + gdctrl->btnA = (currInputs->button & A_BUTTON) != 0; + gdctrl->btnB = (currInputs->button & B_BUTTON) != 0; + gdctrl->cleft = (currInputs->button & L_CBUTTONS) != 0; gdctrl->cright = (currInputs->button & R_CBUTTONS) != 0; - gdctrl->cup = (currInputs->button & U_CBUTTONS) != 0; - gdctrl->cdown = (currInputs->button & D_CBUTTONS) != 0; + gdctrl->cup = (currInputs->button & U_CBUTTONS) != 0; + gdctrl->cdown = (currInputs->button & D_CBUTTONS) != 0; // but not these buttons?? - gdctrl->dleft = currInputs->button & L_JPAD; + gdctrl->dleft = currInputs->button & L_JPAD; gdctrl->dright = currInputs->button & R_JPAD; - gdctrl->dup = currInputs->button & U_JPAD; - gdctrl->ddown = currInputs->button & D_JPAD; + gdctrl->dup = currInputs->button & U_JPAD; + gdctrl->ddown = currInputs->button & D_JPAD; if (gdctrl->btnA && !gdctrl->dragging) { gdctrl->startedDragging = TRUE; @@ -2417,7 +2358,7 @@ void parse_p1_controller(void) { activate_timing(); } - for (i = 0; ((s32) i) < sDebugViewsCount; i++) { + for (i = 0; ((s32)i) < sDebugViewsCount; i++) { sDebugViews[i]->flags &= ~VIEW_UPDATE; } @@ -2448,7 +2389,7 @@ void parse_p1_controller(void) { } for (i = 0; i < sizeof(OSContPad); i++) { - ((u8 *) prevInputs)[i] = ((u8 *) currInputs)[i]; + ((u8*)prevInputs)[i] = ((u8*)currInputs)[i]; } } @@ -2512,8 +2453,7 @@ void Unknown801A347C(f32 x, f32 y, f32 z) { void border_active_view(void) { if (sActiveView->flags & VIEW_BORDERED) { gd_dl_set_fill(gd_get_colour(1)); - gd_draw_border_rect(0.0f, 0.0f, (sActiveView->lowerRight.x - 1.0f), - (sActiveView->lowerRight.y - 1.0f)); + gd_draw_border_rect(0.0f, 0.0f, (sActiveView->lowerRight.x - 1.0f), (sActiveView->lowerRight.y - 1.0f)); } } @@ -2530,7 +2470,7 @@ void gd_shading(s32 model) { } /* 251DAC -> 251E18 */ -s32 gd_getproperty(s32 prop, UNUSED void *arg1) { +s32 gd_getproperty(s32 prop, UNUSED void* arg1) { s32 got = FALSE; switch (prop) { @@ -2551,7 +2491,7 @@ void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3) { switch (prop) { case GD_PROP_LIGHTING: - parm = (s32) f1; + parm = (s32)f1; switch (parm) { case 1: gSPSetGeometryMode(next_gfx(), G_LIGHTING); @@ -2577,7 +2517,7 @@ void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3) { sLightScaleColours[sLightId].b = f3; break; case GD_PROP_CULLING: - parm = (s32) f1; + parm = (s32)f1; switch (parm) { case 1: gSPSetGeometryMode(next_gfx(), G_CULL_BACK); @@ -2588,7 +2528,7 @@ void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3) { } break; case GD_PROP_OVERLAY: - parm = (s32) f1; + parm = (s32)f1; switch (parm) { case 1: break; @@ -2599,7 +2539,7 @@ void gd_setproperty(enum GdProperty prop, f32 f1, f32 f2, f32 f3) { } break; case GD_PROP_ZBUF_FN: - parm = (s32) f1; + parm = (s32)f1; switch (parm) { case 23: break; @@ -2677,26 +2617,24 @@ void gd_create_perspective_matrix(f32 fovy, f32 aspect, f32 near, f32 far) { } /* 25262C -> 252AF8 */ -s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, UNUSED s32 uly, - UNUSED s32 lrx, UNUSED s32 lry) { +s32 setup_view_buffers(const char* name, struct ObjView* view, UNUSED s32 ulx, UNUSED s32 uly, UNUSED s32 lrx, + UNUSED s32 lry) { char memtrackerName[0x100]; if (view->flags & (VIEW_Z_BUF | VIEW_COLOUR_BUF) && !(view->flags & VIEW_UNK_1000)) { if (view->flags & VIEW_COLOUR_BUF) { sprintf(memtrackerName, "%s CBuf", name); start_memtracker(memtrackerName); - view->colourBufs[0] = - gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x20); + view->colourBufs[0] = gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x20); if (view->flags & VIEW_2_COL_BUF) { - view->colourBufs[1] = - gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x20); + view->colourBufs[1] = gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x20); } else { view->colourBufs[1] = view->colourBufs[0]; } - view->colourBufs[0] = (void *) ALIGN((uintptr_t) view->colourBufs[0], 64); - view->colourBufs[1] = (void *) ALIGN((uintptr_t) view->colourBufs[1], 64); + view->colourBufs[0] = (void*)ALIGN((uintptr_t)view->colourBufs[0], 64); + view->colourBufs[1] = (void*)ALIGN((uintptr_t)view->colourBufs[1], 64); stop_memtracker(memtrackerName); if (view->colourBufs[0] == NULL || view->colourBufs[1] == NULL) { @@ -2711,12 +2649,11 @@ s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, U sprintf(memtrackerName, "%s ZBuf", name); start_memtracker(memtrackerName); if (view->flags & VIEW_ALLOC_ZBUF) { - view->zbuf = - gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x40); + view->zbuf = gd_malloc((u32)(2.0f * view->lowerRight.x * view->lowerRight.y + 64.0f), 0x40); if (view->zbuf == NULL) { fatal_printf("Not enough DRAM for Z buffer\n"); } - view->zbuf = (void *) ALIGN((uintptr_t) view->zbuf, 64); + view->zbuf = (void*)ALIGN((uintptr_t)view->zbuf, 64); } stop_memtracker(memtrackerName); } else { @@ -2738,7 +2675,7 @@ s32 setup_view_buffers(const char *name, struct ObjView *view, UNUSED s32 ulx, U /* 252AF8 -> 252BAC; orig name: _InitControllers */ void gd_init_controllers(void) { - OSContPad *p1cont = &sPrevFrameCont[0]; // 1c + OSContPad* p1cont = &sPrevFrameCont[0]; // 1c u32 i; // 18 osCreateMesgQueue(&D_801BE830, D_801BE848, ARRAY_COUNT(D_801BE848)); @@ -2747,12 +2684,12 @@ void gd_init_controllers(void) { osContStartReadData(&D_801BE830); for (i = 0; i < sizeof(OSContPad); i++) { - ((u8 *) p1cont)[i] = 0; + ((u8*)p1cont)[i] = 0; } } /* 252BAC -> 252BC0 */ -void stub_renderer_6(UNUSED struct GdObj *obj) { +void stub_renderer_6(UNUSED struct GdObj* obj) { } /** @@ -2764,8 +2701,8 @@ void stub_renderer_6(UNUSED struct GdObj *obj) { * popup menu. * @return an identifier of the menu just defined */ -long defpup(UNUSED const char *menufmt, ...) { - return 0; +long defpup(UNUSED const char* menufmt, ...) { + return 0; } /** @@ -2794,7 +2731,7 @@ void func_801A4438(f32 x, f32 y, f32 z) { } /* 252C70 -> 252DB4 */ -s32 gd_gentexture(void *texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 arg4) { +s32 gd_gentexture(void* texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 arg4) { UNUSED s32 sp2C; UNUSED s32 sp28 = 1; s32 dl; // 24 @@ -2834,12 +2771,12 @@ s32 gd_gentexture(void *texture, s32 fmt, s32 size, UNUSED u32 arg3, UNUSED u32 /** * Unused (not called) */ -void *load_texture_from_file(const char *file, s32 fmt, s32 size, u32 arg3, u32 arg4) { - struct GdFile *txFile; // 3c - void *texture; // 38 +void* load_texture_from_file(const char* file, s32 fmt, s32 size, u32 arg3, u32 arg4) { + struct GdFile* txFile; // 3c + void* texture; // 38 u32 txSize; // 34 u32 i; // 30 - u16 *txHalf; // 2C + u16* txHalf; // 2C u8 buf[3]; // 28 u8 alpha; // 27 s32 dl; // 20 @@ -2853,9 +2790,9 @@ void *load_texture_from_file(const char *file, s32 fmt, s32 size, u32 arg3, u32 if (texture == NULL) { fatal_printf("Cant allocate memory for texture"); } - txHalf = (u16 *) texture; + txHalf = (u16*)texture; for (i = 0; i < txSize / 3; i++) { - gd_fread((s8 *) buf, 3, 1, txFile); + gd_fread((s8*)buf, 3, 1, txFile); alpha = 0xFF; *txHalf = ((buf[2] >> 3) << 11) | ((buf[1] >> 3) << 6) | ((buf[0] >> 3) << 1) | (alpha >> 7); txHalf++; @@ -2869,7 +2806,7 @@ void *load_texture_from_file(const char *file, s32 fmt, s32 size, u32 arg3, u32 } /* 252F88 -> 252FAC */ -void Unknown801A47B8(struct ObjView *v) { +void Unknown801A47B8(struct ObjView* v) { if (v->flags & VIEW_SAVE_TO_GLOBAL) { D_801BE994 = v; } @@ -2895,7 +2832,7 @@ void func_801A4808(void) { /* 253018 -> 253084 */ void func_801A4848(s32 linkDl) { - struct GdDisplayList *curDl; + struct GdDisplayList* curDl; curDl = sCurrentGdDl; sCurrentGdDl = sMHeadMainDls[gGdFrameBufNum]; @@ -2914,14 +2851,14 @@ void stub_renderer_10(UNUSED u32 arg0) { } /* 2530A8 -> 2530C0 */ -void stub_draw_label_text(UNUSED char *s) { +void stub_draw_label_text(UNUSED char* s) { UNUSED u8 filler1[4]; - UNUSED char *save = s; + UNUSED char* save = s; UNUSED u8 filler2[24]; } /* 2530C0 -> 2530D8; orig name: func_801A48F0 */ -void set_active_view(struct ObjView *v) { +void set_active_view(struct ObjView* v) { sActiveView = v; } @@ -2943,8 +2880,8 @@ void func_801A4918(void) { x = sHandView->upperLeft.x; y = sHandView->upperLeft.y; - if (!(x > sMenuView->upperLeft.x && x < sMenuView->upperLeft.x + sMenuView->lowerRight.x - && y > sMenuView->upperLeft.y && y < sMenuView->upperLeft.y + sMenuView->lowerRight.y)) { + if (!(x > sMenuView->upperLeft.x && x < sMenuView->upperLeft.x + sMenuView->lowerRight.x && + y > sMenuView->upperLeft.y && y < sMenuView->upperLeft.y + sMenuView->lowerRight.y)) { return; } ydiff = (y - sMenuView->upperLeft.y) / 25.0f; @@ -2985,15 +2922,15 @@ void update_cursor(void) { gd_play_sfx(GD_SFX_HAND_DISAPPEAR); } - sHandView->upperLeft.x = (f32) gGdCtrl.csrX; - sHandView->upperLeft.y = (f32) gGdCtrl.csrY; + sHandView->upperLeft.x = (f32)gGdCtrl.csrX; + sHandView->upperLeft.y = (f32)gGdCtrl.csrY; // Make hand display list begin_gddl(sHandShape->dlNums[gGdFrameBufNum]); if (gGdCtrl.dragging) { - gd_put_sprite((u16 *) gd_texture_hand_closed, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); + gd_put_sprite((u16*)gd_texture_hand_closed, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); } else { - gd_put_sprite((u16 *) gd_texture_hand_open, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); + gd_put_sprite((u16*)gd_texture_hand_open, sHandView->upperLeft.x, sHandView->upperLeft.y, 0x20, 0x20); } gd_enddlsplist_parent(); @@ -3014,9 +2951,9 @@ void update_cursor(void) { /* 253728 -> 2538E0 */ void Unknown801A4F58(void) { - register s16 *cbufOff; // a0 - register s16 *cbufOn; // a1 - register u16 *zbuf; // a2 + register s16* cbufOff; // a0 + register s16* cbufOn; // a1 + register u16* zbuf; // a2 register s16 colour; // a3 register s16 r; // t0 register s16 g; // t1 @@ -3053,14 +2990,14 @@ void Unknown801A4F58(void) { } /* 2538E0 -> 253938 */ -void Proc801A5110(struct ObjView *view) { +void Proc801A5110(struct ObjView* view) { if (view->flags & VIEW_UPDATE) { - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) convert_net_verts, view->components); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)convert_net_verts, view->components); } } /* 253938 -> 2539DC; orig name: func_801A5168 */ -void update_view_and_dl(struct ObjView *view) { +void update_view_and_dl(struct ObjView* view) { UNUSED u8 filler[4]; s32 prevFlags; // 18 @@ -3087,11 +3024,11 @@ void func_801A520C(void) { parse_p1_controller(); setup_timers(); start_timer("dlgen"); - apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) update_view_and_dl, gGdViewsGroup); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t)update_view_and_dl, gGdViewsGroup); stop_timer("dlgen"); restart_timer("netupd"); if (!gGdCtrl.newStartPress) { - apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t) Proc801A5110, gGdViewsGroup); + apply_to_obj_types_in_group(OBJ_TYPE_VIEWS, (applyproc_t)Proc801A5110, gGdViewsGroup); } split_timer("netupd"); split_timer("cpu"); @@ -3129,13 +3066,13 @@ void Unknown801A5344(void) { void gd_init(void) { s32 i; // 34 UNUSED u8 filler[4]; - s8 *data; // 2c + s8* data; // 2c imin("gd_init"); i = (u32)(sMemBlockPoolSize - DOUBLE_SIZE_ON_64_BIT(0x3E800)); data = gd_allocblock(i); gd_add_mem_to_heap(i, data, 0x10); - sAlpha = (u16) 0xff; + sAlpha = (u16)0xff; D_801A867C = 0; D_801A8680 = 0; sTextureCount = 0; @@ -3185,9 +3122,8 @@ void gd_init(void) { sViewDls[i][1] = create_child_gdl(1, sDynamicMainDls[1]); } - sScreenView = - make_view("screenview2", (VIEW_2_COL_BUF | VIEW_UNK_1000 | VIEW_COLOUR_BUF | VIEW_Z_BUF), 0, 0, - 0, 320, 240, NULL); + sScreenView = make_view("screenview2", (VIEW_2_COL_BUF | VIEW_UNK_1000 | VIEW_COLOUR_BUF | VIEW_Z_BUF), 0, 0, 0, + 320, 240, NULL); sScreenView->colour.r = 0.0f; sScreenView->colour.g = 0.0f; sScreenView->colour.b = 0.0f; @@ -3196,8 +3132,8 @@ void gd_init(void) { sActiveView = sScreenView; // Zero out controller inputs - data = (s8 *) &gGdCtrl; - for (i = 0; (u32) i < sizeof(struct GdControl); i++) { + data = (s8*)&gGdCtrl; + for (i = 0; (u32)i < sizeof(struct GdControl); i++) { *data++ = 0; } @@ -3218,7 +3154,7 @@ void gd_init(void) { /** * Unused - reverses the characters in `str`. */ -void reverse_string(char *str, s32 len) { +void reverse_string(char* str, s32 len) { char buf[100]; s32 i; @@ -3232,15 +3168,15 @@ void reverse_string(char *str, s32 len) { } /* 254168 -> 25417C */ -void stub_renderer_12(UNUSED s8 *arg0) { +void stub_renderer_12(UNUSED s8* arg0) { } /* 25417C -> 254190 */ -void stub_renderer_13(UNUSED void *arg0) { +void stub_renderer_13(UNUSED void* arg0) { } /* 254190 -> 2541A4 */ -void stub_renderer_14(UNUSED s8 *arg0) { +void stub_renderer_14(UNUSED s8* arg0) { } /** @@ -3249,7 +3185,7 @@ void stub_renderer_14(UNUSED s8 *arg0) { * @param buf pointer to an array of 16-bit values * @param len maximum number of values to store */ -void init_pick_buf(s16 *buf, s32 len) { +void init_pick_buf(s16* buf, s32 len) { buf[0] = 0; buf[1] = 0; sPickBufLen = len; @@ -3269,7 +3205,7 @@ void store_in_pickbuf(s16 data) { ** Divides by 3, since in the final game, only thing stored ** in the pick buf is a tupple of three halves: (datasize, objtype, objnumber) ** (datasize is always 2) */ -s32 get_cur_pickbuf_offset(UNUSED s16 *arg0) { +s32 get_cur_pickbuf_offset(UNUSED s16* arg0) { return sPickBufPosition / 3; } @@ -3286,7 +3222,7 @@ void stub_renderer_17(void) { } /* 254288 -> 2542B0 */ -void *Unknown801A5AB8(s32 texnum) { +void* Unknown801A5AB8(s32 texnum) { return sLoadedTextures[texnum]; } @@ -3306,12 +3242,12 @@ void set_vtx_tc_buf(f32 tcS, f32 tcT) { } /* 2543B8 -> 2543F4 */ -void add_debug_view(struct ObjView *view) { +void add_debug_view(struct ObjView* view) { sDebugViews[sDebugViewsCount++] = view; } /* 2543F4 -> 254450; orig name: Unknown801A5C24 */ -union ObjVarVal *cvrt_val_to_kb(union ObjVarVal *dst, union ObjVarVal src) { +union ObjVarVal* cvrt_val_to_kb(union ObjVarVal* dst, union ObjVarVal src) { union ObjVarVal temp; temp.f = src.f / 1024.0; //? 1024.0f @@ -3319,21 +3255,21 @@ union ObjVarVal *cvrt_val_to_kb(union ObjVarVal *dst, union ObjVarVal src) { } /* 254450 -> 254560 */ -void Unknown801A5C80(struct ObjGroup *parentGroup) { - struct ObjLabel *label; // 3c - struct ObjGroup *debugGroup; // 38 +void Unknown801A5C80(struct ObjGroup* parentGroup) { + struct ObjLabel* label; // 3c + struct ObjGroup* debugGroup; // 38 d_start_group("debugg"); - label = (struct ObjLabel *) d_makeobj(D_LABEL, 0); + label = (struct ObjLabel*)d_makeobj(D_LABEL, 0); d_set_rel_pos(10.0f, 230.0f, 0.0f); d_set_parm_ptr(PARM_PTR_CHAR, gd_strdup("FT %2.2f")); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTracked1FrameTime); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTracked1FrameTime); label->unk30 = 3; d_end_group("debugg"); - debugGroup = (struct ObjGroup *) d_use_obj("debugg"); - make_view("debugview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_DRAW), 2, 0, 0, 320, - 240, debugGroup); + debugGroup = (struct ObjGroup*)d_use_obj("debugg"); + make_view("debugview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_DRAW), 2, 0, 0, 320, 240, + debugGroup); if (parentGroup != NULL) { addto_group(parentGroup, &debugGroup->header); @@ -3341,17 +3277,17 @@ void Unknown801A5C80(struct ObjGroup *parentGroup) { } /* 254560 -> 2547C8 */ -void Unknown801A5D90(struct ObjGroup *arg0) { - struct ObjLabel *mtLabel; // 254 - struct ObjGroup *labelgrp; // 250 - struct ObjView *memview; // 24c - s32 trackerNum; // memtracker id and/or i +void Unknown801A5D90(struct ObjGroup* arg0) { + struct ObjLabel* mtLabel; // 254 + struct ObjGroup* labelgrp; // 250 + struct ObjView* memview; // 24c + s32 trackerNum; // memtracker id and/or i s32 sp244; // label y position? s32 sp240; // done checking all memtrakcers s32 sp23C; // memtracker label made? char mtStatsFmt[0x100]; // 13c char groupId[0x100]; // 3c - struct MemTracker *mt; // 38 + struct MemTracker* mt; // 38 sp240 = FALSE; trackerNum = -1; @@ -3368,10 +3304,10 @@ void Unknown801A5D90(struct ObjGroup *arg0) { if (mt->name != NULL) { sprintf(mtStatsFmt, "%s %%6.2fk", mt->name); - mtLabel = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + mtLabel = (struct ObjLabel*)d_makeobj(D_LABEL, AsDynName(0)); d_set_rel_pos(10.0f, sp244, 0.0f); d_set_parm_ptr(PARM_PTR_CHAR, gd_strdup(mtStatsFmt)); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &mt->total); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&mt->total); mtLabel->unk30 = 3; d_add_valproc(cvrt_val_to_kb); sp23C = TRUE; @@ -3388,13 +3324,13 @@ void Unknown801A5D90(struct ObjGroup *arg0) { } d_end_group(AsDynName(groupId)); - labelgrp = (struct ObjGroup *) d_use_obj(AsDynName(groupId)); + labelgrp = (struct ObjGroup*)d_use_obj(AsDynName(groupId)); if (sp23C) { - memview = make_view("memview", - (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_UNK_2000 | VIEW_UNK_4000 - | VIEW_1_CYCLE | VIEW_DRAW), - 2, 0, 10, 320, 200, labelgrp); + memview = + make_view("memview", + (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_UNK_2000 | VIEW_UNK_4000 | VIEW_1_CYCLE | VIEW_DRAW), + 2, 0, 10, 320, 200, labelgrp); memview->colour.r = 0.0f; memview->colour.g = 0.0f; memview->colour.b = 0.0f; @@ -3406,10 +3342,10 @@ void Unknown801A5D90(struct ObjGroup *arg0) { } /* 2547C8 -> 254AC0 */ -void Unknown801A5FF8(struct ObjGroup *arg0) { - struct ObjView *menuview; // 3c - UNUSED struct ObjLabel *label; // 38 - struct ObjGroup *menugrp; // 34 +void Unknown801A5FF8(struct ObjGroup* arg0) { + struct ObjView* menuview; // 3c + UNUSED struct ObjLabel* label; // 38 + struct ObjGroup* menugrp; // 34 UNUSED u8 filler[8]; d_start_group("menug"); @@ -3419,10 +3355,10 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { d_set_scale(100.0f, 20.0f, 0.0f); d_set_type(6); d_set_colour_num(2); - label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + label = (struct ObjLabel*)d_makeobj(D_LABEL, AsDynName(0)); d_set_rel_pos(5.0f, 18.0f, 0.0f); d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 1"); - d_add_valptr("menu0", 0x40000, 0, (uintptr_t) NULL); + d_add_valptr("menu0", 0x40000, 0, (uintptr_t)NULL); sMenuGadgets[1] = d_makeobj(D_GADGET, "menu1"); d_set_obj_draw_flag(OBJ_IS_GRABBABLE); @@ -3430,10 +3366,10 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { d_set_scale(100.0f, 20.0f, 0.0f); d_set_type(6); d_set_colour_num(4); - label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + label = (struct ObjLabel*)d_makeobj(D_LABEL, AsDynName(0)); d_set_rel_pos(5.0f, 18.0f, 0.0f); d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 2"); - d_add_valptr("menu1", 0x40000, 0, (uintptr_t) NULL); + d_add_valptr("menu1", 0x40000, 0, (uintptr_t)NULL); sMenuGadgets[2] = d_makeobj(D_GADGET, "menu2"); d_set_obj_draw_flag(OBJ_IS_GRABBABLE); @@ -3441,17 +3377,16 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { d_set_scale(100.0f, 20.0f, 0.0f); d_set_type(6); d_set_colour_num(3); - label = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + label = (struct ObjLabel*)d_makeobj(D_LABEL, AsDynName(0)); d_set_rel_pos(5.0f, 18.0f, 0.0f); d_set_parm_ptr(PARM_PTR_CHAR, "ITEM 3"); - d_add_valptr("menu2", 0x40000, 0, (uintptr_t) NULL); + d_add_valptr("menu2", 0x40000, 0, (uintptr_t)NULL); sItemsInMenu = 3; d_end_group("menug"); - menugrp = (struct ObjGroup *) d_use_obj("menug"); - menuview = make_view( - "menuview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_BORDERED | VIEW_UNK_2000 | VIEW_UNK_4000), - 2, 100, 20, 110, 150, menugrp); + menugrp = (struct ObjGroup*)d_use_obj("menug"); + menuview = make_view("menuview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_BORDERED | VIEW_UNK_2000 | VIEW_UNK_4000), + 2, 100, 20, 110, 150, menugrp); menuview->colour.r = 0.0f; menuview->colour.g = 0.0f; menuview->colour.b = 0.0f; @@ -3460,17 +3395,18 @@ void Unknown801A5FF8(struct ObjGroup *arg0) { } /* 254AC0 -> 254DFC; orig name: PutSprite */ -void gd_put_sprite(u16 *sprite, s32 x, s32 y, s32 wx, s32 wy) { +void gd_put_sprite(u16* sprite, s32 x, s32 y, s32 wx, s32 wy) { s32 c; // 5c s32 r; // 58 gSPDisplayList(next_gfx(), osVirtualToPhysical(gd_dl_sprite_start_tex_block)); for (r = 0; r < wy; r += 32) { for (c = 0; c < wx; c += 32) { - gDPLoadTextureBlock(next_gfx(), (r * 32) + sprite + c, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, - G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - gSPTextureRectangle(next_gfx(), x << 2, (y + r) << 2, (x + 32) << 2, (y + r + 32) << 2, - G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + gDPLoadTextureBlock(next_gfx(), (r * 32) + sprite + c, G_IM_FMT_RGBA, G_IM_SIZ_16b, 32, 32, 0, + G_TX_WRAP | G_TX_NOMIRROR, G_TX_WRAP | G_TX_NOMIRROR, G_TX_NOMASK, G_TX_NOMASK, + G_TX_NOLOD, G_TX_NOLOD); + gSPTextureRectangle(next_gfx(), x << 2, (y + r) << 2, (x + 32) << 2, (y + r + 32) << 2, G_TX_RENDERTILE, 0, + 0, 1 << 10, 1 << 10); } } @@ -3481,30 +3417,29 @@ void gd_put_sprite(u16 *sprite, s32 x, s32 y, s32 wx, s32 wy) { } /* 254DFC -> 254F94; orig name: proc_dyn_list */ -void gd_setup_cursor(struct ObjGroup *parentgrp) { - struct ObjView *mouseview; // 34 - struct ObjGroup *mousegrp; // 30 - UNUSED struct ObjNet *net; // 2c +void gd_setup_cursor(struct ObjGroup* parentgrp) { + struct ObjView* mouseview; // 34 + struct ObjGroup* mousegrp; // 30 + UNUSED struct ObjNet* net; // 2c sHandShape = make_shape(0, "mouse"); sHandShape->dlNums[0] = gd_startdisplist(7); - gd_put_sprite((u16 *) gd_texture_hand_open, 100, 100, 32, 32); + gd_put_sprite((u16*)gd_texture_hand_open, 100, 100, 32, 32); gd_enddlsplist_parent(); sHandShape->dlNums[1] = gd_startdisplist(7); - gd_put_sprite((u16 *) gd_texture_hand_open, 100, 100, 32, 32); + gd_put_sprite((u16*)gd_texture_hand_open, 100, 100, 32, 32); gd_enddlsplist_parent(); d_start_group("mouseg"); - net = (struct ObjNet *) d_makeobj(D_NET, AsDynName(0)); + net = (struct ObjNet*)d_makeobj(D_NET, AsDynName(0)); d_set_init_pos(0.0f, 0.0f, 0.0f); d_set_type(3); d_set_shapeptrptr(&sHandShape); d_end_group("mouseg"); - mousegrp = (struct ObjGroup *) d_use_obj("mouseg"); - mouseview = make_view("mouseview", - (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), - 2, 0, 0, 32, 32, mousegrp); + mousegrp = (struct ObjGroup*)d_use_obj("mouseg"); + mouseview = make_view("mouseview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), 2, + 0, 0, 32, 32, mousegrp); mouseview->flags &= ~VIEW_UPDATE; sHandView = mouseview; if (parentgrp != NULL) { @@ -3516,7 +3451,7 @@ void gd_setup_cursor(struct ObjGroup *parentgrp) { * 254F94 -> 254FE4; orig name: Proc801A67C4 * This prints all timers if the view was not updated for a frame **/ -void view_proc_print_timers(struct ObjView *self) { +void view_proc_print_timers(struct ObjView* self) { if (self->flags & VIEW_WAS_UPDATED) { return; } @@ -3526,17 +3461,17 @@ void view_proc_print_timers(struct ObjView *self) { /* 254FE4 -> 255600; not called; orig name: Unknown801A6814 */ void make_timer_gadgets(void) { - struct ObjLabel *timerLabel; - struct ObjGroup *timerg; + struct ObjLabel* timerLabel; + struct ObjGroup* timerg; UNUSED u8 filler[4]; - struct ObjView *timersview; - struct ObjGadget *bar1; - struct ObjGadget *bar2; - struct ObjGadget *bar3; - struct ObjGadget *bar4; - struct ObjGadget *bar5; - struct ObjGadget *bar6; - struct GdTimer *timer; + struct ObjView* timersview; + struct ObjGadget* bar1; + struct ObjGadget* bar2; + struct ObjGadget* bar3; + struct ObjGadget* bar4; + struct ObjGadget* bar5; + struct ObjGadget* bar6; + struct GdTimer* timer; s32 i; char timerNameBuf[0x20]; @@ -3548,8 +3483,8 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0); d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); - bar1 = (struct ObjGadget *) d_use_obj("bar1"); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTimeScaleFactor); + bar1 = (struct ObjGadget*)d_use_obj("bar1"); bar1->colourNum = COLOUR_WHITE; d_makeobj(D_GADGET, "bar2"); @@ -3559,8 +3494,8 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0); d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); - bar2 = (struct ObjGadget *) d_use_obj("bar2"); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTimeScaleFactor); + bar2 = (struct ObjGadget*)d_use_obj("bar2"); bar2->colourNum = COLOUR_PINK; d_makeobj(D_GADGET, "bar3"); @@ -3570,8 +3505,8 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0); d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); - bar3 = (struct ObjGadget *) d_use_obj("bar3"); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTimeScaleFactor); + bar3 = (struct ObjGadget*)d_use_obj("bar3"); bar3->colourNum = COLOUR_WHITE; d_makeobj(D_GADGET, "bar4"); @@ -3581,8 +3516,8 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0); d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); - bar4 = (struct ObjGadget *) d_use_obj("bar4"); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTimeScaleFactor); + bar4 = (struct ObjGadget*)d_use_obj("bar4"); bar4->colourNum = COLOUR_PINK; d_makeobj(D_GADGET, "bar5"); @@ -3592,8 +3527,8 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0); d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); - bar5 = (struct ObjGadget *) d_use_obj("bar5"); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTimeScaleFactor); + bar5 = (struct ObjGadget*)d_use_obj("bar5"); bar5->colourNum = COLOUR_WHITE; d_makeobj(D_GADGET, "bar6"); @@ -3603,8 +3538,8 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0); d_set_parm_f(PARM_F_RANGE_MAX, sTimeScaleFactor); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &sTimeScaleFactor); - bar6 = (struct ObjGadget *) d_use_obj("bar6"); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&sTimeScaleFactor); + bar6 = (struct ObjGadget*)d_use_obj("bar6"); bar6->colourNum = COLOUR_PINK; for (i = 0; i < GD_NUM_TIMERS; i++) { @@ -3619,22 +3554,21 @@ void make_timer_gadgets(void) { d_set_type(4); d_set_parm_f(PARM_F_RANGE_MIN, 0.0f); d_set_parm_f(PARM_F_RANGE_MAX, 1.0f); - d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t) &timer->prevScaledTotal); - sTimerGadgets[i] = (struct ObjGadget *) d_use_obj(timerNameBuf); + d_add_valptr(NULL, 0, OBJ_VALUE_FLOAT, (uintptr_t)&timer->prevScaledTotal); + sTimerGadgets[i] = (struct ObjGadget*)d_use_obj(timerNameBuf); sTimerGadgets[i]->colourNum = timer->gadgetColourNum; - timerLabel = (struct ObjLabel *) d_makeobj(D_LABEL, AsDynName(0)); + timerLabel = (struct ObjLabel*)d_makeobj(D_LABEL, AsDynName(0)); d_set_rel_pos(5.0f, 14.0f, 0); - d_set_parm_ptr(PARM_PTR_CHAR, (void *) timer->name); - d_add_valptr(timerNameBuf, 0x40000, 0, (uintptr_t) NULL); + d_set_parm_ptr(PARM_PTR_CHAR, (void*)timer->name); + d_add_valptr(timerNameBuf, 0x40000, 0, (uintptr_t)NULL); timerLabel->unk30 = 3; } d_end_group("timerg"); - timerg = (struct ObjGroup *) d_use_obj("timerg"); - timersview = make_view( - "timersview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), 2, - 0, 10, 320, 270, timerg); + timerg = (struct ObjGroup*)d_use_obj("timerg"); + timersview = make_view("timersview", (VIEW_2_COL_BUF | VIEW_ALLOC_ZBUF | VIEW_1_CYCLE | VIEW_MOVEMENT | VIEW_DRAW), + 2, 0, 10, 320, 270, timerg); timersview->colour.r = 0.0f; timersview->colour.g = 0.0f; timersview->colour.b = 0.0f; @@ -3653,7 +3587,7 @@ void stub_renderer_18(UNUSED u32 a0) { void stub_renderer_19(UNUSED u32 a0) { } -struct GdObj *load_dynlist(struct DynList *dynlist) { +struct GdObj* load_dynlist(struct DynList* dynlist) { return proc_dynlist(dynlist); } @@ -3666,29 +3600,29 @@ void stub_renderer_20(UNUSED u32 a0) { /** * Unused (not called) */ -void func_801A71CC(struct ObjNet *net) { +void func_801A71CC(struct ObjNet* net) { s32 i; // spB4 s32 j; // spB0 f32 spAC; f32 spA8; struct GdBoundingBox bbox; UNUSED u8 filler1[4]; - struct ObjZone *sp88; - register struct ListNode *link; // s0 (84) - s32 sp80; // linked planes contained in zone? - s32 sp7C; // linked planes in net count? - register struct ListNode *link1; // s1 (78) - register struct ListNode *link2; // s2 (74) - register struct ListNode *link3; // s3 (70) + struct ObjZone* sp88; + register struct ListNode* link; // s0 (84) + s32 sp80; // linked planes contained in zone? + s32 sp7C; // linked planes in net count? + register struct ListNode* link1; // s1 (78) + register struct ListNode* link2; // s2 (74) + register struct ListNode* link3; // s3 (70) struct GdVec3f sp64; UNUSED u8 filler2[4]; - struct ObjPlane *plane; // 5c + struct ObjPlane* plane; // 5c UNUSED u8 filler3[4]; - struct ObjZone *linkedZone; // 54 + struct ObjZone* linkedZone; // 54 UNUSED u8 filler4[4]; - struct ObjPlane *planeL2; // 4c + struct ObjPlane* planeL2; // 4c UNUSED u8 filler5[4]; - struct ObjPlane *planeL3; // 44 + struct ObjPlane* planeL3; // 44 if (net->unk21C == NULL) { net->unk21C = make_group(0); @@ -3723,19 +3657,19 @@ void func_801A71CC(struct ObjNet *net) { } for (link = net->unk1CC->firstMember; link != NULL; link = link->next) { - plane = (struct ObjPlane *) link->obj; + plane = (struct ObjPlane*)link->obj; plane->unk18 = FALSE; } i = 0; // acts as Zone N here... kinda for (link1 = net->unk21C->firstMember; link1 != NULL; link1 = link1->next) { - linkedZone = (struct ObjZone *) link1->obj; + linkedZone = (struct ObjZone*)link1->obj; sp88 = linkedZone; sp7C = 0; sp80 = 0; for (link2 = net->unk1CC->firstMember; link2 != NULL; link2 = link2->next) { - planeL2 = (struct ObjPlane *) link2->obj; + planeL2 = (struct ObjPlane*)link2->obj; sp7C++; if (gd_plane_point_within(&planeL2->boundingBox, &sp88->boundingBox)) { planeL2->unk18 = TRUE; @@ -3752,7 +3686,7 @@ void func_801A71CC(struct ObjNet *net) { } for (link3 = net->unk1CC->firstMember; link3 != NULL; link3 = link3->next) { - planeL3 = (struct ObjPlane *) link3->obj; + planeL3 = (struct ObjPlane*)link3->obj; if (!planeL3->unk18) { gd_print_bounding_box("plane=", &planeL3->boundingBox); diff --git a/src/goddard/sfx.c b/src/goddard/sfx.c index 78ce2047..a3f88604 100644 --- a/src/goddard/sfx.c +++ b/src/goddard/sfx.c @@ -2,8 +2,8 @@ #include "sfx.h" -static u32 sCurrSfx; // bitset of currently playing sound effects -static u32 sPrevSfx; // bitset of sound effects that were playing on the previous frame +static u32 sCurrSfx; // bitset of currently playing sound effects +static u32 sPrevSfx; // bitset of sound effects that were playing on the previous frame /** * Stops all sound effects diff --git a/src/goddard/shape_helper.c b/src/goddard/shape_helper.c index 1b41a987..e25d267b 100644 --- a/src/goddard/shape_helper.c +++ b/src/goddard/shape_helper.c @@ -17,38 +17,43 @@ #include "skin.h" // data -struct ObjGroup *gMarioFaceGrp = NULL; // @ 801A82E0; returned by load_dynlist -struct ObjShape *gSpotShape = NULL; // Shape used for drawing lights? -static struct ObjShape *sGrabJointTestShape = NULL; // Test shape for showing grab joints. This isn't rendered due to make_grabber_joint setting the drawFlags to OBJ_INVISIBLE. -struct ObjShape *gShapeRedSpark = NULL; // @ 801A82EC -struct ObjShape *gShapeSilverSpark = NULL; // @ 801A82F0 -struct ObjShape *gShapeRedStar = NULL; // @ 801A82F4 -struct ObjShape *gShapeSilverStar = NULL; // @ 801A82F8 +struct ObjGroup* gMarioFaceGrp = NULL; // @ 801A82E0; returned by load_dynlist +struct ObjShape* gSpotShape = NULL; // Shape used for drawing lights? +static struct ObjShape* sGrabJointTestShape = NULL; // Test shape for showing grab joints. This isn't rendered due to + // make_grabber_joint setting the drawFlags to OBJ_INVISIBLE. +struct ObjShape* gShapeRedSpark = NULL; // @ 801A82EC +struct ObjShape* gShapeSilverSpark = NULL; // @ 801A82F0 +struct ObjShape* gShapeRedStar = NULL; // @ 801A82F4 +struct ObjShape* gShapeSilverStar = NULL; // @ 801A82F8 // Not sure what this data is, but it looks like stub animation data static struct GdAnimTransform unusedAnimData1[] = { - { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, + { { 1.0, 1.0, 1.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 } }, }; -UNUSED static struct AnimDataInfo unusedAnim1 = { ARRAY_COUNT(unusedAnimData1), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData1 }; +UNUSED static struct AnimDataInfo unusedAnim1 = { ARRAY_COUNT(unusedAnimData1), GD_ANIM_SCALE3F_ROT3F_POS3F_2, + unusedAnimData1 }; static struct GdAnimTransform unusedAnimData2[] = { - { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, + { { 1.0, 1.0, 1.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 } }, }; -UNUSED static struct AnimDataInfo unusedAnim2 = { ARRAY_COUNT(unusedAnimData2), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData2 }; +UNUSED static struct AnimDataInfo unusedAnim2 = { ARRAY_COUNT(unusedAnimData2), GD_ANIM_SCALE3F_ROT3F_POS3F_2, + unusedAnimData2 }; static struct GdAnimTransform unusedAnimData3[] = { - { {1.0, 1.0, 1.0}, {0.0, 0.0, 0.0}, {0.0, 0.0, 0.0} }, + { { 1.0, 1.0, 1.0 }, { 0.0, 0.0, 0.0 }, { 0.0, 0.0, 0.0 } }, }; -UNUSED static struct AnimDataInfo unusedAnim3 = { ARRAY_COUNT(unusedAnimData3), GD_ANIM_SCALE3F_ROT3F_POS3F_2, unusedAnimData3 }; +UNUSED static struct AnimDataInfo unusedAnim3 = { ARRAY_COUNT(unusedAnimData3), GD_ANIM_SCALE3F_ROT3F_POS3F_2, + unusedAnimData3 }; UNUSED static s32 sUnref801A838C[6] = { 0 }; -struct ObjShape *sSimpleShape = NULL; +struct ObjShape* sSimpleShape = NULL; UNUSED static s32 sUnref801A83A8[31] = { 0 }; -UNUSED static struct DynList sSimpleDylist[8] = { // unused +UNUSED static struct DynList sSimpleDylist[8] = { + // unused BeginList(), StartGroup("simpleg"), MakeDynObj(D_NET, "simple"), @@ -64,8 +69,7 @@ static struct DynList sDynlist801A84E4[3] = { EndList(), }; UNUSED static struct DynList sDynlist801A85B3[5] = { - BeginList(), CallList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01), - EndList(), + BeginList(), CallList(sDynlist801A84E4), SetFlag(0x400), SetFriction(0.04, 0.01, 0.01), EndList(), }; UNUSED static struct DynList sDynlist801A85A4[4] = { BeginList(), @@ -83,37 +87,37 @@ static f64 D_801A8668 = 0.0; // bss UNUSED static u8 sUnrefSpaceB00[0x2C]; // @ 801BAB00 -static struct ObjGroup *sCubeShapeGroup; // @ 801BAB2C +static struct ObjGroup* sCubeShapeGroup; // @ 801BAB2C UNUSED static u8 sUnrefSpaceB30[0xC]; // @ 801BAB30 -static struct ObjShape *sCubeShape; // @ 801BAB3C +static struct ObjShape* sCubeShape; // @ 801BAB3C UNUSED static u8 sUnrefSpaceB40[0x8]; // @ 801BAB40 static char sGdLineBuf[0x100]; // @ 801BAB48 static s32 sGdLineBufCsr; // @ 801BAC48 -static struct GdFile *sGdShapeFile; // @ 801BAC4C -static struct ObjShape *sGdShapeListHead; // @ 801BAC50 +static struct GdFile* sGdShapeFile; // @ 801BAC4C +static struct ObjShape* sGdShapeListHead; // @ 801BAC50 static u32 sGdShapeCount; // @ 801BAC54 UNUSED static u8 sUnrefSpaceC58[0x8]; // @ 801BAC58 static struct GdVec3f D_801BAC60; -UNUSED static u32 sUnrefSpaceC6C; // @ 801BAC6C -UNUSED static u32 sUnrefSpaceC70; // @ 801BAC70 -static struct ObjPlane *D_801BAC74; -static struct ObjPlane *D_801BAC78; // sShapeNetHead? -UNUSED static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80 -static struct ObjFace *D_801BAC9C; -static struct ObjFace *D_801BACA0; -UNUSED static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8 +UNUSED static u32 sUnrefSpaceC6C; // @ 801BAC6C +UNUSED static u32 sUnrefSpaceC70; // @ 801BAC70 +static struct ObjPlane* D_801BAC74; +static struct ObjPlane* D_801BAC78; // sShapeNetHead? +UNUSED static u8 sUnrefSpaceC80[0x1C]; // @ 801BAC80 +static struct ObjFace* D_801BAC9C; +static struct ObjFace* D_801BACA0; +UNUSED static u8 sUnrefSpaceCA8[0x10]; // @ 801BACA8 /// factor for scaling vertices in an `ObjShape` when calling `scale_verts_in_shape()` static struct GdVec3f sVertexScaleFactor; /// factor for translating vertices in an `ObjShape` when calling `translate_verts_in_shape()` static struct GdVec3f sVertexTranslateOffset; -UNUSED static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8 -static struct ObjGroup *D_801BAD08; // group of planes from make_netfromshape -UNUSED static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10 -static struct GdVec3f sShapeCenter; // printed with "c=" -UNUSED static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40 +UNUSED static u8 sUnrefSpaceCD8[0x30]; // @ 801BACD8 +static struct ObjGroup* D_801BAD08; // group of planes from make_netfromshape +UNUSED static u8 sUnrefSpaceD10[0x20]; // @ 801BAD10 +static struct GdVec3f sShapeCenter; // printed with "c=" +UNUSED static u8 sUnrefSpaceD40[0x120]; // @ 801BAD40 // Forward Declarations -struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *, s32, f32, f32, f32); +struct ObjMaterial* find_or_add_new_mtl(struct ObjGroup*, s32, f32, f32, f32); /* @ 245A50 for 0x40 */ /* Something to do with shape list/group initialization? */ @@ -126,21 +130,21 @@ void func_80197280(void) { /** * Computes the normal vector for a face based on three of its vertices. */ -void calc_face_normal(struct ObjFace *face) { +void calc_face_normal(struct ObjFace* face) { UNUSED u8 filler1[4]; struct GdVec3f p1; struct GdVec3f p2; struct GdVec3f p3; struct GdVec3f normal; - struct ObjVertex *vtx1; - struct ObjVertex *vtx2; - struct ObjVertex *vtx3; + struct ObjVertex* vtx1; + struct ObjVertex* vtx2; + struct ObjVertex* vtx3; UNUSED u8 filler2[4]; f32 mul = 1000.0f; imin("calc_facenormal"); - if (face->vtxCount >= 3) { // need at least three points to compute a normal + if (face->vtxCount >= 3) { // need at least three points to compute a normal vtx1 = face->vertices[0]; p1.x = vtx1->pos.x; p1.y = vtx1->pos.y; @@ -172,10 +176,10 @@ void calc_face_normal(struct ObjFace *face) { } /* @ 245CDC for 0x118 */ -struct ObjVertex *gd_make_vertex(f32 x, f32 y, f32 z) { - struct ObjVertex *vtx; +struct ObjVertex* gd_make_vertex(f32 x, f32 y, f32 z) { + struct ObjVertex* vtx; - vtx = (struct ObjVertex *) make_object(OBJ_TYPE_VERTICES); + vtx = (struct ObjVertex*)make_object(OBJ_TYPE_VERTICES); vtx->id = 0xD1D4; vtx->pos.x = x; @@ -198,11 +202,11 @@ struct ObjVertex *gd_make_vertex(f32 x, f32 y, f32 z) { } /* @ 245DF4 for 0xAC */ -struct ObjFace *make_face_with_colour(f32 r, f32 g, f32 b) { - struct ObjFace *newFace; +struct ObjFace* make_face_with_colour(f32 r, f32 g, f32 b) { + struct ObjFace* newFace; imin("make_face"); - newFace = (struct ObjFace *) make_object(OBJ_TYPE_FACES); + newFace = (struct ObjFace*)make_object(OBJ_TYPE_FACES); newFace->colour.r = r; newFace->colour.g = g; @@ -217,10 +221,10 @@ struct ObjFace *make_face_with_colour(f32 r, f32 g, f32 b) { } /* @ 245EA0 for 0x6C */ -struct ObjFace *make_face_with_material(struct ObjMaterial *mtl) { - struct ObjFace *newFace; +struct ObjFace* make_face_with_material(struct ObjMaterial* mtl) { + struct ObjFace* newFace; - newFace = (struct ObjFace *) make_object(OBJ_TYPE_FACES); + newFace = (struct ObjFace*)make_object(OBJ_TYPE_FACES); newFace->vtxCount = 0; newFace->mtlId = mtl->id; @@ -230,8 +234,8 @@ struct ObjFace *make_face_with_material(struct ObjMaterial *mtl) { } /* @ 245F0C for 0x88 */ -void add_4_vertices_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjVertex *vtx2, - struct ObjVertex *vtx3, struct ObjVertex *vtx4) { +void add_4_vertices_to_face(struct ObjFace* face, struct ObjVertex* vtx1, struct ObjVertex* vtx2, + struct ObjVertex* vtx3, struct ObjVertex* vtx4) { face->vertices[0] = vtx1; face->vertices[1] = vtx2; face->vertices[2] = vtx3; @@ -241,8 +245,7 @@ void add_4_vertices_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct } /* @ 245F94 for 0x78; orig name: func_801977C4 */ -void add_3_vtx_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjVertex *vtx2, - struct ObjVertex *vtx3) { +void add_3_vtx_to_face(struct ObjFace* face, struct ObjVertex* vtx1, struct ObjVertex* vtx2, struct ObjVertex* vtx3) { face->vertices[0] = vtx1; face->vertices[1] = vtx2; face->vertices[2] = vtx3; @@ -253,12 +256,12 @@ void add_3_vtx_to_face(struct ObjFace *face, struct ObjVertex *vtx1, struct ObjV /** * Creates an `ObjShape` object */ -struct ObjShape *make_shape(s32 flag, const char *name) { - struct ObjShape *newShape; - struct ObjShape *curShapeHead; +struct ObjShape* make_shape(s32 flag, const char* name) { + struct ObjShape* newShape; + struct ObjShape* curShapeHead; UNUSED u8 filler[4]; - newShape = (struct ObjShape *) make_object(OBJ_TYPE_SHAPES); + newShape = (struct ObjShape*)make_object(OBJ_TYPE_SHAPES); if (name != NULL) { gd_strcpy(newShape->name, name); @@ -370,7 +373,7 @@ s32 scan_to_next_non_whitespace(void) { } /* @ 246440 for 0xE0; orig name: func_80197C70 */ -s32 is_next_buf_word(char *a0) { +s32 is_next_buf_word(char* a0) { char curChar; char wordBuf[0xfc]; u32 bufLength; @@ -391,7 +394,7 @@ s32 is_next_buf_word(char *a0) { } /* @ 246520 for 0x198; orig name: func_80197D50 */ -s32 getfloat(f32 *floatPtr) { +s32 getfloat(f32* floatPtr) { char charBuf[0x100]; u32 bufCsr; char curChar; @@ -422,14 +425,14 @@ s32 getfloat(f32 *floatPtr) { charBuf[bufCsr] = '\0'; parsedDouble = gd_lazy_atof(charBuf, &sp34); - *floatPtr = (f32) parsedDouble; + *floatPtr = (f32)parsedDouble; imout(); return !!bufCsr; } /* @ 2466B8 for 0x180; orig name: func_80197EE8 */ -s32 getint(s32 *intPtr) { +s32 getint(s32* intPtr) { char charBuf[0x100]; u32 bufCsr; char curChar; @@ -467,14 +470,14 @@ void Unknown80198068(UNUSED f32 a0) { } /* @ 24684C for 0x6C */ -void func_8019807C(struct ObjVertex *vtx) { +void func_8019807C(struct ObjVertex* vtx) { gd_rot_2d_vec(D_801BAC60.x, &vtx->pos.y, &vtx->pos.z); gd_rot_2d_vec(D_801BAC60.y, &vtx->pos.x, &vtx->pos.z); gd_rot_2d_vec(D_801BAC60.z, &vtx->pos.x, &vtx->pos.y); } /* @ 2468B8 for 0x6C */ -void func_801980E8(f32 *a0) { +void func_801980E8(f32* a0) { gd_rot_2d_vec(D_801BAC60.x, &a0[1], &a0[2]); gd_rot_2d_vec(D_801BAC60.y, &a0[0], &a0[2]); gd_rot_2d_vec(D_801BAC60.z, &a0[0], &a0[1]); @@ -488,17 +491,17 @@ void Unknown80198154(f32 x, f32 y, f32 z) { } /* @ 246954 for 0x6c */ -void Unknown80198184(struct ObjShape *shape, f32 x, f32 y, f32 z) { +void Unknown80198184(struct ObjShape* shape, f32 x, f32 y, f32 z) { UNUSED struct GdVec3f unusedVec; unusedVec.x = x; unusedVec.y = y; unusedVec.z = z; - apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) func_8019807C, shape->vtxGroup); + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t)func_8019807C, shape->vtxGroup); } /* @ 2469C0 for 0xc8 */ -void scale_obj_position(struct GdObj *obj) { +void scale_obj_position(struct GdObj* obj) { struct GdVec3f pos; if (obj->type == OBJ_TYPE_GROUPS) { @@ -517,7 +520,7 @@ void scale_obj_position(struct GdObj *obj) { } /* @ 246A88 for 0x94 */ -void translate_obj_position(struct GdObj *obj) { +void translate_obj_position(struct GdObj* obj) { struct GdVec3f pos; set_cur_dynobj(obj); @@ -531,28 +534,28 @@ void translate_obj_position(struct GdObj *obj) { } /* @ 246B1C for 0x88 */ -void scale_verts_in_shape(struct ObjShape *shape, f32 x, f32 y, f32 z) { +void scale_verts_in_shape(struct ObjShape* shape, f32 x, f32 y, f32 z) { sVertexScaleFactor.x = x; sVertexScaleFactor.y = y; sVertexScaleFactor.z = z; if (shape->vtxGroup != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) scale_obj_position, shape->vtxGroup); + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)scale_obj_position, shape->vtxGroup); } } /* @ 246BA4 for 0x70; not called */ // Guessing on the type of a0 -void translate_verts_in_shape(struct ObjShape *shape, f32 x, f32 y, f32 z) { +void translate_verts_in_shape(struct ObjShape* shape, f32 x, f32 y, f32 z) { sVertexTranslateOffset.x = x; sVertexTranslateOffset.y = y; sVertexTranslateOffset.z = z; - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) translate_obj_position, shape->vtxGroup); + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)translate_obj_position, shape->vtxGroup); } /* @ 246C14 for 0xe0 */ -void Unknown80198444(struct ObjVertex *vtx) { +void Unknown80198444(struct ObjVertex* vtx) { f64 distance; add_obj_pos_to_bounding_box(&vtx->header); @@ -569,7 +572,7 @@ void Unknown80198444(struct ObjVertex *vtx) { } /* @ 246CF4 for 0xc4 */ -void Unknown80198524(struct ObjVertex *vtx) { +void Unknown80198524(struct ObjVertex* vtx) { vtx->pos.x -= sShapeCenter.x; vtx->pos.y -= sShapeCenter.y; vtx->pos.z -= sShapeCenter.z; @@ -580,12 +583,12 @@ void Unknown80198524(struct ObjVertex *vtx) { } /* @ 246DB8 for 0x11c */ -void Unknown801985E8(struct ObjShape *shape) { +void Unknown801985E8(struct ObjShape* shape) { struct GdBoundingBox bbox; D_801A8668 = 0.0; reset_bounding_box(); - apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) Unknown80198444, shape->vtxGroup); + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t)Unknown80198444, shape->vtxGroup); get_some_bounding_box(&bbox); @@ -595,11 +598,11 @@ void Unknown801985E8(struct ObjShape *shape) { gd_print_vec("c=", &sShapeCenter); - apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) Unknown80198524, shape->vtxGroup); + apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t)Unknown80198524, shape->vtxGroup); } /* @ 246ED4 for 0x4FC; orig name: func_80198704 */ -void get_3DG1_shape(struct ObjShape *shape) { +void get_3DG1_shape(struct ObjShape* shape) { UNUSED u8 filler[8]; struct GdVec3f tempNormal; /* maybe? */ s32 curFaceVtx; @@ -607,20 +610,20 @@ void get_3DG1_shape(struct ObjShape *shape) { s32 totalVtx; s32 totalFacePoints; struct GdVec3f tempVec; - struct ObjFace *newFace; - struct ObjVertex *vtxHead = NULL; // ptr to first made ObjVertex in the Obj* list + struct ObjFace* newFace; + struct ObjVertex* vtxHead = NULL; // ptr to first made ObjVertex in the Obj* list s32 vtxCount = 0; - struct ObjFace *faceHead = NULL; // ptr to first made OBjFace in the Obj* list + struct ObjFace* faceHead = NULL; // ptr to first made OBjFace in the Obj* list s32 faceCount = 0; - struct ObjFace **facePtrArr; - struct ObjVertex **vtxPtrArr; - struct ObjMaterial *mtl; + struct ObjFace** facePtrArr; + struct ObjVertex** vtxPtrArr; + struct ObjMaterial* mtl; shape->mtlGroup = make_group(0); imin("get_3DG1_shape"); - vtxPtrArr = gd_malloc_perm(72000 * sizeof(struct ObjVertex *)); // 288,000 = 72,000 * 4 - facePtrArr = gd_malloc_perm(76000 * sizeof(struct ObjFace *)); // 304,000 = 76,000 * 4 + vtxPtrArr = gd_malloc_perm(72000 * sizeof(struct ObjVertex*)); // 288,000 = 72,000 * 4 + facePtrArr = gd_malloc_perm(76000 * sizeof(struct ObjFace*)); // 304,000 = 76,000 * 4 tempNormal.x = 0.0f; tempNormal.y = 0.0f; @@ -711,22 +714,22 @@ void get_3DG1_shape(struct ObjShape *shape) { gd_free(vtxPtrArr); gd_free(facePtrArr); - shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj *) vtxHead, NULL); - shape->faceGroup = make_group_of_type(OBJ_TYPE_FACES, (struct GdObj *) faceHead, NULL); + shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj*)vtxHead, NULL); + shape->faceGroup = make_group_of_type(OBJ_TYPE_FACES, (struct GdObj*)faceHead, NULL); imout(); } /* @ 2473D0 for 0x390; orig name: func_80198C00 */ -void get_OBJ_shape(struct ObjShape *shape) { +void get_OBJ_shape(struct ObjShape* shape) { UNUSED u8 filler[4]; struct GdColour faceClr; s32 curFaceVtx; s32 faceVtxIndex; struct GdVec3f tempVec; - struct ObjFace *newFace; - struct ObjVertex *vtxArr[4000]; - struct ObjFace *faceArr[4000]; + struct ObjFace* newFace; + struct ObjVertex* vtxArr[4000]; + struct ObjFace* faceArr[4000]; s32 faceCount = 0; s32 vtxCount = 0; @@ -807,24 +810,23 @@ void get_OBJ_shape(struct ObjShape *shape) { clear_buf_to_cr(); } - shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj *) vtxArr[0], NULL); - shape->faceGroup = make_group_of_type(OBJ_TYPE_FACES, (struct GdObj *) faceArr[0], NULL); + shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj*)vtxArr[0], NULL); + shape->faceGroup = make_group_of_type(OBJ_TYPE_FACES, (struct GdObj*)faceArr[0], NULL); } /* @ 247760 for 0x124; orig name: func_80198F90 */ -struct ObjGroup *group_faces_in_mtl_grp(struct ObjGroup *mtlGroup, struct GdObj *fromObj, - struct GdObj *toObj) { - struct ObjMaterial *curObjAsMtl; - struct ObjGroup *newGroup; - struct GdObj *curObj; - register struct ListNode *node; - struct GdObj *curLinkedObj; +struct ObjGroup* group_faces_in_mtl_grp(struct ObjGroup* mtlGroup, struct GdObj* fromObj, struct GdObj* toObj) { + struct ObjMaterial* curObjAsMtl; + struct ObjGroup* newGroup; + struct GdObj* curObj; + register struct ListNode* node; + struct GdObj* curLinkedObj; newGroup = make_group(0); for (node = mtlGroup->firstMember; node != NULL; node = node->next) { curLinkedObj = node->obj; - curObjAsMtl = (struct ObjMaterial *) curLinkedObj; + curObjAsMtl = (struct ObjMaterial*)curLinkedObj; curObj = fromObj; while (curObj != NULL) { @@ -833,7 +835,7 @@ struct ObjGroup *group_faces_in_mtl_grp(struct ObjGroup *mtlGroup, struct GdObj } if (curObj->type == OBJ_TYPE_FACES) { - if (((struct ObjFace *) curObj)->mtl == curObjAsMtl) { + if (((struct ObjFace*)curObj)->mtl == curObjAsMtl) { addto_group(newGroup, curObj); } } @@ -845,13 +847,13 @@ struct ObjGroup *group_faces_in_mtl_grp(struct ObjGroup *mtlGroup, struct GdObj } /* @ 247884 for 0x13c; orig name: func_801990B4 */ -struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *group, UNUSED s32 a1, f32 r, f32 g, f32 b) { - struct ObjMaterial *newMtl; - register struct ListNode *node; - struct ObjMaterial *foundMtl; +struct ObjMaterial* find_or_add_new_mtl(struct ObjGroup* group, UNUSED s32 a1, f32 r, f32 g, f32 b) { + struct ObjMaterial* newMtl; + register struct ListNode* node; + struct ObjMaterial* foundMtl; for (node = group->firstMember; node != NULL; node = node->next) { - foundMtl = (struct ObjMaterial *) node->obj; + foundMtl = (struct ObjMaterial*)node->obj; if (foundMtl->header.type == OBJ_TYPE_MATERIALS) { if (foundMtl->Kd.r == r) { @@ -865,15 +867,15 @@ struct ObjMaterial *find_or_add_new_mtl(struct ObjGroup *group, UNUSED s32 a1, f } newMtl = make_material(0, NULL, 1); - set_cur_dynobj((struct GdObj *)newMtl); + set_cur_dynobj((struct GdObj*)newMtl); d_set_diffuse(r, g, b); - addto_group(group, (struct GdObj *) newMtl); + addto_group(group, (struct GdObj*)newMtl); return newMtl; } /* @ 2479C0 for 0x470; orig name: func_801991F0 */ -void read_ARK_shape(struct ObjShape *shape, char *fileName) { +void read_ARK_shape(struct ObjShape* shape, char* fileName) { union { s8 bytes[0x48]; struct { @@ -909,11 +911,11 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) { UNUSED u8 filler[4]; struct GdVec3f sp48; - struct ObjFace *sp44; // newly made face with mtl sp34; - struct ObjFace *sp40 = NULL; // first made face - struct ObjVertex *sp3C; // newly made vtx - struct ObjVertex *sp38 = NULL; // first made vtx - struct ObjMaterial *sp34; // found or new mtl for face + struct ObjFace* sp44; // newly made face with mtl sp34; + struct ObjFace* sp40 = NULL; // first made face + struct ObjVertex* sp3C; // newly made vtx + struct ObjVertex* sp38 = NULL; // first made vtx + struct ObjMaterial* sp34; // found or new mtl for face UNUSED s32 sp30 = 0; UNUSED s32 sp2C = 0; @@ -998,13 +1000,13 @@ void read_ARK_shape(struct ObjShape *shape, char *fileName) { } } - shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj *) sp38, NULL); - shape->faceGroup = group_faces_in_mtl_grp(shape->mtlGroup, (struct GdObj *) sp40, NULL); + shape->vtxGroup = make_group_of_type(OBJ_TYPE_VERTICES, (struct GdObj*)sp38, NULL); + shape->faceGroup = group_faces_in_mtl_grp(shape->mtlGroup, (struct GdObj*)sp40, NULL); gd_fclose(sGdShapeFile); } /* @ 247E30 for 0x148; orig name: Unknown80199660 */ -struct GdFile *get_shape_from_file(struct ObjShape *shape, char *fileName) { +struct GdFile* get_shape_from_file(struct ObjShape* shape, char* fileName) { printf("Loading %s...\n", fileName); start_memtracker(fileName); shape->unk3C = 0; @@ -1043,9 +1045,9 @@ struct GdFile *get_shape_from_file(struct ObjShape *shape, char *fileName) { } /* @ 247F78 for 0x69c; orig name: Unknown801997A8 */ -struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 a3, s32 a4) { +struct ObjShape* make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 a3, s32 a4) { UNUSED u8 filler1[4]; - void *objBuf[32][32]; // vertex or particle depending on gridType + void* objBuf[32][32]; // vertex or particle depending on gridType f32 sp70; f32 sp6C; f32 sp68; @@ -1055,28 +1057,28 @@ struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 s32 row; s32 col; UNUSED s32 sp4C = 0; - struct ObjShape *gridShape; + struct ObjShape* gridShape; f32 sp44; - struct ObjFace *sp40 = NULL; // first made shape? - struct ObjGroup *parOrVtxGrp; // group of made particles or vertices (based on gridType) + struct ObjFace* sp40 = NULL; // first made shape? + struct ObjGroup* parOrVtxGrp; // group of made particles or vertices (based on gridType) UNUSED u8 filler3[4]; - struct ObjGroup *mtlGroup; - struct GdVec3f *sp30; // GdVec3f* ? from gd_get_colour - struct GdVec3f *sp2C; //^ - struct ObjMaterial *mtl1; // first made material - struct ObjMaterial *mtl2; // second made material + struct ObjGroup* mtlGroup; + struct GdVec3f* sp30; // GdVec3f* ? from gd_get_colour + struct GdVec3f* sp2C; //^ + struct ObjMaterial* mtl1; // first made material + struct ObjMaterial* mtl2; // second made material UNUSED u8 filler4[4]; - sp30 = (struct GdVec3f *) gd_get_colour(a1); - sp2C = (struct GdVec3f *) gd_get_colour(a2); + sp30 = (struct GdVec3f*)gd_get_colour(a1); + sp2C = (struct GdVec3f*)gd_get_colour(a2); mtl1 = make_material(0, NULL, 1); - set_cur_dynobj((struct GdObj *) mtl1); + set_cur_dynobj((struct GdObj*)mtl1); d_set_diffuse(sp30->x, sp30->y, sp30->z); mtl1->type = 0x40; mtl2 = make_material(0, NULL, 2); - set_cur_dynobj((struct GdObj *) mtl2); + set_cur_dynobj((struct GdObj*)mtl2); d_set_diffuse(sp2C->x, sp2C->y, sp2C->z); mtl2->type = 0x40; @@ -1098,8 +1100,8 @@ struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 objBuf[row][col] = gd_make_vertex(sp68, sp6C, sp70); } else if (gridType == OBJ_TYPE_PARTICLES) { objBuf[row][col] = make_particle(0, 0, sp68, sp6C + 2.0f, sp70); - ((struct ObjParticle *) objBuf[row][col])->unk44 = (1.0 + sp68) / 2.0; - ((struct ObjParticle *) objBuf[row][col])->unk48 = (1.0 + sp70) / 2.0; + ((struct ObjParticle*)objBuf[row][col])->unk44 = (1.0 + sp68) / 2.0; + ((struct ObjParticle*)objBuf[row][col])->unk48 = (1.0 + sp70) / 2.0; } sp68 += sp44; } @@ -1126,42 +1128,40 @@ struct ObjShape *make_grid_shape(enum ObjTypeFlag gridType, s32 a1, s32 a2, s32 sp40 = D_801BAC9C; } - add_3_vtx_to_face(D_801BAC9C, objBuf[row][col + 1], objBuf[row + 1][col + 1], - objBuf[row][col]); - add_3_vtx_to_face(D_801BACA0, objBuf[row + 1][col + 1], objBuf[row + 1][col], - objBuf[row][col]); + add_3_vtx_to_face(D_801BAC9C, objBuf[row][col + 1], objBuf[row + 1][col + 1], objBuf[row][col]); + add_3_vtx_to_face(D_801BACA0, objBuf[row + 1][col + 1], objBuf[row + 1][col], objBuf[row][col]); } } if (gridType == OBJ_TYPE_PARTICLES) { for (parI = 0; parI <= a3; parI++) { - ((struct ObjParticle *) objBuf[parI][0])->flags |= 2; - ((struct ObjParticle *) objBuf[parI][a4])->flags |= 2; + ((struct ObjParticle*)objBuf[parI][0])->flags |= 2; + ((struct ObjParticle*)objBuf[parI][a4])->flags |= 2; } for (parI = 0; parI <= a4; parI++) { - ((struct ObjParticle *) objBuf[0][parI])->flags |= 2; - ((struct ObjParticle *) objBuf[a3][parI])->flags |= 2; + ((struct ObjParticle*)objBuf[0][parI])->flags |= 2; + ((struct ObjParticle*)objBuf[a3][parI])->flags |= 2; } } - parOrVtxGrp = make_group_of_type(gridType, (struct GdObj *) objBuf[0][0], NULL); + parOrVtxGrp = make_group_of_type(gridType, (struct GdObj*)objBuf[0][0], NULL); gridShape->vtxGroup = parOrVtxGrp; gridShape->mtlGroup = mtlGroup; - gridShape->faceGroup = group_faces_in_mtl_grp(gridShape->mtlGroup, (struct GdObj *) sp40, NULL); + gridShape->faceGroup = group_faces_in_mtl_grp(gridShape->mtlGroup, (struct GdObj*)sp40, NULL); printf("grid: points=%d, faces=%d\n", gridShape->vtxGroup->id, gridShape->faceGroup->id); return gridShape; } /* @ 248614 for 0x44 */ -void Unknown80199E44(UNUSED s32 a0, struct GdObj *a1, struct GdObj *a2, UNUSED s32 a3) { - UNUSED struct ObjGroup *sp1C = make_group(2, a1, a2); +void Unknown80199E44(UNUSED s32 a0, struct GdObj* a1, struct GdObj* a2, UNUSED s32 a3) { + UNUSED struct ObjGroup* sp1C = make_group(2, a1, a2); } /* @ 248658 for 0x5c */ -void Unknown80199E88(struct ObjFace *face) { +void Unknown80199E88(struct ObjFace* face) { D_801BAC74 = make_plane(FALSE, face); if (D_801BAC78 == NULL) { @@ -1170,16 +1170,16 @@ void Unknown80199E88(struct ObjFace *face) { } /* @ 2486B4 for 0xbc; orig name: func_80199EE4 */ -struct ObjNet *make_netfromshape(struct ObjShape *shape) { - struct ObjNet *newNet; +struct ObjNet* make_netfromshape(struct ObjShape* shape) { + struct ObjNet* newNet; if (shape == NULL) { fatal_printf("make_netfromshape(): null shape ptr"); } D_801BAC78 = NULL; - apply_to_obj_types_in_group(OBJ_TYPE_FACES, (applyproc_t) Unknown80199E88, shape->faceGroup); - D_801BAD08 = make_group_of_type(OBJ_TYPE_PLANES, (struct GdObj *) D_801BAC78, NULL); + apply_to_obj_types_in_group(OBJ_TYPE_FACES, (applyproc_t)Unknown80199E88, shape->faceGroup); + D_801BAD08 = make_group_of_type(OBJ_TYPE_PLANES, (struct GdObj*)D_801BAC78, NULL); newNet = make_net(0, shape, NULL, D_801BAD08, shape->vtxGroup); newNet->netType = 1; @@ -1189,11 +1189,11 @@ struct ObjNet *make_netfromshape(struct ObjShape *shape) { /** * Controls the dizzy (game over) animation of Mario's head. */ -void animate_mario_head_gameover(struct ObjAnimator *self) { +void animate_mario_head_gameover(struct ObjAnimator* self) { switch (self->state) { case 0: self->frame = 1.0f; - self->animSeqNum = 1; // game over anim sequence + self->animSeqNum = 1; // game over anim sequence self->state = 1; break; case 1: @@ -1203,7 +1203,7 @@ void animate_mario_head_gameover(struct ObjAnimator *self) { self->frame = 69.0f; self->state = 4; self->controlFunc = animate_mario_head_normal; - self->animSeqNum = 0; // normal anim sequence + self->animSeqNum = 0; // normal anim sequence } break; } @@ -1212,7 +1212,7 @@ void animate_mario_head_gameover(struct ObjAnimator *self) { /** * Controls the normal animation of Mario's head. This functions like a state machine. */ -void animate_mario_head_normal(struct ObjAnimator *self) { +void animate_mario_head_normal(struct ObjAnimator* self) { s32 state = 0; // TODO: label these states s32 aBtnPressed = gGdCtrl.dragging; @@ -1220,7 +1220,7 @@ void animate_mario_head_normal(struct ObjAnimator *self) { case 0: // initialize? self->frame = 1.0f; - self->animSeqNum = 0; // normal anim sequence + self->animSeqNum = 0; // normal anim sequence state = 2; self->nods = 5; break; @@ -1267,7 +1267,7 @@ void animate_mario_head_normal(struct ObjAnimator *self) { self->stillTimer = 150; break; - case 7: // Mario is staying still while his eyes follow the cursor + case 7: // Mario is staying still while his eyes follow the cursor if (aBtnPressed) { self->stillTimer = 300; } else { @@ -1293,35 +1293,35 @@ void animate_mario_head_normal(struct ObjAnimator *self) { * Loads the Mario head from `dynlist_mario_master`, sets up grabbers, and makes * sparkle particles */ -s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { - struct ObjNet *sp54; // net made with sp48 group +s32 load_mario_head(void (*aniFn)(struct ObjAnimator*)) { + struct ObjNet* sp54; // net made with sp48 group UNUSED u8 filler1[8]; - struct ObjGroup *sp48; // Joint group + struct ObjGroup* sp48; // Joint group UNUSED u8 filler2[8]; - struct ObjGroup *mainShapesGrp; - struct GdObj *sp38; // object list head before making a bunch of joints - struct GdObj *faceJoint; // joint on the face that `grabberJoint` pulls - struct ObjJoint *grabberJoint; // joint that's dragged by the cursor - struct ObjCamera *camera; - struct ObjAnimator *animator; - struct ObjParticle *particle; + struct ObjGroup* mainShapesGrp; + struct GdObj* sp38; // object list head before making a bunch of joints + struct GdObj* faceJoint; // joint on the face that `grabberJoint` pulls + struct ObjJoint* grabberJoint; // joint that's dragged by the cursor + struct ObjCamera* camera; + struct ObjAnimator* animator; + struct ObjParticle* particle; // Load Mario head from the dynlist start_memtracker("mario face"); - d_set_name_suffix("l"); // add "l" to the end of all dynobj names generated by the dynlist, for some reason + d_set_name_suffix("l"); // add "l" to the end of all dynobj names generated by the dynlist, for some reason d_use_integer_names(TRUE); - animator = (struct ObjAnimator *) d_makeobj(D_ANIMATOR, AsDynName(DYNOBJ_MARIO_MAIN_ANIMATOR)); + animator = (struct ObjAnimator*)d_makeobj(D_ANIMATOR, AsDynName(DYNOBJ_MARIO_MAIN_ANIMATOR)); animator->controlFunc = aniFn; d_use_integer_names(FALSE); // FIXME: make segment address work once seg4 is disassembled - gMarioFaceGrp = (struct ObjGroup *) load_dynlist(dynlist_mario_master); + gMarioFaceGrp = (struct ObjGroup*)load_dynlist(dynlist_mario_master); stop_memtracker("mario face"); // Make camera - camera = (struct ObjCamera *) d_makeobj(D_CAMERA, NULL); + camera = (struct ObjCamera*)d_makeobj(D_CAMERA, NULL); d_set_rel_pos(0.0f, 200.0f, 2000.0f); d_set_world_pos(0.0f, 200.0f, 2000.0f); d_set_flags(4); @@ -1332,7 +1332,7 @@ s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { addto_group(gMarioFaceGrp, &camera->header); addto_group(gMarioFaceGrp, &animator->header); - d_set_name_suffix(NULL); // stop adding "l" to generated dynobj names + d_set_name_suffix(NULL); // stop adding "l" to generated dynobj names // Make sparkle particles @@ -1357,59 +1357,59 @@ s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { particle->shapePtr = gShapeRedSpark; addto_group(gGdLightGroup, &particle->header); - mainShapesGrp = (struct ObjGroup *) d_use_obj("N1000l"); // DYNOBJ_MARIO_MAIN_SHAPES_GROUP + mainShapesGrp = (struct ObjGroup*)d_use_obj("N1000l"); // DYNOBJ_MARIO_MAIN_SHAPES_GROUP create_gddl_for_shapes(mainShapesGrp); sp38 = gGdObjectList; // Make grabbers to move the face with the cursor grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, -500.0f, 0.0f, -150.0f); - faceJoint = d_use_obj("N167l"); // DYNOBJ_MARIO_LEFT_EAR_JOINT_1 + faceJoint = d_use_obj("N167l"); // DYNOBJ_MARIO_LEFT_EAR_JOINT_1 grabberJoint->attachedObjsGrp = make_group(1, faceJoint); grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 500.0f, 0.0f, -150.0f); - faceJoint = d_use_obj("N176l"); // DYNOBJ_MARIO_RIGHT_EAR_JOINT_1 + faceJoint = d_use_obj("N176l"); // DYNOBJ_MARIO_RIGHT_EAR_JOINT_1 grabberJoint->attachedObjsGrp = make_group(1, faceJoint); grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 0.0f, 700.0f, 300.0f); - faceJoint = d_use_obj("N131l"); // DYNOBJ_MARIO_CAP_JOINT_1 + faceJoint = d_use_obj("N131l"); // DYNOBJ_MARIO_CAP_JOINT_1 grabberJoint->attachedObjsGrp = make_group(1, faceJoint); // drag eyelids and eyebrows along with cap? - faceJoint = d_use_obj("N206l"); // DYNOBJ_LEFT_EYELID_JOINT_1 + faceJoint = d_use_obj("N206l"); // DYNOBJ_LEFT_EYELID_JOINT_1 addto_group(grabberJoint->attachedObjsGrp, faceJoint); - faceJoint = d_use_obj("N215l"); // DYNOBJ_RIGHT_EYELID_JOINT_1 + faceJoint = d_use_obj("N215l"); // DYNOBJ_RIGHT_EYELID_JOINT_1 addto_group(grabberJoint->attachedObjsGrp, faceJoint); - faceJoint = d_use_obj("N31l"); // DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1 + faceJoint = d_use_obj("N31l"); // DYNOBJ_MARIO_LEFT_EYEBROW_MPART_JOINT_1 addto_group(grabberJoint->attachedObjsGrp, faceJoint); - faceJoint = d_use_obj("N65l"); // DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1 + faceJoint = d_use_obj("N65l"); // DYNOBJ_MARIO_RIGHT_EYEBROW_MPART_JOINT_1 addto_group(grabberJoint->attachedObjsGrp, faceJoint); grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 0.0f, 0.0f, 600.0f); - faceJoint = d_use_obj("N185l"); // DYNOBJ_MARIO_NOSE_JOINT_1 + faceJoint = d_use_obj("N185l"); // DYNOBJ_MARIO_NOSE_JOINT_1 grabberJoint->attachedObjsGrp = make_group(1, faceJoint); grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 0.0f, -300.0f, 300.0f); - faceJoint = d_use_obj("N194l"); // DYNOBJ_MARIO_LEFT_JAW_JOINT + faceJoint = d_use_obj("N194l"); // DYNOBJ_MARIO_LEFT_JAW_JOINT grabberJoint->attachedObjsGrp = make_group(1, faceJoint); grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 250.0f, -150.0f, 300.0f); - faceJoint = d_use_obj("N158l"); // DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1 + faceJoint = d_use_obj("N158l"); // DYNOBJ_MARIO_RIGHT_LIP_CORNER_JOINT_1 grabberJoint->attachedObjsGrp = make_group(1, faceJoint); - faceJoint = d_use_obj("N15l"); // DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1 + faceJoint = d_use_obj("N15l"); // DYNOBJ_MARIO_LEFT_MUSTACHE_JOINT_1 addto_group(grabberJoint->attachedObjsGrp, faceJoint); grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, -250.0f, -150.0f, 300.0f); - faceJoint = d_use_obj("N149l"); // DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1 + faceJoint = d_use_obj("N149l"); // DYNOBJ_MARIO_LEFT_LIP_CORNER_JOINT_1 grabberJoint->attachedObjsGrp = make_group(1, faceJoint); - faceJoint = d_use_obj("N6l"); // DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1 + faceJoint = d_use_obj("N6l"); // DYNOBJ_MARIO_RIGHT_MUSTACHE_JOINT_1 addto_group(grabberJoint->attachedObjsGrp, faceJoint); // make the left eye follow cursor grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, 100.0f, 200.0f, 400.0f); - faceJoint = d_use_obj("N112l"); // DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET + faceJoint = d_use_obj("N112l"); // DYNOBJ_MARIO_RIGHT_EYE_UNKNOWN_NET grabberJoint->attachedObjsGrp = make_group(1, faceJoint); grabberJoint->updateFunc = eye_joint_update_func; grabberJoint->rootAnimator = animator; @@ -1417,7 +1417,7 @@ s32 load_mario_head(void (*aniFn)(struct ObjAnimator *)) { // make the right eye follow cursor grabberJoint = make_grabber_joint(sGrabJointTestShape, 0, -100.0f, 200.0f, 400.0f); - faceJoint = d_use_obj("N96l"); // DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET + faceJoint = d_use_obj("N96l"); // DYNOBJ_MARIO_LEFT_EYE_UNKNOWN_NET grabberJoint->attachedObjsGrp = make_group(1, faceJoint); grabberJoint->updateFunc = eye_joint_update_func; grabberJoint->rootAnimator = animator; @@ -1440,10 +1440,10 @@ void load_shapes2(void) { sCubeShape = make_shape(0, "cube"); - gSpotShape = (struct ObjShape *) load_dynlist(dynlist_spot_shape); + gSpotShape = (struct ObjShape*)load_dynlist(dynlist_spot_shape); scale_verts_in_shape(gSpotShape, 200.0f, 200.0f, 200.0f); - sGrabJointTestShape = (struct ObjShape *) load_dynlist(dynlist_test_cube); + sGrabJointTestShape = (struct ObjShape*)load_dynlist(dynlist_test_cube); scale_verts_in_shape(sGrabJointTestShape, 30.0f, 30.0f, 30.0f); sCubeShapeGroup = make_group_of_type(OBJ_TYPE_SHAPES, &sCubeShape->header, NULL); @@ -1453,10 +1453,10 @@ void load_shapes2(void) { } /* @ 249368 -> 249594 */ -struct ObjGroup *Unknown8019AB98(UNUSED u32 a0) { - struct ObjLight *light1; - struct ObjLight *light2; - struct GdObj *oldObjHead = gGdObjectList; // obj head node before making lights +struct ObjGroup* Unknown8019AB98(UNUSED u32 a0) { + struct ObjLight* light1; + struct ObjLight* light2; + struct GdObj* oldObjHead = gGdObjectList; // obj head node before making lights light1 = make_light(0, NULL, 0); light1->position.x = 100.0f; @@ -1497,10 +1497,10 @@ struct ObjGroup *Unknown8019AB98(UNUSED u32 a0) { } /* @ 249594 for 0x100 */ -struct ObjGroup *Unknown8019ADC4(UNUSED u32 a0) { - UNUSED struct ObjLight *unusedLight; - struct ObjLight *newLight; - struct GdObj *oldObjHead; +struct ObjGroup* Unknown8019ADC4(UNUSED u32 a0) { + UNUSED struct ObjLight* unusedLight; + struct ObjLight* newLight; + struct GdObj* oldObjHead; unusedLight = make_light(0, NULL, 0); oldObjHead = gGdObjectList; @@ -1522,9 +1522,9 @@ struct ObjGroup *Unknown8019ADC4(UNUSED u32 a0) { } /* @ 249694 for 0x5c */ -struct ObjGroup *Unknown8019AEC4(UNUSED u32 a0) { +struct ObjGroup* Unknown8019AEC4(UNUSED u32 a0) { UNUSED u8 filler[8]; - UNUSED struct GdObj *sp1C = gGdObjectList; + UNUSED struct GdObj* sp1C = gGdObjectList; gGdLightGroup = make_group(0); diff --git a/src/goddard/skin.c b/src/goddard/skin.c index ab327eb4..cc759c69 100644 --- a/src/goddard/skin.c +++ b/src/goddard/skin.c @@ -17,19 +17,19 @@ #include "skin_movement.h" // bss -struct ObjNet *gGdSkinNet; // @ 801BAAF0 +struct ObjNet* gGdSkinNet; // @ 801BAAF0 static s32 D_801BAAF4; static s32 sNetCount; // @ 801BAAF8 /* 2406E0 -> 240894 */ -void compute_net_bounding_box(struct ObjNet *net) { +void compute_net_bounding_box(struct ObjNet* net) { reset_bounding_box(); if (net->unk1D0 != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) add_obj_pos_to_bounding_box, net->unk1D0); + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)add_obj_pos_to_bounding_box, net->unk1D0); } if (net->unk1C8 != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t) add_obj_pos_to_bounding_box, net->unk1C8); + apply_to_obj_types_in_group(OBJ_TYPE_ALL, (applyproc_t)add_obj_pos_to_bounding_box, net->unk1C8); } gSomeBoundingBox.minX *= net->scale.x; gSomeBoundingBox.maxX *= net->scale.x; @@ -47,8 +47,8 @@ void compute_net_bounding_box(struct ObjNet *net) { } /* 240894 -> 240A64; orig name: func_801920C4 */ -void reset_net(struct ObjNet *net) { - struct ObjGroup *grp; +void reset_net(struct ObjNet* net) { + struct ObjGroup* grp; printf("reset_net %d\n", net->id); @@ -66,20 +66,20 @@ void reset_net(struct ObjNet *net) { D_801BAAF4 = 0; gd_set_identity_mat4(&net->mat168); gd_set_identity_mat4(&net->matE8); - gd_rot_mat_about_vec(&net->matE8, &net->unk68); // set rot mtx to initial rotation? + gd_rot_mat_about_vec(&net->matE8, &net->unk68); // set rot mtx to initial rotation? gd_add_vec3f_to_mat4f_offset(&net->matE8, &net->worldPos); // set to initial position? gd_copy_mat4f(&net->matE8, &net->mat128); if ((grp = net->unk1C8) != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) reset_joint, grp); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191220, grp); - apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018FB58, grp); - apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018FA68, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)reset_joint, grp); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_80191220, grp); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t)func_8018FB58, grp); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t)func_8018FA68, grp); } } /* 240A64 -> 240ACC */ -void func_80192294(struct ObjNet *net) { +void func_80192294(struct ObjNet* net) { UNUSED s32 sp1C = 0; if (net->attachedToObj == NULL) { @@ -90,8 +90,8 @@ void func_80192294(struct ObjNet *net) { } /* 240ACC -> 240B84 */ -void func_801922FC(struct ObjNet *net) { - struct ObjGroup *group; // 24 +void func_801922FC(struct ObjNet* net) { + struct ObjGroup* group; // 24 UNUSED u8 filler[8]; gGdSkinNet = net; @@ -102,17 +102,17 @@ void func_801922FC(struct ObjNet *net) { scale_verts(net->shapePtr->vtxGroup); } if ((group = net->unk1C8) != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) reset_joint_weights, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)reset_joint_weights, group); } } } /* 240B84 -> 240CF8 */ -struct ObjNet *make_net(UNUSED s32 a0, struct ObjShape *shapedata, struct ObjGroup *a2, - struct ObjGroup *a3, struct ObjGroup *a4) { - struct ObjNet *net; +struct ObjNet* make_net(UNUSED s32 a0, struct ObjShape* shapedata, struct ObjGroup* a2, struct ObjGroup* a3, + struct ObjGroup* a4) { + struct ObjNet* net; - net = (struct ObjNet *) make_object(OBJ_TYPE_NETS); + net = (struct ObjNet*)make_object(OBJ_TYPE_NETS); gd_set_identity_mat4(&net->mat128); net->initPos.x = net->initPos.y = net->initPos.z = 0.0f; net->id = ++sNetCount; @@ -133,7 +133,7 @@ struct ObjNet *make_net(UNUSED s32 a0, struct ObjShape *shapedata, struct ObjGro } /* 240CF8 -> 240E74 */ -void func_80192528(struct ObjNet *net) { +void func_80192528(struct ObjNet* net) { net->unusedForce.x = net->unusedForce.y = net->unusedForce.z = 0.0f; net->collDisp.x = net->collDisp.y = net->collDisp.z = 0.0f; net->collTorque.x = net->collTorque.y = net->collTorque.z = 0.0f; @@ -160,7 +160,7 @@ void func_80192528(struct ObjNet *net) { } /* 240E74 -> 2412A0 */ -void collision_something_801926A4(struct ObjNet *net) { +void collision_something_801926A4(struct ObjNet* net) { if (gGdCounter.ctr1 != 0) { if (D_801B9E34 != 0.0f) { D_801B9E28.x /= D_801B9E34; @@ -199,11 +199,11 @@ void collision_something_801926A4(struct ObjNet *net) { } /* 2412A0 -> 24142C; not called */ -void func_80192AD0(struct ObjNet *net) { +void func_80192AD0(struct ObjNet* net) { UNUSED u8 filler1[4]; - struct ObjGroup *sp60; + struct ObjGroup* sp60; UNUSED u8 filler2[68]; - struct ObjNet *sp18; + struct ObjNet* sp18; if ((sp60 = net->unk1C8) == NULL) { return; @@ -223,29 +223,29 @@ void func_80192AD0(struct ObjNet *net) { net->unk200.z = -4.0f; gd_rotate_and_translate_vec3f(&net->unk200, &sp18->mat128); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191824, sp60); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_80191824, sp60); func_80191E88(sp60); - apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018F328, net->unk20C); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t)func_8018F328, net->unk20C); } /* 24142C -> 24149C; orig name: func_80192C5C */ -void move_bonesnet(struct ObjNet *net) { - struct ObjGroup *sp24; +void move_bonesnet(struct ObjNet* net) { + struct ObjGroup* sp24; UNUSED u8 filler[12]; imin("move_bonesnet"); gd_set_identity_mat4(&D_801B9DC8); if ((sp24 = net->unk1C8) != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913C0, sp24); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_801913C0, sp24); } imout(); } /* 24149C -> 241768 */ -void func_80192CCC(struct ObjNet *net) { +void func_80192CCC(struct ObjNet* net) { Mat4f sp38; - UNUSED struct GdControl *ctrl; // 34 - struct ObjGroup *group; // 30 + UNUSED struct GdControl* ctrl; // 34 + struct ObjGroup* group; // 30 struct GdVec3f sp24; ctrl = &gGdCtrl; @@ -283,43 +283,43 @@ void func_80192CCC(struct ObjNet *net) { func_80192528(net); if ((group = net->unk1C8) != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_80191220, group); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913F0, group); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) stub_joints_2, group); - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801911A8, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_80191220, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_801913F0, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)stub_joints_2, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_801911A8, group); } collision_something_801926A4(net); gd_mult_mat4f(&net->mat128, &D_801B9DC8, &net->mat128); if (group != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t) func_801913C0, group); - apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t) func_8018FA68, group); + apply_to_obj_types_in_group(OBJ_TYPE_JOINTS, (applyproc_t)func_801913C0, group); + apply_to_obj_types_in_group(OBJ_TYPE_BONES, (applyproc_t)func_8018FA68, group); } } /* 241768 -> 241AB4; orig name: func_80192F98 */ -void convert_gd_verts_to_Vn(struct ObjGroup *grp) { +void convert_gd_verts_to_Vn(struct ObjGroup* grp) { UNUSED u8 filler1[20]; - Vtx *vn; // 28 + Vtx* vn; // 28 u8 nx, ny, nz; // 24, 25, 26 UNUSED u8 filler2[4]; - register struct VtxLink *vtxlink; // a1 + register struct VtxLink* vtxlink; // a1 #ifndef GBI_FLOATS - register s16 *vnPos; // a2 + register s16* vnPos; // a2 #endif - register s16 x; // a3 - register s16 y; // t0 - register s16 z; // t1 - register struct ObjVertex *vtx; // t2 - register struct ListNode *link; // t3 - struct GdObj *obj; // sp4 + register s16 x; // a3 + register s16 y; // t0 + register s16 z; // t1 + register struct ObjVertex* vtx; // t2 + register struct ListNode* link; // t3 + struct GdObj* obj; // sp4 for (link = grp->firstMember; link != NULL; link = link->next) { obj = link->obj; - vtx = (struct ObjVertex *) obj; - x = (s16) vtx->pos.x; - y = (s16) vtx->pos.y; - z = (s16) vtx->pos.z; + vtx = (struct ObjVertex*)obj; + x = (s16)vtx->pos.x; + y = (s16)vtx->pos.y; + z = (s16)vtx->pos.z; nx = (u8)(vtx->normal.x * 255.0f); ny = (u8)(vtx->normal.y * 255.0f); @@ -346,25 +346,25 @@ void convert_gd_verts_to_Vn(struct ObjGroup *grp) { } /* 241AB4 -> 241BCC; orig name: func_801932E4 */ -void convert_gd_verts_to_Vtx(struct ObjGroup *grp) { +void convert_gd_verts_to_Vtx(struct ObjGroup* grp) { UNUSED u8 filler[24]; - register struct VtxLink *vtxlink; // a1 + register struct VtxLink* vtxlink; // a1 #ifndef GBI_FLOATS - register s16 *vtxcoords; // a2 + register s16* vtxcoords; // a2 #endif - register s16 x; // a3 - register s16 y; // t0 - register s16 z; // t1 - register struct ObjVertex *vtx; // t2 - register struct ListNode *link; // t3 - struct GdObj *obj; // sp4 + register s16 x; // a3 + register s16 y; // t0 + register s16 z; // t1 + register struct ObjVertex* vtx; // t2 + register struct ListNode* link; // t3 + struct GdObj* obj; // sp4 for (link = grp->firstMember; link != NULL; link = link->next) { obj = link->obj; - vtx = (struct ObjVertex *) obj; - x = (s16) vtx->pos.x; - y = (s16) vtx->pos.y; - z = (s16) vtx->pos.z; + vtx = (struct ObjVertex*)obj; + x = (s16)vtx->pos.x; + y = (s16)vtx->pos.y; + z = (s16)vtx->pos.z; for (vtxlink = vtx->gbiVerts; vtxlink != NULL; vtxlink = vtxlink->prev) { #ifndef GBI_FLOATS @@ -382,7 +382,7 @@ void convert_gd_verts_to_Vtx(struct ObjGroup *grp) { } /* 241BCC -> 241CA0; orig name: Proc801933FC */ -void convert_net_verts(struct ObjNet *net) { +void convert_net_verts(struct ObjNet* net) { if (net->shapePtr != NULL) { if (net->shapePtr->unk30) { convert_gd_verts_to_Vn(net->shapePtr->vtxGroup); @@ -399,18 +399,18 @@ void convert_net_verts(struct ObjNet *net) { } /* 241CA0 -> 241D6C */ -static void move_joints_in_net(struct ObjNet *net) { - struct ObjGroup *grp; // 2c - register struct ListNode *link; // s0 - struct GdObj *obj; // 24 +static void move_joints_in_net(struct ObjNet* net) { + struct ObjGroup* grp; // 2c + register struct ListNode* link; // s0 + struct GdObj* obj; // 24 if ((grp = net->unk1C8) != NULL) { for (link = grp->firstMember; link != NULL; link = link->next) { obj = link->obj; switch (obj->type) { case OBJ_TYPE_JOINTS: - if (((struct ObjJoint *) obj)->updateFunc != NULL) { - (*((struct ObjJoint *) obj)->updateFunc)((struct ObjJoint *) obj); + if (((struct ObjJoint*)obj)->updateFunc != NULL) { + (*((struct ObjJoint*)obj)->updateFunc)((struct ObjJoint*)obj); } break; default:; @@ -420,7 +420,7 @@ static void move_joints_in_net(struct ObjNet *net) { } /* 241D6C -> 241E94; orig name: func_8019359C */ -void move_net(struct ObjNet *net) { +void move_net(struct ObjNet* net) { gGdSkinNet = net; switch (net->netType) { @@ -453,26 +453,26 @@ void move_net(struct ObjNet *net) { } /* 241E94 -> 241F0C; orig name: func_801936C4 */ -void move_nets(struct ObjGroup *group) { +void move_nets(struct ObjGroup* group) { imin("move_nets"); restart_timer("move_nets"); - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_80192294, group); - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) move_net, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)func_80192294, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)move_net, group); split_timer("move_nets"); imout(); } /* 241F0C -> 242018 */ -void func_8019373C(struct ObjNet *net) { - register struct ListNode *link; - struct ObjVertex *vtx; +void func_8019373C(struct ObjNet* net) { + register struct ListNode* link; + struct ObjVertex* vtx; switch (net->netType) { case 2: if (net->shapePtr != NULL) { net->shapePtr->scaledVtxGroup = make_group(0); for (link = net->shapePtr->vtxGroup->firstMember; link != NULL; link = link->next) { - vtx = (struct ObjVertex *) link->obj; + vtx = (struct ObjVertex*)link->obj; if (vtx->scaleFactor != 1.0) { addto_group(net->shapePtr->scaledVtxGroup, &vtx->header); } @@ -483,15 +483,15 @@ void func_8019373C(struct ObjNet *net) { } /* 242018 -> 24208C */ -void func_80193848(struct ObjGroup *group) { - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) reset_net, group); - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_80192294, group); - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_801922FC, group); - apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t) func_8019373C, group); +void func_80193848(struct ObjGroup* group) { + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)reset_net, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)func_80192294, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)func_801922FC, group); + apply_to_obj_types_in_group(OBJ_TYPE_NETS, (applyproc_t)func_8019373C, group); } /* 24208C -> 2422E0; not called; orig name: func_801938BC */ -void gd_print_net(struct ObjNet *net) { +void gd_print_net(struct ObjNet* net) { gd_printf("Flags:%x\n", net->flags); gd_print_vec("World:", &net->worldPos); gd_print_vec("Force:", &net->unusedForce); @@ -509,16 +509,16 @@ void gd_print_net(struct ObjNet *net) { gd_printf("MaxRadius: %f\n", net->maxRadius); gd_print_mtx("Matrix:", &net->mat128); if (net->shapePtr != NULL) { - gd_printf("ShapePtr: %x (%s)\n", (u32) (uintptr_t) net->shapePtr, net->shapePtr->name); + gd_printf("ShapePtr: %x (%s)\n", (u32)(uintptr_t)net->shapePtr, net->shapePtr->name); } else { gd_printf("ShapePtr: NULL\n"); } gd_print_vec("Scale:", &net->scale); gd_printf("Mass: %f\n", net->unusedMass); gd_printf("NumModes: %d\n", net->numModes); - gd_printf("NodeGroup: %x\n", (u32) (uintptr_t) net->unk1C8); - gd_printf("PlaneGroup: %x\n", (u32) (uintptr_t) net->unk1CC); - gd_printf("VertexGroup: %x\n", (u32) (uintptr_t) net->unk1D0); + gd_printf("NodeGroup: %x\n", (u32)(uintptr_t)net->unk1C8); + gd_printf("PlaneGroup: %x\n", (u32)(uintptr_t)net->unk1CC); + gd_printf("VertexGroup: %x\n", (u32)(uintptr_t)net->unk1D0); } /* 2422E0 -> 2422F8; orig name: func_80193B10 */ diff --git a/src/goddard/skin_movement.c b/src/goddard/skin_movement.c index fb8a8384..79fcc4f2 100644 --- a/src/goddard/skin_movement.c +++ b/src/goddard/skin_movement.c @@ -10,12 +10,12 @@ #include "skin_movement.h" /* bss */ -struct ObjWeight *sResetCurWeight; -static Mat4f D_801B9EA8; // TODO: rename to sHead2Mtx? -static struct ObjJoint *D_801B9EE8; // set but not used +struct ObjWeight* sResetCurWeight; +static Mat4f D_801B9EA8; // TODO: rename to sHead2Mtx? +static struct ObjJoint* D_801B9EE8; // set but not used /* @ 22FDB0 for 0x180 */ -void func_801815E0(Mat4f *mtx) { +void func_801815E0(Mat4f* mtx) { struct GdVec3f scratchVec; scratchVec.x = (*mtx)[0][0]; @@ -46,13 +46,13 @@ void func_801815E0(Mat4f *mtx) { /* @ 22FF30 for 0xDC */ /* called with ObjNext->unk1A8 (variable obj ptr?) ->unk20 or ->unk24 ptr*/ // TODO: figure out the proper object type for a0 -void scale_verts(struct ObjGroup *a0) { +void scale_verts(struct ObjGroup* a0) { register f32 sp1C; - register struct ListNode *link; - struct ObjVertex *vtx; + register struct ListNode* link; + struct ObjVertex* vtx; for (link = a0->firstMember; link != NULL; link = link->next) { - vtx = (struct ObjVertex *) link->obj; + vtx = (struct ObjVertex*)link->obj; if ((sp1C = vtx->scaleFactor) != 0.0f) { vtx->pos.x = vtx->initPos.x * sp1C; @@ -65,7 +65,7 @@ void scale_verts(struct ObjGroup *a0) { } /* @ 23000C for 0x58; orig name: func8018183C*/ -void move_skin(struct ObjNet *net) { +void move_skin(struct ObjNet* net) { UNUSED u8 filler[8]; if (net->shapePtr != NULL) { @@ -74,20 +74,20 @@ void move_skin(struct ObjNet *net) { } /* @ 230064 for 0x13C*/ -void func_80181894(struct ObjJoint *joint) { - register struct ObjGroup *weightGroup; // baseGroup? weights Only? +void func_80181894(struct ObjJoint* joint) { + register struct ObjGroup* weightGroup; // baseGroup? weights Only? struct GdVec3f stackVec; - register struct ObjWeight *curWeight; - register struct ObjVertex *connectedVtx; - register struct ListNode *link; + register struct ObjWeight* curWeight; + register struct ObjVertex* connectedVtx; + register struct ListNode* link; register f32 scaleFactor; - struct GdObj *linkedObj; + struct GdObj* linkedObj; weightGroup = joint->weightGrp; if (weightGroup != NULL) { for (link = weightGroup->firstMember; link != NULL; link = link->next) { linkedObj = link->obj; - curWeight = (struct ObjWeight *) linkedObj; + curWeight = (struct ObjWeight*)linkedObj; if (curWeight->weightVal > 0.0) { //? 0.0f stackVec.x = curWeight->vec20.x; @@ -107,11 +107,11 @@ void func_80181894(struct ObjJoint *joint) { } /* @ 2301A0 for 0x110 */ -void reset_weight_vtx(struct ObjVertex *vtx) { +void reset_weight_vtx(struct ObjVertex* vtx) { struct GdVec3f localVec; UNUSED u8 filler[16]; - if (sResetWeightVtxNum++ == sResetCurWeight->vtxId) { // found matching vertex + if (sResetWeightVtxNum++ == sResetCurWeight->vtxId) { // found matching vertex sResetCurWeight->vtx = vtx; localVec.x = vtx->pos.x; localVec.y = vtx->pos.y; @@ -126,17 +126,16 @@ void reset_weight_vtx(struct ObjVertex *vtx) { } } -void reset_weight(struct ObjWeight *weight) { +void reset_weight(struct ObjWeight* weight) { UNUSED u32 vtxCount; UNUSED u8 filler[4]; - struct ObjGroup *skinGroup; + struct ObjGroup* skinGroup; sResetCurWeight = weight; sResetWeightVtxNum = 0; if ((skinGroup = gGdSkinNet->skinGrp) != NULL) { // Go through every vertex in the skin group, and reset the weight if the vertex is managed by the weight - vtxCount = - apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t) reset_weight_vtx, skinGroup); + vtxCount = apply_to_obj_types_in_group(OBJ_TYPE_VERTICES, (applyproc_t)reset_weight_vtx, skinGroup); } else { fatal_printf("reset_weight(): Skin net has no SkinGroup"); } @@ -146,12 +145,12 @@ void reset_weight(struct ObjWeight *weight) { } } -void reset_joint_weights(struct ObjJoint *joint) { - struct ObjGroup *group; +void reset_joint_weights(struct ObjJoint* joint) { + struct ObjGroup* group; gd_inverse_mat4f(&joint->matE8, &D_801B9EA8); D_801B9EE8 = joint; if ((group = joint->weightGrp) != NULL) { - apply_to_obj_types_in_group(OBJ_TYPE_WEIGHTS, (applyproc_t) reset_weight, group); + apply_to_obj_types_in_group(OBJ_TYPE_WEIGHTS, (applyproc_t)reset_weight, group); } } diff --git a/src/menu/file_select.c b/src/menu/file_select.c index f0fed8ee..f3f1943e 100644 --- a/src/menu/file_select.c +++ b/src/menu/file_select.c @@ -43,7 +43,7 @@ static s16 sSoundTextX; // Amount of main menu buttons defined in the code called by spawn_object_rel_with_rot. // See file_select.h for the names in MenuButtonTypes. -static struct Object *sMainMenuButtons[NUM_BUTTONS]; +static struct Object* sMainMenuButtons[NUM_BUTTONS]; // Used to defined yes/no fade colors after a file is selected in the erase menu. // sYesNoColor[0]: YES | sYesNoColor[1]: NO @@ -60,13 +60,13 @@ static u8 sTextBaseAlpha = 0; // 2D position of the cursor on the screen. // sCursorPos[0]: X | sCursorPos[1]: Y -static f32 sCursorPos[] = {0, 0}; +static f32 sCursorPos[] = { 0, 0 }; // Determines which graphic to use for the cursor. static s16 sCursorClickingTimer = 0; // Equal to sCursorPos if the cursor gets clicked, {-10000, -10000} otherwise. -static s16 sClickPos[] = {-10000, -10000}; +static s16 sClickPos[] = { -10000, -10000 }; // Used for determining which file has been selected during copying and erasing. static s8 sSelectedFileIndex = -1; @@ -117,165 +117,165 @@ static s8 sScoreFileCoinScoreMode = 0; static s8 sOpenLangSettings = FALSE; #endif -//#ifndef VERSION_EU -//static unsigned char textReturn[] = { TEXT_RETURN }; -//#else -//static unsigned char textReturn[][8] = {{ TEXT_RETURN }, { TEXT_RETURN_FR }, { TEXT_RETURN_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textReturn[] = { TEXT_RETURN }; +// #else +// static unsigned char textReturn[][8] = {{ TEXT_RETURN }, { TEXT_RETURN_FR }, { TEXT_RETURN_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textViewScore[] = { TEXT_CHECK_SCORE }; -//#else -//static unsigned char textViewScore[][12] = {{ TEXT_CHECK_SCORE }, {TEXT_CHECK_SCORE_FR}, {TEXT_CHECK_SCORE_DE}}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textViewScore[] = { TEXT_CHECK_SCORE }; +// #else +// static unsigned char textViewScore[][12] = {{ TEXT_CHECK_SCORE }, {TEXT_CHECK_SCORE_FR}, {TEXT_CHECK_SCORE_DE}}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textCopyFileButton[] = { TEXT_COPY_FILE_BUTTON }; -//#else -//static unsigned char textCopyFileButton[][15] = {{ TEXT_COPY_FILE }, { TEXT_COPY_FILE_FR }, { TEXT_COPY_FILE_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textCopyFileButton[] = { TEXT_COPY_FILE_BUTTON }; +// #else +// static unsigned char textCopyFileButton[][15] = {{ TEXT_COPY_FILE }, { TEXT_COPY_FILE_FR }, { TEXT_COPY_FILE_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textEraseFileButton[] = { TEXT_ERASE_FILE_BUTTON }; -//#else -//static unsigned char textEraseFileButton[][16] = { {TEXT_ERASE_FILE}, {TEXT_ERASE_FILE_FR}, {TEXT_ERASE_FILE_DE} }; -//#endif +// #ifndef VERSION_EU +// static unsigned char textEraseFileButton[] = { TEXT_ERASE_FILE_BUTTON }; +// #else +// static unsigned char textEraseFileButton[][16] = { {TEXT_ERASE_FILE}, {TEXT_ERASE_FILE_FR}, {TEXT_ERASE_FILE_DE} }; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textSoundModes[][8] = { { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET } }; -//#endif +// #ifndef VERSION_EU +// static unsigned char textSoundModes[][8] = { { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET } }; +// #endif // -//static unsigned char textMarioA[] = { TEXT_FILE_MARIO_A }; -//static unsigned char textMarioB[] = { TEXT_FILE_MARIO_B }; -//static unsigned char textMarioC[] = { TEXT_FILE_MARIO_C }; -//static unsigned char textMarioD[] = { TEXT_FILE_MARIO_D }; +// static unsigned char textMarioA[] = { TEXT_FILE_MARIO_A }; +// static unsigned char textMarioB[] = { TEXT_FILE_MARIO_B }; +// static unsigned char textMarioC[] = { TEXT_FILE_MARIO_C }; +// static unsigned char textMarioD[] = { TEXT_FILE_MARIO_D }; // -//#ifndef VERSION_EU -//static unsigned char textNew[] = { TEXT_NEW }; +// #ifndef VERSION_EU +// static unsigned char textNew[] = { TEXT_NEW }; static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE }; static unsigned char xIcon[] = { GLYPH_MULTIPLY, GLYPH_SPACE }; -//#endif +// #endif // -//#ifndef VERSION_EU -//static unsigned char textSelectFile[] = { TEXT_SELECT_FILE }; -//#else -//static unsigned char textSelectFile[][17] = {{ TEXT_SELECT_FILE }, { TEXT_SELECT_FILE_FR }, { TEXT_SELECT_FILE_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textSelectFile[] = { TEXT_SELECT_FILE }; +// #else +// static unsigned char textSelectFile[][17] = {{ TEXT_SELECT_FILE }, { TEXT_SELECT_FILE_FR }, { TEXT_SELECT_FILE_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textScore[] = { TEXT_SCORE }; -//#else -//static unsigned char textScore[][9] = {{ TEXT_SCORE }, { TEXT_SCORE_FR }, { TEXT_SCORE_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textScore[] = { TEXT_SCORE }; +// #else +// static unsigned char textScore[][9] = {{ TEXT_SCORE }, { TEXT_SCORE_FR }, { TEXT_SCORE_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textCopy[] = { TEXT_COPY }; -//#else -//static unsigned char textCopy[][9] = {{ TEXT_COPY }, { TEXT_COPY_FR }, { TEXT_COPY_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textCopy[] = { TEXT_COPY }; +// #else +// static unsigned char textCopy[][9] = {{ TEXT_COPY }, { TEXT_COPY_FR }, { TEXT_COPY_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textErase[] = { TEXT_ERASE }; -//#else -//static unsigned char textErase[][8] = {{ TEXT_ERASE }, { TEXT_ERASE_FR }, { TEXT_ERASE_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textErase[] = { TEXT_ERASE }; +// #else +// static unsigned char textErase[][8] = {{ TEXT_ERASE }, { TEXT_ERASE_FR }, { TEXT_ERASE_DE }}; +// #endif // -//#ifdef VERSION_EU -//static unsigned char textOption[][9] = {{ TEXT_OPTION }, { TEXT_OPTION_FR }, { TEXT_OPTION_DE } }; -//#endif +// #ifdef VERSION_EU +// static unsigned char textOption[][9] = {{ TEXT_OPTION }, { TEXT_OPTION_FR }, { TEXT_OPTION_DE } }; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textCheckFile[] = { TEXT_CHECK_FILE }; -//#else -//static unsigned char textCheckFile[][18] = {{ TEXT_CHECK_FILE }, { TEXT_CHECK_FILE_FR }, { TEXT_CHECK_FILE_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textCheckFile[] = { TEXT_CHECK_FILE }; +// #else +// static unsigned char textCheckFile[][18] = {{ TEXT_CHECK_FILE }, { TEXT_CHECK_FILE_FR }, { TEXT_CHECK_FILE_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textNoSavedDataExists[] = { TEXT_NO_SAVED_DATA_EXISTS }; -//#else -//static unsigned char textNoSavedDataExists[][30] = {{ TEXT_NO_SAVED_DATA_EXISTS }, { TEXT_NO_SAVED_DATA_EXISTS_FR }, { TEXT_NO_SAVED_DATA_EXISTS_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textNoSavedDataExists[] = { TEXT_NO_SAVED_DATA_EXISTS }; +// #else +// static unsigned char textNoSavedDataExists[][30] = {{ TEXT_NO_SAVED_DATA_EXISTS }, { TEXT_NO_SAVED_DATA_EXISTS_FR }, +// { TEXT_NO_SAVED_DATA_EXISTS_DE }}; #endif // -//#ifndef VERSION_EU -//static unsigned char textCopyFile[] = { TEXT_COPY_FILE }; -//#else -//static unsigned char textCopyFile[][16] = {{ TEXT_COPY_FILE_BUTTON }, { TEXT_COPY_FILE_BUTTON_FR }, { TEXT_COPY_FILE_BUTTON_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textCopyFile[] = { TEXT_COPY_FILE }; +// #else +// static unsigned char textCopyFile[][16] = {{ TEXT_COPY_FILE_BUTTON }, { TEXT_COPY_FILE_BUTTON_FR }, { +// TEXT_COPY_FILE_BUTTON_DE }}; #endif // -//#ifndef VERSION_EU -//static unsigned char textCopyItToWhere[] = { TEXT_COPY_IT_TO_WHERE }; -//#else -//static unsigned char textCopyItToWhere[][18] = {{ TEXT_COPY_IT_TO_WHERE }, { TEXT_COPY_IT_TO_WHERE_FR }, { TEXT_COPY_IT_TO_WHERE_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textCopyItToWhere[] = { TEXT_COPY_IT_TO_WHERE }; +// #else +// static unsigned char textCopyItToWhere[][18] = {{ TEXT_COPY_IT_TO_WHERE }, { TEXT_COPY_IT_TO_WHERE_FR }, { +// TEXT_COPY_IT_TO_WHERE_DE }}; #endif // -//#ifndef VERSION_EU -//static unsigned char textNoSavedDataExistsCopy[] = { TEXT_NO_SAVED_DATA_EXISTS }; -//#endif +// #ifndef VERSION_EU +// static unsigned char textNoSavedDataExistsCopy[] = { TEXT_NO_SAVED_DATA_EXISTS }; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textCopyCompleted[] = { TEXT_COPYING_COMPLETED }; -//#else -//static unsigned char textCopyCompleted[][18] = {{ TEXT_COPYING_COMPLETED }, { TEXT_COPYING_COMPLETED_FR }, { TEXT_COPYING_COMPLETED_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textCopyCompleted[] = { TEXT_COPYING_COMPLETED }; +// #else +// static unsigned char textCopyCompleted[][18] = {{ TEXT_COPYING_COMPLETED }, { TEXT_COPYING_COMPLETED_FR }, { +// TEXT_COPYING_COMPLETED_DE }}; #endif // -//#ifndef VERSION_EU -//static unsigned char textSavedDataExists[] = { TEXT_SAVED_DATA_EXISTS }; -//#else -//static unsigned char textSavedDataExists[][20] = {{ TEXT_SAVED_DATA_EXISTS }, { TEXT_SAVED_DATA_EXISTS_FR }, { TEXT_SAVED_DATA_EXISTS_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textSavedDataExists[] = { TEXT_SAVED_DATA_EXISTS }; +// #else +// static unsigned char textSavedDataExists[][20] = {{ TEXT_SAVED_DATA_EXISTS }, { TEXT_SAVED_DATA_EXISTS_FR }, { +// TEXT_SAVED_DATA_EXISTS_DE }}; #endif // -//#ifndef VERSION_EU -//static unsigned char textNoFileToCopyFrom[] = { TEXT_NO_FILE_TO_COPY_FROM }; -//#else -//static unsigned char textNoFileToCopyFrom[][21] = {{ TEXT_NO_FILE_TO_COPY_FROM }, { TEXT_NO_FILE_TO_COPY_FROM_FR }, { TEXT_NO_FILE_TO_COPY_FROM_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textNoFileToCopyFrom[] = { TEXT_NO_FILE_TO_COPY_FROM }; +// #else +// static unsigned char textNoFileToCopyFrom[][21] = {{ TEXT_NO_FILE_TO_COPY_FROM }, { TEXT_NO_FILE_TO_COPY_FROM_FR }, { +// TEXT_NO_FILE_TO_COPY_FROM_DE }}; #endif // -//#ifndef VERSION_EU -//static unsigned char textYes[] = { TEXT_YES }; -//#else -//static unsigned char textYes[][4] = {{ TEXT_YES }, { TEXT_YES_FR }, { TEXT_YES_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textYes[] = { TEXT_YES }; +// #else +// static unsigned char textYes[][4] = {{ TEXT_YES }, { TEXT_YES_FR }, { TEXT_YES_DE }}; +// #endif // -//#ifndef VERSION_EU -//static unsigned char textNo[] = { TEXT_NO }; -//#else -//static unsigned char textNo[][5] = {{ TEXT_NO }, { TEXT_NO_FR }, { TEXT_NO_DE }}; -//#endif +// #ifndef VERSION_EU +// static unsigned char textNo[] = { TEXT_NO }; +// #else +// static unsigned char textNo[][5] = {{ TEXT_NO }, { TEXT_NO_FR }, { TEXT_NO_DE }}; +// #endif // -//#ifdef VERSION_EU +// #ifdef VERSION_EU //// In EU, Erase File and Sound Select strings are outside it's print string function -//static unsigned char textEraseFile[][17] = { -// { TEXT_ERASE_FILE_BUTTON }, { TEXT_ERASE_FILE_BUTTON_FR }, { TEXT_ERASE_FILE_BUTTON_DE } -//}; -//static unsigned char textSure[][8] = {{ TEXT_SURE }, { TEXT_SURE_FR }, { TEXT_SURE_DE }}; -//static unsigned char textMarioAJustErased[][20] = { -// { TEXT_FILE_MARIO_A_JUST_ERASED }, { TEXT_FILE_MARIO_A_JUST_ERASED_FR }, { TEXT_FILE_MARIO_A_JUST_ERASED_DE } -//}; +// static unsigned char textEraseFile[][17] = { +// { TEXT_ERASE_FILE_BUTTON }, { TEXT_ERASE_FILE_BUTTON_FR }, { TEXT_ERASE_FILE_BUTTON_DE } +// }; +// static unsigned char textSure[][8] = {{ TEXT_SURE }, { TEXT_SURE_FR }, { TEXT_SURE_DE }}; +// static unsigned char textMarioAJustErased[][20] = { +// { TEXT_FILE_MARIO_A_JUST_ERASED }, { TEXT_FILE_MARIO_A_JUST_ERASED_FR }, { TEXT_FILE_MARIO_A_JUST_ERASED_DE } +// }; // -//static unsigned char textSoundSelect[][13] = { -// { TEXT_SOUND_SELECT }, { TEXT_SOUND_SELECT_FR }, { TEXT_SOUND_SELECT_DE } -//}; +// static unsigned char textSoundSelect[][13] = { +// { TEXT_SOUND_SELECT }, { TEXT_SOUND_SELECT_FR }, { TEXT_SOUND_SELECT_DE } +// }; // -//static unsigned char textLanguageSelect[][17] = { -// { TEXT_LANGUAGE_SELECT }, { TEXT_LANGUAGE_SELECT_FR }, { TEXT_LANGUAGE_SELECT_DE } -//}; +// static unsigned char textLanguageSelect[][17] = { +// { TEXT_LANGUAGE_SELECT }, { TEXT_LANGUAGE_SELECT_FR }, { TEXT_LANGUAGE_SELECT_DE } +// }; // -//static unsigned char textSoundModes[][10] = { -// { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET }, -// { TEXT_STEREO_FR }, { TEXT_MONO_FR }, { TEXT_HEADSET_FR }, -// { TEXT_STEREO_DE }, { TEXT_MONO_DE }, { TEXT_HEADSET_DE } -//}; +// static unsigned char textSoundModes[][10] = { +// { TEXT_STEREO }, { TEXT_MONO }, { TEXT_HEADSET }, +// { TEXT_STEREO_FR }, { TEXT_MONO_FR }, { TEXT_HEADSET_FR }, +// { TEXT_STEREO_DE }, { TEXT_MONO_DE }, { TEXT_HEADSET_DE } +// }; // -//static unsigned char textLanguage[][9] = {{ TEXT_ENGLISH }, { TEXT_FRENCH }, { TEXT_GERMAN }}; +// static unsigned char textLanguage[][9] = {{ TEXT_ENGLISH }, { TEXT_FRENCH }, { TEXT_GERMAN }}; // -//static unsigned char textMario[] = { TEXT_MARIO }; -//static unsigned char textHiScore[][15] = {{ TEXT_HI_SCORE }, { TEXT_HI_SCORE_FR }, { TEXT_HI_SCORE_DE }}; -//static unsigned char textMyScore[][10] = {{ TEXT_MY_SCORE }, { TEXT_MY_SCORE_FR }, { TEXT_MY_SCORE_DE }}; +// static unsigned char textMario[] = { TEXT_MARIO }; +// static unsigned char textHiScore[][15] = {{ TEXT_HI_SCORE }, { TEXT_HI_SCORE_FR }, { TEXT_HI_SCORE_DE }}; +// static unsigned char textMyScore[][10] = {{ TEXT_MY_SCORE }, { TEXT_MY_SCORE_FR }, { TEXT_MY_SCORE_DE }}; // -//static unsigned char textNew[][5] = {{ TEXT_NEW }, { TEXT_NEW_FR }, { TEXT_NEW_DE }}; -//static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE }; -//static unsigned char xIcon[] = { GLYPH_MULTIPLY, GLYPH_SPACE }; -//#endif +// static unsigned char textNew[][5] = {{ TEXT_NEW }, { TEXT_NEW_FR }, { TEXT_NEW_DE }}; +// static unsigned char starIcon[] = { GLYPH_STAR, GLYPH_SPACE }; +// static unsigned char xIcon[] = { GLYPH_MULTIPLY, GLYPH_SPACE }; +// #endif /** * Yellow Background Menu Initial Action @@ -301,8 +301,8 @@ void beh_yellow_background_menu_loop(void) { */ s32 check_clicked_button(s16 x, s16 y, f32 depth) { f32 a = 52.4213; - f32 newX = ((f32) x * 160.0) / (a * depth); - f32 newY = ((f32) y * 120.0) / (a * 3 / 4 * depth); + f32 newX = ((f32)x * 160.0) / (a * depth); + f32 newY = ((f32)y * 120.0) / (a * 3 / 4 * depth); s16 maxX = newX + 25.0f; s16 minX = newX - 25.0f; s16 maxY = newY + 21.0f; @@ -317,7 +317,7 @@ s32 check_clicked_button(s16 x, s16 y, f32 depth) { /** * Grow from main menu, used by selecting files and menus. */ -static void bhv_menu_button_growing_from_main_menu(struct Object *button) { +static void bhv_menu_button_growing_from_main_menu(struct Object* button) { if (button->oMenuButtonTimer < 16) { button->oFaceAngleYaw += 0x800; } @@ -344,7 +344,7 @@ static void bhv_menu_button_growing_from_main_menu(struct Object *button) { /** * Shrink back to main menu, used to return back while inside menus. */ -static void bhv_menu_button_shrinking_to_main_menu(struct Object *button) { +static void bhv_menu_button_shrinking_to_main_menu(struct Object* button) { if (button->oMenuButtonTimer < 16) { button->oFaceAngleYaw -= 0x800; } @@ -371,7 +371,7 @@ static void bhv_menu_button_shrinking_to_main_menu(struct Object *button) { /** * Grow from submenu, used by selecting a file in the score menu. */ -static void bhv_menu_button_growing_from_submenu(struct Object *button) { +static void bhv_menu_button_growing_from_submenu(struct Object* button) { if (button->oMenuButtonTimer < 16) { button->oFaceAngleYaw += 0x800; } @@ -396,7 +396,7 @@ static void bhv_menu_button_growing_from_submenu(struct Object *button) { /** * Shrink back to submenu, used to return back while inside a score save menu. */ -static void bhv_menu_button_shrinking_to_submenu(struct Object *button) { +static void bhv_menu_button_shrinking_to_submenu(struct Object* button) { if (button->oMenuButtonTimer < 16) { button->oFaceAngleYaw -= 0x800; } @@ -424,7 +424,7 @@ static void bhv_menu_button_shrinking_to_submenu(struct Object *button) { * A small increase and decrease in size. * Used by failed copy/erase/score operations and sound mode select. */ -static void bhv_menu_button_zoom_in_out(struct Object *button) { +static void bhv_menu_button_zoom_in_out(struct Object* button) { if (sCurrentMenuLevel == MENU_LAYER_MAIN) { if (button->oMenuButtonTimer < 4) { button->oParentRelativePosZ -= 20.0f; @@ -451,7 +451,7 @@ static void bhv_menu_button_zoom_in_out(struct Object *button) { * A small temporary increase in size. * Used while selecting a target copy/erase file or yes/no erase confirmation prompt. */ -static void bhv_menu_button_zoom_in(struct Object *button) { +static void bhv_menu_button_zoom_in(struct Object* button) { button->oMenuButtonScale += 0.0022; button->oMenuButtonTimer++; if (button->oMenuButtonTimer == 10) { @@ -465,7 +465,7 @@ static void bhv_menu_button_zoom_in(struct Object *button) { * Used after selecting a target copy/erase file or * yes/no erase confirmation prompt to undo the zoom in. */ -static void bhv_menu_button_zoom_out(struct Object *button) { +static void bhv_menu_button_zoom_out(struct Object* button) { button->oMenuButtonScale -= 0.0022; button->oMenuButtonTimer++; if (button->oMenuButtonTimer == 10) { @@ -535,10 +535,9 @@ void bhv_menu_button_loop(void) { /** * Handles how to exit the score file menu using button states. */ -void exit_score_file_to_score_menu(struct Object *scoreFileButton, s8 scoreButtonID) { +void exit_score_file_to_score_menu(struct Object* scoreFileButton, s8 scoreButtonID) { // Begin exit - if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN - && sCursorClickingTimer == 2) { + if (scoreFileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN && sCursorClickingTimer == 2) { play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource); #if ENABLE_RUMBLE queue_rumble_data(5, 80); @@ -558,27 +557,23 @@ void exit_score_file_to_score_menu(struct Object *scoreFileButton, s8 scoreButto * Render buttons for the score menu. * Also check if the save file exists to render a different Mario button. */ -void render_score_menu_buttons(struct Object *scoreButton) { +void render_score_menu_buttons(struct Object* scoreButton) { // File A if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = - spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - 711, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); } else { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = - spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, - 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); } sMainMenuButtons[MENU_BUTTON_SCORE_FILE_A]->oMenuButtonScale = 0.11111111f; // File B if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = - spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - -166, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); } else { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = - spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, - -166, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); } sMainMenuButtons[MENU_BUTTON_SCORE_FILE_B]->oMenuButtonScale = 0.11111111f; // File C @@ -592,9 +587,8 @@ void render_score_menu_buttons(struct Object *scoreButton) { sMainMenuButtons[MENU_BUTTON_SCORE_FILE_C]->oMenuButtonScale = 0.11111111f; // File D if (save_file_exists(SAVE_FILE_D) == TRUE) { - sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = - spawn_object_rel_with_rot(scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - -166, 0, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = spawn_object_rel_with_rot( + scoreButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); } else { sMainMenuButtons[MENU_BUTTON_SCORE_FILE_D] = spawn_object_rel_with_rot( scoreButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); @@ -615,15 +609,15 @@ void render_score_menu_buttons(struct Object *scoreButton) { } #ifdef VERSION_EU - #define SCORE_TIMER 46 +#define SCORE_TIMER 46 #else - #define SCORE_TIMER 31 +#define SCORE_TIMER 31 #endif /** * In the score menu, checks if a button was clicked to play a sound, button state and other functions. */ -void check_score_menu_clicked_buttons(struct Object *scoreButton) { +void check_score_menu_clicked_buttons(struct Object* scoreButton) { if (scoreButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { s32 buttonID; // Configure score menu button group @@ -633,16 +627,15 @@ void check_score_menu_clicked_buttons(struct Object *scoreButton) { if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE && sMainMenuTimer >= SCORE_TIMER) { // If menu button clicked, select it - if (buttonID == MENU_BUTTON_SCORE_RETURN || buttonID == MENU_BUTTON_SCORE_COPY_FILE - || buttonID == MENU_BUTTON_SCORE_ERASE_FILE) { + if (buttonID == MENU_BUTTON_SCORE_RETURN || buttonID == MENU_BUTTON_SCORE_COPY_FILE || + buttonID == MENU_BUTTON_SCORE_ERASE_FILE) { play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource); #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; sSelectedButtonID = buttonID; - } - else { // Check if a save file is clicked + } else { // Check if a save file is clicked if (sMainMenuTimer >= SCORE_TIMER) { // If clicked in a existing save file, select it too see it's score if (save_file_exists(buttonID - MENU_BUTTON_SCORE_MIN) == TRUE) { @@ -652,15 +645,13 @@ void check_score_menu_clicked_buttons(struct Object *scoreButton) { #endif sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; sSelectedButtonID = buttonID; - } - else { + } else { // If clicked in a non-existing save file, play buzz sound play_sound(SOUND_MENU_CAMERA_BUZZ, gGlobalSoundSource); #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif - sMainMenuButtons[buttonID]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_IN_OUT; + sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; if (sMainMenuTimer >= SCORE_TIMER) { sFadeOutText = TRUE; sMainMenuTimer = 0; @@ -681,12 +672,11 @@ void check_score_menu_clicked_buttons(struct Object *scoreButton) { * Render buttons for the copy menu. * Also check if the save file exists to render a different Mario button. */ -void render_copy_menu_buttons(struct Object *copyButton) { +void render_copy_menu_buttons(struct Object* copyButton) { // File A if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = - spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, - 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); } else { sMainMenuButtons[MENU_BUTTON_COPY_FILE_A] = spawn_object_rel_with_rot( copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); @@ -694,13 +684,11 @@ void render_copy_menu_buttons(struct Object *copyButton) { sMainMenuButtons[MENU_BUTTON_COPY_FILE_A]->oMenuButtonScale = 0.11111111f; // File B if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = - spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - -166, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); } else { - sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = - spawn_object_rel_with_rot(copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, - 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_COPY_FILE_B] = spawn_object_rel_with_rot( + copyButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); } sMainMenuButtons[MENU_BUTTON_COPY_FILE_B]->oMenuButtonScale = 0.11111111f; // File C @@ -736,17 +724,17 @@ void render_copy_menu_buttons(struct Object *copyButton) { } #ifdef VERSION_EU - #define BUZZ_TIMER 36 +#define BUZZ_TIMER 36 #else - #define BUZZ_TIMER 21 +#define BUZZ_TIMER 21 #endif /** * Copy Menu phase actions that handles what to do when a file button is clicked. */ -void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) { +void copy_action_file_button(struct Object* copyButton, s32 copyFileButtonID) { switch (copyButton->oMenuButtonActionPhase) { - case COPY_PHASE_MAIN: // Copy Menu Main Phase + case COPY_PHASE_MAIN: // Copy Menu Main Phase if (sAllFilesExist == TRUE) { // Don't enable copy if all save files exists return; } @@ -813,17 +801,17 @@ void copy_action_file_button(struct Object *copyButton, s32 copyFileButtonID) { } #ifdef VERSION_EU - #define ACTION_TIMER 41 - #define MAIN_RETURN_TIMER 36 +#define ACTION_TIMER 41 +#define MAIN_RETURN_TIMER 36 #else - #define ACTION_TIMER 31 - #define MAIN_RETURN_TIMER 31 +#define ACTION_TIMER 31 +#define MAIN_RETURN_TIMER 31 #endif /** * In the copy menu, checks if a button was clicked to play a sound, button state and other functions. */ -void check_copy_menu_clicked_buttons(struct Object *copyButton) { +void check_copy_menu_clicked_buttons(struct Object* copyButton) { if (copyButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { s32 buttonID; // Configure copy menu button group @@ -833,8 +821,8 @@ void check_copy_menu_clicked_buttons(struct Object *copyButton) { if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { // If menu button clicked, select it - if (buttonID == MENU_BUTTON_COPY_RETURN || buttonID == MENU_BUTTON_COPY_CHECK_SCORE - || buttonID == MENU_BUTTON_COPY_ERASE_FILE) { + if (buttonID == MENU_BUTTON_COPY_RETURN || buttonID == MENU_BUTTON_COPY_CHECK_SCORE || + buttonID == MENU_BUTTON_COPY_ERASE_FILE) { if (copyButton->oMenuButtonActionPhase == COPY_PHASE_MAIN) { play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource); #if ENABLE_RUMBLE @@ -843,11 +831,10 @@ void check_copy_menu_clicked_buttons(struct Object *copyButton) { sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; sSelectedButtonID = buttonID; } - } - else { + } else { // Check if a file button is clicked to play a copy action - if (sMainMenuButtons[buttonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuTimer >= ACTION_TIMER) { + if (sMainMenuButtons[buttonID]->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT && + sMainMenuTimer >= ACTION_TIMER) { copy_action_file_button(copyButton, buttonID); } } @@ -857,11 +844,9 @@ void check_copy_menu_clicked_buttons(struct Object *copyButton) { } // After copy is complete, return to main copy phase - if (copyButton->oMenuButtonActionPhase == COPY_PHASE_COPY_COMPLETE - && sMainMenuTimer >= MAIN_RETURN_TIMER) { + if (copyButton->oMenuButtonActionPhase == COPY_PHASE_COPY_COMPLETE && sMainMenuTimer >= MAIN_RETURN_TIMER) { copyButton->oMenuButtonActionPhase = COPY_PHASE_MAIN; - sMainMenuButtons[MENU_BUTTON_COPY_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; + sMainMenuButtons[MENU_BUTTON_COPY_MIN + sSelectedFileIndex]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_OUT; } } } @@ -870,27 +855,23 @@ void check_copy_menu_clicked_buttons(struct Object *copyButton) { * Render buttons for the erase menu. * Also check if the save file exists to render a different Mario button. */ -void render_erase_menu_buttons(struct Object *eraseButton) { +void render_erase_menu_buttons(struct Object* eraseButton) { // File A if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = - spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - 711, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); } else { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = - spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, - 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, 711, 311, -100, 0, -0x8000, 0); } sMainMenuButtons[MENU_BUTTON_ERASE_FILE_A]->oMenuButtonScale = 0.11111111f; // File B if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = - spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - -166, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); } else { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = - spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, - -166, 311, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 311, -100, 0, -0x8000, 0); } sMainMenuButtons[MENU_BUTTON_ERASE_FILE_B]->oMenuButtonScale = 0.11111111f; // File C @@ -904,9 +885,8 @@ void render_erase_menu_buttons(struct Object *eraseButton) { sMainMenuButtons[MENU_BUTTON_ERASE_FILE_C]->oMenuButtonScale = 0.11111111f; // File D if (save_file_exists(SAVE_FILE_D) == TRUE) { - sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = - spawn_object_rel_with_rot(eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, - -166, 0, -100, 0, -0x8000, 0); + sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = spawn_object_rel_with_rot( + eraseButton, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); } else { sMainMenuButtons[MENU_BUTTON_ERASE_FILE_D] = spawn_object_rel_with_rot( eraseButton, MODEL_MAIN_MENU_MARIO_NEW_BUTTON, bhvMenuButton, -166, 0, -100, 0, -0x8000, 0); @@ -929,7 +909,7 @@ void render_erase_menu_buttons(struct Object *eraseButton) { /** * Erase Menu phase actions that handles what to do when a file button is clicked. */ -void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID) { +void erase_action_file_button(struct Object* eraseButton, s32 eraseFileButtonID) { switch (eraseButton->oMenuButtonActionPhase) { case ERASE_PHASE_MAIN: // Erase Menu Main Phase if (save_file_exists(eraseFileButtonID - MENU_BUTTON_ERASE_MIN) == TRUE) { @@ -980,7 +960,7 @@ void erase_action_file_button(struct Object *eraseButton, s32 eraseFileButtonID) /** * In the erase menu, checks if a button was clicked to play a sound, button state and other functions. */ -void check_erase_menu_clicked_buttons(struct Object *eraseButton) { +void check_erase_menu_clicked_buttons(struct Object* eraseButton) { if (eraseButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { s32 buttonID; // Configure erase menu button group @@ -990,8 +970,8 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) { if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { // If menu button clicked, select it - if (buttonID == MENU_BUTTON_ERASE_RETURN || buttonID == MENU_BUTTON_ERASE_CHECK_SCORE - || buttonID == MENU_BUTTON_ERASE_COPY_FILE) { + if (buttonID == MENU_BUTTON_ERASE_RETURN || buttonID == MENU_BUTTON_ERASE_CHECK_SCORE || + buttonID == MENU_BUTTON_ERASE_COPY_FILE) { if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MAIN) { play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource); #if ENABLE_RUMBLE @@ -1000,8 +980,7 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) { sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; sSelectedButtonID = buttonID; } - } - else { + } else { // Check if a file button is clicked to play an erase action if (sMainMenuTimer >= ACTION_TIMER) { erase_action_file_button(eraseButton, buttonID); @@ -1012,11 +991,9 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) { } } // After erase is complete, return to main erase phase - if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MARIO_ERASED - && sMainMenuTimer >= MAIN_RETURN_TIMER) { + if (eraseButton->oMenuButtonActionPhase == ERASE_PHASE_MARIO_ERASED && sMainMenuTimer >= MAIN_RETURN_TIMER) { eraseButton->oMenuButtonActionPhase = ERASE_PHASE_MAIN; - sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; + sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_OUT; } } } @@ -1025,15 +1002,15 @@ void check_erase_menu_clicked_buttons(struct Object *eraseButton) { #undef MAIN_RETURN_TIMER #ifdef VERSION_EU - #define SOUND_BUTTON_Y 388 +#define SOUND_BUTTON_Y 388 #else - #define SOUND_BUTTON_Y 0 +#define SOUND_BUTTON_Y 0 #endif /** * Render buttons for the sound mode menu. */ -void render_sound_mode_menu_buttons(struct Object *soundModeButton) { +void render_sound_mode_menu_buttons(struct Object* soundModeButton) { // Stereo option button sMainMenuButtons[MENU_BUTTON_STEREO] = spawn_object_rel_with_rot( soundModeButton, MODEL_MAIN_MENU_GENERIC_BUTTON, bhvMenuButton, 533, SOUND_BUTTON_Y, -100, 0, -0x8000, 0); @@ -1076,7 +1053,7 @@ void render_sound_mode_menu_buttons(struct Object *soundModeButton) { /** * In the sound mode menu, checks if a button was clicked to change sound mode & button state. */ -void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { +void check_sound_mode_menu_clicked_buttons(struct Object* soundModeButton) { if (soundModeButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { s32 buttonID; // Configure sound mode menu button group @@ -1087,8 +1064,7 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { if (check_clicked_button(buttonX, buttonY, 22.0f) == TRUE) { // If sound mode button clicked, select it and define sound mode // The check will always be true because of the group configured above (In JP & US) - if (buttonID == MENU_BUTTON_STEREO || buttonID == MENU_BUTTON_MONO - || buttonID == MENU_BUTTON_HEADSET) { + if (buttonID == MENU_BUTTON_STEREO || buttonID == MENU_BUTTON_MONO || buttonID == MENU_BUTTON_HEADSET) { if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) { play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource); #if ENABLE_RUMBLE @@ -1106,8 +1082,8 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { } #ifdef VERSION_EU // If language mode button clicked, select it and change language - if (buttonID == MENU_BUTTON_LANGUAGE_ENGLISH || buttonID == MENU_BUTTON_LANGUAGE_FRENCH - || buttonID == MENU_BUTTON_LANGUAGE_GERMAN) { + if (buttonID == MENU_BUTTON_LANGUAGE_ENGLISH || buttonID == MENU_BUTTON_LANGUAGE_FRENCH || + buttonID == MENU_BUTTON_LANGUAGE_GERMAN) { if (soundModeButton->oMenuButtonActionPhase == SOUND_MODE_PHASE_MAIN) { play_sound(SOUND_MENU_CLICK_FILE_SELECT, gGlobalSoundSource); sMainMenuButtons[buttonID]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_IN_OUT; @@ -1134,7 +1110,7 @@ void check_sound_mode_menu_clicked_buttons(struct Object *soundModeButton) { * Loads a save file selected after it goes into a full screen state * retuning sSelectedFileNum to a save value defined in fileNum. */ -void load_main_menu_save_file(struct Object *fileButton, s32 fileNum) { +void load_main_menu_save_file(struct Object* fileButton, s32 fileNum) { if (fileButton->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { sSelectedFileNum = fileNum; } @@ -1144,12 +1120,12 @@ void load_main_menu_save_file(struct Object *fileButton, s32 fileNum) { * Returns from the previous menu back to the main menu using * the return button (or sound mode) as source button. */ -void return_to_main_menu(s16 prevMenuButtonID, struct Object *sourceButton) { +void return_to_main_menu(s16 prevMenuButtonID, struct Object* sourceButton) { s32 buttonID; // If the source button is in default state and the previous menu in full screen, // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT && + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource); sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; sCurrentMenuLevel = MENU_LAYER_MAIN; @@ -1184,12 +1160,12 @@ void return_to_main_menu(s16 prevMenuButtonID, struct Object *sourceButton) { /** * Loads score menu from the previous menu using "CHECK SCORE" as source button. */ -void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { +void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object* sourceButton) { s32 buttonID; // If the source button is in default state and the previous menu in full screen, // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT && + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource); sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; sCurrentMenuLevel = MENU_LAYER_MAIN; @@ -1224,12 +1200,12 @@ void load_score_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut /** * Loads copy menu from the previous menu using "COPY FILE" as source button. */ -void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { +void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object* sourceButton) { s32 buttonID; // If the source button is in default state and the previous menu in full screen, // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT && + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource); sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; sCurrentMenuLevel = MENU_LAYER_MAIN; @@ -1264,12 +1240,12 @@ void load_copy_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButt /** * Loads erase menu from the previous menu using "ERASE FILE" as source button. */ -void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceButton) { +void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object* sourceButton) { s32 buttonID; // If the source button is in default state and the previous menu in full screen, // play zoom out sound and shrink previous menu - if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT - && sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { + if (sourceButton->oMenuButtonState == MENU_BUTTON_STATE_DEFAULT && + sMainMenuButtons[prevMenuButtonID]->oMenuButtonState == MENU_BUTTON_STATE_FULLSCREEN) { play_sound(SOUND_MENU_CAMERA_ZOOM_OUT, gGlobalSoundSource); sMainMenuButtons[prevMenuButtonID]->oMenuButtonState = MENU_BUTTON_STATE_SHRINKING; sCurrentMenuLevel = MENU_LAYER_MAIN; @@ -1301,7 +1277,6 @@ void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut } } - /** * Menu Buttons Menu Manager Initial Action * Creates models of the buttons in the menu. For the Mario buttons it @@ -1311,31 +1286,26 @@ void load_erase_menu_from_submenu(s16 prevMenuButtonID, struct Object *sourceBut void bhv_menu_button_manager_init(void) { // File A if (save_file_exists(SAVE_FILE_A) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = - spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, - bhvMenuButton, -6400, 2800, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, -6400, 2800, 0, 0, 0, 0); } else { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = - spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, - bhvMenuButton, -6400, 2800, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, -6400, 2800, 0, 0, 0, 0); } sMainMenuButtons[MENU_BUTTON_PLAY_FILE_A]->oMenuButtonScale = 1.0f; // File B if (save_file_exists(SAVE_FILE_B) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = - spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, - bhvMenuButton, 1500, 2800, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, 1500, 2800, 0, 0, 0, 0); } else { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = - spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, - bhvMenuButton, 1500, 2800, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, 1500, 2800, 0, 0, 0, 0); } sMainMenuButtons[MENU_BUTTON_PLAY_FILE_B]->oMenuButtonScale = 1.0f; // File C if (save_file_exists(SAVE_FILE_C) == TRUE) { - sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = - spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, - bhvMenuButton, -6400, 0, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = spawn_object_rel_with_rot( + gCurrentObject, MODEL_MAIN_MENU_MARIO_SAVE_BUTTON_FADE, bhvMenuButton, -6400, 0, 0, 0, 0, 0); } else { sMainMenuButtons[MENU_BUTTON_PLAY_FILE_C] = spawn_object_rel_with_rot( gCurrentObject, MODEL_MAIN_MENU_MARIO_NEW_BUTTON_FADE, bhvMenuButton, -6400, 0, 0, 0, 0, 0); @@ -1351,16 +1321,16 @@ void bhv_menu_button_manager_init(void) { } sMainMenuButtons[MENU_BUTTON_PLAY_FILE_D]->oMenuButtonScale = 1.0f; // Score menu button - sMainMenuButtons[MENU_BUTTON_SCORE] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, bhvMenuButton, -6400, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_SCORE] = spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_GREEN_SCORE_BUTTON, + bhvMenuButton, -6400, -3500, 0, 0, 0, 0); sMainMenuButtons[MENU_BUTTON_SCORE]->oMenuButtonScale = 1.0f; // Copy menu button - sMainMenuButtons[MENU_BUTTON_COPY] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, bhvMenuButton, -2134, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_COPY] = spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_BLUE_COPY_BUTTON, + bhvMenuButton, -2134, -3500, 0, 0, 0, 0); sMainMenuButtons[MENU_BUTTON_COPY]->oMenuButtonScale = 1.0f; // Erase menu button - sMainMenuButtons[MENU_BUTTON_ERASE] = spawn_object_rel_with_rot( - gCurrentObject, MODEL_MAIN_MENU_RED_ERASE_BUTTON, bhvMenuButton, 2134, -3500, 0, 0, 0, 0); + sMainMenuButtons[MENU_BUTTON_ERASE] = spawn_object_rel_with_rot(gCurrentObject, MODEL_MAIN_MENU_RED_ERASE_BUTTON, + bhvMenuButton, 2134, -3500, 0, 0, 0, 0); sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonScale = 1.0f; // Sound mode menu button (Option Mode in EU) sMainMenuButtons[MENU_BUTTON_SOUND_MODE] = spawn_object_rel_with_rot( @@ -1383,7 +1353,7 @@ void check_main_menu_clicked_buttons(void) { // Sound mode menu is handled separately because the button ID for it // is not grouped with the IDs of the other submenus. if (check_clicked_button(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosX, - sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosY, 200.0f) == TRUE) { + sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oPosY, 200.0f) == TRUE) { sMainMenuButtons[MENU_BUTTON_SOUND_MODE]->oMenuButtonState = MENU_BUTTON_STATE_GROWING; sSelectedButtonID = MENU_BUTTON_SOUND_MODE; } else { @@ -1525,12 +1495,10 @@ void bhv_menu_button_manager_loop(void) { return_to_main_menu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_RETURN]); break; case MENU_BUTTON_SCORE_COPY_FILE: - load_copy_menu_from_submenu(MENU_BUTTON_SCORE, - sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]); + load_copy_menu_from_submenu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_COPY_FILE]); break; case MENU_BUTTON_SCORE_ERASE_FILE: - load_erase_menu_from_submenu(MENU_BUTTON_SCORE, - sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]); + load_erase_menu_from_submenu(MENU_BUTTON_SCORE, sMainMenuButtons[MENU_BUTTON_SCORE_ERASE_FILE]); break; case MENU_BUTTON_COPY_FILE_A: @@ -1545,12 +1513,10 @@ void bhv_menu_button_manager_loop(void) { return_to_main_menu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_RETURN]); break; case MENU_BUTTON_COPY_CHECK_SCORE: - load_score_menu_from_submenu(MENU_BUTTON_COPY, - sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]); + load_score_menu_from_submenu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_CHECK_SCORE]); break; case MENU_BUTTON_COPY_ERASE_FILE: - load_erase_menu_from_submenu(MENU_BUTTON_COPY, - sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]); + load_erase_menu_from_submenu(MENU_BUTTON_COPY, sMainMenuButtons[MENU_BUTTON_COPY_ERASE_FILE]); break; case MENU_BUTTON_ERASE_FILE_A: @@ -1565,20 +1531,18 @@ void bhv_menu_button_manager_loop(void) { return_to_main_menu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_RETURN]); break; case MENU_BUTTON_ERASE_CHECK_SCORE: - load_score_menu_from_submenu(MENU_BUTTON_ERASE, - sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]); + load_score_menu_from_submenu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_CHECK_SCORE]); break; case MENU_BUTTON_ERASE_COPY_FILE: - load_copy_menu_from_submenu(MENU_BUTTON_ERASE, - sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]); + load_copy_menu_from_submenu(MENU_BUTTON_ERASE, sMainMenuButtons[MENU_BUTTON_ERASE_COPY_FILE]); break; case MENU_BUTTON_SOUND_MODE: check_sound_mode_menu_clicked_buttons(sMainMenuButtons[MENU_BUTTON_SOUND_MODE]); break; - // STEREO, MONO and HEADSET buttons are undefined so they can be selected without - // exiting the Options menu, as a result they added a return button + // STEREO, MONO and HEADSET buttons are undefined so they can be selected without + // exiting the Options menu, as a result they added a return button #ifdef VERSION_EU case MENU_BUTTON_LANGUAGE_RETURN: return_to_main_menu(MENU_BUTTON_SOUND_MODE, sMainMenuButtons[MENU_BUTTON_LANGUAGE_RETURN]); @@ -1606,9 +1570,8 @@ void bhv_menu_button_manager_loop(void) { */ void handle_cursor_button_input(void) { // If scoring a file, pressing A just changes the coin score mode. - if (sSelectedButtonID == MENU_BUTTON_SCORE_FILE_A || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_B - || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_C - || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_D) { + if (sSelectedButtonID == MENU_BUTTON_SCORE_FILE_A || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_B || + sSelectedButtonID == MENU_BUTTON_SCORE_FILE_C || sSelectedButtonID == MENU_BUTTON_SCORE_FILE_D) { if (gPlayer3Controller->buttonPressed #ifdef VERSION_EU & (B_BUTTON | START_BUTTON | Z_TRIG) @@ -1704,7 +1667,7 @@ void print_menu_cursor(void) { /** * Prints a hud string depending of the hud table list defined with text fade properties. */ -void print_hud_lut_string_fade(s8 hudLUT, s16 x, s16 y, const unsigned char *text) { +void print_hud_lut_string_fade(s8 hudLUT, s16 x, s16 y, const unsigned char* text) { gSPDisplayList(gDisplayListHead++, dl_rgba16_text_begin); gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha - sTextFadeAlpha); print_hud_lut_string(hudLUT, x, y, text); @@ -1714,7 +1677,7 @@ void print_hud_lut_string_fade(s8 hudLUT, s16 x, s16 y, const unsigned char *tex /** * Prints a generic white string with text fade properties. */ -void print_generic_string_fade(s16 x, s16 y, const unsigned char *text) { +void print_generic_string_fade(s16 x, s16 y, const unsigned char* text) { gSPDisplayList(gDisplayListHead++, dl_ia_text_begin); gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha - sTextFadeAlpha); print_generic_string(x, y, text); @@ -1768,20 +1731,20 @@ void print_save_file_star_count(s8 fileIndex, s16 x, s16 y) { } #if defined(VERSION_US) - #define SELECT_FILE_X (ROM_JP ? 96 : 93) - #define SCORE_X (ROM_JP ? 50 : 52) - #define COPY_X (ROM_JP ? 115 : 117) - #define ERASE_X (ROM_JP ? 180 : 177) - #define SOUNDMODE_X1 (ROM_JP ? 235 : sSoundTextX) - #define SAVEFILE_X1 92 - #define SAVEFILE_X2 209 - #define MARIOTEXT_X1 92 - #define MARIOTEXT_X2 207 +#define SELECT_FILE_X (ROM_JP ? 96 : 93) +#define SCORE_X (ROM_JP ? 50 : 52) +#define COPY_X (ROM_JP ? 115 : 117) +#define ERASE_X (ROM_JP ? 180 : 177) +#define SOUNDMODE_X1 (ROM_JP ? 235 : sSoundTextX) +#define SAVEFILE_X1 92 +#define SAVEFILE_X2 209 +#define MARIOTEXT_X1 92 +#define MARIOTEXT_X2 207 #elif defined(VERSION_EU) - #define SAVEFILE_X1 97 - #define SAVEFILE_X2 204 - #define MARIOTEXT_X1 97 - #define MARIOTEXT_X2 204 +#define SAVEFILE_X1 97 +#define SAVEFILE_X2 204 +#define MARIOTEXT_X1 97 +#define MARIOTEXT_X2 204 #endif /** @@ -1815,11 +1778,9 @@ void print_main_menu_strings(void) { print_generic_string(SCORE_X, 39, GameEngine_LoadTranslation("TEXT_SCORE")); print_generic_string(COPY_X, 39, GameEngine_LoadTranslation("TEXT_COPY")); print_generic_string(ERASE_X, 39, GameEngine_LoadTranslation("TEXT_ERASE")); - unsigned char* textSoundModes[] = { - GameEngine_LoadTranslation("TEXT_STEREO"), - GameEngine_LoadTranslation("TEXT_MONO"), - GameEngine_LoadTranslation("TEXT_HEADSET") - }; + unsigned char* textSoundModes[] = { GameEngine_LoadTranslation("TEXT_STEREO"), + GameEngine_LoadTranslation("TEXT_MONO"), + GameEngine_LoadTranslation("TEXT_HEADSET") }; sSoundTextX = get_str_x_pos_from_center(254, textSoundModes[sSoundMode], 10.0f); print_generic_string(SOUNDMODE_X1, 39, textSoundModes[sSoundMode]); gSPDisplayList(gDisplayListHead++, dl_ia_text_end); @@ -1868,11 +1829,11 @@ void print_main_lang_strings(void) { #endif #if defined(VERSION_US) - #define CHECK_FILE_X (ROM_JP ? 90 : 95) - #define NOSAVE_DATA_X1 (ROM_JP ? 90 : 99) +#define CHECK_FILE_X (ROM_JP ? 90 : 95) +#define NOSAVE_DATA_X1 (ROM_JP ? 90 : 99) #elif defined(VERSION_EU) - #define CHECK_FILE_X checkFileX - #define NOSAVE_DATA_X1 noSaveDataX +#define CHECK_FILE_X checkFileX +#define NOSAVE_DATA_X1 noSaveDataX #endif /** @@ -1900,19 +1861,19 @@ void score_menu_display_message(s8 messageID) { } #if defined(VERSION_US) - #define RETURN_X 44 - #define COPYFILE_X1 (ROM_JP ? 128 : 135) - #define ERASEFILE_X1 (ROM_JP ? 228 : 231) +#define RETURN_X 44 +#define COPYFILE_X1 (ROM_JP ? 128 : 135) +#define ERASEFILE_X1 (ROM_JP ? 228 : 231) #elif defined(VERSION_EU) - #define RETURN_X centeredX - #define COPYFILE_X1 centeredX - #define ERASEFILE_X1 centeredX +#define RETURN_X centeredX +#define COPYFILE_X1 centeredX +#define ERASEFILE_X1 centeredX #endif #ifdef VERSION_EU - #define FADEOUT_TIMER 35 +#define FADEOUT_TIMER 35 #else - #define FADEOUT_TIMER 20 +#define FADEOUT_TIMER 20 #endif /** @@ -1980,19 +1941,19 @@ void print_score_menu_strings(void) { } #if defined(VERSION_US) - #define NOFILE_COPY_X (ROM_JP ? 90 : 119) - #define COPY_FILE_X (ROM_JP ? 90 : 104) - #define COPYIT_WHERE_X (ROM_JP ? 90 : 109) - #define NOSAVE_DATA_X2 (ROM_JP ? 90 : 101) - #define COPYCOMPLETE_X (ROM_JP ? 90 : 110) - #define SAVE_EXISTS_X1 (ROM_JP ? 90 : 110) +#define NOFILE_COPY_X (ROM_JP ? 90 : 119) +#define COPY_FILE_X (ROM_JP ? 90 : 104) +#define COPYIT_WHERE_X (ROM_JP ? 90 : 109) +#define NOSAVE_DATA_X2 (ROM_JP ? 90 : 101) +#define COPYCOMPLETE_X (ROM_JP ? 90 : 110) +#define SAVE_EXISTS_X1 (ROM_JP ? 90 : 110) #elif defined(VERSION_EU) - #define NOFILE_COPY_X centeredX - #define COPY_FILE_X centeredX - #define COPYIT_WHERE_X centeredX - #define NOSAVE_DATA_X2 centeredX - #define COPYCOMPLETE_X centeredX - #define SAVE_EXISTS_X1 centeredX +#define NOFILE_COPY_X centeredX +#define COPY_FILE_X centeredX +#define COPYIT_WHERE_X centeredX +#define NOSAVE_DATA_X2 centeredX +#define COPYCOMPLETE_X centeredX +#define SAVE_EXISTS_X1 centeredX #endif /** @@ -2064,8 +2025,7 @@ void copy_menu_update_message(void) { } break; case COPY_PHASE_COPY_WHERE: - if (sMainMenuTimer == FADEOUT_TIMER - && sStatusMessageID == COPY_MSG_SAVE_EXISTS) { + if (sMainMenuTimer == FADEOUT_TIMER && sStatusMessageID == COPY_MSG_SAVE_EXISTS) { sFadeOutText = TRUE; } if (update_text_fade_out() == TRUE) { @@ -2092,14 +2052,14 @@ void copy_menu_update_message(void) { } #if defined(VERSION_US) - #define VIEWSCORE_X1 (ROM_JP ? 133 : 128) - #define ERASEFILE_X2 (ROM_JP ? 220 : 230) +#define VIEWSCORE_X1 (ROM_JP ? 133 : 128) +#define ERASEFILE_X2 (ROM_JP ? 220 : 230) #elif defined(VERSION_EU) - #define VIEWSCORE_X1 centeredX - #define ERASEFILE_X2 centeredX +#define VIEWSCORE_X1 centeredX +#define ERASEFILE_X2 centeredX #elif defined(VERSION_SH) - #define VIEWSCORE_X1 133 - #define ERASEFILE_X2 230 +#define VIEWSCORE_X1 133 +#define ERASEFILE_X2 230 #endif /** @@ -2161,11 +2121,11 @@ void print_copy_menu_strings(void) { #define MENU_ERASE_YES_NO_MAX_Y 210 #ifdef VERSION_SH - #define MENU_ERASE_NO_MIN_X 194 - #define MENU_ERASE_NO_MAX_X 213 +#define MENU_ERASE_NO_MIN_X 194 +#define MENU_ERASE_NO_MAX_X 213 #else - #define MENU_ERASE_NO_MIN_X 189 - #define MENU_ERASE_NO_MAX_X 218 +#define MENU_ERASE_NO_MIN_X 189 +#define MENU_ERASE_NO_MAX_X 218 #endif /** @@ -2177,14 +2137,14 @@ void print_erase_menu_prompt(s16 x, s16 y) { s16 cursorX = sCursorPos[0] + CURSOR_X; s16 cursorY = sCursorPos[1] + 120.0f; - if (cursorX < MENU_ERASE_YES_MAX_X && cursorX >= MENU_ERASE_YES_MIN_X && - cursorY < MENU_ERASE_YES_NO_MAX_Y && cursorY >= MENU_ERASE_YES_NO_MIN_Y) { + if (cursorX < MENU_ERASE_YES_MAX_X && cursorX >= MENU_ERASE_YES_MIN_X && cursorY < MENU_ERASE_YES_NO_MAX_Y && + cursorY >= MENU_ERASE_YES_NO_MIN_Y) { // Fade "YES" string color but keep "NO" gray sYesNoColor[0] = sins(colorFade) * 50.0f + 205.0f; sYesNoColor[1] = 150; sEraseYesNoHoverState = MENU_ERASE_HOVER_YES; - } else if (cursorX < MENU_ERASE_NO_MAX_X && cursorX >= MENU_ERASE_NO_MIN_X - && cursorY < MENU_ERASE_YES_NO_MAX_Y && cursorY >= MENU_ERASE_YES_NO_MIN_Y) { + } else if (cursorX < MENU_ERASE_NO_MAX_X && cursorX >= MENU_ERASE_NO_MIN_X && cursorY < MENU_ERASE_YES_NO_MAX_Y && + cursorY >= MENU_ERASE_YES_NO_MIN_Y) { // Fade "NO" string color but keep "YES" gray sYesNoColor[0] = 150; sYesNoColor[1] = sins(colorFade) * 50.0f + 205.0f; @@ -2218,8 +2178,7 @@ void print_erase_menu_prompt(s16 x, s16 y) { #if ENABLE_RUMBLE queue_rumble_data(5, 80); #endif - sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = - MENU_BUTTON_STATE_ZOOM_OUT; + sMainMenuButtons[MENU_BUTTON_ERASE_MIN + sSelectedFileIndex]->oMenuButtonState = MENU_BUTTON_STATE_ZOOM_OUT; sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase = ERASE_PHASE_MAIN; sFadeOutText = TRUE; sMainMenuTimer = 0; @@ -2241,17 +2200,17 @@ void print_erase_menu_prompt(s16 x, s16 y) { // M a r i o A --- マ リ オ A // 0 1 2 3 4 5 6 --- 0 1 2 3 #if defined(VERSION_US) - #define ERASE_FILE_X (ROM_JP ? 96 : 98) - #define NOSAVE_DATA_X3 (ROM_JP ? 90 : 100) - #define MARIO_ERASED_VAR (ROM_JP ? 3 : 6) - #define MARIO_ERASED_X (ROM_JP ? 90 : 100) - #define SAVE_EXISTS_X2 (ROM_JP ? 90 : 100) +#define ERASE_FILE_X (ROM_JP ? 96 : 98) +#define NOSAVE_DATA_X3 (ROM_JP ? 90 : 100) +#define MARIO_ERASED_VAR (ROM_JP ? 3 : 6) +#define MARIO_ERASED_X (ROM_JP ? 90 : 100) +#define SAVE_EXISTS_X2 (ROM_JP ? 90 : 100) #elif defined(VERSION_EU) - #define ERASE_FILE_X centeredX - #define NOSAVE_DATA_X3 centeredX - #define MARIO_ERASED_VAR 6 - #define MARIO_ERASED_X centeredX - #define SAVE_EXISTS_X2 centeredX +#define ERASE_FILE_X centeredX +#define NOSAVE_DATA_X3 centeredX +#define MARIO_ERASED_VAR 6 +#define MARIO_ERASED_X centeredX +#define SAVE_EXISTS_X2 centeredX #endif /** @@ -2306,8 +2265,7 @@ void erase_menu_display_message(s8 messageID) { void erase_menu_update_message(void) { switch (sMainMenuButtons[MENU_BUTTON_ERASE]->oMenuButtonActionPhase) { case ERASE_PHASE_MAIN: - if (sMainMenuTimer == FADEOUT_TIMER - && sStatusMessageID == ERASE_MSG_NOSAVE_EXISTS) { + if (sMainMenuTimer == FADEOUT_TIMER && sStatusMessageID == ERASE_MSG_NOSAVE_EXISTS) { sFadeOutText = TRUE; } if (update_text_fade_out() == TRUE) { @@ -2403,7 +2361,7 @@ void print_erase_menu_strings(void) { } #if defined(VERSION_US) - #define SOUND_HUD_X (ROM_JP ? 96 : 88) +#define SOUND_HUD_X (ROM_JP ? 96 : 88) #endif /** @@ -2443,9 +2401,8 @@ void print_sound_mode_menu_strings(void) { } else { gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); } - print_generic_string( - get_str_x_pos_from_center(textX, textSoundModes[sLanguageMode * 3 + mode], 10.0f), - 141, textSoundModes[sLanguageMode * 3 + mode]); + print_generic_string(get_str_x_pos_from_center(textX, textSoundModes[sLanguageMode * 3 + mode], 10.0f), 141, + textSoundModes[sLanguageMode * 3 + mode]); } // In EU, print language mode names @@ -2455,16 +2412,12 @@ void print_sound_mode_menu_strings(void) { } else { gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, sTextBaseAlpha); } - print_generic_string( - get_str_x_pos_from_center(textX, textLanguage[mode], 10.0f), - 72, textLanguage[mode]); + print_generic_string(get_str_x_pos_from_center(textX, textLanguage[mode], 10.0f), 72, textLanguage[mode]); } #else - unsigned char* textSoundModes[] = { - GameEngine_LoadTranslation("TEXT_STEREO"), - GameEngine_LoadTranslation("TEXT_MONO"), - GameEngine_LoadTranslation("TEXT_HEADSET") - }; + unsigned char* textSoundModes[] = { GameEngine_LoadTranslation("TEXT_STEREO"), + GameEngine_LoadTranslation("TEXT_MONO"), + GameEngine_LoadTranslation("TEXT_HEADSET") }; // Print sound mode names for (mode = 0; mode < 3; mode++) { if (mode == sSoundMode) { @@ -2494,8 +2447,7 @@ void print_score_file_castle_secret_stars(s8 fileIndex, s16 x, s16 y) { // Print "[star] x" print_menu_generic_string(x, y, GameEngine_LoadTranslation("TEXT_STAR_X")); // Print number of castle secret stars - int_to_str(save_file_get_total_star_count(fileIndex, COURSE_BONUS_STAGES - 1, COURSE_MAX - 1), - secretStarsText); + int_to_str(save_file_get_total_star_count(fileIndex, COURSE_BONUS_STAGES - 1, COURSE_MAX - 1), secretStarsText); #ifdef VERSION_EU print_menu_generic_string(x + 20, y, secretStarsText); #else @@ -2503,8 +2455,8 @@ void print_score_file_castle_secret_stars(s8 fileIndex, s16 x, s16 y) { #endif } -#define HISCORE_COIN_ICON_X (ROM_JP ? 0 : 18) -#define HISCORE_COIN_TEXT_X (ROM_JP ? 16 : 34) +#define HISCORE_COIN_ICON_X (ROM_JP ? 0 : 18) +#define HISCORE_COIN_TEXT_X (ROM_JP ? 16 : 34) #define HISCORE_COIN_NAMES_X (ROM_JP ? 45 : 60) /** @@ -2515,11 +2467,11 @@ void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s1 u8 stars = save_file_get_star_flags(fileIndex, courseIndex); unsigned char* textCoinX = GameEngine_LoadTranslation("TEXT_COIN_X"); unsigned char* textStar = GameEngine_LoadTranslation("TEXT_STAR"); - unsigned char* fileNames[] = { - GameEngine_LoadTranslation("TEXT_4DASHES"), - GameEngine_LoadTranslation("TEXT_FILE_MARIO_A"), GameEngine_LoadTranslation("TEXT_FILE_MARIO_B"), - GameEngine_LoadTranslation("TEXT_FILE_MARIO_C"), GameEngine_LoadTranslation("TEXT_FILE_MARIO_D") - }; + unsigned char* fileNames[] = { GameEngine_LoadTranslation("TEXT_4DASHES"), + GameEngine_LoadTranslation("TEXT_FILE_MARIO_A"), + GameEngine_LoadTranslation("TEXT_FILE_MARIO_B"), + GameEngine_LoadTranslation("TEXT_FILE_MARIO_C"), + GameEngine_LoadTranslation("TEXT_FILE_MARIO_D") }; // MYSCORE if (sScoreFileCoinScoreMode == 0) { // Print "[coin] x" @@ -2531,15 +2483,15 @@ void print_score_file_course_coin_score(s8 fileIndex, s16 courseIndex, s16 x, s1 if (stars & (1 << 6)) { print_menu_generic_string(x + 70, y, textStar); } - } else { // HISCORE + } else { // HISCORE // Print "[coin] x" print_menu_generic_string(x + HISCORE_COIN_ICON_X, y, textCoinX); // Print coin highscore - int_to_str((u16) save_file_get_max_coin_score(courseIndex) & 0xFFFF, coinScoreText); + int_to_str((u16)save_file_get_max_coin_score(courseIndex) & 0xFFFF, coinScoreText); print_menu_generic_string(x + HISCORE_COIN_TEXT_X, y, coinScoreText); // Print coin highscore file print_menu_generic_string(x + HISCORE_COIN_NAMES_X, y, - fileNames[(save_file_get_max_coin_score(courseIndex) >> 16) & 0xFFFF]); + fileNames[(save_file_get_max_coin_score(courseIndex) >> 16) & 0xFFFF]); } } @@ -2565,18 +2517,18 @@ void print_score_file_star_score(s8 fileIndex, s16 courseIndex, s16 x, s16 y) { } #if defined(VERSION_US) - #define MARIO_X (ROM_JP ? 28 : 25) - #define FILE_LETTER_X (ROM_JP ? 86 : 95) - #define LEVEL_NUM_PAD (ROM_JP ? 0 : 3) - #define SECRET_STARS_PAD (ROM_JP ? 0 : 6) - #define LEVEL_NAME_X 23 - #define STAR_SCORE_X (ROM_JP ? 152 : 171) +#define MARIO_X (ROM_JP ? 28 : 25) +#define FILE_LETTER_X (ROM_JP ? 86 : 95) +#define LEVEL_NUM_PAD (ROM_JP ? 0 : 3) +#define SECRET_STARS_PAD (ROM_JP ? 0 : 6) +#define LEVEL_NAME_X 23 +#define STAR_SCORE_X (ROM_JP ? 152 : 171) #ifdef VERSION_EU - #define MYSCORE_X get_str_x_pos_from_center(257, textMyScore[sLanguageMode], 10.0f) - #define HISCORE_X get_str_x_pos_from_center(257, textHiScore[sLanguageMode], 10.0f) +#define MYSCORE_X get_str_x_pos_from_center(257, textMyScore[sLanguageMode], 10.0f) +#define HISCORE_X get_str_x_pos_from_center(257, textHiScore[sLanguageMode], 10.0f) #else - #define MYSCORE_X (ROM_JP ? 237 : 238) - #define HISCORE_X (ROM_JP ? 237 : 231) +#define MYSCORE_X (ROM_JP ? 237 : 238) +#define HISCORE_X (ROM_JP ? 237 : 231) #endif #endif @@ -2595,7 +2547,7 @@ void print_save_file_scores(s8 fileIndex) { unsigned char* textMyScore = GameEngine_LoadTranslation("TEXT_MY_SCORE"); #else unsigned char textFileLetter[] = { TEXT_ZERO }; - void **levelNameTable; + void** levelNameTable; switch (sLanguageMode) { case LANGUAGE_ENGLISH: @@ -2626,15 +2578,15 @@ void print_save_file_scores(s8 fileIndex) { gDPSetEnvColor(gDisplayListHead++, 255, 255, 255, sTextBaseAlpha); //! Huge print list, for loops exist for a reason! -#define PRINT_COURSE_SCORES(courseIndex, pad) \ - print_menu_generic_string(LEVEL_NAME_X + (pad * LEVEL_NUM_PAD), 23 + 12 * courseIndex, \ - GameEngine_LoadLevelName(courseIndex - 1)); \ +#define PRINT_COURSE_SCORES(courseIndex, pad) \ + print_menu_generic_string(LEVEL_NAME_X + (pad * LEVEL_NUM_PAD), 23 + 12 * courseIndex, \ + GameEngine_LoadLevelName(courseIndex - 1)); \ print_score_file_star_score(fileIndex, courseIndex - 1, STAR_SCORE_X, 23 + 12 * courseIndex); \ print_score_file_course_coin_score(fileIndex, courseIndex - 1, 213, 23 + 12 * courseIndex); // Course values are indexed, from Bob-omb Battlefield to Rainbow Ride PRINT_COURSE_SCORES(COURSE_BOB, 1) - PRINT_COURSE_SCORES(COURSE_WF, 1) + PRINT_COURSE_SCORES(COURSE_WF, 1) PRINT_COURSE_SCORES(COURSE_JRB, 1) PRINT_COURSE_SCORES(COURSE_CCM, 1) PRINT_COURSE_SCORES(COURSE_BBH, 1) @@ -2642,17 +2594,16 @@ void print_save_file_scores(s8 fileIndex) { PRINT_COURSE_SCORES(COURSE_LLL, 1) PRINT_COURSE_SCORES(COURSE_SSL, 1) PRINT_COURSE_SCORES(COURSE_DDD, 1) - PRINT_COURSE_SCORES(COURSE_SL, 0) + PRINT_COURSE_SCORES(COURSE_SL, 0) PRINT_COURSE_SCORES(COURSE_WDW, 0) PRINT_COURSE_SCORES(COURSE_TTM, 0) PRINT_COURSE_SCORES(COURSE_THI, 0) PRINT_COURSE_SCORES(COURSE_TTC, 0) - PRINT_COURSE_SCORES(COURSE_RR, 0) + PRINT_COURSE_SCORES(COURSE_RR, 0) #undef PRINT_COURSE_SCORES // Print castle secret stars text - print_menu_generic_string(LEVEL_NAME_X + SECRET_STARS_PAD, 23 + 12 * 16, - GameEngine_LoadLevelName(25)); + print_menu_generic_string(LEVEL_NAME_X + SECRET_STARS_PAD, 23 + 12 * 16, GameEngine_LoadLevelName(25)); // Print castle secret stars score print_score_file_castle_secret_stars(fileIndex, STAR_SCORE_X, 23 + 12 * 16); @@ -2728,7 +2679,7 @@ static void print_file_select_strings(void) { /** * Geo function that prints file select strings and the cursor. */ -Gfx *geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct GraphNode *node, UNUSED Mat4 mtx) { +Gfx* geo_file_select_strings_and_menu_cursor(s32 callContext, UNUSED struct GraphNode* node, UNUSED Mat4 mtx) { if (callContext == GEO_CONTEXT_RENDER) { print_file_select_strings(); print_menu_cursor(); diff --git a/src/menu/intro_geo.c b/src/menu/intro_geo.c index a4a2b871..4d196ccb 100644 --- a/src/menu/intro_geo.c +++ b/src/menu/intro_geo.c @@ -26,13 +26,13 @@ struct GraphNodeMore { /*0x00*/ struct GraphNode node; - /*0x14*/ void *todo; + /*0x14*/ void* todo; /*0x18*/ u32 unk18; }; // intro geo bss #ifdef VERSION_SH -static u16 *sFramebuffers[3]; +static u16* sFramebuffers[3]; #endif static s32 sGameOverFrameCounter; static s32 sGameOverTableIndex; @@ -42,13 +42,13 @@ static s32 sTmCopyrightAlpha; /** * Geo callback to render the "Super Mario 64" logo on the title screen */ -Gfx *geo_intro_super_mario_64_logo(s32 state, struct GraphNode *node, UNUSED void *context) { - struct GraphNode *graphNode = node; - Gfx *dl = NULL; - Gfx *dlIter = NULL; - Mtx *scaleMat; - f32 *scaleTable1 = segmented_to_virtual(intro_seg7_table_0700C790); - f32 *scaleTable2 = segmented_to_virtual(intro_seg7_table_0700C880); +Gfx* geo_intro_super_mario_64_logo(s32 state, struct GraphNode* node, UNUSED void* context) { + struct GraphNode* graphNode = node; + Gfx* dl = NULL; + Gfx* dlIter = NULL; + Mtx* scaleMat; + f32* scaleTable1 = segmented_to_virtual(intro_seg7_table_0700C790); + f32* scaleTable2 = segmented_to_virtual(intro_seg7_table_0700C880); f32 scaleX; f32 scaleY; f32 scaleZ; @@ -86,7 +86,7 @@ Gfx *geo_intro_super_mario_64_logo(s32 state, struct GraphNode *node, UNUSED voi guScale(scaleMat, scaleX, scaleY, scaleZ); gSPMatrix(dlIter++, scaleMat, G_MTX_MODELVIEW | G_MTX_MUL | G_MTX_PUSH); - gSPDisplayList(dlIter++, intro_seg7_dl_0700B3A0); // draw model + gSPDisplayList(dlIter++, intro_seg7_dl_0700B3A0); // draw model gSPPopMatrix(dlIter++, G_MTX_MODELVIEW); gSPEndDisplayList(dlIter); @@ -98,14 +98,14 @@ Gfx *geo_intro_super_mario_64_logo(s32 state, struct GraphNode *node, UNUSED voi /** * Geo callback to render TM and Copyright on the title screen */ -Gfx *geo_intro_tm_copyright(s32 state, struct GraphNode *node, UNUSED void *context) { - struct GraphNode *graphNode = node; - Gfx *dl = NULL; - Gfx *dlIter = NULL; +Gfx* geo_intro_tm_copyright(s32 state, struct GraphNode* node, UNUSED void* context) { + struct GraphNode* graphNode = node; + Gfx* dl = NULL; + Gfx* dlIter = NULL; - if (state != 1) { // reset + if (state != 1) { // reset sTmCopyrightAlpha = 0; - } else if (state == 1) { // draw + } else if (state == 1) { // draw dl = alloc_display_list(5 * sizeof(*dl)); dlIter = dl; gSPDisplayList(dlIter++, dl_proj_mtx_fullscreen); @@ -120,7 +120,7 @@ Gfx *geo_intro_tm_copyright(s32 state, struct GraphNode *node, UNUSED void *cont gDPSetRenderMode(dlIter++, G_RM_AA_XLU_SURF, G_RM_AA_XLU_SURF2); break; } - gSPDisplayList(dlIter++, intro_seg7_dl_0700C6A0); // draw model + gSPDisplayList(dlIter++, intro_seg7_dl_0700C6A0); // draw model gSPEndDisplayList(dlIter); // Once the "Super Mario 64" logo has just about zoomed fully, fade in the "TM" and copyright text @@ -138,31 +138,32 @@ Gfx *geo_intro_tm_copyright(s32 state, struct GraphNode *node, UNUSED void *cont * Generates a display list for a single background tile * * @param index which tile to render (value from 0 to 11) - * @param backgroundTable array describing which image to use for each tile (0 denotes a "Super Mario 64" image, and 1 denotes a "Game Over" image) + * @param backgroundTable array describing which image to use for each tile (0 denotes a "Super Mario 64" image, and 1 + * denotes a "Game Over" image) */ -static Gfx *intro_backdrop_one_image(s32 index, s8 *backgroundTable) { +static Gfx* intro_backdrop_one_image(s32 index, s8* backgroundTable) { // intro screen background display lists for each of four 80x20 textures - static const Gfx *introBackgroundDlRows[] = { title_screen_bg_dl_0A000130, title_screen_bg_dl_0A000148, + static const Gfx* introBackgroundDlRows[] = { title_screen_bg_dl_0A000130, title_screen_bg_dl_0A000148, title_screen_bg_dl_0A000160, title_screen_bg_dl_0A000178 }; - s32 num_tiles_h = (s32)(GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT + 80 ) / 80; - float xOffset = ((float) SCREEN_WIDTH / 2) - ( GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT / 2); + s32 num_tiles_h = (s32)(GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT + 80) / 80; + float xOffset = ((float)SCREEN_WIDTH / 2) - (GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT / 2); // table that points to either the "Super Mario 64" or "Game Over" tables - static const u8 *const *textureTables[] = { mario_title_texture_table, game_over_texture_table }; + static const u8* const* textureTables[] = { mario_title_texture_table, game_over_texture_table }; - Mtx *mtx = alloc_display_list(sizeof(*mtx)); - Gfx *displayList = alloc_display_list(36 * sizeof(*displayList)); - Gfx *displayListIter = displayList; - const u8 *const *vIntroBgTable = segmented_to_virtual(textureTables[backgroundTable[0]]); + Mtx* mtx = alloc_display_list(sizeof(*mtx)); + Gfx* displayList = alloc_display_list(36 * sizeof(*displayList)); + Gfx* displayListIter = displayList; + const u8* const* vIntroBgTable = segmented_to_virtual(textureTables[backgroundTable[0]]); s32 i; - guTranslate(mtx, ((index % num_tiles_h) * 80) + xOffset, (index/num_tiles_h) * 80, 0.0f); + guTranslate(mtx, ((index % num_tiles_h) * 80) + xOffset, (index / num_tiles_h) * 80, 0.0f); gSPMatrix(displayListIter++, mtx, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH); gSPDisplayList(displayListIter++, title_screen_bg_dl_0A000118); for (i = 0; i < 4; ++i) { - gDPLoadTextureBlock(displayListIter++, vIntroBgTable[i], G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 20, 0, - G_TX_CLAMP, G_TX_CLAMP, 7, 6, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(displayListIter++, vIntroBgTable[i], G_IM_FMT_RGBA, G_IM_SIZ_16b, 80, 20, 0, G_TX_CLAMP, + G_TX_CLAMP, 7, 6, G_TX_NOLOD, G_TX_NOLOD); gSPDisplayList(displayListIter++, introBackgroundDlRows[i]); } gSPPopMatrix(displayListIter++, G_MTX_MODELVIEW); @@ -178,22 +179,22 @@ static s8 introBackgroundIndexTable[] = { }; // only one table of indexes listed -static s8 *introBackgroundTables[] = { introBackgroundIndexTable }; +static s8* introBackgroundTables[] = { introBackgroundIndexTable }; /** * Geo callback to render the intro background tiles */ -Gfx *geo_intro_regular_backdrop(s32 state, struct GraphNode *node, UNUSED void *context) { - struct GraphNodeMore *graphNode = (struct GraphNodeMore *) node; +Gfx* geo_intro_regular_backdrop(s32 state, struct GraphNode* node, UNUSED void* context) { + struct GraphNodeMore* graphNode = (struct GraphNodeMore*)node; s32 index = graphNode->unk18 & 0xff; // TODO: word at offset 0x18 of struct GraphNode (always ends up being 0) - s8 *backgroundTable = introBackgroundTables[index]; - Gfx *dl = NULL; - Gfx *dlIter = NULL; + s8* backgroundTable = introBackgroundTables[index]; + Gfx* dl = NULL; + Gfx* dlIter = NULL; s32 i; - s32 num_tiles_h = (s32)((GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT + 80 ) / 80) * 3; + s32 num_tiles_h = (s32)((GFX_DIMENSIONS_ASPECT_RATIO * SCREEN_HEIGHT + 80) / 80) * 3; - if (state == 1) { // draw + if (state == 1) { // draw dl = alloc_display_list((num_tiles_h + 4) * sizeof(*dl)); dlIter = dl; graphNode->node.flags = (graphNode->node.flags & 0xFF) | (LAYER_OPAQUE << 8); @@ -209,28 +210,27 @@ Gfx *geo_intro_regular_backdrop(s32 state, struct GraphNode *node, UNUSED void * } static s8 gameOverBackgroundTable[] = { - INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, - INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, - INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, - INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, + INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, + INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, + INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, INTRO_BACKGROUND_GAME_OVER, }; /** * Geo callback to render the Game Over background tiles */ -Gfx *geo_intro_gameover_backdrop(s32 state, struct GraphNode *node, UNUSED void *context) { - struct GraphNode *graphNode = node; - Gfx *dl = NULL; - Gfx *dlIter = NULL; +Gfx* geo_intro_gameover_backdrop(s32 state, struct GraphNode* node, UNUSED void* context) { + struct GraphNode* graphNode = node; + Gfx* dl = NULL; + Gfx* dlIter = NULL; s32 j; s32 i; - if (state != 1) { // reset + if (state != 1) { // reset sGameOverFrameCounter = 0; sGameOverTableIndex = -2; for (i = 0; i < ARRAY_COUNT(gameOverBackgroundTable); ++i) gameOverBackgroundTable[i] = INTRO_BACKGROUND_GAME_OVER; - } else { // draw + } else { // draw dl = alloc_display_list(16 * sizeof(*dl)); dlIter = dl; if (sGameOverTableIndex == -2) { @@ -245,8 +245,7 @@ Gfx *geo_intro_gameover_backdrop(s32 state, struct GraphNode *node, UNUSED void static s8 flipOrder[] = { 0, 1, 2, 3, 7, 11, 10, 9, 8, 4, 5, 6 }; sGameOverTableIndex++; - gameOverBackgroundTable[flipOrder[sGameOverTableIndex]] = - INTRO_BACKGROUND_SUPER_MARIO; + gameOverBackgroundTable[flipOrder[sGameOverTableIndex]] = INTRO_BACKGROUND_SUPER_MARIO; } } if (sGameOverTableIndex != 11) { @@ -273,41 +272,34 @@ extern Gfx title_screen_bg_dl_0A007548[]; // Data s8 sFaceVisible[] = { - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, - 1, 1, 0, 0, 0, 0, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 1, 1, + 1, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, }; s8 sFaceToggleOrder[] = { - 0, 1, 2, 3, 4, 5, 6, 7, - 15, 23, 31, 39, 47, 46, 45, 44, - 43, 42, 41, 40, 32, 24, 16, 8, - 9, 10, 11, 12, 13, 14, 22, 30, - 38, 37, 36, 35, 34, 33, 25, 17, + 0, 1, 2, 3, 4, 5, 6, 7, 15, 23, 31, 39, 47, 46, 45, 44, 43, 42, 41, 40, + 32, 24, 16, 8, 9, 10, 11, 12, 13, 14, 22, 30, 38, 37, 36, 35, 34, 33, 25, 17, }; s8 sFaceCounter = 0; -void intro_gen_face_texrect(Gfx **dlIter) { +void intro_gen_face_texrect(Gfx** dlIter) { s32 x; s32 y; for (y = 0; y < 6; y++) { for (x = 0; x < 8; x++) { - if (sFaceVisible[y*8 + x] != 0) { - gSPTextureRectangle((*dlIter)++, (x * 40) << 2, (y * 40) << 2, (x * 40 + 39) << 2, (y * 40 + 39) << 2, 0, - 0, 0, 4 << 10, 1 << 10); + if (sFaceVisible[y * 8 + x] != 0) { + gSPTextureRectangle((*dlIter)++, (x * 40) << 2, (y * 40) << 2, (x * 40 + 39) << 2, (y * 40 + 39) << 2, + 0, 0, 0, 4 << 10, 1 << 10); } } } } -Gfx *intro_draw_face(u16 *image, s32 imageW, s32 imageH) { - Gfx *dl; - Gfx *dlIter; +Gfx* intro_draw_face(u16* image, s32 imageW, s32 imageH) { + Gfx* dl; + Gfx* dlIter; dl = alloc_display_list(110 * sizeof(Gfx)); @@ -319,7 +311,8 @@ Gfx *intro_draw_face(u16 *image, s32 imageW, s32 imageH) { gSPDisplayList(dlIter++, title_screen_bg_dl_0A0065E8); - gDPLoadTextureBlock(dlIter++, VIRTUAL_TO_PHYSICAL(image), G_IM_FMT_RGBA, G_IM_SIZ_16b, imageW, imageH, 0, G_TX_CLAMP | G_TX_NOMIRROR, G_TX_CLAMP | G_TX_NOMIRROR, 6, 6, G_TX_NOLOD, G_TX_NOLOD); + gDPLoadTextureBlock(dlIter++, VIRTUAL_TO_PHYSICAL(image), G_IM_FMT_RGBA, G_IM_SIZ_16b, imageW, imageH, 0, + G_TX_CLAMP | G_TX_NOMIRROR, G_TX_CLAMP | G_TX_NOMIRROR, 6, 6, G_TX_NOLOD, G_TX_NOLOD); intro_gen_face_texrect(&dlIter); @@ -330,9 +323,9 @@ Gfx *intro_draw_face(u16 *image, s32 imageW, s32 imageH) { return dl; } -u16 *intro_sample_framebuffer(s32 imageW, s32 imageH, s32 sampleW, s32 sampleH) { - u16 *fb; - u16 *image; +u16* intro_sample_framebuffer(s32 imageW, s32 imageH, s32 sampleW, s32 sampleH) { + u16* fb; + u16* image; s32 pixel; f32 size; f32 r, g, b; @@ -375,19 +368,19 @@ u16 *intro_sample_framebuffer(s32 imageW, s32 imageH, s32 sampleW, s32 sampleH) } size = sampleW * sampleH; - image[imageH * iy + ix] = ((((u16) (r / size + 0.5) << 0xB) & 0xF800) & 0xffff) + - ((((u16) (g / size + 0.5) << 0x6) & 0x7C0) & 0xffff) + - ((((u16) (b / size + 0.5) << 0x1) & 0x3E) & 0xffff) + 1; + image[imageH * iy + ix] = ((((u16)(r / size + 0.5) << 0xB) & 0xF800) & 0xffff) + + ((((u16)(g / size + 0.5) << 0x6) & 0x7C0) & 0xffff) + + ((((u16)(b / size + 0.5) << 0x1) & 0x3E) & 0xffff) + 1; } } return image; } -Gfx *geo_intro_face_easter_egg(s32 state, struct GraphNode *node, UNUSED void *context) { - struct GraphNodeGenerated *genNode = (struct GraphNodeGenerated *)node; - u16 *image; - Gfx *dl = NULL; +Gfx* geo_intro_face_easter_egg(s32 state, struct GraphNode* node, UNUSED void* context) { + struct GraphNodeGenerated* genNode = (struct GraphNodeGenerated*)node; + u16* image; + Gfx* dl = NULL; s32 i; if (state != 1) { @@ -426,10 +419,10 @@ Gfx *geo_intro_face_easter_egg(s32 state, struct GraphNode *node, UNUSED void *c return dl; } -Gfx *geo_intro_rumble_pak_graphic(s32 state, struct GraphNode *node, UNUSED void *context) { - struct GraphNodeGenerated *genNode = (struct GraphNodeGenerated *)node; - Gfx *dlIter; - Gfx *dl = NULL; +Gfx* geo_intro_rumble_pak_graphic(s32 state, struct GraphNode* node, UNUSED void* context) { + struct GraphNodeGenerated* genNode = (struct GraphNodeGenerated*)node; + Gfx* dlIter; + Gfx* dl = NULL; s32 introContext; s8 backgroundTileSix = 0; diff --git a/src/menu/star_select.c b/src/menu/star_select.c index 068dafeb..323699cb 100644 --- a/src/menu/star_select.c +++ b/src/menu/star_select.c @@ -34,7 +34,7 @@ #define COIN_STAR_INDEX 6 // Star Selector count models printed in the act selector menu. -static struct Object *sStarSelectorModels[8]; +static struct Object* sStarSelectorModels[8]; // The act the course is loaded as, affects whether some objects spawn. static s8 sLoadedActNum; @@ -101,8 +101,8 @@ void bhv_act_selector_star_type_loop(void) { void render_100_coin_star(u8 stars) { if (stars & (1 << COIN_STAR_INDEX)) { // If the 100 coin star has been collected, create a new star selector next to the coin score. - sStarSelectorModels[COIN_STAR_INDEX] = spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, - bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); + sStarSelectorModels[COIN_STAR_INDEX] = + spawn_object_abs_with_rot(gCurrentObject, 0, MODEL_STAR, bhvActSelectorStarType, 370, 24, -300, 0, 0, 0); sStarSelectorModels[COIN_STAR_INDEX]->oStarSelectorSize = 0.8; sStarSelectorModels[COIN_STAR_INDEX]->oStarSelectorType = STAR_SELECTOR_100_COINS; } @@ -286,18 +286,18 @@ void print_course_number(void) { */ void print_act_selector_strings(void) { #ifdef VERSION_EU - unsigned char myScore[][10] = { {TEXT_MYSCORE}, {TEXT_MY_SCORE_FR}, {TEXT_MY_SCORE_DE} }; + unsigned char myScore[][10] = { { TEXT_MYSCORE }, { TEXT_MY_SCORE_FR }, { TEXT_MY_SCORE_DE } }; #else unsigned char* myScore = GameEngine_LoadTranslation("TEXT_MYSCORE"); #endif unsigned char* starNumbers = GameEngine_LoadTranslation("TEXT_ZERO"); #ifdef VERSION_EU - u8 **levelNameTbl; - u8 *currLevelName; - u8 **actNameTbl; + u8** levelNameTbl; + u8* currLevelName; + u8** actNameTbl; #endif - u8 *selectedActName; + u8* selectedActName; s16 lvlNameX; s16 actNameX; s8 i; @@ -359,7 +359,8 @@ void print_act_selector_strings(void) { gDPSetEnvColor(gDisplayListHead++, 0, 0, 0, 255); // Print the name of the selected act. if (sVisibleStars != 0) { - selectedActName = GameEngine_LoadActName(COURSE_NUM_TO_INDEX(gCurrCourseNum) * LEVEL_STARS_MAX + sSelectedActIndex); + selectedActName = + GameEngine_LoadActName(COURSE_NUM_TO_INDEX(gCurrCourseNum) * LEVEL_STARS_MAX + sSelectedActIndex); actNameX = get_str_x_pos_from_center(ACT_NAME_X, selectedActName, 8.0f); print_menu_generic_string(actNameX, 81, selectedActName); } @@ -375,12 +376,12 @@ void print_act_selector_strings(void) { } gSPDisplayList(gDisplayListHead++, dl_menu_ia8_text_end); - } +} /** * Geo function that Print act selector strings. */ -Gfx *geo_act_selector_strings(s16 callContext, UNUSED struct GraphNode *node, UNUSED void *context) { +Gfx* geo_act_selector_strings(s16 callContext, UNUSED struct GraphNode* node, UNUSED void* context) { if (callContext == GEO_CONTEXT_RENDER) { print_act_selector_strings(); } @@ -400,8 +401,7 @@ s32 lvl_init_act_selector_values_and_stars(UNUSED s32 arg, UNUSED s32 unused) { sActSelectorMenuTimer = 0; sSelectedActIndex = 0; sSelectableStarIndex = 0; - sObtainedStars = - save_file_get_course_star_count(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum)); + sObtainedStars = save_file_get_course_star_count(gCurrSaveFileNum - 1, COURSE_NUM_TO_INDEX(gCurrCourseNum)); // Don't count 100 coin star if (stars & (1 << COIN_STAR_INDEX)) { @@ -419,9 +419,8 @@ s32 lvl_update_obj_and_load_act_button_actions(UNUSED s32 arg, UNUSED s32 unused if (sActSelectorMenuTimer > 10) { // If any of these buttons are pressed, play sound and go to course act #ifndef VERSION_EU - if ((gPlayer3Controller->buttonPressed & A_BUTTON) - || (gPlayer3Controller->buttonPressed & START_BUTTON) - || (gPlayer3Controller->buttonPressed & B_BUTTON)) { + if ((gPlayer3Controller->buttonPressed & A_BUTTON) || (gPlayer3Controller->buttonPressed & START_BUTTON) || + (gPlayer3Controller->buttonPressed & B_BUTTON)) { #else if ((gPlayer3Controller->buttonPressed & (A_BUTTON | START_BUTTON | B_BUTTON | Z_TRIG))) { #endif diff --git a/src/menu/title_screen.c b/src/menu/title_screen.c index 12c0147c..697914c0 100644 --- a/src/menu/title_screen.c +++ b/src/menu/title_screen.c @@ -28,7 +28,7 @@ #define DEFINE_LEVEL(textname, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) textname, static char sLevelSelectStageNames[64][16] = { - #include "levels/level_defines.h" +#include "levels/level_defines.h" }; #undef STUB_LEVEL #undef DEFINE_LEVEL @@ -37,7 +37,7 @@ static char sLevelSelectStageNames[64][16] = { #define DEFINE_LEVEL(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, textname) textname, static char sBetterLevelSelectStageNames[38][31] = { - #include "levels/level_defines.h" +#include "levels/level_defines.h" }; #undef STUB_LEVEL #undef DEFINE_LEVEL @@ -49,9 +49,7 @@ static s16 sPlayMarioGameOver = TRUE; #define PRESS_START_DEMO_TIMER 800 static const char* gDemoInputs[8] = { - gDemoBitdw, gDemoWf, gDemoCcm, - gDemoBbh, gDemoJrb, gDemoHmc, - gDemoPss, gDemoUnused + gDemoBitdw, gDemoWf, gDemoCcm, gDemoBbh, gDemoJrb, gDemoHmc, gDemoPss, gDemoUnused }; /** @@ -71,7 +69,7 @@ s32 run_level_id_or_demo(s32 level) { // start the Mario demo animation for the demo list. void* data = ResourceGetDataByName(gDemoInputs[gDemoInputListID]); - if(data == NULL) { + if (data == NULL) { return 0; } @@ -85,8 +83,8 @@ s32 run_level_id_or_demo(s32 level) { // add 1 (+4) to the pointer to skip the first 4 bytes // Use the first 4 bytes to store level ID, // then use the rest of the values for inputs - gCurrDemoInput = ((struct DemoInput *) data) + 1; - level = (s8)((struct DemoInput *) data)->timer; + gCurrDemoInput = ((struct DemoInput*)data) + 1; + level = (s8)((struct DemoInput*)data)->timer; gCurrSaveFileNum = 1; gCurrActNum = 1; } @@ -116,18 +114,22 @@ s16 intro_level_select(void) { --gCurrLevelNum, stageChanged = TRUE; direction = -1; } - if (gPlayer1Controller->buttonPressed & U_JPAD || (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & U_CBUTTONS)) { + if (gPlayer1Controller->buttonPressed & U_JPAD || + (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & U_CBUTTONS)) { --gCurrLevelNum, stageChanged = TRUE; direction = -1; } - if (gPlayer1Controller->buttonPressed & D_JPAD || (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & D_CBUTTONS)) { + if (gPlayer1Controller->buttonPressed & D_JPAD || + (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & D_CBUTTONS)) { ++gCurrLevelNum, stageChanged = TRUE; } - if (gPlayer1Controller->buttonPressed & L_JPAD || (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & L_CBUTTONS)) { + if (gPlayer1Controller->buttonPressed & L_JPAD || + (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & L_CBUTTONS)) { gCurrLevelNum -= 10, stageChanged = TRUE; direction = -1; } - if (gPlayer1Controller->buttonPressed & R_JPAD || (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & R_CBUTTONS)) { + if (gPlayer1Controller->buttonPressed & R_JPAD || + (CVarGetInteger("gDeveloper.BetterLevelSelect", 0) && gPlayer1Controller->buttonPressed & R_CBUTTONS)) { gCurrLevelNum += 10, stageChanged = TRUE; } diff --git a/src/port/Engine.cpp b/src/port/Engine.cpp index f53731fa..04592256 100644 --- a/src/port/Engine.cpp +++ b/src/port/Engine.cpp @@ -56,7 +56,7 @@ bool prevAltAssets = false; GameEngine* GameEngine::Instance; -GameEngine::GameEngine(): dictionary(nullptr) { +GameEngine::GameEngine() : dictionary(nullptr) { this->context = Ship::Context::CreateUninitializedInstance("Ghostship", "sm64", "ghostship.cfg.json"); #ifdef __SWITCH__ @@ -75,8 +75,10 @@ GameEngine::GameEngine(): dictionary(nullptr) { if (std::filesystem::exists(main_path)) { archiveFiles.push_back(main_path); } else { - if (ShowYesNoBox("Ghostship - Asset Extraction", "Please provide a Super Mario 64 ROM.\n\nSupported Versions:\nUS\nJP\n\nAssets will be extracted into an O2R file.") == IDYES) { - if(!GenAssetFile()){ + if (ShowYesNoBox("Ghostship - Asset Extraction", + "Please provide a Super Mario 64 ROM.\n\nSupported Versions:\nUS\nJP\n\nAssets will be " + "extracted into an O2R file.") == IDYES) { + if (!GenAssetFile()) { ShowMessage("Error", "An error occured, no O2R file was generated.\n\nExiting..."); exit(1); } else { @@ -91,8 +93,7 @@ GameEngine::GameEngine(): dictionary(nullptr) { archiveFiles.push_back(assets_path); } - if (const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods"); - !patches_path.empty()) { + if (const std::string patches_path = Ship::Context::GetPathRelativeToAppDirectory("mods"); !patches_path.empty()) { if (!std::filesystem::exists(patches_path)) { std::filesystem::create_directories(patches_path); } @@ -127,12 +128,12 @@ GameEngine::GameEngine(): dictionary(nullptr) { #ifndef __SWITCH__ Ship::Context::GetInstance()->GetLogger()->set_level( - (spdlog::level::level_enum) CVarGetInteger("gDeveloperTools.LogLevel", 1)); + (spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v"); #endif Ship::Context::GetInstance()->GetLogger()->set_level( - (spdlog::level::level_enum) CVarGetInteger("gDeveloperTools.LogLevel", 1)); + (spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); Ship::Context::GetInstance()->GetLogger()->set_pattern("[%H:%M:%S.%e] [%s:%#] [%l] %v"); window->SetTargetFps(60); @@ -141,31 +142,55 @@ GameEngine::GameEngine(): dictionary(nullptr) { auto loader = context->GetResourceManager()->GetResourceLoader(); auto blobFactory = std::make_shared(); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Animation", static_cast(SM64::ResourceType::Anim), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "AudioBank", static_cast(SM64::ResourceType::Bank), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "AudioSample", static_cast(SM64::ResourceType::Sample), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "AudioSequence", static_cast(SM64::ResourceType::Sequence), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Dialog", static_cast(SM64::ResourceType::SDialog), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Dictionary", static_cast(SM64::ResourceType::Dictionary), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Texture", static_cast(Fast::ResourceType::Texture), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Texture", static_cast(Fast::ResourceType::Texture), 1); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Vertex", static_cast(Fast::ResourceType::Vertex), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "DisplayList", static_cast(Fast::ResourceType::DisplayList), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Matrix", static_cast(Fast::ResourceType::Matrix), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Light", static_cast(Fast::ResourceType::Light), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "AssetArray", static_cast(SM64::ResourceType::AssetArray), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Trajectory", static_cast(SM64::ResourceType::Trajectory), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Movtex", static_cast(SM64::ResourceType::Movtex), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Animation", + static_cast(SM64::ResourceType::Anim), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "AudioBank", + static_cast(SM64::ResourceType::Bank), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "AudioSample", static_cast(SM64::ResourceType::Sample), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "AudioSequence", static_cast(SM64::ResourceType::Sequence), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Dialog", + static_cast(SM64::ResourceType::SDialog), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Dictionary", + static_cast(SM64::ResourceType::Dictionary), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "Texture", static_cast(Fast::ResourceType::Texture), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "Texture", static_cast(Fast::ResourceType::Texture), 1); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "Vertex", static_cast(Fast::ResourceType::Vertex), 0); + loader->RegisterResourceFactory(std::make_shared(), + RESOURCE_FORMAT_BINARY, "DisplayList", + static_cast(Fast::ResourceType::DisplayList), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "Matrix", static_cast(Fast::ResourceType::Matrix), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "Light", static_cast(Fast::ResourceType::Light), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, + "AssetArray", static_cast(SM64::ResourceType::AssetArray), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Trajectory", + static_cast(SM64::ResourceType::Trajectory), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Movtex", + static_cast(SM64::ResourceType::Movtex), 0); // TODO: This shit needs to change, i mean why i have 5 factories doing the same thing xD - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "GenericArray", static_cast(SM64::ResourceType::GenericArray), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Collision", static_cast(SM64::ResourceType::Collision), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "PaintingData", static_cast(SM64::ResourceType::PaintingData), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "MacroObject", static_cast(SM64::ResourceType::MacroObject), 0); + loader->RegisterResourceFactory(std::make_shared(), + RESOURCE_FORMAT_BINARY, "GenericArray", + static_cast(SM64::ResourceType::GenericArray), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Collision", + static_cast(SM64::ResourceType::Collision), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "PaintingData", + static_cast(SM64::ResourceType::PaintingData), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "MacroObject", + static_cast(SM64::ResourceType::MacroObject), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "MovtexQuad", static_cast(SM64::ResourceType::MovtexQuad), 0); - loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Painting", static_cast(SM64::ResourceType::Painting), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "MovtexQuad", + static_cast(SM64::ResourceType::MovtexQuad), 0); + loader->RegisterResourceFactory(std::make_shared(), RESOURCE_FORMAT_BINARY, "Painting", + static_cast(SM64::ResourceType::Painting), 0); - loader->RegisterResourceFactory(blobFactory, RESOURCE_FORMAT_BINARY, "Blob", static_cast(Ship::ResourceType::Blob), 0); + loader->RegisterResourceFactory(blobFactory, RESOURCE_FORMAT_BINARY, "Blob", + static_cast(Ship::ResourceType::Blob), 0); prevAltAssets = CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0); context->GetResourceManager()->SetAltAssetsEnabled(prevAltAssets); } @@ -184,7 +209,8 @@ bool GameEngine::GenAssetFile(bool exitOnFail) { auto game = extractor->ValidateChecksum(); if (!game.has_value()) { - ShowMessage("Unsupported ROM", "The provided ROM is not supported.\n\nCheck the readme for a list of supported versions."); + ShowMessage("Unsupported ROM", + "The provided ROM is not supported.\n\nCheck the readme for a list of supported versions."); if (exitOnFail) { exit(1); } else { @@ -192,7 +218,8 @@ bool GameEngine::GenAssetFile(bool exitOnFail) { } } - ShowMessage(("Ghostship - Extraction - Found " + game.value()).c_str(), "The extraction process will now begin.\n\nThis may take a few minutes.", SDL_MESSAGEBOX_INFORMATION); + ShowMessage(("Ghostship - Extraction - Found " + game.value()).c_str(), + "The extraction process will now begin.\n\nThis may take a few minutes.", SDL_MESSAGEBOX_INFORMATION); return extractor->GenerateOTR(); } @@ -233,7 +260,7 @@ int GameEngine::ShowYesNoBox(const char* title, const char* box) { return ret; } -void GameEngine::Create(){ +void GameEngine::Create() { const auto instance = Instance = new GameEngine(); GameUI::SetupGuiElements(); instance->AudioInit(); @@ -246,7 +273,7 @@ void GameEngine::Create(){ DevConsole_Init(); } -void GameEngine::Destroy(){ +void GameEngine::Destroy() { PortEnhancements_Exit(); AudioExit(); #ifdef __SWITCH__ @@ -262,7 +289,8 @@ void GameEngine::StartFrame() const { switch (dwScancode) { case KbScancode::LUS_KB_TAB: { // Toggle HD Assets - CVarSetInteger("gEnhancements.Mods.AlternateAssets", !CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0)); + CVarSetInteger("gEnhancements.Mods.AlternateAssets", + !CVarGetInteger("gEnhancements.Mods.AlternateAssets", 0)); break; } default: @@ -279,12 +307,13 @@ uint32_t GameEngine::GetInterpolationFPS() { return Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); } - return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), CVarGetInteger("gInterpolationFPS", 30)); + return std::min(Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(), + CVarGetInteger("gInterpolationFPS", 30)); } // Audio -void GameEngine::HandleAudioThread(){ +void GameEngine::HandleAudioThread() { while (audio.running) { { std::unique_lock Lock(audio.mutex); @@ -306,14 +335,14 @@ void GameEngine::HandleAudioThread(){ create_next_audio_buffer(audio_buffer + i * (num_audio_samples * 2), num_audio_samples); } - AudioPlayerPlayFrame((u8 *) audio_buffer, 2 * num_audio_samples * 4); + AudioPlayerPlayFrame((u8*)audio_buffer, 2 * num_audio_samples * 4); audio.processing = false; audio.cv_from_thread.notify_one(); } } -void GameEngine::StartAudioFrame(){ +void GameEngine::StartAudioFrame() { { std::unique_lock Lock(audio.mutex); audio.processing = true; @@ -322,7 +351,7 @@ void GameEngine::StartAudioFrame(){ audio.cv_to_thread.notify_one(); } -void GameEngine::EndAudioFrame(){ +void GameEngine::EndAudioFrame() { { std::unique_lock Lock(audio.mutex); while (audio.processing) { @@ -341,15 +370,15 @@ void GameEngine::AudioInit() { Instance->audioSequenceTable.resize(512); Instance->banksTable.resize(512); - for(auto& bank : *banksFiles){ + for (auto& bank : *banksFiles) { auto path = "__OTR__" + bank; - const auto ctl = static_cast(ResourceGetDataByName(path.c_str())); + const auto ctl = static_cast(ResourceGetDataByName(path.c_str())); this->bankMapTable[bank] = ctl->bankId; } - for( auto& sequence : *sequences_files){ + for (auto& sequence : *sequences_files) { auto path = "__OTR__" + sequence; - auto seq = static_cast(ResourceGetDataByName(path.c_str())); + auto seq = static_cast(ResourceGetDataByName(path.c_str())); Instance->sequenceTable[seq->id] = path; } @@ -371,7 +400,8 @@ void GameEngine::AudioExit() { } void GameEngine::LoadDictionary() { - this->dictionary = static_cast> *>(ResourceGetDataByName("__OTR__texts/strings/global")); + this->dictionary = static_cast>*>( + ResourceGetDataByName("__OTR__texts/strings/global")); } void GameEngine::LoadPlayerAnims() { @@ -380,14 +410,14 @@ void GameEngine::LoadPlayerAnims() { auto anims = archiveMgr->ListFiles("assets/anims/*"); this->animationsTable.resize(anims->size()); - for(auto& anim : *anims){ + for (auto& anim : *anims) { const auto id = std::stoi(anim.substr(anim.find('_') + 1, anim.length()), nullptr, 16); - this->animationsTable[id] = static_cast(ResourceGetDataByName(anim.c_str())); + this->animationsTable[id] = static_cast(ResourceGetDataByName(anim.c_str())); } } uint8_t GameEngine::GetBankIdByName(const std::string& name) { - if(Instance->bankMapTable.contains(name)){ + if (Instance->bankMapTable.contains(name)) { return Instance->bankMapTable[name]; } return 0; @@ -445,7 +475,7 @@ void GameEngine::ProcessGfxCommands(Gfx* commands) { while (time + original_fps <= next_original_frame) { time += original_fps; if (time != next_original_frame) { - mtx_replacements.push_back(FrameInterpolation_Interpolate((float) time / next_original_frame)); + mtx_replacements.push_back(FrameInterpolation_Interpolate((float)time / next_original_frame)); } else { mtx_replacements.emplace_back(); // No interpolation for key frames } @@ -479,7 +509,7 @@ extern "C" uint32_t GameEngine_GetSampleRate() { return player->GetSampleRate(); } -extern "C" uint32_t GameEngine_GetSamplesPerFrame(){ +extern "C" uint32_t GameEngine_GetSamplesPerFrame() { return SAMPLES_PER_FRAME; } @@ -487,9 +517,9 @@ extern "C" uint32_t GameEngine_GetSamplesPerFrame(){ Fast::Interpreter* GameEngine_GetInterpreter() { return static_pointer_cast(Ship::Context::GetInstance()->GetWindow()) - ->GetInterpreterWeak() - .lock() - .get(); + ->GetInterpreterWeak() + .lock() + .get(); } extern "C" float GameEngine_GetAspectRatio() { @@ -500,17 +530,17 @@ extern "C" float GameEngine_GetAspectRatio() { extern "C" CtlEntry* GameEngine_LoadBank(const uint8_t bankId) { const auto engine = GameEngine::Instance; - if(bankId >= engine->bankMapTable.size()){ + if (bankId >= engine->bankMapTable.size()) { return nullptr; } - if(engine->banksTable[bankId] != nullptr){ + if (engine->banksTable[bankId] != nullptr) { return engine->banksTable[bankId]; } - for(auto& bank : engine->bankMapTable){ - if(bank.second == bankId){ - const auto ctl = static_cast(ResourceGetDataByName(("__OTR__" + bank.first).c_str())); + for (auto& bank : engine->bankMapTable) { + if (bank.second == bankId) { + const auto ctl = static_cast(ResourceGetDataByName(("__OTR__" + bank.first).c_str())); engine->banksTable[bankId] = ctl; return ctl; } @@ -532,20 +562,20 @@ extern "C" void GameEngine_UnloadBank(const uint8_t bankId) { extern "C" AudioSequenceData* GameEngine_LoadSequence(const uint8_t seqId) { auto engine = GameEngine::Instance; - if(engine->sequenceTable[seqId].empty()){ + if (engine->sequenceTable[seqId].empty()) { return nullptr; } - if(engine->audioSequenceTable[seqId] != nullptr){ + if (engine->audioSequenceTable[seqId] != nullptr) { return engine->audioSequenceTable[seqId]; } - auto sequences = static_cast(ResourceGetDataByName(engine->sequenceTable[seqId].c_str())); + auto sequences = static_cast(ResourceGetDataByName(engine->sequenceTable[seqId].c_str())); engine->audioSequenceTable[seqId] = sequences; return sequences; } -extern "C" uint32_t GameEngine_GetSequenceCount(){ +extern "C" uint32_t GameEngine_GetSequenceCount() { auto engine = GameEngine::Instance; return engine->sequenceTable.size(); } @@ -563,16 +593,17 @@ extern "C" uint32_t GameEngine_GetGameVersion() { return Ship::Context::GetInstance()->GetResourceManager()->GetArchiveManager()->GetGameVersions()[0]; } -extern "C" uint8_t* GameEngine_LoadActName(const uint32_t actId){ - return static_cast(ResourceGetDataByName(StringHelper::Sprintf(gActRoot, actId).c_str())); +extern "C" uint8_t* GameEngine_LoadActName(const uint32_t actId) { + return static_cast(ResourceGetDataByName(StringHelper::Sprintf(gActRoot, actId).c_str())); } -extern "C" uint8_t* GameEngine_LoadLevelName(const uint32_t courseId){ - return static_cast(ResourceGetDataByName(StringHelper::Sprintf(gCourseRoot, courseId).c_str())); +extern "C" uint8_t* GameEngine_LoadLevelName(const uint32_t courseId) { + return static_cast(ResourceGetDataByName(StringHelper::Sprintf(gCourseRoot, courseId).c_str())); } -extern "C" DialogEntry* GameEngine_LoadDialog(const uint32_t dialogId){ - auto dialog = static_cast(ResourceGetDataByName(StringHelper::Sprintf(gDialogRoot, dialogId).c_str())); +extern "C" DialogEntry* GameEngine_LoadDialog(const uint32_t dialogId) { + auto dialog = + static_cast(ResourceGetDataByName(StringHelper::Sprintf(gDialogRoot, dialogId).c_str())); return dialog; } @@ -592,7 +623,7 @@ extern "C" int GameEngine_OTRSigCheck(const char* data) { extern "C" Animation* GameEngine_LoadAnimation(const uint32_t animId) { auto engine = GameEngine::Instance; - if(animId >= engine->animationsTable.size()){ + if (animId >= engine->animationsTable.size()) { return nullptr; } return engine->animationsTable[animId]; diff --git a/src/port/GBIMiddleware.cpp b/src/port/GBIMiddleware.cpp index 45642edb..3bf3c2cb 100644 --- a/src/port/GBIMiddleware.cpp +++ b/src/port/GBIMiddleware.cpp @@ -37,7 +37,7 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa return; } - for(int i = 0; i < patchCount; i++) { + for (int i = 0; i < patchCount; i++) { GfxPatch patch = patches[i]; // Store original gfx if not already stored @@ -77,7 +77,7 @@ extern "C" void gSPDisplayList(Gfx* pkt, Gfx* dl) { extern "C" void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0) { if (GameEngine_OTRSigCheck((char*)v) == 1) { - v = (uintptr_t) ResourceGetDataByName((char *) v); + v = (uintptr_t)ResourceGetDataByName((char*)v); } __gSPVertex(pkt, v, n, v0); @@ -89,10 +89,10 @@ extern "C" void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr) { if (texAddr != 0 && GameEngine_OTRSigCheck(imgData)) { auto res = Ship::Context::GetInstance()->GetResourceManager()->LoadResource(imgData); - if (res->GetInitData()->Type == (uint32_t) Fast::ResourceType::DisplayList) + if (res->GetInitData()->Type == (uint32_t)Fast::ResourceType::DisplayList) texAddr = (uintptr_t)&((std::static_pointer_cast(res))->Instructions[0]); else { - texAddr = (uintptr_t) res->GetRawPointer(); + texAddr = (uintptr_t)res->GetRawPointer(); } } __gSPInvalidateTexCache(pkt, texAddr); diff --git a/src/port/Game.cpp b/src/port/Game.cpp index d128d2c8..1d396197 100644 --- a/src/port/Game.cpp +++ b/src/port/Game.cpp @@ -15,9 +15,8 @@ void alloc_pool() { gEffectsMemoryPool = mem_pool_init(0x4000, MEMORY_POOL_LEFT); } -extern "C" -void exec_display_list(SPTask *spTask) { - GameEngine::ProcessGfxCommands((Gfx *) spTask->task.t.data_ptr); +extern "C" void exec_display_list(SPTask* spTask) { + GameEngine::ProcessGfxCommands((Gfx*)spTask->task.t.data_ptr); } void push_frame() { @@ -28,9 +27,9 @@ void push_frame() { } #ifdef _WIN32 -int SDL_main(int argc, char **argv) { +int SDL_main(int argc, char** argv) { #else -int main(){ +int main() { #endif GameEngine::Create(); alloc_pool(); diff --git a/src/port/GameExtractor.cpp b/src/port/GameExtractor.cpp index 9c1cd5da..a1c1cc53 100644 --- a/src/port/GameExtractor.cpp +++ b/src/port/GameExtractor.cpp @@ -43,7 +43,8 @@ bool GameExtractor::SelectGameFromUI() { // Auto detect first baserom with valid hash for (const auto& rom : roms) { - if (!std::filesystem::exists(rom)) continue; + if (!std::filesystem::exists(rom)) + continue; std::ifstream inFile(rom, std::ios::binary); if (!inFile.is_open()) { @@ -76,14 +77,13 @@ bool GameExtractor::SelectGameFromUI() { // Desktop: fallback to file dialogue if no baserom found if (!foundGame) { if (!pfd::settings::available()) { - SPDLOG_ERROR( - "portable-file-dialogs is not available on this system." - ); + SPDLOG_ERROR("portable-file-dialogs is not available on this system."); return false; } auto selection = pfd::open_file("Select a file", ".", { "N64 Roms", "*.z64" }).result(); - if (selection.empty()) return false; + if (selection.empty()) + return false; romPath = selection[0]; } @@ -107,7 +107,8 @@ bool GameExtractor::SelectGameFromUI() { } std::ifstream inFile(romPath, std::ios::binary); - if (!inFile.is_open()) return false; + if (!inFile.is_open()) + return false; romData = std::vector(std::istreambuf_iterator(inFile), {}); inFile.close(); @@ -178,7 +179,7 @@ std::optional GameExtractor::ValidateChecksum() const { const auto rom = new N64::Cartridge(this->mGameData); rom->Initialize(); auto hash = rom->GetHash(); - + if (mGameList.find(hash) == mGameList.end()) { return std::nullopt; } diff --git a/src/port/Matrix.cpp b/src/port/Matrix.cpp index 9ae2e454..659d5002 100644 --- a/src/port/Matrix.cpp +++ b/src/port/Matrix.cpp @@ -10,16 +10,15 @@ extern "C" { struct Matrix { Mtx Screen2D; // Orthogonal projection for UI, skybox, and such Mtx Ortho; - std::array Persp; - std::array LookAt; - std::array Karts; // Eight players * four screens + std::array Persp; + std::array LookAt; + std::array Karts; // Eight players * four screens std::array Shadows; // Eight players * four screens std::deque Hud; std::deque Objects; - Matrix() - : Hud(200), Objects(1000) - {} + Matrix() : Hud(200), Objects(1000) { + } }; Matrix gMatrix; @@ -90,7 +89,7 @@ void ApplyMatrixTransformations(Mat4 mtx, FVector pos, IRotator rot, FVector sca f32 sine1, cosine1; f32 sine2, cosine2; f32 sine3, cosine3; - //FrameInterpolation_ApplyMatrixTransformations((Mat4*)mtx, pos, rot, scale); + // FrameInterpolation_ApplyMatrixTransformations((Mat4*)mtx, pos, rot, scale); // Compute the sine and cosine of the orientation (Euler angles) sine1 = sins(rot.pitch); @@ -126,7 +125,7 @@ void ApplyMatrixTransformations(Mat4 mtx, FVector pos, IRotator rot, FVector sca mtx[0][2] *= scale.z; mtx[1][2] *= scale.z; mtx[2][2] *= scale.z; - + // Set the last row and column for the homogeneous coordinate system mtx[0][3] = 0.0f; mtx[1][3] = 0.0f; @@ -134,7 +133,7 @@ void ApplyMatrixTransformations(Mat4 mtx, FVector pos, IRotator rot, FVector sca mtx[3][3] = 1.0f; } -/* +/* * Spherical billboarding * Rotates the object to face the camera * Rotates on all three axis @@ -196,11 +195,11 @@ void AddLocalRotation(Mat4 mat, IRotator rot) { mat[0][0] = (cos_yaw * cos_roll) + (sin_pitch * sin_yaw * sin_roll); mat[0][1] = (cos_pitch * sin_roll); mat[0][2] = (-sin_yaw * cos_roll) + (sin_pitch * cos_yaw * sin_roll); - + mat[1][0] = (-cos_yaw * sin_roll) + (sin_pitch * sin_yaw * cos_roll); mat[1][1] = (cos_pitch * cos_roll); mat[1][2] = (sin_yaw * sin_roll) + (sin_pitch * cos_yaw * cos_roll); - + mat[2][0] = (cos_pitch * sin_yaw); mat[2][1] = -sin_pitch; mat[2][2] = (cos_pitch * cos_yaw); @@ -208,69 +207,67 @@ void AddLocalRotation(Mat4 mat, IRotator rot) { // API extern "C" { - void AddHudMatrix(Mat4 mtx, s32 flags) { - AddMatrix(gMatrix.Objects, mtx, flags); - } - - Mtx* GetScreenMatrix(void) { - return &gMatrix.Screen2D; - } - - Mtx* GetOrthoMatrix(void) { - return &gMatrix.Ortho; - } - - Mtx* GetPerspMatrix(size_t cameraId) { - return &gMatrix.Persp[cameraId]; - } - - Mtx* GetLookAtMatrix(size_t cameraId) { - return &gMatrix.LookAt[cameraId]; - } - - void AddObjectMatrix(Mat4 mtx, s32 flags) { - AddMatrix(gMatrix.Objects, mtx, flags); - } - - Mtx* GetShadowMatrix(size_t playerId) { - return &gMatrix.Shadows[playerId]; - } - - Mtx* GetKartMatrix(size_t playerId) { - return &gMatrix.Karts[playerId]; - } - - void AddEffectMatrix(Mat4 mtx, s32 flags) { - AddMatrix(gMatrix.Objects, mtx, flags); - } - - void AddEffectMatrixOrtho(void) { - auto& stack = gMatrix.Objects; - stack.emplace_back(); - - guOrtho(&stack.back(), 0.0f, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0.0f, -100.0f, 100.0f, 1.0f); - - gSPMatrix(gDisplayListHead++, &stack.back(), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - } - - Mtx* GetEffectMatrix(void) { - return GetMatrix(gMatrix.Objects); - } - - - /** - * Note that the game doesn't seem to clear all of these at the beginning of a new frame. - * We might need to adjust which ones we clear. - */ - void ClearMatrixPools(void) { - gMatrix.Objects.clear(); - // gMatrix.Shadows.clear(); - //gMatrix.Karts.clear(); - // gMatrix.Effects.clear(); - } - - void ClearObjectsMatrixPool(void) { - gMatrix.Objects.clear(); - } +void AddHudMatrix(Mat4 mtx, s32 flags) { + AddMatrix(gMatrix.Objects, mtx, flags); } +Mtx* GetScreenMatrix(void) { + return &gMatrix.Screen2D; +} + +Mtx* GetOrthoMatrix(void) { + return &gMatrix.Ortho; +} + +Mtx* GetPerspMatrix(size_t cameraId) { + return &gMatrix.Persp[cameraId]; +} + +Mtx* GetLookAtMatrix(size_t cameraId) { + return &gMatrix.LookAt[cameraId]; +} + +void AddObjectMatrix(Mat4 mtx, s32 flags) { + AddMatrix(gMatrix.Objects, mtx, flags); +} + +Mtx* GetShadowMatrix(size_t playerId) { + return &gMatrix.Shadows[playerId]; +} + +Mtx* GetKartMatrix(size_t playerId) { + return &gMatrix.Karts[playerId]; +} + +void AddEffectMatrix(Mat4 mtx, s32 flags) { + AddMatrix(gMatrix.Objects, mtx, flags); +} + +void AddEffectMatrixOrtho(void) { + auto& stack = gMatrix.Objects; + stack.emplace_back(); + + guOrtho(&stack.back(), 0.0f, SCREEN_WIDTH - 1, SCREEN_HEIGHT - 1, 0.0f, -100.0f, 100.0f, 1.0f); + + gSPMatrix(gDisplayListHead++, &stack.back(), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); +} + +Mtx* GetEffectMatrix(void) { + return GetMatrix(gMatrix.Objects); +} + +/** + * Note that the game doesn't seem to clear all of these at the beginning of a new frame. + * We might need to adjust which ones we clear. + */ +void ClearMatrixPools(void) { + gMatrix.Objects.clear(); + // gMatrix.Shadows.clear(); + // gMatrix.Karts.clear(); + // gMatrix.Effects.clear(); +} + +void ClearObjectsMatrixPool(void) { + gMatrix.Objects.clear(); +} +} diff --git a/src/port/game/GeoLayoutParser.cpp b/src/port/game/GeoLayoutParser.cpp index bd602e62..666dee72 100644 --- a/src/port/game/GeoLayoutParser.cpp +++ b/src/port/game/GeoLayoutParser.cpp @@ -35,7 +35,10 @@ struct GraphNodeEntry { GraphNodeFunc function; }; -#define FUNC(f) GraphNodeEntry { #f, reinterpret_cast(f) } +#define FUNC(f) \ + GraphNodeEntry { \ + #f, reinterpret_cast(f) \ + } std::unordered_map mUSFunctionTable = { { 0x8016f670, FUNC(geo_intro_super_mario_64_logo) }, @@ -152,19 +155,18 @@ std::unordered_map mJPFunctionTable = { }; std::unordered_map> mFunctionTable = { - { 0xFF2B5A63, mUSFunctionTable }, - { 0xE3DAA4E, mJPFunctionTable } + { 0xFF2B5A63, mUSFunctionTable }, { 0xE3DAA4E, mJPFunctionTable } }; GraphNodeFunc GetFunctionByAddr(const uint32_t addr, std::string opcode) { const auto version = GameEngine::Instance->GetGameVersion(); auto table = mFunctionTable[version]; - if(addr == 0){ + if (addr == 0) { return nullptr; } - if(!table.contains(addr)) { + if (!table.contains(addr)) { SPDLOG_ERROR("Function table does not contain address: 0x{:X} on {}", addr, opcode); return nullptr; } @@ -303,7 +305,7 @@ void process_cmd_node_root() { GraphNodeRoot* graphNode = init_graph_node_root(gGraphNodePool, nullptr, 0, x, y, width, height); - gGeoViews = static_cast(alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(GraphNode *))); + gGeoViews = static_cast(alloc_only_pool_alloc(gGraphNodePool, gGeoNumViews * sizeof(GraphNode*))); graphNode->nodeId = generate_uuid64(); graphNode->views = gGeoViews; @@ -337,7 +339,8 @@ void process_cmd_node_perspective() { frustumFunc = GetFunctionByAddr(func, "NODE_PERSPECTIVE"); } - GraphNodePerspective* graphNode = init_graph_node_perspective(gGraphNodePool, nullptr, (f32) fov, _near, _far, frustumFunc, 0); + GraphNodePerspective* graphNode = + init_graph_node_perspective(gGraphNodePool, nullptr, (f32)fov, _near, _far, frustumFunc, 0); register_scene_graph_node(&graphNode->fnNode.node); } @@ -372,11 +375,10 @@ void process_cmd_node_switch_case() { const auto cs = GeoLayoutParser::mReader->ReadInt16(); const auto func = GeoLayoutParser::mReader->ReadUInt32(); - GraphNodeSwitchCase *graphNode = + GraphNodeSwitchCase* graphNode = init_graph_node_switch_case(gGraphNodePool, nullptr, - cs, // case which is initially selected - 0, - GetFunctionByAddr(func, "NODE_SWITCH_CASE"), // case update function + cs, // case which is initially selected + 0, GetFunctionByAddr(func, "NODE_SWITCH_CASE"), // case update function 0); register_scene_graph_node(&graphNode->fnNode.node); @@ -392,8 +394,8 @@ void process_cmd_node_camera() { const auto addr = GeoLayoutParser::mReader->ReadUInt32(); - GraphNodeCamera* graphNode = init_graph_node_camera(gGraphNodePool, nullptr, pos, focus, - GetFunctionByAddr(addr, "NODE_CAMERA"), type); + GraphNodeCamera* graphNode = + init_graph_node_camera(gGraphNodePool, nullptr, pos, focus, GetFunctionByAddr(addr, "NODE_CAMERA"), type); register_scene_graph_node(&graphNode->fnNode.node); @@ -433,11 +435,8 @@ void process_cmd_node_translation_rotation() { drawingLayer = params & 0x0F; } - GraphNodeTranslationRotation* graphNode = init_graph_node_translation_rotation( - gGraphNodePool, nullptr, - drawingLayer, displayList, - translation, rotation - ); + GraphNodeTranslationRotation* graphNode = + init_graph_node_translation_rotation(gGraphNodePool, nullptr, drawingLayer, displayList, translation, rotation); register_scene_graph_node(&graphNode->node); } @@ -447,7 +446,7 @@ void process_cmd_node_translation() { const auto params = GeoLayoutParser::mReader->ReadUByte(); s16 drawingLayer = 0; - void *displayList = nullptr; + void* displayList = nullptr; ReadVec3s(translation); @@ -468,7 +467,7 @@ void process_cmd_node_rotation() { const auto params = GeoLayoutParser::mReader->ReadUByte(); s16 drawingLayer = 0; - void *displayList = nullptr; + void* displayList = nullptr; ReadVec3sAngle(rotation); @@ -487,7 +486,7 @@ void process_cmd_node_scale() { s16 drawingLayer = 0; const auto params = GeoLayoutParser::mReader->ReadUByte(); const auto scale = GeoLayoutParser::mReader->ReadUInt32() / 65536.0f; - void *displayList = nullptr; + void* displayList = nullptr; if (params & 0x80) { displayList = ResourceGetDataByCrc(ReadSafeCrc()); @@ -499,7 +498,8 @@ void process_cmd_node_scale() { register_scene_graph_node(&graphNode->node); } -void process_cmd_nop2() {} +void process_cmd_nop2() { +} void process_cmd_node_animated_part() { Vec3s translation; @@ -529,14 +529,15 @@ void process_cmd_node_billboard() { drawingLayer = params & 0x0F; } - GraphNodeBillboard* graphNode = init_graph_node_billboard(gGraphNodePool, nullptr, drawingLayer, displayList, translation); + GraphNodeBillboard* graphNode = + init_graph_node_billboard(gGraphNodePool, nullptr, drawingLayer, displayList, translation); register_scene_graph_node(&graphNode->node); } void process_cmd_node_display_list() { const auto drawingLayer = GeoLayoutParser::mReader->ReadUByte(); - void *displayList = ResourceGetDataByCrc(ReadSafeCrc()); + void* displayList = ResourceGetDataByCrc(ReadSafeCrc()); GraphNodeDisplayList* graphNode = init_graph_node_display_list(gGraphNodePool, nullptr, drawingLayer, displayList); @@ -563,9 +564,9 @@ void process_cmd_node_generated() { const auto param = GeoLayoutParser::mReader->ReadInt16(); const auto addr = GeoLayoutParser::mReader->ReadUInt32(); - GraphNodeGenerated* graphNode = init_graph_node_generated(gGraphNodePool, nullptr, - GetFunctionByAddr(addr, "NODE_ASM"), // asm function - param); // parameter + GraphNodeGenerated* graphNode = + init_graph_node_generated(gGraphNodePool, nullptr, GetFunctionByAddr(addr, "NODE_ASM"), // asm function + param); // parameter register_scene_graph_node(&graphNode->fnNode.node); } @@ -574,26 +575,27 @@ void process_cmd_node_background() { const auto param = GeoLayoutParser::mReader->ReadInt16(); const auto addr = GeoLayoutParser::mReader->ReadUInt32(); - GraphNodeBackground* graphNode = init_graph_node_background( - gGraphNodePool, nullptr, - param, // background ID, or RGBA5551 color if asm function is null - GetFunctionByAddr(addr, "NODE_BACKGROUND"), // asm function - 0); + GraphNodeBackground* graphNode = + init_graph_node_background(gGraphNodePool, nullptr, + param, // background ID, or RGBA5551 color if asm function is null + GetFunctionByAddr(addr, "NODE_BACKGROUND"), // asm function + 0); register_scene_graph_node(&graphNode->fnNode.node); } -void process_cmd_nop() {} +void process_cmd_nop() { +} void process_cmd_copy_view() { - GraphNode *node = nullptr; + GraphNode* node = nullptr; const auto index = GeoLayoutParser::mReader->ReadInt16(); if (index >= 0) { node = gGeoViews[index]; if (node->type == GRAPH_NODE_TYPE_OBJECT_PARENT) { - node = reinterpret_cast(node)->sharedChild; + node = reinterpret_cast(node)->sharedChild; } else { node = nullptr; } @@ -612,12 +614,8 @@ void process_cmd_node_held_obj() { ReadVec3s(offset); - GraphNodeHeldObject *graphNode = init_graph_node_held_object( - gGraphNodePool, nullptr, nullptr, - offset, - GetFunctionByAddr(addr, "NODE_HELD_OBJ"), - player - ); + GraphNodeHeldObject* graphNode = init_graph_node_held_object(gGraphNodePool, nullptr, nullptr, offset, + GetFunctionByAddr(addr, "NODE_HELD_OBJ"), player); register_scene_graph_node(&graphNode->fnNode.node); } @@ -664,7 +662,6 @@ GeoCommandFunction GeoLayoutFunctionTable[] = { process_cmd_node_culling_radius, }; - void GeoLayoutParser::execute(const char* path) { const auto data = static_cast(ResourceGetDataByName(path)); const auto size = ResourceGetSizeByName(path); @@ -679,7 +676,7 @@ void GeoLayoutParser::execute(const char* path) { } delete mReader; - mReader = nullptr; + mReader = nullptr; } extern "C" void GeoLayoutExecute(char const* path) { diff --git a/src/port/hooks/impl/EventSystem.cpp b/src/port/hooks/impl/EventSystem.cpp index 3418b6ef..1157378f 100644 --- a/src/port/hooks/impl/EventSystem.cpp +++ b/src/port/hooks/impl/EventSystem.cpp @@ -9,24 +9,22 @@ EventID EventSystem::RegisterEvent() { } ListenerID EventSystem::RegisterListener(EventID id, EventCallback callback, EventPriority priority) { - if(id == -1) { + if (id == -1) { throw std::runtime_error("Trying to register listener for unregistered event"); } auto& listeners = this->mEventListeners[id]; - if(std::find_if(listeners.begin(), listeners.end(), [callback](EventListener listener) { - return listener.function == callback; - }) != listeners.end()) { + if (std::find_if(listeners.begin(), listeners.end(), + [callback](EventListener listener) { return listener.function == callback; }) != listeners.end()) { throw std::runtime_error("Listener already registered"); } listeners.push_back({ priority, callback }); // Sort by priority - std::sort(listeners.begin(), listeners.end(), [](EventListener a, EventListener b) { - return a.priority < b.priority; - }); + std::sort(listeners.begin(), listeners.end(), + [](EventListener a, EventListener b) { return a.priority < b.priority; }); return listeners.size() - 1; } diff --git a/src/port/importer/AnimationFactory.cpp b/src/port/importer/AnimationFactory.cpp index a24dfe33..6d18131f 100644 --- a/src/port/importer/AnimationFactory.cpp +++ b/src/port/importer/AnimationFactory.cpp @@ -2,8 +2,9 @@ #include "port/importer/types/Animation.h" #include "spdlog/spdlog.h" -std::shared_ptr SM64::AnimationFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::AnimationFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -31,7 +32,7 @@ std::shared_ptr SM64::AnimationFactoryV0::ReadResource(std::sha animation->values.push_back(reader->ReadInt16()); } - animation->mData.index = animation->indices.data(); + animation->mData.index = animation->indices.data(); animation->mData.values = animation->values.data(); return animation; diff --git a/src/port/importer/AssetArrayFactory.cpp b/src/port/importer/AssetArrayFactory.cpp index d2acfc04..5af3a610 100644 --- a/src/port/importer/AssetArrayFactory.cpp +++ b/src/port/importer/AssetArrayFactory.cpp @@ -5,8 +5,9 @@ #include "ResourceUtil.h" namespace SM64 { -std::shared_ptr ResourceFactoryBinaryAssetArrayV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +ResourceFactoryBinaryAssetArrayV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -15,10 +16,10 @@ std::shared_ptr ResourceFactoryBinaryAssetArrayV0::ReadResource auto reader = std::get>(file->Reader); auto count = reader->ReadUInt32(); - for(size_t i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { asset->mPtrs.push_back(reinterpret_cast(ResourceGetDataByCrc(reader->ReadUInt64()))); } return asset; } -} // namespace LUS +} // namespace SM64 diff --git a/src/port/importer/AudioBankFactory.cpp b/src/port/importer/AudioBankFactory.cpp index 4bdd333c..975bc573 100644 --- a/src/port/importer/AudioBankFactory.cpp +++ b/src/port/importer/AudioBankFactory.cpp @@ -3,8 +3,9 @@ #include #include "ResourceUtil.h" -std::shared_ptr SM64::AudioBankFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::AudioBankFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -15,10 +16,10 @@ std::shared_ptr SM64::AudioBankFactoryV0::ReadResource(std::sha uint8_t bankId = reader->ReadUInt32(); uint32_t instrumentCount = reader->ReadUInt32(); - for(size_t i = 0; i < instrumentCount; i++){ + for (size_t i = 0; i < instrumentCount; i++) { auto* instrument = new Instrument(); bool valid = reader->ReadUByte(); - if(!valid){ + if (!valid) { bank->instruments.push_back(nullptr); continue; } @@ -28,9 +29,9 @@ std::shared_ptr SM64::AudioBankFactoryV0::ReadResource(std::sha instrument->normalRangeHi = reader->ReadUByte(); uint32_t envelopeSize = reader->ReadUInt32(); - if(envelopeSize != 0){ + if (envelopeSize != 0) { instrument->envelope = new AdsrEnvelope[envelopeSize]; - for(size_t j = 0; j < envelopeSize; j++){ + for (size_t j = 0; j < envelopeSize; j++) { instrument->envelope[j].delay = BSWAP16(reader->ReadInt16()); instrument->envelope[j].arg = BSWAP16(reader->ReadInt16()); } @@ -41,19 +42,19 @@ std::shared_ptr SM64::AudioBankFactoryV0::ReadResource(std::sha bool hasMed = soundFlags & (1 << 1); bool hasHi = soundFlags & (1 << 2); - if(hasLo){ + if (hasLo) { std::string lowSampleName = reader->ReadString(); instrument->lowNotesSound.sample = LoadChild(lowSampleName.c_str()); instrument->lowNotesSound.tuning = reader->ReadFloat(); } - if(hasMed){ + if (hasMed) { std::string normalSampleName = reader->ReadString(); instrument->normalNotesSound.sample = LoadChild(normalSampleName.c_str()); instrument->normalNotesSound.tuning = reader->ReadFloat(); } - if(hasHi){ + if (hasHi) { std::string highSampleName = reader->ReadString(); instrument->highNotesSound.sample = LoadChild(highSampleName.c_str()); instrument->highNotesSound.tuning = reader->ReadFloat(); @@ -64,16 +65,16 @@ std::shared_ptr SM64::AudioBankFactoryV0::ReadResource(std::sha uint32_t drumCount = reader->ReadUInt32(); - for(size_t i = 0; i < drumCount; i++){ + for (size_t i = 0; i < drumCount; i++) { auto* drum = new Drum(); drum->releaseRate = reader->ReadUByte(); drum->pan = reader->ReadUByte(); drum->loaded = 1; uint32_t envelopeSize = reader->ReadUInt32(); - if(envelopeSize != 0){ + if (envelopeSize != 0) { drum->envelope = new AdsrEnvelope[envelopeSize]; - for(size_t j = 0; j < envelopeSize; j++){ + for (size_t j = 0; j < envelopeSize; j++) { drum->envelope[j].delay = BSWAP16(reader->ReadInt16()); drum->envelope[j].arg = BSWAP16(reader->ReadInt16()); } diff --git a/src/port/importer/AudioSampleFactory.cpp b/src/port/importer/AudioSampleFactory.cpp index 461f4c99..8ce13956 100644 --- a/src/port/importer/AudioSampleFactory.cpp +++ b/src/port/importer/AudioSampleFactory.cpp @@ -3,8 +3,9 @@ #include "port/importer/types/AudioSample.h" #include "spdlog/spdlog.h" -std::shared_ptr SM64::AudioSampleFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::AudioSampleFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -19,9 +20,9 @@ std::shared_ptr SM64::AudioSampleFactoryV0::ReadResource(std::s uint32_t stateSize = reader->ReadUInt32(); std::vector state; - if(stateSize > 0){ + if (stateSize > 0) { bank->loop.state = new int16_t[stateSize]; - reader->Read((char*) bank->loop.state, stateSize * sizeof(int16_t)); + reader->Read((char*)bank->loop.state, stateSize * sizeof(int16_t)); } else { bank->loop.state = nullptr; } @@ -31,7 +32,7 @@ std::shared_ptr SM64::AudioSampleFactoryV0::ReadResource(std::s uint32_t tableSize = reader->ReadUInt32(); bank->book.book = new int16_t[tableSize]; - reader->Read((char*) bank->book.book, tableSize * sizeof(int16_t)); + reader->Read((char*)bank->book.book, tableSize * sizeof(int16_t)); int32_t sampleSize = reader->ReadInt32(); char* sampleData = new char[sampleSize]; @@ -41,7 +42,7 @@ std::shared_ptr SM64::AudioSampleFactoryV0::ReadResource(std::s bank->mData.loaded = 1; bank->mData.loop = &bank->loop; bank->mData.book = &bank->book; - bank->mData.sampleAddr = (uint8_t*) sampleData; + bank->mData.sampleAddr = (uint8_t*)sampleData; bank->mData.sampleSize = sampleSize; return bank; diff --git a/src/port/importer/AudioSequenceFactory.cpp b/src/port/importer/AudioSequenceFactory.cpp index d759dad2..a0300d60 100644 --- a/src/port/importer/AudioSequenceFactory.cpp +++ b/src/port/importer/AudioSequenceFactory.cpp @@ -4,8 +4,9 @@ #include "port/Engine.h" #include "port/importer/types/AudioBank.h" -std::shared_ptr SM64::AudioSequenceFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::AudioSequenceFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -15,13 +16,13 @@ std::shared_ptr SM64::AudioSequenceFactoryV0::ReadResource(std: uint8_t id = reader->ReadUInt32(); size_t bankCount = reader->ReadUInt32(); - for(size_t i = 0; i < bankCount; i++){ + for (size_t i = 0; i < bankCount; i++) { std::string bankName = reader->ReadString(); bank->banks.push_back(GameEngine::GetBankIdByName(bankName)); } size_t sampleSize = reader->ReadUInt32(); - for(size_t i = 0; i < sampleSize; i++){ + for (size_t i = 0; i < sampleSize; i++) { bank->sampleData.push_back(reader->ReadUByte()); } diff --git a/src/port/importer/DialogFactory.cpp b/src/port/importer/DialogFactory.cpp index 0ec3aa8b..19b4c4a2 100644 --- a/src/port/importer/DialogFactory.cpp +++ b/src/port/importer/DialogFactory.cpp @@ -3,7 +3,7 @@ #include "spdlog/spdlog.h" std::shared_ptr SM64::DialogFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -17,7 +17,7 @@ std::shared_ptr SM64::DialogFactoryV0::ReadResource(std::shared dialog->mData.width = reader->ReadInt16(); size_t textSize = reader->ReadUInt32(); - for(size_t i = 0; i < textSize; i++){ + for (size_t i = 0; i < textSize; i++) { dialog->mText.push_back(reader->ReadUByte()); } diff --git a/src/port/importer/DictionaryFactory.cpp b/src/port/importer/DictionaryFactory.cpp index f719b462..408c6c4d 100644 --- a/src/port/importer/DictionaryFactory.cpp +++ b/src/port/importer/DictionaryFactory.cpp @@ -2,9 +2,9 @@ #include "port/importer/types/Dictionary.h" #include "spdlog/spdlog.h" - -std::shared_ptr SM64::DictionaryFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::DictionaryFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -13,11 +13,11 @@ std::shared_ptr SM64::DictionaryFactoryV0::ReadResource(std::sh auto reader = std::get>(file->Reader); size_t numEntries = reader->ReadUInt32(); - for(size_t i = 0; i < numEntries; i++){ + for (size_t i = 0; i < numEntries; i++) { std::string key = reader->ReadString(); size_t valueSize = reader->ReadUInt32(); std::vector value; - for(size_t j = 0; j < valueSize; j++){ + for (size_t j = 0; j < valueSize; j++) { value.push_back(reader->ReadUByte()); } dictionary->mData[key] = value; diff --git a/src/port/importer/GenericArrayFactory.cpp b/src/port/importer/GenericArrayFactory.cpp index 665ff342..67059c39 100644 --- a/src/port/importer/GenericArrayFactory.cpp +++ b/src/port/importer/GenericArrayFactory.cpp @@ -3,8 +3,9 @@ #include "spdlog/spdlog.h" namespace SF64 { -std::shared_ptr ResourceFactoryBinaryGenericArrayV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +ResourceFactoryBinaryGenericArrayV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -107,4 +108,4 @@ std::shared_ptr ResourceFactoryBinaryGenericArrayV0::ReadResour return arr; } -} // namespace LUS +} // namespace SF64 diff --git a/src/port/importer/MacroObjectFactory.cpp b/src/port/importer/MacroObjectFactory.cpp index 6e9c6530..cd43ad54 100644 --- a/src/port/importer/MacroObjectFactory.cpp +++ b/src/port/importer/MacroObjectFactory.cpp @@ -3,8 +3,9 @@ #define MACRO_OBJECT_END() 0x001E -std::shared_ptr SM64::MacroObjectFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::MacroObjectFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -14,7 +15,7 @@ std::shared_ptr SM64::MacroObjectFactoryV0::ReadResource(std::s uint32_t count = reader->ReadUInt32(); - for(size_t i = 0; i < count; i++){ + for (size_t i = 0; i < count; i++) { macro->mData.push_back(reader->ReadInt16()); macro->mData.push_back(reader->ReadInt16()); macro->mData.push_back(reader->ReadInt16()); diff --git a/src/port/importer/MovtexFactory.cpp b/src/port/importer/MovtexFactory.cpp index f592a48d..77a4e16c 100644 --- a/src/port/importer/MovtexFactory.cpp +++ b/src/port/importer/MovtexFactory.cpp @@ -2,7 +2,7 @@ #include "port/importer/types/Movtex.h" std::shared_ptr SM64::MovtexFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -12,7 +12,7 @@ std::shared_ptr SM64::MovtexFactoryV0::ReadResource(std::shared uint32_t count = reader->ReadUInt32(); - for(size_t i = 0; i < count; i++){ + for (size_t i = 0; i < count; i++) { movtex->mData.push_back(reader->ReadInt16()); } diff --git a/src/port/importer/MovtexQuadFactory.cpp b/src/port/importer/MovtexQuadFactory.cpp index b2306a20..b30306f6 100644 --- a/src/port/importer/MovtexQuadFactory.cpp +++ b/src/port/importer/MovtexQuadFactory.cpp @@ -2,8 +2,9 @@ #include "ResourceUtil.h" #include "port/importer/types/MovtexQuad.h" -std::shared_ptr SM64::MovtexQuadFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::MovtexQuadFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -13,11 +14,8 @@ std::shared_ptr SM64::MovtexQuadFactoryV0::ReadResource(std::sh uint32_t count = reader->ReadUInt32(); - for(size_t i = 0; i < count; i++){ - movtex->mData.push_back({ - reader->ReadInt16(), - LoadChild(reader->ReadUInt64()) - }); + for (size_t i = 0; i < count; i++) { + movtex->mData.push_back({ reader->ReadInt16(), LoadChild(reader->ReadUInt64()) }); } return movtex; diff --git a/src/port/importer/PaintingFactory.cpp b/src/port/importer/PaintingFactory.cpp index 93315e5c..f48955cf 100644 --- a/src/port/importer/PaintingFactory.cpp +++ b/src/port/importer/PaintingFactory.cpp @@ -2,8 +2,9 @@ #include "ResourceUtil.h" #include "port/importer/types/Painting.h" -std::shared_ptr SM64::PaintingFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::PaintingFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } diff --git a/src/port/importer/TrajectoryFactory.cpp b/src/port/importer/TrajectoryFactory.cpp index 289c25dd..61247384 100644 --- a/src/port/importer/TrajectoryFactory.cpp +++ b/src/port/importer/TrajectoryFactory.cpp @@ -1,8 +1,9 @@ #include "TrajectoryFactory.h" #include "port/importer/types/Trajectory.h" -std::shared_ptr SM64::TrajectoryFactoryV0::ReadResource(std::shared_ptr file, - std::shared_ptr initData) { +std::shared_ptr +SM64::TrajectoryFactoryV0::ReadResource(std::shared_ptr file, + std::shared_ptr initData) { if (!FileHasValidFormatAndReader(file, initData)) { return nullptr; } @@ -12,13 +13,9 @@ std::shared_ptr SM64::TrajectoryFactoryV0::ReadResource(std::sh uint32_t count = reader->ReadUInt32(); - for(size_t i = 0; i < count; i++){ - trajectory->mData.push_back({ - reader->ReadInt16(), - reader->ReadInt16(), - reader->ReadInt16(), - reader->ReadInt16() - }); + for (size_t i = 0; i < count; i++) { + trajectory->mData.push_back( + { reader->ReadInt16(), reader->ReadInt16(), reader->ReadInt16(), reader->ReadInt16() }); } return trajectory; diff --git a/src/port/importer/types/Animation.cpp b/src/port/importer/types/Animation.cpp index 14153247..dcb3656d 100644 --- a/src/port/importer/types/Animation.cpp +++ b/src/port/importer/types/Animation.cpp @@ -8,4 +8,4 @@ AnimationData* Animation::GetPointer() { size_t Animation::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/AssetArray.cpp b/src/port/importer/types/AssetArray.cpp index bfb8102f..e28d32a8 100644 --- a/src/port/importer/types/AssetArray.cpp +++ b/src/port/importer/types/AssetArray.cpp @@ -1,11 +1,11 @@ #include "AssetArray.h" namespace SM64 { - uintptr_t* AssetArray::GetPointer() { - return mPtrs.data(); - } +uintptr_t* AssetArray::GetPointer() { + return mPtrs.data(); +} - size_t AssetArray::GetPointerSize() { - return mPtrs.size() * sizeof(uintptr_t); - } -} \ No newline at end of file +size_t AssetArray::GetPointerSize() { + return mPtrs.size() * sizeof(uintptr_t); +} +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/AudioBank.cpp b/src/port/importer/types/AudioBank.cpp index f91b767d..c2e14e03 100644 --- a/src/port/importer/types/AudioBank.cpp +++ b/src/port/importer/types/AudioBank.cpp @@ -8,4 +8,4 @@ CtlEntry* AudioBank::GetPointer() { size_t AudioBank::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/AudioSample.cpp b/src/port/importer/types/AudioSample.cpp index cbdbd657..112e6757 100644 --- a/src/port/importer/types/AudioSample.cpp +++ b/src/port/importer/types/AudioSample.cpp @@ -8,4 +8,4 @@ AudioBankSample* AudioSample::GetPointer() { size_t AudioSample::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/AudioSequence.cpp b/src/port/importer/types/AudioSequence.cpp index 263530cf..e215cd40 100644 --- a/src/port/importer/types/AudioSequence.cpp +++ b/src/port/importer/types/AudioSequence.cpp @@ -8,4 +8,4 @@ AudioSequenceData* AudioSequence::GetPointer() { size_t AudioSequence::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/Dialog.cpp b/src/port/importer/types/Dialog.cpp index 10919e3c..8e14ac57 100644 --- a/src/port/importer/types/Dialog.cpp +++ b/src/port/importer/types/Dialog.cpp @@ -8,4 +8,4 @@ DialogEntry* Dialog::GetPointer() { size_t Dialog::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/Dictionary.cpp b/src/port/importer/types/Dictionary.cpp index 7becc5b1..fd861999 100644 --- a/src/port/importer/types/Dictionary.cpp +++ b/src/port/importer/types/Dictionary.cpp @@ -8,4 +8,4 @@ GameDictionary* Dictionary::GetPointer() { size_t Dictionary::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/GenericArray.cpp b/src/port/importer/types/GenericArray.cpp index 74332a7e..5c5d2b74 100644 --- a/src/port/importer/types/GenericArray.cpp +++ b/src/port/importer/types/GenericArray.cpp @@ -8,4 +8,4 @@ uint8_t* GenericArray::GetPointer() { size_t GenericArray::GetPointerSize() { return mData.size(); } -} \ No newline at end of file +} // namespace SF64 \ No newline at end of file diff --git a/src/port/importer/types/MacroObject.cpp b/src/port/importer/types/MacroObject.cpp index 0f55157a..307861cf 100644 --- a/src/port/importer/types/MacroObject.cpp +++ b/src/port/importer/types/MacroObject.cpp @@ -8,4 +8,4 @@ int16_t* MacroObject::GetPointer() { size_t MacroObject::GetPointerSize() { return sizeof(mData.size()) * sizeof(int16_t); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/Movtex.cpp b/src/port/importer/types/Movtex.cpp index 9f717a02..c3e93968 100644 --- a/src/port/importer/types/Movtex.cpp +++ b/src/port/importer/types/Movtex.cpp @@ -8,4 +8,4 @@ int16_t* Movtex::GetPointer() { size_t Movtex::GetPointerSize() { return mData.size() * sizeof(int16_t); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/MovtexQuad.cpp b/src/port/importer/types/MovtexQuad.cpp index 3461e49d..3d0b0b79 100644 --- a/src/port/importer/types/MovtexQuad.cpp +++ b/src/port/importer/types/MovtexQuad.cpp @@ -8,4 +8,4 @@ MovtexQuadData* MovtexQuad::GetPointer() { size_t MovtexQuad::GetPointerSize() { return sizeof(mData.size()) * sizeof(MovtexQuadData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/Painting.cpp b/src/port/importer/types/Painting.cpp index 5d40c5b8..d7407048 100644 --- a/src/port/importer/types/Painting.cpp +++ b/src/port/importer/types/Painting.cpp @@ -8,4 +8,4 @@ PaintingData* Painting::GetPointer() { size_t Painting::GetPointerSize() { return sizeof(mData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/importer/types/Trajectory.cpp b/src/port/importer/types/Trajectory.cpp index 934044ba..04bf06f2 100644 --- a/src/port/importer/types/Trajectory.cpp +++ b/src/port/importer/types/Trajectory.cpp @@ -8,4 +8,4 @@ TrajectoryData* Trajectory::GetPointer() { size_t Trajectory::GetPointerSize() { return sizeof(mData.size()) * sizeof(TrajectoryData); } -} \ No newline at end of file +} // namespace SM64 \ No newline at end of file diff --git a/src/port/interpolation/FrameInterpolation.cpp b/src/port/interpolation/FrameInterpolation.cpp index 9e15fad5..d2125b99 100644 --- a/src/port/interpolation/FrameInterpolation.cpp +++ b/src/port/interpolation/FrameInterpolation.cpp @@ -49,7 +49,6 @@ static bool invert_matrix(const float m[16], float invOut[16]); using namespace std; - namespace { enum class Op { @@ -271,7 +270,7 @@ Data& append(Op op) { } MtxF* Matrix_GetCurrent() { - return (MtxF*) gInterpolationMatrix; + return (MtxF*)gInterpolationMatrix; } struct InterpolateCtx { @@ -355,15 +354,15 @@ struct InterpolateCtx { s16 interpolate_angle(s16 os, s16 ns) { if (os == ns) return ns; - int o = (u16) os; - int n = (u16) ns; + int o = (u16)os; + int n = (u16)ns; u16 res; int diff = o - n; if (-0x8000 <= diff && diff <= 0x8000) { if (diff < -0x4000 || diff > 0x4000) { return ns; } - res = (u16) (w * o + step * n); + res = (u16)(w * o + step * n); } else { if (o < n) { o += 0x10000; @@ -374,7 +373,7 @@ struct InterpolateCtx { if (diff < -0x4000 || diff > 0x4000) { return ns; } - res = (u16) (w * o + step * n); + res = (u16)(w * o + step * n); } return res; } @@ -417,11 +416,11 @@ struct InterpolateCtx { break; case Op::MatrixPush: - Matrix_Push((Matrix**) &gInterpolationMatrix); + Matrix_Push((Matrix**)&gInterpolationMatrix); break; case Op::MatrixPop: - Matrix_Pop((Matrix**) &gInterpolationMatrix); + Matrix_Pop((Matrix**)&gInterpolationMatrix); break; // Unused on SF64 @@ -454,11 +453,11 @@ struct InterpolateCtx { tempF[2] = lerp(old_op.matrix_pos_rot_xyz.pos.z, new_op.matrix_pos_rot_xyz.pos.z); tempS[0] = - lerp(old_op.matrix_pos_rot_xyz.orientation.x, new_op.matrix_pos_rot_xyz.orientation.x); + lerp(old_op.matrix_pos_rot_xyz.orientation.x, new_op.matrix_pos_rot_xyz.orientation.x); tempS[1] = - lerp(old_op.matrix_pos_rot_xyz.orientation.y, new_op.matrix_pos_rot_xyz.orientation.y); + lerp(old_op.matrix_pos_rot_xyz.orientation.y, new_op.matrix_pos_rot_xyz.orientation.y); tempS[2] = - lerp(old_op.matrix_pos_rot_xyz.orientation.z, new_op.matrix_pos_rot_xyz.orientation.z); + lerp(old_op.matrix_pos_rot_xyz.orientation.z, new_op.matrix_pos_rot_xyz.orientation.z); mtxf_rotate_xyz_and_translate(*gInterpolationMatrix, tempF, tempS); break; @@ -472,43 +471,44 @@ struct InterpolateCtx { tempF[2] = lerp(old_op.matrix_pos_rot_xyz.pos.z, new_op.matrix_pos_rot_xyz.pos.z); tempS[0] = - lerp(old_op.matrix_pos_rot_xyz.orientation.x, new_op.matrix_pos_rot_xyz.orientation.x); + lerp(old_op.matrix_pos_rot_xyz.orientation.x, new_op.matrix_pos_rot_xyz.orientation.x); tempS[1] = - lerp(old_op.matrix_pos_rot_xyz.orientation.y, new_op.matrix_pos_rot_xyz.orientation.y); + lerp(old_op.matrix_pos_rot_xyz.orientation.y, new_op.matrix_pos_rot_xyz.orientation.y); tempS[2] = - lerp(old_op.matrix_pos_rot_xyz.orientation.z, new_op.matrix_pos_rot_xyz.orientation.z); + lerp(old_op.matrix_pos_rot_xyz.orientation.z, new_op.matrix_pos_rot_xyz.orientation.z); mtxf_rotate_zxy_and_translate(*gInterpolationMatrix, tempF, tempS); break; } case Op::MatrixScale: - // mtxf_scale(*gInterpolationMatrix, lerp(old_op.matrix_scale.scale, new_op.matrix_scale.scale)); + // mtxf_scale(*gInterpolationMatrix, lerp(old_op.matrix_scale.scale, + // new_op.matrix_scale.scale)); break; case Op::MatrixRotate1Coord: { -// s16 v = interpolate_angle(old_op.matrix_rotate_1_coord.value, -// new_op.matrix_rotate_1_coord.value); -// switch (new_op.matrix_rotate_1_coord.coord) { -// case 0: -// mtxf_rotate_x(*gInterpolationMatrix, v); -// break; -// -// case 1: -// mtxf_rotate_y(*gInterpolationMatrix, v); -// break; -// -// case 2: -// mtxf_s16_rotate_z(*gInterpolationMatrix, v); -// break; -// } + // s16 v = interpolate_angle(old_op.matrix_rotate_1_coord.value, + // new_op.matrix_rotate_1_coord.value); + // switch (new_op.matrix_rotate_1_coord.coord) { + // case 0: + // mtxf_rotate_x(*gInterpolationMatrix, v); + // break; + // + // case 1: + // mtxf_rotate_y(*gInterpolationMatrix, v); + // break; + // + // case 2: + // mtxf_s16_rotate_z(*gInterpolationMatrix, v); + // break; + // } break; } case Op::MatrixRotateXYCoords: { - s16 x = interpolate_angle(old_op.matrix_rotate_xy_coords.x, - new_op.matrix_rotate_xy_coords.x); - s16 y = interpolate_angle(old_op.matrix_rotate_xy_coords.y, - new_op.matrix_rotate_xy_coords.y); + s16 x = + interpolate_angle(old_op.matrix_rotate_xy_coords.x, new_op.matrix_rotate_xy_coords.x); + s16 y = + interpolate_angle(old_op.matrix_rotate_xy_coords.y, new_op.matrix_rotate_xy_coords.y); // mtxf_rotate_xy(*gInterpolationMatrix, y); break; } @@ -564,10 +564,12 @@ struct InterpolateCtx { &new_op.set_transform_matrix_data.positionVector); u16 rotationAngleTemp = lerp_s16(old_op.set_transform_matrix_data.rotationAngle, - new_op.set_transform_matrix_data.rotationAngle); - f32 scaleFactorTemp = lerp(old_op.set_transform_matrix_data.scaleFactor, new_op.set_transform_matrix_data.scaleFactor); + new_op.set_transform_matrix_data.rotationAngle); + f32 scaleFactorTemp = lerp(old_op.set_transform_matrix_data.scaleFactor, + new_op.set_transform_matrix_data.scaleFactor); - // set_transform_matrix(*gInterpolationMatrix, tmp_vec3f, tmp_vec3f2, rotationAngleTemp, scaleFactorTemp); + // set_transform_matrix(*gInterpolationMatrix, tmp_vec3f, tmp_vec3f2, rotationAngleTemp, + // scaleFactorTemp); break; } @@ -578,20 +580,22 @@ struct InterpolateCtx { &new_op.set_matrix_transformation_data.location); lerp_vec3s(&tmp_vec3s, *(Vec3s*)&old_op.set_matrix_transformation_data.rotation, - *(Vec3s*)&new_op.set_matrix_transformation_data.rotation); + *(Vec3s*)&new_op.set_matrix_transformation_data.rotation); - f32 scaleFactorTemp = lerp(old_op.set_matrix_transformation_data.scale, new_op.set_matrix_transformation_data.scale); + f32 scaleFactorTemp = lerp(old_op.set_matrix_transformation_data.scale, + new_op.set_matrix_transformation_data.scale); -// mtxf_set_matrix_transformation(*gInterpolationMatrix, tmp_vec3f, *(Vec3su*)&tmp_vec3s, scaleFactorTemp); + // mtxf_set_matrix_transformation(*gInterpolationMatrix, + // tmp_vec3f, *(Vec3su*)&tmp_vec3s, scaleFactorTemp); break; } - + case Op::SetTranslateRotate: { lerp_vec3f(&tmp_vec3f, &old_op.set_translate_rotate_data.location, &new_op.set_translate_rotate_data.location); lerp_vec3s(&tmp_vec3s, old_op.set_translate_rotate_data.rotation, - new_op.set_translate_rotate_data.rotation); + new_op.set_translate_rotate_data.rotation); // mtxf_translate_rotate(*gInterpolationMatrix, tmp_vec3f, tmp_vec3s); break; @@ -600,11 +604,14 @@ struct InterpolateCtx { tmp32[0] = lerp_s32(old_op.matrix_pos_rot_scale_xy.x, new_op.matrix_pos_rot_scale_xy.x); tmp32[1] = lerp_s32(old_op.matrix_pos_rot_scale_xy.y, new_op.matrix_pos_rot_scale_xy.y); - tmp_vec3s[0] = lerp_s16(old_op.matrix_pos_rot_scale_xy.angle, new_op.matrix_pos_rot_scale_xy.angle); + tmp_vec3s[0] = + lerp_s16(old_op.matrix_pos_rot_scale_xy.angle, new_op.matrix_pos_rot_scale_xy.angle); - tmp_vec3f[0] = lerp(old_op.matrix_pos_rot_scale_xy.scale, new_op.matrix_pos_rot_scale_xy.scale); + tmp_vec3f[0] = + lerp(old_op.matrix_pos_rot_scale_xy.scale, new_op.matrix_pos_rot_scale_xy.scale); - // mtxf_translation_x_y_rotate_z_scale_x_y(*gInterpolationMatrix, tmp32[0], tmp32[1], tmp_vec3s[0], tmp_vec3f[0]); + // mtxf_translation_x_y_rotate_z_scale_x_y(*gInterpolationMatrix, tmp32[0], tmp32[1], + // tmp_vec3s[0], tmp_vec3f[0]); break; } } @@ -682,14 +689,14 @@ void FrameInterpolation_DontInterpolateCamera(void) { } int FrameInterpolation_GetCameraEpoch(void) { - return (int) camera_epoch; + return (int)camera_epoch; } void FrameInterpolation_Record_SetTextMatrix(Mat4* matrix, f32 x, f32 y, f32 arg3, f32 arg4) { if (!check_if_recording()) { return; } - append(Op::SetTextMatrix).matrix_text = {matrix, x, y, arg3, arg4}; + append(Op::SetTextMatrix).matrix_text = { matrix, x, y, arg3, arg4 }; } void FrameInterpolation_RecordActorPosRotMatrix(void) { @@ -699,13 +706,13 @@ void FrameInterpolation_RecordActorPosRotMatrix(void) { next_is_actor_pos_rot_matrix = true; } -//void FrameInterpolation_RecordMatrixPush(Mat4* matrix) { -// if (!check_if_recording()) { -// return; -// } +// void FrameInterpolation_RecordMatrixPush(Mat4* matrix) { +// if (!check_if_recording()) { +// return; +// } // -// append(Op::MatrixPush).matrix_ptr = { (Mat4**) matrix }; -//} +// append(Op::MatrixPush).matrix_ptr = { (Mat4**) matrix }; +// } void FrameInterpolation_RecordMarker(const char* file, int line) { if (!check_if_recording()) { @@ -715,12 +722,12 @@ void FrameInterpolation_RecordMarker(const char* file, int line) { append(Op::Marker).marker = { file, line }; } -//void FrameInterpolation_RecordMatrixPop(Mat4* matrix) { -// if (!check_if_recording()) { -// return; -// } -// append(Op::MatrixPop).matrix_ptr = { (Mat4**) matrix }; -//} +// void FrameInterpolation_RecordMatrixPop(Mat4* matrix) { +// if (!check_if_recording()) { +// return; +// } +// append(Op::MatrixPop).matrix_ptr = { (Mat4**) matrix }; +// } void FrameInterpolation_RecordMatrixPut(MtxF* src) { if (!check_if_recording()) { @@ -748,7 +755,7 @@ void FrameInterpolation_RecordMatrixTranslate(Mat4* matrix, Vec3f b) { return; } // Note: Vec3f decays to pointer when passed as parameter. Cast directly, not &b. - append(Op::MatrixTranslate).matrix_translate = { matrix, *((Vec3fInterp*) b) }; + append(Op::MatrixTranslate).matrix_translate = { matrix, *((Vec3fInterp*)b) }; } void FrameInterpolation_RecordMatrixScale(Mat4* matrix, f32 scale) { @@ -765,25 +772,37 @@ void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Mat4* matrix, Vec3f src // append(Op::MatrixMultVec3fNoTranslate).matrix_vec_no_translate = { matrix, src, dest }; } -void FrameInterpolation_RecordSetTransformMatrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle, - f32 scaleFactor) { +void FrameInterpolation_RecordSetTransformMatrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, + u16 rotationAngle, f32 scaleFactor) { if (!check_if_recording()) { return; } - append(Op::SetTransformMatrix).set_transform_matrix_data = { dest, {orientationVector[0], orientationVector[1], orientationVector[2]}, { positionVector[0], positionVector[1], positionVector[2] }, rotationAngle, scaleFactor}; + append(Op::SetTransformMatrix).set_transform_matrix_data = { + dest, + { orientationVector[0], orientationVector[1], orientationVector[2] }, + { positionVector[0], positionVector[1], positionVector[2] }, + rotationAngle, + scaleFactor + }; } void FrameInterpolation_RecordTranslateRotate(Mat4* dest, Vec3f pos, Vec3s rotation) { - if (!check_if_recording()) { return; } + if (!check_if_recording()) { + return; + } - append(Op::SetTranslateRotate).set_translate_rotate_data = { dest, {pos[0], pos[1], pos[2]}, { rotation[0], rotation[1], rotation[2] }}; + append(Op::SetTranslateRotate).set_translate_rotate_data = { dest, + { pos[0], pos[1], pos[2] }, + { rotation[0], rotation[1], rotation[2] } }; } void FrameInterpolation_RecordSetMatrixTransformation(Mat4* dest, Vec3f location, Vec3su rotation, f32 scale) { if (!check_if_recording()) { return; } - append(Op::SetMatrixTransformation).set_matrix_transformation_data = { dest, {location[0], location[1], location[2]}, { rotation[0], rotation[1], rotation[2] }, scale}; + append(Op::SetMatrixTransformation).set_matrix_transformation_data = { + dest, { location[0], location[1], location[2] }, { rotation[0], rotation[1], rotation[2] }, scale + }; } void FrameInterpolation_RecordCalculateOrientationMatrix(Mat3* dest, f32 x, f32 y, f32 z, s16 rot) { @@ -791,7 +810,7 @@ void FrameInterpolation_RecordCalculateOrientationMatrix(Mat3* dest, f32 x, f32 return; } - // append(Op::SetMatrixTransformation).set_calculate_orientation_matrix_data = { dest, x, y, z, rot}; + // append(Op::SetMatrixTransformation).set_calculate_orientation_matrix_data = { dest, x, y, z, rot}; } // Make a template for deref @@ -802,7 +821,7 @@ void FrameInterpolation_RecordMatrixPosRotXYZ(Mat4* out, Vec3f pos, Vec3s orient } // Note: Vec3f and Vec3s decay to pointers when passed as parameters. // We cast the pointer directly (not &pos which would be pointer-to-pointer). - append(Op::MatrixPosRotXYZ).matrix_pos_rot_xyz = { out, *((Vec3fInterp*) pos), *((Vec3sInterp*) orientation) }; + append(Op::MatrixPosRotXYZ).matrix_pos_rot_xyz = { out, *((Vec3fInterp*)pos), *((Vec3sInterp*)orientation) }; } void FrameInterpolation_RecordMatrixPosRotZXY(Mat4* out, Vec3f pos, Vec3s orientation) { @@ -811,7 +830,7 @@ void FrameInterpolation_RecordMatrixPosRotZXY(Mat4* out, Vec3f pos, Vec3s orient } // Note: Vec3f and Vec3s decay to pointers when passed as parameters. // We cast the pointer directly (not &pos which would be pointer-to-pointer). - append(Op::MatrixPosRotXYZ).matrix_pos_rot_xyz = { out, *((Vec3fInterp*) pos), *((Vec3sInterp*) orientation) }; + append(Op::MatrixPosRotXYZ).matrix_pos_rot_xyz = { out, *((Vec3fInterp*)pos), *((Vec3sInterp*)orientation) }; } void FrameInterpolation_RecordMatrixPosRotScaleXY(Mat4* matrix, s32 x, s32 y, u16 angle, f32 scale) { diff --git a/src/port/interpolation/matrix.c b/src/port/interpolation/matrix.c index 7f739409..0874acc9 100644 --- a/src/port/interpolation/matrix.c +++ b/src/port/interpolation/matrix.c @@ -3,7 +3,8 @@ #include "matrix.h" #include "FrameInterpolation.h" -Mtx gIdentityMtx = gdSPDefMtx(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); +Mtx gIdentityMtx = + gdSPDefMtx(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f); Matrix gIdentityMatrix = { { { 1.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f, 0.0f }, @@ -44,7 +45,6 @@ void Matrix_InitOrtho(Gfx** dList) { FrameInterpolation_RecordCloseChild(); } - // Copies src Matrix into dst void Matrix_Copy(Matrix* dst, Matrix* src) { int32_t i; diff --git a/src/port/mods/PortEnhancements.c b/src/port/mods/PortEnhancements.c index 98398bc2..c9a2e6a6 100644 --- a/src/port/mods/PortEnhancements.c +++ b/src/port/mods/PortEnhancements.c @@ -7,24 +7,18 @@ #include "assets/bin/segment2.h" -static const Mtx matrix_patch_identity = {{ - { 1.0f, 0.0f, 0.0f, 0.0f }, - { 0.0f, 1.0f, 0.0f, 0.0f }, - { 0.0f, 0.0f, 1.0f, 0.0f }, - { 0.0f, 0.0f, 0.0f, 1.0f } -}}; - +static const Mtx matrix_patch_identity = { + { { 1.0f, 0.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 1.0f, 0.0f }, { 0.0f, 0.0f, 0.0f, 1.0f } } +}; // 0x020144B0 - 0x020144F0 -static const Mtx matrix_patch_fullscreen = {{ - { 2.0f / SCREEN_WIDTH, 0.0f, 0.0f, 0.0f }, - { 0.0f, 2.0f / SCREEN_HEIGHT, 0.0f, 0.0f }, - { 0.0f, 0.0f, -1.0f, 0.0f }, - { -1.0f, -1.0f, -1.0f, 1.0f } -}}; +static const Mtx matrix_patch_fullscreen = { { { 2.0f / SCREEN_WIDTH, 0.0f, 0.0f, 0.0f }, + { 0.0f, 2.0f / SCREEN_HEIGHT, 0.0f, 0.0f }, + { 0.0f, 0.0f, -1.0f, 0.0f }, + { -1.0f, -1.0f, -1.0f, 1.0f } } }; void OnLivesChange(IEvent* event) { - PlayerLivesChange* ev = (PlayerLivesChange*) event; + PlayerLivesChange* ev = (PlayerLivesChange*)event; if (CVarGetInteger("gInfiniteLives", 0) == 0 || ev->lives > 0) { return; } @@ -33,7 +27,7 @@ void OnLivesChange(IEvent* event) { } void OnHealthChange(IEvent* event) { - PlayerHealthChange* ev = (PlayerHealthChange*) event; + PlayerHealthChange* ev = (PlayerHealthChange*)event; if (CVarGetInteger("gInfiniteHealth", 0) == 0 || ev->health > 0) { return; } @@ -57,35 +51,22 @@ void PatchSetupDList() { Gfx nop = gsSPNoOp(); // 0 - GfxPatch pt_mtx_fullscreen[] = { - { 4, identity }, - { 5, nop }, - { 6, fullscreen }, - { 7, nop }, - { 8, model }, - { 9, nop } - }; - ResourceMgr_PatchGfxByName(dl_proj_mtx_fullscreen, "SetupFullscreenProjMtx", pt_mtx_fullscreen, ARRAY_COUNT(pt_mtx_fullscreen)); + GfxPatch pt_mtx_fullscreen[] = { { 4, identity }, { 5, nop }, { 6, fullscreen }, + { 7, nop }, { 8, model }, { 9, nop } }; + ResourceMgr_PatchGfxByName(dl_proj_mtx_fullscreen, "SetupFullscreenProjMtx", pt_mtx_fullscreen, + ARRAY_COUNT(pt_mtx_fullscreen)); // 1 - GfxPatch pt_skybox_begin[] = { - { 6, identity }, - { 7, nop } - }; + GfxPatch pt_skybox_begin[] = { { 6, identity }, { 7, nop } }; ResourceMgr_PatchGfxByName(dl_skybox_begin, "SetupSkyboxBegin", pt_skybox_begin, ARRAY_COUNT(pt_skybox_begin)); - + // 2 - GfxPatch pt_skybox_tile_settings[] = { - { 0, model }, - { 1, nop } - }; - ResourceMgr_PatchGfxByName(dl_skybox_tile_tex_settings, "SetupSkyboxTileTexSettings", pt_skybox_tile_settings, ARRAY_COUNT(pt_skybox_tile_settings)); + GfxPatch pt_skybox_tile_settings[] = { { 0, model }, { 1, nop } }; + ResourceMgr_PatchGfxByName(dl_skybox_tile_tex_settings, "SetupSkyboxTileTexSettings", pt_skybox_tile_settings, + ARRAY_COUNT(pt_skybox_tile_settings)); // 3 - GfxPatch pt_up_arrow[] = { - { 7, identity }, - { 8, nop } - }; + GfxPatch pt_up_arrow[] = { { 7, identity }, { 8, nop } }; ResourceMgr_PatchGfxByName(dl_ia8_up_arrow_begin, "SetupUpArrowBegin", pt_up_arrow, ARRAY_COUNT(pt_up_arrow)); } diff --git a/src/port/ui/ImguiUI.cpp b/src/port/ui/ImguiUI.cpp index 97c9f58c..adcc09ee 100644 --- a/src/port/ui/ImguiUI.cpp +++ b/src/port/ui/ImguiUI.cpp @@ -44,9 +44,9 @@ void SetupGuiElements() { if (gui->GetMenuBar() && !gui->GetMenuBar()->IsVisible()) { #if defined(__SWITCH__) || defined(__WIIU__) - Notification::Emit({ .message = "Press - to access enhancements menu", .remainingTime = 10.0f }); + Notification::Emit({ .message = "Press - to access enhancements menu", .remainingTime = 10.0f }); #else - Notification::Emit({ .message = "Press F1 to access enhancements menu", .remainingTime = 10.0f }); + Notification::Emit({ .message = "Press F1 to access enhancements menu", .remainingTime = 10.0f }); #endif } @@ -71,7 +71,8 @@ void SetupGuiElements() { SPDLOG_ERROR("Could not find input GfxDebuggerWindow"); } - mAdvancedResolutionSettingsWindow = std::make_shared("gAdvancedResolutionEditorEnabled", "Advanced Resolution Settings"); + mAdvancedResolutionSettingsWindow = std::make_shared( + "gAdvancedResolutionEditorEnabled", "Advanced Resolution Settings"); gui->AddGuiWindow(mAdvancedResolutionSettingsWindow); mSaveEditorWindow = std::make_shared("gSaveEditorEnabled", "Save Editor"); gui->AddGuiWindow(mSaveEditorWindow); @@ -91,49 +92,55 @@ std::string GetWindowButtonText(const char* text, bool menuOpen) { strcat(buttonText, ICON_FA_CHEVRON_RIGHT " "); } strcat(buttonText, text); - if (!menuOpen) { strcat(buttonText, " "); } + if (!menuOpen) { + strcat(buttonText, " "); + } return buttonText; } -} +} // namespace GameUI static const char* filters[3] = { #ifdef __WIIU__ - "", + "", #else - "Three-Point", + "Three-Point", #endif - "Linear", "None" + "Linear", "None" }; -void DrawSettingsMenu(){ - if(UIWidgets::BeginMenu("Settings")){ +void DrawSettingsMenu() { + if (UIWidgets::BeginMenu("Settings")) { if (UIWidgets::BeginMenu("Audio")) { - UIWidgets::CVarSliderFloat("Master Volume", "gGameMasterVolume", 0.0f, 1.0f, 1.0f, { - .format = "%.0f%%", - .isPercentage = true, - }); - if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f, { - .format = "%.0f%%", - .isPercentage = true, - })) { + UIWidgets::CVarSliderFloat("Master Volume", "gGameMasterVolume", 0.0f, 1.0f, 1.0f, + { + .format = "%.0f%%", + .isPercentage = true, + }); + if (UIWidgets::CVarSliderFloat("Main Music Volume", "gMainMusicVolume", 0.0f, 1.0f, 1.0f, + { + .format = "%.0f%%", + .isPercentage = true, + })) { audio_set_player_volume(SEQ_PLAYER_LEVEL, CVarGetFloat("gMainMusicVolume", 1.0f)); } - if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume", 0.0f, 1.0f, 1.0f, { - .format = "%.0f%%", - .isPercentage = true, - })) { + if (UIWidgets::CVarSliderFloat("Sound Effects Volume", "gSFXMusicVolume", 0.0f, 1.0f, 1.0f, + { + .format = "%.0f%%", + .isPercentage = true, + })) { audio_set_player_volume(SEQ_PLAYER_SFX, CVarGetFloat("gSFXMusicVolume", 1.0f)); } - if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume", 0.0f, 1.0f, 1.0f, { - .format = "%.0f%%", - .isPercentage = true, - })) { + if (UIWidgets::CVarSliderFloat("Environment Volume", "gEnvironmentVolume", 0.0f, 1.0f, 1.0f, + { + .format = "%.0f%%", + .isPercentage = true, + })) { audio_set_player_volume(SEQ_PLAYER_ENV, CVarGetFloat("gEnvironmentVolume", 1.0f)); } static std::unordered_map audioBackendNames = { - { Ship::AudioBackend::WASAPI, "Windows Audio Session API" }, - { Ship::AudioBackend::SDL, "SDL" }, + { Ship::AudioBackend::WASAPI, "Windows Audio Session API" }, + { Ship::AudioBackend::SDL, "SDL" }, }; ImGui::Text("Audio API (Needs reload)"); @@ -143,7 +150,8 @@ void DrawSettingsMenu(){ UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); } if (ImGui::BeginCombo("##AApi", audioBackendNames[currentAudioBackend])) { - for (uint8_t i = 0; i < Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); i++) { + for (uint8_t i = 0; i < Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->size(); + i++) { auto backend = Ship::Context::GetInstance()->GetAudio()->GetAvailableAudioBackends()->data()[i]; if (ImGui::Selectable(audioBackendNames[backend], backend == currentAudioBackend)) { Ship::Context::GetInstance()->GetAudio()->SetCurrentAudioBackend(backend); @@ -166,18 +174,21 @@ void DrawSettingsMenu(){ UIWidgets::Spacer(0); #ifndef __SWITCH__ - UIWidgets::CVarCheckbox("Menubar Controller Navigation", "gControlNav", { - .tooltip = "Allows controller navigation of the SOH menu bar (Settings, Enhancements,...)\nCAUTION: This will disable game inputs while the menubar is visible.\n\nD-pad to move between items, A to select, and X to grab focus on the menu bar" - }); + UIWidgets::CVarCheckbox( + "Menubar Controller Navigation", "gControlNav", + { .tooltip = "Allows controller navigation of the SOH menu bar (Settings, Enhancements,...)\nCAUTION: " + "This will disable game inputs while the menubar is visible.\n\nD-pad to move between " + "items, A to select, and X to grab focus on the menu bar" }); #endif - UIWidgets::CVarCheckbox("Show Inputs", "gInputEnabled", { - .tooltip = "Shows currently pressed inputs on the bottom right of the screen" - }); + UIWidgets::CVarCheckbox("Show Inputs", "gInputEnabled", + { .tooltip = "Shows currently pressed inputs on the bottom right of the screen" }); if (CVarGetInteger("gInputEnabled", 0)) { - UIWidgets::CVarSliderFloat("Input Scale", "gInputScale", 1.0f, 3.0f, 1.0f, { - .tooltip = "Sets the on screen size of the displayed inputs from the Show Inputs setting", - .format = "%.1fx", - }); + UIWidgets::CVarSliderFloat( + "Input Scale", "gInputScale", 1.0f, 3.0f, 1.0f, + { + .tooltip = "Sets the on screen size of the displayed inputs from the Show Inputs setting", + .format = "%.1fx", + }); } ImGui::EndMenu(); @@ -188,17 +199,20 @@ void DrawSettingsMenu(){ ImGui::SetCursorPosY(0.0f); if (UIWidgets::BeginMenu("Graphics")) { - UIWidgets::WindowButton("Resolution Editor", "gAdvancedResolutionEditorEnabled", GameUI::mAdvancedResolutionSettingsWindow); + UIWidgets::WindowButton("Resolution Editor", "gAdvancedResolutionEditorEnabled", + GameUI::mAdvancedResolutionSettingsWindow); UIWidgets::Spacer(0); // Previously was running every frame, and nothing was setting it? Maybe a bad copy/paste? // Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); - // UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but effective form of anti-aliasing"); + // UIWidgets::Tooltip("Multiplies your output resolution by the value inputted, as a more intensive but + // effective form of anti-aliasing"); #ifndef __WIIU__ - if (UIWidgets::CVarSliderInt("MSAA: %d", "gMSAAValue", 1, 8, 1, { - .tooltip = "Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel" - })) { + if (UIWidgets::CVarSliderInt( + "MSAA: %d", "gMSAAValue", 1, 8, 1, + { .tooltip = + "Activates multi-sample anti-aliasing when above 1x up to 8x for 8 samples for every pixel" })) { Ship::Context::GetInstance()->GetWindow()->SetMsaaLevel(CVarGetInteger("gMSAAValue", 1)); } #endif @@ -206,13 +220,14 @@ void DrawSettingsMenu(){ { // FPS Slider const int minFps = 30; static int maxFps; - if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == + Ship::WindowBackend::FAST3D_DXGI_DX11) { maxFps = 360; } else { maxFps = Ship::Context::GetInstance()->GetWindow()->GetCurrentRefreshRate(); } int currentFps = fmax(fmin(GameEngine::GetInterpolationFPS(), maxFps), minFps); - #ifdef __WIIU__ +#ifdef __WIIU__ UIWidgets::Spacer(0); // only support divisors of 60 on the Wii U if (currentFps > 60) { @@ -272,24 +287,24 @@ void DrawSettingsMenu(){ } CVarSetInteger("gInterpolationFPS", currentFps); Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - #else +#else bool matchingRefreshRate = - CVarGetInteger("gMatchRefreshRate", 0) && Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11; - UIWidgets::CVarSliderInt((currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", "gInterpolationFPS", minFps, maxFps, 1, { - .disabled = matchingRefreshRate - }); - #endif - if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { + CVarGetInteger("gMatchRefreshRate", 0) && + Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() != Ship::WindowBackend::FAST3D_DXGI_DX11; + UIWidgets::CVarSliderInt((currentFps == 20) ? "FPS: Original (20)" : "FPS: %d", "gInterpolationFPS", minFps, + maxFps, 1, { .disabled = matchingRefreshRate }); +#endif + if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == + Ship::WindowBackend::FAST3D_DXGI_DX11) { UIWidgets::Tooltip( "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " "visual and does not impact game logic, execution of glitches etc.\n\n" - "A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse result." - ); + "A higher target FPS than your monitor's refresh rate will waste resources, and might give a worse " + "result."); } else { UIWidgets::Tooltip( "Uses Matrix Interpolation to create extra frames, resulting in smoother graphics. This is purely " - "visual and does not impact game logic, execution of glitches etc." - ); + "visual and does not impact game logic, execution of glitches etc."); } } // END FPS Slider @@ -309,25 +324,29 @@ void DrawSettingsMenu(){ UIWidgets::Tooltip("Matches interpolation value to the current game's window refresh rate"); if (Ship::Context::GetInstance()->GetWindow()->GetWindowBackend() == Ship::WindowBackend::FAST3D_DXGI_DX11) { - UIWidgets::PaddedEnhancementSliderInt(CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", - "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false); - UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input lag (e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to work on one frame while GPU works on the previous frame.\nThis setting should be used when your computer is too slow to do CPU + GPU work in time."); + UIWidgets::PaddedEnhancementSliderInt( + CVarGetInteger("gExtraLatencyThreshold", 80) == 0 ? "Jitter fix: Off" : "Jitter fix: >= %d FPS", + "##ExtraLatencyThreshold", "gExtraLatencyThreshold", 0, 360, "", 80, true, true, false); + UIWidgets::Tooltip("When Interpolation FPS setting is at least this threshold, add one frame of input lag " + "(e.g. 16.6 ms for 60 FPS) in order to avoid jitter. This setting allows the CPU to " + "work on one frame while GPU works on the previous frame.\nThis setting should be used " + "when your computer is too slow to do CPU + GPU work in time."); } UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); - static std::unordered_map windowBackendNames = { - { Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" }, - { Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL"}, - { Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" }, + { Ship::WindowBackend::FAST3D_DXGI_DX11, "DirectX" }, + { Ship::WindowBackend::FAST3D_SDL_OPENGL, "OpenGL" }, + { Ship::WindowBackend::FAST3D_SDL_METAL, "Metal" }, }; ImGui::Text("Renderer API (Needs reload)"); Ship::WindowBackend runningWindowBackend = Ship::Context::GetInstance()->GetWindow()->GetWindowBackend(); Ship::WindowBackend configWindowBackend; int configWindowBackendId = Ship::Context::GetInstance()->GetConfig()->GetInt("Window.Backend.Id", -1); - if (configWindowBackendId != -1 && configWindowBackendId < static_cast(Ship::WindowBackend::WINDOW_BACKEND_COUNT)) { + if (configWindowBackendId != -1 && + configWindowBackendId < static_cast(Ship::WindowBackend::WINDOW_BACKEND_COUNT)) { configWindowBackend = static_cast(configWindowBackendId); } else { configWindowBackend = runningWindowBackend; @@ -337,12 +356,13 @@ void DrawSettingsMenu(){ UIWidgets::DisableComponent(ImGui::GetStyle().Alpha * 0.5f); } if (ImGui::BeginCombo("##RApi", windowBackendNames[configWindowBackend])) { - for (size_t i = 0; i < Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); i++) { + for (size_t i = 0; i < Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->size(); + i++) { auto backend = Ship::Context::GetInstance()->GetWindow()->GetAvailableWindowBackends()->data()[i]; if (ImGui::Selectable(windowBackendNames[backend], backend == configWindowBackend)) { Ship::Context::GetInstance()->GetConfig()->SetInt("Window.Backend.Id", static_cast(backend)); Ship::Context::GetInstance()->GetConfig()->SetString("Window.Backend.Name", - windowBackendNames[backend]); + windowBackendNames[backend]); Ship::Context::GetInstance()->GetConfig()->Save(); } } @@ -361,8 +381,10 @@ void DrawSettingsMenu(){ } if (Ship::Context::GetInstance()->GetWindow()->GetGui()->SupportsViewports()) { - UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false, false, "", UIWidgets::CheckboxGraphics::Cross, true); - UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload to take effect."); + UIWidgets::PaddedEnhancementCheckbox("Allow multi-windows", "gEnableMultiViewports", true, false, false, "", + UIWidgets::CheckboxGraphics::Cross, true); + UIWidgets::Tooltip("Allows windows to be able to be dragged off of the main game window. Requires a reload " + "to take effect."); } // If more filters are added to LUS, make sure to add them to the filters list here @@ -381,8 +403,8 @@ void DrawSettingsMenu(){ void DrawMenuBarIcon() { static bool gameIconLoaded = false; if (!gameIconLoaded) { - // Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("Game_Icon", "textures/icons/gIcon.png", ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); - // gameIconLoaded = true; + // Ship::Context::GetInstance()->GetWindow()->GetGui()->LoadGuiTexture("Game_Icon", "textures/icons/gIcon.png", + // ImVec4(1.0f, 1.0f, 1.0f, 1.0f)); gameIconLoaded = true; } if (Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName("Game_Icon")) { @@ -407,12 +429,14 @@ void DrawGameMenu() { if (UIWidgets::BeginMenu("Ghostship")) { if (UIWidgets::MenuItem("Reset", #ifdef __APPLE__ - "Command-R" + "Command-R" #else - "Ctrl+R" + "Ctrl+R" #endif - )) { - std::reinterpret_pointer_cast(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console"))->Dispatch("reset"); + )) { + std::reinterpret_pointer_cast( + Ship::Context::GetInstance()->GetWindow()->GetGui()->GetGuiWindow("Console")) + ->Dispatch("reset"); } #if !defined(__SWITCH__) && !defined(__WIIU__) if (UIWidgets::MenuItem("Toggle Fullscreen", "F9")) { @@ -430,25 +454,24 @@ void DrawEnhancementsMenu() { if (UIWidgets::BeginMenu("Enhancements")) { if (UIWidgets::BeginMenu("Gameplay")) { - UIWidgets::CVarCheckbox("No Level of Detail (LOD)", "gDisableLOD", { - .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance" - }); - UIWidgets::CVarCheckbox("Select any star from menu", "gSelectAllStars", { - .tooltip = "Let's you select any star from the menu regardless of the courses completion status." - }); - UIWidgets::CVarCheckbox("Collecting Stars Will Not Exit Level", "gStarNoExit", { - .tooltip = "Stars act like the 100 coin star and will not take you out of the level" - }); - UIWidgets::CVarCheckbox("Avoid playing peach cutscene", "gDisablePeachCutscene", { - .tooltip = "Avoid playing the peach cutscene when starting a new game" - }); + UIWidgets::CVarCheckbox( + "No Level of Detail (LOD)", "gDisableLOD", + { .tooltip = "Disable Level of Detail (LOD) to avoid models using lower poly versions at a distance" }); + UIWidgets::CVarCheckbox( + "Select any star from menu", "gSelectAllStars", + { .tooltip = "Let's you select any star from the menu regardless of the courses completion status." }); + UIWidgets::CVarCheckbox( + "Collecting Stars Will Not Exit Level", "gStarNoExit", + { .tooltip = "Stars act like the 100 coin star and will not take you out of the level" }); + UIWidgets::CVarCheckbox("Avoid playing peach cutscene", "gDisablePeachCutscene", + { .tooltip = "Avoid playing the peach cutscene when starting a new game" }); ImGui::EndMenu(); } if (UIWidgets::BeginMenu("Fixes")) { - UIWidgets::CVarCheckbox("Fix Koopa race music", "gFixKoopaRaceMusic", { - .tooltip = "Fixes the Koopa race music on Bob-omb Battlefield and Tiny-Huge Island" - }); + UIWidgets::CVarCheckbox( + "Fix Koopa race music", "gFixKoopaRaceMusic", + { .tooltip = "Fixes the Koopa race music on Bob-omb Battlefield and Tiny-Huge Island" }); ImGui::EndMenu(); } @@ -468,12 +491,7 @@ void DrawCheatsMenu() { } const char* debugInfoPages[6] = { - "Object", - "Check Surface", - "Map", - "Stage", - "Effect", - "Enemy", + "Object", "Check Surface", "Map", "Stage", "Effect", "Enemy", }; static const char* logLevels[] = { @@ -482,53 +500,57 @@ static const char* logLevels[] = { void DrawDebugMenu() { if (UIWidgets::BeginMenu("Developer")) { - if (UIWidgets::CVarCombobox("Log Level", "gDeveloperTools.LogLevel", logLevels, { - .tooltip = "The log level determines which messages are printed to the " - "console. This does not affect the log file output", - .defaultIndex = 1, - })) { - Ship::Context::GetInstance()->GetLogger()->set_level((spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); + if (UIWidgets::CVarCombobox("Log Level", "gDeveloperTools.LogLevel", logLevels, + { + .tooltip = "The log level determines which messages are printed to the " + "console. This does not affect the log file output", + .defaultIndex = 1, + })) { + Ship::Context::GetInstance()->GetLogger()->set_level( + (spdlog::level::level_enum)CVarGetInteger("gDeveloperTools.LogLevel", 1)); } - UIWidgets::WindowButton("Gfx Debugger", "gGfxDebuggerEnabled", GameUI::mGfxDebuggerWindow, { - .tooltip = "Enables the Gfx Debugger window, allowing you to input commands, type help for some examples" - }); + UIWidgets::WindowButton( + "Gfx Debugger", "gGfxDebuggerEnabled", GameUI::mGfxDebuggerWindow, + { .tooltip = + "Enables the Gfx Debugger window, allowing you to input commands, type help for some examples" }); - UIWidgets::CVarCheckbox("Debug mode", "gEnableDebugMode", { - .tooltip = "Various debug features, including a level selector from the main menu" - }); + UIWidgets::CVarCheckbox("Debug mode", "gEnableDebugMode", + { .tooltip = "Various debug features, including a level selector from the main menu" }); #ifdef USE_GBI_TRACE - UIWidgets::CVarCheckbox("GFX trace mode", "gEnableGFXTrace", { - .tooltip = "Enables the Gfx trace mode, which will output information about the Gfx commands being run" - }); + UIWidgets::CVarCheckbox( + "GFX trace mode", "gEnableGFXTrace", + { .tooltip = + "Enables the Gfx trace mode, which will output information about the Gfx commands being run" }); #endif - UIWidgets::CVarCheckbox("Better Level Select", "gDeveloper.BetterLevelSelect", { - .tooltip = "Tweaks to the level select screen, like naming and allowing C-buttons to be used" - }); + UIWidgets::CVarCheckbox( + "Better Level Select", "gDeveloper.BetterLevelSelect", + { .tooltip = "Tweaks to the level select screen, like naming and allowing C-buttons to be used" }); UIWidgets::CVarCheckbox("Draw DebugInfo", "gDeveloper.DrawDebugInfo"); if (CVarGetInteger("gDeveloper.DrawDebugInfo", 0)) { - UIWidgets::CVarCombobox("DebugInfo mode", "gDeveloper.DebugInfoPage", debugInfoPages, { - .defaultIndex = 0, - }); + UIWidgets::CVarCombobox("DebugInfo mode", "gDeveloper.DebugInfoPage", debugInfoPages, + { + .defaultIndex = 0, + }); } UIWidgets::Spacer(0); UIWidgets::WindowButton("Save Editor", "gSaveEditorEnabled", GameUI::mSaveEditorWindow); - UIWidgets::WindowButton("Stats", "gStatsEnabled", GameUI::mStatsWindow, { - .tooltip = "Shows the stats window, with your FPS and frametimes, and the OS you're playing on" - }); - UIWidgets::WindowButton("Console", "gConsoleEnabled", GameUI::mConsoleWindow, { - .tooltip = "Enables the console window, allowing you to input commands, type help for some examples" - }); + UIWidgets::WindowButton( + "Stats", "gStatsEnabled", GameUI::mStatsWindow, + { .tooltip = "Shows the stats window, with your FPS and frametimes, and the OS you're playing on" }); + UIWidgets::WindowButton( + "Console", "gConsoleEnabled", GameUI::mConsoleWindow, + { .tooltip = "Enables the console window, allowing you to input commands, type help for some examples" }); ImGui::EndMenu(); } } void GameMenuBar::DrawElement() { - if(ImGui::BeginMenuBar()){ + if (ImGui::BeginMenuBar()) { DrawMenuBarIcon(); DrawGameMenu(); diff --git a/src/port/ui/Notification.cpp b/src/port/ui/Notification.cpp index 63500a67..e790d754 100644 --- a/src/port/ui/Notification.cpp +++ b/src/port/ui/Notification.cpp @@ -22,7 +22,7 @@ void Window::Draw() { switch (position) { case 0: // Top Left basePosition = ImVec2(vp->Pos.x + margin, vp->Pos.y + margin); - break; + break; case 1: // Top Right basePosition = ImVec2(vp->Pos.x + vp->Size.x - margin, vp->Pos.y + margin); break; @@ -52,40 +52,38 @@ void Window::Draw() { } ImGui::Begin(("notification#" + std::to_string(notification.id)).c_str(), nullptr, - ImGuiWindowFlags_AlwaysAutoResize | - ImGuiWindowFlags_NoNav | - ImGuiWindowFlags_NoFocusOnAppearing | - ImGuiWindowFlags_NoResize | - ImGuiWindowFlags_NoDocking | - ImGuiWindowFlags_NoTitleBar | - ImGuiWindowFlags_NoScrollWithMouse | - ImGuiWindowFlags_NoInputs | - ImGuiWindowFlags_NoMove | - ImGuiWindowFlags_NoScrollbar - ); + ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoNav | ImGuiWindowFlags_NoFocusOnAppearing | + ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | + ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoInputs | ImGuiWindowFlags_NoMove | + ImGuiWindowFlags_NoScrollbar); ImGui::SetWindowFontScale(CVarGetFloat("gNotifications.Size", 1.8f)); // Make this adjustable ImVec2 notificationPos; switch (position) { case 0: // Top Left - notificationPos = ImVec2(basePosition.x, basePosition.y + ((ImGui::GetWindowSize().y + padding) * inverseIndex)); + notificationPos = + ImVec2(basePosition.x, basePosition.y + ((ImGui::GetWindowSize().y + padding) * inverseIndex)); break; case 1: // Top Right - notificationPos = ImVec2(basePosition.x - ImGui::GetWindowSize().x, basePosition.y + ((ImGui::GetWindowSize().y + padding) * inverseIndex)); + notificationPos = ImVec2(basePosition.x - ImGui::GetWindowSize().x, + basePosition.y + ((ImGui::GetWindowSize().y + padding) * inverseIndex)); break; case 2: // Bottom Left - notificationPos = ImVec2(basePosition.x, basePosition.y - ((ImGui::GetWindowSize().y + padding) * (inverseIndex + 1))); + notificationPos = ImVec2(basePosition.x, + basePosition.y - ((ImGui::GetWindowSize().y + padding) * (inverseIndex + 1))); break; case 3: // Bottom Right - notificationPos = ImVec2(basePosition.x - ImGui::GetWindowSize().x, basePosition.y - ((ImGui::GetWindowSize().y + padding) * (inverseIndex + 1))); + notificationPos = ImVec2(basePosition.x - ImGui::GetWindowSize().x, + basePosition.y - ((ImGui::GetWindowSize().y + padding) * (inverseIndex + 1))); break; } ImGui::SetWindowPos(notificationPos); if (notification.itemIcon != nullptr) { - ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(notification.itemIcon), ImVec2(24, 24)); + ImGui::Image(Ship::Context::GetInstance()->GetWindow()->GetGui()->GetTextureByName(notification.itemIcon), + ImVec2(24, 24)); ImGui::SameLine(); } if (!notification.prefix.empty()) { @@ -106,7 +104,6 @@ void Window::Draw() { ImGui::PopStyleColor(2); } - void Window::UpdateElement() { for (int index = 0; index < notifications.size(); ++index) { auto& notification = notifications[index]; diff --git a/src/port/ui/ResolutionEditor.cpp b/src/port/ui/ResolutionEditor.cpp index 132ce26d..e9812858 100644 --- a/src/port/ui/ResolutionEditor.cpp +++ b/src/port/ui/ResolutionEditor.cpp @@ -27,268 +27,270 @@ */ namespace AdvancedResolutionSettings { - enum setting { UPDATE_aspectRatioX, UPDATE_aspectRatioY, UPDATE_verticalPixelCount }; +enum setting { UPDATE_aspectRatioX, UPDATE_aspectRatioY, UPDATE_verticalPixelCount }; - const char* aspectRatioPresetLabels[] = { - "Off", "Custom", "Original (4:3)", "Widescreen (16:9)", "Nintendo 3DS (5:3)", "16:10 (8:5)", "Ultrawide (21:9)" - }; - const float aspectRatioPresetsX[] = { 0.0f, 12.0f, 4.0f, 16.0f, 5.0f, 16.0f, 21.0f }; - const float aspectRatioPresetsY[] = { 0.0f, 9.0f, 3.0f, 9.0f, 3.0f, 10.0f, 9.0f }; - const int default_aspectRatio = 1; // Default combo list option +const char* aspectRatioPresetLabels[] = { + "Off", "Custom", "Original (4:3)", "Widescreen (16:9)", "Nintendo 3DS (5:3)", "16:10 (8:5)", "Ultrawide (21:9)" +}; +const float aspectRatioPresetsX[] = { 0.0f, 12.0f, 4.0f, 16.0f, 5.0f, 16.0f, 21.0f }; +const float aspectRatioPresetsY[] = { 0.0f, 9.0f, 3.0f, 9.0f, 3.0f, 10.0f, 9.0f }; +const int default_aspectRatio = 1; // Default combo list option - const char* pixelCountPresetLabels[] = { "Custom", "Native N64 (240p)", "2x (480p)", "3x (720p)", "4x (960p)", - "5x (1200p)", "6x (1440p)", "Full HD (1080p)", "4K (2160p)" }; - const int pixelCountPresets[] = { 480, 240, 480, 720, 960, 1200, 1440, 1080, 2160, 480 }; - const int default_pixelCount = 0; // Default combo list option +const char* pixelCountPresetLabels[] = { "Custom", "Native N64 (240p)", "2x (480p)", "3x (720p)", "4x (960p)", + "5x (1200p)", "6x (1440p)", "Full HD (1080p)", "4K (2160p)" }; +const int pixelCountPresets[] = { 480, 240, 480, 720, 960, 1200, 1440, 1080, 2160, 480 }; +const int default_pixelCount = 0; // Default combo list option - const uint32_t minVerticalPixelCount = 240; // see: Ship::AdvancedResolution() - const uint32_t maxVerticalPixelCount = 4320; +const uint32_t minVerticalPixelCount = 240; // see: Ship::AdvancedResolution() +const uint32_t maxVerticalPixelCount = 4320; - const unsigned short default_maxIntegerScaleFactor = 6; // Default size of Integer scale factor slider. +const unsigned short default_maxIntegerScaleFactor = 6; // Default size of Integer scale factor slider. - const float enhancementSpacerHeight = 19.0f; +const float enhancementSpacerHeight = 19.0f; // This will need to be determined more intelligently when Hi-DPI UI support is added. - void AdvancedResolutionSettingsWindow::InitElement() { - } +void AdvancedResolutionSettingsWindow::InitElement() { +} - void AdvancedResolutionSettingsWindow::DrawElement() { - ImGui::SetNextWindowSize(ImVec2(497, 532), ImGuiCond_FirstUseEver); - if (ImGui::Begin("Advanced Resolution Settings", &mIsVisible)) { - // Initialise update flags. - bool update[sizeof(setting)]; - for (unsigned short i = 0; i < sizeof(setting); i++) - update[i] = false; - static short updateCountdown = 0; - auto interpreter = GameEngine_GetInterpreter(); - short countdownStartingValue = CVarGetInteger("gInterpolationFPS", 60) / 2; // half of a second, in frames. +void AdvancedResolutionSettingsWindow::DrawElement() { + ImGui::SetNextWindowSize(ImVec2(497, 532), ImGuiCond_FirstUseEver); + if (ImGui::Begin("Advanced Resolution Settings", &mIsVisible)) { + // Initialise update flags. + bool update[sizeof(setting)]; + for (unsigned short i = 0; i < sizeof(setting); i++) + update[i] = false; + static short updateCountdown = 0; + auto interpreter = GameEngine_GetInterpreter(); + short countdownStartingValue = CVarGetInteger("gInterpolationFPS", 60) / 2; // half of a second, in frames. - // Initialise integer scale bounds. - short max_integerScaleFactor = default_maxIntegerScaleFactor; // default value, which may or may not get - // overridden depending on viewport res + // Initialise integer scale bounds. + short max_integerScaleFactor = default_maxIntegerScaleFactor; // default value, which may or may not get + // overridden depending on viewport res - short integerScale_maximumBounds = 1; // can change when window is resized - // This is mostly just for UX purposes, as Fit Automatically logic is part of LUS. - if (((float)interpreter->mGameWindowViewport.width / interpreter->mGameWindowViewport.height) > - ((float)interpreter->mCurDimensions.width / interpreter->mCurDimensions.height)) { - // Scale to window height - integerScale_maximumBounds = interpreter->mGameWindowViewport.height / interpreter->mCurDimensions.height; - } else { - // Scale to window width - integerScale_maximumBounds = interpreter->mGameWindowViewport.width / interpreter->mCurDimensions.width; - } - // Lower-clamping maximum bounds value to 1 is no-longer necessary as that's accounted for in LUS. - // Letting it go below 1 in this Editor will even allow for checking if screen bounds are being exceeded. - if (default_maxIntegerScaleFactor < integerScale_maximumBounds) { - max_integerScaleFactor = - integerScale_maximumBounds + CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0); - } + short integerScale_maximumBounds = 1; // can change when window is resized + // This is mostly just for UX purposes, as Fit Automatically logic is part of LUS. + if (((float)interpreter->mGameWindowViewport.width / interpreter->mGameWindowViewport.height) > + ((float)interpreter->mCurDimensions.width / interpreter->mCurDimensions.height)) { + // Scale to window height + integerScale_maximumBounds = interpreter->mGameWindowViewport.height / interpreter->mCurDimensions.height; + } else { + // Scale to window width + integerScale_maximumBounds = interpreter->mGameWindowViewport.width / interpreter->mCurDimensions.width; + } + // Lower-clamping maximum bounds value to 1 is no-longer necessary as that's accounted for in LUS. + // Letting it go below 1 in this Editor will even allow for checking if screen bounds are being exceeded. + if (default_maxIntegerScaleFactor < integerScale_maximumBounds) { + max_integerScaleFactor = + integerScale_maximumBounds + CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0); + } - // Stored Values for non-UIWidgets elements - static float aspectRatioX = CVarGetFloat("gAdvancedResolution.AspectRatioX", 16.0f); - static float aspectRatioY = CVarGetFloat("gAdvancedResolution.AspectRatioY", 9.0f); - static int verticalPixelCount = CVarGetInteger("gAdvancedResolution.VerticalPixelCount", 480); - // Combo List defaults - static int item_aspectRatio = default_aspectRatio; - static int item_pixelCount = default_pixelCount; - // Additional settings - static bool showHorizontalResField = false; - static int horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; + // Stored Values for non-UIWidgets elements + static float aspectRatioX = CVarGetFloat("gAdvancedResolution.AspectRatioX", 16.0f); + static float aspectRatioY = CVarGetFloat("gAdvancedResolution.AspectRatioY", 9.0f); + static int verticalPixelCount = CVarGetInteger("gAdvancedResolution.VerticalPixelCount", 480); + // Combo List defaults + static int item_aspectRatio = default_aspectRatio; + static int item_pixelCount = default_pixelCount; + // Additional settings + static bool showHorizontalResField = false; + static int horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; #ifdef __APPLE__ - ImGui::Text("Note: these settings may behave incorrectly on Apple Retina Displays."); - UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + ImGui::Text("Note: these settings may behave incorrectly on Apple Retina Displays."); + UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); #endif - // The original resolution slider (for convenience) - if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, - "", 1.0f, true, true, - (CVarGetInteger("gAdvancedResolution.VerticalResolutionToggle", 0) && - CVarGetInteger("gAdvancedResolution.Enabled", 0)) || + // The original resolution slider (for convenience) + if (UIWidgets::EnhancementSliderFloat("Internal Resolution: %d %%", "##IMul", "gInternalResolution", 0.5f, 2.0f, + "", 1.0f, true, true, + (CVarGetInteger("gAdvancedResolution.VerticalResolutionToggle", 0) && + CVarGetInteger("gAdvancedResolution.Enabled", 0)) || CVarGetInteger("gLowResMode", 0))) { - Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); + Ship::Context::GetInstance()->GetWindow()->SetResolutionMultiplier(CVarGetFloat("gInternalResolution", 1)); + } + UIWidgets::Tooltip("Multiplies your output resolution by the value entered, as a more intensive but effective " + "form of anti-aliasing"); // Description pulled from SohMenuBar.cpp + + // N64 Mode toggle (again for convenience) + // UIWidgets::PaddedEnhancementCheckbox("(Enhancements>Graphics) N64 Mode", "gLowResMode", false, false, false, + // "", UIWidgets::CheckboxGraphics::Cross, false); + + UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + // Activator + UIWidgets::PaddedEnhancementCheckbox("Enable advanced settings.", "gAdvancedResolution.Enabled", false, false, + false, "", UIWidgets::CheckboxGraphics::Cross, false); + // Error/Warning display + if (!CVarGetInteger("gLowResMode", 0)) { + if (IsDroppingFrames()) { // Significant frame drop warning + ImGui::TextColored({ 0.85f, 0.85f, 0.0f, 1.0f }, + ICON_FA_EXCLAMATION_TRIANGLE " Significant frame rate (FPS) drops may be occuring."); + UIWidgets::Spacer(2); + } else { // No warnings + UIWidgets::Spacer(enhancementSpacerHeight); } - UIWidgets::Tooltip("Multiplies your output resolution by the value entered, as a more intensive but effective " - "form of anti-aliasing"); // Description pulled from SohMenuBar.cpp - - // N64 Mode toggle (again for convenience) - // UIWidgets::PaddedEnhancementCheckbox("(Enhancements>Graphics) N64 Mode", "gLowResMode", false, false, false, - // "", UIWidgets::CheckboxGraphics::Cross, false); - - UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); - // Activator - UIWidgets::PaddedEnhancementCheckbox("Enable advanced settings.", "gAdvancedResolution.Enabled", false, false, - false, "", UIWidgets::CheckboxGraphics::Cross, false); - // Error/Warning display - if (!CVarGetInteger("gLowResMode", 0)) { - if (IsDroppingFrames()) { // Significant frame drop warning - ImGui::TextColored({ 0.85f, 0.85f, 0.0f, 1.0f }, - ICON_FA_EXCLAMATION_TRIANGLE " Significant frame rate (FPS) drops may be occuring."); - UIWidgets::Spacer(2); - } else { // No warnings - UIWidgets::Spacer(enhancementSpacerHeight); - } - } else { // N64 Mode warning - ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, - ICON_FA_QUESTION_CIRCLE " \"N64 Mode\" is overriding these settings."); - ImGui::SameLine(); - if (ImGui::Button("Click to disable")) { - CVarSetInteger("gLowResMode", (int)false); - CVarSave(); - } - } - // Resolution visualiser - ImGui::Text("Viewport dimensions: %d x %d", interpreter->mGameWindowViewport.width, - interpreter->mGameWindowViewport.height); - ImGui::Text("Internal resolution: %d x %d", interpreter->mCurDimensions.width, interpreter->mCurDimensions.height); - - UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); - - // Aspect Ratio - ImGui::Text("Force aspect ratio:"); + } else { // N64 Mode warning + ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, + ICON_FA_QUESTION_CIRCLE " \"N64 Mode\" is overriding these settings."); ImGui::SameLine(); - ImGui::TextColored({ 0.75f, 0.75f, 0.75f, 1.0f }, "(Select \"Off\" to disable.)"); - if (ImGui::Combo(" ", &item_aspectRatio, aspectRatioPresetLabels, - IM_ARRAYSIZE(aspectRatioPresetLabels)) && - item_aspectRatio != default_aspectRatio) { // don't change anything if "Custom" is selected. - aspectRatioX = aspectRatioPresetsX[item_aspectRatio]; - aspectRatioY = aspectRatioPresetsY[item_aspectRatio]; + if (ImGui::Button("Click to disable")) { + CVarSetInteger("gLowResMode", (int)false); + CVarSave(); + } + } + // Resolution visualiser + ImGui::Text("Viewport dimensions: %d x %d", interpreter->mGameWindowViewport.width, + interpreter->mGameWindowViewport.height); + ImGui::Text("Internal resolution: %d x %d", interpreter->mCurDimensions.width, + interpreter->mCurDimensions.height); + + UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + + // Aspect Ratio + ImGui::Text("Force aspect ratio:"); + ImGui::SameLine(); + ImGui::TextColored({ 0.75f, 0.75f, 0.75f, 1.0f }, "(Select \"Off\" to disable.)"); + if (ImGui::Combo(" ", &item_aspectRatio, aspectRatioPresetLabels, + IM_ARRAYSIZE(aspectRatioPresetLabels)) && + item_aspectRatio != default_aspectRatio) { // don't change anything if "Custom" is selected. + aspectRatioX = aspectRatioPresetsX[item_aspectRatio]; + aspectRatioY = aspectRatioPresetsY[item_aspectRatio]; + update[UPDATE_aspectRatioX] = true; + update[UPDATE_aspectRatioY] = true; + + if (showHorizontalResField) { + horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; + } + } + if (item_aspectRatio == default_aspectRatio && !showHorizontalResField) { + // Declaring the Y input interaction in particular as a variable beforehand + // will prevent a bug where the Y field would disappear when modifying X. + bool inputX = ImGui::InputFloat("X", &aspectRatioX, 0.1f, 1.0f, "%.3f"); + bool inputY = ImGui::InputFloat("Y", &aspectRatioY, 0.1f, 1.0f, "%.3f"); + if (inputX || inputY) { + item_aspectRatio = default_aspectRatio; update[UPDATE_aspectRatioX] = true; update[UPDATE_aspectRatioY] = true; - - if (showHorizontalResField) { - horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; - } } - if (item_aspectRatio == default_aspectRatio && !showHorizontalResField) { - // Declaring the Y input interaction in particular as a variable beforehand - // will prevent a bug where the Y field would disappear when modifying X. - bool inputX = ImGui::InputFloat("X", &aspectRatioX, 0.1f, 1.0f, "%.3f"); - bool inputY = ImGui::InputFloat("Y", &aspectRatioY, 0.1f, 1.0f, "%.3f"); - if (inputX || inputY) { - item_aspectRatio = default_aspectRatio; - update[UPDATE_aspectRatioX] = true; - update[UPDATE_aspectRatioY] = true; - } - } else if (showHorizontalResField) { // Show calculated aspect ratio - if (item_aspectRatio) { - UIWidgets::Spacer(2); - float resolvedAspectRatio = (float)interpreter->mCurDimensions.height / interpreter->mCurDimensions.width; - ImGui::Text("Aspect ratio: %.4f", resolvedAspectRatio); - } else { - UIWidgets::Spacer(enhancementSpacerHeight); - } + } else if (showHorizontalResField) { // Show calculated aspect ratio + if (item_aspectRatio) { + UIWidgets::Spacer(2); + float resolvedAspectRatio = + (float)interpreter->mCurDimensions.height / interpreter->mCurDimensions.width; + ImGui::Text("Aspect ratio: %.4f", resolvedAspectRatio); + } else { + UIWidgets::Spacer(enhancementSpacerHeight); } + } - UIWidgets::Spacer(0); - // Vertical Resolution - UIWidgets::PaddedEnhancementCheckbox("Set fixed vertical resolution (disables Resolution slider)", - "gAdvancedResolution.VerticalResolutionToggle", true, false, false, "", - UIWidgets::CheckboxGraphics::Cross, false); - UIWidgets::Tooltip( - "Override the resolution scale slider and use the settings below, irrespective of window size."); - if (ImGui::Combo("Pixel Count Presets", &item_pixelCount, pixelCountPresetLabels, - IM_ARRAYSIZE(pixelCountPresetLabels)) && - item_pixelCount != default_pixelCount) { // don't change anything if "Custom" is selected. - verticalPixelCount = pixelCountPresets[item_pixelCount]; - update[UPDATE_verticalPixelCount] = true; + UIWidgets::Spacer(0); + // Vertical Resolution + UIWidgets::PaddedEnhancementCheckbox("Set fixed vertical resolution (disables Resolution slider)", + "gAdvancedResolution.VerticalResolutionToggle", true, false, false, "", + UIWidgets::CheckboxGraphics::Cross, false); + UIWidgets::Tooltip( + "Override the resolution scale slider and use the settings below, irrespective of window size."); + if (ImGui::Combo("Pixel Count Presets", &item_pixelCount, pixelCountPresetLabels, + IM_ARRAYSIZE(pixelCountPresetLabels)) && + item_pixelCount != default_pixelCount) { // don't change anything if "Custom" is selected. + verticalPixelCount = pixelCountPresets[item_pixelCount]; + update[UPDATE_verticalPixelCount] = true; - if (showHorizontalResField) { - horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; - } - } - // Horizontal Resolution, if visibility is enabled for it. if (showHorizontalResField) { - // Only show the field if Aspect Ratio is being enforced. - if ((aspectRatioX > 0.0f) && (aspectRatioY > 0.0f)) { - // So basically we're "faking" this one by setting aspectRatioX instead. - if (ImGui::InputInt("Horiz. Pixel Count", &horizontalPixelCount, 8, 320)) { - item_aspectRatio = default_aspectRatio; - if (horizontalPixelCount < (minVerticalPixelCount / 3.0f) * 4.0f) { - horizontalPixelCount = (minVerticalPixelCount / 3.0f) * 4.0f; - } - aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; - update[UPDATE_aspectRatioX] = true; - } - } else { // Display a notice instead. - ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, - ICON_FA_QUESTION_CIRCLE " \"Force aspect ratio\" required."); - // ImGui::Text(" "); - ImGui::SameLine(); - if (ImGui::Button("Click to resolve")) { - item_aspectRatio = default_aspectRatio; // Set it to Custom - aspectRatioX = aspectRatioPresetsX[2]; // but use the 4:3 defaults - aspectRatioY = aspectRatioPresetsY[2]; - update[UPDATE_aspectRatioX] = true; - update[UPDATE_aspectRatioY] = true; - horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; - } - } + horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; } - // Vertical Resolution part 2 - if (ImGui::InputInt("Vertical Pixel Count", &verticalPixelCount, 8, 240)) { - item_pixelCount = default_pixelCount; - update[UPDATE_verticalPixelCount] = true; - - // Account for the natural instinct to enter horizontal first. - // Ignore vertical resolutions that are below the lower clamp constant. - if (showHorizontalResField && !(verticalPixelCount < minVerticalPixelCount)) { + } + // Horizontal Resolution, if visibility is enabled for it. + if (showHorizontalResField) { + // Only show the field if Aspect Ratio is being enforced. + if ((aspectRatioX > 0.0f) && (aspectRatioY > 0.0f)) { + // So basically we're "faking" this one by setting aspectRatioX instead. + if (ImGui::InputInt("Horiz. Pixel Count", &horizontalPixelCount, 8, 320)) { + item_aspectRatio = default_aspectRatio; + if (horizontalPixelCount < (minVerticalPixelCount / 3.0f) * 4.0f) { + horizontalPixelCount = (minVerticalPixelCount / 3.0f) * 4.0f; + } aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; update[UPDATE_aspectRatioX] = true; } + } else { // Display a notice instead. + ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, + ICON_FA_QUESTION_CIRCLE " \"Force aspect ratio\" required."); + // ImGui::Text(" "); + ImGui::SameLine(); + if (ImGui::Button("Click to resolve")) { + item_aspectRatio = default_aspectRatio; // Set it to Custom + aspectRatioX = aspectRatioPresetsX[2]; // but use the 4:3 defaults + aspectRatioY = aspectRatioPresetsY[2]; + update[UPDATE_aspectRatioX] = true; + update[UPDATE_aspectRatioY] = true; + horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; + } + } + } + // Vertical Resolution part 2 + if (ImGui::InputInt("Vertical Pixel Count", &verticalPixelCount, 8, 240)) { + item_pixelCount = default_pixelCount; + update[UPDATE_verticalPixelCount] = true; + + // Account for the natural instinct to enter horizontal first. + // Ignore vertical resolutions that are below the lower clamp constant. + if (showHorizontalResField && !(verticalPixelCount < minVerticalPixelCount)) { + aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; + update[UPDATE_aspectRatioX] = true; + } + } + + UIWidgets::Spacer(0); + // UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + + // Integer scaling settings group + if (ImGui::CollapsingHeader("Integer Scaling Settings")) { + // Pixel-perfect Mode + UIWidgets::PaddedEnhancementCheckbox("Pixel-perfect Mode", "gAdvancedResolution.PixelPerfectMode", true, + true, + !CVarGetInteger("gAdvancedResolution.VerticalResolutionToggle", 0), "", + UIWidgets::CheckboxGraphics::Cross, false); + UIWidgets::Tooltip("Don't scale image to fill window."); + if (!CVarGetInteger("gAdvancedResolution.VerticalResolutionToggle", 0)) { + CVarSetInteger("gAdvancedResolution.PixelPerfectMode", (int)false); + CVarSave(); } - UIWidgets::Spacer(0); - // UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); - - // Integer scaling settings group - if (ImGui::CollapsingHeader("Integer Scaling Settings")) { - // Pixel-perfect Mode - UIWidgets::PaddedEnhancementCheckbox("Pixel-perfect Mode", "gAdvancedResolution.PixelPerfectMode", true, - true, - !CVarGetInteger("gAdvancedResolution.VerticalResolutionToggle", 0), "", - UIWidgets::CheckboxGraphics::Cross, false); - UIWidgets::Tooltip("Don't scale image to fill window."); - if (!CVarGetInteger("gAdvancedResolution.VerticalResolutionToggle", 0)) { - CVarSetInteger("gAdvancedResolution.PixelPerfectMode", (int)false); - CVarSave(); - } - - // Integer Scaling - UIWidgets::EnhancementSliderInt("Integer scale factor: %d", "##ARSIntScale", - "gAdvancedResolution.IntegerScale.Factor", 1, max_integerScaleFactor, "%d", - 1, true, - !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0) || + // Integer Scaling + UIWidgets::EnhancementSliderInt("Integer scale factor: %d", "##ARSIntScale", + "gAdvancedResolution.IntegerScale.Factor", 1, max_integerScaleFactor, "%d", + 1, true, + !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0) || CVarGetInteger("gAdvancedResolution.IntegerScale.FitAutomatically", 0)); - UIWidgets::Tooltip("Integer scales the image. Only available in pixel-perfect mode."); - // Display warning if size is being clamped or if framebuffer is larger than viewport. - if (CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0) && - (CVarGetInteger("gAdvancedResolution.IntegerScale.NeverExceedBounds", 1) && - CVarGetInteger("gAdvancedResolution.IntegerScale.Factor", 1) > integerScale_maximumBounds)) { - ImGui::SameLine(); - ImGui::TextColored({ 0.85f, 0.85f, 0.0f, 1.0f }, ICON_FA_EXCLAMATION_TRIANGLE " Window exceeded."); - } - - UIWidgets::PaddedEnhancementCheckbox("Automatically scale image to fit viewport", - "gAdvancedResolution.IntegerScale.FitAutomatically", true, true, - !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0), "", - UIWidgets::CheckboxGraphics::Cross, false); - UIWidgets::Tooltip("Automatically sets scale factor to fit window. Only available in pixel-perfect mode."); - if (CVarGetInteger("gAdvancedResolution.IntegerScale.FitAutomatically", 0)) { - // This is just here to update the value shown on the slider. - // The function in LUS to handle this setting will ignore IntegerScaleFactor while active. - CVarSetInteger("gAdvancedResolution.IntegerScale.Factor", integerScale_maximumBounds); - // CVarSave(); - } + UIWidgets::Tooltip("Integer scales the image. Only available in pixel-perfect mode."); + // Display warning if size is being clamped or if framebuffer is larger than viewport. + if (CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0) && + (CVarGetInteger("gAdvancedResolution.IntegerScale.NeverExceedBounds", 1) && + CVarGetInteger("gAdvancedResolution.IntegerScale.Factor", 1) > integerScale_maximumBounds)) { + ImGui::SameLine(); + ImGui::TextColored({ 0.85f, 0.85f, 0.0f, 1.0f }, ICON_FA_EXCLAMATION_TRIANGLE " Window exceeded."); } - UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + UIWidgets::PaddedEnhancementCheckbox("Automatically scale image to fit viewport", + "gAdvancedResolution.IntegerScale.FitAutomatically", true, true, + !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0), "", + UIWidgets::CheckboxGraphics::Cross, false); + UIWidgets::Tooltip("Automatically sets scale factor to fit window. Only available in pixel-perfect mode."); + if (CVarGetInteger("gAdvancedResolution.IntegerScale.FitAutomatically", 0)) { + // This is just here to update the value shown on the slider. + // The function in LUS to handle this setting will ignore IntegerScaleFactor while active. + CVarSetInteger("gAdvancedResolution.IntegerScale.Factor", integerScale_maximumBounds); + // CVarSave(); + } + } - // Collapsible panel for additional settings - if (ImGui::CollapsingHeader("Additional Settings")) { - UIWidgets::Spacer(0); + UIWidgets::PaddedSeparator(true, true, 3.0f, 3.0f); + + // Collapsible panel for additional settings + if (ImGui::CollapsingHeader("Additional Settings")) { + UIWidgets::Spacer(0); #if defined(__SWITCH__) || defined(__WIIU__) - // Disable aspect correction, stretching the framebuffer to fill the viewport. + // Disable aspect correction, stretching the framebuffer to fill the viewport. // This option is only really needed on systems limited to 16:9 TV resolutions, such as consoles. // The associated CVar is still functional on PC platforms if you want to use it though. UIWidgets::PaddedEnhancementCheckbox("Disable aspect correction and stretch the output image.\n" @@ -298,127 +300,127 @@ namespace AdvancedResolutionSettings { CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0), "", UIWidgets::CheckboxGraphics::Cross, false); #else - if (CVarGetInteger("gAdvancedResolution.IgnoreAspectCorrection", 0)) { - // This setting is intentionally not exposed on PC platforms, - // but may be accidentally activated for varying reasons. - // Having this button should hopefully prevent support headaches. - ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, ICON_FA_QUESTION_CIRCLE - " If the image is stretched and you don't know why, click this."); - if (ImGui::Button("Click to reenable aspect correction.")) { - CVarSetInteger("gAdvancedResolution.IgnoreAspectCorrection", (int)false); - CVarSave(); - } - UIWidgets::Spacer(2); + if (CVarGetInteger("gAdvancedResolution.IgnoreAspectCorrection", 0)) { + // This setting is intentionally not exposed on PC platforms, + // but may be accidentally activated for varying reasons. + // Having this button should hopefully prevent support headaches. + ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, ICON_FA_QUESTION_CIRCLE + " If the image is stretched and you don't know why, click this."); + if (ImGui::Button("Click to reenable aspect correction.")) { + CVarSetInteger("gAdvancedResolution.IgnoreAspectCorrection", (int)false); + CVarSave(); } + UIWidgets::Spacer(2); + } #endif - if (ImGui::Checkbox("Show a horizontal resolution field.", &showHorizontalResField)) { - if (!showHorizontalResField && (aspectRatioX > 0.0f)) { // when turning this setting off - // Refresh relevant values - aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; + if (ImGui::Checkbox("Show a horizontal resolution field.", &showHorizontalResField)) { + if (!showHorizontalResField && (aspectRatioX > 0.0f)) { // when turning this setting off + // Refresh relevant values + aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; + horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; + } else { // when turning this setting on + item_aspectRatio = default_aspectRatio; + if (aspectRatioX > 0.0f) { + // Refresh relevant values in the opposite order horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; - } else { // when turning this setting on - item_aspectRatio = default_aspectRatio; - if (aspectRatioX > 0.0f) { - // Refresh relevant values in the opposite order - horizontalPixelCount = (verticalPixelCount / aspectRatioY) * aspectRatioX; - aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; - } + aspectRatioX = aspectRatioY * horizontalPixelCount / verticalPixelCount; } - update[UPDATE_aspectRatioX] = true; } + update[UPDATE_aspectRatioX] = true; + } - UIWidgets::PaddedEnhancementCheckbox( - "Don't allow integer scaling to exceed screen bounds.\n" - "(Makes screen bounds take priority over specified factor.)", - "gAdvancedResolution.IntegerScale.NeverExceedBounds", true, false, - !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0) || - CVarGetInteger("gAdvancedResolution.IntegerScale.FitAutomatically", 0), - "", UIWidgets::CheckboxGraphics::Cross, true); + UIWidgets::PaddedEnhancementCheckbox( + "Don't allow integer scaling to exceed screen bounds.\n" + "(Makes screen bounds take priority over specified factor.)", + "gAdvancedResolution.IntegerScale.NeverExceedBounds", true, false, + !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0) || + CVarGetInteger("gAdvancedResolution.IntegerScale.FitAutomatically", 0), + "", UIWidgets::CheckboxGraphics::Cross, true); - if (!CVarGetInteger("gAdvancedResolution.IntegerScale.NeverExceedBounds", 1) || - CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0)) { - ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, - " " ICON_FA_QUESTION_CIRCLE - " A scroll bar may become visible if screen bounds are exceeded."); - // Another helpful button for an unused CVar. - if (CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0)) { - if (ImGui::Button("Click to reset an unused CVar that may be causing this.")) { - CVarSetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0); - CVarSave(); - } - } - } else { - UIWidgets::Spacer(enhancementSpacerHeight); - } - - // I've ended up dummying this one out because it doesn't function in a satisfactory way. - // Consider this idea on the table, but I don't deem it an important enough feature to push for. - /* - UIWidgets::PaddedEnhancementCheckbox("Allow integer scale factor to go 1x above maximum screen bounds.", - "gAdvancedResolution.IntegerScale.ExceedBoundsBy", false, false, - !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0), "", - UIWidgets::CheckboxGraphics::Cross, false); + if (!CVarGetInteger("gAdvancedResolution.IntegerScale.NeverExceedBounds", 1) || + CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0)) { + ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, + " " ICON_FA_QUESTION_CIRCLE + " A scroll bar may become visible if screen bounds are exceeded."); + // Another helpful button for an unused CVar. if (CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0)) { - ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, - " " ICON_FA_QUESTION_CIRCLE - " A scroll bar may become visible if screen bounds are exceeded."); - }*/ - - } // end of Additional Settings - - // Clamp and update the CVars that don't use UIWidgets - if (IsBoolArrayTrue(update)) { - if (update[UPDATE_aspectRatioX]) { - if (aspectRatioX < 0.0f) { - aspectRatioX = 0.0f; + if (ImGui::Button("Click to reset an unused CVar that may be causing this.")) { + CVarSetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0); + CVarSave(); } - CVarSetFloat("gAdvancedResolution.AspectRatioX", aspectRatioX); } - if (update[UPDATE_aspectRatioY]) { - if (aspectRatioY < 0.0f) { - aspectRatioY = 0.0f; - } - CVarSetFloat("gAdvancedResolution.AspectRatioY", aspectRatioY); - } - if (update[UPDATE_verticalPixelCount]) { - // There's a upper and lower clamp on the Libultraship side too, - // so clamping it here is purely visual, so the vertical resolution field reflects it. - if (verticalPixelCount < minVerticalPixelCount) { - verticalPixelCount = minVerticalPixelCount; - } - if (verticalPixelCount > maxVerticalPixelCount) { - verticalPixelCount = maxVerticalPixelCount; - } - CVarSetInteger("gAdvancedResolution.VerticalPixelCount", verticalPixelCount); - } - // Delay saving this set of CVars by a predetermined length of time, in frames. - updateCountdown = countdownStartingValue; - } - if (updateCountdown > 0) { - updateCountdown--; } else { - CVarSave(); + UIWidgets::Spacer(enhancementSpacerHeight); } + + // I've ended up dummying this one out because it doesn't function in a satisfactory way. + // Consider this idea on the table, but I don't deem it an important enough feature to push for. + /* + UIWidgets::PaddedEnhancementCheckbox("Allow integer scale factor to go 1x above maximum screen bounds.", + "gAdvancedResolution.IntegerScale.ExceedBoundsBy", false, false, + !CVarGetInteger("gAdvancedResolution.PixelPerfectMode", 0), "", + UIWidgets::CheckboxGraphics::Cross, false); + if (CVarGetInteger("gAdvancedResolution.IntegerScale.ExceedBoundsBy", 0)) { + ImGui::TextColored({ 0.0f, 0.85f, 0.85f, 1.0f }, + " " ICON_FA_QUESTION_CIRCLE + " A scroll bar may become visible if screen bounds are exceeded."); + }*/ + + } // end of Additional Settings + + // Clamp and update the CVars that don't use UIWidgets + if (IsBoolArrayTrue(update)) { + if (update[UPDATE_aspectRatioX]) { + if (aspectRatioX < 0.0f) { + aspectRatioX = 0.0f; + } + CVarSetFloat("gAdvancedResolution.AspectRatioX", aspectRatioX); + } + if (update[UPDATE_aspectRatioY]) { + if (aspectRatioY < 0.0f) { + aspectRatioY = 0.0f; + } + CVarSetFloat("gAdvancedResolution.AspectRatioY", aspectRatioY); + } + if (update[UPDATE_verticalPixelCount]) { + // There's a upper and lower clamp on the Libultraship side too, + // so clamping it here is purely visual, so the vertical resolution field reflects it. + if (verticalPixelCount < minVerticalPixelCount) { + verticalPixelCount = minVerticalPixelCount; + } + if (verticalPixelCount > maxVerticalPixelCount) { + verticalPixelCount = maxVerticalPixelCount; + } + CVarSetInteger("gAdvancedResolution.VerticalPixelCount", verticalPixelCount); + } + // Delay saving this set of CVars by a predetermined length of time, in frames. + updateCountdown = countdownStartingValue; + } + if (updateCountdown > 0) { + updateCountdown--; + } else { + CVarSave(); } - ImGui::End(); } + ImGui::End(); +} - void AdvancedResolutionSettingsWindow::UpdateElement() { - } +void AdvancedResolutionSettingsWindow::UpdateElement() { +} - bool AdvancedResolutionSettingsWindow::IsDroppingFrames() { - // a rather imprecise way of checking for frame drops. - // but it's mostly there to inform the player of large drops. - const short targetFPS = CVarGetInteger("gInterpolationFPS", 60); - const float threshold = targetFPS / 20.0f + 4.1f; - return ImGui::GetIO().Framerate < targetFPS - threshold; - } +bool AdvancedResolutionSettingsWindow::IsDroppingFrames() { + // a rather imprecise way of checking for frame drops. + // but it's mostly there to inform the player of large drops. + const short targetFPS = CVarGetInteger("gInterpolationFPS", 60); + const float threshold = targetFPS / 20.0f + 4.1f; + return ImGui::GetIO().Framerate < targetFPS - threshold; +} - bool AdvancedResolutionSettingsWindow::IsBoolArrayTrue(bool* foo) { - for (unsigned short i = 0; i < sizeof(&foo); i++) - if (&foo[i]) - return true; - return false; - } +bool AdvancedResolutionSettingsWindow::IsBoolArrayTrue(bool* foo) { + for (unsigned short i = 0; i < sizeof(&foo); i++) + if (&foo[i]) + return true; + return false; +} } // namespace AdvancedResolutionSettings \ No newline at end of file diff --git a/src/port/ui/SaveEditor.cpp b/src/port/ui/SaveEditor.cpp index 1e747698..d6fb0fcb 100644 --- a/src/port/ui/SaveEditor.cpp +++ b/src/port/ui/SaveEditor.cpp @@ -16,7 +16,7 @@ extern MarioState* gMarioState; #define DEFINE_COURSES_END() #define DEFINE_BONUS_COURSE(_0, _1, name) name, static char courseNames[][31] = { - #include "levels/course_defines.h" +#include "levels/course_defines.h" }; #undef DEFINE_COURSE #undef DEFINE_COURSES_END @@ -26,12 +26,13 @@ void DrawFlagTableArray32(const FlagTable& flagTable, uint16_t row, uint32_t& fl ImGui::PushID((std::to_string(row) + flagTable.name).c_str()); for (int32_t flagIndex = 0; flagIndex < 32; flagIndex++) { if ((flagIndex % 8) != 0) { - ImGui::SameLine(); + ImGui::SameLine(); } ImGui::PushID(flagIndex); bool hasDescription = !!flagTable.flagDescriptions.contains(flagIndex); uint32_t bitMask = 1 << flagIndex; - ImGui::PushStyleColor(ImGuiCol_FrameBg, hasDescription ? ImVec4(0.16f, 0.29f, 0.48f, 0.54f) : ImVec4(0.16f, 0.29f, 0.48f, 0.24f)); + ImGui::PushStyleColor(ImGuiCol_FrameBg, + hasDescription ? ImVec4(0.16f, 0.29f, 0.48f, 0.54f) : ImVec4(0.16f, 0.29f, 0.48f, 0.24f)); bool flag = (flags & bitMask) != 0; if (ImGui::Checkbox("##check", &flag)) { if (flag) { @@ -55,38 +56,42 @@ void SaveEditorWindow::InitElement() { } void SaveEditorWindow::DrawElement() { - ImGui::SetNextWindowSize(ImVec2(497, 532), ImGuiCond_FirstUseEver); - if (ImGui::Begin("Save Editor", &mIsVisible)) { + ImGui::SetNextWindowSize(ImVec2(497, 532), ImGuiCond_FirstUseEver); + if (ImGui::Begin("Save Editor", &mIsVisible)) { - ImGui::BeginTabBar("##saveEditorTabs"); - if (ImGui::BeginTabItem("Main Save & Mario Flags")) { - ImGui::Text("Mario Flags"); - DrawFlagTableArray32(flagTables[1], 0, gMarioState->flags); - ImGui::Text("Save File Flags"); - DrawFlagTableArray32(flagTables[0], 0, gSaveBuffer.files[gCurrSaveFileNum - 1][0].flags); - ImGui::EndTabItem(); - } - - if (ImGui::BeginTabItem("Course Stars & Coins")) { - for (int i = 0; i < COURSE_COUNT; i++) { - ImGui::Text("%s", courseNames[i]); - std::string invisibleLabelStr = "##courseStars" + std::string(courseNames[i]); - const char* invisibleLabel = invisibleLabelStr.c_str(); - UIWidgets::DrawFlagArray8(invisibleLabel, gSaveBuffer.files[gCurrSaveFileNum - 1][0].courseStars[COURSE_NUM_TO_INDEX(i)]); - if (i < COURSE_STAGES_COUNT) { - ImGui::SameLine(); - std::string invisibleLabelStr2 = "##courseCoins" + std::string(courseNames[i]); - const char* invisibleLabel2 = invisibleLabelStr2.c_str(); - ImGui::SetNextItemWidth(ImGui::GetFontSize() * 4); - ImGui::InputScalar(invisibleLabel2, ImGuiDataType_U8, &gSaveBuffer.files[gCurrSaveFileNum - 1][0].courseCoinScores[COURSE_NUM_TO_INDEX(i)], NULL, NULL, "%u"); + ImGui::BeginTabBar("##saveEditorTabs"); + if (ImGui::BeginTabItem("Main Save & Mario Flags")) { + ImGui::Text("Mario Flags"); + DrawFlagTableArray32(flagTables[1], 0, gMarioState->flags); + ImGui::Text("Save File Flags"); + DrawFlagTableArray32(flagTables[0], 0, gSaveBuffer.files[gCurrSaveFileNum - 1][0].flags); + ImGui::EndTabItem(); } - } - ImGui::EndTabItem(); - } - ImGui::EndTabBar(); - } - ImGui::End(); + if (ImGui::BeginTabItem("Course Stars & Coins")) { + for (int i = 0; i < COURSE_COUNT; i++) { + ImGui::Text("%s", courseNames[i]); + std::string invisibleLabelStr = "##courseStars" + std::string(courseNames[i]); + const char* invisibleLabel = invisibleLabelStr.c_str(); + UIWidgets::DrawFlagArray8( + invisibleLabel, gSaveBuffer.files[gCurrSaveFileNum - 1][0].courseStars[COURSE_NUM_TO_INDEX(i)]); + if (i < COURSE_STAGES_COUNT) { + ImGui::SameLine(); + std::string invisibleLabelStr2 = "##courseCoins" + std::string(courseNames[i]); + const char* invisibleLabel2 = invisibleLabelStr2.c_str(); + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 4); + ImGui::InputScalar( + invisibleLabel2, ImGuiDataType_U8, + &gSaveBuffer.files[gCurrSaveFileNum - 1][0].courseCoinScores[COURSE_NUM_TO_INDEX(i)], NULL, + NULL, "%u"); + } + } + ImGui::EndTabItem(); + } + + ImGui::EndTabBar(); + } + ImGui::End(); } void SaveEditorWindow::UpdateElement() { diff --git a/src/port/ui/UIWidgets.cpp b/src/port/ui/UIWidgets.cpp index 20e6904e..db4499aa 100644 --- a/src/port/ui/UIWidgets.cpp +++ b/src/port/ui/UIWidgets.cpp @@ -10,1018 +10,1074 @@ namespace UIWidgets { - // MARK: - Layout Helper +// MARK: - Layout Helper - // Automatically adds newlines to break up text longer than a specified number of characters - // Manually included newlines will still be respected and reset the line length - // If line is midword when it hits the limit, text should break at the last encountered space - char* WrappedText(const char* text, unsigned int charactersPerLine) { - std::string newText(text); - const size_t tipLength = newText.length(); - int lastSpace = -1; - int currentLineLength = 0; - for (unsigned int currentCharacter = 0; currentCharacter < tipLength; currentCharacter++) { - if (newText[currentCharacter] == '\n') { - currentLineLength = 0; - lastSpace = -1; - continue; - } else if (newText[currentCharacter] == ' ') { - lastSpace = currentCharacter; - } - - if ((currentLineLength >= charactersPerLine) && (lastSpace >= 0)) { - newText[lastSpace] = '\n'; - currentLineLength = currentCharacter - lastSpace - 1; - lastSpace = -1; - } - currentLineLength++; +// Automatically adds newlines to break up text longer than a specified number of characters +// Manually included newlines will still be respected and reset the line length +// If line is midword when it hits the limit, text should break at the last encountered space +char* WrappedText(const char* text, unsigned int charactersPerLine) { + std::string newText(text); + const size_t tipLength = newText.length(); + int lastSpace = -1; + int currentLineLength = 0; + for (unsigned int currentCharacter = 0; currentCharacter < tipLength; currentCharacter++) { + if (newText[currentCharacter] == '\n') { + currentLineLength = 0; + lastSpace = -1; + continue; + } else if (newText[currentCharacter] == ' ') { + lastSpace = currentCharacter; } - return strdup(newText.c_str()); + if ((currentLineLength >= charactersPerLine) && (lastSpace >= 0)) { + newText[lastSpace] = '\n'; + currentLineLength = currentCharacter - lastSpace - 1; + lastSpace = -1; + } + currentLineLength++; } - char* WrappedText(const std::string& text, unsigned int charactersPerLine) { - return WrappedText(text.c_str(), charactersPerLine); - } - - void SetLastItemHoverText(const std::string& text) { - if (ImGui::IsItemHovered()) { - ImGui::BeginTooltip(); - ImGui::Text("%s", WrappedText(text, 60)); - ImGui::EndTooltip(); - } - } - - void SetLastItemHoverText(const char* text) { - if (ImGui::IsItemHovered()) { - ImGui::BeginTooltip(); - ImGui::Text("%s", WrappedText(text, 60)); - ImGui::EndTooltip(); - } - } - - // Adds a "?" next to the previous ImGui item with a custom tooltip - void InsertHelpHoverText(const std::string& text) { - ImGui::SameLine(); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?"); - if (ImGui::IsItemHovered()) { - ImGui::BeginTooltip(); - ImGui::Text("%s", WrappedText(text, 60)); - ImGui::EndTooltip(); - } - } - - void InsertHelpHoverText(const char* text) { - ImGui::SameLine(); - ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?"); - if (ImGui::IsItemHovered()) { - ImGui::BeginTooltip(); - ImGui::Text("%s", WrappedText(text, 60)); - ImGui::EndTooltip(); - } - } - - - // MARK: - UI Elements - - void Tooltip(const char* text) { - if (ImGui::IsItemHovered()) { - ImGui::SetTooltip("%s", WrappedText(text)); - } - } - - void Spacer(float height) { - ImGui::Dummy(ImVec2(0.0f, height)); - } - - void PaddedSeparator(bool padTop, bool padBottom, float extraVerticalTopPadding, float extraVerticalBottomPadding) { - if (padTop) { - Spacer(extraVerticalTopPadding); - } - ImGui::Separator(); - if (padBottom) { - Spacer(extraVerticalBottomPadding); - } - } - - void RenderCross(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz) { - float thickness = ImMax(sz / 5.0f, 1.0f); - sz -= thickness * 0.5f; - pos += ImVec2(thickness * 0.25f, thickness * 0.25f); - - draw_list->PathLineTo(ImVec2(pos.x, pos.y)); - draw_list->PathLineTo(ImVec2(pos.x + sz, pos.y + sz)); - draw_list->PathStroke(col, 0, thickness); - - draw_list->PathLineTo(ImVec2(pos.x + sz, pos.y)); - draw_list->PathLineTo(ImVec2(pos.x, pos.y + sz)); - draw_list->PathStroke(col, 0, thickness); - } - - bool CustomCheckbox(const char* label, bool* v, bool disabled, CheckboxGraphics disabledGraphic) { - ImGuiWindow* window = ImGui::GetCurrentWindow(); - if (window->SkipItems) { - return false; - } - - ImGuiContext& g = *GImGui; - const ImGuiStyle& style = g.Style; - const ImGuiID id = window->GetID(label); - const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true); - - const float square_sz = ImGui::GetFrameHeight(); - const ImVec2 pos = window->DC.CursorPos; - const ImRect total_bb(pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), label_size.y + style.FramePadding.y * 2.0f)); - ImGui::ItemSize(total_bb, style.FramePadding.y); - if (!ImGui::ItemAdd(total_bb, id)) { - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); - return false; - } - - bool hovered, held; - bool pressed = ImGui::ButtonBehavior(total_bb, id, &hovered, &held); - if (pressed) { - *v = !(*v); - ImGui::MarkItemEdited(id); - } - - const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz)); - ImGui::RenderNavHighlight(total_bb, id); - ImGui::RenderFrame(check_bb.Min, check_bb.Max, ImGui::GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive : hovered ? ImGuiCol_FrameBgHovered : ImGuiCol_FrameBg), true, style.FrameRounding); - ImU32 check_col = ImGui::GetColorU32(ImGuiCol_CheckMark); - ImU32 cross_col = ImGui::GetColorU32(ImVec4(0.50f, 0.50f, 0.50f, 1.00f)); - bool mixed_value = (g.LastItemData.ItemFlags & ImGuiItemFlags_MixedValue) != 0; - if (mixed_value) { - // Undocumented tristate/mixed/indeterminate checkbox (#2644) - // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all widgets (not just checkbox) - ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f))); - window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding); - } else if ((!disabled && *v) || (disabled && disabledGraphic == CheckboxGraphics::Checkmark)) { - const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); - ImGui::RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f); - } else if (disabled && disabledGraphic == CheckboxGraphics::Cross) { - const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); - RenderCross(window->DrawList, check_bb.Min + ImVec2(pad, pad), cross_col, square_sz - pad * 2.0f); - } - - ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y); - if (g.LogEnabled) { - ImGui::LogRenderedText(&label_pos, mixed_value ? "[~]" : *v ? "[x]" : "[ ]"); - } - if (label_size.x > 0.0f) { - ImGui::RenderText(label_pos, label); - } - - IMGUI_TEST_ENGINE_ITEM_INFO(id, label, g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | (*v ? ImGuiItemStatusFlags_Checked : 0)); - return pressed; - } - - void ReEnableComponent(const char* disabledTooltipText) { - // End of disable region of previous component - ImGui::PopStyleVar(1); - if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(disabledTooltipText, "") != 0) { - ImGui::SetTooltip("%s", disabledTooltipText); - } - ImGui::PopItemFlag(); - } - - void DisableComponent(const float alpha) { - ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); - ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha); - } - - bool EnhancementCheckbox(const char* text, const char* cvarName, bool disabled, const char* disabledTooltipText, CheckboxGraphics disabledGraphic, bool defaultValue) { - bool changed = false; - if (disabled) { - DisableComponent(ImGui::GetStyle().Alpha * 0.5f); - } - - bool val = (bool)CVarGetInteger(cvarName, defaultValue); - if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { - CVarSetInteger(cvarName, val); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - changed = true; - } - - if (disabled) { - ReEnableComponent(disabledTooltipText); - } - return changed; - } - - bool PaddedEnhancementCheckbox(const char* text, const char* cvarName, bool padTop, bool padBottom, bool disabled, const char* disabledTooltipText, CheckboxGraphics disabledGraphic, bool defaultValue) { - ImGui::BeginGroup(); - if (padTop) Spacer(0); - - bool changed = EnhancementCheckbox(text, cvarName, disabled, disabledTooltipText, disabledGraphic, defaultValue); - - if (padBottom) Spacer(0); - ImGui::EndGroup(); - return changed; - } - - bool EnhancementCombobox(const char* cvarName, std::span comboArray, uint8_t defaultIndex, bool disabled, const char* disabledTooltipText, uint8_t disabledValue) { - bool changed = false; - if (defaultIndex <= 0) { - defaultIndex = 0; - } - - if (disabled) { - DisableComponent(ImGui::GetStyle().Alpha * 0.5f); - } - - uint8_t selected = CVarGetInteger(cvarName, defaultIndex); - std::string comboName = std::string("##") + std::string(cvarName); - if (ImGui::BeginCombo(comboName.c_str(), comboArray[selected])) { - for (uint8_t i = 0; i < comboArray.size(); i++) { - if (strlen(comboArray[i]) > 1) { - if (ImGui::Selectable(comboArray[i], i == selected)) { - CVarSetInteger(cvarName, i); - selected = i; - changed = true; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - } - } - } - ImGui::EndCombo(); - } - - if (disabled) { - ReEnableComponent(disabledTooltipText); - - if (disabledValue >= 0 && selected != disabledValue) { - CVarSetInteger(cvarName, disabledValue); - changed = true; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - } - } - - return changed; - } - - bool LabeledRightAlignedEnhancementCombobox(const char* label, const char* cvarName, std::span comboArray, uint8_t defaultIndex, bool disabled, const char* disabledTooltipText, uint8_t disabledValue) { - ImGui::Text(label); - s32 currentValue = CVarGetInteger(cvarName, defaultIndex); - -#ifdef __WIIU__ - ImGui::SameLine(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize(comboArray[currentValue]).x + 40.0f)); - ImGui::PushItemWidth(ImGui::CalcTextSize(comboArray[currentValue]).x + 60.0f); -#else - ImGui::SameLine(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize(comboArray[currentValue]).x + 20.0f)); - ImGui::PushItemWidth(ImGui::CalcTextSize(comboArray[currentValue]).x + 30.0f); -#endif - - bool changed = EnhancementCombobox(cvarName, comboArray, defaultIndex, disabled, disabledTooltipText, disabledValue); - - ImGui::PopItemWidth(); - return changed; - } - - void PaddedText(const char* text, bool padTop, bool padBottom) { - if (padTop) Spacer(0); - - ImGui::Text("%s", text); - - if (padBottom) Spacer(0); - } - - bool EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue, bool PlusMinusButton, bool disabled, const char* disabledTooltipText) { - bool changed = false; - int val = CVarGetInteger(cvarName, defaultValue); - - if (disabled) { - DisableComponent(ImGui::GetStyle().Alpha * 0.5f); - } - - ImGui::Text(text, val); - Spacer(0); - - ImGui::BeginGroup(); - if (PlusMinusButton) { - std::string MinusBTNName = " - ##" + std::string(cvarName); - if (ImGui::Button(MinusBTNName.c_str())) { - val--; - changed = true; - } - ImGui::SameLine(); - ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); - } - - ImGui::PushItemWidth(std::min((ImGui::GetContentRegionAvail().x - (PlusMinusButton ? sliderButtonWidth : 0.0f)), maxSliderWidth)); - if (ImGui::SliderInt(id, &val, min, max, format, ImGuiSliderFlags_AlwaysClamp)) - { - changed = true; - } - ImGui::PopItemWidth(); - - if (PlusMinusButton) { - std::string PlusBTNName = " + ##" + std::string(cvarName); - ImGui::SameLine(); - ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); - if (ImGui::Button(PlusBTNName.c_str())) { - val++; - changed = true; - } - } - ImGui::EndGroup(); - - if (disabled) { - ReEnableComponent(disabledTooltipText); - } - - if (val < min) { - val = min; - changed = true; - } - - if (val > max) { - val = max; - changed = true; - } - - if (changed) { - CVarSetInteger(cvarName, val); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - } - - return changed; - } - - bool EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton, bool disabled, const char* disabledTooltipText) { - bool changed = false; - float val = CVarGetFloat(cvarName, defaultValue); - - if (disabled) { - DisableComponent(ImGui::GetStyle().Alpha * 0.5f); - } - - if (!isPercentage) { - ImGui::Text(text, val); - } else { - ImGui::Text(text, static_cast(100 * val)); - } - Spacer(0); - - ImGui::BeginGroup(); - if (PlusMinusButton) { - std::string MinusBTNName = " - ##" + std::string(cvarName); - if (ImGui::Button(MinusBTNName.c_str())) { - if (isPercentage) { - val -= 0.01f; - } else { - val -= 0.1f; - } - changed = true; - } - ImGui::SameLine(); - ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); - } - - ImGui::PushItemWidth(std::min((ImGui::GetContentRegionAvail().x - (PlusMinusButton ? sliderButtonWidth : 0.0f)), maxSliderWidth)); - if (ImGui::SliderFloat(id, &val, min, max, format, ImGuiSliderFlags_AlwaysClamp)) { - if (isPercentage) { - val = roundf(val * 100) / 100; - } - changed = true; - } - ImGui::PopItemWidth(); - - if (PlusMinusButton) { - std::string PlusBTNName = " + ##" + std::string(cvarName); - ImGui::SameLine(); - ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); - if (ImGui::Button(PlusBTNName.c_str())) { - if (isPercentage) { - val += 0.01f; - } else { - val += 0.1f; - } - changed = true; - } - } - ImGui::EndGroup(); - - if (disabled) { - ReEnableComponent(disabledTooltipText); - } - - if (val < min) { - val = min; - changed = true; - } - - if (val > max) { - val = max; - changed = true; - } - - if (changed) { - CVarSetFloat(cvarName, val); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - } - - return changed; - } - - bool PaddedEnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, int defaultValue, bool PlusMinusButton, bool padTop, bool padBottom, bool disabled, const char* disabledTooltipText) { - bool changed = false; - ImGui::BeginGroup(); - if (padTop) Spacer(0); - - changed = EnhancementSliderInt(text, id, cvarName, min, max, format, defaultValue, PlusMinusButton, disabled, disabledTooltipText); - - if (padBottom) Spacer(0); - ImGui::EndGroup(); - return changed; - } - - bool PaddedEnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton, bool padTop, bool padBottom, bool disabled, const char* disabledTooltipText) { - bool changed = false; - ImGui::BeginGroup(); - if (padTop) Spacer(0); - - changed = EnhancementSliderFloat(text, id, cvarName, min, max, format, defaultValue, isPercentage, PlusMinusButton, disabled, disabledTooltipText); - - if (padBottom) Spacer(0); - ImGui::EndGroup(); - return changed; - } - - bool EnhancementRadioButton(const char* text, const char* cvarName, int id) { - /*Usage : - EnhancementRadioButton("My Visible Name","gMyCVarName", MyID); - First arg is the visible name of the Radio button - Second is the cvar name where MyID will be saved. - Note: the CVar name should be the same to each Buddies. - Example : - EnhancementRadioButton("English", "gLanguages", LANGUAGE_ENG); - EnhancementRadioButton("German", "gLanguages", LANGUAGE_GER); - EnhancementRadioButton("French", "gLanguages", LANGUAGE_FRA); - */ - std::string make_invisible = "##" + std::string(text) + std::string(cvarName); - - bool ret = false; - int val = CVarGetInteger(cvarName, 0); - if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { - CVarSetInteger(cvarName, id); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - ret = true; - } - ImGui::SameLine(); - ImGui::Text("%s", text); - - return ret; - } - - bool DrawResetColorButton(const char* cvarName, ImVec4* colors, ImVec4 defaultcolors, bool has_alpha) { - bool changed = false; - std::string Cvar_RBM = std::string(cvarName) + "RBM"; - std::string MakeInvisible = "Reset##" + std::string(cvarName) + "Reset"; - if (ImGui::Button(MakeInvisible.c_str())) { - colors->x = defaultcolors.x; - colors->y = defaultcolors.y; - colors->z = defaultcolors.z; - colors->w = has_alpha ? defaultcolors.w : 255.0f; - - Color_RGBA8 colorsRGBA; - colorsRGBA.r = defaultcolors.x; - colorsRGBA.g = defaultcolors.y; - colorsRGBA.b = defaultcolors.z; - colorsRGBA.a = has_alpha ? defaultcolors.w : 255.0f; - - CVarSetColor(cvarName, colorsRGBA); - CVarSetInteger(Cvar_RBM.c_str(), 0); //On click disable rainbow mode. - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - changed = true; - } - Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color"); - return changed; - } - - void DrawLockColorCheckbox(const char* cvarName) { - std::string Cvar_Lock = std::string(cvarName) + "Lock"; - s32 lock = CVarGetInteger(Cvar_Lock.c_str(), 0); - std::string FullName = "Lock##" + Cvar_Lock; - EnhancementCheckbox(FullName.c_str(), Cvar_Lock.c_str()); - Tooltip("Prevents this color from being changed upon selecting \"Randomize all\""); - } - - void RainbowColor(const char* cvarName, ImVec4* colors) { - std::string Cvar_RBM = std::string(cvarName) + "RBM"; - std::string MakeInvisible = "Rainbow##" + std::string(cvarName) + "Rainbow"; - - EnhancementCheckbox(MakeInvisible.c_str(), Cvar_RBM.c_str()); - Tooltip("Cycles through colors on a timer\nOverwrites previously chosen color"); - } - - void LoadPickersColors(ImVec4& ColorArray, const char* cvarname, const ImVec4& default_colors, bool has_alpha) { - Color_RGBA8 defaultColors; - defaultColors.r = default_colors.x; - defaultColors.g = default_colors.y; - defaultColors.b = default_colors.z; - defaultColors.a = default_colors.w; - - Color_RGBA8 cvarColor = CVarGetColor(cvarname, defaultColors); - - ColorArray.x = cvarColor.r / 255.0; - ColorArray.y = cvarColor.g / 255.0; - ColorArray.z = cvarColor.b / 255.0; - ColorArray.w = cvarColor.a / 255.0; - } - - void DrawFlagArray32(const std::string& name, uint32_t& flags) { - ImGui::PushID(name.c_str()); - for (int32_t flagIndex = 0; flagIndex < 32; flagIndex++) { - if ((flagIndex % 8) != 0) { - ImGui::SameLine(); - } - ImGui::PushID(flagIndex); - uint32_t bitMask = 1 << flagIndex; - bool flag = (flags & bitMask) != 0; - if (ImGui::Checkbox("##check", &flag)) { - if (flag) { - flags |= bitMask; - } else { - flags &= ~bitMask; - } - } - ImGui::PopID(); - } - ImGui::PopID(); - } - - void DrawFlagArray16(const std::string& name, uint16_t& flags) { - ImGui::PushID(name.c_str()); - for (int16_t flagIndex = 0; flagIndex < 16; flagIndex++) { - if ((flagIndex % 8) != 0) { - ImGui::SameLine(); - } - ImGui::PushID(flagIndex); - uint16_t bitMask = 1 << flagIndex; - bool flag = (flags & bitMask) != 0; - if (ImGui::Checkbox("##check", &flag)) { - if (flag) { - flags |= bitMask; - } else { - flags &= ~bitMask; - } - } - ImGui::PopID(); - } - ImGui::PopID(); - } - - void DrawFlagArray8(const std::string& name, uint8_t& flags) { - ImGui::PushID(name.c_str()); - for (int8_t flagIndex = 0; flagIndex < 8; flagIndex++) { - if ((flagIndex % 8) != 0) { - ImGui::SameLine(); - } - ImGui::PushID(flagIndex); - uint8_t bitMask = 1 << flagIndex; - bool flag = (flags & bitMask) != 0; - if (ImGui::Checkbox("##check", &flag)) { - if (flag) { - flags |= bitMask; - } else { - flags &= ~bitMask; - } - } - ImGui::PopID(); - } - ImGui::PopID(); - } - - // V2 - - void PushStyleMenu(const ImVec4& color) { - ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(color.x, color.y, color.z, 0.5f)); - ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_PopupBg, UIWidgets::Colors::DarkGray); - ImGui::PushStyleColor(ImGuiCol_Border, UIWidgets::Colors::DarkGray); - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(8.0f, 15.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, 3.0f); - } - - void PopStyleMenu() { - ImGui::PopStyleVar(2); - ImGui::PopStyleColor(4); - } - - bool BeginMenu(const char* label, const ImVec4& color) { - bool dirty = false; - PushStyleMenu(color); - if (ImGui::BeginMenu(label)) { - dirty = true; - } - PopStyleMenu(); - return dirty; - } - - void PushStyleMenuItem(const ImVec4& color) { - ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(20.0f, 15.0f)); - } - - void PopStyleMenuItem() { - ImGui::PopStyleVar(1); - ImGui::PopStyleColor(1); - } - - bool MenuItem(const char* label, const char* shortcut, const ImVec4& color) { - bool dirty = false; - PushStyleMenuItem(color); - if (ImGui::MenuItem(label, shortcut)) { - dirty = true; - } - PopStyleMenuItem(); - return dirty; - } - - void PushStyleButton(const ImVec4& color) { - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(color.x, color.y, color.z, 0.8f)); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(color.x, color.y, color.z, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 8.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f); - } - - void PopStyleButton() { - ImGui::PopStyleVar(3); - ImGui::PopStyleColor(4); - } - - bool Button(const char* label, const ButtonOptions& options) { - ImGui::BeginDisabled(options.disabled); - PushStyleButton(options.color); - bool dirty = ImGui::Button(label, options.size); - PopStyleButton(); - ImGui::EndDisabled(); - if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.disabledTooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); - } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.tooltip)); - } - return dirty; - } - - bool WindowButton(const char* label, const char* cvarName, std::shared_ptr windowPtr, const ButtonOptions& options) { - ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0)); - std::string buttonText = label; - bool dirty = false; - if (CVarGetInteger(cvarName, 0)) { - buttonText = ICON_FA_WINDOW_CLOSE " " + buttonText; - } else { - buttonText = ICON_FA_EXTERNAL_LINK_SQUARE " " + buttonText; - } - if (Button(buttonText.c_str(), options)) { - windowPtr->ToggleVisibility(); - dirty = true; - } - ImGui::PopStyleVar(); - return dirty; - } - - void PushStyleCheckbox(const ImVec4& color) { - ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.8f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f)); - ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(1.0f, 1.0f, 1.0f, 0.7f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 6.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f); - } - - void PopStyleCheckbox() { - ImGui::PopStyleVar(3); - ImGui::PopStyleColor(5); - } - - bool Checkbox(const char* label, bool* value, const CheckboxOptions& options) { - ImGui::PushID(label); - bool dirty = false; - float startX = ImGui::GetCursorPosX(); - std::string invisibleLabelStr = "##" + std::string(label); - const char* invisibleLabel = invisibleLabelStr.c_str(); - ImGui::BeginDisabled(options.disabled); - PushStyleCheckbox(options.color); - if (options.alignment == ComponentAlignment::Right) { - if (options.labelPosition == LabelPosition::Near || options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::GetStyle().FramePadding.x * 2 - ImGui::GetStyle().ItemSpacing.x); - } else if (options.labelPosition == LabelPosition::Above) { - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); - ImGui::Text(label); - ImGui::NewLine(); - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::GetStyle().FramePadding.x * 2 - ImGui::GetStyle().ItemSpacing.x); - } - } else if (options.alignment == ComponentAlignment::Left) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::Text(label); - } - } - dirty = ImGui::Checkbox(invisibleLabel, value); - if (options.alignment == ComponentAlignment::Right) { - if (options.labelPosition == LabelPosition::Near) { - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x - ImGui::GetStyle().FramePadding.x * 2 - ImGui::GetStyle().ItemSpacing.x * 2); - ImGui::Text(label); - } else if (options.labelPosition == LabelPosition::Far) { - ImGui::SameLine(); - ImGui::SetCursorPosX(startX); - ImGui::Text(label); - } - } else if (options.alignment == ComponentAlignment::Left) { - if (options.labelPosition == LabelPosition::Near) { - ImGui::SameLine(); - ImGui::Text(label); - } else if (options.labelPosition == LabelPosition::Far) { - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); - ImGui::Text(label); - } - } - PopStyleCheckbox(); - ImGui::EndDisabled(); - if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.disabledTooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); - } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.tooltip)); - } - ImGui::PopID(); - return dirty; - } - - bool CVarCheckbox(const char* label, const char* cvarName, const CheckboxOptions& options) { - bool dirty = false; - bool value = (bool)CVarGetInteger(cvarName, options.defaultValue); - if (Checkbox(label, &value, options)) { - CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - return dirty; - } - - void PushStyleCombobox(const ImVec4& color) { - ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 0.8f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(color.x, color.y, color.z, 0.8f)); - ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(color.x, color.y, color.z, 0.5f)); - ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(color.x, color.y, color.z, 0.6f)); - ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(color.x, color.y, color.z, 0.6f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_PopupRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, 0.0f); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 6.0f)); - } - - void PopStyleCombobox() { - ImGui::PopStyleVar(4); - ImGui::PopStyleColor(9); - } - - bool Combobox(const char* label, uint8_t* value, std::span comboArray, const ComboboxOptions& options) { - bool dirty = false; - float startX = ImGui::GetCursorPosX(); - std::string invisibleLabelStr = "##" + std::string(label); - const char* invisibleLabel = invisibleLabelStr.c_str(); - ImGui::PushID(label); - ImGui::BeginGroup(); - ImGui::BeginDisabled(options.disabled); - PushStyleCombobox(options.color); - if (options.alignment == ComponentAlignment::Left) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::Text(label); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - } else if (options.labelPosition == LabelPosition::Near) { - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x - ImGui::GetStyle().ItemSpacing.x * 2); - } else if (options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { - ImGui::SetNextItemWidth(ImGui::CalcTextSize(comboArray[*value]).x + ImGui::GetStyle().FramePadding.x * 4 + ImGui::GetStyle().ItemSpacing.x); - } - } else if (options.alignment == ComponentAlignment::Right) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::NewLine(); - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); - ImGui::Text(label); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - } else if (options.labelPosition == LabelPosition::Near) { - ImGui::SameLine(ImGui::CalcTextSize(label).x + ImGui::GetStyle().ItemSpacing.x * 2); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - } else if (options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { - float width = ImGui::CalcTextSize(comboArray[*value]).x + ImGui::GetStyle().FramePadding.x * 4; - ImGui::SameLine(ImGui::GetContentRegionAvail().x - width); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - } - } - if (ImGui::BeginCombo(invisibleLabel, comboArray[*value], options.flags)) { - ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(10.0f, 10.0f)); - for (uint8_t i = 0; i < comboArray.size(); i++) { - if (strlen(comboArray[i]) > 1) { - if (ImGui::Selectable(comboArray[i], i == *value)) { - *value = i; - dirty = true; - } - } - } - ImGui::PopStyleVar(); - ImGui::EndCombo(); - } - if (options.alignment == ComponentAlignment::Left) { - if (options.labelPosition == LabelPosition::Near) { - ImGui::SameLine(); - ImGui::Text(label); - } else if (options.labelPosition == LabelPosition::Far) { - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); - ImGui::Text(label); - } - } else if (options.alignment == ComponentAlignment::Right) { - if (options.labelPosition == LabelPosition::Near || options.labelPosition == LabelPosition::Far) { - ImGui::SameLine(startX); - ImGui::Text(label); - } - } - PopStyleCombobox(); - ImGui::EndDisabled(); - ImGui::EndGroup(); - if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.disabledTooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); - } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.tooltip)); - } - ImGui::PopID(); - return dirty; - } - - bool CVarCombobox(const char* label, const char* cvarName, std::span comboArray, const ComboboxOptions& options) { - bool dirty = false; - uint8_t value = (uint8_t)CVarGetInteger(cvarName, options.defaultIndex); - if (Combobox(label, &value, comboArray, options)) { - CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - return dirty; - } - - void PushStyleSlider(const ImVec4& color) { - ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(color.x, color.y, color.z, 1.0f)); - ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(1.0, 1.0, 1.0, 0.4f)); - ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(1.0, 1.0, 1.0, 0.5f)); - ImGui::PushStyleVar(ImGuiStyleVar_GrabRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); - ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 8.0f)); - ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f); - } - - void PopStyleSlider() { - ImGui::PopStyleVar(4); - ImGui::PopStyleColor(6); - } - - bool SliderInt(const char* label, int32_t* value, int32_t min, int32_t max, const IntSliderOptions& options) { - bool dirty = false; - std::string invisibleLabelStr = "##" + std::string(label); - const char* invisibleLabel = invisibleLabelStr.c_str(); - ImGui::PushID(label); - ImGui::BeginGroup(); - ImGui::BeginDisabled(options.disabled); - PushStyleSlider(options.color); - if (options.alignment == ComponentAlignment::Left) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::Text(label, *value); - } - } else if (options.alignment == ComponentAlignment::Right) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::NewLine(); - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); - ImGui::Text(label, *value); - } - } - if (options.showButtons) { - if (Button("-", { .color = options.color, .size = Sizes::Inline }) && *value > min) { - *value -= options.step; - if (*value < min) *value = min; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - ImGui::SameLine(0, 3.0f); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize("+").x + 20.0f + 3.0f)); - } else { - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - } - if (ImGui::SliderScalar(invisibleLabel, ImGuiDataType_S32, value, &min, &max, options.format, options.flags)) { - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - if (options.showButtons) { - ImGui::SameLine(0, 3.0f); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (Button("+", { .color = options.color, .size = Sizes::Inline }) && *value < max) { - *value += options.step; - if (*value > max) *value = max; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - } - PopStyleSlider(); - ImGui::EndDisabled(); - ImGui::EndGroup(); - if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.disabledTooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); - } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.tooltip)); - } - ImGui::PopID(); - return dirty; - } - - bool CVarSliderInt(const char* label, const char* cvarName, int32_t min, int32_t max, const int32_t defaultValue, const IntSliderOptions& options) { - bool dirty = false; - int32_t value = CVarGetInteger(cvarName, defaultValue); - if (SliderInt(label, &value, min, max, options)) { - CVarSetInteger(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - return dirty; - } - - bool SliderFloat(const char* label, float* value, float min, float max, const FloatSliderOptions& options) { - bool dirty = false; - std::string invisibleLabelStr = "##" + std::string(label); - const char* invisibleLabel = invisibleLabelStr.c_str(); - float valueToDisplay = options.isPercentage ? *value * 100.0f : *value; - float maxToDisplay = options.isPercentage ? max * 100.0f : max; - float minToDisplay = options.isPercentage ? min * 100.0f : min; - ImGui::PushID(label); - ImGui::BeginGroup(); - ImGui::BeginDisabled(options.disabled); - PushStyleSlider(options.color); - if (options.alignment == ComponentAlignment::Left) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::Text(label, valueToDisplay); - } - } else if (options.alignment == ComponentAlignment::Right) { - if (options.labelPosition == LabelPosition::Above) { - ImGui::NewLine(); - ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); - ImGui::Text(label, valueToDisplay); - } - } - if (options.showButtons) { - if (Button("-", { .color = options.color, .size = Sizes::Inline }) && *value > min) { - *value -= options.step; - if (*value < min) *value = min; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - ImGui::SameLine(0, 3.0f); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize("+").x + 20.0f + 3.0f)); - } else { - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - } - if (ImGui::SliderScalar(invisibleLabel, ImGuiDataType_Float, &valueToDisplay, &minToDisplay, &maxToDisplay, options.format, options.flags)) { - *value = options.isPercentage ? valueToDisplay / 100.0f : valueToDisplay; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - if (options.showButtons) { - ImGui::SameLine(0, 3.0f); - ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); - if (Button("+", { .color = options.color, .size = Sizes::Inline }) && *value < max) { - *value += options.step; - if (*value > max) *value = max; - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - } - PopStyleSlider(); - ImGui::EndDisabled(); - ImGui::EndGroup(); - if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.disabledTooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); - } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { - ImGui::SetTooltip("%s", WrappedText(options.tooltip)); - } - ImGui::PopID(); - return dirty; - } - - bool CVarSliderFloat(const char* label, const char* cvarName, float min, float max, const float defaultValue, const FloatSliderOptions& options) { - bool dirty = false; - float value = CVarGetFloat(cvarName, defaultValue); - if (SliderFloat(label, &value, min, max, options)) { - CVarSetFloat(cvarName, value); - Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); - dirty = true; - } - return dirty; + return strdup(newText.c_str()); +} + +char* WrappedText(const std::string& text, unsigned int charactersPerLine) { + return WrappedText(text.c_str(), charactersPerLine); +} + +void SetLastItemHoverText(const std::string& text) { + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("%s", WrappedText(text, 60)); + ImGui::EndTooltip(); } } + +void SetLastItemHoverText(const char* text) { + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("%s", WrappedText(text, 60)); + ImGui::EndTooltip(); + } +} + +// Adds a "?" next to the previous ImGui item with a custom tooltip +void InsertHelpHoverText(const std::string& text) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?"); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("%s", WrappedText(text, 60)); + ImGui::EndTooltip(); + } +} + +void InsertHelpHoverText(const char* text) { + ImGui::SameLine(); + ImGui::TextColored(ImVec4(0.7f, 0.7f, 0.7f, 1.0f), "?"); + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text("%s", WrappedText(text, 60)); + ImGui::EndTooltip(); + } +} + +// MARK: - UI Elements + +void Tooltip(const char* text) { + if (ImGui::IsItemHovered()) { + ImGui::SetTooltip("%s", WrappedText(text)); + } +} + +void Spacer(float height) { + ImGui::Dummy(ImVec2(0.0f, height)); +} + +void PaddedSeparator(bool padTop, bool padBottom, float extraVerticalTopPadding, float extraVerticalBottomPadding) { + if (padTop) { + Spacer(extraVerticalTopPadding); + } + ImGui::Separator(); + if (padBottom) { + Spacer(extraVerticalBottomPadding); + } +} + +void RenderCross(ImDrawList* draw_list, ImVec2 pos, ImU32 col, float sz) { + float thickness = ImMax(sz / 5.0f, 1.0f); + sz -= thickness * 0.5f; + pos += ImVec2(thickness * 0.25f, thickness * 0.25f); + + draw_list->PathLineTo(ImVec2(pos.x, pos.y)); + draw_list->PathLineTo(ImVec2(pos.x + sz, pos.y + sz)); + draw_list->PathStroke(col, 0, thickness); + + draw_list->PathLineTo(ImVec2(pos.x + sz, pos.y)); + draw_list->PathLineTo(ImVec2(pos.x, pos.y + sz)); + draw_list->PathStroke(col, 0, thickness); +} + +bool CustomCheckbox(const char* label, bool* v, bool disabled, CheckboxGraphics disabledGraphic) { + ImGuiWindow* window = ImGui::GetCurrentWindow(); + if (window->SkipItems) { + return false; + } + + ImGuiContext& g = *GImGui; + const ImGuiStyle& style = g.Style; + const ImGuiID id = window->GetID(label); + const ImVec2 label_size = ImGui::CalcTextSize(label, NULL, true); + + const float square_sz = ImGui::GetFrameHeight(); + const ImVec2 pos = window->DC.CursorPos; + const ImRect total_bb( + pos, pos + ImVec2(square_sz + (label_size.x > 0.0f ? style.ItemInnerSpacing.x + label_size.x : 0.0f), + label_size.y + style.FramePadding.y * 2.0f)); + ImGui::ItemSize(total_bb, style.FramePadding.y); + if (!ImGui::ItemAdd(total_bb, id)) { + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, + g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | + (*v ? ImGuiItemStatusFlags_Checked : 0)); + return false; + } + + bool hovered, held; + bool pressed = ImGui::ButtonBehavior(total_bb, id, &hovered, &held); + if (pressed) { + *v = !(*v); + ImGui::MarkItemEdited(id); + } + + const ImRect check_bb(pos, pos + ImVec2(square_sz, square_sz)); + ImGui::RenderNavHighlight(total_bb, id); + ImGui::RenderFrame(check_bb.Min, check_bb.Max, + ImGui::GetColorU32((held && hovered) ? ImGuiCol_FrameBgActive + : hovered ? ImGuiCol_FrameBgHovered + : ImGuiCol_FrameBg), + true, style.FrameRounding); + ImU32 check_col = ImGui::GetColorU32(ImGuiCol_CheckMark); + ImU32 cross_col = ImGui::GetColorU32(ImVec4(0.50f, 0.50f, 0.50f, 1.00f)); + bool mixed_value = (g.LastItemData.ItemFlags & ImGuiItemFlags_MixedValue) != 0; + if (mixed_value) { + // Undocumented tristate/mixed/indeterminate checkbox (#2644) + // This may seem awkwardly designed because the aim is to make ImGuiItemFlags_MixedValue supported by all + // widgets (not just checkbox) + ImVec2 pad(ImMax(1.0f, IM_FLOOR(square_sz / 3.6f)), ImMax(1.0f, IM_FLOOR(square_sz / 3.6f))); + window->DrawList->AddRectFilled(check_bb.Min + pad, check_bb.Max - pad, check_col, style.FrameRounding); + } else if ((!disabled && *v) || (disabled && disabledGraphic == CheckboxGraphics::Checkmark)) { + const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); + ImGui::RenderCheckMark(window->DrawList, check_bb.Min + ImVec2(pad, pad), check_col, square_sz - pad * 2.0f); + } else if (disabled && disabledGraphic == CheckboxGraphics::Cross) { + const float pad = ImMax(1.0f, IM_FLOOR(square_sz / 6.0f)); + RenderCross(window->DrawList, check_bb.Min + ImVec2(pad, pad), cross_col, square_sz - pad * 2.0f); + } + + ImVec2 label_pos = ImVec2(check_bb.Max.x + style.ItemInnerSpacing.x, check_bb.Min.y + style.FramePadding.y); + if (g.LogEnabled) { + ImGui::LogRenderedText(&label_pos, mixed_value ? "[~]" : *v ? "[x]" : "[ ]"); + } + if (label_size.x > 0.0f) { + ImGui::RenderText(label_pos, label); + } + + IMGUI_TEST_ENGINE_ITEM_INFO(id, label, + g.LastItemData.StatusFlags | ImGuiItemStatusFlags_Checkable | + (*v ? ImGuiItemStatusFlags_Checked : 0)); + return pressed; +} + +void ReEnableComponent(const char* disabledTooltipText) { + // End of disable region of previous component + ImGui::PopStyleVar(1); + if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(disabledTooltipText, "") != 0) { + ImGui::SetTooltip("%s", disabledTooltipText); + } + ImGui::PopItemFlag(); +} + +void DisableComponent(const float alpha) { + ImGui::PushItemFlag(ImGuiItemFlags_Disabled, true); + ImGui::PushStyleVar(ImGuiStyleVar_Alpha, alpha); +} + +bool EnhancementCheckbox(const char* text, const char* cvarName, bool disabled, const char* disabledTooltipText, + CheckboxGraphics disabledGraphic, bool defaultValue) { + bool changed = false; + if (disabled) { + DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + } + + bool val = (bool)CVarGetInteger(cvarName, defaultValue); + if (CustomCheckbox(text, &val, disabled, disabledGraphic)) { + CVarSetInteger(cvarName, val); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + changed = true; + } + + if (disabled) { + ReEnableComponent(disabledTooltipText); + } + return changed; +} + +bool PaddedEnhancementCheckbox(const char* text, const char* cvarName, bool padTop, bool padBottom, bool disabled, + const char* disabledTooltipText, CheckboxGraphics disabledGraphic, bool defaultValue) { + ImGui::BeginGroup(); + if (padTop) + Spacer(0); + + bool changed = EnhancementCheckbox(text, cvarName, disabled, disabledTooltipText, disabledGraphic, defaultValue); + + if (padBottom) + Spacer(0); + ImGui::EndGroup(); + return changed; +} + +bool EnhancementCombobox(const char* cvarName, std::span comboArray, + uint8_t defaultIndex, bool disabled, const char* disabledTooltipText, uint8_t disabledValue) { + bool changed = false; + if (defaultIndex <= 0) { + defaultIndex = 0; + } + + if (disabled) { + DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + } + + uint8_t selected = CVarGetInteger(cvarName, defaultIndex); + std::string comboName = std::string("##") + std::string(cvarName); + if (ImGui::BeginCombo(comboName.c_str(), comboArray[selected])) { + for (uint8_t i = 0; i < comboArray.size(); i++) { + if (strlen(comboArray[i]) > 1) { + if (ImGui::Selectable(comboArray[i], i == selected)) { + CVarSetInteger(cvarName, i); + selected = i; + changed = true; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + } + } + } + ImGui::EndCombo(); + } + + if (disabled) { + ReEnableComponent(disabledTooltipText); + + if (disabledValue >= 0 && selected != disabledValue) { + CVarSetInteger(cvarName, disabledValue); + changed = true; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + } + } + + return changed; +} + +bool LabeledRightAlignedEnhancementCombobox(const char* label, const char* cvarName, + std::span comboArray, + uint8_t defaultIndex, bool disabled, const char* disabledTooltipText, + uint8_t disabledValue) { + ImGui::Text(label); + s32 currentValue = CVarGetInteger(cvarName, defaultIndex); + +#ifdef __WIIU__ + ImGui::SameLine(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize(comboArray[currentValue]).x + 40.0f)); + ImGui::PushItemWidth(ImGui::CalcTextSize(comboArray[currentValue]).x + 60.0f); +#else + ImGui::SameLine(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize(comboArray[currentValue]).x + 20.0f)); + ImGui::PushItemWidth(ImGui::CalcTextSize(comboArray[currentValue]).x + 30.0f); +#endif + + bool changed = + EnhancementCombobox(cvarName, comboArray, defaultIndex, disabled, disabledTooltipText, disabledValue); + + ImGui::PopItemWidth(); + return changed; +} + +void PaddedText(const char* text, bool padTop, bool padBottom) { + if (padTop) + Spacer(0); + + ImGui::Text("%s", text); + + if (padBottom) + Spacer(0); +} + +bool EnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, const char* format, + int defaultValue, bool PlusMinusButton, bool disabled, const char* disabledTooltipText) { + bool changed = false; + int val = CVarGetInteger(cvarName, defaultValue); + + if (disabled) { + DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + } + + ImGui::Text(text, val); + Spacer(0); + + ImGui::BeginGroup(); + if (PlusMinusButton) { + std::string MinusBTNName = " - ##" + std::string(cvarName); + if (ImGui::Button(MinusBTNName.c_str())) { + val--; + changed = true; + } + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + } + + ImGui::PushItemWidth( + std::min((ImGui::GetContentRegionAvail().x - (PlusMinusButton ? sliderButtonWidth : 0.0f)), maxSliderWidth)); + if (ImGui::SliderInt(id, &val, min, max, format, ImGuiSliderFlags_AlwaysClamp)) { + changed = true; + } + ImGui::PopItemWidth(); + + if (PlusMinusButton) { + std::string PlusBTNName = " + ##" + std::string(cvarName); + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::Button(PlusBTNName.c_str())) { + val++; + changed = true; + } + } + ImGui::EndGroup(); + + if (disabled) { + ReEnableComponent(disabledTooltipText); + } + + if (val < min) { + val = min; + changed = true; + } + + if (val > max) { + val = max; + changed = true; + } + + if (changed) { + CVarSetInteger(cvarName, val); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + } + + return changed; +} + +bool EnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, + const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton, + bool disabled, const char* disabledTooltipText) { + bool changed = false; + float val = CVarGetFloat(cvarName, defaultValue); + + if (disabled) { + DisableComponent(ImGui::GetStyle().Alpha * 0.5f); + } + + if (!isPercentage) { + ImGui::Text(text, val); + } else { + ImGui::Text(text, static_cast(100 * val)); + } + Spacer(0); + + ImGui::BeginGroup(); + if (PlusMinusButton) { + std::string MinusBTNName = " - ##" + std::string(cvarName); + if (ImGui::Button(MinusBTNName.c_str())) { + if (isPercentage) { + val -= 0.01f; + } else { + val -= 0.1f; + } + changed = true; + } + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + } + + ImGui::PushItemWidth( + std::min((ImGui::GetContentRegionAvail().x - (PlusMinusButton ? sliderButtonWidth : 0.0f)), maxSliderWidth)); + if (ImGui::SliderFloat(id, &val, min, max, format, ImGuiSliderFlags_AlwaysClamp)) { + if (isPercentage) { + val = roundf(val * 100) / 100; + } + changed = true; + } + ImGui::PopItemWidth(); + + if (PlusMinusButton) { + std::string PlusBTNName = " + ##" + std::string(cvarName); + ImGui::SameLine(); + ImGui::SetCursorPosX(ImGui::GetCursorPosX() - 7.0f); + if (ImGui::Button(PlusBTNName.c_str())) { + if (isPercentage) { + val += 0.01f; + } else { + val += 0.1f; + } + changed = true; + } + } + ImGui::EndGroup(); + + if (disabled) { + ReEnableComponent(disabledTooltipText); + } + + if (val < min) { + val = min; + changed = true; + } + + if (val > max) { + val = max; + changed = true; + } + + if (changed) { + CVarSetFloat(cvarName, val); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + } + + return changed; +} + +bool PaddedEnhancementSliderInt(const char* text, const char* id, const char* cvarName, int min, int max, + const char* format, int defaultValue, bool PlusMinusButton, bool padTop, bool padBottom, + bool disabled, const char* disabledTooltipText) { + bool changed = false; + ImGui::BeginGroup(); + if (padTop) + Spacer(0); + + changed = EnhancementSliderInt(text, id, cvarName, min, max, format, defaultValue, PlusMinusButton, disabled, + disabledTooltipText); + + if (padBottom) + Spacer(0); + ImGui::EndGroup(); + return changed; +} + +bool PaddedEnhancementSliderFloat(const char* text, const char* id, const char* cvarName, float min, float max, + const char* format, float defaultValue, bool isPercentage, bool PlusMinusButton, + bool padTop, bool padBottom, bool disabled, const char* disabledTooltipText) { + bool changed = false; + ImGui::BeginGroup(); + if (padTop) + Spacer(0); + + changed = EnhancementSliderFloat(text, id, cvarName, min, max, format, defaultValue, isPercentage, PlusMinusButton, + disabled, disabledTooltipText); + + if (padBottom) + Spacer(0); + ImGui::EndGroup(); + return changed; +} + +bool EnhancementRadioButton(const char* text, const char* cvarName, int id) { + /*Usage : + EnhancementRadioButton("My Visible Name","gMyCVarName", MyID); + First arg is the visible name of the Radio button + Second is the cvar name where MyID will be saved. + Note: the CVar name should be the same to each Buddies. + Example : + EnhancementRadioButton("English", "gLanguages", LANGUAGE_ENG); + EnhancementRadioButton("German", "gLanguages", LANGUAGE_GER); + EnhancementRadioButton("French", "gLanguages", LANGUAGE_FRA); + */ + std::string make_invisible = "##" + std::string(text) + std::string(cvarName); + + bool ret = false; + int val = CVarGetInteger(cvarName, 0); + if (ImGui::RadioButton(make_invisible.c_str(), id == val)) { + CVarSetInteger(cvarName, id); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + ret = true; + } + ImGui::SameLine(); + ImGui::Text("%s", text); + + return ret; +} + +bool DrawResetColorButton(const char* cvarName, ImVec4* colors, ImVec4 defaultcolors, bool has_alpha) { + bool changed = false; + std::string Cvar_RBM = std::string(cvarName) + "RBM"; + std::string MakeInvisible = "Reset##" + std::string(cvarName) + "Reset"; + if (ImGui::Button(MakeInvisible.c_str())) { + colors->x = defaultcolors.x; + colors->y = defaultcolors.y; + colors->z = defaultcolors.z; + colors->w = has_alpha ? defaultcolors.w : 255.0f; + + Color_RGBA8 colorsRGBA; + colorsRGBA.r = defaultcolors.x; + colorsRGBA.g = defaultcolors.y; + colorsRGBA.b = defaultcolors.z; + colorsRGBA.a = has_alpha ? defaultcolors.w : 255.0f; + + CVarSetColor(cvarName, colorsRGBA); + CVarSetInteger(Cvar_RBM.c_str(), 0); // On click disable rainbow mode. + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + changed = true; + } + Tooltip("Revert colors to the game's original colors (GameCube version)\nOverwrites previously chosen color"); + return changed; +} + +void DrawLockColorCheckbox(const char* cvarName) { + std::string Cvar_Lock = std::string(cvarName) + "Lock"; + s32 lock = CVarGetInteger(Cvar_Lock.c_str(), 0); + std::string FullName = "Lock##" + Cvar_Lock; + EnhancementCheckbox(FullName.c_str(), Cvar_Lock.c_str()); + Tooltip("Prevents this color from being changed upon selecting \"Randomize all\""); +} + +void RainbowColor(const char* cvarName, ImVec4* colors) { + std::string Cvar_RBM = std::string(cvarName) + "RBM"; + std::string MakeInvisible = "Rainbow##" + std::string(cvarName) + "Rainbow"; + + EnhancementCheckbox(MakeInvisible.c_str(), Cvar_RBM.c_str()); + Tooltip("Cycles through colors on a timer\nOverwrites previously chosen color"); +} + +void LoadPickersColors(ImVec4& ColorArray, const char* cvarname, const ImVec4& default_colors, bool has_alpha) { + Color_RGBA8 defaultColors; + defaultColors.r = default_colors.x; + defaultColors.g = default_colors.y; + defaultColors.b = default_colors.z; + defaultColors.a = default_colors.w; + + Color_RGBA8 cvarColor = CVarGetColor(cvarname, defaultColors); + + ColorArray.x = cvarColor.r / 255.0; + ColorArray.y = cvarColor.g / 255.0; + ColorArray.z = cvarColor.b / 255.0; + ColorArray.w = cvarColor.a / 255.0; +} + +void DrawFlagArray32(const std::string& name, uint32_t& flags) { + ImGui::PushID(name.c_str()); + for (int32_t flagIndex = 0; flagIndex < 32; flagIndex++) { + if ((flagIndex % 8) != 0) { + ImGui::SameLine(); + } + ImGui::PushID(flagIndex); + uint32_t bitMask = 1 << flagIndex; + bool flag = (flags & bitMask) != 0; + if (ImGui::Checkbox("##check", &flag)) { + if (flag) { + flags |= bitMask; + } else { + flags &= ~bitMask; + } + } + ImGui::PopID(); + } + ImGui::PopID(); +} + +void DrawFlagArray16(const std::string& name, uint16_t& flags) { + ImGui::PushID(name.c_str()); + for (int16_t flagIndex = 0; flagIndex < 16; flagIndex++) { + if ((flagIndex % 8) != 0) { + ImGui::SameLine(); + } + ImGui::PushID(flagIndex); + uint16_t bitMask = 1 << flagIndex; + bool flag = (flags & bitMask) != 0; + if (ImGui::Checkbox("##check", &flag)) { + if (flag) { + flags |= bitMask; + } else { + flags &= ~bitMask; + } + } + ImGui::PopID(); + } + ImGui::PopID(); +} + +void DrawFlagArray8(const std::string& name, uint8_t& flags) { + ImGui::PushID(name.c_str()); + for (int8_t flagIndex = 0; flagIndex < 8; flagIndex++) { + if ((flagIndex % 8) != 0) { + ImGui::SameLine(); + } + ImGui::PushID(flagIndex); + uint8_t bitMask = 1 << flagIndex; + bool flag = (flags & bitMask) != 0; + if (ImGui::Checkbox("##check", &flag)) { + if (flag) { + flags |= bitMask; + } else { + flags &= ~bitMask; + } + } + ImGui::PopID(); + } + ImGui::PopID(); +} + +// V2 + +void PushStyleMenu(const ImVec4& color) { + ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(color.x, color.y, color.z, 0.5f)); + ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_PopupBg, UIWidgets::Colors::DarkGray); + ImGui::PushStyleColor(ImGuiCol_Border, UIWidgets::Colors::DarkGray); + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(8.0f, 15.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, 3.0f); +} + +void PopStyleMenu() { + ImGui::PopStyleVar(2); + ImGui::PopStyleColor(4); +} + +bool BeginMenu(const char* label, const ImVec4& color) { + bool dirty = false; + PushStyleMenu(color); + if (ImGui::BeginMenu(label)) { + dirty = true; + } + PopStyleMenu(); + return dirty; +} + +void PushStyleMenuItem(const ImVec4& color) { + ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(20.0f, 15.0f)); +} + +void PopStyleMenuItem() { + ImGui::PopStyleVar(1); + ImGui::PopStyleColor(1); +} + +bool MenuItem(const char* label, const char* shortcut, const ImVec4& color) { + bool dirty = false; + PushStyleMenuItem(color); + if (ImGui::MenuItem(label, shortcut)) { + dirty = true; + } + PopStyleMenuItem(); + return dirty; +} + +void PushStyleButton(const ImVec4& color) { + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(color.x, color.y, color.z, 0.8f)); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(color.x, color.y, color.z, 0.6f)); + ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 8.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f); +} + +void PopStyleButton() { + ImGui::PopStyleVar(3); + ImGui::PopStyleColor(4); +} + +bool Button(const char* label, const ButtonOptions& options) { + ImGui::BeginDisabled(options.disabled); + PushStyleButton(options.color); + bool dirty = ImGui::Button(label, options.size); + PopStyleButton(); + ImGui::EndDisabled(); + if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && + strcmp(options.disabledTooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); + } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.tooltip)); + } + return dirty; +} + +bool WindowButton(const char* label, const char* cvarName, std::shared_ptr windowPtr, + const ButtonOptions& options) { + ImGui::PushStyleVar(ImGuiStyleVar_ButtonTextAlign, ImVec2(0, 0)); + std::string buttonText = label; + bool dirty = false; + if (CVarGetInteger(cvarName, 0)) { + buttonText = ICON_FA_WINDOW_CLOSE " " + buttonText; + } else { + buttonText = ICON_FA_EXTERNAL_LINK_SQUARE " " + buttonText; + } + if (Button(buttonText.c_str(), options)) { + windowPtr->ToggleVisibility(); + dirty = true; + } + ImGui::PopStyleVar(); + return dirty; +} + +void PushStyleCheckbox(const ImVec4& color) { + ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.8f)); + ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f)); + ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.0f, 0.0f, 0.0f, 0.3f)); + ImGui::PushStyleColor(ImGuiCol_CheckMark, ImVec4(1.0f, 1.0f, 1.0f, 0.7f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 6.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 5.0f); +} + +void PopStyleCheckbox() { + ImGui::PopStyleVar(3); + ImGui::PopStyleColor(5); +} + +bool Checkbox(const char* label, bool* value, const CheckboxOptions& options) { + ImGui::PushID(label); + bool dirty = false; + float startX = ImGui::GetCursorPosX(); + std::string invisibleLabelStr = "##" + std::string(label); + const char* invisibleLabel = invisibleLabelStr.c_str(); + ImGui::BeginDisabled(options.disabled); + PushStyleCheckbox(options.color); + if (options.alignment == ComponentAlignment::Right) { + if (options.labelPosition == LabelPosition::Near || options.labelPosition == LabelPosition::Far || + options.labelPosition == LabelPosition::None) { + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::GetStyle().FramePadding.x * 2 - + ImGui::GetStyle().ItemSpacing.x); + } else if (options.labelPosition == LabelPosition::Above) { + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); + ImGui::Text(label); + ImGui::NewLine(); + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::GetStyle().FramePadding.x * 2 - + ImGui::GetStyle().ItemSpacing.x); + } + } else if (options.alignment == ComponentAlignment::Left) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::Text(label); + } + } + dirty = ImGui::Checkbox(invisibleLabel, value); + if (options.alignment == ComponentAlignment::Right) { + if (options.labelPosition == LabelPosition::Near) { + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x - + ImGui::GetStyle().FramePadding.x * 2 - ImGui::GetStyle().ItemSpacing.x * 2); + ImGui::Text(label); + } else if (options.labelPosition == LabelPosition::Far) { + ImGui::SameLine(); + ImGui::SetCursorPosX(startX); + ImGui::Text(label); + } + } else if (options.alignment == ComponentAlignment::Left) { + if (options.labelPosition == LabelPosition::Near) { + ImGui::SameLine(); + ImGui::Text(label); + } else if (options.labelPosition == LabelPosition::Far) { + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); + ImGui::Text(label); + } + } + PopStyleCheckbox(); + ImGui::EndDisabled(); + if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && + strcmp(options.disabledTooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); + } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.tooltip)); + } + ImGui::PopID(); + return dirty; +} + +bool CVarCheckbox(const char* label, const char* cvarName, const CheckboxOptions& options) { + bool dirty = false; + bool value = (bool)CVarGetInteger(cvarName, options.defaultValue); + if (Checkbox(label, &value, options)) { + CVarSetInteger(cvarName, value); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + return dirty; +} + +void PushStyleCombobox(const ImVec4& color) { + ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 0.8f)); + ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 0.6f)); + ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 0.6f)); + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_ButtonHovered, ImVec4(color.x, color.y, color.z, 0.8f)); + ImGui::PushStyleColor(ImGuiCol_ButtonActive, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(color.x, color.y, color.z, 0.5f)); + ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(color.x, color.y, color.z, 0.6f)); + ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(color.x, color.y, color.z, 0.6f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); + ImGui::PushStyleVar(ImGuiStyleVar_PopupRounding, 3.0f); + ImGui::PushStyleVar(ImGuiStyleVar_PopupBorderSize, 0.0f); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 6.0f)); +} + +void PopStyleCombobox() { + ImGui::PopStyleVar(4); + ImGui::PopStyleColor(9); +} + +bool Combobox(const char* label, uint8_t* value, std::span comboArray, + const ComboboxOptions& options) { + bool dirty = false; + float startX = ImGui::GetCursorPosX(); + std::string invisibleLabelStr = "##" + std::string(label); + const char* invisibleLabel = invisibleLabelStr.c_str(); + ImGui::PushID(label); + ImGui::BeginGroup(); + ImGui::BeginDisabled(options.disabled); + PushStyleCombobox(options.color); + if (options.alignment == ComponentAlignment::Left) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::Text(label); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + } else if (options.labelPosition == LabelPosition::Near) { + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x - + ImGui::GetStyle().ItemSpacing.x * 2); + } else if (options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { + ImGui::SetNextItemWidth(ImGui::CalcTextSize(comboArray[*value]).x + ImGui::GetStyle().FramePadding.x * 4 + + ImGui::GetStyle().ItemSpacing.x); + } + } else if (options.alignment == ComponentAlignment::Right) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::NewLine(); + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); + ImGui::Text(label); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + } else if (options.labelPosition == LabelPosition::Near) { + ImGui::SameLine(ImGui::CalcTextSize(label).x + ImGui::GetStyle().ItemSpacing.x * 2); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + } else if (options.labelPosition == LabelPosition::Far || options.labelPosition == LabelPosition::None) { + float width = ImGui::CalcTextSize(comboArray[*value]).x + ImGui::GetStyle().FramePadding.x * 4; + ImGui::SameLine(ImGui::GetContentRegionAvail().x - width); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + } + } + if (ImGui::BeginCombo(invisibleLabel, comboArray[*value], options.flags)) { + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(10.0f, 10.0f)); + for (uint8_t i = 0; i < comboArray.size(); i++) { + if (strlen(comboArray[i]) > 1) { + if (ImGui::Selectable(comboArray[i], i == *value)) { + *value = i; + dirty = true; + } + } + } + ImGui::PopStyleVar(); + ImGui::EndCombo(); + } + if (options.alignment == ComponentAlignment::Left) { + if (options.labelPosition == LabelPosition::Near) { + ImGui::SameLine(); + ImGui::Text(label); + } else if (options.labelPosition == LabelPosition::Far) { + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); + ImGui::Text(label); + } + } else if (options.alignment == ComponentAlignment::Right) { + if (options.labelPosition == LabelPosition::Near || options.labelPosition == LabelPosition::Far) { + ImGui::SameLine(startX); + ImGui::Text(label); + } + } + PopStyleCombobox(); + ImGui::EndDisabled(); + ImGui::EndGroup(); + if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && + strcmp(options.disabledTooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); + } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.tooltip)); + } + ImGui::PopID(); + return dirty; +} + +bool CVarCombobox(const char* label, const char* cvarName, std::span comboArray, + const ComboboxOptions& options) { + bool dirty = false; + uint8_t value = (uint8_t)CVarGetInteger(cvarName, options.defaultIndex); + if (Combobox(label, &value, comboArray, options)) { + CVarSetInteger(cvarName, value); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + return dirty; +} + +void PushStyleSlider(const ImVec4& color) { + ImGui::PushStyleColor(ImGuiCol_FrameBg, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_FrameBgHovered, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_FrameBgActive, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(color.x, color.y, color.z, 1.0f)); + ImGui::PushStyleColor(ImGuiCol_SliderGrab, ImVec4(1.0, 1.0, 1.0, 0.4f)); + ImGui::PushStyleColor(ImGuiCol_SliderGrabActive, ImVec4(1.0, 1.0, 1.0, 0.5f)); + ImGui::PushStyleVar(ImGuiStyleVar_GrabRounding, 3.0f); + ImGui::PushStyleVar(ImGuiStyleVar_FrameRounding, 3.0f); + ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(10.0f, 8.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 0.0f); +} + +void PopStyleSlider() { + ImGui::PopStyleVar(4); + ImGui::PopStyleColor(6); +} + +bool SliderInt(const char* label, int32_t* value, int32_t min, int32_t max, const IntSliderOptions& options) { + bool dirty = false; + std::string invisibleLabelStr = "##" + std::string(label); + const char* invisibleLabel = invisibleLabelStr.c_str(); + ImGui::PushID(label); + ImGui::BeginGroup(); + ImGui::BeginDisabled(options.disabled); + PushStyleSlider(options.color); + if (options.alignment == ComponentAlignment::Left) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::Text(label, *value); + } + } else if (options.alignment == ComponentAlignment::Right) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::NewLine(); + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); + ImGui::Text(label, *value); + } + } + if (options.showButtons) { + if (Button("-", { .color = options.color, .size = Sizes::Inline }) && *value > min) { + *value -= options.step; + if (*value < min) + *value = min; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + ImGui::SameLine(0, 3.0f); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize("+").x + 20.0f + 3.0f)); + } else { + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + } + if (ImGui::SliderScalar(invisibleLabel, ImGuiDataType_S32, value, &min, &max, options.format, options.flags)) { + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + if (options.showButtons) { + ImGui::SameLine(0, 3.0f); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + if (Button("+", { .color = options.color, .size = Sizes::Inline }) && *value < max) { + *value += options.step; + if (*value > max) + *value = max; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + } + PopStyleSlider(); + ImGui::EndDisabled(); + ImGui::EndGroup(); + if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && + strcmp(options.disabledTooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); + } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.tooltip)); + } + ImGui::PopID(); + return dirty; +} + +bool CVarSliderInt(const char* label, const char* cvarName, int32_t min, int32_t max, const int32_t defaultValue, + const IntSliderOptions& options) { + bool dirty = false; + int32_t value = CVarGetInteger(cvarName, defaultValue); + if (SliderInt(label, &value, min, max, options)) { + CVarSetInteger(cvarName, value); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + return dirty; +} + +bool SliderFloat(const char* label, float* value, float min, float max, const FloatSliderOptions& options) { + bool dirty = false; + std::string invisibleLabelStr = "##" + std::string(label); + const char* invisibleLabel = invisibleLabelStr.c_str(); + float valueToDisplay = options.isPercentage ? *value * 100.0f : *value; + float maxToDisplay = options.isPercentage ? max * 100.0f : max; + float minToDisplay = options.isPercentage ? min * 100.0f : min; + ImGui::PushID(label); + ImGui::BeginGroup(); + ImGui::BeginDisabled(options.disabled); + PushStyleSlider(options.color); + if (options.alignment == ComponentAlignment::Left) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::Text(label, valueToDisplay); + } + } else if (options.alignment == ComponentAlignment::Right) { + if (options.labelPosition == LabelPosition::Above) { + ImGui::NewLine(); + ImGui::SameLine(ImGui::GetContentRegionAvail().x - ImGui::CalcTextSize(label).x); + ImGui::Text(label, valueToDisplay); + } + } + if (options.showButtons) { + if (Button("-", { .color = options.color, .size = Sizes::Inline }) && *value > min) { + *value -= options.step; + if (*value < min) + *value = min; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + ImGui::SameLine(0, 3.0f); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x - (ImGui::CalcTextSize("+").x + 20.0f + 3.0f)); + } else { + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + } + if (ImGui::SliderScalar(invisibleLabel, ImGuiDataType_Float, &valueToDisplay, &minToDisplay, &maxToDisplay, + options.format, options.flags)) { + *value = options.isPercentage ? valueToDisplay / 100.0f : valueToDisplay; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + if (options.showButtons) { + ImGui::SameLine(0, 3.0f); + ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x); + if (Button("+", { .color = options.color, .size = Sizes::Inline }) && *value < max) { + *value += options.step; + if (*value > max) + *value = max; + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + } + PopStyleSlider(); + ImGui::EndDisabled(); + ImGui::EndGroup(); + if (options.disabled && ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && + strcmp(options.disabledTooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.disabledTooltip)); + } else if (ImGui::IsItemHovered(ImGuiHoveredFlags_AllowWhenDisabled) && strcmp(options.tooltip, "") != 0) { + ImGui::SetTooltip("%s", WrappedText(options.tooltip)); + } + ImGui::PopID(); + return dirty; +} + +bool CVarSliderFloat(const char* label, const char* cvarName, float min, float max, const float defaultValue, + const FloatSliderOptions& options) { + bool dirty = false; + float value = CVarGetFloat(cvarName, defaultValue); + if (SliderFloat(label, &value, min, max, options)) { + CVarSetFloat(cvarName, value); + Ship::Context::GetInstance()->GetWindow()->GetGui()->SaveConsoleVariablesNextFrame(); + dirty = true; + } + return dirty; +} +} // namespace UIWidgets