diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..03468a05c --- /dev/null +++ b/.gitignore @@ -0,0 +1,403 @@ +# Cache files +__pycache__/ +.pyc +.DS_Store + +# Text editor remnants +.vscode/ +.vs/ +.idea/ +CMakeLists.txt +cmake-build-debug +venv/ + +# Project-specific ignores +build/ +expected/ +notes/ +baserom/ +docs/doxygen/ +*.elf +*.sra +*.z64 +*.n64 +*.v64 +*.map +*.dump +out.txt + +# Tool artifacts +tools/mipspro7.2_compiler/ +tools/overlayhelpers/batchdisasm/output/* +tools/overlayhelpers/batchdisasm/output2/* +tools/overlayhelpers/batchdisasm/mipsdisasm/* +tools/disasm/output/* +tools/asmsplitter/asm/* +tools/asmsplitter/c/* +ctx.c +tools/*dSYM/ +graphs/ + +# Assets +*.png +*.jpg +*.mdli +*.anmi +*.obj +*.mtl +*.fbx +!*_custom* +.extracted-assets.json + +# Docs +!docs/tutorial/ + +# Per-user configuration +.python-version + + +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ +**/Properties/launchSettings.json + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +*.out +*.o +*.d +lib/libgfxd/libgfxd.a +ExporterTest/ExporterTest.a +ZAPDUtils/ZAPDUtils.a +.vscode/ +build/ +external/ +ZAPDUtils/build/ +ZAPD/BuildInfo.h + +DebugObj/* +ReleaseObj/* \ No newline at end of file diff --git a/BUILDING.md b/BUILDING.md new file mode 100644 index 000000000..3e4d7b21a --- /dev/null +++ b/BUILDING.md @@ -0,0 +1,66 @@ +# Building Ship of Harkinian + +## Windows + + 1. Install [Python](https://www.python.org/downloads/) >= 3.6. + 2. Install [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/vs/community/) + 3. In the Visual Studio Installer, install `MSVC v142 - VS 2019 C++`. + 4. Clone the Ship of Harkinian repository. + 5. Place one or more [compatible](#compatible-roms) roms in the `OTRExporter` directory with namings of your choice. + 6. Run `OTRExporter/OTRExporter.sln`. + 7. Switch the solution to `Release x64`. + 8. Build the solution. + 9. Launching `OTRExporter/extract_assets.py` will generate an `oot.otr` archive file in `OTRExporter/oot.otr`. + 10. Run `soh/soh.sln` + 11. Switch the solution to `Release x86`. + 12. Build the solution. + 13. Copy the `OTRExporter/oot.otr` archive file to `soh/Release`. + 14. Launch `soh.exe`. + +## Linux + +```bash +# Clone the repo +git clone git@github.com:HarbourMasters/ShipWright.git +cd ShipWright +# Copy the baserom to the OTRExporter folder +cp OTRExporter +# Build the docker image +sudo docker build . -t soh +# Run the docker image with the working directory mounted to /soh +sudo docker run --rm -it -v $(pwd):/soh soh /bin/bash +``` +Inside the Docker container: +```bash +# Clone and build StormLib +git clone https://github.com/ladislav-zezula/StormLib external/StormLib +cmake -B external/StormLib/build -S external/StormLib +cmake --build external/StormLib/build +cp external/StormLib/build/libstorm.a external +cp /usr/local/lib/libGLEW.a external + +cd soh +# Extract the assets/Compile the exporter/Run the exporter +make setup -j$(nproc) OPTFLAGS=-O0 DEBUG=0 +# Compile the code +make -j $(nproc) OPTFLAGS=-O0 DEBUG=0 +``` + +# Compatible Roms +``` +OOT_PAL_GC checksum 0x09465AC3 +OOT_PAL_GC_DBG1 checksum 0x871E1C92 (debug non-master quest) +``` + +# OTRExporter Usage + +The OTRExporter exports an `oot.otr` archive file which Ship of Harkinian requires to play. + +Use the `extract_assets.py` script file to run the exporter using any of the following methods: + +1. Double click on the script after placing one or more roms in the directory. +2. Drag & Drop a rom onto the script. +3. In a terminal run `python3 extract_assets.py` after placing one or more roms in the directory. +4. In a terminal run `python3 extract_assets.py ` + +If the script finds multiple roms the user is prompted which to use. Selection is done using the number keys and then pressing the carriage return key. \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..e981cf573 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ + + +FROM ubuntu:21.04 as build + +ENV LANG C.UTF-8 +ARG DEBIAN_FRONTEND=noninteractive + +RUN dpkg --add-architecture i386 && \ + apt-get update && \ + apt-get upgrade -y && \ + apt-get install -y \ + binutils:i386 \ + gcc-10:i386 \ + g++-10:i386 \ + python3.10 \ + python \ + make \ + cmake \ + git \ + lld \ + libsdl2-dev:i386 \ + zlib1g-dev:i386 \ + libbz2-dev:i386 \ + libpng-dev:i386 \ + libgles2-mesa-dev && \ + ln -sf /usr/bin/python3.10 /usr/bin/python3 && \ + ln -s /usr/bin/gcc-10 /usr/bin/gcc && \ + ln -s /usr/bin/gcc-10 /usr/bin/cc && \ + ln -s /usr/bin/g++-10 /usr/bin/g++ && \ + ln -s /usr/bin/g++-10 /usr/bin/c++ + +RUN git clone https://github.com/Perlmint/glew-cmake.git && \ + cmake glew-cmake && \ + make -j$(nproc) && \ + make install ARCH64=false + +RUN mkdir /soh +WORKDIR /soh diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..7f1132bae --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,117 @@ +pipeline { + agent none + + options { + timestamps() + skipDefaultCheckout(true) + } + + stages { + stage ('Build Windows') { + environment { + MSBUILD='C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\Msbuild\\Current\\Bin\\msbuild.exe' + CONFIG='Release' + OTRPLATFORM='x64' + PLATFORM='x86' + ZIP='C:\\Program Files\\7-Zip\\7z.exe' + PYTHON='C:\\Users\\jenkins\\AppData\\Local\\Programs\\Python\\Python310\\python.exe' + CMAKE='C:\\Program Files\\CMake\\bin\\cmake.exe' + TOOLSET='v142' + } + agent { + label "SoH-Builders" + } + steps { + checkout([ + $class: 'GitSCM', + branches: scm.branches, + doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, + extensions: scm.extensions, + userRemoteConfigs: scm.userRemoteConfigs + ]) + + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + bat """ + + "${env.MSBUILD}" ".\\OTRExporter\\OTRExporter.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.OTRPLATFORM};PlatformToolset=${env.TOOLSET};RestorePackagesConfig=true /restore /nodeReuse:false /m + + xcopy "..\\..\\ZELOOTD.z64" "OTRExporter\\" + + cd "OTRExporter" + "${env.PYTHON}" ".\\extract_assets.py" + cd "..\\" + + "${env.MSBUILD}" ".\\soh\\soh.sln" -t:build -p:Configuration=${env.CONFIG};Platform=${env.PLATFORM};PlatformToolset=${env.TOOLSET} /nodeReuse:false /m + + cd OTRGui + mkdir build + cd build + + "${env.CMAKE}" .. + "${env.CMAKE}" --build . --config Release + + cd "..\\..\\" + + move "soh\\Release\\soh.exe" ".\\" + move "OTRGui\\build\\assets" ".\\" + move ".\\OTRExporter\\x64\\Release\\ZAPD.exe" ".\\assets\\extractor\\" + move ".\\OTRGui\\build\\Release\\OTRGui.exe" ".\\" + rename README.md readme.txt + + "${env.ZIP}" a soh.7z soh.exe OTRGui.exe assets readme.txt + + """ + archiveArtifacts artifacts: 'soh.7z', followSymlinks: false, onlyIfSuccessful: true + } + } + post { + always { + step([$class: 'WsCleanup']) // Clean workspace + } + } + } + stage ('Build Linux') { + agent { + label "SoH-Linux-Builders" + } + steps { + checkout([ + $class: 'GitSCM', + branches: scm.branches, + doGenerateSubmoduleConfigurations: scm.doGenerateSubmoduleConfigurations, + extensions: scm.extensions, + userRemoteConfigs: scm.userRemoteConfigs + ]) + catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { + sh ''' + + cp ../../ZELOOTD.z64 OTRExporter/baserom_non_mq.z64 + docker build . -t soh + docker run --name sohcont -dit --rm -v $(pwd):/soh soh /bin/bash + cp ../../buildsoh.bash soh + docker exec sohcont soh/buildsoh.bash + + mkdir build + mv soh/soh.elf build/ + mv OTRGui/build/OTRGui build/ + mv OTRGui/build/assets build/ + mv ZAPDTR/ZAPD.out build/assets/extractor/ + mv README.md build/readme.txt + cd build + + 7z a soh-linux.7z soh.elf OTRGui assets readme.txt + mv soh-linux.7z ../ + + ''' + } + sh 'sudo docker container stop sohcont' + archiveArtifacts artifacts: 'soh-linux.7z', followSymlinks: false, onlyIfSuccessful: true + } + post { + always { + step([$class: 'WsCleanup']) // Clean workspace + } + } + } + } +} diff --git a/OTRExporter/.gitignore b/OTRExporter/.gitignore index 2372a0cba..005fe6b8c 100644 --- a/OTRExporter/.gitignore +++ b/OTRExporter/.gitignore @@ -345,6 +345,8 @@ baserom/ *.otr *.swp *.a +*.z64 +*.n64 Extract/ tmp.txt diff --git a/OTRExporter/CFG/Config.xml b/OTRExporter/CFG/Config.xml index d9c3782e1..adec174ca 100644 --- a/OTRExporter/CFG/Config.xml +++ b/OTRExporter/CFG/Config.xml @@ -2,7 +2,7 @@ - + diff --git a/OTRExporter/CFG/filelists/dbg.txt b/OTRExporter/CFG/filelists/dbg.txt new file mode 100644 index 000000000..68af5e557 --- /dev/null +++ b/OTRExporter/CFG/filelists/dbg.txt @@ -0,0 +1,1532 @@ +makerom +boot +dmadata +Audiobank +Audioseq +Audiotable +link_animetion +icon_item_static +icon_item_24_static +icon_item_field_static +icon_item_dungeon_static +icon_item_gameover_static +icon_item_nes_static +icon_item_ger_static +icon_item_fra_static +item_name_static +map_name_static +do_action_static +message_static +message_texture_static +nes_font_static +nes_message_data_static +ger_message_data_static +fra_message_data_static +staff_message_data_static +map_grand_static +map_i_static +map_48x85_static +code +ovl_title +ovl_select +ovl_opening +ovl_file_choose +ovl_kaleido_scope +ovl_player_actor +ovl_map_mark_data +ovl_En_Test +ovl_Arms_Hook +ovl_Arrow_Fire +ovl_Arrow_Ice +ovl_Arrow_Light +ovl_Bg_Bdan_Objects +ovl_Bg_Bdan_Switch +ovl_Bg_Bom_Guard +ovl_Bg_Bombwall +ovl_Bg_Bowl_Wall +ovl_Bg_Breakwall +ovl_Bg_Ddan_Jd +ovl_Bg_Ddan_Kd +ovl_Bg_Dodoago +ovl_Bg_Dy_Yoseizo +ovl_Bg_Ganon_Otyuka +ovl_Bg_Gate_Shutter +ovl_Bg_Gjyo_Bridge +ovl_Bg_Gnd_Darkmeiro +ovl_Bg_Gnd_Firemeiro +ovl_Bg_Gnd_Iceblock +ovl_Bg_Gnd_Nisekabe +ovl_Bg_Gnd_Soulmeiro +ovl_Bg_Haka +ovl_Bg_Haka_Gate +ovl_Bg_Haka_Huta +ovl_Bg_Haka_Megane +ovl_Bg_Haka_MeganeBG +ovl_Bg_Haka_Sgami +ovl_Bg_Haka_Ship +ovl_Bg_Haka_Trap +ovl_Bg_Haka_Tubo +ovl_Bg_Haka_Water +ovl_Bg_Haka_Zou +ovl_Bg_Heavy_Block +ovl_Bg_Hidan_Curtain +ovl_Bg_Hidan_Dalm +ovl_Bg_Hidan_Firewall +ovl_Bg_Hidan_Fslift +ovl_Bg_Hidan_Fwbig +ovl_Bg_Hidan_Hamstep +ovl_Bg_Hidan_Hrock +ovl_Bg_Hidan_Kousi +ovl_Bg_Hidan_Kowarerukabe +ovl_Bg_Hidan_Rock +ovl_Bg_Hidan_Rsekizou +ovl_Bg_Hidan_Sekizou +ovl_Bg_Hidan_Sima +ovl_Bg_Hidan_Syoku +ovl_Bg_Ice_Objects +ovl_Bg_Ice_Shelter +ovl_Bg_Ice_Shutter +ovl_Bg_Ice_Turara +ovl_Bg_Ingate +ovl_Bg_Jya_1flift +ovl_Bg_Jya_Amishutter +ovl_Bg_Jya_Bigmirror +ovl_Bg_Jya_Block +ovl_Bg_Jya_Bombchuiwa +ovl_Bg_Jya_Bombiwa +ovl_Bg_Jya_Cobra +ovl_Bg_Jya_Goroiwa +ovl_Bg_Jya_Haheniron +ovl_Bg_Jya_Ironobj +ovl_Bg_Jya_Kanaami +ovl_Bg_Jya_Lift +ovl_Bg_Jya_Megami +ovl_Bg_Jya_Zurerukabe +ovl_Bg_Menkuri_Eye +ovl_Bg_Menkuri_Kaiten +ovl_Bg_Menkuri_Nisekabe +ovl_Bg_Mizu_Bwall +ovl_Bg_Mizu_Movebg +ovl_Bg_Mizu_Shutter +ovl_Bg_Mizu_Uzu +ovl_Bg_Mizu_Water +ovl_Bg_Mjin +ovl_Bg_Mori_Bigst +ovl_Bg_Mori_Elevator +ovl_Bg_Mori_Hashigo +ovl_Bg_Mori_Hashira4 +ovl_Bg_Mori_Hineri +ovl_Bg_Mori_Idomizu +ovl_Bg_Mori_Kaitenkabe +ovl_Bg_Mori_Rakkatenjo +ovl_Bg_Po_Event +ovl_Bg_Po_Syokudai +ovl_Bg_Pushbox +ovl_Bg_Relay_Objects +ovl_Bg_Spot00_Break +ovl_Bg_Spot00_Hanebasi +ovl_Bg_Spot01_Fusya +ovl_Bg_Spot01_Idohashira +ovl_Bg_Spot01_Idomizu +ovl_Bg_Spot01_Idosoko +ovl_Bg_Spot01_Objects2 +ovl_Bg_Spot02_Objects +ovl_Bg_Spot03_Taki +ovl_Bg_Spot05_Soko +ovl_Bg_Spot06_Objects +ovl_Bg_Spot07_Taki +ovl_Bg_Spot08_Bakudankabe +ovl_Bg_Spot08_Iceblock +ovl_Bg_Spot09_Obj +ovl_Bg_Spot11_Bakudankabe +ovl_Bg_Spot11_Oasis +ovl_Bg_Spot12_Gate +ovl_Bg_Spot12_Saku +ovl_Bg_Spot15_Rrbox +ovl_Bg_Spot15_Saku +ovl_Bg_Spot16_Bombstone +ovl_Bg_Spot16_Doughnut +ovl_Bg_Spot17_Bakudankabe +ovl_Bg_Spot17_Funen +ovl_Bg_Spot18_Basket +ovl_Bg_Spot18_Futa +ovl_Bg_Spot18_Obj +ovl_Bg_Spot18_Shutter +ovl_Bg_Sst_Floor +ovl_Bg_Toki_Hikari +ovl_Bg_Toki_Swd +ovl_Bg_Treemouth +ovl_Bg_Umajump +ovl_Bg_Vb_Sima +ovl_Bg_Ydan_Hasi +ovl_Bg_Ydan_Maruta +ovl_Bg_Ydan_Sp +ovl_Bg_Zg +ovl_Boss_Dodongo +ovl_Boss_Fd +ovl_Boss_Fd2 +ovl_Boss_Ganon +ovl_Boss_Ganon2 +ovl_Boss_Ganondrof +ovl_Boss_Goma +ovl_Boss_Mo +ovl_Boss_Sst +ovl_Boss_Tw +ovl_Boss_Va +ovl_Demo_6K +ovl_Demo_Du +ovl_Demo_Ec +ovl_Demo_Effect +ovl_Demo_Ext +ovl_Demo_Geff +ovl_Demo_Gj +ovl_Demo_Go +ovl_Demo_Gt +ovl_Demo_Ik +ovl_Demo_Im +ovl_Demo_Kankyo +ovl_Demo_Kekkai +ovl_Demo_Sa +ovl_Demo_Shd +ovl_Demo_Tre_Lgt +ovl_Door_Ana +ovl_Door_Gerudo +ovl_Door_Killer +ovl_Door_Shutter +ovl_Door_Toki +ovl_Door_Warp1 +ovl_Efc_Erupc +ovl_Eff_Dust +ovl_Effect_Ss_Blast +ovl_Effect_Ss_Bomb +ovl_Effect_Ss_Bomb2 +ovl_Effect_Ss_Bubble +ovl_Effect_Ss_D_Fire +ovl_Effect_Ss_Dead_Db +ovl_Effect_Ss_Dead_Dd +ovl_Effect_Ss_Dead_Ds +ovl_Effect_Ss_Dead_Sound +ovl_Effect_Ss_Dt_Bubble +ovl_Effect_Ss_Dust +ovl_Effect_Ss_En_Fire +ovl_Effect_Ss_En_Ice +ovl_Effect_Ss_Extra +ovl_Effect_Ss_Fcircle +ovl_Effect_Ss_Fhg_Flash +ovl_Effect_Ss_Fire_Tail +ovl_Effect_Ss_G_Fire +ovl_Effect_Ss_G_Magma +ovl_Effect_Ss_G_Magma2 +ovl_Effect_Ss_G_Ripple +ovl_Effect_Ss_G_Spk +ovl_Effect_Ss_G_Splash +ovl_Effect_Ss_Hahen +ovl_Effect_Ss_HitMark +ovl_Effect_Ss_Ice_Piece +ovl_Effect_Ss_Ice_Smoke +ovl_Effect_Ss_K_Fire +ovl_Effect_Ss_Kakera +ovl_Effect_Ss_KiraKira +ovl_Effect_Ss_Lightning +ovl_Effect_Ss_Sibuki +ovl_Effect_Ss_Sibuki2 +ovl_Effect_Ss_Solder_Srch_Ball +ovl_Effect_Ss_Stick +ovl_Effect_Ss_Stone1 +ovl_Elf_Msg +ovl_Elf_Msg2 +ovl_En_Am +ovl_En_Ani +ovl_En_Anubice +ovl_En_Anubice_Fire +ovl_En_Anubice_Tag +ovl_En_Arow_Trap +ovl_En_Arrow +ovl_En_Attack_Niw +ovl_En_Ba +ovl_En_Bb +ovl_En_Bdfire +ovl_En_Bigokuta +ovl_En_Bili +ovl_En_Bird +ovl_En_Blkobj +ovl_En_Bom +ovl_En_Bom_Bowl_Man +ovl_En_Bom_Bowl_Pit +ovl_En_Bom_Chu +ovl_En_Bombf +ovl_En_Boom +ovl_En_Box +ovl_En_Brob +ovl_En_Bubble +ovl_En_Butte +ovl_En_Bw +ovl_En_Bx +ovl_En_Changer +ovl_En_Clear_Tag +ovl_En_Cow +ovl_En_Crow +ovl_En_Cs +ovl_En_Daiku +ovl_En_Daiku_Kakariko +ovl_En_Dekubaba +ovl_En_Dekunuts +ovl_En_Dh +ovl_En_Dha +ovl_En_Diving_Game +ovl_En_Dns +ovl_En_Dnt_Demo +ovl_En_Dnt_Jiji +ovl_En_Dnt_Nomal +ovl_En_Dodojr +ovl_En_Dodongo +ovl_En_Dog +ovl_En_Door +ovl_En_Ds +ovl_En_Du +ovl_En_Dy_Extra +ovl_En_Eg +ovl_En_Eiyer +ovl_En_Elf +ovl_En_Encount1 +ovl_En_Encount2 +ovl_En_Ex_Item +ovl_En_Ex_Ruppy +ovl_En_Fd +ovl_En_Fd_Fire +ovl_En_Fhg_Fire +ovl_En_Fire_Rock +ovl_En_Firefly +ovl_En_Fish +ovl_En_Floormas +ovl_En_Fr +ovl_En_Fu +ovl_En_Fw +ovl_En_Fz +ovl_En_G_Switch +ovl_En_Ganon_Mant +ovl_En_Ganon_Organ +ovl_En_Gb +ovl_En_Ge1 +ovl_En_Ge2 +ovl_En_Ge3 +ovl_En_GeldB +ovl_En_GirlA +ovl_En_Gm +ovl_En_Go +ovl_En_Go2 +ovl_En_Goma +ovl_En_Goroiwa +ovl_En_Gs +ovl_En_Guest +ovl_En_Hata +ovl_En_Heishi1 +ovl_En_Heishi2 +ovl_En_Heishi3 +ovl_En_Heishi4 +ovl_En_Hintnuts +ovl_En_Holl +ovl_En_Honotrap +ovl_En_Horse +ovl_En_Horse_Game_Check +ovl_En_Horse_Ganon +ovl_En_Horse_Link_Child +ovl_En_Horse_Normal +ovl_En_Horse_Zelda +ovl_En_Hs +ovl_En_Hs2 +ovl_En_Hy +ovl_En_Ice_Hono +ovl_En_Ik +ovl_En_In +ovl_En_Insect +ovl_En_Ishi +ovl_En_It +ovl_En_Jj +ovl_En_Js +ovl_En_Jsjutan +ovl_En_Kakasi +ovl_En_Kakasi2 +ovl_En_Kakasi3 +ovl_En_Kanban +ovl_En_Karebaba +ovl_En_Ko +ovl_En_Kusa +ovl_En_Kz +ovl_En_Light +ovl_En_Lightbox +ovl_En_M_Fire1 +ovl_En_M_Thunder +ovl_En_Ma1 +ovl_En_Ma2 +ovl_En_Ma3 +ovl_En_Mag +ovl_En_Mb +ovl_En_Md +ovl_En_Mk +ovl_En_Mm +ovl_En_Mm2 +ovl_En_Ms +ovl_En_Mu +ovl_En_Nb +ovl_En_Niw +ovl_En_Niw_Girl +ovl_En_Niw_Lady +ovl_En_Nutsball +ovl_En_Nwc +ovl_En_Ny +ovl_En_OE2 +ovl_En_Okarina_Effect +ovl_En_Okarina_Tag +ovl_En_Okuta +ovl_En_Ossan +ovl_En_Owl +ovl_En_Part +ovl_En_Peehat +ovl_En_Po_Desert +ovl_En_Po_Field +ovl_En_Po_Relay +ovl_En_Po_Sisters +ovl_En_Poh +ovl_En_Pu_box +ovl_En_Rd +ovl_En_Reeba +ovl_En_River_Sound +ovl_En_Rl +ovl_En_Rr +ovl_En_Ru1 +ovl_En_Ru2 +ovl_En_Sa +ovl_En_Sb +ovl_En_Scene_Change +ovl_En_Sda +ovl_En_Shopnuts +ovl_En_Si +ovl_En_Siofuki +ovl_En_Skb +ovl_En_Skj +ovl_En_Skjneedle +ovl_En_Ssh +ovl_En_St +ovl_En_Sth +ovl_En_Stream +ovl_En_Sw +ovl_En_Syateki_Itm +ovl_En_Syateki_Man +ovl_En_Syateki_Niw +ovl_En_Ta +ovl_En_Takara_Man +ovl_En_Tana +ovl_En_Tg +ovl_En_Tite +ovl_En_Tk +ovl_En_Torch +ovl_En_Torch2 +ovl_En_Toryo +ovl_En_Tp +ovl_En_Tr +ovl_En_Trap +ovl_En_Tubo_Trap +ovl_En_Vali +ovl_En_Vase +ovl_En_Vb_Ball +ovl_En_Viewer +ovl_En_Vm +ovl_En_Wall_Tubo +ovl_En_Wallmas +ovl_En_Weather_Tag +ovl_En_Weiyer +ovl_En_Wf +ovl_En_Wonder_Item +ovl_En_Wonder_Talk +ovl_En_Wonder_Talk2 +ovl_En_Wood02 +ovl_En_Xc +ovl_En_Yabusame_Mark +ovl_En_Yukabyun +ovl_En_Zf +ovl_En_Zl1 +ovl_En_Zl2 +ovl_En_Zl3 +ovl_En_Zl4 +ovl_En_Zo +ovl_En_fHG +ovl_End_Title +ovl_Fishing +ovl_Item_B_Heart +ovl_Item_Etcetera +ovl_Item_Inbox +ovl_Item_Ocarina +ovl_Item_Shield +ovl_Magic_Dark +ovl_Magic_Fire +ovl_Magic_Wind +ovl_Mir_Ray +ovl_Obj_Bean +ovl_Obj_Blockstop +ovl_Obj_Bombiwa +ovl_Obj_Comb +ovl_Obj_Dekujr +ovl_Obj_Elevator +ovl_Obj_Hamishi +ovl_Obj_Hana +ovl_Obj_Hsblock +ovl_Obj_Ice_Poly +ovl_Obj_Kibako +ovl_Obj_Kibako2 +ovl_Obj_Lift +ovl_Obj_Lightswitch +ovl_Obj_Makekinsuta +ovl_Obj_Makeoshihiki +ovl_Obj_Mure +ovl_Obj_Mure2 +ovl_Obj_Mure3 +ovl_Obj_Oshihiki +ovl_Obj_Roomtimer +ovl_Obj_Switch +ovl_Obj_Syokudai +ovl_Obj_Timeblock +ovl_Obj_Tsubo +ovl_Obj_Warp2block +ovl_Object_Kankyo +ovl_Oceff_Spot +ovl_Oceff_Storm +ovl_Oceff_Wipe +ovl_Oceff_Wipe2 +ovl_Oceff_Wipe3 +ovl_Oceff_Wipe4 +ovl_Shot_Sun +gameplay_keep +gameplay_field_keep +gameplay_dangeon_keep +gameplay_object_exchange_static +object_link_boy +object_link_child +object_box +object_human +object_okuta +object_poh +object_wallmaster +object_dy_obj +object_firefly +object_dodongo +object_fire +object_niw +object_tite +object_reeba +object_peehat +object_kingdodongo +object_horse +object_zf +object_goma +object_zl1 +object_gol +object_bubble +object_dodojr +object_torch2 +object_bl +object_tp +object_oA1 +object_st +object_bw +object_ei +object_horse_normal +object_oB1 +object_o_anime +object_spot04_objects +object_ddan_objects +object_hidan_objects +object_horse_ganon +object_oA2 +object_spot00_objects +object_mb +object_bombf +object_sk2 +object_oE1 +object_oE_anime +object_oE2 +object_ydan_objects +object_gnd +object_am +object_dekubaba +object_oA3 +object_oA4 +object_oA5 +object_oA6 +object_oA7 +object_jj +object_oA8 +object_oA9 +object_oB2 +object_oB3 +object_oB4 +object_horse_zelda +object_opening_demo1 +object_warp1 +object_b_heart +object_dekunuts +object_oE3 +object_oE4 +object_menkuri_objects +object_oE5 +object_oE6 +object_oE7 +object_oE8 +object_oE9 +object_oE10 +object_oE11 +object_oE12 +object_vali +object_oA10 +object_oA11 +object_mizu_objects +object_fhg +object_ossan +object_mori_hineri1 +object_Bb +object_toki_objects +object_yukabyun +object_zl2 +object_mjin +object_mjin_flash +object_mjin_dark +object_mjin_flame +object_mjin_ice +object_mjin_soul +object_mjin_wind +object_mjin_oka +object_haka_objects +object_spot06_objects +object_ice_objects +object_relay_objects +object_mori_hineri1a +object_mori_hineri2 +object_mori_hineri2a +object_mori_objects +object_mori_tex +object_spot08_obj +object_warp2 +object_hata +object_bird +object_wood02 +object_lightbox +object_pu_box +object_trap +object_vase +object_im +object_ta +object_tk +object_xc +object_vm +object_bv +object_hakach_objects +object_efc_crystal_light +object_efc_fire_ball +object_efc_flash +object_efc_lgt_shower +object_efc_star_field +object_god_lgt +object_light_ring +object_triforce_spot +object_medal +object_bdan_objects +object_sd +object_rd +object_po_sisters +object_heavy_object +object_gndd +object_fd +object_du +object_fw +object_horse_link_child +object_spot02_objects +object_haka +object_ru1 +object_syokudai +object_fd2 +object_dh +object_rl +object_efc_tw +object_demo_tre_lgt +object_gi_key +object_mir_ray +object_brob +object_gi_jewel +object_spot09_obj +object_spot18_obj +object_bdoor +object_spot17_obj +object_shop_dungen +object_nb +object_mo +object_sb +object_gi_melody +object_gi_heart +object_gi_compass +object_gi_bosskey +object_gi_medal +object_gi_nuts +object_sa +object_gi_hearts +object_gi_arrowcase +object_gi_bombpouch +object_in +object_tr +object_spot16_obj +object_oE1s +object_oE4s +object_os_anime +object_gi_bottle +object_gi_stick +object_gi_map +object_oF1d_map +object_ru2 +object_gi_shield_1 +object_dekujr +object_gi_magicpot +object_gi_bomb_1 +object_oF1s +object_ma2 +object_gi_purse +object_hni +object_tw +object_rr +object_bxa +object_anubice +object_gi_gerudo +object_gi_arrow +object_gi_bomb_2 +object_gi_egg +object_gi_scale +object_gi_shield_2 +object_gi_hookshot +object_gi_ocarina +object_gi_milk +object_ma1 +object_ganon +object_sst +object_ny +object_fr +object_gi_pachinko +object_gi_boomerang +object_gi_bow +object_gi_glasses +object_gi_liquid +object_ani +object_demo_6k +object_gi_shield_3 +object_gi_letter +object_spot15_obj +object_jya_obj +object_gi_clothes +object_gi_bean +object_gi_fish +object_gi_saw +object_gi_hammer +object_gi_grass +object_gi_longsword +object_spot01_objects +object_md +object_km1 +object_kw1 +object_zo +object_kz +object_umajump +object_masterkokiri +object_masterkokirihead +object_mastergolon +object_masterzoora +object_aob +object_ik +object_ahg +object_cne +object_gi_niwatori +object_skj +object_gi_bottle_letter +object_bji +object_bba +object_gi_ocarina_0 +object_ds +object_ane +object_boj +object_spot03_object +object_spot07_object +object_fz +object_bob +object_ge1 +object_yabusame_point +object_gi_boots_2 +object_gi_seed +object_gnd_magic +object_d_elevator +object_d_hsblock +object_d_lift +object_mamenoki +object_goroiwa +object_toryo +object_daiku +object_nwc +object_blkobj +object_gm +object_ms +object_hs +object_ingate +object_lightswitch +object_kusa +object_tsubo +object_gi_gloves +object_gi_coin +object_kanban +object_gjyo_objects +object_owl +object_mk +object_fu +object_gi_ki_tan_mask +object_gi_redead_mask +object_gi_skj_mask +object_gi_rabit_mask +object_gi_truth_mask +object_ganon_objects +object_siofuki +object_stream +object_mm +object_fa +object_os +object_gi_eye_lotion +object_gi_powder +object_gi_mushroom +object_gi_ticketstone +object_gi_brokensword +object_js +object_cs +object_gi_prescription +object_gi_bracelet +object_gi_soldout +object_gi_frog +object_mag +object_door_gerudo +object_gt +object_efc_erupc +object_zl2_anime1 +object_zl2_anime2 +object_gi_golonmask +object_gi_zoramask +object_gi_gerudomask +object_ganon2 +object_ka +object_ts +object_zg +object_gi_hoverboots +object_gi_m_arrow +object_ds2 +object_ec +object_fish +object_gi_sutaru +object_gi_goddess +object_ssh +object_bigokuta +object_bg +object_spot05_objects +object_spot12_obj +object_bombiwa +object_hintnuts +object_rs +object_spot00_break +object_gla +object_shopnuts +object_geldb +object_gr +object_dog +object_jya_iron +object_jya_door +object_spot01_objects2 +object_spot11_obj +object_kibako2 +object_dns +object_dnk +object_gi_fire +object_gi_insect +object_gi_butterfly +object_gi_ghost +object_gi_soul +object_bowl +object_po_field +object_demo_kekkai +object_efc_doughnut +object_gi_dekupouch +object_ganon_anime1 +object_ganon_anime2 +object_ganon_anime3 +object_gi_rupy +object_spot01_matoya +object_spot01_matoyab +object_po_composer +object_mu +object_wf +object_skb +object_gj +object_geff +object_haka_door +object_gs +object_ps +object_bwall +object_crow +object_cow +object_cob +object_gi_sword_1 +object_door_killer +object_ouke_haka +object_timeblock +object_zl4 +g_pn_01 +g_pn_02 +g_pn_03 +g_pn_04 +g_pn_05 +g_pn_06 +g_pn_07 +g_pn_08 +g_pn_09 +g_pn_10 +g_pn_11 +g_pn_12 +g_pn_13 +g_pn_14 +g_pn_15 +g_pn_16 +g_pn_17 +g_pn_18 +g_pn_19 +g_pn_20 +g_pn_21 +g_pn_22 +g_pn_23 +g_pn_24 +g_pn_25 +g_pn_26 +g_pn_27 +g_pn_28 +g_pn_29 +g_pn_30 +g_pn_31 +g_pn_32 +g_pn_33 +g_pn_34 +g_pn_35 +g_pn_36 +g_pn_37 +g_pn_38 +g_pn_39 +g_pn_40 +g_pn_41 +g_pn_42 +g_pn_43 +g_pn_44 +g_pn_45 +g_pn_46 +g_pn_47 +g_pn_48 +g_pn_49 +g_pn_50 +g_pn_51 +g_pn_52 +g_pn_53 +g_pn_54 +g_pn_55 +g_pn_56 +g_pn_57 +z_select_static +nintendo_rogo_static +title_static +parameter_static +vr_fine0_static +vr_fine0_pal_static +vr_fine1_static +vr_fine1_pal_static +vr_fine2_static +vr_fine2_pal_static +vr_fine3_static +vr_fine3_pal_static +vr_cloud0_static +vr_cloud0_pal_static +vr_cloud1_static +vr_cloud1_pal_static +vr_cloud2_static +vr_cloud2_pal_static +vr_cloud3_static +vr_cloud3_pal_static +vr_holy0_static +vr_holy0_pal_static +vr_holy1_static +vr_holy1_pal_static +vr_MDVR_static +vr_MDVR_pal_static +vr_MNVR_static +vr_MNVR_pal_static +vr_RUVR_static +vr_RUVR_pal_static +vr_LHVR_static +vr_LHVR_pal_static +vr_KHVR_static +vr_KHVR_pal_static +vr_K3VR_static +vr_K3VR_pal_static +vr_K4VR_static +vr_K4VR_pal_static +vr_K5VR_static +vr_K5VR_pal_static +vr_SP1a_static +vr_SP1a_pal_static +vr_MLVR_static +vr_MLVR_pal_static +vr_KKRVR_static +vr_KKRVR_pal_static +vr_KR3VR_static +vr_KR3VR_pal_static +vr_IPVR_static +vr_IPVR_pal_static +vr_KSVR_static +vr_KSVR_pal_static +vr_GLVR_static +vr_GLVR_pal_static +vr_ZRVR_static +vr_ZRVR_pal_static +vr_DGVR_static +vr_DGVR_pal_static +vr_ALVR_static +vr_ALVR_pal_static +vr_NSVR_static +vr_NSVR_pal_static +vr_LBVR_static +vr_LBVR_pal_static +vr_TTVR_static +vr_TTVR_pal_static +vr_FCVR_static +vr_FCVR_pal_static +elf_message_field +elf_message_ydan +syotes_scene +syotes_room_0 +syotes2_scene +syotes2_room_0 +depth_test_scene +depth_test_room_0 +spot00_scene +spot00_room_0 +spot01_scene +spot01_room_0 +spot02_scene +spot02_room_0 +spot02_room_1 +spot03_scene +spot03_room_0 +spot03_room_1 +spot04_scene +spot04_room_0 +spot04_room_1 +spot04_room_2 +spot05_scene +spot05_room_0 +spot06_scene +spot06_room_0 +spot07_scene +spot07_room_0 +spot07_room_1 +spot08_scene +spot08_room_0 +spot09_scene +spot09_room_0 +spot10_scene +spot10_room_0 +spot10_room_1 +spot10_room_2 +spot10_room_3 +spot10_room_4 +spot10_room_5 +spot10_room_6 +spot10_room_7 +spot10_room_8 +spot10_room_9 +spot11_scene +spot11_room_0 +spot12_scene +spot12_room_0 +spot12_room_1 +spot13_scene +spot13_room_0 +spot13_room_1 +spot15_scene +spot15_room_0 +spot16_scene +spot16_room_0 +spot17_scene +spot17_room_0 +spot17_room_1 +spot18_scene +spot18_room_0 +spot18_room_1 +spot18_room_2 +spot18_room_3 +ydan_scene +ydan_room_0 +ydan_room_1 +ydan_room_2 +ydan_room_3 +ydan_room_4 +ydan_room_5 +ydan_room_6 +ydan_room_7 +ydan_room_8 +ydan_room_9 +ydan_room_10 +ydan_room_11 +ddan_scene +ddan_room_0 +ddan_room_1 +ddan_room_2 +ddan_room_3 +ddan_room_4 +ddan_room_5 +ddan_room_6 +ddan_room_7 +ddan_room_8 +ddan_room_9 +ddan_room_10 +ddan_room_11 +ddan_room_12 +ddan_room_13 +ddan_room_14 +ddan_room_15 +ddan_room_16 +bdan_scene +bdan_room_0 +bdan_room_1 +bdan_room_2 +bdan_room_3 +bdan_room_4 +bdan_room_5 +bdan_room_6 +bdan_room_7 +bdan_room_8 +bdan_room_9 +bdan_room_10 +bdan_room_11 +bdan_room_12 +bdan_room_13 +bdan_room_14 +bdan_room_15 +Bmori1_scene +Bmori1_room_0 +Bmori1_room_1 +Bmori1_room_2 +Bmori1_room_3 +Bmori1_room_4 +Bmori1_room_5 +Bmori1_room_6 +Bmori1_room_7 +Bmori1_room_8 +Bmori1_room_9 +Bmori1_room_10 +Bmori1_room_11 +Bmori1_room_12 +Bmori1_room_13 +Bmori1_room_14 +Bmori1_room_15 +Bmori1_room_16 +Bmori1_room_17 +Bmori1_room_18 +Bmori1_room_19 +Bmori1_room_20 +Bmori1_room_21 +Bmori1_room_22 +HIDAN_scene +HIDAN_room_0 +HIDAN_room_1 +HIDAN_room_2 +HIDAN_room_3 +HIDAN_room_4 +HIDAN_room_5 +HIDAN_room_6 +HIDAN_room_7 +HIDAN_room_8 +HIDAN_room_9 +HIDAN_room_10 +HIDAN_room_11 +HIDAN_room_12 +HIDAN_room_13 +HIDAN_room_14 +HIDAN_room_15 +HIDAN_room_16 +HIDAN_room_17 +HIDAN_room_18 +HIDAN_room_19 +HIDAN_room_20 +HIDAN_room_21 +HIDAN_room_22 +HIDAN_room_23 +HIDAN_room_24 +HIDAN_room_25 +HIDAN_room_26 +MIZUsin_scene +MIZUsin_room_0 +MIZUsin_room_1 +MIZUsin_room_2 +MIZUsin_room_3 +MIZUsin_room_4 +MIZUsin_room_5 +MIZUsin_room_6 +MIZUsin_room_7 +MIZUsin_room_8 +MIZUsin_room_9 +MIZUsin_room_10 +MIZUsin_room_11 +MIZUsin_room_12 +MIZUsin_room_13 +MIZUsin_room_14 +MIZUsin_room_15 +MIZUsin_room_16 +MIZUsin_room_17 +MIZUsin_room_18 +MIZUsin_room_19 +MIZUsin_room_20 +MIZUsin_room_21 +MIZUsin_room_22 +jyasinzou_scene +jyasinzou_room_0 +jyasinzou_room_1 +jyasinzou_room_2 +jyasinzou_room_3 +jyasinzou_room_4 +jyasinzou_room_5 +jyasinzou_room_6 +jyasinzou_room_7 +jyasinzou_room_8 +jyasinzou_room_9 +jyasinzou_room_10 +jyasinzou_room_11 +jyasinzou_room_12 +jyasinzou_room_13 +jyasinzou_room_14 +jyasinzou_room_15 +jyasinzou_room_16 +jyasinzou_room_17 +jyasinzou_room_18 +jyasinzou_room_19 +jyasinzou_room_20 +jyasinzou_room_21 +jyasinzou_room_22 +jyasinzou_room_23 +jyasinzou_room_24 +jyasinzou_room_25 +jyasinzou_room_26 +jyasinzou_room_27 +jyasinzou_room_28 +HAKAdan_scene +HAKAdan_room_0 +HAKAdan_room_1 +HAKAdan_room_2 +HAKAdan_room_3 +HAKAdan_room_4 +HAKAdan_room_5 +HAKAdan_room_6 +HAKAdan_room_7 +HAKAdan_room_8 +HAKAdan_room_9 +HAKAdan_room_10 +HAKAdan_room_11 +HAKAdan_room_12 +HAKAdan_room_13 +HAKAdan_room_14 +HAKAdan_room_15 +HAKAdan_room_16 +HAKAdan_room_17 +HAKAdan_room_18 +HAKAdan_room_19 +HAKAdan_room_20 +HAKAdan_room_21 +HAKAdan_room_22 +HAKAdanCH_scene +HAKAdanCH_room_0 +HAKAdanCH_room_1 +HAKAdanCH_room_2 +HAKAdanCH_room_3 +HAKAdanCH_room_4 +HAKAdanCH_room_5 +HAKAdanCH_room_6 +ice_doukutu_scene +ice_doukutu_room_0 +ice_doukutu_room_1 +ice_doukutu_room_2 +ice_doukutu_room_3 +ice_doukutu_room_4 +ice_doukutu_room_5 +ice_doukutu_room_6 +ice_doukutu_room_7 +ice_doukutu_room_8 +ice_doukutu_room_9 +ice_doukutu_room_10 +ice_doukutu_room_11 +men_scene +men_room_0 +men_room_1 +men_room_2 +men_room_3 +men_room_4 +men_room_5 +men_room_6 +men_room_7 +men_room_8 +men_room_9 +men_room_10 +ganontika_scene +ganontika_room_0 +ganontika_room_1 +ganontika_room_2 +ganontika_room_3 +ganontika_room_4 +ganontika_room_5 +ganontika_room_6 +ganontika_room_7 +ganontika_room_8 +ganontika_room_9 +ganontika_room_10 +ganontika_room_11 +ganontika_room_12 +ganontika_room_13 +ganontika_room_14 +ganontika_room_15 +ganontika_room_16 +ganontika_room_17 +ganontika_room_18 +ganontika_room_19 +market_day_scene +market_day_room_0 +market_night_scene +market_night_room_0 +testroom_scene +testroom_room_0 +testroom_room_1 +testroom_room_2 +testroom_room_3 +testroom_room_4 +kenjyanoma_scene +kenjyanoma_room_0 +tokinoma_scene +tokinoma_room_0 +tokinoma_room_1 +sutaru_scene +sutaru_room_0 +link_home_scene +link_home_room_0 +kokiri_shop_scene +kokiri_shop_room_0 +kokiri_home_scene +kokiri_home_room_0 +kakusiana_scene +kakusiana_room_0 +kakusiana_room_1 +kakusiana_room_2 +kakusiana_room_3 +kakusiana_room_4 +kakusiana_room_5 +kakusiana_room_6 +kakusiana_room_7 +kakusiana_room_8 +kakusiana_room_9 +kakusiana_room_10 +kakusiana_room_11 +kakusiana_room_12 +kakusiana_room_13 +entra_scene +entra_room_0 +moribossroom_scene +moribossroom_room_0 +moribossroom_room_1 +syatekijyou_scene +syatekijyou_room_0 +shop1_scene +shop1_room_0 +hairal_niwa_scene +hairal_niwa_room_0 +ganon_tou_scene +ganon_tou_room_0 +sasatest_scene +sasatest_room_0 +market_alley_scene +market_alley_room_0 +spot20_scene +spot20_room_0 +market_ruins_scene +market_ruins_room_0 +entra_n_scene +entra_n_room_0 +enrui_scene +enrui_room_0 +market_alley_n_scene +market_alley_n_room_0 +hiral_demo_scene +hiral_demo_room_0 +kokiri_home3_scene +kokiri_home3_room_0 +malon_stable_scene +malon_stable_room_0 +kakariko_scene +kakariko_room_0 +bdan_boss_scene +bdan_boss_room_0 +bdan_boss_room_1 +FIRE_bs_scene +FIRE_bs_room_0 +FIRE_bs_room_1 +hut_scene +hut_room_0 +daiyousei_izumi_scene +daiyousei_izumi_room_0 +hakaana_scene +hakaana_room_0 +yousei_izumi_tate_scene +yousei_izumi_tate_room_0 +yousei_izumi_yoko_scene +yousei_izumi_yoko_room_0 +golon_scene +golon_room_0 +zoora_scene +zoora_room_0 +drag_scene +drag_room_0 +alley_shop_scene +alley_shop_room_0 +night_shop_scene +night_shop_room_0 +impa_scene +impa_room_0 +labo_scene +labo_room_0 +tent_scene +tent_room_0 +nakaniwa_scene +nakaniwa_room_0 +ddan_boss_scene +ddan_boss_room_0 +ddan_boss_room_1 +ydan_boss_scene +ydan_boss_room_0 +ydan_boss_room_1 +HAKAdan_bs_scene +HAKAdan_bs_room_0 +HAKAdan_bs_room_1 +MIZUsin_bs_scene +MIZUsin_bs_room_0 +MIZUsin_bs_room_1 +ganon_scene +ganon_room_0 +ganon_room_1 +ganon_room_2 +ganon_room_3 +ganon_room_4 +ganon_room_5 +ganon_room_6 +ganon_room_7 +ganon_room_8 +ganon_room_9 +ganon_boss_scene +ganon_boss_room_0 +jyasinboss_scene +jyasinboss_room_0 +jyasinboss_room_1 +jyasinboss_room_2 +jyasinboss_room_3 +kokiri_home4_scene +kokiri_home4_room_0 +kokiri_home5_scene +kokiri_home5_room_0 +ganon_final_scene +ganon_final_room_0 +kakariko3_scene +kakariko3_room_0 +hairal_niwa2_scene +hairal_niwa2_room_0 +hakasitarelay_scene +hakasitarelay_room_0 +hakasitarelay_room_1 +hakasitarelay_room_2 +hakasitarelay_room_3 +hakasitarelay_room_4 +hakasitarelay_room_5 +hakasitarelay_room_6 +shrine_scene +shrine_room_0 +turibori_scene +turibori_room_0 +shrine_n_scene +shrine_n_room_0 +shrine_r_scene +shrine_r_room_0 +hakaana2_scene +hakaana2_room_0 +gerudoway_scene +gerudoway_room_0 +gerudoway_room_1 +gerudoway_room_2 +gerudoway_room_3 +gerudoway_room_4 +gerudoway_room_5 +hairal_niwa_n_scene +hairal_niwa_n_room_0 +bowling_scene +bowling_room_0 +hakaana_ouke_scene +hakaana_ouke_room_0 +hakaana_ouke_room_1 +hakaana_ouke_room_2 +hylia_labo_scene +hylia_labo_room_0 +souko_scene +souko_room_0 +souko_room_1 +souko_room_2 +miharigoya_scene +miharigoya_room_0 +mahouya_scene +mahouya_room_0 +takaraya_scene +takaraya_room_0 +takaraya_room_1 +takaraya_room_2 +takaraya_room_3 +takaraya_room_4 +takaraya_room_5 +takaraya_room_6 +ganon_sonogo_scene +ganon_sonogo_room_0 +ganon_sonogo_room_1 +ganon_sonogo_room_2 +ganon_sonogo_room_3 +ganon_sonogo_room_4 +ganon_demo_scene +ganon_demo_room_0 +besitu_scene +besitu_room_0 +face_shop_scene +face_shop_room_0 +kinsuta_scene +kinsuta_room_0 +ganontikasonogo_scene +ganontikasonogo_room_0 +ganontikasonogo_room_1 +test01_scene +test01_room_0 +bump_texture_static +anime_model_1_static +anime_model_2_static +anime_model_3_static +anime_model_4_static +anime_model_5_static +anime_model_6_static +anime_texture_1_static +anime_texture_2_static +anime_texture_3_static +anime_texture_4_static +anime_texture_5_static +anime_texture_6_static +softsprite_matrix_static \ No newline at end of file diff --git a/OTRExporter/CFG/filelists/gamecube.txt b/OTRExporter/CFG/filelists/gamecube.txt new file mode 100644 index 000000000..23794e1f6 --- /dev/null +++ b/OTRExporter/CFG/filelists/gamecube.txt @@ -0,0 +1,1509 @@ +makerom +boot +dmadata +Audiobank +Audioseq +Audiotable +kanji +link_animetion +icon_item_static +icon_item_24_static +icon_item_field_static +icon_item_dungeon_static +icon_item_gameover_static +icon_item_jpn_static +icon_item_nes_static +item_name_static +map_name_static +do_action_static +message_static +message_texture_static +nes_font_static +jpn_message_data_static +nes_message_data_static +staff_message_data_static +map_grand_static +map_48x85_static +map_i_static +code +ovl_title +ovl_select +ovl_opening +ovl_file_choose +ovl_kaleido_scope +ovl_player_actor +ovl_map_mark_data +ovl_En_Test +ovl_Arms_Hook +ovl_Arrow_Fire +ovl_Arrow_Ice +ovl_Arrow_Light +ovl_Bg_Bdan_Objects +ovl_Bg_Bdan_Switch +ovl_Bg_Bom_Guard +ovl_Bg_Bombwall +ovl_Bg_Bowl_Wall +ovl_Bg_Breakwall +ovl_Bg_Ddan_Jd +ovl_Bg_Ddan_Kd +ovl_Bg_Dodoago +ovl_Bg_Dy_Yoseizo +ovl_Bg_Ganon_Otyuka +ovl_Bg_Gate_Shutter +ovl_Bg_Gjyo_Bridge +ovl_Bg_Gnd_Darkmeiro +ovl_Bg_Gnd_Firemeiro +ovl_Bg_Gnd_Iceblock +ovl_Bg_Gnd_Nisekabe +ovl_Bg_Gnd_Soulmeiro +ovl_Bg_Haka +ovl_Bg_Haka_Gate +ovl_Bg_Haka_Huta +ovl_Bg_Haka_Megane +ovl_Bg_Haka_MeganeBG +ovl_Bg_Haka_Sgami +ovl_Bg_Haka_Ship +ovl_Bg_Haka_Trap +ovl_Bg_Haka_Tubo +ovl_Bg_Haka_Water +ovl_Bg_Haka_Zou +ovl_Bg_Heavy_Block +ovl_Bg_Hidan_Curtain +ovl_Bg_Hidan_Dalm +ovl_Bg_Hidan_Firewall +ovl_Bg_Hidan_Fslift +ovl_Bg_Hidan_Fwbig +ovl_Bg_Hidan_Hamstep +ovl_Bg_Hidan_Hrock +ovl_Bg_Hidan_Kousi +ovl_Bg_Hidan_Kowarerukabe +ovl_Bg_Hidan_Rock +ovl_Bg_Hidan_Rsekizou +ovl_Bg_Hidan_Sekizou +ovl_Bg_Hidan_Sima +ovl_Bg_Hidan_Syoku +ovl_Bg_Ice_Objects +ovl_Bg_Ice_Shelter +ovl_Bg_Ice_Shutter +ovl_Bg_Ice_Turara +ovl_Bg_Ingate +ovl_Bg_Jya_1flift +ovl_Bg_Jya_Amishutter +ovl_Bg_Jya_Bigmirror +ovl_Bg_Jya_Block +ovl_Bg_Jya_Bombchuiwa +ovl_Bg_Jya_Bombiwa +ovl_Bg_Jya_Cobra +ovl_Bg_Jya_Goroiwa +ovl_Bg_Jya_Haheniron +ovl_Bg_Jya_Ironobj +ovl_Bg_Jya_Kanaami +ovl_Bg_Jya_Lift +ovl_Bg_Jya_Megami +ovl_Bg_Jya_Zurerukabe +ovl_Bg_Menkuri_Eye +ovl_Bg_Menkuri_Kaiten +ovl_Bg_Menkuri_Nisekabe +ovl_Bg_Mizu_Bwall +ovl_Bg_Mizu_Movebg +ovl_Bg_Mizu_Shutter +ovl_Bg_Mizu_Uzu +ovl_Bg_Mizu_Water +ovl_Bg_Mjin +ovl_Bg_Mori_Bigst +ovl_Bg_Mori_Elevator +ovl_Bg_Mori_Hashigo +ovl_Bg_Mori_Hashira4 +ovl_Bg_Mori_Hineri +ovl_Bg_Mori_Idomizu +ovl_Bg_Mori_Kaitenkabe +ovl_Bg_Mori_Rakkatenjo +ovl_Bg_Po_Event +ovl_Bg_Po_Syokudai +ovl_Bg_Pushbox +ovl_Bg_Relay_Objects +ovl_Bg_Spot00_Break +ovl_Bg_Spot00_Hanebasi +ovl_Bg_Spot01_Fusya +ovl_Bg_Spot01_Idohashira +ovl_Bg_Spot01_Idomizu +ovl_Bg_Spot01_Idosoko +ovl_Bg_Spot01_Objects2 +ovl_Bg_Spot02_Objects +ovl_Bg_Spot03_Taki +ovl_Bg_Spot05_Soko +ovl_Bg_Spot06_Objects +ovl_Bg_Spot07_Taki +ovl_Bg_Spot08_Bakudankabe +ovl_Bg_Spot08_Iceblock +ovl_Bg_Spot09_Obj +ovl_Bg_Spot11_Bakudankabe +ovl_Bg_Spot11_Oasis +ovl_Bg_Spot12_Gate +ovl_Bg_Spot12_Saku +ovl_Bg_Spot15_Rrbox +ovl_Bg_Spot15_Saku +ovl_Bg_Spot16_Bombstone +ovl_Bg_Spot16_Doughnut +ovl_Bg_Spot17_Bakudankabe +ovl_Bg_Spot17_Funen +ovl_Bg_Spot18_Basket +ovl_Bg_Spot18_Futa +ovl_Bg_Spot18_Obj +ovl_Bg_Spot18_Shutter +ovl_Bg_Sst_Floor +ovl_Bg_Toki_Hikari +ovl_Bg_Toki_Swd +ovl_Bg_Treemouth +ovl_Bg_Umajump +ovl_Bg_Vb_Sima +ovl_Bg_Ydan_Hasi +ovl_Bg_Ydan_Maruta +ovl_Bg_Ydan_Sp +ovl_Bg_Zg +ovl_Boss_Dodongo +ovl_Boss_Fd +ovl_Boss_Fd2 +ovl_Boss_Ganon +ovl_Boss_Ganon2 +ovl_Boss_Ganondrof +ovl_Boss_Goma +ovl_Boss_Mo +ovl_Boss_Sst +ovl_Boss_Tw +ovl_Boss_Va +ovl_Demo_6K +ovl_Demo_Du +ovl_Demo_Ec +ovl_Demo_Effect +ovl_Demo_Ext +ovl_Demo_Geff +ovl_Demo_Gj +ovl_Demo_Go +ovl_Demo_Gt +ovl_Demo_Ik +ovl_Demo_Im +ovl_Demo_Kankyo +ovl_Demo_Kekkai +ovl_Demo_Sa +ovl_Demo_Shd +ovl_Demo_Tre_Lgt +ovl_Door_Ana +ovl_Door_Gerudo +ovl_Door_Killer +ovl_Door_Shutter +ovl_Door_Toki +ovl_Door_Warp1 +ovl_Efc_Erupc +ovl_Eff_Dust +ovl_Effect_Ss_Blast +ovl_Effect_Ss_Bomb +ovl_Effect_Ss_Bomb2 +ovl_Effect_Ss_Bubble +ovl_Effect_Ss_D_Fire +ovl_Effect_Ss_Dead_Db +ovl_Effect_Ss_Dead_Dd +ovl_Effect_Ss_Dead_Ds +ovl_Effect_Ss_Dead_Sound +ovl_Effect_Ss_Dt_Bubble +ovl_Effect_Ss_Dust +ovl_Effect_Ss_En_Fire +ovl_Effect_Ss_En_Ice +ovl_Effect_Ss_Extra +ovl_Effect_Ss_Fcircle +ovl_Effect_Ss_Fhg_Flash +ovl_Effect_Ss_Fire_Tail +ovl_Effect_Ss_G_Fire +ovl_Effect_Ss_G_Magma +ovl_Effect_Ss_G_Magma2 +ovl_Effect_Ss_G_Ripple +ovl_Effect_Ss_G_Spk +ovl_Effect_Ss_G_Splash +ovl_Effect_Ss_Hahen +ovl_Effect_Ss_HitMark +ovl_Effect_Ss_Ice_Piece +ovl_Effect_Ss_Ice_Smoke +ovl_Effect_Ss_K_Fire +ovl_Effect_Ss_Kakera +ovl_Effect_Ss_KiraKira +ovl_Effect_Ss_Lightning +ovl_Effect_Ss_Sibuki +ovl_Effect_Ss_Sibuki2 +ovl_Effect_Ss_Solder_Srch_Ball +ovl_Effect_Ss_Stick +ovl_Effect_Ss_Stone1 +ovl_Elf_Msg +ovl_Elf_Msg2 +ovl_En_Am +ovl_En_Ani +ovl_En_Anubice +ovl_En_Anubice_Fire +ovl_En_Anubice_Tag +ovl_En_Arow_Trap +ovl_En_Arrow +ovl_En_Attack_Niw +ovl_En_Ba +ovl_En_Bb +ovl_En_Bdfire +ovl_En_Bigokuta +ovl_En_Bili +ovl_En_Bird +ovl_En_Blkobj +ovl_En_Bom +ovl_En_Bom_Bowl_Man +ovl_En_Bom_Bowl_Pit +ovl_En_Bom_Chu +ovl_En_Bombf +ovl_En_Boom +ovl_En_Box +ovl_En_Brob +ovl_En_Bubble +ovl_En_Butte +ovl_En_Bw +ovl_En_Bx +ovl_En_Changer +ovl_En_Clear_Tag +ovl_En_Cow +ovl_En_Crow +ovl_En_Cs +ovl_En_Daiku +ovl_En_Daiku_Kakariko +ovl_En_Dekubaba +ovl_En_Dekunuts +ovl_En_Dh +ovl_En_Dha +ovl_En_Diving_Game +ovl_En_Dns +ovl_En_Dnt_Demo +ovl_En_Dnt_Jiji +ovl_En_Dnt_Nomal +ovl_En_Dodojr +ovl_En_Dodongo +ovl_En_Dog +ovl_En_Door +ovl_En_Ds +ovl_En_Du +ovl_En_Dy_Extra +ovl_En_Eg +ovl_En_Eiyer +ovl_En_Elf +ovl_En_Encount1 +ovl_En_Encount2 +ovl_En_Ex_Item +ovl_En_Ex_Ruppy +ovl_En_Fd +ovl_En_Fd_Fire +ovl_En_Fhg_Fire +ovl_En_Fire_Rock +ovl_En_Firefly +ovl_En_Fish +ovl_En_Floormas +ovl_En_Fr +ovl_En_Fu +ovl_En_Fw +ovl_En_Fz +ovl_En_G_Switch +ovl_En_Ganon_Mant +ovl_En_Ganon_Organ +ovl_En_Gb +ovl_En_Ge1 +ovl_En_Ge2 +ovl_En_Ge3 +ovl_En_GeldB +ovl_En_GirlA +ovl_En_Gm +ovl_En_Go +ovl_En_Go2 +ovl_En_Goma +ovl_En_Goroiwa +ovl_En_Gs +ovl_En_Guest +ovl_En_Hata +ovl_En_Heishi1 +ovl_En_Heishi2 +ovl_En_Heishi3 +ovl_En_Heishi4 +ovl_En_Hintnuts +ovl_En_Holl +ovl_En_Honotrap +ovl_En_Horse +ovl_En_Horse_Game_Check +ovl_En_Horse_Ganon +ovl_En_Horse_Link_Child +ovl_En_Horse_Normal +ovl_En_Horse_Zelda +ovl_En_Hs +ovl_En_Hs2 +ovl_En_Hy +ovl_En_Ice_Hono +ovl_En_Ik +ovl_En_In +ovl_En_Insect +ovl_En_Ishi +ovl_En_It +ovl_En_Jj +ovl_En_Js +ovl_En_Jsjutan +ovl_En_Kakasi +ovl_En_Kakasi2 +ovl_En_Kakasi3 +ovl_En_Kanban +ovl_En_Karebaba +ovl_En_Ko +ovl_En_Kusa +ovl_En_Kz +ovl_En_Light +ovl_En_Lightbox +ovl_En_M_Fire1 +ovl_En_M_Thunder +ovl_En_Ma1 +ovl_En_Ma2 +ovl_En_Ma3 +ovl_En_Mag +ovl_En_Mb +ovl_En_Md +ovl_En_Mk +ovl_En_Mm +ovl_En_Mm2 +ovl_En_Ms +ovl_En_Mu +ovl_En_Nb +ovl_En_Niw +ovl_En_Niw_Girl +ovl_En_Niw_Lady +ovl_En_Nutsball +ovl_En_Nwc +ovl_En_Ny +ovl_En_OE2 +ovl_En_Okarina_Effect +ovl_En_Okarina_Tag +ovl_En_Okuta +ovl_En_Ossan +ovl_En_Owl +ovl_En_Part +ovl_En_Peehat +ovl_En_Po_Desert +ovl_En_Po_Field +ovl_En_Po_Relay +ovl_En_Po_Sisters +ovl_En_Poh +ovl_En_Pu_box +ovl_En_Rd +ovl_En_Reeba +ovl_En_River_Sound +ovl_En_Rl +ovl_En_Rr +ovl_En_Ru1 +ovl_En_Ru2 +ovl_En_Sa +ovl_En_Sb +ovl_En_Scene_Change +ovl_En_Sda +ovl_En_Shopnuts +ovl_En_Si +ovl_En_Siofuki +ovl_En_Skb +ovl_En_Skj +ovl_En_Skjneedle +ovl_En_Ssh +ovl_En_St +ovl_En_Sth +ovl_En_Stream +ovl_En_Sw +ovl_En_Syateki_Itm +ovl_En_Syateki_Man +ovl_En_Syateki_Niw +ovl_En_Ta +ovl_En_Takara_Man +ovl_En_Tana +ovl_En_Tg +ovl_En_Tite +ovl_En_Tk +ovl_En_Torch +ovl_En_Torch2 +ovl_En_Toryo +ovl_En_Tp +ovl_En_Tr +ovl_En_Trap +ovl_En_Tubo_Trap +ovl_En_Vali +ovl_En_Vase +ovl_En_Vb_Ball +ovl_En_Viewer +ovl_En_Vm +ovl_En_Wall_Tubo +ovl_En_Wallmas +ovl_En_Weather_Tag +ovl_En_Weiyer +ovl_En_Wf +ovl_En_Wonder_Item +ovl_En_Wonder_Talk +ovl_En_Wonder_Talk2 +ovl_En_Wood02 +ovl_En_Xc +ovl_En_Yabusame_Mark +ovl_En_Yukabyun +ovl_En_Zf +ovl_En_Zl1 +ovl_En_Zl2 +ovl_En_Zl3 +ovl_En_Zl4 +ovl_En_Zo +ovl_En_fHG +ovl_End_Title +ovl_Fishing +ovl_Item_B_Heart +ovl_Item_Etcetera +ovl_Item_Inbox +ovl_Item_Ocarina +ovl_Item_Shield +ovl_Magic_Dark +ovl_Magic_Fire +ovl_Magic_Wind +ovl_Mir_Ray +ovl_Obj_Bean +ovl_Obj_Blockstop +ovl_Obj_Bombiwa +ovl_Obj_Comb +ovl_Obj_Dekujr +ovl_Obj_Elevator +ovl_Obj_Hamishi +ovl_Obj_Hana +ovl_Obj_Hsblock +ovl_Obj_Ice_Poly +ovl_Obj_Kibako +ovl_Obj_Kibako2 +ovl_Obj_Lift +ovl_Obj_Lightswitch +ovl_Obj_Makekinsuta +ovl_Obj_Makeoshihiki +ovl_Obj_Mure +ovl_Obj_Mure2 +ovl_Obj_Mure3 +ovl_Obj_Oshihiki +ovl_Obj_Roomtimer +ovl_Obj_Switch +ovl_Obj_Syokudai +ovl_Obj_Timeblock +ovl_Obj_Tsubo +ovl_Obj_Warp2block +ovl_Object_Kankyo +ovl_Oceff_Spot +ovl_Oceff_Storm +ovl_Oceff_Wipe +ovl_Oceff_Wipe2 +ovl_Oceff_Wipe3 +ovl_Oceff_Wipe4 +ovl_Shot_Sun +gameplay_keep +gameplay_field_keep +gameplay_dangeon_keep +gameplay_object_exchange_static +object_link_boy +object_link_child +object_box +object_human +object_okuta +object_poh +object_wallmaster +object_dy_obj +object_firefly +object_dodongo +object_fire +object_niw +object_tite +object_reeba +object_peehat +object_kingdodongo +object_horse +object_zf +object_goma +object_zl1 +object_gol +object_bubble +object_dodojr +object_torch2 +object_bl +object_tp +object_oA1 +object_st +object_bw +object_ei +object_horse_normal +object_oB1 +object_o_anime +object_spot04_objects +object_ddan_objects +object_hidan_objects +object_horse_ganon +object_oA2 +object_spot00_objects +object_mb +object_bombf +object_sk2 +object_oE1 +object_oE_anime +object_oE2 +object_ydan_objects +object_gnd +object_am +object_dekubaba +object_oA3 +object_oA4 +object_oA5 +object_oA6 +object_oA7 +object_jj +object_oA8 +object_oA9 +object_oB2 +object_oB3 +object_oB4 +object_horse_zelda +object_opening_demo1 +object_warp1 +object_b_heart +object_dekunuts +object_oE3 +object_oE4 +object_menkuri_objects +object_oE5 +object_oE6 +object_oE7 +object_oE8 +object_oE9 +object_oE10 +object_oE11 +object_oE12 +object_vali +object_oA10 +object_oA11 +object_mizu_objects +object_fhg +object_ossan +object_mori_hineri1 +object_Bb +object_toki_objects +object_yukabyun +object_zl2 +object_mjin +object_mjin_flash +object_mjin_dark +object_mjin_flame +object_mjin_ice +object_mjin_soul +object_mjin_wind +object_mjin_oka +object_haka_objects +object_spot06_objects +object_ice_objects +object_relay_objects +object_mori_hineri1a +object_mori_hineri2 +object_mori_hineri2a +object_mori_objects +object_mori_tex +object_spot08_obj +object_warp2 +object_hata +object_bird +object_wood02 +object_lightbox +object_pu_box +object_trap +object_vase +object_im +object_ta +object_tk +object_xc +object_vm +object_bv +object_hakach_objects +object_efc_crystal_light +object_efc_fire_ball +object_efc_flash +object_efc_lgt_shower +object_efc_star_field +object_god_lgt +object_light_ring +object_triforce_spot +object_medal +object_bdan_objects +object_sd +object_rd +object_po_sisters +object_heavy_object +object_gndd +object_fd +object_du +object_fw +object_horse_link_child +object_spot02_objects +object_haka +object_ru1 +object_syokudai +object_fd2 +object_dh +object_rl +object_efc_tw +object_demo_tre_lgt +object_gi_key +object_mir_ray +object_brob +object_gi_jewel +object_spot09_obj +object_spot18_obj +object_bdoor +object_spot17_obj +object_shop_dungen +object_nb +object_mo +object_sb +object_gi_melody +object_gi_heart +object_gi_compass +object_gi_bosskey +object_gi_medal +object_gi_nuts +object_sa +object_gi_hearts +object_gi_arrowcase +object_gi_bombpouch +object_in +object_tr +object_spot16_obj +object_oE1s +object_oE4s +object_os_anime +object_gi_bottle +object_gi_stick +object_gi_map +object_oF1d_map +object_ru2 +object_gi_shield_1 +object_dekujr +object_gi_magicpot +object_gi_bomb_1 +object_oF1s +object_ma2 +object_gi_purse +object_hni +object_tw +object_rr +object_bxa +object_anubice +object_gi_gerudo +object_gi_arrow +object_gi_bomb_2 +object_gi_egg +object_gi_scale +object_gi_shield_2 +object_gi_hookshot +object_gi_ocarina +object_gi_milk +object_ma1 +object_ganon +object_sst +object_ny +object_fr +object_gi_pachinko +object_gi_boomerang +object_gi_bow +object_gi_glasses +object_gi_liquid +object_ani +object_demo_6k +object_gi_shield_3 +object_gi_letter +object_spot15_obj +object_jya_obj +object_gi_clothes +object_gi_bean +object_gi_fish +object_gi_saw +object_gi_hammer +object_gi_grass +object_gi_longsword +object_spot01_objects +object_md +object_km1 +object_kw1 +object_zo +object_kz +object_umajump +object_masterkokiri +object_masterkokirihead +object_mastergolon +object_masterzoora +object_aob +object_ik +object_ahg +object_cne +object_gi_niwatori +object_skj +object_gi_bottle_letter +object_bji +object_bba +object_gi_ocarina_0 +object_ds +object_ane +object_boj +object_spot03_object +object_spot07_object +object_fz +object_bob +object_ge1 +object_yabusame_point +object_gi_boots_2 +object_gi_seed +object_gnd_magic +object_d_elevator +object_d_hsblock +object_d_lift +object_mamenoki +object_goroiwa +object_toryo +object_daiku +object_nwc +object_blkobj +object_gm +object_ms +object_hs +object_ingate +object_lightswitch +object_kusa +object_tsubo +object_gi_gloves +object_gi_coin +object_kanban +object_gjyo_objects +object_owl +object_mk +object_fu +object_gi_ki_tan_mask +object_gi_redead_mask +object_gi_skj_mask +object_gi_rabit_mask +object_gi_truth_mask +object_ganon_objects +object_siofuki +object_stream +object_mm +object_fa +object_os +object_gi_eye_lotion +object_gi_powder +object_gi_mushroom +object_gi_ticketstone +object_gi_brokensword +object_js +object_cs +object_gi_prescription +object_gi_bracelet +object_gi_soldout +object_gi_frog +object_mag +object_door_gerudo +object_gt +object_efc_erupc +object_zl2_anime1 +object_zl2_anime2 +object_gi_golonmask +object_gi_zoramask +object_gi_gerudomask +object_ganon2 +object_ka +object_ts +object_zg +object_gi_hoverboots +object_gi_m_arrow +object_ds2 +object_ec +object_fish +object_gi_sutaru +object_gi_goddess +object_ssh +object_bigokuta +object_bg +object_spot05_objects +object_spot12_obj +object_bombiwa +object_hintnuts +object_rs +object_spot00_break +object_gla +object_shopnuts +object_geldb +object_gr +object_dog +object_jya_iron +object_jya_door +object_spot01_objects2 +object_spot11_obj +object_kibako2 +object_dns +object_dnk +object_gi_fire +object_gi_insect +object_gi_butterfly +object_gi_ghost +object_gi_soul +object_bowl +object_po_field +object_demo_kekkai +object_efc_doughnut +object_gi_dekupouch +object_ganon_anime1 +object_ganon_anime2 +object_ganon_anime3 +object_gi_rupy +object_spot01_matoya +object_spot01_matoyab +object_po_composer +object_mu +object_wf +object_skb +object_gj +object_geff +object_haka_door +object_gs +object_ps +object_bwall +object_crow +object_cow +object_cob +object_gi_sword_1 +object_door_killer +object_ouke_haka +object_timeblock +object_zl4 +g_pn_01 +g_pn_02 +g_pn_03 +g_pn_04 +g_pn_05 +g_pn_06 +g_pn_07 +g_pn_08 +g_pn_09 +g_pn_10 +g_pn_11 +g_pn_12 +g_pn_13 +g_pn_14 +g_pn_15 +g_pn_16 +g_pn_17 +g_pn_18 +g_pn_19 +g_pn_20 +g_pn_21 +g_pn_22 +g_pn_23 +g_pn_24 +g_pn_25 +g_pn_26 +g_pn_27 +g_pn_28 +g_pn_29 +g_pn_30 +g_pn_31 +g_pn_32 +g_pn_33 +g_pn_34 +g_pn_35 +g_pn_36 +g_pn_37 +g_pn_38 +g_pn_39 +g_pn_40 +g_pn_41 +g_pn_42 +g_pn_43 +g_pn_44 +g_pn_45 +g_pn_46 +g_pn_47 +g_pn_48 +g_pn_49 +g_pn_50 +g_pn_51 +g_pn_52 +g_pn_53 +g_pn_54 +g_pn_55 +g_pn_56 +g_pn_57 +z_select_static +nintendo_rogo_static +title_static +parameter_static +vr_fine0_static +vr_fine0_pal_static +vr_fine1_static +vr_fine1_pal_static +vr_fine2_static +vr_fine2_pal_static +vr_fine3_static +vr_fine3_pal_static +vr_cloud0_static +vr_cloud0_pal_static +vr_cloud1_static +vr_cloud1_pal_static +vr_cloud2_static +vr_cloud2_pal_static +vr_cloud3_static +vr_cloud3_pal_static +vr_holy0_static +vr_holy0_pal_static +vr_holy1_static +vr_holy1_pal_static +vr_MDVR_static +vr_MDVR_pal_static +vr_MNVR_static +vr_MNVR_pal_static +vr_RUVR_static +vr_RUVR_pal_static +vr_LHVR_static +vr_LHVR_pal_static +vr_KHVR_static +vr_KHVR_pal_static +vr_K3VR_static +vr_K3VR_pal_static +vr_K4VR_static +vr_K4VR_pal_static +vr_K5VR_static +vr_K5VR_pal_static +vr_SP1a_static +vr_SP1a_pal_static +vr_MLVR_static +vr_MLVR_pal_static +vr_KKRVR_static +vr_KKRVR_pal_static +vr_KR3VR_static +vr_KR3VR_pal_static +vr_IPVR_static +vr_IPVR_pal_static +vr_KSVR_static +vr_KSVR_pal_static +vr_GLVR_static +vr_GLVR_pal_static +vr_ZRVR_static +vr_ZRVR_pal_static +vr_DGVR_static +vr_DGVR_pal_static +vr_ALVR_static +vr_ALVR_pal_static +vr_NSVR_static +vr_NSVR_pal_static +vr_LBVR_static +vr_LBVR_pal_static +vr_TTVR_static +vr_TTVR_pal_static +vr_FCVR_static +vr_FCVR_pal_static +elf_message_field +elf_message_ydan +ydan_scene +ydan_room_0 +ydan_room_1 +ydan_room_2 +ydan_room_3 +ydan_room_4 +ydan_room_5 +ydan_room_6 +ydan_room_7 +ydan_room_8 +ydan_room_9 +ydan_room_10 +ydan_room_11 +ddan_scene +ddan_room_0 +ddan_room_1 +ddan_room_2 +ddan_room_3 +ddan_room_4 +ddan_room_5 +ddan_room_6 +ddan_room_7 +ddan_room_8 +ddan_room_9 +ddan_room_10 +ddan_room_11 +ddan_room_12 +ddan_room_13 +ddan_room_14 +ddan_room_15 +ddan_room_16 +bdan_scene +bdan_room_0 +bdan_room_1 +bdan_room_2 +bdan_room_3 +bdan_room_4 +bdan_room_5 +bdan_room_6 +bdan_room_7 +bdan_room_8 +bdan_room_9 +bdan_room_10 +bdan_room_11 +bdan_room_12 +bdan_room_13 +bdan_room_14 +bdan_room_15 +Bmori1_scene +Bmori1_room_0 +Bmori1_room_1 +Bmori1_room_2 +Bmori1_room_3 +Bmori1_room_4 +Bmori1_room_5 +Bmori1_room_6 +Bmori1_room_7 +Bmori1_room_8 +Bmori1_room_9 +Bmori1_room_10 +Bmori1_room_11 +Bmori1_room_12 +Bmori1_room_13 +Bmori1_room_14 +Bmori1_room_15 +Bmori1_room_16 +Bmori1_room_17 +Bmori1_room_18 +Bmori1_room_19 +Bmori1_room_20 +Bmori1_room_21 +Bmori1_room_22 +HIDAN_scene +HIDAN_room_0 +HIDAN_room_1 +HIDAN_room_2 +HIDAN_room_3 +HIDAN_room_4 +HIDAN_room_5 +HIDAN_room_6 +HIDAN_room_7 +HIDAN_room_8 +HIDAN_room_9 +HIDAN_room_10 +HIDAN_room_11 +HIDAN_room_12 +HIDAN_room_13 +HIDAN_room_14 +HIDAN_room_15 +HIDAN_room_16 +HIDAN_room_17 +HIDAN_room_18 +HIDAN_room_19 +HIDAN_room_20 +HIDAN_room_21 +HIDAN_room_22 +HIDAN_room_23 +HIDAN_room_24 +HIDAN_room_25 +HIDAN_room_26 +MIZUsin_scene +MIZUsin_room_0 +MIZUsin_room_1 +MIZUsin_room_2 +MIZUsin_room_3 +MIZUsin_room_4 +MIZUsin_room_5 +MIZUsin_room_6 +MIZUsin_room_7 +MIZUsin_room_8 +MIZUsin_room_9 +MIZUsin_room_10 +MIZUsin_room_11 +MIZUsin_room_12 +MIZUsin_room_13 +MIZUsin_room_14 +MIZUsin_room_15 +MIZUsin_room_16 +MIZUsin_room_17 +MIZUsin_room_18 +MIZUsin_room_19 +MIZUsin_room_20 +MIZUsin_room_21 +MIZUsin_room_22 +jyasinzou_scene +jyasinzou_room_0 +jyasinzou_room_1 +jyasinzou_room_2 +jyasinzou_room_3 +jyasinzou_room_4 +jyasinzou_room_5 +jyasinzou_room_6 +jyasinzou_room_7 +jyasinzou_room_8 +jyasinzou_room_9 +jyasinzou_room_10 +jyasinzou_room_11 +jyasinzou_room_12 +jyasinzou_room_13 +jyasinzou_room_14 +jyasinzou_room_15 +jyasinzou_room_16 +jyasinzou_room_17 +jyasinzou_room_18 +jyasinzou_room_19 +jyasinzou_room_20 +jyasinzou_room_21 +jyasinzou_room_22 +jyasinzou_room_23 +jyasinzou_room_24 +jyasinzou_room_25 +jyasinzou_room_26 +jyasinzou_room_27 +jyasinzou_room_28 +HAKAdan_scene +HAKAdan_room_0 +HAKAdan_room_1 +HAKAdan_room_2 +HAKAdan_room_3 +HAKAdan_room_4 +HAKAdan_room_5 +HAKAdan_room_6 +HAKAdan_room_7 +HAKAdan_room_8 +HAKAdan_room_9 +HAKAdan_room_10 +HAKAdan_room_11 +HAKAdan_room_12 +HAKAdan_room_13 +HAKAdan_room_14 +HAKAdan_room_15 +HAKAdan_room_16 +HAKAdan_room_17 +HAKAdan_room_18 +HAKAdan_room_19 +HAKAdan_room_20 +HAKAdan_room_21 +HAKAdan_room_22 +HAKAdanCH_scene +HAKAdanCH_room_0 +HAKAdanCH_room_1 +HAKAdanCH_room_2 +HAKAdanCH_room_3 +HAKAdanCH_room_4 +HAKAdanCH_room_5 +HAKAdanCH_room_6 +ice_doukutu_scene +ice_doukutu_room_0 +ice_doukutu_room_1 +ice_doukutu_room_2 +ice_doukutu_room_3 +ice_doukutu_room_4 +ice_doukutu_room_5 +ice_doukutu_room_6 +ice_doukutu_room_7 +ice_doukutu_room_8 +ice_doukutu_room_9 +ice_doukutu_room_10 +ice_doukutu_room_11 +men_scene +men_room_0 +men_room_1 +men_room_2 +men_room_3 +men_room_4 +men_room_5 +men_room_6 +men_room_7 +men_room_8 +men_room_9 +men_room_10 +ganontika_scene +ganontika_room_0 +ganontika_room_1 +ganontika_room_2 +ganontika_room_3 +ganontika_room_4 +ganontika_room_5 +ganontika_room_6 +ganontika_room_7 +ganontika_room_8 +ganontika_room_9 +ganontika_room_10 +ganontika_room_11 +ganontika_room_12 +ganontika_room_13 +ganontika_room_14 +ganontika_room_15 +ganontika_room_16 +ganontika_room_17 +ganontika_room_18 +ganontika_room_19 +spot00_scene +spot00_room_0 +spot01_scene +spot01_room_0 +spot02_scene +spot02_room_0 +spot02_room_1 +spot03_scene +spot03_room_0 +spot03_room_1 +spot04_scene +spot04_room_0 +spot04_room_1 +spot04_room_2 +spot05_scene +spot05_room_0 +spot06_scene +spot06_room_0 +spot07_scene +spot07_room_0 +spot07_room_1 +spot08_scene +spot08_room_0 +spot09_scene +spot09_room_0 +spot10_scene +spot10_room_0 +spot10_room_1 +spot10_room_2 +spot10_room_3 +spot10_room_4 +spot10_room_5 +spot10_room_6 +spot10_room_7 +spot10_room_8 +spot10_room_9 +spot11_scene +spot11_room_0 +spot12_scene +spot12_room_0 +spot12_room_1 +spot13_scene +spot13_room_0 +spot13_room_1 +spot15_scene +spot15_room_0 +spot16_scene +spot16_room_0 +spot17_scene +spot17_room_0 +spot17_room_1 +spot18_scene +spot18_room_0 +spot18_room_1 +spot18_room_2 +spot18_room_3 +market_day_scene +market_day_room_0 +market_night_scene +market_night_room_0 +kenjyanoma_scene +kenjyanoma_room_0 +tokinoma_scene +tokinoma_room_0 +tokinoma_room_1 +link_home_scene +link_home_room_0 +kokiri_shop_scene +kokiri_shop_room_0 +kokiri_home_scene +kokiri_home_room_0 +kakusiana_scene +kakusiana_room_0 +kakusiana_room_1 +kakusiana_room_2 +kakusiana_room_3 +kakusiana_room_4 +kakusiana_room_5 +kakusiana_room_6 +kakusiana_room_7 +kakusiana_room_8 +kakusiana_room_9 +kakusiana_room_10 +kakusiana_room_11 +kakusiana_room_12 +kakusiana_room_13 +entra_scene +entra_room_0 +moribossroom_scene +moribossroom_room_0 +moribossroom_room_1 +syatekijyou_scene +syatekijyou_room_0 +shop1_scene +shop1_room_0 +hairal_niwa_scene +hairal_niwa_room_0 +ganon_tou_scene +ganon_tou_room_0 +market_alley_scene +market_alley_room_0 +spot20_scene +spot20_room_0 +market_ruins_scene +market_ruins_room_0 +entra_n_scene +entra_n_room_0 +enrui_scene +enrui_room_0 +market_alley_n_scene +market_alley_n_room_0 +hiral_demo_scene +hiral_demo_room_0 +kokiri_home3_scene +kokiri_home3_room_0 +malon_stable_scene +malon_stable_room_0 +kakariko_scene +kakariko_room_0 +bdan_boss_scene +bdan_boss_room_0 +bdan_boss_room_1 +FIRE_bs_scene +FIRE_bs_room_0 +FIRE_bs_room_1 +hut_scene +hut_room_0 +daiyousei_izumi_scene +daiyousei_izumi_room_0 +hakaana_scene +hakaana_room_0 +yousei_izumi_tate_scene +yousei_izumi_tate_room_0 +yousei_izumi_yoko_scene +yousei_izumi_yoko_room_0 +golon_scene +golon_room_0 +zoora_scene +zoora_room_0 +drag_scene +drag_room_0 +alley_shop_scene +alley_shop_room_0 +night_shop_scene +night_shop_room_0 +impa_scene +impa_room_0 +labo_scene +labo_room_0 +tent_scene +tent_room_0 +nakaniwa_scene +nakaniwa_room_0 +ddan_boss_scene +ddan_boss_room_0 +ddan_boss_room_1 +ydan_boss_scene +ydan_boss_room_0 +ydan_boss_room_1 +HAKAdan_bs_scene +HAKAdan_bs_room_0 +HAKAdan_bs_room_1 +MIZUsin_bs_scene +MIZUsin_bs_room_0 +MIZUsin_bs_room_1 +ganon_scene +ganon_room_0 +ganon_room_1 +ganon_room_2 +ganon_room_3 +ganon_room_4 +ganon_room_5 +ganon_room_6 +ganon_room_7 +ganon_room_8 +ganon_room_9 +ganon_boss_scene +ganon_boss_room_0 +jyasinboss_scene +jyasinboss_room_0 +jyasinboss_room_1 +jyasinboss_room_2 +jyasinboss_room_3 +kokiri_home4_scene +kokiri_home4_room_0 +kokiri_home5_scene +kokiri_home5_room_0 +ganon_final_scene +ganon_final_room_0 +kakariko3_scene +kakariko3_room_0 +hakasitarelay_scene +hakasitarelay_room_0 +hakasitarelay_room_1 +hakasitarelay_room_2 +hakasitarelay_room_3 +hakasitarelay_room_4 +hakasitarelay_room_5 +hakasitarelay_room_6 +shrine_scene +shrine_room_0 +turibori_scene +turibori_room_0 +shrine_n_scene +shrine_n_room_0 +shrine_r_scene +shrine_r_room_0 +hakaana2_scene +hakaana2_room_0 +gerudoway_scene +gerudoway_room_0 +gerudoway_room_1 +gerudoway_room_2 +gerudoway_room_3 +gerudoway_room_4 +gerudoway_room_5 +hairal_niwa_n_scene +hairal_niwa_n_room_0 +bowling_scene +bowling_room_0 +hakaana_ouke_scene +hakaana_ouke_room_0 +hakaana_ouke_room_1 +hakaana_ouke_room_2 +hylia_labo_scene +hylia_labo_room_0 +souko_scene +souko_room_0 +souko_room_1 +souko_room_2 +miharigoya_scene +miharigoya_room_0 +mahouya_scene +mahouya_room_0 +takaraya_scene +takaraya_room_0 +takaraya_room_1 +takaraya_room_2 +takaraya_room_3 +takaraya_room_4 +takaraya_room_5 +takaraya_room_6 +ganon_sonogo_scene +ganon_sonogo_room_0 +ganon_sonogo_room_1 +ganon_sonogo_room_2 +ganon_sonogo_room_3 +ganon_sonogo_room_4 +ganon_demo_scene +ganon_demo_room_0 +face_shop_scene +face_shop_room_0 +kinsuta_scene +kinsuta_room_0 +ganontikasonogo_scene +ganontikasonogo_room_0 +ganontikasonogo_room_1 +bump_texture_static +anime_model_1_static +anime_model_2_static +anime_model_3_static +anime_model_4_static +anime_model_5_static +anime_model_6_static +anime_texture_1_static +anime_texture_2_static +anime_texture_3_static +anime_texture_4_static +anime_texture_5_static +anime_texture_6_static +softsprite_matrix_static \ No newline at end of file diff --git a/OTRExporter/CFG/filelists/gamecube_pal.txt b/OTRExporter/CFG/filelists/gamecube_pal.txt new file mode 100644 index 000000000..c9746c1da --- /dev/null +++ b/OTRExporter/CFG/filelists/gamecube_pal.txt @@ -0,0 +1,1510 @@ +makerom +boot +dmadata +Audiobank +Audioseq +Audiotable +link_animetion +icon_item_static +icon_item_24_static +icon_item_field_static +icon_item_dungeon_static +icon_item_gameover_static +icon_item_nes_static +icon_item_ger_static +icon_item_fra_static +item_name_static +map_name_static +do_action_static +message_static +message_texture_static +nes_font_static +nes_message_data_static +ger_message_data_static +fra_message_data_static +staff_message_data_static +map_grand_static +map_48x85_static +map_i_static +code +ovl_title +ovl_select +ovl_opening +ovl_file_choose +ovl_kaleido_scope +ovl_player_actor +ovl_map_mark_data +ovl_En_Test +ovl_Arms_Hook +ovl_Arrow_Fire +ovl_Arrow_Ice +ovl_Arrow_Light +ovl_Bg_Bdan_Objects +ovl_Bg_Bdan_Switch +ovl_Bg_Bom_Guard +ovl_Bg_Bombwall +ovl_Bg_Bowl_Wall +ovl_Bg_Breakwall +ovl_Bg_Ddan_Jd +ovl_Bg_Ddan_Kd +ovl_Bg_Dodoago +ovl_Bg_Dy_Yoseizo +ovl_Bg_Ganon_Otyuka +ovl_Bg_Gate_Shutter +ovl_Bg_Gjyo_Bridge +ovl_Bg_Gnd_Darkmeiro +ovl_Bg_Gnd_Firemeiro +ovl_Bg_Gnd_Iceblock +ovl_Bg_Gnd_Nisekabe +ovl_Bg_Gnd_Soulmeiro +ovl_Bg_Haka +ovl_Bg_Haka_Gate +ovl_Bg_Haka_Huta +ovl_Bg_Haka_Megane +ovl_Bg_Haka_MeganeBG +ovl_Bg_Haka_Sgami +ovl_Bg_Haka_Ship +ovl_Bg_Haka_Trap +ovl_Bg_Haka_Tubo +ovl_Bg_Haka_Water +ovl_Bg_Haka_Zou +ovl_Bg_Heavy_Block +ovl_Bg_Hidan_Curtain +ovl_Bg_Hidan_Dalm +ovl_Bg_Hidan_Firewall +ovl_Bg_Hidan_Fslift +ovl_Bg_Hidan_Fwbig +ovl_Bg_Hidan_Hamstep +ovl_Bg_Hidan_Hrock +ovl_Bg_Hidan_Kousi +ovl_Bg_Hidan_Kowarerukabe +ovl_Bg_Hidan_Rock +ovl_Bg_Hidan_Rsekizou +ovl_Bg_Hidan_Sekizou +ovl_Bg_Hidan_Sima +ovl_Bg_Hidan_Syoku +ovl_Bg_Ice_Objects +ovl_Bg_Ice_Shelter +ovl_Bg_Ice_Shutter +ovl_Bg_Ice_Turara +ovl_Bg_Ingate +ovl_Bg_Jya_1flift +ovl_Bg_Jya_Amishutter +ovl_Bg_Jya_Bigmirror +ovl_Bg_Jya_Block +ovl_Bg_Jya_Bombchuiwa +ovl_Bg_Jya_Bombiwa +ovl_Bg_Jya_Cobra +ovl_Bg_Jya_Goroiwa +ovl_Bg_Jya_Haheniron +ovl_Bg_Jya_Ironobj +ovl_Bg_Jya_Kanaami +ovl_Bg_Jya_Lift +ovl_Bg_Jya_Megami +ovl_Bg_Jya_Zurerukabe +ovl_Bg_Menkuri_Eye +ovl_Bg_Menkuri_Kaiten +ovl_Bg_Menkuri_Nisekabe +ovl_Bg_Mizu_Bwall +ovl_Bg_Mizu_Movebg +ovl_Bg_Mizu_Shutter +ovl_Bg_Mizu_Uzu +ovl_Bg_Mizu_Water +ovl_Bg_Mjin +ovl_Bg_Mori_Bigst +ovl_Bg_Mori_Elevator +ovl_Bg_Mori_Hashigo +ovl_Bg_Mori_Hashira4 +ovl_Bg_Mori_Hineri +ovl_Bg_Mori_Idomizu +ovl_Bg_Mori_Kaitenkabe +ovl_Bg_Mori_Rakkatenjo +ovl_Bg_Po_Event +ovl_Bg_Po_Syokudai +ovl_Bg_Pushbox +ovl_Bg_Relay_Objects +ovl_Bg_Spot00_Break +ovl_Bg_Spot00_Hanebasi +ovl_Bg_Spot01_Fusya +ovl_Bg_Spot01_Idohashira +ovl_Bg_Spot01_Idomizu +ovl_Bg_Spot01_Idosoko +ovl_Bg_Spot01_Objects2 +ovl_Bg_Spot02_Objects +ovl_Bg_Spot03_Taki +ovl_Bg_Spot05_Soko +ovl_Bg_Spot06_Objects +ovl_Bg_Spot07_Taki +ovl_Bg_Spot08_Bakudankabe +ovl_Bg_Spot08_Iceblock +ovl_Bg_Spot09_Obj +ovl_Bg_Spot11_Bakudankabe +ovl_Bg_Spot11_Oasis +ovl_Bg_Spot12_Gate +ovl_Bg_Spot12_Saku +ovl_Bg_Spot15_Rrbox +ovl_Bg_Spot15_Saku +ovl_Bg_Spot16_Bombstone +ovl_Bg_Spot16_Doughnut +ovl_Bg_Spot17_Bakudankabe +ovl_Bg_Spot17_Funen +ovl_Bg_Spot18_Basket +ovl_Bg_Spot18_Futa +ovl_Bg_Spot18_Obj +ovl_Bg_Spot18_Shutter +ovl_Bg_Sst_Floor +ovl_Bg_Toki_Hikari +ovl_Bg_Toki_Swd +ovl_Bg_Treemouth +ovl_Bg_Umajump +ovl_Bg_Vb_Sima +ovl_Bg_Ydan_Hasi +ovl_Bg_Ydan_Maruta +ovl_Bg_Ydan_Sp +ovl_Bg_Zg +ovl_Boss_Dodongo +ovl_Boss_Fd +ovl_Boss_Fd2 +ovl_Boss_Ganon +ovl_Boss_Ganon2 +ovl_Boss_Ganondrof +ovl_Boss_Goma +ovl_Boss_Mo +ovl_Boss_Sst +ovl_Boss_Tw +ovl_Boss_Va +ovl_Demo_6K +ovl_Demo_Du +ovl_Demo_Ec +ovl_Demo_Effect +ovl_Demo_Ext +ovl_Demo_Geff +ovl_Demo_Gj +ovl_Demo_Go +ovl_Demo_Gt +ovl_Demo_Ik +ovl_Demo_Im +ovl_Demo_Kankyo +ovl_Demo_Kekkai +ovl_Demo_Sa +ovl_Demo_Shd +ovl_Demo_Tre_Lgt +ovl_Door_Ana +ovl_Door_Gerudo +ovl_Door_Killer +ovl_Door_Shutter +ovl_Door_Toki +ovl_Door_Warp1 +ovl_Efc_Erupc +ovl_Eff_Dust +ovl_Effect_Ss_Blast +ovl_Effect_Ss_Bomb +ovl_Effect_Ss_Bomb2 +ovl_Effect_Ss_Bubble +ovl_Effect_Ss_D_Fire +ovl_Effect_Ss_Dead_Db +ovl_Effect_Ss_Dead_Dd +ovl_Effect_Ss_Dead_Ds +ovl_Effect_Ss_Dead_Sound +ovl_Effect_Ss_Dt_Bubble +ovl_Effect_Ss_Dust +ovl_Effect_Ss_En_Fire +ovl_Effect_Ss_En_Ice +ovl_Effect_Ss_Extra +ovl_Effect_Ss_Fcircle +ovl_Effect_Ss_Fhg_Flash +ovl_Effect_Ss_Fire_Tail +ovl_Effect_Ss_G_Fire +ovl_Effect_Ss_G_Magma +ovl_Effect_Ss_G_Magma2 +ovl_Effect_Ss_G_Ripple +ovl_Effect_Ss_G_Spk +ovl_Effect_Ss_G_Splash +ovl_Effect_Ss_Hahen +ovl_Effect_Ss_HitMark +ovl_Effect_Ss_Ice_Piece +ovl_Effect_Ss_Ice_Smoke +ovl_Effect_Ss_K_Fire +ovl_Effect_Ss_Kakera +ovl_Effect_Ss_KiraKira +ovl_Effect_Ss_Lightning +ovl_Effect_Ss_Sibuki +ovl_Effect_Ss_Sibuki2 +ovl_Effect_Ss_Solder_Srch_Ball +ovl_Effect_Ss_Stick +ovl_Effect_Ss_Stone1 +ovl_Elf_Msg +ovl_Elf_Msg2 +ovl_En_Am +ovl_En_Ani +ovl_En_Anubice +ovl_En_Anubice_Fire +ovl_En_Anubice_Tag +ovl_En_Arow_Trap +ovl_En_Arrow +ovl_En_Attack_Niw +ovl_En_Ba +ovl_En_Bb +ovl_En_Bdfire +ovl_En_Bigokuta +ovl_En_Bili +ovl_En_Bird +ovl_En_Blkobj +ovl_En_Bom +ovl_En_Bom_Bowl_Man +ovl_En_Bom_Bowl_Pit +ovl_En_Bom_Chu +ovl_En_Bombf +ovl_En_Boom +ovl_En_Box +ovl_En_Brob +ovl_En_Bubble +ovl_En_Butte +ovl_En_Bw +ovl_En_Bx +ovl_En_Changer +ovl_En_Clear_Tag +ovl_En_Cow +ovl_En_Crow +ovl_En_Cs +ovl_En_Daiku +ovl_En_Daiku_Kakariko +ovl_En_Dekubaba +ovl_En_Dekunuts +ovl_En_Dh +ovl_En_Dha +ovl_En_Diving_Game +ovl_En_Dns +ovl_En_Dnt_Demo +ovl_En_Dnt_Jiji +ovl_En_Dnt_Nomal +ovl_En_Dodojr +ovl_En_Dodongo +ovl_En_Dog +ovl_En_Door +ovl_En_Ds +ovl_En_Du +ovl_En_Dy_Extra +ovl_En_Eg +ovl_En_Eiyer +ovl_En_Elf +ovl_En_Encount1 +ovl_En_Encount2 +ovl_En_Ex_Item +ovl_En_Ex_Ruppy +ovl_En_Fd +ovl_En_Fd_Fire +ovl_En_Fhg_Fire +ovl_En_Fire_Rock +ovl_En_Firefly +ovl_En_Fish +ovl_En_Floormas +ovl_En_Fr +ovl_En_Fu +ovl_En_Fw +ovl_En_Fz +ovl_En_G_Switch +ovl_En_Ganon_Mant +ovl_En_Ganon_Organ +ovl_En_Gb +ovl_En_Ge1 +ovl_En_Ge2 +ovl_En_Ge3 +ovl_En_GeldB +ovl_En_GirlA +ovl_En_Gm +ovl_En_Go +ovl_En_Go2 +ovl_En_Goma +ovl_En_Goroiwa +ovl_En_Gs +ovl_En_Guest +ovl_En_Hata +ovl_En_Heishi1 +ovl_En_Heishi2 +ovl_En_Heishi3 +ovl_En_Heishi4 +ovl_En_Hintnuts +ovl_En_Holl +ovl_En_Honotrap +ovl_En_Horse +ovl_En_Horse_Game_Check +ovl_En_Horse_Ganon +ovl_En_Horse_Link_Child +ovl_En_Horse_Normal +ovl_En_Horse_Zelda +ovl_En_Hs +ovl_En_Hs2 +ovl_En_Hy +ovl_En_Ice_Hono +ovl_En_Ik +ovl_En_In +ovl_En_Insect +ovl_En_Ishi +ovl_En_It +ovl_En_Jj +ovl_En_Js +ovl_En_Jsjutan +ovl_En_Kakasi +ovl_En_Kakasi2 +ovl_En_Kakasi3 +ovl_En_Kanban +ovl_En_Karebaba +ovl_En_Ko +ovl_En_Kusa +ovl_En_Kz +ovl_En_Light +ovl_En_Lightbox +ovl_En_M_Fire1 +ovl_En_M_Thunder +ovl_En_Ma1 +ovl_En_Ma2 +ovl_En_Ma3 +ovl_En_Mag +ovl_En_Mb +ovl_En_Md +ovl_En_Mk +ovl_En_Mm +ovl_En_Mm2 +ovl_En_Ms +ovl_En_Mu +ovl_En_Nb +ovl_En_Niw +ovl_En_Niw_Girl +ovl_En_Niw_Lady +ovl_En_Nutsball +ovl_En_Nwc +ovl_En_Ny +ovl_En_OE2 +ovl_En_Okarina_Effect +ovl_En_Okarina_Tag +ovl_En_Okuta +ovl_En_Ossan +ovl_En_Owl +ovl_En_Part +ovl_En_Peehat +ovl_En_Po_Desert +ovl_En_Po_Field +ovl_En_Po_Relay +ovl_En_Po_Sisters +ovl_En_Poh +ovl_En_Pu_box +ovl_En_Rd +ovl_En_Reeba +ovl_En_River_Sound +ovl_En_Rl +ovl_En_Rr +ovl_En_Ru1 +ovl_En_Ru2 +ovl_En_Sa +ovl_En_Sb +ovl_En_Scene_Change +ovl_En_Sda +ovl_En_Shopnuts +ovl_En_Si +ovl_En_Siofuki +ovl_En_Skb +ovl_En_Skj +ovl_En_Skjneedle +ovl_En_Ssh +ovl_En_St +ovl_En_Sth +ovl_En_Stream +ovl_En_Sw +ovl_En_Syateki_Itm +ovl_En_Syateki_Man +ovl_En_Syateki_Niw +ovl_En_Ta +ovl_En_Takara_Man +ovl_En_Tana +ovl_En_Tg +ovl_En_Tite +ovl_En_Tk +ovl_En_Torch +ovl_En_Torch2 +ovl_En_Toryo +ovl_En_Tp +ovl_En_Tr +ovl_En_Trap +ovl_En_Tubo_Trap +ovl_En_Vali +ovl_En_Vase +ovl_En_Vb_Ball +ovl_En_Viewer +ovl_En_Vm +ovl_En_Wall_Tubo +ovl_En_Wallmas +ovl_En_Weather_Tag +ovl_En_Weiyer +ovl_En_Wf +ovl_En_Wonder_Item +ovl_En_Wonder_Talk +ovl_En_Wonder_Talk2 +ovl_En_Wood02 +ovl_En_Xc +ovl_En_Yabusame_Mark +ovl_En_Yukabyun +ovl_En_Zf +ovl_En_Zl1 +ovl_En_Zl2 +ovl_En_Zl3 +ovl_En_Zl4 +ovl_En_Zo +ovl_En_fHG +ovl_End_Title +ovl_Fishing +ovl_Item_B_Heart +ovl_Item_Etcetera +ovl_Item_Inbox +ovl_Item_Ocarina +ovl_Item_Shield +ovl_Magic_Dark +ovl_Magic_Fire +ovl_Magic_Wind +ovl_Mir_Ray +ovl_Obj_Bean +ovl_Obj_Blockstop +ovl_Obj_Bombiwa +ovl_Obj_Comb +ovl_Obj_Dekujr +ovl_Obj_Elevator +ovl_Obj_Hamishi +ovl_Obj_Hana +ovl_Obj_Hsblock +ovl_Obj_Ice_Poly +ovl_Obj_Kibako +ovl_Obj_Kibako2 +ovl_Obj_Lift +ovl_Obj_Lightswitch +ovl_Obj_Makekinsuta +ovl_Obj_Makeoshihiki +ovl_Obj_Mure +ovl_Obj_Mure2 +ovl_Obj_Mure3 +ovl_Obj_Oshihiki +ovl_Obj_Roomtimer +ovl_Obj_Switch +ovl_Obj_Syokudai +ovl_Obj_Timeblock +ovl_Obj_Tsubo +ovl_Obj_Warp2block +ovl_Object_Kankyo +ovl_Oceff_Spot +ovl_Oceff_Storm +ovl_Oceff_Wipe +ovl_Oceff_Wipe2 +ovl_Oceff_Wipe3 +ovl_Oceff_Wipe4 +ovl_Shot_Sun +gameplay_keep +gameplay_field_keep +gameplay_dangeon_keep +gameplay_object_exchange_static +object_link_boy +object_link_child +object_box +object_human +object_okuta +object_poh +object_wallmaster +object_dy_obj +object_firefly +object_dodongo +object_fire +object_niw +object_tite +object_reeba +object_peehat +object_kingdodongo +object_horse +object_zf +object_goma +object_zl1 +object_gol +object_bubble +object_dodojr +object_torch2 +object_bl +object_tp +object_oA1 +object_st +object_bw +object_ei +object_horse_normal +object_oB1 +object_o_anime +object_spot04_objects +object_ddan_objects +object_hidan_objects +object_horse_ganon +object_oA2 +object_spot00_objects +object_mb +object_bombf +object_sk2 +object_oE1 +object_oE_anime +object_oE2 +object_ydan_objects +object_gnd +object_am +object_dekubaba +object_oA3 +object_oA4 +object_oA5 +object_oA6 +object_oA7 +object_jj +object_oA8 +object_oA9 +object_oB2 +object_oB3 +object_oB4 +object_horse_zelda +object_opening_demo1 +object_warp1 +object_b_heart +object_dekunuts +object_oE3 +object_oE4 +object_menkuri_objects +object_oE5 +object_oE6 +object_oE7 +object_oE8 +object_oE9 +object_oE10 +object_oE11 +object_oE12 +object_vali +object_oA10 +object_oA11 +object_mizu_objects +object_fhg +object_ossan +object_mori_hineri1 +object_Bb +object_toki_objects +object_yukabyun +object_zl2 +object_mjin +object_mjin_flash +object_mjin_dark +object_mjin_flame +object_mjin_ice +object_mjin_soul +object_mjin_wind +object_mjin_oka +object_haka_objects +object_spot06_objects +object_ice_objects +object_relay_objects +object_mori_hineri1a +object_mori_hineri2 +object_mori_hineri2a +object_mori_objects +object_mori_tex +object_spot08_obj +object_warp2 +object_hata +object_bird +object_wood02 +object_lightbox +object_pu_box +object_trap +object_vase +object_im +object_ta +object_tk +object_xc +object_vm +object_bv +object_hakach_objects +object_efc_crystal_light +object_efc_fire_ball +object_efc_flash +object_efc_lgt_shower +object_efc_star_field +object_god_lgt +object_light_ring +object_triforce_spot +object_medal +object_bdan_objects +object_sd +object_rd +object_po_sisters +object_heavy_object +object_gndd +object_fd +object_du +object_fw +object_horse_link_child +object_spot02_objects +object_haka +object_ru1 +object_syokudai +object_fd2 +object_dh +object_rl +object_efc_tw +object_demo_tre_lgt +object_gi_key +object_mir_ray +object_brob +object_gi_jewel +object_spot09_obj +object_spot18_obj +object_bdoor +object_spot17_obj +object_shop_dungen +object_nb +object_mo +object_sb +object_gi_melody +object_gi_heart +object_gi_compass +object_gi_bosskey +object_gi_medal +object_gi_nuts +object_sa +object_gi_hearts +object_gi_arrowcase +object_gi_bombpouch +object_in +object_tr +object_spot16_obj +object_oE1s +object_oE4s +object_os_anime +object_gi_bottle +object_gi_stick +object_gi_map +object_oF1d_map +object_ru2 +object_gi_shield_1 +object_dekujr +object_gi_magicpot +object_gi_bomb_1 +object_oF1s +object_ma2 +object_gi_purse +object_hni +object_tw +object_rr +object_bxa +object_anubice +object_gi_gerudo +object_gi_arrow +object_gi_bomb_2 +object_gi_egg +object_gi_scale +object_gi_shield_2 +object_gi_hookshot +object_gi_ocarina +object_gi_milk +object_ma1 +object_ganon +object_sst +object_ny +object_fr +object_gi_pachinko +object_gi_boomerang +object_gi_bow +object_gi_glasses +object_gi_liquid +object_ani +object_demo_6k +object_gi_shield_3 +object_gi_letter +object_spot15_obj +object_jya_obj +object_gi_clothes +object_gi_bean +object_gi_fish +object_gi_saw +object_gi_hammer +object_gi_grass +object_gi_longsword +object_spot01_objects +object_md +object_km1 +object_kw1 +object_zo +object_kz +object_umajump +object_masterkokiri +object_masterkokirihead +object_mastergolon +object_masterzoora +object_aob +object_ik +object_ahg +object_cne +object_gi_niwatori +object_skj +object_gi_bottle_letter +object_bji +object_bba +object_gi_ocarina_0 +object_ds +object_ane +object_boj +object_spot03_object +object_spot07_object +object_fz +object_bob +object_ge1 +object_yabusame_point +object_gi_boots_2 +object_gi_seed +object_gnd_magic +object_d_elevator +object_d_hsblock +object_d_lift +object_mamenoki +object_goroiwa +object_toryo +object_daiku +object_nwc +object_blkobj +object_gm +object_ms +object_hs +object_ingate +object_lightswitch +object_kusa +object_tsubo +object_gi_gloves +object_gi_coin +object_kanban +object_gjyo_objects +object_owl +object_mk +object_fu +object_gi_ki_tan_mask +object_gi_redead_mask +object_gi_skj_mask +object_gi_rabit_mask +object_gi_truth_mask +object_ganon_objects +object_siofuki +object_stream +object_mm +object_fa +object_os +object_gi_eye_lotion +object_gi_powder +object_gi_mushroom +object_gi_ticketstone +object_gi_brokensword +object_js +object_cs +object_gi_prescription +object_gi_bracelet +object_gi_soldout +object_gi_frog +object_mag +object_door_gerudo +object_gt +object_efc_erupc +object_zl2_anime1 +object_zl2_anime2 +object_gi_golonmask +object_gi_zoramask +object_gi_gerudomask +object_ganon2 +object_ka +object_ts +object_zg +object_gi_hoverboots +object_gi_m_arrow +object_ds2 +object_ec +object_fish +object_gi_sutaru +object_gi_goddess +object_ssh +object_bigokuta +object_bg +object_spot05_objects +object_spot12_obj +object_bombiwa +object_hintnuts +object_rs +object_spot00_break +object_gla +object_shopnuts +object_geldb +object_gr +object_dog +object_jya_iron +object_jya_door +object_spot01_objects2 +object_spot11_obj +object_kibako2 +object_dns +object_dnk +object_gi_fire +object_gi_insect +object_gi_butterfly +object_gi_ghost +object_gi_soul +object_bowl +object_po_field +object_demo_kekkai +object_efc_doughnut +object_gi_dekupouch +object_ganon_anime1 +object_ganon_anime2 +object_ganon_anime3 +object_gi_rupy +object_spot01_matoya +object_spot01_matoyab +object_po_composer +object_mu +object_wf +object_skb +object_gj +object_geff +object_haka_door +object_gs +object_ps +object_bwall +object_crow +object_cow +object_cob +object_gi_sword_1 +object_door_killer +object_ouke_haka +object_timeblock +object_zl4 +g_pn_01 +g_pn_02 +g_pn_03 +g_pn_04 +g_pn_05 +g_pn_06 +g_pn_07 +g_pn_08 +g_pn_09 +g_pn_10 +g_pn_11 +g_pn_12 +g_pn_13 +g_pn_14 +g_pn_15 +g_pn_16 +g_pn_17 +g_pn_18 +g_pn_19 +g_pn_20 +g_pn_21 +g_pn_22 +g_pn_23 +g_pn_24 +g_pn_25 +g_pn_26 +g_pn_27 +g_pn_28 +g_pn_29 +g_pn_30 +g_pn_31 +g_pn_32 +g_pn_33 +g_pn_34 +g_pn_35 +g_pn_36 +g_pn_37 +g_pn_38 +g_pn_39 +g_pn_40 +g_pn_41 +g_pn_42 +g_pn_43 +g_pn_44 +g_pn_45 +g_pn_46 +g_pn_47 +g_pn_48 +g_pn_49 +g_pn_50 +g_pn_51 +g_pn_52 +g_pn_53 +g_pn_54 +g_pn_55 +g_pn_56 +g_pn_57 +z_select_static +nintendo_rogo_static +title_static +parameter_static +vr_fine0_static +vr_fine0_pal_static +vr_fine1_static +vr_fine1_pal_static +vr_fine2_static +vr_fine2_pal_static +vr_fine3_static +vr_fine3_pal_static +vr_cloud0_static +vr_cloud0_pal_static +vr_cloud1_static +vr_cloud1_pal_static +vr_cloud2_static +vr_cloud2_pal_static +vr_cloud3_static +vr_cloud3_pal_static +vr_holy0_static +vr_holy0_pal_static +vr_holy1_static +vr_holy1_pal_static +vr_MDVR_static +vr_MDVR_pal_static +vr_MNVR_static +vr_MNVR_pal_static +vr_RUVR_static +vr_RUVR_pal_static +vr_LHVR_static +vr_LHVR_pal_static +vr_KHVR_static +vr_KHVR_pal_static +vr_K3VR_static +vr_K3VR_pal_static +vr_K4VR_static +vr_K4VR_pal_static +vr_K5VR_static +vr_K5VR_pal_static +vr_SP1a_static +vr_SP1a_pal_static +vr_MLVR_static +vr_MLVR_pal_static +vr_KKRVR_static +vr_KKRVR_pal_static +vr_KR3VR_static +vr_KR3VR_pal_static +vr_IPVR_static +vr_IPVR_pal_static +vr_KSVR_static +vr_KSVR_pal_static +vr_GLVR_static +vr_GLVR_pal_static +vr_ZRVR_static +vr_ZRVR_pal_static +vr_DGVR_static +vr_DGVR_pal_static +vr_ALVR_static +vr_ALVR_pal_static +vr_NSVR_static +vr_NSVR_pal_static +vr_LBVR_static +vr_LBVR_pal_static +vr_TTVR_static +vr_TTVR_pal_static +vr_FCVR_static +vr_FCVR_pal_static +elf_message_field +elf_message_ydan +ydan_scene +ydan_room_0 +ydan_room_1 +ydan_room_2 +ydan_room_3 +ydan_room_4 +ydan_room_5 +ydan_room_6 +ydan_room_7 +ydan_room_8 +ydan_room_9 +ydan_room_10 +ydan_room_11 +ddan_scene +ddan_room_0 +ddan_room_1 +ddan_room_2 +ddan_room_3 +ddan_room_4 +ddan_room_5 +ddan_room_6 +ddan_room_7 +ddan_room_8 +ddan_room_9 +ddan_room_10 +ddan_room_11 +ddan_room_12 +ddan_room_13 +ddan_room_14 +ddan_room_15 +ddan_room_16 +bdan_scene +bdan_room_0 +bdan_room_1 +bdan_room_2 +bdan_room_3 +bdan_room_4 +bdan_room_5 +bdan_room_6 +bdan_room_7 +bdan_room_8 +bdan_room_9 +bdan_room_10 +bdan_room_11 +bdan_room_12 +bdan_room_13 +bdan_room_14 +bdan_room_15 +Bmori1_scene +Bmori1_room_0 +Bmori1_room_1 +Bmori1_room_2 +Bmori1_room_3 +Bmori1_room_4 +Bmori1_room_5 +Bmori1_room_6 +Bmori1_room_7 +Bmori1_room_8 +Bmori1_room_9 +Bmori1_room_10 +Bmori1_room_11 +Bmori1_room_12 +Bmori1_room_13 +Bmori1_room_14 +Bmori1_room_15 +Bmori1_room_16 +Bmori1_room_17 +Bmori1_room_18 +Bmori1_room_19 +Bmori1_room_20 +Bmori1_room_21 +Bmori1_room_22 +HIDAN_scene +HIDAN_room_0 +HIDAN_room_1 +HIDAN_room_2 +HIDAN_room_3 +HIDAN_room_4 +HIDAN_room_5 +HIDAN_room_6 +HIDAN_room_7 +HIDAN_room_8 +HIDAN_room_9 +HIDAN_room_10 +HIDAN_room_11 +HIDAN_room_12 +HIDAN_room_13 +HIDAN_room_14 +HIDAN_room_15 +HIDAN_room_16 +HIDAN_room_17 +HIDAN_room_18 +HIDAN_room_19 +HIDAN_room_20 +HIDAN_room_21 +HIDAN_room_22 +HIDAN_room_23 +HIDAN_room_24 +HIDAN_room_25 +HIDAN_room_26 +MIZUsin_scene +MIZUsin_room_0 +MIZUsin_room_1 +MIZUsin_room_2 +MIZUsin_room_3 +MIZUsin_room_4 +MIZUsin_room_5 +MIZUsin_room_6 +MIZUsin_room_7 +MIZUsin_room_8 +MIZUsin_room_9 +MIZUsin_room_10 +MIZUsin_room_11 +MIZUsin_room_12 +MIZUsin_room_13 +MIZUsin_room_14 +MIZUsin_room_15 +MIZUsin_room_16 +MIZUsin_room_17 +MIZUsin_room_18 +MIZUsin_room_19 +MIZUsin_room_20 +MIZUsin_room_21 +MIZUsin_room_22 +jyasinzou_scene +jyasinzou_room_0 +jyasinzou_room_1 +jyasinzou_room_2 +jyasinzou_room_3 +jyasinzou_room_4 +jyasinzou_room_5 +jyasinzou_room_6 +jyasinzou_room_7 +jyasinzou_room_8 +jyasinzou_room_9 +jyasinzou_room_10 +jyasinzou_room_11 +jyasinzou_room_12 +jyasinzou_room_13 +jyasinzou_room_14 +jyasinzou_room_15 +jyasinzou_room_16 +jyasinzou_room_17 +jyasinzou_room_18 +jyasinzou_room_19 +jyasinzou_room_20 +jyasinzou_room_21 +jyasinzou_room_22 +jyasinzou_room_23 +jyasinzou_room_24 +jyasinzou_room_25 +jyasinzou_room_26 +jyasinzou_room_27 +jyasinzou_room_28 +HAKAdan_scene +HAKAdan_room_0 +HAKAdan_room_1 +HAKAdan_room_2 +HAKAdan_room_3 +HAKAdan_room_4 +HAKAdan_room_5 +HAKAdan_room_6 +HAKAdan_room_7 +HAKAdan_room_8 +HAKAdan_room_9 +HAKAdan_room_10 +HAKAdan_room_11 +HAKAdan_room_12 +HAKAdan_room_13 +HAKAdan_room_14 +HAKAdan_room_15 +HAKAdan_room_16 +HAKAdan_room_17 +HAKAdan_room_18 +HAKAdan_room_19 +HAKAdan_room_20 +HAKAdan_room_21 +HAKAdan_room_22 +HAKAdanCH_scene +HAKAdanCH_room_0 +HAKAdanCH_room_1 +HAKAdanCH_room_2 +HAKAdanCH_room_3 +HAKAdanCH_room_4 +HAKAdanCH_room_5 +HAKAdanCH_room_6 +ice_doukutu_scene +ice_doukutu_room_0 +ice_doukutu_room_1 +ice_doukutu_room_2 +ice_doukutu_room_3 +ice_doukutu_room_4 +ice_doukutu_room_5 +ice_doukutu_room_6 +ice_doukutu_room_7 +ice_doukutu_room_8 +ice_doukutu_room_9 +ice_doukutu_room_10 +ice_doukutu_room_11 +men_scene +men_room_0 +men_room_1 +men_room_2 +men_room_3 +men_room_4 +men_room_5 +men_room_6 +men_room_7 +men_room_8 +men_room_9 +men_room_10 +ganontika_scene +ganontika_room_0 +ganontika_room_1 +ganontika_room_2 +ganontika_room_3 +ganontika_room_4 +ganontika_room_5 +ganontika_room_6 +ganontika_room_7 +ganontika_room_8 +ganontika_room_9 +ganontika_room_10 +ganontika_room_11 +ganontika_room_12 +ganontika_room_13 +ganontika_room_14 +ganontika_room_15 +ganontika_room_16 +ganontika_room_17 +ganontika_room_18 +ganontika_room_19 +spot00_scene +spot00_room_0 +spot01_scene +spot01_room_0 +spot02_scene +spot02_room_0 +spot02_room_1 +spot03_scene +spot03_room_0 +spot03_room_1 +spot04_scene +spot04_room_0 +spot04_room_1 +spot04_room_2 +spot05_scene +spot05_room_0 +spot06_scene +spot06_room_0 +spot07_scene +spot07_room_0 +spot07_room_1 +spot08_scene +spot08_room_0 +spot09_scene +spot09_room_0 +spot10_scene +spot10_room_0 +spot10_room_1 +spot10_room_2 +spot10_room_3 +spot10_room_4 +spot10_room_5 +spot10_room_6 +spot10_room_7 +spot10_room_8 +spot10_room_9 +spot11_scene +spot11_room_0 +spot12_scene +spot12_room_0 +spot12_room_1 +spot13_scene +spot13_room_0 +spot13_room_1 +spot15_scene +spot15_room_0 +spot16_scene +spot16_room_0 +spot17_scene +spot17_room_0 +spot17_room_1 +spot18_scene +spot18_room_0 +spot18_room_1 +spot18_room_2 +spot18_room_3 +market_day_scene +market_day_room_0 +market_night_scene +market_night_room_0 +kenjyanoma_scene +kenjyanoma_room_0 +tokinoma_scene +tokinoma_room_0 +tokinoma_room_1 +link_home_scene +link_home_room_0 +kokiri_shop_scene +kokiri_shop_room_0 +kokiri_home_scene +kokiri_home_room_0 +kakusiana_scene +kakusiana_room_0 +kakusiana_room_1 +kakusiana_room_2 +kakusiana_room_3 +kakusiana_room_4 +kakusiana_room_5 +kakusiana_room_6 +kakusiana_room_7 +kakusiana_room_8 +kakusiana_room_9 +kakusiana_room_10 +kakusiana_room_11 +kakusiana_room_12 +kakusiana_room_13 +entra_scene +entra_room_0 +moribossroom_scene +moribossroom_room_0 +moribossroom_room_1 +syatekijyou_scene +syatekijyou_room_0 +shop1_scene +shop1_room_0 +hairal_niwa_scene +hairal_niwa_room_0 +ganon_tou_scene +ganon_tou_room_0 +market_alley_scene +market_alley_room_0 +spot20_scene +spot20_room_0 +market_ruins_scene +market_ruins_room_0 +entra_n_scene +entra_n_room_0 +enrui_scene +enrui_room_0 +market_alley_n_scene +market_alley_n_room_0 +hiral_demo_scene +hiral_demo_room_0 +kokiri_home3_scene +kokiri_home3_room_0 +malon_stable_scene +malon_stable_room_0 +kakariko_scene +kakariko_room_0 +bdan_boss_scene +bdan_boss_room_0 +bdan_boss_room_1 +FIRE_bs_scene +FIRE_bs_room_0 +FIRE_bs_room_1 +hut_scene +hut_room_0 +daiyousei_izumi_scene +daiyousei_izumi_room_0 +hakaana_scene +hakaana_room_0 +yousei_izumi_tate_scene +yousei_izumi_tate_room_0 +yousei_izumi_yoko_scene +yousei_izumi_yoko_room_0 +golon_scene +golon_room_0 +zoora_scene +zoora_room_0 +drag_scene +drag_room_0 +alley_shop_scene +alley_shop_room_0 +night_shop_scene +night_shop_room_0 +impa_scene +impa_room_0 +labo_scene +labo_room_0 +tent_scene +tent_room_0 +nakaniwa_scene +nakaniwa_room_0 +ddan_boss_scene +ddan_boss_room_0 +ddan_boss_room_1 +ydan_boss_scene +ydan_boss_room_0 +ydan_boss_room_1 +HAKAdan_bs_scene +HAKAdan_bs_room_0 +HAKAdan_bs_room_1 +MIZUsin_bs_scene +MIZUsin_bs_room_0 +MIZUsin_bs_room_1 +ganon_scene +ganon_room_0 +ganon_room_1 +ganon_room_2 +ganon_room_3 +ganon_room_4 +ganon_room_5 +ganon_room_6 +ganon_room_7 +ganon_room_8 +ganon_room_9 +ganon_boss_scene +ganon_boss_room_0 +jyasinboss_scene +jyasinboss_room_0 +jyasinboss_room_1 +jyasinboss_room_2 +jyasinboss_room_3 +kokiri_home4_scene +kokiri_home4_room_0 +kokiri_home5_scene +kokiri_home5_room_0 +ganon_final_scene +ganon_final_room_0 +kakariko3_scene +kakariko3_room_0 +hakasitarelay_scene +hakasitarelay_room_0 +hakasitarelay_room_1 +hakasitarelay_room_2 +hakasitarelay_room_3 +hakasitarelay_room_4 +hakasitarelay_room_5 +hakasitarelay_room_6 +shrine_scene +shrine_room_0 +turibori_scene +turibori_room_0 +shrine_n_scene +shrine_n_room_0 +shrine_r_scene +shrine_r_room_0 +hakaana2_scene +hakaana2_room_0 +gerudoway_scene +gerudoway_room_0 +gerudoway_room_1 +gerudoway_room_2 +gerudoway_room_3 +gerudoway_room_4 +gerudoway_room_5 +hairal_niwa_n_scene +hairal_niwa_n_room_0 +bowling_scene +bowling_room_0 +hakaana_ouke_scene +hakaana_ouke_room_0 +hakaana_ouke_room_1 +hakaana_ouke_room_2 +hylia_labo_scene +hylia_labo_room_0 +souko_scene +souko_room_0 +souko_room_1 +souko_room_2 +miharigoya_scene +miharigoya_room_0 +mahouya_scene +mahouya_room_0 +takaraya_scene +takaraya_room_0 +takaraya_room_1 +takaraya_room_2 +takaraya_room_3 +takaraya_room_4 +takaraya_room_5 +takaraya_room_6 +ganon_sonogo_scene +ganon_sonogo_room_0 +ganon_sonogo_room_1 +ganon_sonogo_room_2 +ganon_sonogo_room_3 +ganon_sonogo_room_4 +ganon_demo_scene +ganon_demo_room_0 +face_shop_scene +face_shop_room_0 +kinsuta_scene +kinsuta_room_0 +ganontikasonogo_scene +ganontikasonogo_room_0 +ganontikasonogo_room_1 +bump_texture_static +anime_model_1_static +anime_model_2_static +anime_model_3_static +anime_model_4_static +anime_model_5_static +anime_model_6_static +anime_texture_1_static +anime_texture_2_static +anime_texture_3_static +anime_texture_4_static +anime_texture_5_static +anime_texture_6_static +softsprite_matrix_static \ No newline at end of file diff --git a/OTRExporter/OTRExporter/AnimationExporter.cpp b/OTRExporter/OTRExporter/AnimationExporter.cpp index 4f031b8a8..74fa8a7e6 100644 --- a/OTRExporter/OTRExporter/AnimationExporter.cpp +++ b/OTRExporter/OTRExporter/AnimationExporter.cpp @@ -49,12 +49,12 @@ void OTRExporter_Animation::Save(ZResource* res, const fs::path& outPath, Binary writer->Write((uint32_t)normalAnim->rotationValues.size()); - for (int i = 0; i < normalAnim->rotationValues.size(); i++) + for (size_t i = 0; i < normalAnim->rotationValues.size(); i++) writer->Write(normalAnim->rotationValues[i]); writer->Write((uint32_t)normalAnim->rotationIndices.size()); - for (int i = 0; i < normalAnim->rotationIndices.size(); i++) + for (size_t i = 0; i < normalAnim->rotationIndices.size(); i++) { writer->Write(normalAnim->rotationIndices[i].x); writer->Write(normalAnim->rotationIndices[i].y); diff --git a/OTRExporter/OTRExporter/ArrayExporter.cpp b/OTRExporter/OTRExporter/ArrayExporter.cpp index 2ddfd7b10..f83bfd87d 100644 --- a/OTRExporter/OTRExporter/ArrayExporter.cpp +++ b/OTRExporter/OTRExporter/ArrayExporter.cpp @@ -10,7 +10,7 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit writer->Write((uint32_t)arr->resList[0]->GetResourceType()); writer->Write((uint32_t)arr->arrayCnt); - for (int i = 0; i < arr->arrayCnt; i++) + for (size_t i = 0; i < arr->arrayCnt; i++) { if (arr->resList[i]->GetResourceType() == ZResourceType::Vertex) { @@ -32,7 +32,7 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit writer->Write((uint32_t)vec->scalarType); writer->Write((uint32_t)vec->dimensions); - for (int k = 0; k < vec->dimensions; k++) + for (size_t k = 0; k < vec->dimensions; k++) { // OTRTODO: Duplicate code here. Cleanup at a later date... switch (vec->scalarType) @@ -62,6 +62,8 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit writer->Write(vec->scalars[k].scalarData.u64); break; // OTRTODO: ADD OTHER TYPES + default: + break; } } } @@ -98,6 +100,8 @@ void OTRExporter_Array::Save(ZResource* res, const fs::path& outPath, BinaryWrit writer->Write(scal->scalarData.u64); break; // OTRTODO: ADD OTHER TYPES + default: + break; } } } diff --git a/OTRExporter/OTRExporter/CutsceneExporter.cpp b/OTRExporter/OTRExporter/CutsceneExporter.cpp index 7cbf7f175..b52d73d8b 100644 --- a/OTRExporter/OTRExporter/CutsceneExporter.cpp +++ b/OTRExporter/OTRExporter/CutsceneExporter.cpp @@ -29,7 +29,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries) { writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame)); - writer->Write(CMD_F(e->viewAngle)); + writer->Write(e->viewAngle); writer->Write(CMD_HH(e->posX, e->posY)); writer->Write(CMD_HH(e->posZ, e->unused)); } @@ -46,7 +46,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries) { writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame)); - writer->Write(CMD_F(e->viewAngle)); + writer->Write(e->viewAngle); writer->Write(CMD_HH(e->posX, e->posY)); writer->Write(CMD_HH(e->posZ, e->unused)); } @@ -105,7 +105,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries) { writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame)); - writer->Write(CMD_F(e->viewAngle)); + writer->Write(e->viewAngle); writer->Write(CMD_HH(e->posX, e->posY)); writer->Write(CMD_HH(e->posZ, e->unused)); } @@ -122,7 +122,7 @@ void OTRExporter_Cutscene::Save(ZResource* res, const fs::path& outPath, BinaryW for (auto& e : ((CutsceneCommandSetCameraPos*)cs->commands[i])->entries) { writer->Write(CMD_BBH(e->continueFlag, e->cameraRoll, e->nextPointFrame)); - writer->Write(CMD_F(e->viewAngle)); + writer->Write(e->viewAngle); writer->Write(CMD_HH(e->posX, e->posY)); writer->Write(CMD_HH(e->posZ, e->unused)); } diff --git a/OTRExporter/OTRExporter/DisplayListExporter.cpp b/OTRExporter/OTRExporter/DisplayListExporter.cpp index 4d4f067b1..d03a06333 100644 --- a/OTRExporter/OTRExporter/DisplayListExporter.cpp +++ b/OTRExporter/OTRExporter/DisplayListExporter.cpp @@ -29,20 +29,6 @@ Ab1, Ad1)) \ } -typedef int32_t Mtx_t[4][4]; - -typedef union Mtx -{ - //_Alignas(8) - Mtx_t m; - int32_t l[16]; - struct - { - int16_t i[16]; - uint16_t f[16]; - }; -} Mtx; - #define gsSPBranchLessZraw2(dl, vtx, zval) \ { _SHIFTL(G_BRANCH_Z,24,8)|_SHIFTL((vtx)*5,12,12)|_SHIFTL((vtx)*2,0,12),\ (unsigned int)(zval), } @@ -71,7 +57,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina // DEBUG: Write in a marker Declaration* dbgDecl = dList->parent->GetDeclaration(dList->GetRawDataIndex()); - std::string dbgName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dbgDecl->varName.c_str()); + std::string dbgName = StringHelper::Sprintf("%s/%s", GetParentFolderName(res).c_str(), dbgDecl->varName.c_str()); uint64_t hash = CRC64(dbgName.c_str()); writer->Write((uint32_t)(G_MARKER << 24)); writer->Write((uint32_t)0xBEEFBEEF); @@ -81,7 +67,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina auto dlStart = std::chrono::steady_clock::now(); //for (auto data : dList->instructions) - for (int dataIdx = 0; dataIdx < dList->instructions.size(); dataIdx++) + for (size_t dataIdx = 0; dataIdx < dList->instructions.size(); dataIdx++) { auto data = dList->instructions[dataIdx]; uint32_t word0 = 0; @@ -209,14 +195,14 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina break; case G_MTX: { - if ((!Globals::Instance->HasSegment(GETSEGNUM(data))) || ((data & 0xFFFFFFFF) == 0x07000000)) // En_Zf and En_Ny place a DL in segment 7 + if ((!Globals::Instance->HasSegment(GETSEGNUM(data), res->parent->workerID)) || ((data & 0xFFFFFFFF) == 0x07000000)) // En_Zf and En_Ny place a DL in segment 7 { uint32_t pp = (data & 0x000000FF00000000) >> 32; uint32_t mm = (data & 0x00000000FFFFFFFF); pp ^= G_MTX_PUSH; - mm = (mm & 0x0FFFFFFF) + 0xF0000000; + mm = (mm & 0x0FFFFFFF) + 1; Gfx value = gsSPMatrix(mm, pp); word0 = value.words.w0; @@ -243,7 +229,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina if (mtxDecl != nullptr) { - std::string vName = StringHelper::Sprintf("%s\\%s", (GetParentFolderName(res).c_str()), mtxDecl->varName.c_str()); + std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), mtxDecl->varName.c_str()); uint64_t hash = CRC64(vName.c_str()); @@ -347,7 +333,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina if (dListDecl != nullptr) { - std::string vName = StringHelper::Sprintf("%s\\%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str()); + std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str()); uint64_t hash = CRC64(vName.c_str()); @@ -370,7 +356,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina //std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str()); std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str()); - if (!File::Exists("Extract\\" + fName)) + if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName)) { MemoryStream* dlStream = new MemoryStream(); BinaryWriter dlWriter = BinaryWriter(dlStream); @@ -382,7 +368,10 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina //otrArchive->RemoveFile(fName); #endif - File::WriteAllBytes("Extract\\" + fName, dlStream->ToVector()); + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) + File::WriteAllBytes("Extract/" + fName, dlStream->ToVector()); + else + files[fName] = dlStream->ToVector(); //otrArchive->AddFile(fName, (uintptr_t)dlStream->ToVector().data(), dlWriter.GetBaseAddress()); } @@ -401,14 +390,14 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina //case G_BRANCH_Z: case G_DL: { - if ((!Globals::Instance->HasSegment(GETSEGNUM(data)) && (int)opF3D != G_BRANCH_Z) + if ((!Globals::Instance->HasSegment(GETSEGNUM(data), res->parent->workerID) && (int)opF3D != G_BRANCH_Z) || ((data & 0xFFFFFFFF) == 0x07000000)) // En_Zf and En_Ny place a DL in segment 7 { int32_t pp = (data & 0x00FF000000000000) >> 56; Gfx value; - u32 dListVal = (data & 0x0FFFFFFF) + 0xF0000000; + u32 dListVal = (data & 0x0FFFFFFF) + 1; if (pp != 0) value = gsSPBranchList(dListVal); @@ -441,7 +430,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina if (dListDecl != nullptr) { - std::string vName = StringHelper::Sprintf("%s\\%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str()); + std::string vName = StringHelper::Sprintf("%s/%s", (GetParentFolderName(res).c_str()), dListDecl->varName.c_str()); uint64_t hash = CRC64(vName.c_str()); @@ -464,14 +453,17 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina //std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), dListDecl2->varName.c_str()); std::string fName = OTRExporter_DisplayList::GetPathToRes(res, dListDecl2->varName.c_str()); - if (!File::Exists("Extract\\" + fName)) + if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName)) { MemoryStream* dlStream = new MemoryStream(); BinaryWriter dlWriter = BinaryWriter(dlStream); Save(dList->otherDLists[i], outPath, &dlWriter); - File::WriteAllBytes("Extract\\" + fName, dlStream->ToVector()); + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) + File::WriteAllBytes("Extract/" + fName, dlStream->ToVector()); + else + files[fName] = dlStream->ToVector(); } } else @@ -527,7 +519,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina int32_t bb = ((data & 0x0000FF0000000000ULL) >> 40) / 2; int32_t cc = ((data & 0x000000FF00000000ULL) >> 32) / 2; int32_t dd = ((data & 0x000000000000FFULL)) / 2; - + Gfx test = gsSP1Quadrangle(aa, bb, cc, dd, 0); word0 = test.words.w0; word1 = test.words.w1; @@ -661,7 +653,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina { int sss = (data & 0x00FFF00000000000) >> 44; int ttt = (data & 0x00000FFF00000000) >> 32; - int i = (data & 0x000000000F000000) >> 16; + int i = (data & 0x000000000F000000) >> 24; int uuu = (data & 0x0000000000FFF000) >> 12; int vvv= (data & 0x0000000000000FFF); @@ -675,7 +667,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina uint32_t seg = data & 0xFFFFFFFF; int32_t texAddress = Seg2Filespace(data, dList->parent->baseAddress); - if (!Globals::Instance->HasSegment(GETSEGNUM(seg))) + if (!Globals::Instance->HasSegment(GETSEGNUM(seg), res->parent->workerID)) { int32_t __ = (data & 0x00FF000000000000) >> 48; int32_t www = (data & 0x00000FFF00000000) >> 32; @@ -683,7 +675,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina uint32_t fmt = (__ & 0xE0) >> 5; uint32_t siz = (__ & 0x18) >> 3; - Gfx value = gsDPSetTextureImage(fmt, siz, www - 1, (seg & 0x0FFFFFFF) + 0xF0000000); + Gfx value = gsDPSetTextureImage(fmt, siz, www + 1, (seg & 0x0FFFFFFF) + 1); word0 = value.words.w0; word1 = value.words.w1; @@ -693,7 +685,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina else { std::string texName = ""; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, dList->parent, "", texName); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, dList->parent, "", texName, res->parent->workerID); int32_t __ = (data & 0x00FF000000000000) >> 48; int32_t www = (data & 0x00000FFF00000000) >> 32; @@ -701,7 +693,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina uint32_t fmt = (__ & 0xE0) >> 5; uint32_t siz = (__ & 0x18) >> 3; - Gfx value = gsDPSetTextureImage(fmt, siz, www - 1, __); + Gfx value = gsDPSetTextureImage(fmt, siz, www + 1, __); word0 = value.words.w0 & 0x00FFFFFF; word0 += (G_SETTIMG_OTR << 24); //word1 = value.words.w1; @@ -712,10 +704,10 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina if (foundDecl) { - ZFile* assocFile = Globals::Instance->GetSegment(GETSEGNUM(seg)); + ZFile* assocFile = Globals::Instance->GetSegment(GETSEGNUM(seg), res->parent->workerID); std::string assocFileName = assocFile->GetName(); std::string fName = ""; - + if (GETSEGNUM(seg) == SEGMENT_SCENE || GETSEGNUM(seg) == SEGMENT_ROOM) fName = GetPathToRes(res, texName.c_str()); else @@ -747,45 +739,10 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina Gfx value = gsSPVertex(data & 0xFFFFFFFF, nn, ((aa >> 1) - nn)); word0 = value.words.w0; - word1 = value.words.w1 | 0xF0000000; + word1 = value.words.w1 | 1; } else - //if (dList->vertices.size() > 0) { - // Connect neighboring vertex arrays - std::vector>> vertsKeys(dList->vertices.begin(), - dList->vertices.end()); - - if (vertsKeys.size() > 0) - { - auto lastItem = vertsKeys[0]; - - for (size_t i = 1; i < vertsKeys.size(); i++) - { - auto curItem = vertsKeys[i]; - - int32_t sizeDiff = curItem.first - (lastItem.first + (lastItem.second.size() * 16)); - - // Make sure there isn't an unaccounted inbetween these two - if (sizeDiff == 0) - { - for (auto v : curItem.second) - { - dList->vertices[lastItem.first].push_back(v); - lastItem.second.push_back(v); - } - - dList->vertices.erase(curItem.first); - vertsKeys.erase(vertsKeys.begin() + i); - - i--; - continue; - } - - lastItem = curItem; - } - } - // Write CRC64 of vtx file name uint32_t addr = data & 0xFFFFFFFF; @@ -793,10 +750,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina addr -= dList->parent->baseAddress; auto segOffset = GETSEGOFFSET(addr); - //uint32_t seg = data & 0xFFFFFFFF; Declaration* vtxDecl = dList->parent->GetDeclarationRanged(segOffset); - //std::string vtxName = ""; - //bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, dList->parent, "", vtxName); int32_t aa = (data & 0x000000FF00000000ULL) >> 32; int32_t nn = (data & 0x000FF00000000000ULL) >> 44; @@ -822,9 +776,8 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina word0 = hash >> 32; word1 = hash & 0xFFFFFFFF; - if (!File::Exists("Extract\\" + fName)) + if (files.find(fName) == files.end() && !File::Exists("Extract/" + fName)) { - //printf("Exporting VTX Data %s\n", fName.c_str()); // Write vertices to file MemoryStream* vtxStream = new MemoryStream(); BinaryWriter vtxWriter = BinaryWriter(vtxStream); @@ -833,7 +786,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina auto split = StringHelper::Split(vtxDecl->text, "\n"); - for (int i = 0; i < split.size(); i++) + for (size_t i = 0; i < split.size(); i++) { std::string line = split[i]; @@ -847,44 +800,40 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina vtxWriter.Write((uint32_t)ZResourceType::Vertex); vtxWriter.Write((uint32_t)arrCnt); - size_t sz = dList->vertices[vtxDecl->address].size(); + auto start = std::chrono::steady_clock::now(); - //if (sz > 0) + // God dammit this is so dumb + for (size_t i = 0; i < split.size(); i++) { - auto start = std::chrono::steady_clock::now(); + std::string line = split[i]; - // God dammit this is so dumb - for (size_t i = 0; i < split.size(); i++) + if (StringHelper::Contains(line, "VTX(")) { - std::string line = split[i]; + auto split2 = StringHelper::Split(StringHelper::Split(StringHelper::Split(line, "VTX(")[1], ")")[0], ","); - if (StringHelper::Contains(line, "VTX(")) - { - auto split2 = StringHelper::Split(StringHelper::Split(StringHelper::Split(line, "VTX(")[1], ")")[0], ","); + vtxWriter.Write((int16_t)std::stoi(split2[0], nullptr, 10)); // v.x + vtxWriter.Write((int16_t)std::stoi(split2[1], nullptr, 10)); // v.y + vtxWriter.Write((int16_t)std::stoi(split2[2], nullptr, 10)); // v.z - vtxWriter.Write((int16_t)std::stoi(split2[0], nullptr, 10)); // v.x - vtxWriter.Write((int16_t)std::stoi(split2[1], nullptr, 10)); // v.y - vtxWriter.Write((int16_t)std::stoi(split2[2], nullptr, 10)); // v.z + vtxWriter.Write((int16_t)0); // v.flag - vtxWriter.Write((int16_t)0); // v.flag - - vtxWriter.Write((int16_t)std::stoi(split2[3], nullptr, 10)); // v.s - vtxWriter.Write((int16_t)std::stoi(split2[4], nullptr, 10)); // v.t - - vtxWriter.Write((uint8_t)std::stoi(split2[5], nullptr, 10)); // v.r - vtxWriter.Write((uint8_t)std::stoi(split2[6], nullptr, 10)); // v.g - vtxWriter.Write((uint8_t)std::stoi(split2[7], nullptr, 10)); // v.b - vtxWriter.Write((uint8_t)std::stoi(split2[8], nullptr, 10)); // v.a - } + vtxWriter.Write((int16_t)std::stoi(split2[3], nullptr, 10)); // v.s + vtxWriter.Write((int16_t)std::stoi(split2[4], nullptr, 10)); // v.t + + vtxWriter.Write((uint8_t)std::stoi(split2[5], nullptr, 10)); // v.r + vtxWriter.Write((uint8_t)std::stoi(split2[6], nullptr, 10)); // v.g + vtxWriter.Write((uint8_t)std::stoi(split2[7], nullptr, 10)); // v.b + vtxWriter.Write((uint8_t)std::stoi(split2[8], nullptr, 10)); // v.a } - - File::WriteAllBytes("Extract\\" + fName, vtxStream->ToVector()); - - auto end = std::chrono::steady_clock::now(); - size_t diff = std::chrono::duration_cast(end - start).count(); - - //printf("Exported VTX Array %s in %zums\n", fName.c_str(), diff); } + + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) + File::WriteAllBytes("Extract/" + fName, vtxStream->ToVector()); + else + files[fName] = vtxStream->ToVector(); + + auto end = std::chrono::steady_clock::now(); + size_t diff = std::chrono::duration_cast(end - start).count(); } } else @@ -892,19 +841,10 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina spdlog::error("vtxDecl == nullptr!"); } } - /*else - { - writer->Write(word0); - writer->Write(word1); - word0 = 0; - word1 = 0; - - spdlog::error("dList->vertices.size() <= 0!"); - }*/ } break; } - + writer->Write(word0); writer->Write(word1); } @@ -918,7 +858,7 @@ void OTRExporter_DisplayList::Save(ZResource* res, const fs::path& outPath, Bina std::string OTRExporter_DisplayList::GetPathToRes(ZResource* res, std::string varName) { std::string prefix = GetPrefix(res); - std::string fName = StringHelper::Sprintf("%s\\%s", GetParentFolderName(res).c_str(), varName.c_str()); + std::string fName = StringHelper::Sprintf("%s/%s", GetParentFolderName(res).c_str(), varName.c_str()); return fName; } @@ -932,7 +872,7 @@ std::string OTRExporter_DisplayList::GetParentFolderName(ZResource* res) { auto split = StringHelper::Split(oName, "_"); oName = ""; - for (int i = 0; i < split.size() - 1; i++) + for (size_t i = 0; i < split.size() - 1; i++) oName += split[i] + "_"; oName += "scene"; @@ -943,7 +883,7 @@ std::string OTRExporter_DisplayList::GetParentFolderName(ZResource* res) } if (prefix != "") - oName = prefix + "\\" + oName; + oName = prefix + "/" + oName; return oName; } diff --git a/OTRExporter/OTRExporter/Main.cpp b/OTRExporter/OTRExporter/Main.cpp index 24a156fe9..2ed9cb427 100644 --- a/OTRExporter/OTRExporter/Main.cpp +++ b/OTRExporter/OTRExporter/Main.cpp @@ -25,6 +25,7 @@ std::string otrFileName = "oot.otr"; std::shared_ptr otrArchive; BinaryWriter* fileWriter; std::chrono::steady_clock::time_point fileStart, resStart; +std::map> files; void InitVersionInfo(); @@ -39,6 +40,8 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM { fileMode = (ZFileMode)ExporterFileMode::BuildOTR; + printf("BOTR: Generating OTR Archive...\n"); + if (File::Exists(otrFileName)) otrArchive = std::shared_ptr(new Ship::Archive(otrFileName, true)); else @@ -49,11 +52,40 @@ static void ExporterParseFileMode(const std::string& buildMode, ZFileMode& fileM for (auto item : lst) { auto fileData = File::ReadAllBytes(item); - otrArchive->AddFile(StringHelper::Split(item, "Extract\\")[1], (uintptr_t)fileData.data(), fileData.size()); + otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size()); } } } +static void ExporterProgramEnd() +{ + if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory) + { + printf("Generating OTR Archive...\n"); + otrArchive = Ship::Archive::CreateArchive(otrFileName, 65536 / 2); + + for (auto item : files) + { + auto fileData = item.second; + otrArchive->AddFile(item.first, (uintptr_t)fileData.data(), fileData.size()); + } + + // Add any additional files that need to be manually copied... + auto lst = Directory::ListFiles("Extract"); + + for (auto item : lst) + { + auto fileData = File::ReadAllBytes(item); + otrArchive->AddFile(StringHelper::Split(item, "Extract/")[1], (uintptr_t)fileData.data(), fileData.size()); + } + + otrArchive->AddFile("Audiobank", (uintptr_t)Globals::Instance->GetBaseromFile("Audiobank").data(), Globals::Instance->GetBaseromFile("Audiobank").size()); + otrArchive->AddFile("Audioseq", (uintptr_t)Globals::Instance->GetBaseromFile("Audioseq").data(), Globals::Instance->GetBaseromFile("Audioseq").size()); + otrArchive->AddFile("Audiotable", (uintptr_t)Globals::Instance->GetBaseromFile("Audiotable").data(), Globals::Instance->GetBaseromFile("Audiotable").size()); + } +} + + static void ExporterParseArgs(int argc, char* argv[], int& i) { std::string arg = argv[i]; @@ -85,6 +117,7 @@ static void ExporterFileBegin(ZFile* file) static void ExporterFileEnd(ZFile* file) { + // delete fileWriter; } static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer) @@ -107,7 +140,7 @@ static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer) { auto split = StringHelper::Split(oName, "_"); oName = ""; - for (int i = 0; i < split.size() - 1; i++) + for (size_t i = 0; i < split.size() - 1; i++) oName += split[i] + "_"; oName += "scene"; @@ -120,11 +153,14 @@ static void ExporterResourceEnd(ZResource* res, BinaryWriter& writer) std::string fName = ""; if (prefix != "") - fName = StringHelper::Sprintf("%s\\%s\\%s", prefix.c_str(), oName.c_str(), rName.c_str()); + fName = StringHelper::Sprintf("%s/%s/%s", prefix.c_str(), oName.c_str(), rName.c_str()); else - fName = StringHelper::Sprintf("%s\\%s", oName.c_str(), rName.c_str()); + fName = StringHelper::Sprintf("%s/%s", oName.c_str(), rName.c_str()); - File::WriteAllBytes("Extract\\" + fName, strem->ToVector()); + if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory) + files[fName] = strem->ToVector(); + else + File::WriteAllBytes("Extract/" + fName, strem->ToVector()); } auto end = std::chrono::steady_clock::now(); @@ -155,6 +191,8 @@ static void ImportExporters() exporterSet->beginXMLFunc = ExporterXMLBegin; exporterSet->endXMLFunc = ExporterXMLEnd; exporterSet->resSaveFunc = ExporterResourceEnd; + exporterSet->endProgramFunc = ExporterProgramEnd; + exporterSet->exporters[ZResourceType::Background] = new OTRExporter_Background(); exporterSet->exporters[ZResourceType::Texture] = new OTRExporter_Texture(); exporterSet->exporters[ZResourceType::Room] = new OTRExporter_Room(); diff --git a/OTRExporter/OTRExporter/Main.h b/OTRExporter/OTRExporter/Main.h index a29e21859..af4ada763 100644 --- a/OTRExporter/OTRExporter/Main.h +++ b/OTRExporter/OTRExporter/Main.h @@ -2,4 +2,5 @@ #include -extern std::shared_ptr otrArchive; \ No newline at end of file +extern std::shared_ptr otrArchive; +extern std::map> files; \ No newline at end of file diff --git a/OTRExporter/OTRExporter/Makefile b/OTRExporter/OTRExporter/Makefile index 1c4e61bf2..954b183a3 100644 --- a/OTRExporter/OTRExporter/Makefile +++ b/OTRExporter/OTRExporter/Makefile @@ -39,13 +39,13 @@ D_FILES := $(O_FILES:%.o=%.d) LIB := OTRExporter.a INC_DIRS := $(addprefix -I, \ - ../../ZAPD/ZAPD \ - ../../ZAPD/lib/tinyxml2 \ - ../../ZAPD/lib/libgfxd \ - ../../ZAPD/ZAPDUtils \ - ../../OtrLib/otrlib \ - ../../OtrLib/otrlib/Lib/spdlog/include \ - ../../OtrLib/otrlib/Lib/Fast3D/U64 \ + ../../ZAPDTR/ZAPD \ + ../../ZAPDTR/lib/tinyxml2 \ + ../../ZAPDTR/lib/libgfxd \ + ../../ZAPDTR/ZAPDUtils \ + ../../libultraship/libultraship \ + ../../libultraship/libultraship/Lib/spdlog/include \ + ../../libultraship/libultraship/Lib/Fast3D/U64 \ ) # create build directories diff --git a/OTRExporter/OTRExporter/OTRExporter.vcxproj b/OTRExporter/OTRExporter/OTRExporter.vcxproj index 96531304b..4ed7d72e1 100644 --- a/OTRExporter/OTRExporter/OTRExporter.vcxproj +++ b/OTRExporter/OTRExporter/OTRExporter.vcxproj @@ -63,6 +63,12 @@ + + + {02d10590-9542-3f55-aaf8-6055677e2a2a} + false + + 16.0 Win32Proj @@ -118,19 +124,31 @@ true $(SolutionDir)otrlib;$(SolutionDir)\ZAPD\ZAPD\;$(SolutionDir)\ZAPD\lib\tinyxml2;$(SolutionDir)\ZAPD\lib\libgfxd;$(SolutionDir)\ZAPD\lib\elfio;$(SolutionDir)\ZAPD\lib\assimp\include;$(SolutionDir)\ZAPD\lib\stb;$(ProjectDir);$(IncludePath) + MinimumRecommendedRules.ruleset + + false + MinimumRecommendedRules.ruleset + + true $(ProjectDir)..\..\ZAPDTR\ZAPD;$(ProjectDir)..\..\ZAPDTR\lib\tinyxml2;$(ProjectDir)..\..\ZAPDTR\lib\libgfxd;$(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)..\..\libultraship\libultraship;$(ProjectDir)..\..\libultraship\libultraship\lib\spdlog\include;$(ProjectDir)..\..\libultraship\libultraship\Lib\Fast3D\U64;$(IncludePath) $(ProjectDir)..\..\libultraship\libultraship;$(LibraryPath) + MinimumRecommendedRules.ruleset + + false $(ProjectDir)..\..\ZAPDTR\ZAPD;$(ProjectDir)..\..\ZAPDTR\lib\tinyxml2;$(ProjectDir)..\..\ZAPDTR\lib\libgfxd;$(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)..\..\libultraship\libultraship;$(ProjectDir)..\..\libultraship\libultraship\lib\spdlog\include;$(ProjectDir)..\..\libultraship\libultraship\Lib\Fast3D\U64;$(IncludePath) $(ProjectDir)..\..\libultraship\libultraship;$(LibraryPath) + MinimumRecommendedRules.ruleset + + diff --git a/OTRExporter/OTRExporter/PathExporter.cpp b/OTRExporter/OTRExporter/PathExporter.cpp index de15789ab..75f6b723f 100644 --- a/OTRExporter/OTRExporter/PathExporter.cpp +++ b/OTRExporter/OTRExporter/PathExporter.cpp @@ -9,11 +9,11 @@ void OTRExporter_Path::Save(ZResource* res, const fs::path& outPath, BinaryWrite writer->Write((uint32_t)path->pathways.size()); - for (int k = 0; k < path->pathways.size(); k++) + for (size_t k = 0; k < path->pathways.size(); k++) { writer->Write((uint32_t)path->pathways[k].points.size()); - for (int i = 0; i < path->pathways[k].points.size(); i++) + for (size_t i = 0; i < path->pathways[k].points.size(); i++) { writer->Write(path->pathways[k].points[i].scalars[0].scalarData.s16); writer->Write(path->pathways[k].points[i].scalars[1].scalarData.s16); diff --git a/OTRExporter/OTRExporter/RoomExporter.cpp b/OTRExporter/OTRExporter/RoomExporter.cpp index 622901aff..9a5704bbc 100644 --- a/OTRExporter/OTRExporter/RoomExporter.cpp +++ b/OTRExporter/OTRExporter/RoomExporter.cpp @@ -46,7 +46,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite for (size_t i = 0; i < room->commands.size(); i++) { ZRoomCommand* cmd = room->commands[i]; - + writer->Write((uint32_t)cmd->cmdID); switch (cmd->cmdID) @@ -172,7 +172,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite writer->Write((uint32_t)cmdCsCam->points.size()); - for (int i = 0; i < cmdCsCam->points.size(); i++) + for (size_t i = 0; i < cmdCsCam->points.size(); i++) { writer->Write(cmdCsCam->points[i].scalars[0].scalarData.s16); writer->Write(cmdCsCam->points[i].scalars[1].scalarData.s16); @@ -183,7 +183,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite case RoomCommand::SetMesh: { SetMesh* cmdMesh = (SetMesh*)cmd; - + writer->Write((uint8_t)cmdMesh->data); // 0x01 writer->Write(cmdMesh->meshHeaderType); @@ -207,12 +207,12 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite Declaration* dListDeclXlu = poly->parent->GetDeclaration(GETSEGOFFSET(test->xlu)); if (test->opa != 0) - writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str())); + writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str())); else writer->Write(""); - + if (test->xlu != 0) - writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclXlu->varName.c_str())); + writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclXlu->varName.c_str())); else writer->Write(""); @@ -228,7 +228,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite Declaration* bgDecl = poly->parent->GetDeclarationRanged(GETSEGOFFSET(poly->multiList[i].source)); writer->Write(OTRExporter_DisplayList::GetPathToRes(poly->multiList[i].sourceBackground, bgDecl->varName)); - + writer->Write(poly->multiList[i].unk_0C); writer->Write(poly->multiList[i].tlut); writer->Write(poly->multiList[i].width); @@ -338,7 +338,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite for (size_t i = 0;i < cmdRoom->romfile->numRooms; i++) { - //std::string roomName = StringHelper::Sprintf("%s\\%s_room_%i", (StringHelper::Split(room->GetName(), "_")[0] + "_scene").c_str(), StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i); + //std::string roomName = StringHelper::Sprintf("%s/%s_room_%i", (StringHelper::Split(room->GetName(), "_")[0] + "_scene").c_str(), StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i); std::string roomName = OTRExporter_DisplayList::GetPathToRes(room, StringHelper::Sprintf("%s_room_%i", StringHelper::Split(room->GetName(), "_scene")[0].c_str(), i)); writer->Write(roomName); writer->Write(cmdRoom->romfile->rooms[i].virtualAddressStart); @@ -383,7 +383,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite uint32_t baseStreamEnd = writer->GetStream().get()->GetLength(); writer->Write((uint32_t)cmdStartPos->actors.size()); // 0x01 - + for (const ActorSpawnEntry& entry : cmdStartPos->actors) { writer->Write(entry.actorNum); @@ -407,7 +407,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite { uint32_t seg = cmdHeaders->headers[i] & 0xFFFFFFFF; std::string headerName = ""; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, room->parent, "", headerName); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(seg, room->parent, "", headerName, res->parent->workerID); if (headerName == "NULL") writer->Write(""); else @@ -441,9 +441,9 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite case RoomCommand::SetCutscenes: { SetCutscenes* cmdSetCutscenes = (SetCutscenes*)cmd; - + std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdSetCutscenes->cmdArg2, room->parent, "CutsceneData", listName); + Globals::Instance->GetSegmentedPtrName(cmdSetCutscenes->cmdArg2, room->parent, "CutsceneData", listName, res->parent->workerID); std::string fName = OTRExporter_DisplayList::GetPathToRes(room, listName); //std::string fName = StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), listName.c_str()); writer->Write(fName); @@ -453,7 +453,10 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite OTRExporter_Cutscene cs; cs.Save(cmdSetCutscenes->cutscenes[0], "", &csWriter); - File::WriteAllBytes("Extract\\" + fName, csStream->ToVector()); + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) + File::WriteAllBytes("Extract/" + fName, csStream->ToVector()); + else + files[fName] = csStream->ToVector(); //std::string fName = OTRExporter_DisplayList::GetPathToRes(res, vtxDecl->varName); //otrArchive->AddFile(fName, (uintptr_t)csStream->ToVector().data(), csWriter.GetBaseAddress()); @@ -465,7 +468,7 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite writer->Write((uint32_t)cmdSetPathways->pathwayList.pathways.size()); - for (int i = 0; i < cmdSetPathways->pathwayList.pathways.size(); i++) + for (size_t i = 0; i < cmdSetPathways->pathwayList.pathways.size(); i++) { Declaration* decl = room->parent->GetDeclaration(GETSEGOFFSET(cmdSetPathways->pathwayList.pathways[i].listSegmentAddress)); //std::string path = StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), decl->varName.c_str()); @@ -477,7 +480,10 @@ void OTRExporter_Room::Save(ZResource* res, const fs::path& outPath, BinaryWrite OTRExporter_Path pathExp; pathExp.Save(&cmdSetPathways->pathwayList, outPath, &pathWriter); - File::WriteAllBytes("Extract\\" + path, pathStream->ToVector()); + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) + File::WriteAllBytes("Extract/" + path, pathStream->ToVector()); + else + files[path] = pathStream->ToVector(); //otrArchive->AddFile(path, (uintptr_t)pathStream->ToVector().data(), pathWriter.GetBaseAddress()); @@ -508,12 +514,12 @@ void OTRExporter_Room::WritePolyDList(BinaryWriter* writer, ZRoom* room, Polygon writer->Write(dlist->unk_06); [[fallthrough]]; default: - //writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str())); + //writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(res).c_str(), dListDeclOpa->varName.c_str())); if (dlist->opaDList != nullptr) { auto opaDecl = room->parent->GetDeclaration(GETSEGOFFSET(dlist->opaDList->GetRawDataIndex())); - writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), opaDecl->varName.c_str())); + writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), opaDecl->varName.c_str())); } else writer->Write(""); @@ -521,7 +527,7 @@ void OTRExporter_Room::WritePolyDList(BinaryWriter* writer, ZRoom* room, Polygon if (dlist->xluDList != nullptr) { auto xluDecl = room->parent->GetDeclaration(GETSEGOFFSET(dlist->xluDList->GetRawDataIndex())); - writer->Write(StringHelper::Sprintf("%s\\%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), xluDecl->varName.c_str())); + writer->Write(StringHelper::Sprintf("%s/%s", OTRExporter_DisplayList::GetParentFolderName(room).c_str(), xluDecl->varName.c_str())); } else writer->Write(""); diff --git a/OTRExporter/OTRExporter/SkeletonExporter.cpp b/OTRExporter/OTRExporter/SkeletonExporter.cpp index cd9f7a8fd..3e0c58d06 100644 --- a/OTRExporter/OTRExporter/SkeletonExporter.cpp +++ b/OTRExporter/OTRExporter/SkeletonExporter.cpp @@ -23,7 +23,7 @@ void OTRExporter_Skeleton::Save(ZResource* res, const fs::path& outPath, BinaryW Declaration* skelDecl = skel->parent->GetDeclarationRanged(GETSEGOFFSET(skel->limbsTable.limbsAddresses[i])); std::string name; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(skel->limbsTable.limbsAddresses[i], skel->parent, "", name); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(skel->limbsTable.limbsAddresses[i], skel->parent, "", name, res->parent->workerID); if (foundDecl) { if (name.at(0) == '&') diff --git a/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp b/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp index d22c3d000..e29c9a425 100644 --- a/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp +++ b/OTRExporter/OTRExporter/SkeletonLimbExporter.cpp @@ -86,7 +86,7 @@ void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, Bin if (limb->childPtr != 0) { std::string name; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->childPtr, limb->parent, "", name); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->childPtr, limb->parent, "", name, res->parent->workerID); if (foundDecl) { if (name.at(0) == '&') @@ -107,7 +107,7 @@ void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, Bin if (limb->siblingPtr != 0) { std::string name; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->siblingPtr, limb->parent, "", name); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->siblingPtr, limb->parent, "", name, res->parent->workerID); if (foundDecl) { if (name.at(0) == '&') @@ -128,7 +128,7 @@ void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, Bin if (limb->dListPtr != 0) { std::string name; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->dListPtr, limb->parent, "", name); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->dListPtr, limb->parent, "", name, res->parent->workerID); if (foundDecl) { if (name.at(0) == '&') @@ -149,7 +149,7 @@ void OTRExporter_SkeletonLimb::Save(ZResource* res, const fs::path& outPath, Bin if (limb->dList2Ptr != 0) { std::string name; - bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->dList2Ptr, limb->parent, "", name); + bool foundDecl = Globals::Instance->GetSegmentedPtrName(limb->dList2Ptr, limb->parent, "", name, res->parent->workerID); if (foundDecl) { if (name.at(0) == '&') diff --git a/OTRExporter/OTRExporter/TextExporter.cpp b/OTRExporter/OTRExporter/TextExporter.cpp index 19bc0ced1..5819b9b33 100644 --- a/OTRExporter/OTRExporter/TextExporter.cpp +++ b/OTRExporter/OTRExporter/TextExporter.cpp @@ -8,8 +8,8 @@ void OTRExporter_Text::Save(ZResource* res, const fs::path& outPath, BinaryWrite WriteHeader(txt, outPath, writer, Ship::ResourceType::Text); writer->Write((uint32_t)txt->messages.size()); - - for (int i = 0; i < txt->messages.size(); i++) + + for (size_t i = 0; i < txt->messages.size(); i++) { writer->Write(txt->messages[i].id); writer->Write(txt->messages[i].textboxType); diff --git a/OTRExporter/OTRExporter/VersionInfo.cpp b/OTRExporter/OTRExporter/VersionInfo.cpp index 9b684d22b..0a2004673 100644 --- a/OTRExporter/OTRExporter/VersionInfo.cpp +++ b/OTRExporter/OTRExporter/VersionInfo.cpp @@ -5,21 +5,23 @@ std::map resourceVersions; void InitVersionInfo() { - resourceVersions[Ship::ResourceType::Animation] = 0; - resourceVersions[Ship::ResourceType::Model] = 0; - resourceVersions[Ship::ResourceType::Texture] = 0; - resourceVersions[Ship::ResourceType::Material] = 0; - resourceVersions[Ship::ResourceType::PlayerAnimation] = 0; - resourceVersions[Ship::ResourceType::DisplayList] = 0; - resourceVersions[Ship::ResourceType::Room] = 0; - resourceVersions[Ship::ResourceType::CollisionHeader] = 0; - resourceVersions[Ship::ResourceType::Skeleton] = 0; - resourceVersions[Ship::ResourceType::SkeletonLimb] = 0; - resourceVersions[Ship::ResourceType::Matrix] = 0; - resourceVersions[Ship::ResourceType::Path] = 0; - resourceVersions[Ship::ResourceType::Vertex] = 0; - resourceVersions[Ship::ResourceType::Cutscene] = 0; - resourceVersions[Ship::ResourceType::Array] = 0; - resourceVersions[Ship::ResourceType::Text] = 0; - resourceVersions[Ship::ResourceType::Blob] = 0; + resourceVersions = { + { Ship::ResourceType::Animation, 0 }, + { Ship::ResourceType::Model, 0 }, + { Ship::ResourceType::Texture, 0 }, + { Ship::ResourceType::Material, 0 }, + { Ship::ResourceType::PlayerAnimation, 0 }, + { Ship::ResourceType::DisplayList, 0 }, + { Ship::ResourceType::Room, 0 }, + { Ship::ResourceType::CollisionHeader, 0 }, + { Ship::ResourceType::Skeleton, 0 }, + { Ship::ResourceType::SkeletonLimb, 0 }, + { Ship::ResourceType::Matrix, 0 }, + { Ship::ResourceType::Path, 0 }, + { Ship::ResourceType::Vertex, 0 }, + { Ship::ResourceType::Cutscene, 0 }, + { Ship::ResourceType::Array, 0 }, + { Ship::ResourceType::Text, 0 }, + { Ship::ResourceType::Blob, 0 }, + }; } \ No newline at end of file diff --git a/OTRExporter/assets/ship_of_harkinian/fonts/Fipps-Regular.otf b/OTRExporter/assets/ship_of_harkinian/fonts/Fipps-Regular.otf new file mode 100644 index 000000000..9334dad59 Binary files /dev/null and b/OTRExporter/assets/ship_of_harkinian/fonts/Fipps-Regular.otf differ diff --git a/OTRExporter/assets/ship_of_harkinian/fonts/PressStart2P-Regular.ttf b/OTRExporter/assets/ship_of_harkinian/fonts/PressStart2P-Regular.ttf new file mode 100644 index 000000000..2442affbf Binary files /dev/null and b/OTRExporter/assets/ship_of_harkinian/fonts/PressStart2P-Regular.ttf differ diff --git a/OTRExporter/extract_assets.py b/OTRExporter/extract_assets.py index 404b49ced..67b4ca6e4 100755 --- a/OTRExporter/extract_assets.py +++ b/OTRExporter/extract_assets.py @@ -1,24 +1,15 @@ #!/usr/bin/env python3 -import argparse, json, os, signal, time, sys, shutil -from multiprocessing import Pool, cpu_count, Event, Manager, ProcessError +import os, sys, shutil import shutil +from rom_info import Z64Rom +import rom_chooser -def SignalHandler(sig, frame): - print(f'Signal {sig} received. Aborting...') - mainAbort.set() - # Don't exit immediately to update the extracted assets file. - -def BuildOTR(): - shutil.copyfile("baserom/Audiobank", "Extract/Audiobank") - shutil.copyfile("baserom/Audioseq", "Extract/Audioseq") - shutil.copyfile("baserom/Audiotable", "Extract/Audiotable") - +def BuildOTR(xmlPath, rom): shutil.copytree("assets", "Extract/assets") - execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPD/ZAPD.out" - - execStr += " botr -se OTR" + execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPDTR/ZAPD.out" + execStr += " ed -i %s -b %s -fl CFG/filelists -o placeholder -osf placeholder -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, rom) print(execStr) exitValue = os.system(execStr) @@ -28,90 +19,14 @@ def BuildOTR(): print("Aborting...", file=os.sys.stderr) print("\n") -def ExtractFile(xmlPath, outputPath, outputSourcePath): - execStr = "x64\\Release\\ZAPD.exe" if sys.platform == "win32" else "../ZAPD/ZAPD.out" - execStr += " e -eh -i %s -b baserom/ -o %s -osf %s -gsf 1 -rconf CFG/Config.xml -se OTR" % (xmlPath, outputPath, outputSourcePath) - - if "overlays" in xmlPath: - execStr += " --static" - - print(execStr) - exitValue = os.system(execStr) - #exitValue = 0 - if exitValue != 0: - print("\n") - print("Error when extracting from file " + xmlPath, file=os.sys.stderr) - print("Aborting...", file=os.sys.stderr) - print("\n") - -def ExtractFunc(fullPath): - *pathList, xmlName = fullPath.split(os.sep) - objectName = os.path.splitext(xmlName)[0] - - outPath = os.path.join("..\\soh\\assets\\", *pathList[4:], objectName) - os.makedirs(outPath, exist_ok=True) - outSourcePath = outPath - - ExtractFile(fullPath, outPath, outSourcePath) - -def initializeWorker(abort, test): - global globalAbort - globalAbort = abort - - def main(): - parser = argparse.ArgumentParser(description="baserom asset extractor") - parser.add_argument("-s", "--single", help="asset path relative to assets/, e.g. objects/gameplay_keep") - parser.add_argument("-f", "--force", help="Force the extraction of every xml instead of checking the touched ones.", action="store_true") - parser.add_argument("-u", "--unaccounted", help="Enables ZAPD unaccounted detector warning system.", action="store_true") - args = parser.parse_args() + rom_path = rom_chooser.chooseROM() + rom = Z64Rom(rom_path) - global mainAbort - mainAbort = Event() - manager = Manager() - signal.signal(signal.SIGINT, SignalHandler) - - extractedAssetsTracker = manager.dict() - - asset_path = args.single - if asset_path is not None: - fullPath = os.path.join("..\\soh\\assets", "xml", asset_path + ".xml") - if not os.path.exists(fullPath): - print(f"Error. File {fullPath} doesn't exists.", file=os.sys.stderr) - exit(1) - - ExtractFunc(fullPath) - else: - extract_text_path = "assets/text/message_data.h" - if os.path.isfile(extract_text_path): - extract_text_path = None - extract_staff_text_path = "assets/text/message_data_staff.h" - if os.path.isfile(extract_staff_text_path): - extract_staff_text_path = None - - xmlFiles = [] - for currentPath, _, files in os.walk(os.path.join("..\\soh\\assets", "xml")): - for file in files: - fullPath = os.path.join(currentPath, file) - if file.endswith(".xml"): - xmlFiles.append(fullPath) - - try: - numCores = 2 - print("Extracting assets with " + str(numCores) + " CPU cores.") - with Pool(numCores, initializer=initializeWorker, initargs=(mainAbort, 0)) as p: - p.map(ExtractFunc, xmlFiles) - except Exception as e: - print("Warning: Multiprocessing exception ocurred.", file=os.sys.stderr) - print("Disabling mutliprocessing.", file=os.sys.stderr) - - initializeWorker(mainAbort, 0) - for singlePath in xmlFiles: - ExtractFunc(singlePath) - - - BuildOTR() + if (os.path.exists("Extract")): shutil.rmtree("Extract") + BuildOTR("../soh/assets/xml/" + rom.version.xml_ver + "/", rom_path) + if __name__ == "__main__": - main() \ No newline at end of file + main() diff --git a/OTRExporter/extract_baserom.py b/OTRExporter/extract_baserom.py new file mode 100644 index 000000000..f387df57a --- /dev/null +++ b/OTRExporter/extract_baserom.py @@ -0,0 +1,53 @@ +#!/usr/bin/python3 + +import os +import sys +import struct +from multiprocessing import Pool, cpu_count +from rom_info import Z64Rom +import rom_chooser + + +rom = None + +def initialize_worker(input_rom): + global rom + rom = input_rom + +def ExtractFunc(i): + + dma_file = rom.getDmaEntryByIndex(i) + dma_data = rom.readDmaEntry(dma_file) + + filename = '../soh/baserom/' + rom.version.file_table[i] + print('extracting ' + filename + " (0x%08X, 0x%08X)" % (dma_file.virtStart, dma_file.virtEnd)) + + try: + with open(filename, 'wb') as f: + f.write(dma_data) + except IOError: + print('failed to write file ' + filename) + + # TODO: handle this better + if dma_file.compressed: + os.system('tools/yaz0 -d ' + filename + ' ' + filename) + +##################################################################### + +def main(): + try: + os.mkdir('../soh/baserom') + except: + pass + + rom_path = rom_chooser.chooseROM() + input_rom = Z64Rom(rom_path) + + # extract files + num_cores = cpu_count() + print("Extracting baserom with " + str(num_cores) + " CPU cores.") + with Pool(num_cores, initialize_worker, (input_rom,)) as p: + p.map(ExtractFunc, range(len(input_rom.version.file_table))) + +if __name__ == "__main__": + main() diff --git a/OTRExporter/rom_chooser.py b/OTRExporter/rom_chooser.py new file mode 100644 index 000000000..5c5f875d0 --- /dev/null +++ b/OTRExporter/rom_chooser.py @@ -0,0 +1,37 @@ +import os, sys, glob + +from rom_info import Z64Rom + +def chooseROM(): + roms = [] + + for file in glob.glob("*.z64"): + if Z64Rom.isValidRom(file): + roms.append(file) + + if not (roms): + print("Error: No roms located, place one in the OTRExporter directory", file=os.sys.stderr) + sys.exit(1) + + if (len(roms) == 1): + return roms[0] + + print(str(len(roms))+ " roms found, please select one by pressing 1-"+str(len(roms))) + + for i in range(len(roms)): + print(str(i+1)+ ". " + roms[i]) + + while(1): + try: + selection = int(input()) + except: + print("Bad input. Try again with the number keys.") + continue + + if (selection < 1 or selection > len(roms)): + print("Bad input. Try again.") + continue + + else: break + + return roms[selection - 1] diff --git a/OTRExporter/rom_info.py b/OTRExporter/rom_info.py new file mode 100644 index 000000000..3edc8b0f9 --- /dev/null +++ b/OTRExporter/rom_info.py @@ -0,0 +1,87 @@ +from enum import Enum +from tabnanny import check +import struct + +class Checksums(Enum): + OOT_NTSC_10 = "EC7011B7" + OOT_NTSC_11 = "D43DA81F" + OOT_NTSC_12 = "693BA2AE" + OOT_PAL_10 = "B044B569" + OOT_PAL_11 = "B2055FBD" + OOT_NTSC_JP_GC_CE = "F7F52DB8" + OOT_NTSC_JP_GC = "F611F4BA" + OOT_NTSC_US_GC = "F3DD35BA" + OOT_PAL_GC = "09465AC3" + OOT_NTSC_JP_MQ = "F43B45BA" + OOT_NTSC_US_MQ = "F034001A" + OOT_PAL_MQ = "1D4136F3" + OOT_PAL_GC_DBG1 = "871E1C92" + OOT_PAL_GC_DBG2 = "87121EFE" + OOT_PAL_GC_MQ_DBG = "917D18F6" + OOT_IQUE_TW = "3D81FB3E" + OOT_IQUE_CN = "B1E1E07B" + OOT_UNKNOWN = "FFFFFFFF" + + @classmethod + def has_value(self, value): + return value in self._value2member_map_ + +class RomVersion: + def __init__(self, file_table_path, file_table_off, xml_ver): + self.file_table_off = file_table_off + self.xml_ver = xml_ver + with open(file_table_path, 'r') as f: + self.file_table = [line.strip('\n') for line in f] + +ROM_INFO_TABLE = dict() +ROM_INFO_TABLE[Checksums.OOT_PAL_GC] = RomVersion("CFG/filelists/gamecube_pal.txt", 0x7170, "GC_NMQ_PAL_F") +ROM_INFO_TABLE[Checksums.OOT_PAL_GC_DBG1] = RomVersion("CFG/filelists/dbg.txt", 0x12F70, "GC_NMQ_D") + +class RomDmaEntry: + def __init__(self, rom, i): + + off = rom.version.file_table_off + 16 * i + + (self.virtStart, \ + self.virtEnd, \ + self.physStart, \ + self.physEnd) = struct.unpack('>IIII', rom.rom_data[off:off+4*4]) + + self.compressed = self.physEnd != 0 + self.size = self.physEnd - self.physStart \ + if self.compressed \ + else self.virtEnd - self.virtStart + self.name = rom.version.file_table[i] + + +class Z64Rom: + def __init__(self, file_path): + self.file_path = file_path + with open(file_path, 'rb') as f: + self.rom_data = f.read() + + self.is_valid = len(self.rom_data) > 20 * 1024 * 1024 + + if not self.is_valid: + return + + # get checkum + checksum_str = self.rom_data[16:16+4].hex().upper() + self.checksum = Checksums(checksum_str) if Checksums.has_value(checksum_str) else Checksums.OOT_UNKNOWN + + if self.checksum == Checksums.OOT_UNKNOWN: + self.is_valid = False + return + + # get rom version + self.version = ROM_INFO_TABLE[self.checksum] + + def getDmaEntryByIndex(self, i): + return RomDmaEntry(self, i) + + def readDmaEntry(self, entry): + return self.rom_data[entry.physStart:entry.physStart + entry.size] + + @staticmethod + def isValidRom(rom_path): + return Z64Rom(rom_path).is_valid diff --git a/OTRGui/assets/extractor/Config.xml b/OTRGui/assets/extractor/Config_GC_MQ_D.xml similarity index 83% rename from OTRGui/assets/extractor/Config.xml rename to OTRGui/assets/extractor/Config_GC_MQ_D.xml index 6e86fa8d8..51e536292 100644 --- a/OTRGui/assets/extractor/Config.xml +++ b/OTRGui/assets/extractor/Config_GC_MQ_D.xml @@ -2,7 +2,7 @@ - + diff --git a/OTRGui/assets/extractor/Config_GC_NMQ_D.xml b/OTRGui/assets/extractor/Config_GC_NMQ_D.xml new file mode 100644 index 000000000..7cc11ac18 --- /dev/null +++ b/OTRGui/assets/extractor/Config_GC_NMQ_D.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/OTRGui/assets/extractor/Config_GC_NMQ_PAL_F.xml b/OTRGui/assets/extractor/Config_GC_NMQ_PAL_F.xml new file mode 100644 index 000000000..b98acfb00 --- /dev/null +++ b/OTRGui/assets/extractor/Config_GC_NMQ_PAL_F.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/OTRGui/assets/extractor/filelists/gamecube_pal.txt b/OTRGui/assets/extractor/filelists/gamecube_pal.txt new file mode 100644 index 000000000..c9746c1da --- /dev/null +++ b/OTRGui/assets/extractor/filelists/gamecube_pal.txt @@ -0,0 +1,1510 @@ +makerom +boot +dmadata +Audiobank +Audioseq +Audiotable +link_animetion +icon_item_static +icon_item_24_static +icon_item_field_static +icon_item_dungeon_static +icon_item_gameover_static +icon_item_nes_static +icon_item_ger_static +icon_item_fra_static +item_name_static +map_name_static +do_action_static +message_static +message_texture_static +nes_font_static +nes_message_data_static +ger_message_data_static +fra_message_data_static +staff_message_data_static +map_grand_static +map_48x85_static +map_i_static +code +ovl_title +ovl_select +ovl_opening +ovl_file_choose +ovl_kaleido_scope +ovl_player_actor +ovl_map_mark_data +ovl_En_Test +ovl_Arms_Hook +ovl_Arrow_Fire +ovl_Arrow_Ice +ovl_Arrow_Light +ovl_Bg_Bdan_Objects +ovl_Bg_Bdan_Switch +ovl_Bg_Bom_Guard +ovl_Bg_Bombwall +ovl_Bg_Bowl_Wall +ovl_Bg_Breakwall +ovl_Bg_Ddan_Jd +ovl_Bg_Ddan_Kd +ovl_Bg_Dodoago +ovl_Bg_Dy_Yoseizo +ovl_Bg_Ganon_Otyuka +ovl_Bg_Gate_Shutter +ovl_Bg_Gjyo_Bridge +ovl_Bg_Gnd_Darkmeiro +ovl_Bg_Gnd_Firemeiro +ovl_Bg_Gnd_Iceblock +ovl_Bg_Gnd_Nisekabe +ovl_Bg_Gnd_Soulmeiro +ovl_Bg_Haka +ovl_Bg_Haka_Gate +ovl_Bg_Haka_Huta +ovl_Bg_Haka_Megane +ovl_Bg_Haka_MeganeBG +ovl_Bg_Haka_Sgami +ovl_Bg_Haka_Ship +ovl_Bg_Haka_Trap +ovl_Bg_Haka_Tubo +ovl_Bg_Haka_Water +ovl_Bg_Haka_Zou +ovl_Bg_Heavy_Block +ovl_Bg_Hidan_Curtain +ovl_Bg_Hidan_Dalm +ovl_Bg_Hidan_Firewall +ovl_Bg_Hidan_Fslift +ovl_Bg_Hidan_Fwbig +ovl_Bg_Hidan_Hamstep +ovl_Bg_Hidan_Hrock +ovl_Bg_Hidan_Kousi +ovl_Bg_Hidan_Kowarerukabe +ovl_Bg_Hidan_Rock +ovl_Bg_Hidan_Rsekizou +ovl_Bg_Hidan_Sekizou +ovl_Bg_Hidan_Sima +ovl_Bg_Hidan_Syoku +ovl_Bg_Ice_Objects +ovl_Bg_Ice_Shelter +ovl_Bg_Ice_Shutter +ovl_Bg_Ice_Turara +ovl_Bg_Ingate +ovl_Bg_Jya_1flift +ovl_Bg_Jya_Amishutter +ovl_Bg_Jya_Bigmirror +ovl_Bg_Jya_Block +ovl_Bg_Jya_Bombchuiwa +ovl_Bg_Jya_Bombiwa +ovl_Bg_Jya_Cobra +ovl_Bg_Jya_Goroiwa +ovl_Bg_Jya_Haheniron +ovl_Bg_Jya_Ironobj +ovl_Bg_Jya_Kanaami +ovl_Bg_Jya_Lift +ovl_Bg_Jya_Megami +ovl_Bg_Jya_Zurerukabe +ovl_Bg_Menkuri_Eye +ovl_Bg_Menkuri_Kaiten +ovl_Bg_Menkuri_Nisekabe +ovl_Bg_Mizu_Bwall +ovl_Bg_Mizu_Movebg +ovl_Bg_Mizu_Shutter +ovl_Bg_Mizu_Uzu +ovl_Bg_Mizu_Water +ovl_Bg_Mjin +ovl_Bg_Mori_Bigst +ovl_Bg_Mori_Elevator +ovl_Bg_Mori_Hashigo +ovl_Bg_Mori_Hashira4 +ovl_Bg_Mori_Hineri +ovl_Bg_Mori_Idomizu +ovl_Bg_Mori_Kaitenkabe +ovl_Bg_Mori_Rakkatenjo +ovl_Bg_Po_Event +ovl_Bg_Po_Syokudai +ovl_Bg_Pushbox +ovl_Bg_Relay_Objects +ovl_Bg_Spot00_Break +ovl_Bg_Spot00_Hanebasi +ovl_Bg_Spot01_Fusya +ovl_Bg_Spot01_Idohashira +ovl_Bg_Spot01_Idomizu +ovl_Bg_Spot01_Idosoko +ovl_Bg_Spot01_Objects2 +ovl_Bg_Spot02_Objects +ovl_Bg_Spot03_Taki +ovl_Bg_Spot05_Soko +ovl_Bg_Spot06_Objects +ovl_Bg_Spot07_Taki +ovl_Bg_Spot08_Bakudankabe +ovl_Bg_Spot08_Iceblock +ovl_Bg_Spot09_Obj +ovl_Bg_Spot11_Bakudankabe +ovl_Bg_Spot11_Oasis +ovl_Bg_Spot12_Gate +ovl_Bg_Spot12_Saku +ovl_Bg_Spot15_Rrbox +ovl_Bg_Spot15_Saku +ovl_Bg_Spot16_Bombstone +ovl_Bg_Spot16_Doughnut +ovl_Bg_Spot17_Bakudankabe +ovl_Bg_Spot17_Funen +ovl_Bg_Spot18_Basket +ovl_Bg_Spot18_Futa +ovl_Bg_Spot18_Obj +ovl_Bg_Spot18_Shutter +ovl_Bg_Sst_Floor +ovl_Bg_Toki_Hikari +ovl_Bg_Toki_Swd +ovl_Bg_Treemouth +ovl_Bg_Umajump +ovl_Bg_Vb_Sima +ovl_Bg_Ydan_Hasi +ovl_Bg_Ydan_Maruta +ovl_Bg_Ydan_Sp +ovl_Bg_Zg +ovl_Boss_Dodongo +ovl_Boss_Fd +ovl_Boss_Fd2 +ovl_Boss_Ganon +ovl_Boss_Ganon2 +ovl_Boss_Ganondrof +ovl_Boss_Goma +ovl_Boss_Mo +ovl_Boss_Sst +ovl_Boss_Tw +ovl_Boss_Va +ovl_Demo_6K +ovl_Demo_Du +ovl_Demo_Ec +ovl_Demo_Effect +ovl_Demo_Ext +ovl_Demo_Geff +ovl_Demo_Gj +ovl_Demo_Go +ovl_Demo_Gt +ovl_Demo_Ik +ovl_Demo_Im +ovl_Demo_Kankyo +ovl_Demo_Kekkai +ovl_Demo_Sa +ovl_Demo_Shd +ovl_Demo_Tre_Lgt +ovl_Door_Ana +ovl_Door_Gerudo +ovl_Door_Killer +ovl_Door_Shutter +ovl_Door_Toki +ovl_Door_Warp1 +ovl_Efc_Erupc +ovl_Eff_Dust +ovl_Effect_Ss_Blast +ovl_Effect_Ss_Bomb +ovl_Effect_Ss_Bomb2 +ovl_Effect_Ss_Bubble +ovl_Effect_Ss_D_Fire +ovl_Effect_Ss_Dead_Db +ovl_Effect_Ss_Dead_Dd +ovl_Effect_Ss_Dead_Ds +ovl_Effect_Ss_Dead_Sound +ovl_Effect_Ss_Dt_Bubble +ovl_Effect_Ss_Dust +ovl_Effect_Ss_En_Fire +ovl_Effect_Ss_En_Ice +ovl_Effect_Ss_Extra +ovl_Effect_Ss_Fcircle +ovl_Effect_Ss_Fhg_Flash +ovl_Effect_Ss_Fire_Tail +ovl_Effect_Ss_G_Fire +ovl_Effect_Ss_G_Magma +ovl_Effect_Ss_G_Magma2 +ovl_Effect_Ss_G_Ripple +ovl_Effect_Ss_G_Spk +ovl_Effect_Ss_G_Splash +ovl_Effect_Ss_Hahen +ovl_Effect_Ss_HitMark +ovl_Effect_Ss_Ice_Piece +ovl_Effect_Ss_Ice_Smoke +ovl_Effect_Ss_K_Fire +ovl_Effect_Ss_Kakera +ovl_Effect_Ss_KiraKira +ovl_Effect_Ss_Lightning +ovl_Effect_Ss_Sibuki +ovl_Effect_Ss_Sibuki2 +ovl_Effect_Ss_Solder_Srch_Ball +ovl_Effect_Ss_Stick +ovl_Effect_Ss_Stone1 +ovl_Elf_Msg +ovl_Elf_Msg2 +ovl_En_Am +ovl_En_Ani +ovl_En_Anubice +ovl_En_Anubice_Fire +ovl_En_Anubice_Tag +ovl_En_Arow_Trap +ovl_En_Arrow +ovl_En_Attack_Niw +ovl_En_Ba +ovl_En_Bb +ovl_En_Bdfire +ovl_En_Bigokuta +ovl_En_Bili +ovl_En_Bird +ovl_En_Blkobj +ovl_En_Bom +ovl_En_Bom_Bowl_Man +ovl_En_Bom_Bowl_Pit +ovl_En_Bom_Chu +ovl_En_Bombf +ovl_En_Boom +ovl_En_Box +ovl_En_Brob +ovl_En_Bubble +ovl_En_Butte +ovl_En_Bw +ovl_En_Bx +ovl_En_Changer +ovl_En_Clear_Tag +ovl_En_Cow +ovl_En_Crow +ovl_En_Cs +ovl_En_Daiku +ovl_En_Daiku_Kakariko +ovl_En_Dekubaba +ovl_En_Dekunuts +ovl_En_Dh +ovl_En_Dha +ovl_En_Diving_Game +ovl_En_Dns +ovl_En_Dnt_Demo +ovl_En_Dnt_Jiji +ovl_En_Dnt_Nomal +ovl_En_Dodojr +ovl_En_Dodongo +ovl_En_Dog +ovl_En_Door +ovl_En_Ds +ovl_En_Du +ovl_En_Dy_Extra +ovl_En_Eg +ovl_En_Eiyer +ovl_En_Elf +ovl_En_Encount1 +ovl_En_Encount2 +ovl_En_Ex_Item +ovl_En_Ex_Ruppy +ovl_En_Fd +ovl_En_Fd_Fire +ovl_En_Fhg_Fire +ovl_En_Fire_Rock +ovl_En_Firefly +ovl_En_Fish +ovl_En_Floormas +ovl_En_Fr +ovl_En_Fu +ovl_En_Fw +ovl_En_Fz +ovl_En_G_Switch +ovl_En_Ganon_Mant +ovl_En_Ganon_Organ +ovl_En_Gb +ovl_En_Ge1 +ovl_En_Ge2 +ovl_En_Ge3 +ovl_En_GeldB +ovl_En_GirlA +ovl_En_Gm +ovl_En_Go +ovl_En_Go2 +ovl_En_Goma +ovl_En_Goroiwa +ovl_En_Gs +ovl_En_Guest +ovl_En_Hata +ovl_En_Heishi1 +ovl_En_Heishi2 +ovl_En_Heishi3 +ovl_En_Heishi4 +ovl_En_Hintnuts +ovl_En_Holl +ovl_En_Honotrap +ovl_En_Horse +ovl_En_Horse_Game_Check +ovl_En_Horse_Ganon +ovl_En_Horse_Link_Child +ovl_En_Horse_Normal +ovl_En_Horse_Zelda +ovl_En_Hs +ovl_En_Hs2 +ovl_En_Hy +ovl_En_Ice_Hono +ovl_En_Ik +ovl_En_In +ovl_En_Insect +ovl_En_Ishi +ovl_En_It +ovl_En_Jj +ovl_En_Js +ovl_En_Jsjutan +ovl_En_Kakasi +ovl_En_Kakasi2 +ovl_En_Kakasi3 +ovl_En_Kanban +ovl_En_Karebaba +ovl_En_Ko +ovl_En_Kusa +ovl_En_Kz +ovl_En_Light +ovl_En_Lightbox +ovl_En_M_Fire1 +ovl_En_M_Thunder +ovl_En_Ma1 +ovl_En_Ma2 +ovl_En_Ma3 +ovl_En_Mag +ovl_En_Mb +ovl_En_Md +ovl_En_Mk +ovl_En_Mm +ovl_En_Mm2 +ovl_En_Ms +ovl_En_Mu +ovl_En_Nb +ovl_En_Niw +ovl_En_Niw_Girl +ovl_En_Niw_Lady +ovl_En_Nutsball +ovl_En_Nwc +ovl_En_Ny +ovl_En_OE2 +ovl_En_Okarina_Effect +ovl_En_Okarina_Tag +ovl_En_Okuta +ovl_En_Ossan +ovl_En_Owl +ovl_En_Part +ovl_En_Peehat +ovl_En_Po_Desert +ovl_En_Po_Field +ovl_En_Po_Relay +ovl_En_Po_Sisters +ovl_En_Poh +ovl_En_Pu_box +ovl_En_Rd +ovl_En_Reeba +ovl_En_River_Sound +ovl_En_Rl +ovl_En_Rr +ovl_En_Ru1 +ovl_En_Ru2 +ovl_En_Sa +ovl_En_Sb +ovl_En_Scene_Change +ovl_En_Sda +ovl_En_Shopnuts +ovl_En_Si +ovl_En_Siofuki +ovl_En_Skb +ovl_En_Skj +ovl_En_Skjneedle +ovl_En_Ssh +ovl_En_St +ovl_En_Sth +ovl_En_Stream +ovl_En_Sw +ovl_En_Syateki_Itm +ovl_En_Syateki_Man +ovl_En_Syateki_Niw +ovl_En_Ta +ovl_En_Takara_Man +ovl_En_Tana +ovl_En_Tg +ovl_En_Tite +ovl_En_Tk +ovl_En_Torch +ovl_En_Torch2 +ovl_En_Toryo +ovl_En_Tp +ovl_En_Tr +ovl_En_Trap +ovl_En_Tubo_Trap +ovl_En_Vali +ovl_En_Vase +ovl_En_Vb_Ball +ovl_En_Viewer +ovl_En_Vm +ovl_En_Wall_Tubo +ovl_En_Wallmas +ovl_En_Weather_Tag +ovl_En_Weiyer +ovl_En_Wf +ovl_En_Wonder_Item +ovl_En_Wonder_Talk +ovl_En_Wonder_Talk2 +ovl_En_Wood02 +ovl_En_Xc +ovl_En_Yabusame_Mark +ovl_En_Yukabyun +ovl_En_Zf +ovl_En_Zl1 +ovl_En_Zl2 +ovl_En_Zl3 +ovl_En_Zl4 +ovl_En_Zo +ovl_En_fHG +ovl_End_Title +ovl_Fishing +ovl_Item_B_Heart +ovl_Item_Etcetera +ovl_Item_Inbox +ovl_Item_Ocarina +ovl_Item_Shield +ovl_Magic_Dark +ovl_Magic_Fire +ovl_Magic_Wind +ovl_Mir_Ray +ovl_Obj_Bean +ovl_Obj_Blockstop +ovl_Obj_Bombiwa +ovl_Obj_Comb +ovl_Obj_Dekujr +ovl_Obj_Elevator +ovl_Obj_Hamishi +ovl_Obj_Hana +ovl_Obj_Hsblock +ovl_Obj_Ice_Poly +ovl_Obj_Kibako +ovl_Obj_Kibako2 +ovl_Obj_Lift +ovl_Obj_Lightswitch +ovl_Obj_Makekinsuta +ovl_Obj_Makeoshihiki +ovl_Obj_Mure +ovl_Obj_Mure2 +ovl_Obj_Mure3 +ovl_Obj_Oshihiki +ovl_Obj_Roomtimer +ovl_Obj_Switch +ovl_Obj_Syokudai +ovl_Obj_Timeblock +ovl_Obj_Tsubo +ovl_Obj_Warp2block +ovl_Object_Kankyo +ovl_Oceff_Spot +ovl_Oceff_Storm +ovl_Oceff_Wipe +ovl_Oceff_Wipe2 +ovl_Oceff_Wipe3 +ovl_Oceff_Wipe4 +ovl_Shot_Sun +gameplay_keep +gameplay_field_keep +gameplay_dangeon_keep +gameplay_object_exchange_static +object_link_boy +object_link_child +object_box +object_human +object_okuta +object_poh +object_wallmaster +object_dy_obj +object_firefly +object_dodongo +object_fire +object_niw +object_tite +object_reeba +object_peehat +object_kingdodongo +object_horse +object_zf +object_goma +object_zl1 +object_gol +object_bubble +object_dodojr +object_torch2 +object_bl +object_tp +object_oA1 +object_st +object_bw +object_ei +object_horse_normal +object_oB1 +object_o_anime +object_spot04_objects +object_ddan_objects +object_hidan_objects +object_horse_ganon +object_oA2 +object_spot00_objects +object_mb +object_bombf +object_sk2 +object_oE1 +object_oE_anime +object_oE2 +object_ydan_objects +object_gnd +object_am +object_dekubaba +object_oA3 +object_oA4 +object_oA5 +object_oA6 +object_oA7 +object_jj +object_oA8 +object_oA9 +object_oB2 +object_oB3 +object_oB4 +object_horse_zelda +object_opening_demo1 +object_warp1 +object_b_heart +object_dekunuts +object_oE3 +object_oE4 +object_menkuri_objects +object_oE5 +object_oE6 +object_oE7 +object_oE8 +object_oE9 +object_oE10 +object_oE11 +object_oE12 +object_vali +object_oA10 +object_oA11 +object_mizu_objects +object_fhg +object_ossan +object_mori_hineri1 +object_Bb +object_toki_objects +object_yukabyun +object_zl2 +object_mjin +object_mjin_flash +object_mjin_dark +object_mjin_flame +object_mjin_ice +object_mjin_soul +object_mjin_wind +object_mjin_oka +object_haka_objects +object_spot06_objects +object_ice_objects +object_relay_objects +object_mori_hineri1a +object_mori_hineri2 +object_mori_hineri2a +object_mori_objects +object_mori_tex +object_spot08_obj +object_warp2 +object_hata +object_bird +object_wood02 +object_lightbox +object_pu_box +object_trap +object_vase +object_im +object_ta +object_tk +object_xc +object_vm +object_bv +object_hakach_objects +object_efc_crystal_light +object_efc_fire_ball +object_efc_flash +object_efc_lgt_shower +object_efc_star_field +object_god_lgt +object_light_ring +object_triforce_spot +object_medal +object_bdan_objects +object_sd +object_rd +object_po_sisters +object_heavy_object +object_gndd +object_fd +object_du +object_fw +object_horse_link_child +object_spot02_objects +object_haka +object_ru1 +object_syokudai +object_fd2 +object_dh +object_rl +object_efc_tw +object_demo_tre_lgt +object_gi_key +object_mir_ray +object_brob +object_gi_jewel +object_spot09_obj +object_spot18_obj +object_bdoor +object_spot17_obj +object_shop_dungen +object_nb +object_mo +object_sb +object_gi_melody +object_gi_heart +object_gi_compass +object_gi_bosskey +object_gi_medal +object_gi_nuts +object_sa +object_gi_hearts +object_gi_arrowcase +object_gi_bombpouch +object_in +object_tr +object_spot16_obj +object_oE1s +object_oE4s +object_os_anime +object_gi_bottle +object_gi_stick +object_gi_map +object_oF1d_map +object_ru2 +object_gi_shield_1 +object_dekujr +object_gi_magicpot +object_gi_bomb_1 +object_oF1s +object_ma2 +object_gi_purse +object_hni +object_tw +object_rr +object_bxa +object_anubice +object_gi_gerudo +object_gi_arrow +object_gi_bomb_2 +object_gi_egg +object_gi_scale +object_gi_shield_2 +object_gi_hookshot +object_gi_ocarina +object_gi_milk +object_ma1 +object_ganon +object_sst +object_ny +object_fr +object_gi_pachinko +object_gi_boomerang +object_gi_bow +object_gi_glasses +object_gi_liquid +object_ani +object_demo_6k +object_gi_shield_3 +object_gi_letter +object_spot15_obj +object_jya_obj +object_gi_clothes +object_gi_bean +object_gi_fish +object_gi_saw +object_gi_hammer +object_gi_grass +object_gi_longsword +object_spot01_objects +object_md +object_km1 +object_kw1 +object_zo +object_kz +object_umajump +object_masterkokiri +object_masterkokirihead +object_mastergolon +object_masterzoora +object_aob +object_ik +object_ahg +object_cne +object_gi_niwatori +object_skj +object_gi_bottle_letter +object_bji +object_bba +object_gi_ocarina_0 +object_ds +object_ane +object_boj +object_spot03_object +object_spot07_object +object_fz +object_bob +object_ge1 +object_yabusame_point +object_gi_boots_2 +object_gi_seed +object_gnd_magic +object_d_elevator +object_d_hsblock +object_d_lift +object_mamenoki +object_goroiwa +object_toryo +object_daiku +object_nwc +object_blkobj +object_gm +object_ms +object_hs +object_ingate +object_lightswitch +object_kusa +object_tsubo +object_gi_gloves +object_gi_coin +object_kanban +object_gjyo_objects +object_owl +object_mk +object_fu +object_gi_ki_tan_mask +object_gi_redead_mask +object_gi_skj_mask +object_gi_rabit_mask +object_gi_truth_mask +object_ganon_objects +object_siofuki +object_stream +object_mm +object_fa +object_os +object_gi_eye_lotion +object_gi_powder +object_gi_mushroom +object_gi_ticketstone +object_gi_brokensword +object_js +object_cs +object_gi_prescription +object_gi_bracelet +object_gi_soldout +object_gi_frog +object_mag +object_door_gerudo +object_gt +object_efc_erupc +object_zl2_anime1 +object_zl2_anime2 +object_gi_golonmask +object_gi_zoramask +object_gi_gerudomask +object_ganon2 +object_ka +object_ts +object_zg +object_gi_hoverboots +object_gi_m_arrow +object_ds2 +object_ec +object_fish +object_gi_sutaru +object_gi_goddess +object_ssh +object_bigokuta +object_bg +object_spot05_objects +object_spot12_obj +object_bombiwa +object_hintnuts +object_rs +object_spot00_break +object_gla +object_shopnuts +object_geldb +object_gr +object_dog +object_jya_iron +object_jya_door +object_spot01_objects2 +object_spot11_obj +object_kibako2 +object_dns +object_dnk +object_gi_fire +object_gi_insect +object_gi_butterfly +object_gi_ghost +object_gi_soul +object_bowl +object_po_field +object_demo_kekkai +object_efc_doughnut +object_gi_dekupouch +object_ganon_anime1 +object_ganon_anime2 +object_ganon_anime3 +object_gi_rupy +object_spot01_matoya +object_spot01_matoyab +object_po_composer +object_mu +object_wf +object_skb +object_gj +object_geff +object_haka_door +object_gs +object_ps +object_bwall +object_crow +object_cow +object_cob +object_gi_sword_1 +object_door_killer +object_ouke_haka +object_timeblock +object_zl4 +g_pn_01 +g_pn_02 +g_pn_03 +g_pn_04 +g_pn_05 +g_pn_06 +g_pn_07 +g_pn_08 +g_pn_09 +g_pn_10 +g_pn_11 +g_pn_12 +g_pn_13 +g_pn_14 +g_pn_15 +g_pn_16 +g_pn_17 +g_pn_18 +g_pn_19 +g_pn_20 +g_pn_21 +g_pn_22 +g_pn_23 +g_pn_24 +g_pn_25 +g_pn_26 +g_pn_27 +g_pn_28 +g_pn_29 +g_pn_30 +g_pn_31 +g_pn_32 +g_pn_33 +g_pn_34 +g_pn_35 +g_pn_36 +g_pn_37 +g_pn_38 +g_pn_39 +g_pn_40 +g_pn_41 +g_pn_42 +g_pn_43 +g_pn_44 +g_pn_45 +g_pn_46 +g_pn_47 +g_pn_48 +g_pn_49 +g_pn_50 +g_pn_51 +g_pn_52 +g_pn_53 +g_pn_54 +g_pn_55 +g_pn_56 +g_pn_57 +z_select_static +nintendo_rogo_static +title_static +parameter_static +vr_fine0_static +vr_fine0_pal_static +vr_fine1_static +vr_fine1_pal_static +vr_fine2_static +vr_fine2_pal_static +vr_fine3_static +vr_fine3_pal_static +vr_cloud0_static +vr_cloud0_pal_static +vr_cloud1_static +vr_cloud1_pal_static +vr_cloud2_static +vr_cloud2_pal_static +vr_cloud3_static +vr_cloud3_pal_static +vr_holy0_static +vr_holy0_pal_static +vr_holy1_static +vr_holy1_pal_static +vr_MDVR_static +vr_MDVR_pal_static +vr_MNVR_static +vr_MNVR_pal_static +vr_RUVR_static +vr_RUVR_pal_static +vr_LHVR_static +vr_LHVR_pal_static +vr_KHVR_static +vr_KHVR_pal_static +vr_K3VR_static +vr_K3VR_pal_static +vr_K4VR_static +vr_K4VR_pal_static +vr_K5VR_static +vr_K5VR_pal_static +vr_SP1a_static +vr_SP1a_pal_static +vr_MLVR_static +vr_MLVR_pal_static +vr_KKRVR_static +vr_KKRVR_pal_static +vr_KR3VR_static +vr_KR3VR_pal_static +vr_IPVR_static +vr_IPVR_pal_static +vr_KSVR_static +vr_KSVR_pal_static +vr_GLVR_static +vr_GLVR_pal_static +vr_ZRVR_static +vr_ZRVR_pal_static +vr_DGVR_static +vr_DGVR_pal_static +vr_ALVR_static +vr_ALVR_pal_static +vr_NSVR_static +vr_NSVR_pal_static +vr_LBVR_static +vr_LBVR_pal_static +vr_TTVR_static +vr_TTVR_pal_static +vr_FCVR_static +vr_FCVR_pal_static +elf_message_field +elf_message_ydan +ydan_scene +ydan_room_0 +ydan_room_1 +ydan_room_2 +ydan_room_3 +ydan_room_4 +ydan_room_5 +ydan_room_6 +ydan_room_7 +ydan_room_8 +ydan_room_9 +ydan_room_10 +ydan_room_11 +ddan_scene +ddan_room_0 +ddan_room_1 +ddan_room_2 +ddan_room_3 +ddan_room_4 +ddan_room_5 +ddan_room_6 +ddan_room_7 +ddan_room_8 +ddan_room_9 +ddan_room_10 +ddan_room_11 +ddan_room_12 +ddan_room_13 +ddan_room_14 +ddan_room_15 +ddan_room_16 +bdan_scene +bdan_room_0 +bdan_room_1 +bdan_room_2 +bdan_room_3 +bdan_room_4 +bdan_room_5 +bdan_room_6 +bdan_room_7 +bdan_room_8 +bdan_room_9 +bdan_room_10 +bdan_room_11 +bdan_room_12 +bdan_room_13 +bdan_room_14 +bdan_room_15 +Bmori1_scene +Bmori1_room_0 +Bmori1_room_1 +Bmori1_room_2 +Bmori1_room_3 +Bmori1_room_4 +Bmori1_room_5 +Bmori1_room_6 +Bmori1_room_7 +Bmori1_room_8 +Bmori1_room_9 +Bmori1_room_10 +Bmori1_room_11 +Bmori1_room_12 +Bmori1_room_13 +Bmori1_room_14 +Bmori1_room_15 +Bmori1_room_16 +Bmori1_room_17 +Bmori1_room_18 +Bmori1_room_19 +Bmori1_room_20 +Bmori1_room_21 +Bmori1_room_22 +HIDAN_scene +HIDAN_room_0 +HIDAN_room_1 +HIDAN_room_2 +HIDAN_room_3 +HIDAN_room_4 +HIDAN_room_5 +HIDAN_room_6 +HIDAN_room_7 +HIDAN_room_8 +HIDAN_room_9 +HIDAN_room_10 +HIDAN_room_11 +HIDAN_room_12 +HIDAN_room_13 +HIDAN_room_14 +HIDAN_room_15 +HIDAN_room_16 +HIDAN_room_17 +HIDAN_room_18 +HIDAN_room_19 +HIDAN_room_20 +HIDAN_room_21 +HIDAN_room_22 +HIDAN_room_23 +HIDAN_room_24 +HIDAN_room_25 +HIDAN_room_26 +MIZUsin_scene +MIZUsin_room_0 +MIZUsin_room_1 +MIZUsin_room_2 +MIZUsin_room_3 +MIZUsin_room_4 +MIZUsin_room_5 +MIZUsin_room_6 +MIZUsin_room_7 +MIZUsin_room_8 +MIZUsin_room_9 +MIZUsin_room_10 +MIZUsin_room_11 +MIZUsin_room_12 +MIZUsin_room_13 +MIZUsin_room_14 +MIZUsin_room_15 +MIZUsin_room_16 +MIZUsin_room_17 +MIZUsin_room_18 +MIZUsin_room_19 +MIZUsin_room_20 +MIZUsin_room_21 +MIZUsin_room_22 +jyasinzou_scene +jyasinzou_room_0 +jyasinzou_room_1 +jyasinzou_room_2 +jyasinzou_room_3 +jyasinzou_room_4 +jyasinzou_room_5 +jyasinzou_room_6 +jyasinzou_room_7 +jyasinzou_room_8 +jyasinzou_room_9 +jyasinzou_room_10 +jyasinzou_room_11 +jyasinzou_room_12 +jyasinzou_room_13 +jyasinzou_room_14 +jyasinzou_room_15 +jyasinzou_room_16 +jyasinzou_room_17 +jyasinzou_room_18 +jyasinzou_room_19 +jyasinzou_room_20 +jyasinzou_room_21 +jyasinzou_room_22 +jyasinzou_room_23 +jyasinzou_room_24 +jyasinzou_room_25 +jyasinzou_room_26 +jyasinzou_room_27 +jyasinzou_room_28 +HAKAdan_scene +HAKAdan_room_0 +HAKAdan_room_1 +HAKAdan_room_2 +HAKAdan_room_3 +HAKAdan_room_4 +HAKAdan_room_5 +HAKAdan_room_6 +HAKAdan_room_7 +HAKAdan_room_8 +HAKAdan_room_9 +HAKAdan_room_10 +HAKAdan_room_11 +HAKAdan_room_12 +HAKAdan_room_13 +HAKAdan_room_14 +HAKAdan_room_15 +HAKAdan_room_16 +HAKAdan_room_17 +HAKAdan_room_18 +HAKAdan_room_19 +HAKAdan_room_20 +HAKAdan_room_21 +HAKAdan_room_22 +HAKAdanCH_scene +HAKAdanCH_room_0 +HAKAdanCH_room_1 +HAKAdanCH_room_2 +HAKAdanCH_room_3 +HAKAdanCH_room_4 +HAKAdanCH_room_5 +HAKAdanCH_room_6 +ice_doukutu_scene +ice_doukutu_room_0 +ice_doukutu_room_1 +ice_doukutu_room_2 +ice_doukutu_room_3 +ice_doukutu_room_4 +ice_doukutu_room_5 +ice_doukutu_room_6 +ice_doukutu_room_7 +ice_doukutu_room_8 +ice_doukutu_room_9 +ice_doukutu_room_10 +ice_doukutu_room_11 +men_scene +men_room_0 +men_room_1 +men_room_2 +men_room_3 +men_room_4 +men_room_5 +men_room_6 +men_room_7 +men_room_8 +men_room_9 +men_room_10 +ganontika_scene +ganontika_room_0 +ganontika_room_1 +ganontika_room_2 +ganontika_room_3 +ganontika_room_4 +ganontika_room_5 +ganontika_room_6 +ganontika_room_7 +ganontika_room_8 +ganontika_room_9 +ganontika_room_10 +ganontika_room_11 +ganontika_room_12 +ganontika_room_13 +ganontika_room_14 +ganontika_room_15 +ganontika_room_16 +ganontika_room_17 +ganontika_room_18 +ganontika_room_19 +spot00_scene +spot00_room_0 +spot01_scene +spot01_room_0 +spot02_scene +spot02_room_0 +spot02_room_1 +spot03_scene +spot03_room_0 +spot03_room_1 +spot04_scene +spot04_room_0 +spot04_room_1 +spot04_room_2 +spot05_scene +spot05_room_0 +spot06_scene +spot06_room_0 +spot07_scene +spot07_room_0 +spot07_room_1 +spot08_scene +spot08_room_0 +spot09_scene +spot09_room_0 +spot10_scene +spot10_room_0 +spot10_room_1 +spot10_room_2 +spot10_room_3 +spot10_room_4 +spot10_room_5 +spot10_room_6 +spot10_room_7 +spot10_room_8 +spot10_room_9 +spot11_scene +spot11_room_0 +spot12_scene +spot12_room_0 +spot12_room_1 +spot13_scene +spot13_room_0 +spot13_room_1 +spot15_scene +spot15_room_0 +spot16_scene +spot16_room_0 +spot17_scene +spot17_room_0 +spot17_room_1 +spot18_scene +spot18_room_0 +spot18_room_1 +spot18_room_2 +spot18_room_3 +market_day_scene +market_day_room_0 +market_night_scene +market_night_room_0 +kenjyanoma_scene +kenjyanoma_room_0 +tokinoma_scene +tokinoma_room_0 +tokinoma_room_1 +link_home_scene +link_home_room_0 +kokiri_shop_scene +kokiri_shop_room_0 +kokiri_home_scene +kokiri_home_room_0 +kakusiana_scene +kakusiana_room_0 +kakusiana_room_1 +kakusiana_room_2 +kakusiana_room_3 +kakusiana_room_4 +kakusiana_room_5 +kakusiana_room_6 +kakusiana_room_7 +kakusiana_room_8 +kakusiana_room_9 +kakusiana_room_10 +kakusiana_room_11 +kakusiana_room_12 +kakusiana_room_13 +entra_scene +entra_room_0 +moribossroom_scene +moribossroom_room_0 +moribossroom_room_1 +syatekijyou_scene +syatekijyou_room_0 +shop1_scene +shop1_room_0 +hairal_niwa_scene +hairal_niwa_room_0 +ganon_tou_scene +ganon_tou_room_0 +market_alley_scene +market_alley_room_0 +spot20_scene +spot20_room_0 +market_ruins_scene +market_ruins_room_0 +entra_n_scene +entra_n_room_0 +enrui_scene +enrui_room_0 +market_alley_n_scene +market_alley_n_room_0 +hiral_demo_scene +hiral_demo_room_0 +kokiri_home3_scene +kokiri_home3_room_0 +malon_stable_scene +malon_stable_room_0 +kakariko_scene +kakariko_room_0 +bdan_boss_scene +bdan_boss_room_0 +bdan_boss_room_1 +FIRE_bs_scene +FIRE_bs_room_0 +FIRE_bs_room_1 +hut_scene +hut_room_0 +daiyousei_izumi_scene +daiyousei_izumi_room_0 +hakaana_scene +hakaana_room_0 +yousei_izumi_tate_scene +yousei_izumi_tate_room_0 +yousei_izumi_yoko_scene +yousei_izumi_yoko_room_0 +golon_scene +golon_room_0 +zoora_scene +zoora_room_0 +drag_scene +drag_room_0 +alley_shop_scene +alley_shop_room_0 +night_shop_scene +night_shop_room_0 +impa_scene +impa_room_0 +labo_scene +labo_room_0 +tent_scene +tent_room_0 +nakaniwa_scene +nakaniwa_room_0 +ddan_boss_scene +ddan_boss_room_0 +ddan_boss_room_1 +ydan_boss_scene +ydan_boss_room_0 +ydan_boss_room_1 +HAKAdan_bs_scene +HAKAdan_bs_room_0 +HAKAdan_bs_room_1 +MIZUsin_bs_scene +MIZUsin_bs_room_0 +MIZUsin_bs_room_1 +ganon_scene +ganon_room_0 +ganon_room_1 +ganon_room_2 +ganon_room_3 +ganon_room_4 +ganon_room_5 +ganon_room_6 +ganon_room_7 +ganon_room_8 +ganon_room_9 +ganon_boss_scene +ganon_boss_room_0 +jyasinboss_scene +jyasinboss_room_0 +jyasinboss_room_1 +jyasinboss_room_2 +jyasinboss_room_3 +kokiri_home4_scene +kokiri_home4_room_0 +kokiri_home5_scene +kokiri_home5_room_0 +ganon_final_scene +ganon_final_room_0 +kakariko3_scene +kakariko3_room_0 +hakasitarelay_scene +hakasitarelay_room_0 +hakasitarelay_room_1 +hakasitarelay_room_2 +hakasitarelay_room_3 +hakasitarelay_room_4 +hakasitarelay_room_5 +hakasitarelay_room_6 +shrine_scene +shrine_room_0 +turibori_scene +turibori_room_0 +shrine_n_scene +shrine_n_room_0 +shrine_r_scene +shrine_r_room_0 +hakaana2_scene +hakaana2_room_0 +gerudoway_scene +gerudoway_room_0 +gerudoway_room_1 +gerudoway_room_2 +gerudoway_room_3 +gerudoway_room_4 +gerudoway_room_5 +hairal_niwa_n_scene +hairal_niwa_n_room_0 +bowling_scene +bowling_room_0 +hakaana_ouke_scene +hakaana_ouke_room_0 +hakaana_ouke_room_1 +hakaana_ouke_room_2 +hylia_labo_scene +hylia_labo_room_0 +souko_scene +souko_room_0 +souko_room_1 +souko_room_2 +miharigoya_scene +miharigoya_room_0 +mahouya_scene +mahouya_room_0 +takaraya_scene +takaraya_room_0 +takaraya_room_1 +takaraya_room_2 +takaraya_room_3 +takaraya_room_4 +takaraya_room_5 +takaraya_room_6 +ganon_sonogo_scene +ganon_sonogo_room_0 +ganon_sonogo_room_1 +ganon_sonogo_room_2 +ganon_sonogo_room_3 +ganon_sonogo_room_4 +ganon_demo_scene +ganon_demo_room_0 +face_shop_scene +face_shop_room_0 +kinsuta_scene +kinsuta_room_0 +ganontikasonogo_scene +ganontikasonogo_room_0 +ganontikasonogo_room_1 +bump_texture_static +anime_model_1_static +anime_model_2_static +anime_model_3_static +anime_model_4_static +anime_model_5_static +anime_model_6_static +anime_texture_1_static +anime_texture_2_static +anime_texture_3_static +anime_texture_4_static +anime_texture_5_static +anime_texture_6_static +softsprite_matrix_static \ No newline at end of file diff --git a/OTRGui/src/game/game.cpp b/OTRGui/src/game/game.cpp index 3fc6438a8..022a7788e 100644 --- a/OTRGui/src/game/game.cpp +++ b/OTRGui/src/game/game.cpp @@ -18,6 +18,7 @@ Shader shader = { 0 }; Light light = { 0 }; Vector3 lightPos = { -5.0f, 10.0f, 10.0f }; Vector2 dragOffset; +bool isDragging = false; std::string sohFolder = NULLSTR; bool extracting = false; bool rom_ready = false; @@ -25,6 +26,7 @@ bool single_thread = false; bool hide_second_btn = false; RomVersion version; const char* patched_rom = "tmp/rom.z64"; +extern bool oldExtractMode; static std::string currentStep = "None"; @@ -65,17 +67,35 @@ void OTRGame::init(){ mat.shader = shader; } - if(fs::exists("soh.exe") && !fs::exists("oot.otr")) { + if((fs::exists("soh.exe") || fs::exists("soh.elf")) && !fs::exists("oot.otr")) { hide_second_btn = true; sohFolder = "."; } } -void ExtractRom() { - const WriteResult result = ExtractBaserom(patched_rom); +void ExtractRom() +{ + WriteResult result; + + if (oldExtractMode) + ExtractBaserom(patched_rom); + else + result.error = NULLSTR; + if (result.error == NULLSTR) { if (MoonUtils::exists("oot.otr")) MoonUtils::rm("oot.otr"); - startWorker(); + if (MoonUtils::exists("Extract")) MoonUtils::rm("Extract"); + + MoonUtils::mkdir("Extract"); + //MoonUtils::copy("tmp/baserom/Audiobank", "Extract/Audiobank"); + //MoonUtils::copy("tmp/baserom/Audioseq", "Extract/Audioseq"); + //MoonUtils::copy("tmp/baserom/Audiotable", "Extract/Audiotable"); + //MoonUtils::copy("tmp/baserom/version", "Extract/version"); + MoonUtils::write("Extract/version", (char*)&version.crc, sizeof(version.crc)); + + MoonUtils::copy("assets/game/", "Extract/assets/"); + + startWorker(version); extracting = true; } } @@ -95,69 +115,103 @@ void OTRGame::update(){ } void OTRGame::draw() { + Vector2 windowSize(GetScreenWidth(), GetScreenHeight()); + Rectangle titlebar = Rectangle(0, 0, windowSize.x - 50, 35); + Vector2 mousePos = GetMousePosition(); + Vector2 mouseDelta = GetMouseDelta(); + + if (IsMouseButtonPressed(MOUSE_BUTTON_LEFT) && !isDragging && + mousePos.x >= titlebar.x && mousePos.y >= titlebar.y && mousePos.x <= titlebar.x + titlebar.width && mousePos.y <= titlebar.y + titlebar.height) { + isDragging = true; + dragOffset = mousePos; + } + else if (IsMouseButtonReleased(MOUSE_BUTTON_LEFT) && isDragging) { + isDragging = false; + dragOffset = Vector2(0, 0); + } + + if (isDragging && (mouseDelta.x != 0.0f || mouseDelta.y != 0.0f)) { + Vector2 wndPos = GetWindowPosition(); + wndPos = Vector2(wndPos.x + (mousePos.x - dragOffset.x), wndPos.y + (mousePos.y - dragOffset.y)); + + // Calculate virtual screen total size in case there are multiple monitors + + int vsX1 = 0, vsY1 = 0, vsX2 = 0, vsY2 = 0; + int monitorCount = GetMonitorCount(); + + for (int m = 0; m < monitorCount; m++) { + Vector2 monitorPos = GetMonitorPosition(m); + Vector2 monitorSize = Vector2(GetMonitorWidth(m), GetMonitorHeight(m)); + + if (monitorPos.x < vsX1) vsX1 = monitorPos.x; + if (monitorPos.y < vsY1) vsY1 = monitorPos.y; + if (monitorPos.x + monitorSize.x > vsX2) vsX2 = monitorPos.x + monitorSize.x; + if (monitorPos.y + monitorSize.y > vsY2) vsY2 = monitorPos.y + monitorSize.y; + } + + // Clamp the window to the borders of the monitors + if (wndPos.x < vsX1) wndPos.x = vsX1; + if (wndPos.x < vsX1) wndPos.x = vsX1; + if (wndPos.y < vsY1) wndPos.y = vsY1; + if (wndPos.x + windowSize.x > vsX2) wndPos.x = vsX2 - windowSize.x; + if (wndPos.y + windowSize.y > vsY2) wndPos.y = vsY2 - windowSize.y; + + SetWindowPosition(wndPos.x, wndPos.y); + } + BeginDrawing(); - ClearBackground(Color(40, 40, 40, 255)); - Vector3 windowSize(GetScreenWidth(), GetScreenHeight()); - Rectangle titlebar = Rectangle(0, 0, windowSize.x - 50, 35); - Vector2 mousePos = Vector2(GetMouseX(), GetMouseY()); - bool hoveredTitlebar = mousePos.x >= titlebar.x && mousePos.y >= titlebar.y && mousePos.x <= titlebar.x + titlebar.width && mousePos.y <= titlebar.y + titlebar.height; + ClearBackground(Color(40, 40, 40, 255)); - if (hoveredTitlebar && IsMouseButtonDown(MOUSE_BUTTON_LEFT)) { - if (dragOffset.x == 0 && dragOffset.y == 0) dragOffset = mousePos; - Vector2 wndPos = GetWindowPosition(); + DrawTexture(Textures["Frame"], 0, 0, WHITE); - SetWindowPosition(wndPos.x + (mousePos.x - dragOffset.x), wndPos.y + (mousePos.y - dragOffset.y)); - } - else dragOffset = Vector2(0, 0); + Texture2D titleTex = Textures["Title"]; + DrawTexture(titleTex, windowSize.x / 2 - titleTex.width / 2, titlebar.height / 2 - titleTex.height / 2, WHITE); - DrawTexture(Textures["Frame"], 0, 0, WHITE); + if (UIUtils::GuiIcon("Exit", windowSize.x - 36, titlebar.height / 2 - 10) && (extracting && currentStep.find("Done") != std::string::npos || !extracting)) { + closeRequested = true; + } - Texture2D titleTex = Textures["Title"]; - DrawTexture(titleTex, windowSize.x / 2 - titleTex.width / 2, titlebar.height / 2 - titleTex.height / 2, WHITE); + BeginMode3D(camera); + DrawModelEx(Models["Ship"], Vector3Zero(), Vector3(.0f, 1.0f, .0f), this->ModelRotation, SCALE(1.0f), WHITE); + EndMode3D(); - if (UIUtils::GuiIcon("Exit", windowSize.x - 36, titlebar.height / 2 - 10) && (extracting && currentStep.find("Done") != std::string::npos || !extracting)) { - CloseWindow(); - } + constexpr float text_y = 125.f; + UIUtils::GuiShadowText(("Rom Type: " + version.version).c_str(), 32, text_y, 10, WHITE, BLACK); + UIUtils::GuiShadowText("Tool Version: 1.0", 32, text_y + 15, 10, WHITE, BLACK); + UIUtils::GuiShadowText("OTR Version: 1.0", 32, text_y + 30, 10, WHITE, BLACK); - BeginMode3D(camera); - DrawModelEx(Models["Ship"] ,Vector3Zero(), Vector3(.0f, 1.0f, .0f), this->ModelRotation, SCALE(1.0f), WHITE); - EndMode3D(); - - constexpr float text_y = 125.f; - UIUtils::GuiShadowText(("Rom Type: " + version.version).c_str(), 32, text_y, 10, WHITE, BLACK); - UIUtils::GuiShadowText("Tool Version: 1.0", 32, text_y + 15, 10, WHITE, BLACK); - UIUtils::GuiShadowText("OTR Version: 1.0", 32, text_y + 30, 10, WHITE, BLACK); + if (oldExtractMode) UIUtils::GuiToggle(&single_thread, "Single Thread", 32, text_y + 40, currentStep != NULLSTR); - - if(!hide_second_btn && UIUtils::GuiIconButton("Folder", "Open\nShip Folder", 109, 50, currentStep != NULLSTR, "Select your Ship of Harkinian Folder\n\nYou could use another folder\nfor development purposes")) { - const std::string path = NativeFS->LaunchFileExplorer(LaunchType::FOLDER); - sohFolder = path; - } - if (UIUtils::GuiIconButton("Cartridge", "Open\nOoT Rom", 32, 50, currentStep != NULLSTR, "Select an Ocarina of Time\nMaster Quest or Vanilla Debug Rom\n\nYou can dump it or lend one from Nintendo")) { - const std::string path = NativeFS->LaunchFileExplorer(LaunchType::FILE); - if (path != NULLSTR) { - const std::string patched_n64 = std::string(patched_rom); - MoonUtils::rm(patched_n64); - version = GetVersion(fopen(path.c_str(), "r")); - if (version.version != NULLSTR) { - MoonUtils::copy(path, patched_n64); - rom_ready = true; - return; - } - fix_baserom(path.c_str(), patched_rom); - version = GetVersion(fopen(patched_rom, "r")); - if (version.version != NULLSTR) rom_ready = true; + if (!hide_second_btn && UIUtils::GuiIconButton("Folder", "Open\nShip Folder", 109, 50, currentStep != NULLSTR, "Select your Ship of Harkinian Folder\n\nYou could use another folder\nfor development purposes")) { + const std::string path = NativeFS->LaunchFileExplorer(LaunchType::FOLDER); + sohFolder = path; + } + + if (UIUtils::GuiIconButton("Cartridge", "Open\nOoT Rom", 32, 50, currentStep != NULLSTR, "Select an Ocarina of Time\nGameCube PAL or Vanilla Debug Rom\n\nYou can dump it or lend one from Nintendo")) { + const std::string path = NativeFS->LaunchFileExplorer(LaunchType::FILE); + if (path != NULLSTR) { + const std::string patched_n64 = std::string(patched_rom); + MoonUtils::rm(patched_n64); + version = GetVersion(fopen(path.c_str(), "r")); + if (version.version != NULLSTR) { + MoonUtils::copy(path, patched_n64); + rom_ready = true; + return; } + fix_baserom(path.c_str(), patched_rom); + version = GetVersion(fopen(patched_rom, "r")); + if (version.version != NULLSTR) rom_ready = true; } + } - if(currentStep != NULLSTR) { - DrawRectangle(0, 0, windowSize.x, windowSize.y, Color(0, 0, 0, 160)); - DrawTexture(Textures["Modal"], windowSize.x / 2 - Textures["Modal"].width / 2, windowSize.y / 2 - Textures["Modal"].height / 2, WHITE); - UIUtils::GuiShadowText(currentStep.c_str(), 0, windowSize.y / 2, 10, WHITE, BLACK, windowSize.x, true); - } + if (currentStep != NULLSTR) { + DrawRectangle(0, 0, windowSize.x, windowSize.y, Color(0, 0, 0, 160)); + DrawTexture(Textures["Modal"], windowSize.x / 2 - Textures["Modal"].width / 2, windowSize.y / 2 - Textures["Modal"].height / 2, WHITE); + UIUtils::GuiShadowText(currentStep.c_str(), 0, windowSize.y / 2, 10, WHITE, BLACK, windowSize.x, true); + } - EndDrawing(); + EndDrawing(); } void setCurrentStep(const std::string& step) { @@ -166,4 +220,4 @@ void setCurrentStep(const std::string& step) { void OTRGame::exit(){ -} \ No newline at end of file +} diff --git a/OTRGui/src/game/game.h b/OTRGui/src/game/game.h index b284f857a..bd74b1c3f 100644 --- a/OTRGui/src/game/game.h +++ b/OTRGui/src/game/game.h @@ -19,6 +19,8 @@ public: void update(); void draw(); void exit(); + + inline bool CloseRequested() { return closeRequested; } protected: void LoadTexture(const std::string& name, const std::string& path) { const Image tmp = LoadImage(path.c_str()); @@ -32,6 +34,9 @@ protected: SetTextureFilter(font.texture, TEXTURE_FILTER_POINT); Fonts[name] = font; } + +private: + bool closeRequested = false; }; extern OTRGame* Game; diff --git a/OTRGui/src/impl/baserom_extractor/baserom_extractor.cpp b/OTRGui/src/impl/baserom_extractor/baserom_extractor.cpp index 86be26f6c..bd2fc42ea 100644 --- a/OTRGui/src/impl/baserom_extractor/baserom_extractor.cpp +++ b/OTRGui/src/impl/baserom_extractor/baserom_extractor.cpp @@ -83,37 +83,37 @@ RomVersion GetVersion(FILE* rom) { break; case OOT_NTSC_JP_GC: version.version = "JP GameCube (MQ Disk)"; - version.listPath = "gamecube_mq.txt"; + version.listPath = "gamecube.txt"; version.offset = OOT_OFF_JP_GC; break; case OOT_NTSC_JP_GC_CE: version.version = "GameCube (Collectors Edition Disk)"; - version.listPath = "gamecube_mq.txt"; + version.listPath = "gamecube.txt"; version.offset = OOT_OFF_JP_GC_CE; break; case OOT_NTSC_JP_MQ: version.version = "JP Master Quest"; - version.listPath = "gamecube_mq.txt"; + version.listPath = "gamecube.txt"; version.offset = OOT_OFF_JP_MQ; break; case OOT_NTSC_US_MQ: version.version = "NTSC Master Quest"; - version.listPath = "gamecube_mq.txt"; + version.listPath = "gamecube.txt"; version.offset = OOT_OFF_JP_MQ; break; case OOT_NTSC_US_GC: version.version = "NTSC GameCube"; - version.listPath = "gamecube_mq.txt"; + version.listPath = "gamecube.txt"; version.offset = OOT_OFF_US_MQ; break; case OOT_PAL_GC: version.version = "PAL GameCube"; - version.listPath = "gamecube_mq.txt"; + version.listPath = "gamecube_pal.txt"; version.offset = OOT_OFF_PAL_GC; break; case OOT_PAL_MQ: version.version = "PAL Master Quest"; - version.listPath = "pal_mq.txt"; + version.listPath = "gamecube_pal.txt"; version.offset = OOT_OFF_PAL_MQ; break; case OOT_PAL_GC_DBG1: @@ -179,6 +179,8 @@ WriteResult ExtractBaserom(const char* romPath) { const std::vector lines = MoonUtils::split(read(MoonUtils::join("assets/extractor/filelists", version.listPath)), '\n'); + std::vector decompressedData(1); + for (int i = 0; i < lines.size(); i++) { FILE* outFile = fopen(MoonUtils::join("tmp/baserom", lines[i]).c_str(), "wb"); const int romOffset = version.offset + (DMA_ENTRY_SIZE * i); @@ -196,10 +198,13 @@ WriteResult ExtractBaserom(const char* romPath) { auto outData = new uint8_t[size]; memcpy(outData, romData + physStart, size); + if (compressed) { - std::vector compressedData = yaz0_encode(outData, size); - outData = compressedData.data(); - size = compressedData.size(); + int decSize = virtEnd - virtStart; + decompressedData = std::vector(decSize); + yaz0_decode(outData, decompressedData.data(), decSize); + outData = decompressedData.data(); + size = decSize; } fwrite(outData, sizeof(char), size, outFile); diff --git a/OTRGui/src/impl/baserom_extractor/baserom_extractor.h b/OTRGui/src/impl/baserom_extractor/baserom_extractor.h index 8548f4eca..9538c87f6 100644 --- a/OTRGui/src/impl/baserom_extractor/baserom_extractor.h +++ b/OTRGui/src/impl/baserom_extractor/baserom_extractor.h @@ -1,23 +1,7 @@ #ifndef EXTRACT_BASEROM_H_ #define EXTRACT_BASEROM_H_ -#define OOT_NTSC_10 0xEC7011B7 -#define OOT_NTSC_11 0xD43DA81F -#define OOT_NTSC_12 0x693BA2AE -#define OOT_PAL_10 0xB044B569 -#define OOT_PAL_11 0xB2055FBD -#define OOT_NTSC_JP_GC_CE 0xF7F52DB8 -#define OOT_NTSC_JP_GC 0xF611F4BA -#define OOT_NTSC_US_GC 0xF3DD35BA -#define OOT_PAL_GC 0x09465AC3 -#define OOT_NTSC_JP_MQ 0xF43B45BA -#define OOT_NTSC_US_MQ 0xF034001A -#define OOT_PAL_MQ 0x1D4136F3 -#define OOT_PAL_GC_DBG1 0x871E1C92 // 03-21-2002 build -#define OOT_PAL_GC_DBG2 0x87121EFE // 03-13-2002 build -#define OOT_PAL_GC_MQ_DBG 0x917D18F6 -#define OOT_IQUE_TW 0x3D81FB3E -#define OOT_IQUE_CN 0xB1E1E07B +#include "../../libultraship/libultraship/GameVersions.h" #include #include diff --git a/OTRGui/src/impl/extractor/extractor.cpp b/OTRGui/src/impl/extractor/extractor.cpp index ec435a9e4..a2eab1bb6 100644 --- a/OTRGui/src/impl/extractor/extractor.cpp +++ b/OTRGui/src/impl/extractor/extractor.cpp @@ -5,6 +5,7 @@ #include "utils/mutils.h" #include "ctpl/ctpl_stl.h" #include +#include #ifdef _WIN32 #define PLATFORM Platforms::WINDOWS @@ -13,6 +14,7 @@ #endif namespace Util = MoonUtils; +bool oldExtractMode = false; static int maxResources = 0; static int extractedResources = 0; bool buildingOtr = false; @@ -22,19 +24,29 @@ bool isWindows() { return (PLATFORM == Platforms::WINDOWS); } -void BuildOTR(const std::string output) { - Util::copy("tmp/baserom/Audiobank", "Extract/Audiobank"); - Util::copy("tmp/baserom/Audioseq", "Extract/Audioseq"); - Util::copy("tmp/baserom/Audiotable", "Extract/Audiotable"); - - Util::copy("assets/game/", "Extract/assets/"); - - std::string execStr = Util::format("assets/extractor/%s", isWindows() ? "ZAPD.exe" : "ZAPD.out") + " botr -se OTR"; - ProcessResult result = NativeFS->LaunchProcess(execStr); - if(result.exitCode != 0) { - std::cout << "\nError when building the OTR file with error code: " << result.exitCode << " !" << std::endl; - std::cout << "Aborting...\n" << std::endl; +std::string GetXMLVersion(RomVersion version) +{ + switch (version.crc) + { + case OOT_PAL_GC_DBG1: return "GC_NMQ_D"; + case OOT_PAL_GC_DBG2: return "GC_MQ_D"; + case OOT_PAL_GC: return "GC_NMQ_PAL_F"; } + + return "ERROR"; +} + +void BuildOTR(const std::string output) { + if (oldExtractMode) + { + std::string execStr = Util::format("assets/extractor/%s", isWindows() ? "ZAPD.exe" : "ZAPD.out") + " botr -se OTR"; + ProcessResult result = NativeFS->LaunchProcess(execStr); + if (result.exitCode != 0) { + std::cout << "\nError when building the OTR file with error code: " << result.exitCode << " !" << std::endl; + std::cout << "Aborting...\n" << std::endl; + } + } + setCurrentStep("Done!"); if (output == ".") return; @@ -44,9 +56,9 @@ void BuildOTR(const std::string output) { MoonUtils::copy("oot.otr", outputPath); } -void ExtractFile(std::string xmlPath, std::string outPath, std::string outSrcPath) { +void ExtractFile(std::string xmlPath, std::string outPath, std::string outSrcPath, RomVersion version) { std::string execStr = Util::format("assets/extractor/%s", isWindows() ? "ZAPD.exe" : "ZAPD.out"); - std::string args = Util::format(" e -eh -i %s -b tmp/baserom/ -o %s -osf %s -gsf 1 -rconf assets/extractor/Config.xml -se OTR %s", xmlPath.c_str(), outPath.c_str(), outSrcPath.c_str(), xmlPath.find("overlays") != std::string::npos ? "--static" : ""); + std::string args = Util::format(" e -eh -i %s -b tmp/baserom/ -o %s -osf %s -gsf 1 -rconf assets/extractor/Config_%s.xml -se OTR %s", xmlPath.c_str(), outPath.c_str(), outSrcPath.c_str(), GetXMLVersion(version).c_str(), xmlPath.find("overlays") != std::string::npos ? "--static" : ""); ProcessResult result = NativeFS->LaunchProcess(execStr + args); if (result.exitCode != 0) { @@ -55,49 +67,77 @@ void ExtractFile(std::string xmlPath, std::string outPath, std::string outSrcPat } } -void ExtractFunc(std::string fullPath) { +void ExtractFunc(std::string fullPath, RomVersion version) { std::vector path = Util::split(fullPath, Util::pathSeparator()); std::string outPath = Util::join(Util::join("assets/extractor/xmls/output", path[4]), Util::basename(fullPath)); Util::mkdir(outPath); - ExtractFile(fullPath, outPath, outPath); + ExtractFile(fullPath, outPath, outPath, version); setCurrentStep("Extracting: " + Util::basename(fullPath)); extractedResources++; } -void startWorker() { - std::string path = "assets/extractor/xmls"; - std::vector files; - Util::dirscan(path, files); - std::vector xmlFiles; +void startWorker(RomVersion version) { + std::string path = "assets/extractor/xmls/"; - const int num_threads = std::thread::hardware_concurrency(); - ctpl::thread_pool pool(num_threads / 2); - for(auto &file : files) { - if (file.find(".xml") != std::string::npos) xmlFiles.push_back(file); - } + path += GetXMLVersion(version); - for (auto& file : xmlFiles) { - if(single_thread) { - ExtractFunc(file); - } else { - pool.push([file](int) { - ExtractFunc(file); - }); + Util::write("tmp/baserom/version", (char*)&version.crc, sizeof(version.crc)); + + if (oldExtractMode) + { + std::vector files; + Util::dirscan(path, files); + std::vector xmlFiles; + + const int num_threads = std::thread::hardware_concurrency(); + ctpl::thread_pool pool(num_threads / 2); + for (auto& file : files) { + if (file.find(".xml") != std::string::npos) xmlFiles.push_back(file); } - } - maxResources = xmlFiles.size(); + for (auto& file : xmlFiles) { + if (single_thread) { + ExtractFunc(file, version); + } + else { + pool.push([file, version](int) { + ExtractFunc(file, version); + }); + } + } + + maxResources = xmlFiles.size(); + } + else + { + std::string execStr = Util::format("assets/extractor/%s", isWindows() ? "ZAPD.exe" : "ZAPD.out"); + std::string args = Util::format(" ed -eh -i %s -b tmp/rom.z64 -fl assets/extractor/filelists -o %s -osf %s -gsf 1 -rconf assets/extractor/Config_%s.xml -se OTR %s", path.c_str(), path + "../", path + "../", GetXMLVersion(version).c_str(), ""); + ProcessResult result = NativeFS->LaunchProcess(execStr + args); + + if (result.exitCode != 0) { + std::cout << "\nError when extracting the ROM with error code: " << result.exitCode << " !" << std::endl; + std::cout << "Aborting...\n" << std::endl; + } + else + { + printf("All done?\n"); + } + + maxResources = 1; + } } void updateWorker(const std::string& output) { - if (maxResources > 0 && !buildingOtr && extractedResources >= maxResources) { + if (maxResources > 0 && !buildingOtr && (extractedResources >= maxResources || !oldExtractMode)) + { setCurrentStep("Building OTR..."); if (skipFrames < 3) { skipFrames++; return; } buildingOtr = true; - if (single_thread){ + + if (single_thread || !oldExtractMode){ BuildOTR(output); return; } diff --git a/OTRGui/src/impl/extractor/extractor.h b/OTRGui/src/impl/extractor/extractor.h index 98dea147a..de48d7574 100644 --- a/OTRGui/src/impl/extractor/extractor.h +++ b/OTRGui/src/impl/extractor/extractor.h @@ -5,5 +5,7 @@ enum Platforms { WINDOWS, LINUX }; -void startWorker(); +struct RomVersion; + +void startWorker(RomVersion version); void updateWorker(const std::string& output); \ No newline at end of file diff --git a/OTRGui/src/main.cpp b/OTRGui/src/main.cpp index 87c9d26ee..2b3e40a7c 100644 --- a/OTRGui/src/main.cpp +++ b/OTRGui/src/main.cpp @@ -17,8 +17,8 @@ void UpdateDrawFrame(void) { } int main() { - constexpr Vector2 windowSize = Vector2(400, 200); - SetTargetFPS(144); + constexpr Vector2 windowSize = Vector2(400, 200); + SetConfigFlags(FLAG_VSYNC_HINT); SetConfigFlags(FLAG_WINDOW_HIGHDPI); SetConfigFlags(FLAG_WINDOW_UNDECORATED); SetConfigFlags(FLAG_MSAA_4X_HINT); @@ -32,7 +32,7 @@ int main() { Game = new OTRGame(); Game->preload(); Game->init(); - while(!WindowShouldClose()) { + while(!WindowShouldClose() && !Game->CloseRequested()) { UpdateDrawFrame(); } CloseWindow(); diff --git a/OTRGui/src/utils/mutils.cpp b/OTRGui/src/utils/mutils.cpp index 770df8423..2a649452e 100644 --- a/OTRGui/src/utils/mutils.cpp +++ b/OTRGui/src/utils/mutils.cpp @@ -72,7 +72,11 @@ namespace MoonUtils { vector result; stringstream ss (s); string item; - while (getline(ss, item, delim)) { + while (getline(ss, item, delim)) + { + if (item.at(item.size() - 1) == '\r') + item = item.substr(0, item.size() - 1); + result.push_back (item); } return result; diff --git a/README.md b/README.md index cc5fce64d..8a4538e2a 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,23 @@ The Ship does not include assets and as such requires a prior copy of the game t ## Quick Start -1) Download The Ship of Harkinian from Discord. -2) Get a ZRET OoT Debug ROM -``` -Build date: `zelda@srd022j 03-02-21 00:49:18` -sha1: cee6bc3c2a634b41728f2af8da54d9bf8cc14099 -``` +1) Download The Ship of Harkinian from [Discord](https://discord.com/invite/BtBmd55HVH). +2) Requires a supported copy of the game (See supported games below). 3) Use the OTRGui to generate an `oot.otr` archive file. 4) Launch `soh.exe` +### Supported Games +Ocarina of Time Debug (not Master Quest) +``` +Build team: `zelda@srd022j` +Build date: `03-02-21 00:49:18` (year-month-day) +sha1: cee6bc3c2a634b41728f2af8da54d9bf8cc14099 +``` +Ocarina of Time PAL GameCube +``` +sha1: 0227d7c0074f2d0ac935631990da8ec5914597b4 +``` + Congratulations, you are now sailing with the Ship of Harkinian! Have fun! ## Additional Setup Information @@ -36,7 +44,7 @@ If you still cannot get the tool to work, join our [Discord Server](https://disc ### Running The Ship of Harkinian -Launch the game. If the window immediately closes, or if there are visual artifacts, you may have selected the wrong rom in the OTRGui tool. +Launch the game. If the window immediately closes, or if there are visual artifacts, you may have selected the wrong rom in the OTRGui tool. Currently, DirectX 11 and OpenGL is supported. Change the renderer by opening the `shipofharkinian.ini` configuration file in notepad and add `sdl` to `gfx backend` for OpenGL or leave blank for DirectX. @@ -50,23 +58,7 @@ Official Discord: https://discord.com/invite/BtBmd55HVH ## Building The Ship of Harkinian - 1. Install [Python](https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe) - 2. Install [Visual Studio 2022 Community Edition](https://visualstudio.microsoft.com/vs/community/) - 2b. In the Visual Studio Installer, install `MSVC v142 - VS 2019 C++`. - 4. Clone the Ship of Harkinian repository. - 5. Put your 2020 OoT debug rom in the `soh` folder. - 6. Launch `soh/fixbaserom.py`. - 7. Launch `soh/extract_baserom.py`. - 8. Copy the `baserom` folder from the `soh` folder into the `OTRExporter` folder. - 9. Run `OTRExporter/OTRExporter.sln`. - 10. Switch the solution to `Release x64`. - 11. Build the solution. - 12. Launching `OTRExporter/extract_assets.py` will generate an `oot.otr` archive file in `OTRExporter/oot.otr`. - 13. Run `soh/soh.sln` - 14. Switch the solution to `Release x86`. - 15. Build the solution. - 16. Copy the `OTRExporter/oot.otr` archive file to `soh/Release`. - 17. Launch `soh.exe`. +Refer to the [building instructions](BUILDING.md) to compile SoH. ## Troubleshooting The Exporter - Affirm that you have an `/assets` folder filled with XMLs in the same directory as OTRGui.exe @@ -75,38 +67,45 @@ Official Discord: https://discord.com/invite/BtBmd55HVH ## The Harbour Masters Are... - Kenix | Lead Developer/Public Relations - Resource Management Programmer, Audio System Programmer, and General Programmer - Jack Walker | Lead Developer - OTR Format Programmer, Resource Load Programmer, and General Programmer - Louist103 | Developer - Save System Programmer and General Programmer - Emil | Developer - Fast3D Programmer - m4xw | Developer - Shipwright, Throwing Baguettes, and General Programmer - MelonSpeedruns | Developer - General Programmer - Rozlette | Developer - General Programmer - JoshDuMan | Developer - General Programmer - KiritoDev/Lywx | Developer - General Programmer - Theo3 | Developer - General Programmer - Random06457 | Developer - Linux Build + Kenix | Lead Developer/Public Relations - Resource Management Programmer, Audio System Programmer, and General Programmer + Jack Walker | Lead Developer - OTR Format Programmer, Resource Load Programmer, and General Programmer + Louist103 | Developer - Save System Programmer and General Programmer + Emil | Developer - Fast3D Programmer + m4xw | Developer - Shipwright, Throwing Baguettes, and General Programmer + MelonSpeedruns | Developer - General Programmer + Rozlette | Developer - General Programmer + JoshDuMan | Developer - General Programmer + KiritoDev/Lywx | Developer - General Programmer + Theo3 | Developer - General Programmer + Random06457 | Developer - Linux Build ## Special Thanks - Decomp & ZAPD | Made this project even possible in the first place! - MNGoldenEagle | Patiently explained audio data formats, encouragement, and founding ZSO which was the first source of the game's code and resource format documentation. - Rrrrry123 | Speedbunner, encouragement, and community moderation - Fierce deity | Encouragement and community moderation - mzxrules | For his contributions to decomp - Aloxado | Developer - General Programmer - MegaMech | Developer - General Programmer - Revo | Tester - GCC support and General Testing - zfg | Tester - General Testing - Horseless Headman | Tester - General Testing - Steven Pritchett | Tester - General Testing - Trenton May | Tester - General Testing - Zeldaboy14 | Tester - General Testing, encouragement, and community moderation - Koby Howell | Tester - General Testing - Logg | Tester - General Testing - Taylor Daley | Graphic Design - Can't Sleep | Graphic Design - MicTheMicrophone | Voice actor for the King - Amphibibro | Voice actor for Link - -Lemons + Decomp & ZAPD | Made this project even possible in the first place! + MNGoldenEagle | Patiently explained audio data formats, encouragement, and founding ZSO which was the first source of the game's code and resource format documentation. + Rrrrry123 | Speedbunner, encouragement, and community moderation + Fierce deity | Encouragement and community moderation + mzxrules | For his contributions to decomp + zel. | For his contributions to decomp + Aloxado | Developer - General Programmer + MegaMech | Developer - General Programmer + Revo | Tester - GCC support and General Testing + zfg | Tester - General Testing + Horseless Headman | Tester - General Testing + Steven Pritchett | Tester - General Testing + Trenton May | Tester - General Testing + Zeldaboy14 | Tester - General Testing, encouragement, and community moderation + Koby Howell | Tester - General Testing + Logg | Tester - General Testing + Taylor Daley | Graphic Design + Can't Sleep | Graphic Design + +## Video Credits + Kenix | Producer / Writer + rainbow_fash | Executive Producer + TheLegendOfXela | Editor + MicTheMicrophone | Gwonam / The King + Amphibibro | Link + AceHeart | Zelda + +###### Lemons \ No newline at end of file diff --git a/ZAPDTR/ExporterTest/CollisionExporter.cpp b/ZAPDTR/ExporterTest/CollisionExporter.cpp index e00f5c1b0..4ab8a62cd 100644 --- a/ZAPDTR/ExporterTest/CollisionExporter.cpp +++ b/ZAPDTR/ExporterTest/CollisionExporter.cpp @@ -1,6 +1,6 @@ #include "CollisionExporter.h" -void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] fs::path outPath, +void ExporterExample_Collision::Save(ZResource* res, [[maybe_unused]] const fs::path& outPath, BinaryWriter* writer) { ZCollisionHeader* col = (ZCollisionHeader*)res; diff --git a/ZAPDTR/ExporterTest/CollisionExporter.h b/ZAPDTR/ExporterTest/CollisionExporter.h index 5f48e6557..1dc50634e 100644 --- a/ZAPDTR/ExporterTest/CollisionExporter.h +++ b/ZAPDTR/ExporterTest/CollisionExporter.h @@ -6,5 +6,5 @@ class ExporterExample_Collision : public ZResourceExporter { public: - void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override; + void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override; }; \ No newline at end of file diff --git a/ZAPDTR/ExporterTest/RoomExporter.cpp b/ZAPDTR/ExporterTest/RoomExporter.cpp index 6c5552d8f..bc7ef3727 100644 --- a/ZAPDTR/ExporterTest/RoomExporter.cpp +++ b/ZAPDTR/ExporterTest/RoomExporter.cpp @@ -20,7 +20,7 @@ #include "ZRoom/Commands/SetTimeSettings.h" #include "ZRoom/Commands/SetWind.h" -void ExporterExample_Room::Save(ZResource* res, fs::path outPath, BinaryWriter* writer) +void ExporterExample_Room::Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) { ZRoom* room = dynamic_cast(res); diff --git a/ZAPDTR/ExporterTest/RoomExporter.h b/ZAPDTR/ExporterTest/RoomExporter.h index ee531dc87..d8f7eae01 100644 --- a/ZAPDTR/ExporterTest/RoomExporter.h +++ b/ZAPDTR/ExporterTest/RoomExporter.h @@ -6,5 +6,5 @@ class ExporterExample_Room : public ZResourceExporter { public: - void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override; + void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override; }; \ No newline at end of file diff --git a/ZAPDTR/ExporterTest/TextureExporter.cpp b/ZAPDTR/ExporterTest/TextureExporter.cpp index 6488bed3a..58d0964d3 100644 --- a/ZAPDTR/ExporterTest/TextureExporter.cpp +++ b/ZAPDTR/ExporterTest/TextureExporter.cpp @@ -1,7 +1,7 @@ #include "TextureExporter.h" #include "../ZAPD/ZFile.h" -void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] fs::path outPath, +void ExporterExample_Texture::Save(ZResource* res, [[maybe_unused]] const fs::path& outPath, BinaryWriter* writer) { ZTexture* tex = (ZTexture*)res; diff --git a/ZAPDTR/ExporterTest/TextureExporter.h b/ZAPDTR/ExporterTest/TextureExporter.h index 41c4e79be..f3922cac1 100644 --- a/ZAPDTR/ExporterTest/TextureExporter.h +++ b/ZAPDTR/ExporterTest/TextureExporter.h @@ -7,5 +7,5 @@ class ExporterExample_Texture : public ZResourceExporter { public: - void Save(ZResource* res, fs::path outPath, BinaryWriter* writer) override; + void Save(ZResource* res, const fs::path& outPath, BinaryWriter* writer) override; }; \ No newline at end of file diff --git a/ZAPDTR/Makefile b/ZAPDTR/Makefile index 2b47a8039..13f0dce20 100644 --- a/ZAPDTR/Makefile +++ b/ZAPDTR/Makefile @@ -44,7 +44,8 @@ ifneq ($(DEPRECATION_ON),0) endif # CXXFLAGS += -DTEXTURE_DEBUG -LDFLAGS := -lm -ldl -lpng +LDFLAGS := -lm -ldl -lpng \ + -L../external -L../libultraship -lz -lbz2 -pthread -lpulse -lultraship -lstorm -lSDL2 -lGLEW -lGL -lX11 # Use LLD if available. Set LLD=0 to not use it ifeq ($(shell command -v ld.lld >/dev/null 2>&1; echo $$?),0) @@ -59,9 +60,9 @@ UNAME := $(shell uname) UNAMEM := $(shell uname -m) ifneq ($(UNAME), Darwin) LDFLAGS += -Wl,-export-dynamic -lstdc++fs - EXPORTERS := -Wl,--whole-archive ExporterTest/ExporterTest.a -Wl,--no-whole-archive + EXPORTERS := -Wl,--whole-archive ../OTRExporter/OTRExporter/OTRExporter.a -Wl,--no-whole-archive else - EXPORTERS := -Wl,-force_load ExporterTest/ExporterTest.a + EXPORTERS := -Wl,-force_load ../OTRExporter/OTRExporter/OTRExporter.a ifeq ($(UNAMEM),arm64) ifeq ($(shell brew list libpng > /dev/null 2>&1; echo $$?),0) LDFLAGS += -L $(shell brew --prefix)/lib diff --git a/ZAPDTR/ZAPD/CRC32.h b/ZAPDTR/ZAPD/CRC32.h index 4158a5528..1f82c75c5 100644 --- a/ZAPDTR/ZAPD/CRC32.h +++ b/ZAPDTR/ZAPD/CRC32.h @@ -1,6 +1,6 @@ #pragma once -static uint32_t CRC32B(unsigned char* message, int32_t size) +static uint32_t CRC32B(const unsigned char* message, int32_t size) { int32_t byte, crc; int32_t mask; diff --git a/ZAPDTR/ZAPD/Declaration.cpp b/ZAPDTR/ZAPD/Declaration.cpp index eeb988db7..27494b866 100644 --- a/ZAPDTR/ZAPD/Declaration.cpp +++ b/ZAPDTR/ZAPD/Declaration.cpp @@ -1,6 +1,7 @@ #include "Declaration.h" #include "Globals.h" +#include "ZVtx.h" #include "Utils/StringHelper.h" Declaration::Declaration(offset_t nAddress, DeclarationAlignment nAlignment, size_t nSize, @@ -61,6 +62,12 @@ Declaration::Declaration(offset_t nAddress, const std::string& nIncludePath, siz varName = nVarName; } +Declaration::~Declaration() +{ + //for (auto item : vertexHack) + //delete item; +} + bool Declaration::IsStatic() const { switch (staticConf) diff --git a/ZAPDTR/ZAPD/Declaration.h b/ZAPDTR/ZAPD/Declaration.h index 4a743b50f..45d36f49e 100644 --- a/ZAPDTR/ZAPD/Declaration.h +++ b/ZAPDTR/ZAPD/Declaration.h @@ -22,6 +22,8 @@ enum class StaticConfig On }; +class ZVtx; + class Declaration { public: @@ -38,6 +40,8 @@ public: std::string varName; std::string includePath; + std::vector vertexHack; + bool isExternal = false; bool isArray = false; bool forceArrayCnt = false; @@ -65,6 +69,8 @@ public: Declaration(offset_t nAddress, const std::string& nIncludePath, size_t nSize, const std::string& nVarType, const std::string& nVarName); + ~Declaration(); + bool IsStatic() const; std::string GetNormalDeclarationStr() const; diff --git a/ZAPDTR/ZAPD/FileWorker.cpp b/ZAPDTR/ZAPD/FileWorker.cpp new file mode 100644 index 000000000..e69de29bb diff --git a/ZAPDTR/ZAPD/FileWorker.h b/ZAPDTR/ZAPD/FileWorker.h new file mode 100644 index 000000000..6ceae8076 --- /dev/null +++ b/ZAPDTR/ZAPD/FileWorker.h @@ -0,0 +1,15 @@ +#pragma once + +#include +#include +#include +#include "ZFile.h" + +class FileWorker +{ +public: + std::vector files; + std::vector externalFiles; + std::vector segments; + std::map> segmentRefFiles; +}; \ No newline at end of file diff --git a/ZAPDTR/ZAPD/Globals.cpp b/ZAPDTR/ZAPD/Globals.cpp index 0902b2c9e..455205b2a 100644 --- a/ZAPDTR/ZAPD/Globals.cpp +++ b/ZAPDTR/ZAPD/Globals.cpp @@ -20,6 +20,7 @@ Globals::Globals() profile = false; useLegacyZDList = false; useExternalResources = true; + singleThreaded = true; verbosity = VerbosityLevel::VERBOSITY_SILENT; outputPath = Directory::GetCurrentDirectory(); } @@ -34,30 +35,88 @@ Globals::~Globals() } } -void Globals::AddSegment(int32_t segment, ZFile* file) +void Globals::AddSegment(int32_t segment, ZFile* file, int workerID) { - if (std::find(segments.begin(), segments.end(), segment) == segments.end()) - segments.push_back(segment); - if (cfg.segmentRefFiles.find(segment) == cfg.segmentRefFiles.end()) - cfg.segmentRefFiles[segment] = std::vector(); - - cfg.segmentRefFiles[segment].push_back(file); -} - -bool Globals::HasSegment(int32_t segment) -{ - return std::find(segments.begin(), segments.end(), segment) != segments.end(); -} - -ZFile* Globals::GetSegment(int32_t segment) -{ - if (HasSegment(segment)) + if (!Globals::Instance->singleThreaded) { - int idx = std::find(segments.begin(), segments.end(), segment) - segments.begin(); - return files[idx]; + auto worker = workerData[workerID]; + + if (std::find(worker->segments.begin(), worker->segments.end(), segment) == + worker->segments.end()) + worker->segments.push_back(segment); + if (worker->segmentRefFiles.find(segment) == worker->segmentRefFiles.end()) + worker->segmentRefFiles[segment] = std::vector(); + + worker->segmentRefFiles[segment].push_back(file); } else - return nullptr; + { + if (std::find(segments.begin(), segments.end(), segment) == segments.end()) + segments.push_back(segment); + if (cfg.segmentRefFiles.find(segment) == cfg.segmentRefFiles.end()) + cfg.segmentRefFiles[segment] = std::vector(); + + cfg.segmentRefFiles[segment].push_back(file); + } +} + +bool Globals::HasSegment(int32_t segment, int workerID) +{ + if (!Globals::Instance->singleThreaded) + return std::find(workerData[workerID]->segments.begin(), + workerData[workerID]->segments.end(), segment) != workerData[workerID]->segments.end(); + else + return std::find(segments.begin(), segments.end(), segment) != segments.end(); +} + +ZFile* Globals::GetSegment(int32_t segment, int workerID) +{ + if (!Globals::Instance->singleThreaded) + { + if (HasSegment(segment, workerID)) + { + int idx = std::find(workerData[workerID]->segments.begin(), + workerData[workerID]->segments.end(), segment) - + workerData[workerID]->segments.begin(); + return workerData[workerID]->files[idx]; + } + else + return nullptr; + } + else + { + if (HasSegment(segment, workerID)) + { + int idx = std::find(segments.begin(), segments.end(), segment) - segments.begin(); + return files[idx]; + } + else + return nullptr; + } +} + +std::map> Globals::GetSegmentRefFiles(int workerID) +{ + if (!Globals::Instance->singleThreaded) + return workerData[workerID]->segmentRefFiles; + else + return cfg.segmentRefFiles; +} + +void Globals::AddFile(ZFile* file, int workerID) +{ + if (singleThreaded) + files.push_back(file); + else + workerData[workerID]->files.push_back(file); +} + +void Globals::AddExternalFile(ZFile* file, int workerID) +{ + if (singleThreaded) + externalFiles.push_back(file); + else + workerData[workerID]->externalFiles.push_back(file); } std::map& Globals::GetExporterMap() @@ -93,8 +152,22 @@ ExporterSet* Globals::GetExporterSet() return nullptr; } +std::vector Globals::GetBaseromFile(std::string fileName) +{ + if (fileMode == ZFileMode::ExtractDirectory) + { + if (StringHelper::Contains(fileName, "baserom/")) + fileName = StringHelper::Split(fileName, "baserom/")[1]; + + return rom->GetFile(fileName); + + } + else + return File::ReadAllBytes(fileName); +} + bool Globals::GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile, - const std::string& expectedType, std::string& declName) + const std::string& expectedType, std::string& declName, int workerID) { if (segAddress == 0) { @@ -130,9 +203,11 @@ bool Globals::GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile, if (currentFile->GetDeclarationPtrName(segAddress, expectedType, declName)) return true; } - else if (HasSegment(segment)) + else if (HasSegment(segment, workerID)) { - for (auto file : cfg.segmentRefFiles[segment]) + // OTRTODO: Multithreading + auto segs = GetSegmentRefFiles(workerID); + for (auto file : segs[segment]) { offset = Seg2Filespace(segAddress, file->baseAddress); @@ -176,7 +251,7 @@ bool Globals::GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile, bool Globals::GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSize, ZFile* currentFile, const std::string& expectedType, - std::string& declName) + std::string& declName, int workerID) { if (segAddress == 0) { @@ -193,9 +268,11 @@ bool Globals::GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSi if (addressFound) return true; } - else if (HasSegment(segment)) + else if (HasSegment(segment, workerID)) { - for (auto file : cfg.segmentRefFiles[segment]) + // OTRTODO: Multithreading + auto segs = GetSegmentRefFiles(workerID); + for (auto file : segs[segment]) { if (file->IsSegmentedInFilespaceRange(segAddress)) { diff --git a/ZAPDTR/ZAPD/Globals.h b/ZAPDTR/ZAPD/Globals.h index 140de1f24..683fd6fcd 100644 --- a/ZAPDTR/ZAPD/Globals.h +++ b/ZAPDTR/ZAPD/Globals.h @@ -5,6 +5,8 @@ #include #include "GameConfig.h" #include "ZFile.h" +#include +#include class ZRoom; @@ -36,6 +38,7 @@ public: ExporterSetFuncVoid3 beginXMLFunc = nullptr; ExporterSetFuncVoid3 endXMLFunc = nullptr; ExporterSetResSave resSaveFunc = nullptr; + ExporterSetFuncVoid3 endProgramFunc = nullptr; }; class Globals @@ -49,9 +52,10 @@ public: bool outputCrc = false; bool profile; // Measure performance of certain operations bool useLegacyZDList; + bool singleThreaded; VerbosityLevel verbosity; // ZAPD outputs additional information ZFileMode fileMode; - fs::path baseRomPath, inputPath, outputPath, sourceOutputPath, cfgPath; + fs::path baseRomPath, inputPath, outputPath, sourceOutputPath, cfgPath, fileListPath; TextureType texType; ZGame game; GameConfig cfg; @@ -61,10 +65,13 @@ public: bool forceUnaccountedStatic = false; bool otrMode = true; + ZRom* rom; std::vector files; std::vector externalFiles; std::vector segments; + std::map workerData; + std::string currentExporter; static std::map& GetExporterMap(); static void AddExporter(std::string exporterName, ExporterSet* exporterSet); @@ -72,13 +79,18 @@ public: Globals(); ~Globals(); - void AddSegment(int32_t segment, ZFile* file); - bool HasSegment(int32_t segment); - ZFile* GetSegment(int32_t segment); + void AddSegment(int32_t segment, ZFile* file, int workerID); + bool HasSegment(int32_t segment, int workerID); + ZFile* GetSegment(int32_t segment, int workerID); + std::map> GetSegmentRefFiles(int workerID); + void AddFile(ZFile* file, int workerID); + void AddExternalFile(ZFile* file, int workerID); ZResourceExporter* GetExporter(ZResourceType resType); ExporterSet* GetExporterSet(); + std::vector GetBaseromFile(std::string fileName); + /** * Search in every file (and the symbol map) for the `segAddress` passed as parameter. * If the segment of `currentFile` is the same segment of `segAddress`, then that file will be @@ -88,8 +100,8 @@ public: * in which case `declName` will be set to the address formatted as a pointer. */ bool GetSegmentedPtrName(segptr_t segAddress, ZFile* currentFile, - const std::string& expectedType, std::string& declName); + const std::string& expectedType, std::string& declName, int workerID); bool GetSegmentedArrayIndexedName(segptr_t segAddress, size_t elementSize, ZFile* currentFile, - const std::string& expectedType, std::string& declName); + const std::string& expectedType, std::string& declName, int workerID); }; diff --git a/ZAPDTR/ZAPD/Main.cpp b/ZAPDTR/ZAPD/Main.cpp index 440f6d504..65a65fea6 100644 --- a/ZAPDTR/ZAPD/Main.cpp +++ b/ZAPDTR/ZAPD/Main.cpp @@ -10,7 +10,7 @@ #include "ZFile.h" #include "ZTexture.h" -#if !defined(_MSC_VER) && !defined(__CYGWIN__) +#ifdef __linux__ #include #include #include @@ -23,18 +23,47 @@ #include #include #include "tinyxml2.h" +#include //extern const char gBuildHash[]; const char gBuildHash[] = ""; +// LINUX_TODO: remove, those are because of soh <-> lus dependency problems +float divisor_num = 0.0f; + +extern "C" void Audio_SetGameVolume(int player_id, float volume) +{ + +} + + +extern "C" int ResourceMgr_OTRSigCheck(char* imgData) +{ + +} + +void DebugConsole_SaveCVars() +{ + +} + +void DebugConsole_LoadCVars() +{ + +} + + bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath, - ZFileMode fileMode); + ZFileMode fileMode, int workerID); void BuildAssetTexture(const fs::path& pngFilePath, TextureType texType, const fs::path& outPath); void BuildAssetBackground(const fs::path& imageFilePath, const fs::path& outPath); void BuildAssetBlob(const fs::path& blobFilePath, const fs::path& outPath); +int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileMode fileMode); -#if !defined(_MSC_VER) && !defined(__CYGWIN__) +volatile int numWorkersLeft = 0; + +#ifdef __linux__ #define ARRAY_COUNT(arr) (sizeof(arr) / sizeof(arr[0])) void ErrorHandler(int sig) { @@ -182,20 +211,26 @@ int main(int argc, char* argv[]) { Globals::Instance->cfgPath = argv[++i]; } + else if (arg == "-fl") // Set baserom filelist path + { + Globals::Instance->fileListPath = argv[++i]; + } else if (arg == "-rconf") // Read Config File { Globals::Instance->cfg.ReadConfigFile(argv[++i]); } else if (arg == "-eh") // Enable Error Handler { -#if !defined(_MSC_VER) && !defined(__CYGWIN__) +#ifdef __linux__ signal(SIGSEGV, ErrorHandler); signal(SIGABRT, ErrorHandler); #else - HANDLE_WARNING(WarningType::Always, - "tried to set error handler, but this ZAPD build lacks support for one", - ""); + // HANDLE_WARNING(WarningType::Always, + // "tried to set error handler, but this ZAPD build lacks support for one", + // ""); #endif + + } else if (arg == "-v") // Verbose { @@ -240,6 +275,8 @@ int main(int argc, char* argv[]) fileMode = ZFileMode::BuildBlob; else if (buildMode == "e") fileMode = ZFileMode::Extract; + else if (buildMode == "ed") + fileMode = ZFileMode::ExtractDirectory; else if (exporterSet != nullptr && exporterSet->parseFileModeFunc != nullptr) exporterSet->parseFileModeFunc(buildMode, fileMode); @@ -249,6 +286,11 @@ int main(int argc, char* argv[]) return 1; } + Globals::Instance->fileMode = fileMode; + + if (fileMode == ZFileMode::ExtractDirectory) + Globals::Instance->rom = new ZRom(Globals::Instance->baseRomPath.string()); + // We've parsed through our commands once. If an exporter exists, it's been set by now. // Now we'll parse through them again but pass them on to our exporter if one is available. @@ -267,7 +309,7 @@ int main(int argc, char* argv[]) } // TODO: switch - if (fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile) + if (fileMode == ZFileMode::Extract || fileMode == ZFileMode::BuildSourceFile || fileMode == ZFileMode::ExtractDirectory) { bool procFileModeSuccess = false; @@ -276,30 +318,85 @@ int main(int argc, char* argv[]) if (!procFileModeSuccess) { - bool parseSuccessful; - - for (auto& extFile : Globals::Instance->cfg.externalFiles) + if (fileMode == ZFileMode::ExtractDirectory) { - fs::path externalXmlFilePath = - Globals::Instance->cfg.externalXmlFolder / extFile.xmlPath; + std::vector fileList = + Directory::ListFiles(Globals::Instance->inputPath.string()); - if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) + const int num_threads = std::thread::hardware_concurrency(); + ctpl::thread_pool pool(num_threads / 2); + + bool parseSuccessful; + + auto start = std::chrono::steady_clock::now(); + int fileListSize = fileList.size(); + Globals::Instance->singleThreaded = false; + + for (int i = 0; i < fileListSize; i++) + Globals::Instance->workerData[i] = new FileWorker(); + + numWorkersLeft = fileListSize; + + for (int i = 0; i < fileListSize; i++) { - printf("Parsing external file from config: '%s'\n", - externalXmlFilePath.c_str()); + if (Globals::Instance->singleThreaded) + { + ExtractFunc(i, fileList.size(), fileList[i], fileMode); + } + else + { + std::string fileListItem = fileList[i]; + pool.push([i, fileListSize, fileListItem, fileMode](int) { + ExtractFunc(i, fileListSize, fileListItem, fileMode); + }); + } } - parseSuccessful = Parse(externalXmlFilePath, Globals::Instance->baseRomPath, - extFile.outPath, ZFileMode::ExternalFile); + if (!Globals::Instance->singleThreaded) + { + while (true) + { + if (numWorkersLeft <= 0) + break; + std::this_thread::sleep_for(std::chrono::milliseconds(250)); + } + } + + auto end = std::chrono::steady_clock::now(); + auto diff = + std::chrono::duration_cast(end - start).count(); + + printf("Generated OTR File Data in %i seconds\n", diff); + } + else + { + bool parseSuccessful; + + for (auto& extFile : Globals::Instance->cfg.externalFiles) + { + fs::path externalXmlFilePath = + Globals::Instance->cfg.externalXmlFolder / extFile.xmlPath; + + if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) + { + printf("Parsing external file from config: '%s'\n", + externalXmlFilePath.c_str()); + } + + parseSuccessful = Parse(externalXmlFilePath, Globals::Instance->baseRomPath, + extFile.outPath, ZFileMode::ExternalFile, 0); + + if (!parseSuccessful) + return 1; + } + + parseSuccessful = + Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, + Globals::Instance->outputPath, fileMode, 0); if (!parseSuccessful) return 1; } - - parseSuccessful = Parse(Globals::Instance->inputPath, Globals::Instance->baseRomPath, - Globals::Instance->outputPath, fileMode); - if (!parseSuccessful) - return 1; } } else if (fileMode == ZFileMode::BuildTexture) @@ -315,23 +412,77 @@ int main(int argc, char* argv[]) { BuildAssetBlob(Globals::Instance->inputPath, Globals::Instance->outputPath); } - else if (fileMode == ZFileMode::BuildOverlay) - { - ZOverlay* overlay = - ZOverlay::FromBuild(Path::GetDirectoryName(Globals::Instance->inputPath), - Path::GetDirectoryName(Globals::Instance->cfgPath)); - if (overlay != nullptr) - File::WriteAllText(Globals::Instance->outputPath.string(), - overlay->GetSourceOutputCode("")); - } + if (exporterSet != nullptr && exporterSet->endProgramFunc != nullptr) + exporterSet->endProgramFunc(); delete g; return 0; } +int ExtractFunc(int workerID, int fileListSize, std::string fileListItem, ZFileMode fileMode) +{ + bool parseSuccessful; + + printf("(%i / %i): %s\n", (workerID + 1), fileListSize, fileListItem.c_str()); + + for (auto& extFile : Globals::Instance->cfg.externalFiles) + { + fs::path externalXmlFilePath = Globals::Instance->cfg.externalXmlFolder / extFile.xmlPath; + + if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) + { + printf("Parsing external file from config: '%s'\n", externalXmlFilePath.c_str()); + } + + parseSuccessful = Parse(externalXmlFilePath, Globals::Instance->baseRomPath, + extFile.outPath, ZFileMode::ExternalFile, workerID); + + if (!parseSuccessful) + return 1; + } + + parseSuccessful = Parse(fileListItem, Globals::Instance->baseRomPath, + Globals::Instance->outputPath, fileMode, workerID); + + if (!parseSuccessful) + return 1; + + if (Globals::Instance->singleThreaded) + { + for (int i = 0; i < Globals::Instance->files.size(); i++) + { + delete Globals::Instance->files[i]; + Globals::Instance->files.erase(Globals::Instance->files.begin() + i); + i--; + } + + Globals::Instance->externalFiles.clear(); + Globals::Instance->segments.clear(); + Globals::Instance->cfg.segmentRefFiles.clear(); + } + else + { + for (int i = 0; i < Globals::Instance->workerData[workerID]->files.size(); i++) + { + delete Globals::Instance->workerData[workerID]->files[i]; + Globals::Instance->workerData[workerID]->files.erase( + Globals::Instance->workerData[workerID]->files.begin() + + i); + i--; + } + + Globals::Instance->workerData[workerID]->externalFiles.clear(); + Globals::Instance->workerData[workerID]->segments.clear(); + Globals::Instance->workerData[workerID]->segmentRefFiles.clear(); + + numWorkersLeft--; + } + return 0; +} + bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path& outPath, - ZFileMode fileMode) + ZFileMode fileMode, int workerID) { tinyxml2::XMLDocument doc; tinyxml2::XMLError eResult = doc.LoadFile(xmlFilePath.string().c_str()); @@ -359,11 +510,11 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path { if (std::string_view(child->Name()) == "File") { - ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", xmlFilePath); - Globals::Instance->files.push_back(file); + ZFile* file = new ZFile(fileMode, child, basePath, outPath, "", xmlFilePath, workerID); + Globals::Instance->AddFile(file, workerID); if (fileMode == ZFileMode::ExternalFile) { - Globals::Instance->externalFiles.push_back(file); + Globals::Instance->AddExternalFile(file, workerID); file->isExternalFile = true; } } @@ -396,7 +547,7 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path } // Recursion. What can go wrong? - Parse(externalXmlFilePath, basePath, externalOutFilePath, ZFileMode::ExternalFile); + Parse(externalXmlFilePath, basePath, externalOutFilePath, ZFileMode::ExternalFile, workerID); } else { @@ -415,7 +566,14 @@ bool Parse(const fs::path& xmlFilePath, const fs::path& basePath, const fs::path if (exporterSet != nullptr && exporterSet->beginXMLFunc != nullptr) exporterSet->beginXMLFunc(); - for (ZFile* file : Globals::Instance->files) + std::vector files; + + if (Globals::Instance->singleThreaded) + files = Globals::Instance->files; + else + files = Globals::Instance->workerData[workerID]->files; + + for (ZFile* file : files) { if (fileMode == ZFileMode::BuildSourceFile) file->BuildSourceFile(); diff --git a/ZAPDTR/ZAPD/OtherStructs/SkinLimbStructs.cpp b/ZAPDTR/ZAPD/OtherStructs/SkinLimbStructs.cpp index 8ce215c97..c9a537ced 100644 --- a/ZAPDTR/ZAPD/OtherStructs/SkinLimbStructs.cpp +++ b/ZAPDTR/ZAPD/OtherStructs/SkinLimbStructs.cpp @@ -199,8 +199,10 @@ std::string Struct_800A598C::GetBodySourceCode() const { std::string unk_8_Str; std::string unk_C_Str; - Globals::Instance->GetSegmentedPtrName(unk_8, parent, "Struct_800A57C0", unk_8_Str); - Globals::Instance->GetSegmentedPtrName(unk_C, parent, "Struct_800A598C_2", unk_C_Str); + Globals::Instance->GetSegmentedPtrName(unk_8, parent, "Struct_800A57C0", unk_8_Str, + parent->workerID); + Globals::Instance->GetSegmentedPtrName(unk_C, parent, "Struct_800A598C_2", unk_C_Str, + parent->workerID); std::string entryStr = StringHelper::Sprintf("\n\t\tARRAY_COUNTU(%s), ARRAY_COUNTU(%s),\n", unk_8_Str.c_str(), unk_C_Str.c_str()); @@ -316,8 +318,9 @@ std::string Struct_800A5E28::GetBodySourceCode() const { std::string unk_4_Str; std::string unk_8_Str; - Globals::Instance->GetSegmentedPtrName(unk_4, parent, "Struct_800A598C", unk_4_Str); - Globals::Instance->GetSegmentedPtrName(unk_8, parent, "Gfx", unk_8_Str); + Globals::Instance->GetSegmentedPtrName(unk_4, parent, "Struct_800A598C", unk_4_Str, + parent->workerID); + Globals::Instance->GetSegmentedPtrName(unk_8, parent, "Gfx", unk_8_Str, parent->workerID); std::string entryStr = "\n"; entryStr += StringHelper::Sprintf("\t%i, ARRAY_COUNTU(%s),\n", unk_0, unk_4_Str.c_str()); diff --git a/ZAPDTR/ZAPD/OutputFormatter.cpp b/ZAPDTR/ZAPD/OutputFormatter.cpp index dbb8692c0..362ef98fc 100644 --- a/ZAPDTR/ZAPD/OutputFormatter.cpp +++ b/ZAPDTR/ZAPD/OutputFormatter.cpp @@ -3,7 +3,7 @@ void OutputFormatter::Flush() { - //if (!Globals::Instance->otrMode) + //if (!Globals::Instance->otrMode) // OTRTODO: MULTITHREADING { if (col > lineLimit && !Globals::Instance->otrMode) { @@ -31,6 +31,10 @@ void OutputFormatter::Flush() int OutputFormatter::Write(const char* buf, int count) { + // OTRTODO + //if (!Globals::Instance->singleThreaded) + //return 0; + for (int i = 0; i < count; i++) { char c = buf[i]; @@ -92,7 +96,7 @@ int OutputFormatter::Write(const std::string& buf) return Write(buf.data(), buf.size()); } -OutputFormatter* OutputFormatter::Instance; +thread_local OutputFormatter* OutputFormatter::Instance; int OutputFormatter::WriteStatic(const char* buf, int count) { diff --git a/ZAPDTR/ZAPD/OutputFormatter.h b/ZAPDTR/ZAPD/OutputFormatter.h index 28955b1cd..03abfdb96 100644 --- a/ZAPDTR/ZAPD/OutputFormatter.h +++ b/ZAPDTR/ZAPD/OutputFormatter.h @@ -25,7 +25,7 @@ private: void Flush(); - static OutputFormatter* Instance; + static thread_local OutputFormatter* Instance; static int WriteStatic(const char* buf, int count); public: diff --git a/ZAPDTR/ZAPD/Overlays/ZOverlay.cpp b/ZAPDTR/ZAPD/Overlays/ZOverlay.cpp index 113c4ef33..c3e7c68c7 100644 --- a/ZAPDTR/ZAPD/Overlays/ZOverlay.cpp +++ b/ZAPDTR/ZAPD/Overlays/ZOverlay.cpp @@ -1,3 +1,4 @@ +#if 0 #include "ZOverlay.h" #include @@ -350,3 +351,4 @@ ELFIO::Elf_Half ZOverlay::FindSymbolInSection(const std::string& curSymName, } return SHN_UNDEF; } +#endif \ No newline at end of file diff --git a/ZAPDTR/ZAPD/Overlays/ZOverlay.h b/ZAPDTR/ZAPD/Overlays/ZOverlay.h index 98ead9013..c1fadddca 100644 --- a/ZAPDTR/ZAPD/Overlays/ZOverlay.h +++ b/ZAPDTR/ZAPD/Overlays/ZOverlay.h @@ -1,5 +1,7 @@ #pragma once +#if 0 + #include "Utils/Directory.h" #include "ZResource.h" #include "elfio/elfio.hpp" @@ -73,3 +75,4 @@ private: ELFIO::Elf_Half FindSymbolInSection(const std::string& curSymName, ELFIO::section* sectionData, ELFIO::elfio& reader, size_t readerId); }; +#endif \ No newline at end of file diff --git a/ZAPDTR/ZAPD/ZAPD.vcxproj b/ZAPDTR/ZAPD/ZAPD.vcxproj index 95e89d8ff..91ff515a2 100644 --- a/ZAPDTR/ZAPD/ZAPD.vcxproj +++ b/ZAPDTR/ZAPD/ZAPD.vcxproj @@ -74,15 +74,29 @@ $(OutDir);$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\..\OTRExporter\packages\libpng-v142.1.6.37.2\build\native\lib\x64\v142\Debug\;$(ProjectDir)..\..\libultraship\libultraship\;$(LibraryPath) $(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath) + MinimumRecommendedRules.ruleset + + $(ProjectDir)..\ZAPDUtils;$(ProjectDir)..\lib\tinyxml2;$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\lib\elfio;$(ProjectDir)..\lib\stb;$(ProjectDir);$(IncludePath) $(OutDir);$(ProjectDir)..\lib\libgfxd;$(ProjectDir)..\..\OTRExporter\packages\libpng-v142.1.6.37.2\build\native\lib\x64\v142\Debug\;$(ProjectDir)..\..\libultraship\libultraship\;$(LibraryPath) false + MinimumRecommendedRules.ruleset + + $(SolutionDir)ZAPD\lib\tinyxml2;$(SolutionDir)ZAPD\lib\libgfxd;$(SolutionDir)ZAPD\lib\elfio;$(SolutionDir)ZAPD\lib\stb;$(ProjectDir);$(IncludePath) $(SolutionDir)ZAPD\lib\libgfxd;$(SolutionDir)x64\Debug;$(SolutionDir)packages\libpng.1.6.28.1\build\native\lib\x64\v140\dynamic\Debug;$(LibraryPath) + MinimumRecommendedRules.ruleset + + + + + MinimumRecommendedRules.ruleset + + @@ -170,6 +184,7 @@ + @@ -178,6 +193,7 @@ + @@ -185,6 +201,7 @@ + @@ -257,7 +274,9 @@ + + @@ -265,6 +284,8 @@ + + @@ -278,6 +299,7 @@ + @@ -334,6 +356,12 @@ + + + {02d10590-9542-3f55-aaf8-6055677e2a2a} + false + + diff --git a/ZAPDTR/ZAPD/ZAPD.vcxproj.filters b/ZAPDTR/ZAPD/ZAPD.vcxproj.filters index 2a004bf9d..c122b7e56 100644 --- a/ZAPDTR/ZAPD/ZAPD.vcxproj.filters +++ b/ZAPDTR/ZAPD/ZAPD.vcxproj.filters @@ -58,6 +58,12 @@ {730beb67-6d59-4849-9d9b-702c4a565fc0} + + {b26457d2-cdb8-4c92-9ed7-a55bf6d3619e} + + + {9651a041-1019-4486-9e90-1dccfa9471e9} + @@ -282,6 +288,15 @@ Source Files\Z64 + + Source Files\Z64 + + + Source Files\Yaz0 + + + Source Files + @@ -539,6 +554,21 @@ Header Files\Z64 + + Header Files\Z64 + + + Header Files\Yaz0 + + + Header Files\Yaz0 + + + Header Files + + + Header Files\Libraries + diff --git a/ZAPDTR/ZAPD/ZAnimation.cpp b/ZAPDTR/ZAPD/ZAnimation.cpp index dced31aff..ef4735e09 100644 --- a/ZAPDTR/ZAPD/ZAnimation.cpp +++ b/ZAPDTR/ZAPD/ZAnimation.cpp @@ -112,12 +112,15 @@ void ZNormalAnimation::DeclareReferences(const std::string& prefix) const uint8_t lineLength = 14; const uint8_t offset = 0; - for (size_t i = 0; i < rotationValues.size(); i++) + if (!Globals::Instance->otrMode) { - valuesStr += StringHelper::Sprintf("0x%04X, ", rotationValues[i]); + for (size_t i = 0; i < rotationValues.size(); i++) + { + valuesStr += StringHelper::Sprintf("0x%04X, ", rotationValues[i]); - if ((i - offset + 1) % lineLength == 0) - valuesStr += "\n "; + if ((i - offset + 1) % lineLength == 0) + valuesStr += "\n "; + } } parent->AddDeclarationArray(rotationValuesOffset, DeclarationAlignment::Align4, @@ -125,13 +128,17 @@ void ZNormalAnimation::DeclareReferences(const std::string& prefix) StringHelper::Sprintf("%sFrameData", defaultPrefix.c_str()), rotationValues.size(), valuesStr); - for (size_t i = 0; i < rotationIndices.size(); i++) + if (!Globals::Instance->otrMode) { - indicesStr += StringHelper::Sprintf(" { 0x%04X, 0x%04X, 0x%04X },", rotationIndices[i].x, - rotationIndices[i].y, rotationIndices[i].z); + for (size_t i = 0; i < rotationIndices.size(); i++) + { + indicesStr += + StringHelper::Sprintf(" { 0x%04X, 0x%04X, 0x%04X },", rotationIndices[i].x, + rotationIndices[i].y, rotationIndices[i].z); - if (i != (rotationIndices.size() - 1)) - indicesStr += "\n"; + if (i != (rotationIndices.size() - 1)) + indicesStr += "\n"; + } } parent->AddDeclarationArray(rotationIndicesOffset, DeclarationAlignment::Align4, @@ -143,10 +150,11 @@ void ZNormalAnimation::DeclareReferences(const std::string& prefix) std::string ZNormalAnimation::GetBodySourceCode() const { std::string frameDataName; - Globals::Instance->GetSegmentedPtrName(rotationValuesSeg, parent, "s16", frameDataName); + Globals::Instance->GetSegmentedPtrName(rotationValuesSeg, parent, "s16", frameDataName, + parent->workerID); std::string jointIndicesName; Globals::Instance->GetSegmentedPtrName(rotationIndicesSeg, parent, "JointIndex", - jointIndicesName); + jointIndicesName, parent->workerID); std::string headerStr = StringHelper::Sprintf("\n\t{ %i }, %s,\n", frameCount, frameDataName.c_str()); @@ -183,7 +191,7 @@ void ZLinkAnimation::ParseRawData() std::string ZLinkAnimation::GetBodySourceCode() const { std::string segSymbol; - Globals::Instance->GetSegmentedPtrName(segmentAddress, parent, "", segSymbol); + Globals::Instance->GetSegmentedPtrName(segmentAddress, parent, "", segSymbol, parent->workerID); return StringHelper::Sprintf("\n\t{ %i }, %s\n", frameCount, segSymbol.c_str()); } @@ -383,12 +391,13 @@ void ZCurveAnimation::DeclareReferences(const std::string& prefix) std::string ZCurveAnimation::GetBodySourceCode() const { std::string refIndexStr; - Globals::Instance->GetSegmentedPtrName(refIndex, parent, "u8", refIndexStr); + Globals::Instance->GetSegmentedPtrName(refIndex, parent, "u8", refIndexStr, parent->workerID); std::string transformDataStr; Globals::Instance->GetSegmentedPtrName(transformData, parent, "TransformData", - transformDataStr); + transformDataStr, parent->workerID); std::string copyValuesStr; - Globals::Instance->GetSegmentedPtrName(copyValues, parent, "s16", copyValuesStr); + Globals::Instance->GetSegmentedPtrName(copyValues, parent, "s16", copyValuesStr, + parent->workerID); return StringHelper::Sprintf("\n\t%s,\n\t%s,\n\t%s,\n\t%i, %i\n", refIndexStr.c_str(), transformDataStr.c_str(), copyValuesStr.c_str(), unk_0C, unk_10); @@ -510,8 +519,10 @@ std::string ZLegacyAnimation::GetBodySourceCode() const std::string frameDataName; std::string jointKeyName; - Globals::Instance->GetSegmentedPtrName(frameData, parent, "s16", frameDataName); - Globals::Instance->GetSegmentedPtrName(jointKey, parent, "JointKey", jointKeyName); + Globals::Instance->GetSegmentedPtrName(frameData, parent, "s16", frameDataName, + parent->workerID); + Globals::Instance->GetSegmentedPtrName(jointKey, parent, "JointKey", jointKeyName, + parent->workerID); body += StringHelper::Sprintf("\t%i, %i,\n", frameCount, limbCount); body += StringHelper::Sprintf("\t%s,\n", frameDataName.c_str()); diff --git a/ZAPDTR/ZAPD/ZArray.cpp b/ZAPDTR/ZAPD/ZArray.cpp index 341ade1cf..86d73e1e6 100644 --- a/ZAPDTR/ZAPD/ZArray.cpp +++ b/ZAPDTR/ZAPD/ZArray.cpp @@ -102,8 +102,7 @@ std::string ZArray::GetBodySourceCode() const const auto& res = resList[i]; output += "\t"; - if (res->GetResourceType() == ZResourceType::Scalar || - res->GetResourceType() == ZResourceType::Vertex) + if (res->GetResourceType() == ZResourceType::Scalar || res->GetResourceType() == ZResourceType::Vertex) output += resList.at(i)->GetBodySourceCode(); else output += StringHelper::Sprintf("{ %s }", resList.at(i)->GetBodySourceCode().c_str()); diff --git a/ZAPDTR/ZAPD/ZBackground.cpp b/ZAPDTR/ZAPD/ZBackground.cpp index 0ed1eb747..94efe06e9 100644 --- a/ZAPDTR/ZAPD/ZBackground.cpp +++ b/ZAPDTR/ZAPD/ZBackground.cpp @@ -150,8 +150,11 @@ std::string ZBackground::GetExternalExtension() const void ZBackground::Save(const fs::path& outFolder) { - fs::path filepath = outFolder / (outName + "." + GetExternalExtension()); - File::WriteAllBytes(filepath.string(), data); + if (!Globals::Instance->otrMode) + { + fs::path filepath = outFolder / (outName + "." + GetExternalExtension()); + File::WriteAllBytes(filepath.string(), data); + } } std::string ZBackground::GetBodySourceCode() const diff --git a/ZAPDTR/ZAPD/ZCollision.cpp b/ZAPDTR/ZAPD/ZCollision.cpp index 11efd47e8..2a282cf2f 100644 --- a/ZAPDTR/ZAPD/ZCollision.cpp +++ b/ZAPDTR/ZAPD/ZCollision.cpp @@ -97,12 +97,15 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix) if (waterBoxes.size() > 0) { - for (size_t i = 0; i < waterBoxes.size(); i++) + if (!Globals::Instance->otrMode) { - declaration += - StringHelper::Sprintf("\t{ %s },", waterBoxes[i].GetBodySourceCode().c_str()); - if (i + 1 < waterBoxes.size()) - declaration += "\n"; + for (size_t i = 0; i < waterBoxes.size(); i++) + { + declaration += + StringHelper::Sprintf("\t{ %s },", waterBoxes[i].GetBodySourceCode().c_str()); + if (i + 1 < waterBoxes.size()) + declaration += "\n"; + } } parent->AddDeclarationArray( @@ -115,14 +118,17 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix) { declaration.clear(); - for (size_t i = 0; i < polygons.size(); i++) + if (!Globals::Instance->otrMode) { - declaration += StringHelper::Sprintf( - "\t{ 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X },", - polygons[i].type, polygons[i].vtxA, polygons[i].vtxB, polygons[i].vtxC, - polygons[i].a, polygons[i].b, polygons[i].c, polygons[i].d); - if (i + 1 < polygons.size()) - declaration += "\n"; + for (size_t i = 0; i < polygons.size(); i++) + { + declaration += StringHelper::Sprintf( + "\t{ 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X, 0x%04X },", + polygons[i].type, polygons[i].vtxA, polygons[i].vtxB, polygons[i].vtxC, + polygons[i].a, polygons[i].b, polygons[i].c, polygons[i].d); + if (i + 1 < polygons.size()) + declaration += "\n"; + } } parent->AddDeclarationArray( @@ -132,13 +138,16 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix) } declaration.clear(); - for (size_t i = 0; i < polygonTypes.size(); i++) + if (!Globals::Instance->otrMode) { - declaration += StringHelper::Sprintf("\t{ 0x%08lX, 0x%08lX },", polygonTypes[i] >> 32, - polygonTypes[i] & 0xFFFFFFFF); + for (size_t i = 0; i < polygonTypes.size(); i++) + { + declaration += StringHelper::Sprintf("\t{ 0x%08lX, 0x%08lX },", polygonTypes[i] >> 32, + polygonTypes[i] & 0xFFFFFFFF); - if (i < polygonTypes.size() - 1) - declaration += "\n"; + if (i < polygonTypes.size() - 1) + declaration += "\n"; + } } if (polyTypeDefAddress != 0) @@ -154,13 +163,16 @@ void ZCollisionHeader::DeclareReferences(const std::string& prefix) { declaration.clear(); - for (size_t i = 0; i < vertices.size(); i++) + if (!Globals::Instance->otrMode) { - declaration += - StringHelper::Sprintf("\t{ %s },", vertices[i].GetBodySourceCode().c_str()); + for (size_t i = 0; i < vertices.size(); i++) + { + declaration += + StringHelper::Sprintf("\t{ %s },", vertices[i].GetBodySourceCode().c_str()); - if (i < vertices.size() - 1) - declaration += "\n"; + if (i < vertices.size() - 1) + declaration += "\n"; + } } const auto& first = vertices.front(); @@ -177,29 +189,36 @@ std::string ZCollisionHeader::GetBodySourceCode() const { std::string declaration = ""; + if (Globals::Instance->otrMode) + return declaration; + declaration += "\n"; declaration += StringHelper::Sprintf("\t{ %i, %i, %i },\n", absMinX, absMinY, absMinZ); declaration += StringHelper::Sprintf("\t{ %i, %i, %i },\n", absMaxX, absMaxY, absMaxZ); std::string vtxName; - Globals::Instance->GetSegmentedPtrName(vtxAddress, parent, "Vec3s", vtxName); + Globals::Instance->GetSegmentedPtrName(vtxAddress, parent, "Vec3s", vtxName, parent->workerID); declaration += StringHelper::Sprintf("\t%i,\n\t%s,\n", numVerts, vtxName.c_str()); std::string polyName; - Globals::Instance->GetSegmentedPtrName(polyAddress, parent, "CollisionPoly", polyName); + Globals::Instance->GetSegmentedPtrName(polyAddress, parent, "CollisionPoly", polyName, + parent->workerID); declaration += StringHelper::Sprintf("\t%i,\n\t%s,\n", numPolygons, polyName.c_str()); std::string surfaceName; - Globals::Instance->GetSegmentedPtrName(polyTypeDefAddress, parent, "SurfaceType", surfaceName); + Globals::Instance->GetSegmentedPtrName(polyTypeDefAddress, parent, "SurfaceType", surfaceName, + parent->workerID); declaration += StringHelper::Sprintf("\t%s,\n", surfaceName.c_str()); std::string camName; - Globals::Instance->GetSegmentedPtrName(camDataAddress, parent, "CamData", camName); + Globals::Instance->GetSegmentedPtrName(camDataAddress, parent, "CamData", camName, + parent->workerID); declaration += StringHelper::Sprintf("\t%s,\n", camName.c_str()); std::string waterBoxName; - Globals::Instance->GetSegmentedPtrName(waterBoxAddress, parent, "WaterBox", waterBoxName); + Globals::Instance->GetSegmentedPtrName(waterBoxAddress, parent, "WaterBox", waterBoxName, + parent->workerID); declaration += StringHelper::Sprintf("\t%i,\n\t%s\n", numWaterBoxes, waterBoxName.c_str()); return declaration; diff --git a/ZAPDTR/ZAPD/ZDisplayList.cpp b/ZAPDTR/ZAPD/ZDisplayList.cpp index 4c7dd7c17..406245b33 100644 --- a/ZAPDTR/ZAPD/ZDisplayList.cpp +++ b/ZAPDTR/ZAPD/ZDisplayList.cpp @@ -15,6 +15,124 @@ #include "WarningHandler.h" #include "gfxd.h" + +#define G_MDSFT_ALPHACOMPARE 0 +#define G_MDSFT_ZSRCSEL 2 +#define G_MDSFT_RENDERMODE 3 +#define G_MDSFT_BLENDER 16 + +#define G_RM_FOG_SHADE_A 0xC8000000 +#define G_RM_FOG_PRIM_A 0xC4000000 +#define G_RM_PASS 0x0C080000 +#define G_RM_AA_ZB_OPA_SURF 0x442078 +#define G_RM_AA_ZB_OPA_SURF2 0x112078 +#define G_RM_AA_ZB_XLU_SURF 0x4049D8 +#define G_RM_AA_ZB_XLU_SURF2 0x1049D8 +#define G_RM_AA_ZB_OPA_DECAL 0x442D58 +#define G_RM_AA_ZB_OPA_DECAL2 0x112D58 +#define G_RM_AA_ZB_XLU_DECAL 0x404DD8 +#define G_RM_AA_ZB_XLU_DECAL2 0x104DD8 +#define G_RM_AA_ZB_OPA_INTER 0x442478 +#define G_RM_AA_ZB_OPA_INTER2 0x112478 +#define G_RM_AA_ZB_XLU_INTER 0x4045D8 +#define G_RM_AA_ZB_XLU_INTER2 0x1045D8 +#define G_RM_AA_ZB_XLU_LINE 0x407858 +#define G_RM_AA_ZB_XLU_LINE2 0x107858 +#define G_RM_AA_ZB_DEC_LINE 0x407F58 +#define G_RM_AA_ZB_DEC_LINE2 0x107F58 +#define G_RM_AA_ZB_TEX_EDGE 0x443078 +#define G_RM_AA_ZB_TEX_EDGE2 0x113078 +#define G_RM_AA_ZB_TEX_INTER 0x443478 +#define G_RM_AA_ZB_TEX_INTER2 0x113478 +#define G_RM_AA_ZB_SUB_SURF 0x442878 +#define G_RM_AA_ZB_SUB_SURF2 0x112278 +#define G_RM_AA_ZB_PCL_SURF 0x40007B +#define G_RM_AA_ZB_PCL_SURF2 0x10007B +#define G_RM_AA_ZB_OPA_TERR 0x402078 +#define G_RM_AA_ZB_OPA_TERR2 0x102078 +#define G_RM_AA_ZB_TEX_TERR 0x403078 +#define G_RM_AA_ZB_TEX_TERR2 0x103078 +#define G_RM_AA_ZB_SUB_TERR 0x402278 +#define G_RM_AA_ZB_SUB_TERR2 0x102278 +#define G_RM_RA_ZB_OPA_SURF 0x442038 +#define G_RM_RA_ZB_OPA_SURF2 0x112038 +#define G_RM_RA_ZB_OPA_DECAL 0x442D18 +#define G_RM_RA_ZB_OPA_DECAL2 0x112D18 +#define G_RM_RA_ZB_OPA_INTER 0x442438 +#define G_RM_RA_ZB_OPA_INTER2 0x112438 +#define G_RM_AA_OPA_SURF 0x442048 +#define G_RM_AA_OPA_SURF2 0x112048 +#define G_RM_AA_XLU_SURF 0x4041C8 +#define G_RM_AA_XLU_SURF2 0x1041C8 +#define G_RM_AA_XLU_LINE 0x407048 +#define G_RM_AA_XLU_LINE2 0x107048 +#define G_RM_AA_DEC_LINE 0x407248 +#define G_RM_AA_DEC_LINE2 0x107248 +#define G_RM_AA_TEX_EDGE 0x443048 +#define G_RM_AA_TEX_EDGE2 0x113048 +#define G_RM_AA_SUB_SURF 0x442248 +#define G_RM_AA_SUB_SURF2 0x112248 +#define G_RM_AA_PCL_SURF 0x40004B +#define G_RM_AA_PCL_SURF2 0x10004B +#define G_RM_AA_OPA_TERR 0x402048 +#define G_RM_AA_OPA_TERR2 0x102048 +#define G_RM_AA_TEX_TERR 0x403048 +#define G_RM_AA_TEX_TERR2 0x103048 +#define G_RM_AA_SUB_TERR 0x402248 +#define G_RM_AA_SUB_TERR2 0x102248 +#define G_RM_RA_OPA_SURF 0x442008 +#define G_RM_RA_OPA_SURF2 0x112008 +#define G_RM_ZB_OPA_SURF 0x442230 +#define G_RM_ZB_OPA_SURF2 0x112230 +#define G_RM_ZB_XLU_SURF 0x404A50 +#define G_RM_ZB_XLU_SURF2 0x104A50 +#define G_RM_ZB_OPA_DECAL 0x442E10 +#define G_RM_ZB_OPA_DECAL2 0x112E10 +#define G_RM_ZB_XLU_DECAL 0x404E50 +#define G_RM_ZB_XLU_DECAL2 0x104E50 +#define G_RM_ZB_CLD_SURF 0x404B50 +#define G_RM_ZB_CLD_SURF2 0x104B50 +#define G_RM_ZB_OVL_SURF 0x404F50 +#define G_RM_ZB_OVL_SURF2 0x104F50 +#define G_RM_ZB_PCL_SURF 0x0C080233 +#define G_RM_ZB_PCL_SURF2 0x03020233 +#define G_RM_OPA_SURF 0x0C084000 +#define G_RM_OPA_SURF2 0x03024000 +#define G_RM_XLU_SURF 0x00404200 +#define G_RM_XLU_SURF2 0x00104240 +#define G_RM_CLD_SURF 0x00404340 +#define G_RM_CLD_SURF2 0x00104340 +#define G_RM_TEX_EDGE 0x0C087008 +#define G_RM_TEX_EDGE2 0x03027008 +#define G_RM_PCL_SURF 0x0C084203 +#define G_RM_PCL_SURF2 0x03024203 +#define G_RM_ADD 0x04484340 +#define G_RM_ADD2 0x01124340 +#define G_RM_NOOP 0x00000000 +#define G_RM_NOOP2 0x00000000 +#define G_RM_VISCVG 0x0C844040 +#define G_RM_VISCVG2 0x03214040 +#define G_RM_OPA_CI 0x0C080000 +#define G_RM_OPA_CI2 0x03020000 + +#define AA_EN 0x8 +#define Z_CMP 0x10 +#define Z_UPD 0x20 +#define IM_RD 0x40 +#define CLR_ON_CVG 0x80 +#define CVG_DST_CLAMP 0 +#define CVG_DST_WRAP 0x100 +#define CVG_DST_FULL 0x200 +#define CVG_DST_SAVE 0x300 +#define ZMODE_OPA 0 +#define ZMODE_INTER 0x400 +#define ZMODE_XLU 0x800 +#define ZMODE_DEC 0xc00 +#define CVG_X_ALPHA 0x1000 +#define ALPHA_CVG_SEL 0x2000 +#define FORCE_BL 0x4000 +#define TEX_EDGE 0x0000 + REGISTER_ZFILENODE(DList, ZDisplayList); ZDisplayList::ZDisplayList(ZFile* nParent) : ZResource(nParent) @@ -553,7 +671,8 @@ int32_t ZDisplayList::OptimizationCheck_LoadTextureBlock(int32_t startIndex, std lastTexSeg = segmentNumber; - Globals::Instance->GetSegmentedPtrName(data & 0xFFFFFFFF, parent, "", texStr); + Globals::Instance->GetSegmentedPtrName(data & 0xFFFFFFFF, parent, "", texStr, + parent->workerID); } // gsDPSetTile @@ -705,7 +824,7 @@ void ZDisplayList::Opcode_G_DL(uint64_t data, const std::string& prefix, char* l if (pp != 0) { - if (!Globals::Instance->HasSegment(segNum)) + if (!Globals::Instance->HasSegment(segNum, parent->workerID)) sprintf(line, "gsSPBranchList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); else if (dListDecl != nullptr) sprintf(line, "gsSPBranchList(%s),", dListDecl->varName.c_str()); @@ -715,7 +834,7 @@ void ZDisplayList::Opcode_G_DL(uint64_t data, const std::string& prefix, char* l } else { - if (!Globals::Instance->HasSegment(segNum)) + if (!Globals::Instance->HasSegment(segNum, parent->workerID)) sprintf(line, "gsSPDisplayList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); else if (dListDecl != nullptr) sprintf(line, "gsSPDisplayList(%s),", dListDecl->varName.c_str()); @@ -726,7 +845,7 @@ void ZDisplayList::Opcode_G_DL(uint64_t data, const std::string& prefix, char* l // if (segNum == 8 || segNum == 9 || segNum == 10 || segNum == 11 || segNum == 12 || segNum == // 13) // Used for runtime-generated display lists - if (!Globals::Instance->HasSegment(segNum)) + if (!Globals::Instance->HasSegment(segNum, parent->workerID)) { if (pp != 0) sprintf(line, "gsSPBranchList(0x%08" PRIX64 "),", data & 0xFFFFFFFF); @@ -847,7 +966,7 @@ void ZDisplayList::Opcode_G_VTX(uint64_t data, char* line) } // Hack: Don't extract vertices from a unknown segment. - if (!Globals::Instance->HasSegment(GETSEGNUM(data))) + if (!Globals::Instance->HasSegment(GETSEGNUM(data), parent->workerID)) { segptr_t segmented = data & 0xFFFFFFFF; references.push_back(segmented); @@ -951,7 +1070,7 @@ void ZDisplayList::Opcode_G_SETTIMG(uint64_t data, const std::string& prefix, ch if (parent != nullptr) { - if (Globals::Instance->HasSegment(segmentNumber)) + if (Globals::Instance->HasSegment(segmentNumber, parent->workerID)) texDecl = parent->GetDeclaration(texAddress); else texDecl = parent->GetDeclaration(data); @@ -959,7 +1078,7 @@ void ZDisplayList::Opcode_G_SETTIMG(uint64_t data, const std::string& prefix, ch if (texDecl != nullptr) sprintf(texStr, "%s", texDecl->varName.c_str()); - else if (data != 0 && Globals::Instance->HasSegment(segmentNumber)) + else if (data != 0 && Globals::Instance->HasSegment(segmentNumber, parent->workerID)) sprintf(texStr, "%sTex_%06X", prefix.c_str(), texAddress); else { @@ -972,7 +1091,7 @@ void ZDisplayList::Opcode_G_SETTIMG(uint64_t data, const std::string& prefix, ch else { std::string texName; - Globals::Instance->GetSegmentedPtrName(data, parent, "", texName); + Globals::Instance->GetSegmentedPtrName(data, parent, "", texName, parent->workerID); sprintf(line, "gsDPSetTextureImage(%s, %s, %i, %s),", fmtTbl[fmt], sizTbl[siz], www + 1, texName.c_str()); } @@ -1647,7 +1766,9 @@ static int32_t GfxdCallback_Vtx(uint32_t seg, int32_t count) } self->references.push_back(seg); - gfxd_puts("@r"); + + if (!Globals::Instance->otrMode) + gfxd_puts("@r"); return 1; } @@ -1670,7 +1791,7 @@ static int32_t GfxdCallback_Texture(segptr_t seg, int32_t fmt, int32_t siz, int3 self->TextureGenCheck(); std::string texName; - Globals::Instance->GetSegmentedPtrName(seg, self->parent, "", texName); + Globals::Instance->GetSegmentedPtrName(seg, self->parent, "", texName, self->parent->workerID); gfxd_puts(texName.c_str()); @@ -1694,7 +1815,7 @@ static int32_t GfxdCallback_Palette(uint32_t seg, [[maybe_unused]] int32_t idx, self->TextureGenCheck(); std::string palName; - Globals::Instance->GetSegmentedPtrName(seg, self->parent, "", palName); + Globals::Instance->GetSegmentedPtrName(seg, self->parent, "", palName, self->parent->workerID); gfxd_puts(palName.c_str()); @@ -1708,7 +1829,8 @@ static int32_t GfxdCallback_DisplayList(uint32_t seg) uint32_t dListSegNum = GETSEGNUM(seg); std::string dListName = ""; - bool addressFound = Globals::Instance->GetSegmentedPtrName(seg, self->parent, "Gfx", dListName); + bool addressFound = Globals::Instance->GetSegmentedPtrName(seg, self->parent, "Gfx", dListName, + self->parent->workerID); if (!addressFound && self->parent->segment == dListSegNum) { @@ -1731,7 +1853,8 @@ static int32_t GfxdCallback_Matrix(uint32_t seg) std::string mtxName; ZDisplayList* self = static_cast(gfxd_udata_get()); - bool addressFound = Globals::Instance->GetSegmentedPtrName(seg, self->parent, "Mtx", mtxName); + bool addressFound = Globals::Instance->GetSegmentedPtrName(seg, self->parent, "Mtx", mtxName, + self->parent->workerID); if (!addressFound && GETSEGNUM(seg) == self->parent->segment) { Declaration* decl = @@ -1805,6 +1928,23 @@ void ZDisplayList::DeclareReferences(const std::string& prefix) curAddr, firstVtx.GetDeclarationAlignment(), item.second.size() * firstVtx.GetRawDataSize(), firstVtx.GetSourceTypeName(), firstVtx.GetDefaultName(name), item.second.size(), declaration); + + /*for (auto vtx : item.second) + { + ZVtx* nVtx = new ZVtx(vtx.parent); + nVtx->x = vtx.x; + nVtx->y = vtx.y; + nVtx->z = vtx.z; + nVtx->flag = vtx.flag; + nVtx->s = vtx.s; + nVtx->t = vtx.t; + nVtx->r = vtx.r; + nVtx->g = vtx.g; + nVtx->b = vtx.b; + nVtx->a = vtx.a; + decl->vertexHack.push_back(nVtx); + }*/ + decl->isExternal = true; } } @@ -1850,15 +1990,15 @@ void ZDisplayList::DeclareReferences(const std::string& prefix) { auto& item = vertices[vtxKeys[i]]; - std::string declaration; + //std::string declaration; - for (auto& vtx : item) - declaration += StringHelper::Sprintf("\t%s,\n", vtx.GetBodySourceCode().c_str()); + //for (auto& vtx : item) + //declaration += StringHelper::Sprintf("\t%s,\n", vtx.GetBodySourceCode().c_str()); // Ensure there's always a trailing line feed to prevent dumb warnings. // Please don't remove this line, unless you somehow made a way to prevent // that warning when building the OoT repo. - declaration += "\n"; + //declaration += "\n"; if (parent != nullptr) { @@ -1870,12 +2010,6 @@ void ZDisplayList::DeclareReferences(const std::string& prefix) else vtxName = StringHelper::Sprintf("%sVtx_%06X", prefix.c_str(), vtxKeys[i]); - - if (StringHelper::Contains(vtxName, "4B18")) - { - int bp = 0; - } - auto filepath = Globals::Instance->outputPath / vtxName; std::string incStr = StringHelper::Sprintf("%s.%s.inc", filepath.string().c_str(), "vtx"); @@ -1991,7 +2125,7 @@ bool ZDisplayList::TextureGenCheck(int32_t texWidth, int32_t texHeight, uint32_t texWidth, texHeight, texIsPalette, texAddr); if ((texSeg != 0 || texAddr != 0) && texWidth > 0 && texHeight > 0 && texLoaded && - Globals::Instance->HasSegment(segmentNumber)) + Globals::Instance->HasSegment(segmentNumber, self->parent->workerID)) { ZFile* auxParent = nullptr; if (segmentNumber == self->parent->segment) @@ -2002,7 +2136,8 @@ bool ZDisplayList::TextureGenCheck(int32_t texWidth, int32_t texHeight, uint32_t { // Try to find a non-external file (i.e., one we are actually extracting) // which has the same segment number we are looking for. - for (auto& otherFile : Globals::Instance->cfg.segmentRefFiles[segmentNumber]) + auto segs = Globals::Instance->GetSegmentRefFiles(self->parent->workerID); + for (auto& otherFile : segs[segmentNumber]) { if (!otherFile->isExternalFile) { diff --git a/ZAPDTR/ZAPD/ZDisplayList.h b/ZAPDTR/ZAPD/ZDisplayList.h index 96808315d..f3828cc79 100644 --- a/ZAPDTR/ZAPD/ZDisplayList.h +++ b/ZAPDTR/ZAPD/ZDisplayList.h @@ -166,122 +166,6 @@ enum class OoTSegments FrameBuffer = 16, }; -#define G_MDSFT_ALPHACOMPARE 0 -#define G_MDSFT_ZSRCSEL 2 -#define G_MDSFT_RENDERMODE 3 -#define G_MDSFT_BLENDER 16 - -#define G_RM_FOG_SHADE_A 0xC8000000 -#define G_RM_FOG_PRIM_A 0xC4000000 -#define G_RM_PASS 0x0C080000 -#define G_RM_AA_ZB_OPA_SURF 0x442078 -#define G_RM_AA_ZB_OPA_SURF2 0x112078 -#define G_RM_AA_ZB_XLU_SURF 0x4049D8 -#define G_RM_AA_ZB_XLU_SURF2 0x1049D8 -#define G_RM_AA_ZB_OPA_DECAL 0x442D58 -#define G_RM_AA_ZB_OPA_DECAL2 0x112D58 -#define G_RM_AA_ZB_XLU_DECAL 0x404DD8 -#define G_RM_AA_ZB_XLU_DECAL2 0x104DD8 -#define G_RM_AA_ZB_OPA_INTER 0x442478 -#define G_RM_AA_ZB_OPA_INTER2 0x112478 -#define G_RM_AA_ZB_XLU_INTER 0x4045D8 -#define G_RM_AA_ZB_XLU_INTER2 0x1045D8 -#define G_RM_AA_ZB_XLU_LINE 0x407858 -#define G_RM_AA_ZB_XLU_LINE2 0x107858 -#define G_RM_AA_ZB_DEC_LINE 0x407F58 -#define G_RM_AA_ZB_DEC_LINE2 0x107F58 -#define G_RM_AA_ZB_TEX_EDGE 0x443078 -#define G_RM_AA_ZB_TEX_EDGE2 0x113078 -#define G_RM_AA_ZB_TEX_INTER 0x443478 -#define G_RM_AA_ZB_TEX_INTER2 0x113478 -#define G_RM_AA_ZB_SUB_SURF 0x442878 -#define G_RM_AA_ZB_SUB_SURF2 0x112278 -#define G_RM_AA_ZB_PCL_SURF 0x40007B -#define G_RM_AA_ZB_PCL_SURF2 0x10007B -#define G_RM_AA_ZB_OPA_TERR 0x402078 -#define G_RM_AA_ZB_OPA_TERR2 0x102078 -#define G_RM_AA_ZB_TEX_TERR 0x403078 -#define G_RM_AA_ZB_TEX_TERR2 0x103078 -#define G_RM_AA_ZB_SUB_TERR 0x402278 -#define G_RM_AA_ZB_SUB_TERR2 0x102278 -#define G_RM_RA_ZB_OPA_SURF 0x442038 -#define G_RM_RA_ZB_OPA_SURF2 0x112038 -#define G_RM_RA_ZB_OPA_DECAL 0x442D18 -#define G_RM_RA_ZB_OPA_DECAL2 0x112D18 -#define G_RM_RA_ZB_OPA_INTER 0x442438 -#define G_RM_RA_ZB_OPA_INTER2 0x112438 -#define G_RM_AA_OPA_SURF 0x442048 -#define G_RM_AA_OPA_SURF2 0x112048 -#define G_RM_AA_XLU_SURF 0x4041C8 -#define G_RM_AA_XLU_SURF2 0x1041C8 -#define G_RM_AA_XLU_LINE 0x407048 -#define G_RM_AA_XLU_LINE2 0x107048 -#define G_RM_AA_DEC_LINE 0x407248 -#define G_RM_AA_DEC_LINE2 0x107248 -#define G_RM_AA_TEX_EDGE 0x443048 -#define G_RM_AA_TEX_EDGE2 0x113048 -#define G_RM_AA_SUB_SURF 0x442248 -#define G_RM_AA_SUB_SURF2 0x112248 -#define G_RM_AA_PCL_SURF 0x40004B -#define G_RM_AA_PCL_SURF2 0x10004B -#define G_RM_AA_OPA_TERR 0x402048 -#define G_RM_AA_OPA_TERR2 0x102048 -#define G_RM_AA_TEX_TERR 0x403048 -#define G_RM_AA_TEX_TERR2 0x103048 -#define G_RM_AA_SUB_TERR 0x402248 -#define G_RM_AA_SUB_TERR2 0x102248 -#define G_RM_RA_OPA_SURF 0x442008 -#define G_RM_RA_OPA_SURF2 0x112008 -#define G_RM_ZB_OPA_SURF 0x442230 -#define G_RM_ZB_OPA_SURF2 0x112230 -#define G_RM_ZB_XLU_SURF 0x404A50 -#define G_RM_ZB_XLU_SURF2 0x104A50 -#define G_RM_ZB_OPA_DECAL 0x442E10 -#define G_RM_ZB_OPA_DECAL2 0x112E10 -#define G_RM_ZB_XLU_DECAL 0x404E50 -#define G_RM_ZB_XLU_DECAL2 0x104E50 -#define G_RM_ZB_CLD_SURF 0x404B50 -#define G_RM_ZB_CLD_SURF2 0x104B50 -#define G_RM_ZB_OVL_SURF 0x404F50 -#define G_RM_ZB_OVL_SURF2 0x104F50 -#define G_RM_ZB_PCL_SURF 0x0C080233 -#define G_RM_ZB_PCL_SURF2 0x03020233 -#define G_RM_OPA_SURF 0x0C084000 -#define G_RM_OPA_SURF2 0x03024000 -#define G_RM_XLU_SURF 0x00404200 -#define G_RM_XLU_SURF2 0x00104240 -#define G_RM_CLD_SURF 0x00404340 -#define G_RM_CLD_SURF2 0x00104340 -#define G_RM_TEX_EDGE 0x0C087008 -#define G_RM_TEX_EDGE2 0x03027008 -#define G_RM_PCL_SURF 0x0C084203 -#define G_RM_PCL_SURF2 0x03024203 -#define G_RM_ADD 0x04484340 -#define G_RM_ADD2 0x01124340 -#define G_RM_NOOP 0x00000000 -#define G_RM_NOOP2 0x00000000 -#define G_RM_VISCVG 0x0C844040 -#define G_RM_VISCVG2 0x03214040 -#define G_RM_OPA_CI 0x0C080000 -#define G_RM_OPA_CI2 0x03020000 - -#define AA_EN 0x8 -#define Z_CMP 0x10 -#define Z_UPD 0x20 -#define IM_RD 0x40 -#define CLR_ON_CVG 0x80 -#define CVG_DST_CLAMP 0 -#define CVG_DST_WRAP 0x100 -#define CVG_DST_FULL 0x200 -#define CVG_DST_SAVE 0x300 -#define ZMODE_OPA 0 -#define ZMODE_INTER 0x400 -#define ZMODE_XLU 0x800 -#define ZMODE_DEC 0xc00 -#define CVG_X_ALPHA 0x1000 -#define ALPHA_CVG_SEL 0x2000 -#define FORCE_BL 0x4000 -#define TEX_EDGE 0x0000 class ZDisplayList : public ZResource { diff --git a/ZAPDTR/ZAPD/ZFile.cpp b/ZAPDTR/ZAPD/ZFile.cpp index 13ab961f8..9ff7a6823 100644 --- a/ZAPDTR/ZAPD/ZFile.cpp +++ b/ZAPDTR/ZAPD/ZFile.cpp @@ -41,6 +41,7 @@ ZFile::ZFile() baseAddress = 0; rangeStart = 0x000000000; rangeEnd = 0xFFFFFFFF; + workerID = 0; } ZFile::ZFile(const fs::path& nOutPath, const std::string& nName) : ZFile() @@ -51,7 +52,7 @@ ZFile::ZFile(const fs::path& nOutPath, const std::string& nName) : ZFile() } ZFile::ZFile(ZFileMode nMode, tinyxml2::XMLElement* reader, const fs::path& nBasePath, - const fs::path& nOutPath, const std::string& filename, const fs::path& nXmlFilePath) + const fs::path& nOutPath, const std::string& filename, const fs::path& nXmlFilePath, int nWorkerID) : ZFile() { xmlFilePath = nXmlFilePath; @@ -66,6 +67,7 @@ ZFile::ZFile(ZFileMode nMode, tinyxml2::XMLElement* reader, const fs::path& nBas outputPath = nOutPath; mode = nMode; + workerID = nWorkerID; ParseXML(reader, filename); if (mode != ZFileMode::ExternalFile) @@ -167,7 +169,7 @@ void ZFile::ParseXML(tinyxml2::XMLElement* reader, const std::string& filename) } } } - Globals::Instance->AddSegment(segment, this); + Globals::Instance->AddSegment(segment, this, workerID); if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) { @@ -181,16 +183,22 @@ void ZFile::ParseXML(tinyxml2::XMLElement* reader, const std::string& filename) } } - if (mode == ZFileMode::Extract || mode == ZFileMode::ExternalFile) + if (mode == ZFileMode::Extract || mode == ZFileMode::ExternalFile || mode == ZFileMode::ExtractDirectory) { - if (!File::Exists((basePath / name).string())) + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) { - std::string errorHeader = StringHelper::Sprintf("binary file '%s' does not exist.", - (basePath / name).c_str()); - HANDLE_ERROR_PROCESS(WarningType::Always, errorHeader, ""); + if (!File::Exists((basePath / name).string())) + { + std::string errorHeader = StringHelper::Sprintf("binary file '%s' does not exist.", + (basePath / name).c_str()); + HANDLE_ERROR_PROCESS(WarningType::Always, errorHeader, ""); + } } - rawData = File::ReadAllBytes((basePath / name).string()); + if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory) + rawData = Globals::Instance->GetBaseromFile(name); + else + rawData = Globals::Instance->GetBaseromFile((basePath / name).string()); if (reader->Attribute("RangeEnd") == nullptr) rangeEnd = rawData.size(); @@ -260,7 +268,7 @@ void ZFile::ParseXML(tinyxml2::XMLElement* reader, const std::string& filename) { ZResource* nRes = nodeMap[nodeName](this); - if (mode == ZFileMode::Extract || mode == ZFileMode::ExternalFile) + if (mode == ZFileMode::Extract || mode == ZFileMode::ExternalFile || mode == ZFileMode::ExtractDirectory) nRes->ExtractFromXML(child, rawDataIndex); switch (nRes->GetResourceType()) @@ -813,7 +821,34 @@ void ZFile::GenerateSourceHeaderFiles() if (Globals::Instance->verbosity >= VerbosityLevel::VERBOSITY_INFO) printf("Writing H file: %s\n", headerFilename.c_str()); - File::WriteAllText(headerFilename, formatter.GetOutput()); + if (Globals::Instance->fileMode != ZFileMode::ExtractDirectory) + File::WriteAllText(headerFilename, formatter.GetOutput()); + else if (Globals::Instance->sourceOutputPath != "") + { + std::string xmlPath = xmlFilePath.string(); + xmlPath = StringHelper::Replace(xmlPath, "\\", "/"); + auto pathList = StringHelper::Split(xmlPath, "/"); + std::string outPath = ""; + + for (int i = 0; i < 3; i++) + outPath += pathList[i] + "/"; + + for (int i = 5; i < pathList.size(); i++) + { + if (i == pathList.size() - 1) + { + outPath += Path::GetFileNameWithoutExtension(pathList[i]) + "/"; + outPath += outName.string() + ".h"; + } + else + outPath += pathList[i]; + + if (i < pathList.size() - 1) + outPath += "/"; + } + + File::WriteAllText(outPath, formatter.GetOutput()); + } } std::string ZFile::GetHeaderInclude() const @@ -999,6 +1034,10 @@ std::string ZFile::ProcessDeclarations() lastItem.second->size += curItem.second->size; lastItem.second->arrayItemCnt += curItem.second->arrayItemCnt; lastItem.second->text += "\n" + curItem.second->text; + + for (auto vtx : curItem.second->vertexHack) + lastItem.second->vertexHack.push_back(vtx); + declarations.erase(curItem.first); declarationKeys.erase(declarationKeys.begin() + i); delete curItem.second; @@ -1087,7 +1126,7 @@ void ZFile::ProcessDeclarationText(Declaration* decl) { std::string vtxName; Globals::Instance->GetSegmentedArrayIndexedName(decl->references[refIndex], 0x10, this, - "Vtx", vtxName); + "Vtx", vtxName, workerID); decl->text.replace(i, 2, vtxName); refIndex++; @@ -1190,6 +1229,9 @@ void ZFile::HandleUnaccountedData() uint32_t lastSize = 0; std::vector declsAddresses; + if (Globals::Instance->otrMode) + return; + for (const auto& item : declarations) { declsAddresses.push_back(item.first); diff --git a/ZAPDTR/ZAPD/ZFile.h b/ZAPDTR/ZAPD/ZFile.h index ac4062d5b..7860aa4d3 100644 --- a/ZAPDTR/ZAPD/ZFile.h +++ b/ZAPDTR/ZAPD/ZFile.h @@ -16,6 +16,7 @@ enum class ZFileMode BuildBackground, Extract, ExternalFile, + ExtractDirectory, Invalid, Custom = 1000, // Used for exporter file modes }; @@ -34,6 +35,8 @@ public: std::string defines; std::vector resources; + int workerID; + // Default to using virtual addresses uint32_t segment = 0x80; uint32_t baseAddress, rangeStart, rangeEnd; @@ -41,7 +44,7 @@ public: ZFile(const fs::path& nOutPath, const std::string& nName); ZFile(ZFileMode nMode, tinyxml2::XMLElement* reader, const fs::path& nBasePath, - const fs::path& nOutPath, const std::string& filename, const fs::path& nXmlFilePath); + const fs::path& nOutPath, const std::string& filename, const fs::path& nXmlFilePath, int nWorkerID); ~ZFile(); std::string GetName() const; @@ -107,12 +110,12 @@ public: static void RegisterNode(std::string nodeName, ZResourceFactoryFunc* nodeFunc); protected: - std::vector rawData; std::string name; fs::path outName = ""; fs::path basePath; fs::path outputPath; fs::path xmlFilePath; + std::vector rawData; // Keep track of every texture of this ZFile. // The pointers declared here are "borrowed" (somebody else is the owner), diff --git a/ZAPDTR/ZAPD/ZLimb.cpp b/ZAPDTR/ZAPD/ZLimb.cpp index 330fbaf7c..9eb7eac8d 100644 --- a/ZAPDTR/ZAPD/ZLimb.cpp +++ b/ZAPDTR/ZAPD/ZLimb.cpp @@ -218,18 +218,25 @@ size_t ZLimb::GetRawDataSize() const std::string ZLimb::GetBodySourceCode() const { + if (Globals::Instance->otrMode) + return ""; + std::string dListStr; std::string dListStr2; - Globals::Instance->GetSegmentedArrayIndexedName(dListPtr, 8, parent, "Gfx", dListStr); - Globals::Instance->GetSegmentedArrayIndexedName(dList2Ptr, 8, parent, "Gfx", dListStr2); + Globals::Instance->GetSegmentedArrayIndexedName(dListPtr, 8, parent, "Gfx", dListStr, + parent->workerID); + Globals::Instance->GetSegmentedArrayIndexedName(dList2Ptr, 8, parent, "Gfx", dListStr2, + parent->workerID); std::string entryStr = "\n\t"; if (type == ZLimbType::Legacy) { std::string childName; std::string siblingName; - Globals::Instance->GetSegmentedPtrName(childPtr, parent, "LegacyLimb", childName); - Globals::Instance->GetSegmentedPtrName(siblingPtr, parent, "LegacyLimb", siblingName); + Globals::Instance->GetSegmentedPtrName(childPtr, parent, "LegacyLimb", childName, + parent->workerID); + Globals::Instance->GetSegmentedPtrName(siblingPtr, parent, "LegacyLimb", siblingName, + parent->workerID); entryStr += StringHelper::Sprintf("%s,\n", dListStr.c_str()); entryStr += @@ -261,7 +268,8 @@ std::string ZLimb::GetBodySourceCode() const case ZLimbType::Skin: { std::string skinSegmentStr; - Globals::Instance->GetSegmentedPtrName(skinSegment, parent, "", skinSegmentStr); + Globals::Instance->GetSegmentedPtrName(skinSegment, parent, "", skinSegmentStr, + parent->workerID); entryStr += StringHelper::Sprintf("\t0x%02X, %s\n", skinSegmentType, skinSegmentStr.c_str()); } @@ -367,7 +375,7 @@ void ZLimb::DeclareDList(segptr_t dListSegmentedPtr, const std::string& prefix, std::string dlistName; bool declFound = Globals::Instance->GetSegmentedArrayIndexedName(dListSegmentedPtr, 8, parent, - "Gfx", dlistName); + "Gfx", dlistName, parent->workerID); if (declFound) return; diff --git a/ZAPDTR/ZAPD/ZLimb.h b/ZAPDTR/ZAPD/ZLimb.h index 53a414329..5de5276e9 100644 --- a/ZAPDTR/ZAPD/ZLimb.h +++ b/ZAPDTR/ZAPD/ZLimb.h @@ -25,19 +25,19 @@ public: ZLimbSkinType skinSegmentType = ZLimbSkinType::SkinType_0; // Skin only segptr_t skinSegment = 0; // Skin only - Struct_800A5E28 segmentStruct; // Skin only + Struct_800A5E28 segmentStruct = {0}; // Skin only // Legacy only - float legTransX, legTransY, legTransZ; // Vec3f - uint16_t rotX, rotY, rotZ; // Vec3s - segptr_t childPtr; // LegacyLimb* - segptr_t siblingPtr; // LegacyLimb* + float legTransX = 0, legTransY = 0, legTransZ = 0; // Vec3f + uint16_t rotX = 0, rotY = 0, rotZ = 0; // Vec3s + segptr_t childPtr = 0; // LegacyLimb* + segptr_t siblingPtr = 0; // LegacyLimb* segptr_t dListPtr = 0; segptr_t dList2Ptr = 0; // LOD and Curve Only - int16_t transX, transY, transZ; - uint8_t childIndex, siblingIndex; + int16_t transX = 0, transY = 0, transZ = 0; + uint8_t childIndex = 0, siblingIndex = 0; ZLimb(ZFile* nParent); diff --git a/ZAPDTR/ZAPD/ZPath.cpp b/ZAPDTR/ZAPD/ZPath.cpp index e19513db3..660821ce8 100644 --- a/ZAPDTR/ZAPD/ZPath.cpp +++ b/ZAPDTR/ZAPD/ZPath.cpp @@ -142,8 +142,8 @@ void PathwayEntry::DeclareReferences(const std::string& prefix) return; std::string pointsName; - bool addressFound = - Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", pointsName); + bool addressFound = Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", + pointsName, parent->workerID); if (addressFound) return; @@ -177,7 +177,8 @@ std::string PathwayEntry::GetBodySourceCode() const { std::string declaration; std::string listName; - Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName); + Globals::Instance->GetSegmentedPtrName(listSegmentAddress, parent, "Vec3s", listName, + parent->workerID); if (Globals::Instance->game == ZGame::MM_RETAIL) declaration += diff --git a/ZAPDTR/ZAPD/ZPlayerAnimationData.cpp b/ZAPDTR/ZAPD/ZPlayerAnimationData.cpp index a96604fda..ab633c129 100644 --- a/ZAPDTR/ZAPD/ZPlayerAnimationData.cpp +++ b/ZAPDTR/ZAPD/ZPlayerAnimationData.cpp @@ -3,6 +3,7 @@ #include "Utils/BitConverter.h" #include "Utils/StringHelper.h" #include "ZFile.h" +#include REGISTER_ZFILENODE(PlayerAnimationData, ZPlayerAnimationData); @@ -54,6 +55,9 @@ std::string ZPlayerAnimationData::GetBodySourceCode() const { std::string declaration = ""; + if (Globals::Instance->otrMode) + return ""; + size_t index = 0; for (const auto& entry : limbRotData) { diff --git a/ZAPDTR/ZAPD/ZResource.cpp b/ZAPDTR/ZAPD/ZResource.cpp index a5ad4cf21..c6efef073 100644 --- a/ZAPDTR/ZAPD/ZResource.cpp +++ b/ZAPDTR/ZAPD/ZResource.cpp @@ -8,6 +8,7 @@ #include "ZFile.h" #include #include +#include ZResource::ZResource(ZFile* nParent) { @@ -18,6 +19,7 @@ ZResource::ZResource(ZFile* nParent) sourceOutput = ""; rawDataIndex = 0; outputDeclaration = true; + hash = 0; RegisterRequiredAttribute("Name"); RegisterOptionalAttribute("OutName"); @@ -119,14 +121,21 @@ void ZResource::ParseXML(tinyxml2::XMLElement* reader) name = registeredAttributes.at("Name").value; - static std::regex r("[a-zA-Z_]+[a-zA-Z0-9_]*", std::regex::icase | std::regex::optimize); - if (!isInner || (isInner && name != "")) + // Disable this check for OTR file generation for now since it takes up a considerable amount of CPU time + if (!Globals::Instance->otrMode) { - if (!std::regex_match(name, r)) + static std::regex r("[a-zA-Z_]+[a-zA-Z0-9_]*", + std::regex::icase | std::regex::optimize); + + if (!isInner || (isInner && name != "")) { - HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, - rawDataIndex, "invalid value found for 'Name' attribute", ""); + if (!std::regex_match(name, r)) + { + HANDLE_ERROR_RESOURCE(WarningType::InvalidAttributeValue, parent, this, + rawDataIndex, "invalid value found for 'Name' attribute", + ""); + } } } @@ -273,6 +282,21 @@ void ZResource::GetSourceOutputCode([[maybe_unused]] const std::string& prefix) else decl->text = bodyStr; + // OTRTODO: This is a hack and we need something more elegant in the future... + if (GetResourceType() == ZResourceType::Array) + { + ZArray* arr = (ZArray*)this; + if (arr->resList[0]->GetResourceType() == ZResourceType::Vertex) + { + for (int i = 0; i < arr->resList.size(); i++) + { + ZVtx* vtx = (ZVtx*)arr->resList[i]; + decl->vertexHack.push_back(vtx); + + } + } + } + if (decl != nullptr) decl->staticConf = staticConf; } diff --git a/ZAPDTR/ZAPD/ZRom.cpp b/ZAPDTR/ZAPD/ZRom.cpp new file mode 100644 index 000000000..2a1d3c8a1 --- /dev/null +++ b/ZAPDTR/ZAPD/ZRom.cpp @@ -0,0 +1,202 @@ +#include "ZRom.h" +#include "Utils/BitConverter.h" +#include "Utils/File.h" +#include "Utils/Directory.h" +#include "yaz0/yaz0.h" + +#ifndef _MSC_VER +#include +#endif +#include + +namespace fs = std::filesystem; + +#define DMA_ENTRY_SIZE 16 + +#if defined(_MSC_VER) +#define __bswap_32 _byteswap_ulong +#define bswap_32 _byteswap_ulong +#endif + +// ROM DMA Table Start +#define OOT_OFF_NTSC_10_RC 0x7430 +#define OOT_OFF_NTSC_10 0x7430 +#define OOT_OFF_NTSC_11 0x7430 +#define OOT_OFF_PAL_10 0x7950 +#define OOT_OFF_NTSC_12 0x7960 +#define OOT_OFF_PAL_11 0x7950 +#define OOT_OFF_JP_GC 0x7170 +#define OOT_OFF_JP_MQ 0x7170 +#define OOT_OFF_US_GC 0x7170 +#define OOT_OFF_US_MQ 0x7170 +#define OOT_OFF_PAL_GC_DBG1 0x12F70 +#define OOT_OFF_PAL_MQ_DBG 0x12F70 +#define OOT_OFF_PAL_GC_DBG2 0x12F70 +#define OOT_OFF_PAL_GC 0x7170 +#define OOT_OFF_PAL_MQ 0x7170 +#define OOT_OFF_JP_GC_CE 007170 +#define OOT_OFF_CN_IQUE 0xB7A0 +#define OOT_OFF_TW_IQUE 0xB240 + +#define MM_OFF_US_10 0x1A500 +#define MM_OFF_JP_10 0x1C110 +#define MM_OFF_JP_11 0x1C050 +#define MM_OFF_DBG 0x24F60 + +#define OOT_NTSC_10 0xEC7011B7 +#define OOT_NTSC_11 0xD43DA81F +#define OOT_NTSC_12 0x693BA2AE +#define OOT_PAL_10 0xB044B569 +#define OOT_PAL_11 0xB2055FBD +#define OOT_NTSC_JP_GC_CE 0xF7F52DB8 +#define OOT_NTSC_JP_GC 0xF611F4BA +#define OOT_NTSC_US_GC 0xF3DD35BA +#define OOT_PAL_GC 0x09465AC3 +#define OOT_NTSC_JP_MQ 0xF43B45BA +#define OOT_NTSC_US_MQ 0xF034001A +#define OOT_PAL_MQ 0x1D4136F3 +#define OOT_PAL_GC_DBG1 0x871E1C92 // 03-21-2002 build +#define OOT_PAL_GC_DBG2 0x87121EFE // 03-13-2002 build +#define OOT_PAL_GC_MQ_DBG 0x917D18F6 +#define OOT_IQUE_TW 0x3D81FB3E +#define OOT_IQUE_CN 0xB1E1E07B +#define OOT_UNKNOWN 0xFFFFFFFF + +ZRom::ZRom(std::string romPath) +{ + RomVersion version; + romData = File::ReadAllBytes(romPath); + + version.crc = BitConverter::ToInt32BE(romData, 0x10); + + switch (version.crc) + { + case OOT_NTSC_10: + version.version = "N64 NTSC 1.0"; + version.listPath = "ntsc_oot.txt"; + version.offset = OOT_OFF_NTSC_10; + break; + case OOT_NTSC_11: + version.version = "N64 NTSC 1.1"; + version.listPath = "ntsc_oot.txt"; + version.offset = OOT_OFF_NTSC_11; + break; + case OOT_NTSC_12: + version.version = "N64 NTSC 1.2"; + version.listPath = "ntsc_oot.txt"; + version.offset = OOT_OFF_NTSC_12; + break; + case OOT_PAL_10: + version.version = "N64 PAL 1.0"; + version.listPath = "pal_oot.txt"; + version.offset = OOT_OFF_PAL_10; + break; + case OOT_PAL_11: + version.version = "N64 PAL 1.1"; + version.listPath = "pal_oot.txt"; + version.offset = OOT_OFF_PAL_11; + break; + case OOT_NTSC_JP_GC: + version.version = "JP GameCube (MQ Disk)"; + version.listPath = "gamecube.txt"; + version.offset = OOT_OFF_JP_GC; + break; + case OOT_NTSC_JP_GC_CE: + version.version = "GameCube (Collectors Edition Disk)"; + version.listPath = "gamecube.txt"; + version.offset = OOT_OFF_JP_GC_CE; + break; + case OOT_NTSC_JP_MQ: + version.version = "JP Master Quest"; + version.listPath = "gamecube.txt"; + version.offset = OOT_OFF_JP_MQ; + break; + case OOT_NTSC_US_MQ: + version.version = "NTSC Master Quest"; + version.listPath = "gamecube.txt"; + version.offset = OOT_OFF_JP_MQ; + break; + case OOT_NTSC_US_GC: + version.version = "NTSC GameCube"; + version.listPath = "gamecube.txt"; + version.offset = OOT_OFF_US_MQ; + break; + case OOT_PAL_GC: + version.version = "PAL GameCube"; + version.listPath = "gamecube_pal.txt"; + version.offset = OOT_OFF_PAL_GC; + break; + case OOT_PAL_MQ: + version.version = "PAL Master Quest"; + version.listPath = "gamecube_pal.txt"; + version.offset = OOT_OFF_PAL_MQ; + break; + case OOT_PAL_GC_DBG1: + version.version = "GameCube Debug 1.0"; + version.listPath = "dbg.txt"; + version.offset = OOT_OFF_PAL_GC_DBG1; + break; + case OOT_PAL_GC_DBG2: + version.version = "GameCube Debug 2.0"; + version.listPath = "dbg.txt"; + version.offset = OOT_OFF_PAL_GC_DBG2; + break; + case OOT_PAL_GC_MQ_DBG: + version.version = "GameCube MQ-Debug"; + version.listPath = "dbg.txt"; + version.offset = OOT_OFF_PAL_MQ_DBG; + break; + case OOT_IQUE_CN: + version.version = "OoT IQue"; + version.listPath = "ique.txt"; + version.offset = OOT_OFF_CN_IQUE; + break; + case OOT_IQUE_TW: + version.version = "TW IQue"; + version.listPath = "ique.txt"; + version.offset = OOT_OFF_TW_IQUE; + break; + } + + auto path = StringHelper::Sprintf("%s/%s", Globals::Instance->fileListPath.string().c_str(), version.listPath.c_str()); + auto txt = File::ReadAllText(path); + std::vector lines = StringHelper::Split(txt, "\n"); + + std::vector decompressedData(1); + + for (int i = 0; i < lines.size(); i++) + { + lines[i] = StringHelper::Strip(lines[i], "\r"); + const int romOffset = version.offset + (DMA_ENTRY_SIZE * i); + + const int virtStart = BitConverter::ToInt32BE(romData, romOffset + 0); + const int virtEnd = BitConverter::ToInt32BE(romData, romOffset + 4); + const int physStart = BitConverter::ToInt32BE(romData, romOffset + 8); + const int physEnd = BitConverter::ToInt32BE(romData, romOffset + 12); + + const bool compressed = physEnd != 0; + int size = compressed ? physEnd - physStart : virtEnd - virtStart; + + auto outData = std::vector(); + outData.resize(size); + memcpy(outData.data(), romData.data() + physStart, size); + + if (compressed) + { + int decSize = virtEnd - virtStart; + decompressedData = std::vector(); + decompressedData.resize(decSize); + yaz0_decode(outData.data(), decompressedData.data(), decSize); + files[lines[i]] = decompressedData; + } + else + files[lines[i]] = outData; + } + + int bp = 0; +} + +std::vector ZRom::GetFile(std::string fileName) +{ + return files[fileName]; +} diff --git a/ZAPDTR/ZAPD/ZRom.h b/ZAPDTR/ZAPD/ZRom.h new file mode 100644 index 000000000..ae3cac156 --- /dev/null +++ b/ZAPDTR/ZAPD/ZRom.h @@ -0,0 +1,27 @@ +#pragma once + +#include +#include +#include +#include + +class ZRom +{ +public: + ZRom(std::string romPath); + + std::vector GetFile(std::string fileName); + +protected: + std::vector romData; + std::map> files; +}; + +struct RomVersion +{ + std::string version = "None"; + std::string error = "None"; + std::string listPath = "None"; + int offset; + uint32_t crc; +}; \ No newline at end of file diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetActorCutsceneList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetActorCutsceneList.cpp index 60391a9d1..4c9e8fb5f 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetActorCutsceneList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetActorCutsceneList.cpp @@ -54,7 +54,8 @@ void SetActorCutsceneList::DeclareReferences(const std::string& prefix) std::string SetActorCutsceneList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorCutscene", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorCutscene", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ACTOR_CUTSCENE_LIST(%i, %s)", cutscenes.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetActorList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetActorList.cpp index 919d86f57..1cda3c2c6 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetActorList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetActorList.cpp @@ -81,7 +81,8 @@ void SetActorList::DeclareReferencesLate(const std::string& prefix) std::string SetActorList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName, + parent->workerID); if (numActors != actors.size()) { printf("%s: numActors(%i) ~ actors(%li)\n", parent->GetName().c_str(), numActors, diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp index 629d4a0b0..a89c2b74d 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetAlternateHeaders.cpp @@ -48,7 +48,8 @@ void SetAlternateHeaders::DeclareReferencesLate(const std::string& prefix) for (size_t i = 0; i < headers.size(); i++) { std::string altHeaderName; - Globals::Instance->GetSegmentedPtrName(headers.at(i), parent, "", altHeaderName); + Globals::Instance->GetSegmentedPtrName(headers.at(i), parent, "", altHeaderName, + parent->workerID); declaration += StringHelper::Sprintf("\t%s,", altHeaderName.c_str()); @@ -66,7 +67,8 @@ void SetAlternateHeaders::DeclareReferencesLate(const std::string& prefix) std::string SetAlternateHeaders::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "SceneCmd*", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "SceneCmd*", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ALTERNATE_HEADER_LIST(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp index 0b9a67e0e..73f72136c 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetAnimatedMaterialList.cpp @@ -33,7 +33,8 @@ void SetAnimatedMaterialList::DeclareReferences(const std::string& prefix) std::string SetAnimatedMaterialList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "AnimatedMaterial", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "AnimatedMaterial", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ANIMATED_MATERIAL_LIST(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp index 03aaa4bbb..4aafb7c70 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetCollisionHeader.cpp @@ -29,7 +29,8 @@ void SetCollisionHeader::DeclareReferences(const std::string& prefix) std::string SetCollisionHeader::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CollisionHeader", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CollisionHeader", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_COL_HEADER(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetCsCamera.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetCsCamera.cpp index 5cf0a3d03..577a89cd1 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetCsCamera.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetCsCamera.cpp @@ -71,7 +71,7 @@ void SetCsCamera::DeclareReferences(const std::string& prefix) { std::string camPointsName; Globals::Instance->GetSegmentedPtrName(cameras.at(0).GetCamAddress(), parent, "Vec3s", - camPointsName); + camPointsName, parent->workerID); std::string declaration; size_t index = 0; @@ -103,7 +103,8 @@ void SetCsCamera::DeclareReferences(const std::string& prefix) std::string SetCsCamera::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CsCameraEntry", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CsCameraEntry", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ACTOR_CUTSCENE_CAM_LIST(%i, %s)", cameras.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetCutscenes.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetCutscenes.cpp index e51e550b0..106f6f680 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetCutscenes.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetCutscenes.cpp @@ -86,7 +86,8 @@ void SetCutscenes::ParseRawData() std::string SetCutscenes::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneData", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "CutsceneData", listName, + parent->workerID); if (Globals::Instance->game == ZGame::MM_RETAIL) return StringHelper::Sprintf("SCENE_CMD_CUTSCENE_LIST(%i, %s)", numCutscenes, diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetEntranceList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetEntranceList.cpp index 8099bacf1..aa20102ff 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetEntranceList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetEntranceList.cpp @@ -63,7 +63,8 @@ void SetEntranceList::DeclareReferencesLate([[maybe_unused]] const std::string& std::string SetEntranceList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EntranceEntry", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "EntranceEntry", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ENTRANCE_LIST(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetExitList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetExitList.cpp index ddc4c5d43..34d2a6e56 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetExitList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetExitList.cpp @@ -58,7 +58,7 @@ void SetExitList::DeclareReferencesLate([[maybe_unused]] const std::string& pref std::string SetExitList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "u16", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "u16", listName, parent->workerID); return StringHelper::Sprintf("SCENE_CMD_EXIT_LIST(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetLightList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetLightList.cpp index 2e023ff20..060fce0a2 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetLightList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetLightList.cpp @@ -52,7 +52,8 @@ void SetLightList::DeclareReferences(const std::string& prefix) std::string SetLightList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightInfo", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightInfo", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_LIGHT_LIST(%i, %s)", numLights, listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetLightingSettings.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetLightingSettings.cpp index 08cd83d14..4824f3f61 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetLightingSettings.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetLightingSettings.cpp @@ -44,7 +44,8 @@ void SetLightingSettings::DeclareReferences(const std::string& prefix) std::string SetLightingSettings::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightSettings", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "LightSettings", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ENV_LIGHT_SETTINGS(%i, %s)", settings.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetMesh.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetMesh.cpp index ba0bbe2c2..0723fcf14 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetMesh.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetMesh.cpp @@ -78,7 +78,7 @@ std::string SetMesh::GenDListExterns(ZDisplayList* dList) std::string SetMesh::GetBodySourceCode() const { std::string list; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "", list); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "", list, parent->workerID); return StringHelper::Sprintf("SCENE_CMD_MESH(%s)", list.c_str()); } @@ -129,8 +129,8 @@ std::string PolygonDlist::GetBodySourceCode() const std::string bodyStr; std::string opaStr; std::string xluStr; - Globals::Instance->GetSegmentedPtrName(opa, parent, "Gfx", opaStr); - Globals::Instance->GetSegmentedPtrName(xlu, parent, "Gfx", xluStr); + Globals::Instance->GetSegmentedPtrName(opa, parent, "Gfx", opaStr, parent->workerID); + Globals::Instance->GetSegmentedPtrName(xlu, parent, "Gfx", xluStr, parent->workerID); if (polyType == 2) { @@ -294,7 +294,7 @@ std::string BgImage::GetBodySourceCode() const } std::string backgroundName; - Globals::Instance->GetSegmentedPtrName(source, parent, "", backgroundName); + Globals::Instance->GetSegmentedPtrName(source, parent, "", backgroundName, parent->workerID); bodyStr += StringHelper::Sprintf("%s, ", backgroundName.c_str()); bodyStr += "\n "; if (!isSubStruct) @@ -493,7 +493,7 @@ std::string PolygonType1::GetBodySourceCode() const bodyStr += StringHelper::Sprintf("%i, %i, ", type, format); std::string dlistStr; - Globals::Instance->GetSegmentedPtrName(dlist, parent, "", dlistStr); + Globals::Instance->GetSegmentedPtrName(dlist, parent, "", dlistStr, parent->workerID); bodyStr += StringHelper::Sprintf("%s, ", dlistStr.c_str()); bodyStr += "}, \n"; @@ -505,7 +505,7 @@ std::string PolygonType1::GetBodySourceCode() const bodyStr += single.GetBodySourceCode(); break; case 2: - Globals::Instance->GetSegmentedPtrName(list, parent, "BgImage", listStr); + Globals::Instance->GetSegmentedPtrName(list, parent, "BgImage", listStr, parent->workerID); bodyStr += StringHelper::Sprintf(" %i, %s, \n", count, listStr.c_str()); break; @@ -592,7 +592,7 @@ void PolygonType2::DeclareReferences(const std::string& prefix) std::string PolygonType2::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(start, parent, "", listName); + Globals::Instance->GetSegmentedPtrName(start, parent, "", listName, parent->workerID); std::string body = StringHelper::Sprintf("\n %i, %i,\n", type, polyDLists.size()); body += StringHelper::Sprintf(" %s,\n", listName.c_str()); diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapChests.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapChests.cpp index ec432b7d9..3e6c72a11 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapChests.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapChests.cpp @@ -50,7 +50,8 @@ void SetMinimapChests::DeclareReferences(const std::string& prefix) std::string SetMinimapChests::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "MinimapChest", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "MinimapChest", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_MINIMAP_COMPASS_ICON_INFO(0x%02X, %s)", chests.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapList.cpp index be5d8f15d..255bd4e3a 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetMinimapList.cpp @@ -52,7 +52,8 @@ void SetMinimapList::DeclareReferences(const std::string& prefix) { std::string listName; - Globals::Instance->GetSegmentedPtrName(listSegmentAddr, parent, "MinimapEntry", listName); + Globals::Instance->GetSegmentedPtrName(listSegmentAddr, parent, "MinimapEntry", listName, + parent->workerID); std::string declaration = StringHelper::Sprintf("\n\t%s, 0x%08X\n", listName.c_str(), unk4); parent->AddDeclaration( @@ -65,7 +66,8 @@ void SetMinimapList::DeclareReferences(const std::string& prefix) std::string SetMinimapList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "MinimapList", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "MinimapList", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_MINIMAP_INFO(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetObjectList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetObjectList.cpp index fdd41e6cb..29519d3ce 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetObjectList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetObjectList.cpp @@ -51,7 +51,7 @@ void SetObjectList::DeclareReferences(const std::string& prefix) std::string SetObjectList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "s16", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "s16", listName, parent->workerID); return StringHelper::Sprintf("SCENE_CMD_OBJECT_LIST(%i, %s)", objects.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetPathways.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetPathways.cpp index 468aad822..f3bdb0872 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetPathways.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetPathways.cpp @@ -50,7 +50,7 @@ void SetPathways::DeclareReferencesLate(const std::string& prefix) std::string SetPathways::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "Path", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "Path", listName, parent->workerID); return StringHelper::Sprintf("SCENE_CMD_PATH_LIST(%s)", listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetRoomList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetRoomList.cpp index 7027fa1f9..a63dd8772 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetRoomList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetRoomList.cpp @@ -34,7 +34,7 @@ void SetRoomList::DeclareReferences(const std::string& prefix) std::string SetRoomList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "RomFile", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "RomFile", listName, parent->workerID); return StringHelper::Sprintf("SCENE_CMD_ROOM_LIST(%i, %s)", romfile->rooms.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetStartPositionList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetStartPositionList.cpp index f75b5e0d5..32a2b7000 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetStartPositionList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetStartPositionList.cpp @@ -51,7 +51,8 @@ void SetStartPositionList::DeclareReferences(const std::string& prefix) std::string SetStartPositionList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "ActorEntry", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_SPAWN_LIST(%i, %s)", actors.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp b/ZAPDTR/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp index a33d1c6e1..2414f0d2f 100644 --- a/ZAPDTR/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp +++ b/ZAPDTR/ZAPD/ZRoom/Commands/SetTransitionActorList.cpp @@ -52,7 +52,8 @@ void SetTransitionActorList::DeclareReferences(const std::string& prefix) std::string SetTransitionActorList::GetBodySourceCode() const { std::string listName; - Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "TransitionActorEntry", listName); + Globals::Instance->GetSegmentedPtrName(cmdArg2, parent, "TransitionActorEntry", listName, + parent->workerID); return StringHelper::Sprintf("SCENE_CMD_TRANSITION_ACTOR_LIST(%i, %s)", transitionActors.size(), listName.c_str()); } diff --git a/ZAPDTR/ZAPD/ZSkeleton.cpp b/ZAPDTR/ZAPD/ZSkeleton.cpp index bab1f9111..bff4b8263 100644 --- a/ZAPDTR/ZAPD/ZSkeleton.cpp +++ b/ZAPDTR/ZAPD/ZSkeleton.cpp @@ -89,7 +89,8 @@ void ZSkeleton::DeclareReferences(const std::string& prefix) std::string ZSkeleton::GetBodySourceCode() const { std::string limbArrayName; - Globals::Instance->GetSegmentedPtrName(limbsArrayAddress, parent, "", limbArrayName); + Globals::Instance->GetSegmentedPtrName(limbsArrayAddress, parent, "", limbArrayName, + parent->workerID); switch (type) { @@ -245,7 +246,8 @@ std::string ZLimbTable::GetBodySourceCode() const for (size_t i = 0; i < count; i++) { std::string limbName; - Globals::Instance->GetSegmentedPtrName(limbsAddresses[i], parent, "", limbName); + Globals::Instance->GetSegmentedPtrName(limbsAddresses[i], parent, "", limbName, + parent->workerID); body += StringHelper::Sprintf("\t%s,", limbName.c_str()); if (i + 1 < count) diff --git a/ZAPDTR/ZAPD/ZText.cpp b/ZAPDTR/ZAPD/ZText.cpp index 926761784..2e9e0f68a 100644 --- a/ZAPDTR/ZAPD/ZText.cpp +++ b/ZAPDTR/ZAPD/ZText.cpp @@ -12,6 +12,7 @@ REGISTER_ZFILENODE(Text, ZText); ZText::ZText(ZFile* nParent) : ZResource(nParent) { RegisterRequiredAttribute("CodeOffset"); + RegisterOptionalAttribute("LangOffset", "0"); } void ZText::ParseRawData() @@ -20,12 +21,23 @@ void ZText::ParseRawData() const auto& rawData = parent->GetRawData(); uint32_t currentPtr = StringHelper::StrToL(registeredAttributes.at("CodeOffset").value, 16); + uint32_t langPtr = currentPtr; + bool isPalLang = false; - std::vector codeData = File::ReadAllBytes(Globals::Instance->baseRomPath.string() + "\\code"); + if (StringHelper::StrToL(registeredAttributes.at("LangOffset").value, 16) != 0) + { + langPtr = StringHelper::StrToL(registeredAttributes.at("LangOffset").value, 16); - // In some cases with the multi-process extractor it seems that it fails to read the code file if something else is reading from it at the same time. - while (codeData.size() == 0) - codeData = File::ReadAllBytes(Globals::Instance->baseRomPath.string() + "\\code"); + if (langPtr != currentPtr) + isPalLang = true; + } + + std::vector codeData; + + if (Globals::Instance->fileMode == ZFileMode::ExtractDirectory) + codeData = Globals::Instance->GetBaseromFile("code"); + else + codeData = Globals::Instance->GetBaseromFile(Globals::Instance->baseRomPath.string() + "code"); while (true) { @@ -33,8 +45,18 @@ void ZText::ParseRawData() msgEntry.id = BitConverter::ToInt16BE(codeData, currentPtr + 0); msgEntry.textboxType = (codeData[currentPtr + 2] & 0xF0) >> 4; msgEntry.textboxYPos = (codeData[currentPtr + 2] & 0x0F); - msgEntry.segmentId = (codeData[currentPtr + 4]); - msgEntry.msgOffset = BitConverter::ToInt32BE(codeData, currentPtr + 4) & 0x00FFFFFF; + + if (isPalLang) + { + msgEntry.segmentId = (codeData[langPtr + 0]); + msgEntry.msgOffset = BitConverter::ToInt32BE(codeData, langPtr + 0) & 0x00FFFFFF; + } + else + { + msgEntry.segmentId = (codeData[langPtr + 4]); + msgEntry.msgOffset = BitConverter::ToInt32BE(codeData, langPtr + 4) & 0x00FFFFFF; + } + uint32_t msgPtr = msgEntry.msgOffset; unsigned char c = rawData[msgPtr]; @@ -81,6 +103,11 @@ void ZText::ParseRawData() break; currentPtr += 8; + + if (isPalLang) + langPtr += 4; + else + langPtr += 8; } int bp2 = 0; diff --git a/ZAPDTR/ZAPD/ZTexture.cpp b/ZAPDTR/ZAPD/ZTexture.cpp index 46d7ce334..24f12702b 100644 --- a/ZAPDTR/ZAPD/ZTexture.cpp +++ b/ZAPDTR/ZAPD/ZTexture.cpp @@ -807,25 +807,30 @@ Declaration* ZTexture::DeclareVar(const std::string& prefix, std::string ZTexture::GetBodySourceCode() const { std::string sourceOutput; - size_t texSizeInc = (dWordAligned) ? 8 : 4; - for (size_t i = 0; i < textureDataRaw.size(); i += texSizeInc) - { - if (i % 32 == 0) - sourceOutput += " "; - if (dWordAligned) - sourceOutput += - StringHelper::Sprintf("0x%016llX, ", BitConverter::ToUInt64BE(textureDataRaw, i)); - else - sourceOutput += - StringHelper::Sprintf("0x%08llX, ", BitConverter::ToUInt32BE(textureDataRaw, i)); - if (i % 32 == 24) - sourceOutput += StringHelper::Sprintf(" // 0x%06X \n", rawDataIndex + ((i / 32) * 32)); - } - // Ensure there's always a trailing line feed to prevent dumb warnings. - // Please don't remove this line, unless you somehow made a way to prevent - // that warning when building the OoT repo. - sourceOutput += "\n"; + if (!Globals::Instance->otrMode) + { + size_t texSizeInc = (dWordAligned) ? 8 : 4; + for (size_t i = 0; i < textureDataRaw.size(); i += texSizeInc) + { + if (i % 32 == 0) + sourceOutput += " "; + if (dWordAligned) + sourceOutput += StringHelper::Sprintf("0x%016llX, ", + BitConverter::ToUInt64BE(textureDataRaw, i)); + else + sourceOutput += StringHelper::Sprintf("0x%08llX, ", + BitConverter::ToUInt32BE(textureDataRaw, i)); + if (i % 32 == 24) + sourceOutput += + StringHelper::Sprintf(" // 0x%06X \n", rawDataIndex + ((i / 32) * 32)); + } + + // Ensure there's always a trailing line feed to prevent dumb warnings. + // Please don't remove this line, unless you somehow made a way to prevent + // that warning when building the OoT repo. + sourceOutput += "\n"; + } return sourceOutput; } @@ -847,8 +852,11 @@ std::string ZTexture::GetSourceTypeName() const void ZTexture::CalcHash() { - auto parentRawData = parent->GetRawData(); - hash = CRC32B(parentRawData.data() + rawDataIndex, GetRawDataSize()); + //if (hash == 0) + { + const auto& parentRawData = parent->GetRawData(); + hash = CRC32B(parentRawData.data() + rawDataIndex, GetRawDataSize()); + } } std::string ZTexture::GetExternalExtension() const diff --git a/ZAPDTR/ZAPD/ZTextureAnimation.cpp b/ZAPDTR/ZAPD/ZTextureAnimation.cpp index 698054fa8..233a54dbb 100644 --- a/ZAPDTR/ZAPD/ZTextureAnimation.cpp +++ b/ZAPDTR/ZAPD/ZTextureAnimation.cpp @@ -349,9 +349,12 @@ std::string TextureColorChangingParams::GetBodySourceCode() const std::string envColorListName; std::string frameDataListName; - Globals::Instance->GetSegmentedPtrName(primColorListAddress, parent, "", primColorListName); - Globals::Instance->GetSegmentedPtrName(envColorListAddress, parent, "", envColorListName); - Globals::Instance->GetSegmentedPtrName(frameDataListAddress, parent, "", frameDataListName); + Globals::Instance->GetSegmentedPtrName(primColorListAddress, parent, "", primColorListName, + parent->workerID); + Globals::Instance->GetSegmentedPtrName(envColorListAddress, parent, "", envColorListName, + parent->workerID); + Globals::Instance->GetSegmentedPtrName(frameDataListAddress, parent, "", frameDataListName, + parent->workerID); std::string bodyStr = StringHelper::Sprintf( "\n %d, %d, %s, %s, %s,\n", animLength, colorListCount, primColorListName.c_str(), @@ -423,7 +426,8 @@ void TextureCyclingParams::DeclareReferences([[maybe_unused]] const std::string& for (const auto& tex : textureList) { - bool texFound = Globals::Instance->GetSegmentedPtrName(tex, parent, "", texName); + bool texFound = + Globals::Instance->GetSegmentedPtrName(tex, parent, "", texName, parent->workerID); // texName is a raw segmented pointer. This occurs if the texture is not declared // separately since we cannot read the format. In theory we could scan DLists for the @@ -477,9 +481,10 @@ std::string TextureCyclingParams::GetBodySourceCode() const std::string textureListName; std::string textureIndexListName; - Globals::Instance->GetSegmentedPtrName(textureListAddress, parent, "", textureListName); + Globals::Instance->GetSegmentedPtrName(textureListAddress, parent, "", textureListName, + parent->workerID); Globals::Instance->GetSegmentedPtrName(textureIndexListAddress, parent, "", - textureIndexListName); + textureIndexListName, parent->workerID); std::string bodyStr = StringHelper::Sprintf( "\n %d, %s, %s,\n", cycleLength, textureListName.c_str(), textureIndexListName.c_str()); @@ -652,7 +657,8 @@ std::string ZTextureAnimation::GetBodySourceCode() const for (const auto& entry : entries) { std::string paramName; - Globals::Instance->GetSegmentedPtrName(entry.paramsPtr, parent, "", paramName); + Globals::Instance->GetSegmentedPtrName(entry.paramsPtr, parent, "", paramName, + parent->workerID); bodyStr += StringHelper::Sprintf("\t{ %d, %d, %s },\n", entry.segment, entry.type, paramName.c_str()); diff --git a/ZAPDTR/ZAPD/ctpl_stl.h b/ZAPDTR/ZAPD/ctpl_stl.h new file mode 100644 index 000000000..8e2d9c908 --- /dev/null +++ b/ZAPDTR/ZAPD/ctpl_stl.h @@ -0,0 +1,251 @@ +/********************************************************* +* +* Copyright (C) 2014 by Vitaliy Vitsentiy +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +* +*********************************************************/ + + +#ifndef __ctpl_stl_thread_pool_H__ +#define __ctpl_stl_thread_pool_H__ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + + +// thread pool to run user's functors with signature +// ret func(int id, other_params) +// where id is the index of the thread that runs the functor +// ret is some return type + + +namespace ctpl { + + namespace detail { + template + class Queue { + public: + bool push(T const & value) { + std::unique_lock lock(this->mutex); + this->q.push(value); + return true; + } + // deletes the retrieved element, do not use for non integral types + bool pop(T & v) { + std::unique_lock lock(this->mutex); + if (this->q.empty()) + return false; + v = this->q.front(); + this->q.pop(); + return true; + } + bool empty() { + std::unique_lock lock(this->mutex); + return this->q.empty(); + } + private: + std::queue q; + std::mutex mutex; + }; + } + + class thread_pool { + + public: + + thread_pool() { this->init(); } + thread_pool(int nThreads) { this->init(); this->resize(nThreads); } + + // the destructor waits for all the functions in the queue to be finished + ~thread_pool() { + this->stop(true); + } + + // get the number of running threads in the pool + int size() { return static_cast(this->threads.size()); } + + // number of idle threads + int n_idle() { return this->nWaiting; } + std::thread & get_thread(int i) { return *this->threads[i]; } + + // change the number of threads in the pool + // should be called from one thread, otherwise be careful to not interleave, also with this->stop() + // nThreads must be >= 0 + void resize(int nThreads) { + if (!this->isStop && !this->isDone) { + int oldNThreads = static_cast(this->threads.size()); + if (oldNThreads <= nThreads) { // if the number of threads is increased + this->threads.resize(nThreads); + this->flags.resize(nThreads); + + for (int i = oldNThreads; i < nThreads; ++i) { + this->flags[i] = std::make_shared>(false); + this->set_thread(i); + } + } + else { // the number of threads is decreased + for (int i = oldNThreads - 1; i >= nThreads; --i) { + *this->flags[i] = true; // this thread will finish + this->threads[i]->detach(); + } + { + // stop the detached threads that were waiting + std::unique_lock lock(this->mutex); + this->cv.notify_all(); + } + this->threads.resize(nThreads); // safe to delete because the threads are detached + this->flags.resize(nThreads); // safe to delete because the threads have copies of shared_ptr of the flags, not originals + } + } + } + + // empty the queue + void clear_queue() { + std::function * _f; + while (this->q.pop(_f)) + delete _f; // empty the queue + } + + // pops a functional wrapper to the original function + std::function pop() { + std::function * _f = nullptr; + this->q.pop(_f); + std::unique_ptr> func(_f); // at return, delete the function even if an exception occurred + std::function f; + if (_f) + f = *_f; + return f; + } + + // wait for all computing threads to finish and stop all threads + // may be called asynchronously to not pause the calling thread while waiting + // if isWait == true, all the functions in the queue are run, otherwise the queue is cleared without running the functions + void stop(bool isWait = false) { + if (!isWait) { + if (this->isStop) + return; + this->isStop = true; + for (int i = 0, n = this->size(); i < n; ++i) { + *this->flags[i] = true; // command the threads to stop + } + this->clear_queue(); // empty the queue + } + else { + if (this->isDone || this->isStop) + return; + this->isDone = true; // give the waiting threads a command to finish + } + { + std::unique_lock lock(this->mutex); + this->cv.notify_all(); // stop all waiting threads + } + for (int i = 0; i < static_cast(this->threads.size()); ++i) { // wait for the computing threads to finish + if (this->threads[i]->joinable()) + this->threads[i]->join(); + } + // if there were no threads in the pool but some functors in the queue, the functors are not deleted by the threads + // therefore delete them here + this->clear_queue(); + this->threads.clear(); + this->flags.clear(); + } + + template + auto push(F && f, Rest&&... rest) ->std::future { + auto pck = std::make_shared>( + std::bind(std::forward(f), std::placeholders::_1, std::forward(rest)...) + ); + auto _f = new std::function([pck](int id) { + (*pck)(id); + }); + this->q.push(_f); + std::unique_lock lock(this->mutex); + this->cv.notify_one(); + return pck->get_future(); + } + + // run the user's function that excepts argument int - id of the running thread. returned value is templatized + // operator returns std::future, where the user can get the result and rethrow the catched exceptins + template + auto push(F && f) ->std::future { + auto pck = std::make_shared>(std::forward(f)); + auto _f = new std::function([pck](int id) { + (*pck)(id); + }); + this->q.push(_f); + std::unique_lock lock(this->mutex); + this->cv.notify_one(); + return pck->get_future(); + } + + + private: + + // deleted + thread_pool(const thread_pool &);// = delete; + thread_pool(thread_pool &&);// = delete; + thread_pool & operator=(const thread_pool &);// = delete; + thread_pool & operator=(thread_pool &&);// = delete; + + void set_thread(int i) { + std::shared_ptr> flag(this->flags[i]); // a copy of the shared ptr to the flag + auto f = [this, i, flag/* a copy of the shared ptr to the flag */]() { + std::atomic & _flag = *flag; + std::function * _f; + bool isPop = this->q.pop(_f); + while (true) { + while (isPop) { // if there is anything in the queue + std::unique_ptr> func(_f); // at return, delete the function even if an exception occurred + (*_f)(i); + if (_flag) + return; // the thread is wanted to stop, return even if the queue is not empty yet + else + isPop = this->q.pop(_f); + } + // the queue is empty here, wait for the next command + std::unique_lock lock(this->mutex); + ++this->nWaiting; + this->cv.wait(lock, [this, &_f, &isPop, &_flag](){ isPop = this->q.pop(_f); return isPop || this->isDone || _flag; }); + --this->nWaiting; + if (!isPop) + return; // if the queue is empty and this->isDone == true or *flag then return + } + }; + this->threads[i].reset(new std::thread(f)); // compiler may not support std::make_unique() + } + + void init() { this->nWaiting = 0; this->isStop = false; this->isDone = false; } + + std::vector> threads; + std::vector>> flags; + detail::Queue *> q; + std::atomic isDone; + std::atomic isStop; + std::atomic nWaiting; // how many threads are waiting + + std::mutex mutex; + std::condition_variable cv; + }; + +} + +#endif // __ctpl_stl_thread_pool_H__ \ No newline at end of file diff --git a/ZAPDTR/ZAPD/yaz0/readwrite.h b/ZAPDTR/ZAPD/yaz0/readwrite.h new file mode 100644 index 000000000..af3471590 --- /dev/null +++ b/ZAPDTR/ZAPD/yaz0/readwrite.h @@ -0,0 +1,29 @@ +#ifndef __READWRITE_H__ +#define __READWRITE_H__ + +#include + +/* variables */ +union { + uint32_t u; + float f; +} __u32_f32_union__; + +#define U32(x) \ + ((uint32_t)((((uint8_t*)(x))[0] << 24) | (((uint8_t*)(x))[1] << 16) | \ + (((uint8_t*)(x))[2] << 8) | ((uint8_t*)(x))[3])) +#define U16(x) ((uint16_t)(((*((uint8_t*)(x))) << 8) | ((uint8_t*)(x))[1])) +#define U8(x) ((uint8_t)((uint8_t*)(x))[0]) +#define S32(x) ((int32_t)(U32(x))) +#define S16(x) ((int16_t)(U16(x))) +#define F32(x) (((__u32_f32_union__.u = U32(x)) & 0) + __u32_f32_union__.f) + +#define W32(x, v) \ + { \ + *((uint8_t*)x + 3) = ((v)&0xFF); \ + *((uint8_t*)x + 2) = (((v) >> 8) & 0xFF); \ + *((uint8_t*)x + 1) = (((v) >> 16) & 0xFF); \ + *((uint8_t*)x + 0) = (((v) >> 24) & 0xFF); \ + } + +#endif \ No newline at end of file diff --git a/ZAPDTR/ZAPD/yaz0/yaz0.cpp b/ZAPDTR/ZAPD/yaz0/yaz0.cpp new file mode 100644 index 000000000..885f41d1d --- /dev/null +++ b/ZAPDTR/ZAPD/yaz0/yaz0.cpp @@ -0,0 +1,227 @@ +#include +#include +#include +#include +#include +#include "readwrite.h" + +#include "yaz0.h" + +typedef uint8_t u8; +typedef uint16_t u16; +typedef uint32_t u32; + +/* internal declarations */ +int yaz0_encode_internal(const u8* src, int srcSize, u8* Data); + +int yaz0_get_size(u8* src) { return U32(src + 0x4); } + +u32 toDWORD(u32 d) { + u8 w1 = d & 0xFF; + u8 w2 = (d >> 8) & 0xFF; + u8 w3 = (d >> 16) & 0xFF; + u8 w4 = d >> 24; + return (w1 << 24) | (w2 << 16) | (w3 << 8) | w4; +} + +// simple and straight encoding scheme for Yaz0 +u32 longest_match_brute(const u8* src, int size, int pos, u32* pMatchPos) { + int startPos = pos - 0x1000; + int max_match_size = size - pos; + u32 best_match_size = 0; + u32 best_match_pos = 0; + + if (max_match_size < 3) return 0; + + if (startPos < 0) startPos = 0; + + if (max_match_size > 0x111) max_match_size = 0x111; + + for (int i = startPos; i < pos; i++) { + int current_size; + for (current_size = 0; current_size < max_match_size; current_size++) { + if (src[i + current_size] != src[pos + current_size]) { + break; + } + } + if (current_size > best_match_size) { + best_match_size = current_size; + best_match_pos = i; + if (best_match_size == 0x111) break; + } + } + *pMatchPos = best_match_pos; + return best_match_size; +} + +u32 longest_match_rabinkarp(const u8* src, int size, int pos, u32* match_pos) { + int startPos = pos - 0x1000; + int max_match_size = size - pos; + u32 best_match_size = 0; + u32 best_match_pos = 0; + + if (max_match_size < 3) return 0; + + if (startPos < 0) startPos = 0; + + if (max_match_size > 0x111) max_match_size = 0x111; + + int find_hash = src[pos] << 16 | src[pos + 1] << 8 | src[pos + 2]; + int current_hash = src[startPos] << 16 | src[startPos + 1] << 8 | src[startPos + 2]; + + for (int i = startPos; i < pos; i++) { + if(current_hash == find_hash) { + int current_size; + for (current_size = 3; current_size < max_match_size; current_size++) { + if (src[i + current_size] != src[pos + current_size]) { + break; + } + } + if (current_size > best_match_size) { + best_match_size = current_size; + best_match_pos = i; + if (best_match_size == 0x111) break; + } + } + current_hash = (current_hash << 8 | src[i + 3]) & 0xFFFFFF; + } + *match_pos = best_match_pos; + + return best_match_size; +} + +int yaz0_encode_internal(const u8* src, int srcSize, u8* Data) { + int srcPos = 0; + + int bitmask = 0x80; + u8 currCodeByte = 0; + int currCodeBytePos = 0; + int pos = currCodeBytePos + 1; + + while (srcPos < srcSize) { + u32 numBytes; + u32 matchPos; + + numBytes = longest_match_rabinkarp(src, srcSize, srcPos, &matchPos); + //fprintf(stderr, "pos %x len %x pos %x\n", srcPos, (int)numBytes, (int)matchPos); + if (numBytes < 3) { + //fprintf(stderr, "single byte %02x\n", src[srcPos]); + Data[pos++] = src[srcPos++]; + currCodeByte |= bitmask; + } else { + // RLE part + u32 dist = srcPos - matchPos - 1; + + if (numBytes >= 0x12) // 3 byte encoding + { + Data[pos++] = dist >> 8; // 0R + Data[pos++] = dist & 0xFF; // FF + if (numBytes > 0xFF + 0x12) numBytes = 0xFF + 0x12; + Data[pos++] = numBytes - 0x12; + } else // 2 byte encoding + { + Data[pos++] = ((numBytes - 2) << 4) | (dist >> 8); + Data[pos++] = dist & 0xFF; + } + srcPos += numBytes; + } + bitmask >>= 1; + // write eight codes + if (!bitmask) { + Data[currCodeBytePos] = currCodeByte; + currCodeBytePos = pos++; + + currCodeByte = 0; + bitmask = 0x80; + } + } + if (bitmask) { + Data[currCodeBytePos] = currCodeByte; + } + + return pos; +} + +std::vector yaz0_encode_fast(const u8* src, int src_size) { + std::vector buffer; + std::vector> lut; + lut.resize(0x1000000); + + for (int i = 0; i < src_size - 3; ++i) { + lut[src[i + 0] << 16 | src[i + 1] << 8 | src[i + 2]].push_back(i); + } + + return buffer; +} + +std::vector yaz0_encode(const u8* src, int src_size) { + std::vector buffer(src_size * 10 / 8 + 16); + u8* dst = buffer.data(); + + // write 4 bytes yaz0 header + memcpy(dst, "Yaz0", 4); + + // write 4 bytes uncompressed size + W32(dst + 4, src_size); + + // encode + int dst_size = yaz0_encode_internal(src, src_size, dst + 16); + int aligned_size = (dst_size + 31) & -16; + buffer.resize(aligned_size); + +#if 0 + std::vector decompressed(src_size); + yaz0_decode(buffer.data(), decompressed.data(), src_size); + if(memcmp(src, decompressed.data(), src_size)) { + fprintf(stderr, "Decompressed buffer is different from original\n"); + } +#endif + + return buffer; +} + +void yaz0_decode(const uint8_t* source, uint8_t* decomp, int32_t decompSize) { + uint32_t srcPlace = 0, dstPlace = 0; + uint32_t i, dist, copyPlace, numBytes; + uint8_t codeByte, byte1, byte2; + uint8_t bitCount = 0; + + source += 0x10; + while (dstPlace < decompSize) { + /* If there are no more bits to test, get a new byte */ + if (!bitCount) { + codeByte = source[srcPlace++]; + bitCount = 8; + } + + /* If bit 7 is a 1, just copy 1 byte from source to destination */ + /* Else do some decoding */ + if (codeByte & 0x80) { + decomp[dstPlace++] = source[srcPlace++]; + } else { + /* Get 2 bytes from source */ + byte1 = source[srcPlace++]; + byte2 = source[srcPlace++]; + + /* Calculate distance to move in destination */ + /* And the number of bytes to copy */ + dist = ((byte1 & 0xF) << 8) | byte2; + copyPlace = dstPlace - (dist + 1); + numBytes = byte1 >> 4; + + /* Do more calculations on the number of bytes to copy */ + if (!numBytes) + numBytes = source[srcPlace++] + 0x12; + else + numBytes += 2; + + /* Copy data from a previous point in destination */ + /* to current point in destination */ + for (i = 0; i < numBytes; i++) decomp[dstPlace++] = decomp[copyPlace++]; + } + + /* Set up for the next read cycle */ + codeByte = codeByte << 1; + bitCount--; + } +} \ No newline at end of file diff --git a/ZAPDTR/ZAPD/yaz0/yaz0.h b/ZAPDTR/ZAPD/yaz0/yaz0.h new file mode 100644 index 000000000..0d5cc3cfd --- /dev/null +++ b/ZAPDTR/ZAPD/yaz0/yaz0.h @@ -0,0 +1,6 @@ +#pragma once + +#include + +void yaz0_decode(const uint8_t* src, uint8_t* dest, int32_t destsize); +std::vector yaz0_encode(const uint8_t* src, int src_size); \ No newline at end of file diff --git a/ZAPDTR/ZAPDUtils/Utils/BitConverter.h b/ZAPDTR/ZAPDUtils/Utils/BitConverter.h index e672b97c2..708d4b537 100644 --- a/ZAPDTR/ZAPDUtils/Utils/BitConverter.h +++ b/ZAPDTR/ZAPDUtils/Utils/BitConverter.h @@ -3,6 +3,7 @@ #include #include #include +#include class BitConverter { diff --git a/ZAPDTR/ZAPDUtils/Utils/Directory.h b/ZAPDTR/ZAPDUtils/Utils/Directory.h index b1ce49699..1ced139be 100644 --- a/ZAPDTR/ZAPDUtils/Utils/Directory.h +++ b/ZAPDTR/ZAPDUtils/Utils/Directory.h @@ -52,7 +52,7 @@ public: for (auto& p : fs::recursive_directory_iterator(dir)) { if (!p.is_directory()) - lst.push_back(p.path().string()); + lst.push_back(p.path().generic_string()); } } diff --git a/ZAPDTR/ZAPDUtils/Utils/StringHelper.cpp b/ZAPDTR/ZAPDUtils/Utils/StringHelper.cpp index e2b646fd9..070fffa63 100644 --- a/ZAPDTR/ZAPDUtils/Utils/StringHelper.cpp +++ b/ZAPDTR/ZAPDUtils/Utils/StringHelper.cpp @@ -3,6 +3,10 @@ #pragma optimize("2", on) #define _CRT_SECURE_NO_WARNINGS +#ifndef _MSC_VER +#define vsprintf_s vsprintf +#endif + std::vector StringHelper::Split(std::string s, const std::string& delimiter) { std::vector result; @@ -44,7 +48,7 @@ std::string StringHelper::Replace(std::string str, const std::string& from, while (start_pos != std::string::npos) { - str.replace(start_pos, from.length(), to); + str.replace(start_pos, from.length(), to); start_pos = str.find(from); } diff --git a/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj b/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj index dd49779dc..b74fe75f9 100644 --- a/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj +++ b/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj @@ -72,15 +72,27 @@ true + MinimumRecommendedRules.ruleset + + false + MinimumRecommendedRules.ruleset + + true + MinimumRecommendedRules.ruleset + + false + MinimumRecommendedRules.ruleset + + @@ -174,6 +186,12 @@ + + + {02d10590-9542-3f55-aaf8-6055677e2a2a} + false + + diff --git a/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters b/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters index 218084e6d..3c46d19fe 100644 --- a/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters +++ b/ZAPDTR/ZAPDUtils/ZAPDUtils.vcxproj.filters @@ -12,14 +12,14 @@ {d8c2c1e7-b065-4b0f-86a2-46ab46eedc0b} - + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - + {e047919d-7186-49ca-b115-e48fbb5c8743} - + {3de9dd46-0dfd-4d48-9f20-9f24e5b80fe0} @@ -69,19 +69,19 @@ - Header Files\Source Files\Utils + Source Files\Utils - Header Files\Source Files\Utils + Source Files\Utils - Header Files\Source Files\Utils + Source Files\Utils - Header Files\Source Files\Libraries + Source Files\Libraries - Header Files\Source Files\Utils + Source Files\Utils \ No newline at end of file diff --git a/ZAPDTR/lib/libgfxd/priv.h b/ZAPDTR/lib/libgfxd/priv.h index 37cb66b68..34d96f675 100644 --- a/ZAPDTR/lib/libgfxd/priv.h +++ b/ZAPDTR/lib/libgfxd/priv.h @@ -2,6 +2,8 @@ #define GFXD_PRIV_H #include "gfxd.h" +#define CONFIG_MT + #ifdef CONFIG_MT # ifdef _MSC_VER # define TLOCAL __declspec(thread) @@ -9,7 +11,7 @@ # define TLOCAL _Thread_local # endif #else -# define TLOCAL +#define TLOCAL #endif #define UCFUNC static inline diff --git a/libultraship/.gitignore b/libultraship/.gitignore index da0a72409..1cf3c3325 100644 --- a/libultraship/.gitignore +++ b/libultraship/.gitignore @@ -353,4 +353,6 @@ MigrationBackup/ .ionide/ !libultraship/Lib/** -libultraship/DebugObj/* \ No newline at end of file +libultraship/DebugObj/* +build/ +libultraship.a \ No newline at end of file diff --git a/libultraship/Makefile b/libultraship/Makefile index d7aafd65f..d6789db0b 100644 --- a/libultraship/Makefile +++ b/libultraship/Makefile @@ -1,15 +1,78 @@ # Only used for standalone compilation, usually inherits these from the main makefile -CXXFLAGS ?= -Wall -Wextra -O2 -g -std=c++17 + +CXX := g++ +CC := gcc +AR := ar +FORMAT := clang-format-11 + +ASAN ?= 0 +DEBUG ?= 1 +OPTFLAGS ?= -O0 +LTO ?= 0 + +WARN := -Wall -Wextra -Werror \ + -Wno-unused-variable \ + -Wno-unused-parameter \ + -Wno-unused-function \ + -Wno-parentheses \ + -Wno-narrowing \ + -Wno-missing-field-initializers + +CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 -m32 +CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -DENABLE_OPENGL -DSPDLOG_ACTIVE_LEVEL=0 -m32 +CPPFLAGS := -MMD + +ifneq ($(DEBUG),0) + CXXFLAGS += -g -D_DEBUG + CFLAGS += -g -D_DEBUG +endif + +ifneq ($(ASAN),0) + CXXFLAGS += -fsanitize=address + CFLAGS += -fsanitize=address +endif + +ifneq ($(LTO),0) + CXXFLAGS += -flto + CFLAGS += -flto +endif SRC_DIRS := $(shell find -type d -not -path "*build*") -CPP_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.cpp)) -H_FILES := $(foreach dir,$(SRC_DIRS),$(wildcard $(dir)/*.h)) -O_FILES := $(foreach f,$(CPP_FILES:.cpp=.o),build/$f) -LIB := otrlib.a +CXX_FILES := \ + $(shell find libultraship/Factories -name *.cpp) \ + $(shell find libultraship/Lib/Fast3D -name *.cpp) \ + $(shell find libultraship -maxdepth 1 -name *.cpp) \ + $(shell find libultraship/Lib/ImGui -maxdepth 1 -name *.cpp) \ + libultraship/Lib/ImGui/backends/imgui_impl_opengl3.cpp \ + libultraship/Lib/ImGui/backends/imgui_impl_sdl.cpp \ + libultraship/Lib/StrHash64.cpp \ + libultraship/Lib/tinyxml2/tinyxml2.cpp + +C_FILES := \ + libultraship/mixer.c \ + libultraship/Lib/stb/stb_impl.c + +FMT_FILES := $(shell find libultraship/ -type f \( -name *.cpp -o -name *.h \) -a -not -path "libultraship/Lib/*") + +O_FILES := \ + $(CXX_FILES:%.cpp=build/%.o) \ + $(C_FILES:%.c=build/%.o) + +D_FILES := $(O_FILES:%.o=%.d) + +LIB := libultraship.a + +INC_DIRS := $(addprefix -I, \ + ../ZAPDTR/ZAPDUtils \ + libultraship/Lib/Fast3D/U64 \ + libultraship/Lib/spdlog \ + libultraship/Lib/spdlog/include \ + libultraship \ +) # create build directories -$(shell mkdir -p $(foreach dir,$(SRC_DIRS),build/$(dir))) +$(shell mkdir -p $(SRC_DIRS:%=build/%)) all: $(LIB) @@ -17,12 +80,17 @@ clean: rm -rf build $(LIB) format: - clang-format-11 -i $(CPP_FILES) $(H_FILES) + $(FORMAT) -i $(FMT_FILES) .PHONY: all clean format build/%.o: %.cpp - $(CXX) $(CXXFLAGS) $(OPTFLAGS) -I ./ -I ../ZAPD/ZAPD -I ../ZAPD/ZAPDUtils -I ../../ZAPD/lib/tinyxml2 -I otrlib/Lib/spdlog/include -c $(OUTPUT_OPTION) $< + $(CXX) $(CXXFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@ + +build/%.o: %.c + $(CC) $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) -c $< -o $@ $(LIB): $(O_FILES) $(AR) rcs $@ $^ + +-include $(D_FILES) \ No newline at end of file diff --git a/libultraship/libultraship/Animation.cpp b/libultraship/libultraship/Animation.cpp index be2decad3..f9a6e2ee8 100644 --- a/libultraship/libultraship/Animation.cpp +++ b/libultraship/libultraship/Animation.cpp @@ -21,7 +21,7 @@ void Ship::AnimationV0::ParseFileBinary(BinaryReader* reader, Resource* res) uint32_t rotIndCnt = reader->ReadUInt32(); anim->rotationIndices.reserve(rotIndCnt); - for (int i = 0; i < rotIndCnt; i++) + for (size_t i = 0; i < rotIndCnt; i++) { uint16_t x = reader->ReadUInt16(); uint16_t y = reader->ReadUInt16(); diff --git a/libultraship/libultraship/Archive.cpp b/libultraship/libultraship/Archive.cpp index 41c6649f8..1e8f8d597 100644 --- a/libultraship/libultraship/Archive.cpp +++ b/libultraship/libultraship/Archive.cpp @@ -7,7 +7,7 @@ #include namespace Ship { - Archive::Archive(const std::string& MainPath, bool enableWriting) : Archive(MainPath, "", enableWriting) + Archive::Archive(const std::string& MainPath, bool enableWriting) : Archive(MainPath, "", enableWriting) { mainMPQ = nullptr; } @@ -28,7 +28,7 @@ namespace Ship { std::shared_ptr Archive::CreateArchive(const std::string& archivePath, int fileCapacity) { - Archive* archive = new Archive(archivePath, true); + auto archive = std::make_shared(archivePath, true); TCHAR* t_filename = new TCHAR[archivePath.size() + 1]; t_filename[archivePath.size()] = 0; @@ -37,10 +37,15 @@ namespace Ship { bool success = SFileCreateArchive(t_filename, MPQ_CREATE_LISTFILE | MPQ_CREATE_ATTRIBUTES | MPQ_CREATE_ARCHIVE_V2, fileCapacity, &archive->mainMPQ); int error = GetLastError(); - if (success) { + delete[] t_filename; + + if (success) + { archive->mpqHandles[archivePath] = archive->mainMPQ; - return std::make_shared(*archive); - } else { + return archive; + } + else + { SPDLOG_ERROR("({}) We tried to create an archive, but it has fallen and cannot get up."); return nullptr; } @@ -49,11 +54,16 @@ namespace Ship { std::shared_ptr Archive::LoadFile(const std::string& filePath, bool includeParent, std::shared_ptr FileToLoad) { HANDLE fileHandle = NULL; + if (FileToLoad == nullptr) { + FileToLoad = std::make_shared(); + FileToLoad->path = filePath; + } + if (!SFileOpenFileEx(mainMPQ, filePath.c_str(), 0, &fileHandle)) { SPDLOG_ERROR("({}) Failed to open file {} from mpq archive {}", GetLastError(), filePath.c_str(), MainPath.c_str()); std::unique_lock Lock(FileToLoad->FileLoadMutex); FileToLoad->bHasLoadError = true; - return nullptr; + return FileToLoad; } DWORD dwFileSize = SFileGetFileSize(fileHandle, 0); @@ -67,18 +77,13 @@ namespace Ship { } std::unique_lock Lock(FileToLoad->FileLoadMutex); FileToLoad->bHasLoadError = true; - return nullptr; + return FileToLoad; } if (!SFileCloseFile(fileHandle)) { SPDLOG_ERROR("({}) Failed to close file {} from mpq archive {}", GetLastError(), filePath.c_str(), MainPath.c_str()); } - if (FileToLoad == nullptr) { - FileToLoad = std::make_shared(); - FileToLoad->path = filePath; - } - std::unique_lock Lock(FileToLoad->FileLoadMutex); FileToLoad->parent = includeParent ? shared_from_this() : nullptr; FileToLoad->buffer = fileData; @@ -92,6 +97,11 @@ namespace Ship { HANDLE fileHandle = NULL; HANDLE mpqHandle = NULL; + if (FileToLoad == nullptr) { + FileToLoad = std::make_shared(); + FileToLoad->path = filePath; + } + for(auto [path, handle] : mpqHandles) { if (SFileOpenFileEx(mpqHandle, filePath.c_str(), 0, &fileHandle)) { std::unique_lock Lock(FileToLoad->FileLoadMutex); @@ -116,18 +126,13 @@ namespace Ship { } std::unique_lock Lock(FileToLoad->FileLoadMutex); FileToLoad->bHasLoadError = true; - return nullptr; + return FileToLoad; } if (!SFileCloseFile(fileHandle)) { SPDLOG_ERROR("({}) Failed to close file {} from mpq archive {}", GetLastError(), filePath.c_str(), MainPath.c_str()); } - if (FileToLoad == nullptr) { - FileToLoad = std::make_shared(); - FileToLoad->path = filePath; - } - std::unique_lock Lock(FileToLoad->FileLoadMutex); FileToLoad->parent = includeParent ? shared_from_this() : nullptr; FileToLoad->buffer = fileData; @@ -139,13 +144,16 @@ namespace Ship { bool Archive::AddFile(const std::string& path, uintptr_t fileData, DWORD dwFileSize) { HANDLE hFile; - +#ifdef _WIN32 SYSTEMTIME sysTime; GetSystemTime(&sysTime); FILETIME t; SystemTimeToFileTime(&sysTime, &t); ULONGLONG stupidHack = static_cast(t.dwHighDateTime) << (sizeof(t.dwHighDateTime) * 8) | t.dwLowDateTime; - +#else + time_t stupidHack; + time(&stupidHack); +#endif if (!SFileCreateFile(mainMPQ, path.c_str(), stupidHack, dwFileSize, 0, MPQ_FILE_COMPRESS, &hFile)) { SPDLOG_ERROR("({}) Failed to create file of {} bytes {} in archive {}", GetLastError(), dwFileSize, path.c_str(), MainPath.c_str()); return false; @@ -181,7 +189,7 @@ namespace Ship { SPDLOG_ERROR("({}) Failed to remove file {} in archive {}", GetLastError(), path.c_str(), MainPath.c_str()); return false; } - + return true; } @@ -201,7 +209,7 @@ namespace Ship { SFILE_FIND_DATA findContext; HANDLE hFind; - + hFind = SFileFindFirstFile(mainMPQ, searchMask.c_str(), &findContext, nullptr); //if (hFind && GetLastError() != ERROR_NO_MORE_FILES) { if (hFind != nullptr) { @@ -245,7 +253,7 @@ namespace Ship { auto start = std::chrono::steady_clock::now(); auto lst = ListFiles(filename); - + for (const auto& item : lst) { if (item.cFileName == filename) { result = true; @@ -267,7 +275,7 @@ namespace Ship { return LoadMainMPQ(enableWriting, genCRCMap) && LoadPatchMPQs(); } - bool Archive::Unload() + bool Archive::Unload() { bool success = true; for (const auto& mpqHandle : mpqHandles) { @@ -302,11 +310,16 @@ namespace Ship { bool Archive::LoadMainMPQ(bool enableWriting, bool genCRCMap) { HANDLE mpqHandle = NULL; +#ifdef _WIN32 + std::wstring wfullPath = std::filesystem::absolute(MainPath).wstring(); +#endif std::string fullPath = std::filesystem::absolute(MainPath).string(); - std::wstring wFileName = std::filesystem::absolute(MainPath).wstring(); - - if (!SFileOpenArchive(wFileName.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) { +#ifdef _WIN32 + if (!SFileOpenArchive(wfullPath.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) { +#else + if (!SFileOpenArchive(fullPath.c_str(), 0, enableWriting ? 0 : MPQ_OPEN_READ_ONLY, &mpqHandle)) { +#endif SPDLOG_ERROR("({}) Failed to open main mpq file {}.", GetLastError(), fullPath.c_str()); return false; } @@ -340,12 +353,19 @@ namespace Ship { std::wstring wPath = std::filesystem::absolute(path).wstring(); +#ifdef _WIN32 if (!SFileOpenArchive(wPath.c_str(), 0, MPQ_OPEN_READ_ONLY, &patchHandle)) { +#else + if (!SFileOpenArchive(fullPath.c_str(), 0, MPQ_OPEN_READ_ONLY, &patchHandle)) { +#endif SPDLOG_ERROR("({}) Failed to open patch mpq file {} while applying to {}.", GetLastError(), path.c_str(), MainPath.c_str()); return false; } - +#ifdef _WIN32 if (!SFileOpenPatchArchive(mainMPQ, wPath.c_str(), "", 0)) { +#else + if (!SFileOpenPatchArchive(mainMPQ, fullPath.c_str(), "", 0)) { +#endif SPDLOG_ERROR("({}) Failed to apply patch mpq file {} to main mpq {}.", GetLastError(), path.c_str(), MainPath.c_str()); return false; } diff --git a/libultraship/libultraship/Array.cpp b/libultraship/libultraship/Array.cpp index f256903bf..fdd522c11 100644 --- a/libultraship/libultraship/Array.cpp +++ b/libultraship/libultraship/Array.cpp @@ -51,6 +51,8 @@ namespace Ship data.u16 = reader->ReadUInt16(); break; // OTRTODO: IMPLEMENT OTHER TYPES! + default: + break; } arr->scalars.push_back(data); diff --git a/libultraship/libultraship/ConfigFile.cpp b/libultraship/libultraship/ConfigFile.cpp index 1b4952139..8a0794643 100644 --- a/libultraship/libultraship/ConfigFile.cpp +++ b/libultraship/libultraship/ConfigFile.cpp @@ -2,6 +2,7 @@ #include "spdlog/spdlog.h" #include "GlobalCtx2.h" #include "Window.h" +#include "GameSettings.h" namespace Ship { ConfigFile::ConfigFile(std::shared_ptr Context, const std::string& Path) : Context(Context), Path(Path), File(Path.c_str()) { @@ -71,7 +72,7 @@ namespace Ship { (*this)["WINDOW"]["FULLSCREEN WIDTH"] = std::to_string(1920); (*this)["WINDOW"]["FULLSCREEN HEIGHT"] = std::to_string(1080); (*this)["WINDOW"]["FULLSCREEN"] = std::to_string(false); - (*this)["WINDOW"]["GFX BACKEND"] = "sdl"; + (*this)["WINDOW"]["GFX BACKEND"] = ""; (*this)["KEYBOARD CONTROLLER BINDING 1"][STR(BTN_CRIGHT)] = std::to_string(0x14D); (*this)["KEYBOARD CONTROLLER BINDING 1"][STR(BTN_CLEFT)] = std::to_string(0x14B); @@ -149,6 +150,8 @@ namespace Ship { (*this)["KEYBOARD CONTROLLER BINDING 4"][STR(BTN_STICKDOWN)] = std::to_string(0x01F); (*this)["KEYBOARD CONTROLLER BINDING 4"][STR(BTN_STICKUP)] = std::to_string(0x011); + (*this)["ENHANCEMENT SETTINGS"]["TEXT_SPEED"] = "1"; + (*this)["SDL CONTROLLER 1"]["GUID"] = ""; (*this)["SDL CONTROLLER 2"]["GUID"] = ""; (*this)["SDL CONTROLLER 3"]["GUID"] = ""; diff --git a/libultraship/libultraship/ConfigFile.h b/libultraship/libultraship/ConfigFile.h index dcf2a0e4a..b94e22f88 100644 --- a/libultraship/libultraship/ConfigFile.h +++ b/libultraship/libultraship/ConfigFile.h @@ -1,3 +1,6 @@ +#ifndef CONFIG_FILE_H +#define CONFIG_FILE_H + #pragma once #include @@ -29,9 +32,11 @@ namespace Ship { bool CreateDefaultConfig(); private: - mINI::INIFile File; mINI::INIStructure Val; std::weak_ptr Context; std::string Path; + mINI::INIFile File; }; } + +#endif diff --git a/libultraship/libultraship/Controller.h b/libultraship/libultraship/Controller.h index c78142af4..256b31fee 100644 --- a/libultraship/libultraship/Controller.h +++ b/libultraship/libultraship/Controller.h @@ -3,6 +3,7 @@ #include #include #include +#include #include "stdint.h" #include "UltraController.h" #include "ControllerAttachment.h" @@ -19,12 +20,17 @@ namespace Ship { void Read(OSContPad* pad); virtual void ReadFromSource() = 0; virtual void WriteToSource(ControllerCallback* controller) = 0; + virtual bool Connected() const = 0; + virtual bool CanRumble() const = 0; bool isRumbling; void SetButtonMapping(const std::string& szButtonName, int32_t dwScancode); std::shared_ptr GetAttachment() { return Attachment; } int32_t GetControllerNumber() { return dwControllerNumber; } + virtual bool HasPadConf() const = 0; + virtual std::optional GetPadConfSection() = 0; + protected: int32_t dwPressedButtons; std::map ButtonMapping; diff --git a/libultraship/libultraship/Cvar.cpp b/libultraship/libultraship/Cvar.cpp index 306a18e83..891ee73af 100644 --- a/libultraship/libultraship/Cvar.cpp +++ b/libultraship/libultraship/Cvar.cpp @@ -1,23 +1,22 @@ -#include "cvar.h" +#include "Cvar.h" #include #include +#include +#include +#include #include -std::map cvars; +std::map, std::less<>> cvars; -CVar* CVar_GetVar(char* name) { - std::string key(name); - return cvars.contains(key) ? cvars[key] : nullptr; +extern "C" CVar* CVar_Get(const char* name) { + auto it = cvars.find(name); + return (it != cvars.end()) ? it->second.get() : nullptr; } -extern "C" CVar* CVar_Get(char* name) { - return CVar_GetVar(name); -} - -extern "C" s32 CVar_GetS32(char* name, s32 defaultValue) { +extern "C" s32 CVar_GetS32(const char* name, s32 defaultValue) { CVar* cvar = CVar_Get(name); - if (cvar != nullptr) { + if (cvar) { if (cvar->type == CVAR_TYPE_S32) return cvar->value.valueS32; } @@ -25,10 +24,10 @@ extern "C" s32 CVar_GetS32(char* name, s32 defaultValue) { return defaultValue; } -extern "C" float CVar_GetFloat(char* name, float defaultValue) { +extern "C" float CVar_GetFloat(const char* name, float defaultValue) { CVar* cvar = CVar_Get(name); - if (cvar != nullptr) { + if (cvar) { if (cvar->type == CVAR_TYPE_FLOAT) return cvar->value.valueFloat; } @@ -36,10 +35,10 @@ extern "C" float CVar_GetFloat(char* name, float defaultValue) { return defaultValue; } -extern "C" char* CVar_GetString(char* name, char* defaultValue) { +extern "C" const char* CVar_GetString(const char* name, const char* defaultValue) { CVar* cvar = CVar_Get(name); - if (cvar != nullptr) { + if (cvar) { if (cvar->type == CVAR_TYPE_STRING) return cvar->value.valueStr; } @@ -47,54 +46,44 @@ extern "C" char* CVar_GetString(char* name, char* defaultValue) { return defaultValue; } -extern "C" void CVar_SetS32(char* name, s32 value) { - CVar* cvar = CVar_Get(name); +extern "C" void CVar_SetS32(const char* name, s32 value) { + auto& cvar = cvars[name]; if (!cvar) { - cvar = new CVar; - cvars[std::string(name)] = cvar; + cvar = std::make_unique(); } cvar->type = CVAR_TYPE_S32; cvar->value.valueS32 = value; } -void CVar_SetFloat(char* name, float value) { - CVar* cvar = CVar_Get(name); +void CVar_SetFloat(const char* name, float value) { + auto& cvar = cvars[name]; if (!cvar) { - cvar = new CVar; - cvars[std::string(name)] = cvar; + cvar = std::make_unique(); } cvar->type = CVAR_TYPE_FLOAT; cvar->value.valueFloat = value; } -void CVar_SetString(char* name, char* value) { - CVar* cvar = CVar_Get(name); +void CVar_SetString(const char* name, const char* value) { + auto& cvar = cvars[name]; if (!cvar) { - cvar = new CVar; - cvars[std::string(name)] = cvar; + cvar = std::make_unique(); } cvar->type = CVAR_TYPE_STRING; cvar->value.valueStr = value; } - -extern "C" void CVar_RegisterS32(char* name, s32 defaultValue) { - CVar* cvar = CVar_Get(name); - - if (cvar == nullptr) +extern "C" void CVar_RegisterS32(const char* name, s32 defaultValue) { + if (!CVar_Get(name)) CVar_SetS32(name, defaultValue); } -extern "C" void CVar_RegisterFloat(char* name, float defaultValue) { - CVar* cvar = CVar_Get(name); - - if (cvar == nullptr) +extern "C" void CVar_RegisterFloat(const char* name, float defaultValue) { + if (!CVar_Get(name)) CVar_SetFloat(name, defaultValue); } -extern "C" void CVar_RegisterString(char* name, char* defaultValue) { - CVar* cvar = CVar_Get(name); - - if (cvar == nullptr) +extern "C" void CVar_RegisterString(const char* name, const char* defaultValue) { + if (!CVar_Get(name)) CVar_SetString(name, defaultValue); -} \ No newline at end of file +} diff --git a/libultraship/libultraship/Cvar.h b/libultraship/libultraship/Cvar.h index 7bac8f20b..e16f4469f 100644 --- a/libultraship/libultraship/Cvar.h +++ b/libultraship/libultraship/Cvar.h @@ -6,13 +6,13 @@ typedef enum CVarType { CVAR_TYPE_S32, CVAR_TYPE_FLOAT, CVAR_TYPE_STRING } CVarType; typedef struct CVar { - char* name; + const char* name; CVarType type; union { s32 valueS32; float valueFloat; - char* valueStr; + const char* valueStr; } value; } CVar; @@ -22,16 +22,15 @@ extern "C" #endif //#include +CVar* CVar_Get(const char* name); +s32 CVar_GetS32(const char* name, s32 defaultValue); +float CVar_GetFloat(const char* name, float defaultValue); +const char* CVar_GetString(const char* name, const char* defaultValue); +void CVar_SetS32(const char* name, s32 value); -CVar* CVar_Get(char* name); -s32 CVar_GetS32(char* name, s32 defaultValue); -float CVar_GetFloat(char* name, float defaultValue); -char* CVar_GetString(char* name, char* defaultValue); -void CVar_SetS32(char* name, s32 value); - -void CVar_RegisterS32(char* name, s32 defaultValue); -void CVar_RegisterFloat(char* name, float defaultValue); -void CVar_RegisterString(char* name, char* defaultValue); +void CVar_RegisterS32(const char* name, s32 defaultValue); +void CVar_RegisterFloat(const char* name, float defaultValue); +void CVar_RegisterString(const char* name, const char* defaultValue); #ifdef __cplusplus }; @@ -40,10 +39,11 @@ void CVar_RegisterString(char* name, char* defaultValue); #ifdef __cplusplus #include #include +#include +#include -extern std::map cvars; -CVar* CVar_GetVar(char* name); -void CVar_SetFloat(char* name, float value); -void CVar_SetString(char* name, char* value); +extern std::map, std::less<>> cvars; +void CVar_SetFloat(const char* name, float value); +void CVar_SetString(const char* name, const char* value); +#endif #endif -#endif \ No newline at end of file diff --git a/libultraship/libultraship/Factories/OTRResourceLoader.cpp b/libultraship/libultraship/Factories/OTRResourceLoader.cpp deleted file mode 100644 index 125e0d9ec..000000000 --- a/libultraship/libultraship/Factories/OTRResourceLoader.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "OTRResourceLoader.h" -#include "OTRMaterialFactory.h" -#include "OTRSceneFactory.h" -#include "OTRCollisionHeaderFactory.h" -#include "OTRDisplayListFactory.h" -#include "OTRPlayerAnimationFactory.h" -#include "OTRSkeletonFactory.h" -#include "OTRSkeletonLimbFactory.h" -#include "OTRAnimationFactory.h" -#include "OTRVtxFactory.h" -#include "OTRCutsceneFactory.h" -#include "OTRArrayFactory.h" -#include "OTRPathFactory.h" - -namespace OtrLib -{ - OTRResource* OTRResourceLoader::LoadResource(BinaryReader* reader) - { - Endianess endianess = (Endianess)reader->ReadByte(); - - // TODO: Setup the binaryreader to use the resource's endianess - - ResourceType resourceType = (ResourceType)reader->ReadUInt32(); - OTRResource* result = nullptr; - - switch (resourceType) - { - case ResourceType::OTRMaterial: - result = OTRMaterialFactory::ReadMaterial(reader); - break; - case ResourceType::OTRRoom: - result = OTRSceneFactory::ReadScene(reader); - break; - case ResourceType::OTRCollisionHeader: - result = OTRCollisionHeaderFactory::ReadCollisionHeader(reader); - break; - case ResourceType::OTRDisplayList: - result = OTRDisplayListFactory::ReadDisplayList(reader); - break; - case ResourceType::OTRPlayerAnimation: - result = OTRPlayerAnimationFactory::ReadPlayerAnimation(reader); - break; - case ResourceType::OTRSkeleton: - result = OTRSkeletonFactory::ReadSkeleton(reader); - break; - case ResourceType::OTRSkeletonLimb: - result = OTRSkeletonLimbFactory::ReadSkeletonLimb(reader); - break; - case ResourceType::OTRVtx: - result = OTRVtxFactory::ReadVtx(reader); - break; - case ResourceType::OTRAnimation: - result = OTRAnimationFactory::ReadAnimation(reader); - break; - case ResourceType::OTRCutscene: - result = OTRCutsceneFactory::ReadCutscene(reader); - break; - case ResourceType::OTRArray: - result = OTRArrayFactory::ReadArray(reader); - break; - case ResourceType::OTRPath: - result = OTRPathFactory::ReadPath(reader); - break; - default: - // RESOURCE TYPE NOT SUPPORTED - break; - } - - return result; - } -} \ No newline at end of file diff --git a/libultraship/libultraship/GameOverlay.cpp b/libultraship/libultraship/GameOverlay.cpp new file mode 100644 index 000000000..042ff980c --- /dev/null +++ b/libultraship/libultraship/GameOverlay.cpp @@ -0,0 +1,225 @@ +#include "GameOverlay.h" + +#include "Cvar.h" +#include "File.h" +#include "Archive.h" +#include "ResourceMgr.h" +#include "SohConsole.h" +#include "SohImGuiImpl.h" +#include "TextureMod.h" +#include "Lib/ImGui/imgui_internal.h" +#include "Utils/StringHelper.h" + +void Ship::GameOverlay::LoadFont(const std::string& name, const std::string& path, float fontSize) { + ImGuiIO& io = ImGui::GetIO(); + std::shared_ptr base = GlobalCtx2::GetInstance()->GetResourceManager()->GetArchive(); + std::shared_ptr font = std::make_shared(); + base->LoadFile(path, false, font); + if (font->bIsLoaded) { + char* font_data = new char[font->dwBufferSize]; + memcpy(font_data, font->buffer.get(), font->dwBufferSize); + Fonts[name] = io.Fonts->AddFontFromMemoryTTF(font_data, font->dwBufferSize, fontSize); + } +} + +void Ship::GameOverlay::TextDraw(float x, float y, bool shadow, ImVec4 color, const char* fmt, ...) { + char buf[1024]; + va_list args; + va_start(args, fmt); + vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args); + buf[IM_ARRAYSIZE(buf) - 1] = 0; + va_end(args); + + ImGui::PushStyleColor(ImGuiCol_Text, color); + ImGui::PushFont(Fonts[this->CurrentFont]); + if (shadow) { + ImGui::SetCursorPos(ImVec2(x + 1, y + 1)); + ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(.0f, .0f, .0f, color.w)); + ImGui::Text(buf, args); + } + ImGui::PopStyleColor(); + ImGui::SetCursorPos(ImVec2(x, y)); + ImGui::Text(buf, args); + ImGui::PopFont(); + ImGui::PopStyleColor(); +} + +void Ship::GameOverlay::TextDrawNotification(float duration, bool shadow, const char* fmt, ...) { + char buf[1024]; + va_list args; + va_start(args, fmt); + vsnprintf(buf, IM_ARRAYSIZE(buf), fmt, args); + buf[IM_ARRAYSIZE(buf) - 1] = 0; + va_end(args); + this->RegisteredOverlays[StringHelper::Sprintf("NotificationID:%d%d", rand(), this->RegisteredOverlays.size())] = new Overlay({ OverlayType::NOTIFICATION, ImStrdup(buf), duration, duration }); + NeedsCleanup = true; +} + +void Ship::GameOverlay::CleanupNotifications() { + if(!NeedsCleanup) return; + for (auto it = this->RegisteredOverlays.begin(); it != this->RegisteredOverlays.end(); ) { + if (it->second->type == OverlayType::NOTIFICATION && it->second->duration <= 0.0f) { + it = this->RegisteredOverlays.erase(it); + } else { + ++it; + } + } + NeedsCleanup = false; +} + +float Ship::GameOverlay::GetScreenWidth() { + const ImGuiViewport* viewport = ImGui::GetMainViewport(); + return viewport->Size.x; +} + +float Ship::GameOverlay::GetScreenHeight() { + const ImGuiViewport* viewport = ImGui::GetMainViewport(); + return viewport->Size.y; +} + +float Ship::GameOverlay::GetStringWidth(const char* text) { + return CalculateTextSize(text).x; +} + +ImVec2 Ship::GameOverlay::CalculateTextSize(const char* text, const char* text_end, bool hide_text_after_double_hash, float wrap_width) { + ImGuiContext& g = *GImGui; + + const char* text_display_end; + if (hide_text_after_double_hash) + text_display_end = ImGui::FindRenderedTextEnd(text, text_end); // Hide anything after a '##' string + else + text_display_end = text_end; + + GameOverlay* overlay = SohImGui::overlay; + + ImFont* font = overlay->CurrentFont == "Default" ? g.Font : overlay->Fonts[overlay->CurrentFont]; + const float font_size = font->FontSize; + if (text == text_display_end) + return ImVec2(0.0f, font_size); + ImVec2 text_size = font->CalcTextSizeA(font_size, FLT_MAX, wrap_width, text, text_display_end, NULL); + + // Round + // FIXME: This has been here since Dec 2015 (7b0bf230) but down the line we want this out. + // FIXME: Investigate using ceilf or e.g. + // - https://git.musl-libc.org/cgit/musl/tree/src/math/ceilf.c + // - https://embarkstudios.github.io/rust-gpu/api/src/libm/math/ceilf.rs.html + text_size.x = IM_FLOOR(text_size.x + 0.99999f); + + return text_size; +} + +void Ship::GameOverlay::Init() { + this->LoadFont("Press Start 2P", "assets/ship_of_harkinian/fonts/PressStart2P-Regular.ttf", 12.0f); + this->LoadFont("Fipps", "assets/ship_of_harkinian/fonts/Fipps-Regular.otf", 32.0f); + const std::string DefaultFont = this->Fonts.begin()->first; + if(!this->Fonts.empty()) { + const std::string font = CVar_GetString("gOverlayFont", ImStrdup(DefaultFont.c_str())); + for (auto& [name, _] : this->Fonts) { + if (font.starts_with(name)) { + this->CurrentFont = name; + break; + } + this->CurrentFont = DefaultFont; + } + } + SohImGui::console->Commands["overlay"] = { OverlayCommand, "Draw an overlay using a cvar value" }; +} + +void Ship::GameOverlay::DrawSettings() { + ImGui::Text("Overlays Text Font"); + if (ImGui::BeginCombo("##TextFont", this->CurrentFont.c_str())) { + for (auto& [name, font] : this->Fonts) { + if (ImGui::Selectable(name.c_str(), name == this->CurrentFont)) { + this->CurrentFont = name; + CVar_SetString("gOverlayFont", ImStrdup(name.c_str())); + SohImGui::needs_save = true; + } + + } + ImGui::EndCombo(); + } +} + + +void Ship::GameOverlay::Draw() { + const ImGuiViewport* viewport = ImGui::GetMainViewport(); + + ImGui::SetNextWindowPos(viewport->Pos, ImGuiCond_Always); + ImGui::SetNextWindowSize(viewport->Size, ImGuiCond_Always); + ImGui::Begin("SoHOverlay", nullptr, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground | + ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoSavedSettings | ImGuiWindowFlags_NoInputs); + + this->CleanupNotifications(); + + float textY = 50; + float notY = 0; + + for (auto &[key, overlay] : this->RegisteredOverlays) { + + if (overlay->type == OverlayType::TEXT) { + const char* text = ImStrdup(overlay->value); + const CVar* var = CVar_Get(text); + ImVec4 color = ImVec4(1.0f, 1.0f, 1.0f, 1.0f); + + switch (var->type) { + case CVAR_TYPE_FLOAT: + this->TextDraw(30, textY, true, color, "%s %.2f", text, var->value.valueFloat); + break; + case CVAR_TYPE_S32: + this->TextDraw(30, textY, true, color, "%s %d", text, var->value.valueS32); + break; + case CVAR_TYPE_STRING: + this->TextDraw(30, textY, true, color, "%s %s", text, var->value.valueStr); + break; + } + + free((void*) text); + textY += 30; + } + + if (overlay->type == OverlayType::NOTIFICATION && overlay->duration > 0) { + const char* text = overlay->value; + const float duration = overlay->duration / overlay->fadeTime; + + const ImVec4 color = ImVec4(1.0f, 1.0f, 1.0f, duration); + const float textWidth = this->GetStringWidth(overlay->value); + + this->TextDraw(GetScreenWidth() - textWidth - 40, GetScreenHeight() - 40 - notY, true, color, text); + notY += 30; + overlay->duration -= .05f; + } + } + + ImGui::End(); +} + + +bool Ship::OverlayCommand(const std::vector& args) { + if (args.size() < 3) { + return CMD_FAILED; + } + + if (CVar_Get(args[2].c_str()) != nullptr) { + const char* key = args[2].c_str(); + GameOverlay* overlay = SohImGui::overlay; + if (args[1] == "add") { + if (!overlay->RegisteredOverlays.contains(key)) { + overlay->RegisteredOverlays[key] = new Overlay({ OverlayType::TEXT, ImStrdup(key), -1.0f }); + INFO("Added overlay: %s ", key); + } else { + ERROR("Overlay already exists: %s", key); + } + } else if (args[1] == "remove") { + if (overlay->RegisteredOverlays.contains(key)) { + overlay->RegisteredOverlays.erase(key); + INFO("Removed overlay: %s ", key); + } else { + ERROR("Overlay not found: %s ", key); + } + } + } else { + ERROR("CVar %s does not exist", args[2].c_str()); + } + + return CMD_SUCCESS; +} \ No newline at end of file diff --git a/libultraship/libultraship/GameOverlay.h b/libultraship/libultraship/GameOverlay.h new file mode 100644 index 000000000..605cd5898 --- /dev/null +++ b/libultraship/libultraship/GameOverlay.h @@ -0,0 +1,42 @@ +#pragma once +#include +#include + +#include "Lib/ImGui/imgui.h" +#include +#include + +enum class OverlayType { + TEXT, IMAGE, NOTIFICATION +}; + +struct Overlay { + OverlayType type; + const char* value; + float fadeTime; + float duration; +}; + +namespace Ship { + class GameOverlay { + public: + std::unordered_map RegisteredOverlays; + std::unordered_map Fonts; + std::string CurrentFont = "Default"; + void Init(); + void Draw(); + void DrawSettings(); + static float GetScreenWidth(); + static float GetScreenHeight(); + static float GetStringWidth(const char* text); + static ImVec2 CalculateTextSize(const char* text, const char* text_end = NULL, bool hide_text_after_double_hash = false, float wrap_width = -1.0f); + void TextDraw(float x, float y, bool shadow, ImVec4 color, const char* text, ...); + void TextDrawNotification(float duration, bool shadow, const char* fmt, ...); + private: + bool NeedsCleanup = false; + void CleanupNotifications(); + void LoadFont(const std::string& name, const std::string& path, float fontSize); + }; + + static bool OverlayCommand(const std::vector& args); +} diff --git a/libultraship/libultraship/GameSettings.cpp b/libultraship/libultraship/GameSettings.cpp index 8599367a7..0cd9aa2f4 100644 --- a/libultraship/libultraship/GameSettings.cpp +++ b/libultraship/libultraship/GameSettings.cpp @@ -1,19 +1,22 @@ #include "GameSettings.h" // Audio +#include +#include #include #include #include -#include #include "ConfigFile.h" #include "Cvar.h" #include "GlobalCtx2.h" #include "SohImGuiImpl.h" -#include "stox.h" #include "../../soh/include/z64audio.h" -#include #include "SohHooks.h" +#include "../../soh/soh/Enhancements/debugconsole.h" + +#include "Window.h" +#include "Lib/Fast3D/gfx_rendering_api.h" #define ABS(var) var < 0 ? -(var) : var @@ -22,112 +25,46 @@ using namespace Ship; namespace Game { bool DeSyncAudio = false; - SoHConfigType Settings; - const std::string ConfSection = DEBUG_SECTION; - const std::string AudioSection = AUDIO_SECTION; - const std::string ControllerSection = CONTROLLER_SECTION; - const std::string EnhancementSection = ENHANCEMENTS_SECTION; void UpdateAudio() { - Audio_SetGameVolume(SEQ_BGM_MAIN, Settings.audio.music_main); - Audio_SetGameVolume(SEQ_BGM_SUB, Settings.audio.music_sub); - Audio_SetGameVolume(SEQ_FANFARE, Settings.audio.fanfare); - Audio_SetGameVolume(SEQ_SFX, Settings.audio.sfx); + Audio_SetGameVolume(SEQ_BGM_MAIN, CVar_GetFloat("gMainMusicVolume", 1)); + Audio_SetGameVolume(SEQ_BGM_SUB, CVar_GetFloat("gSubMusicVolume", 1)); + Audio_SetGameVolume(SEQ_FANFARE, CVar_GetFloat("gSFXMusicVolume", 1)); + Audio_SetGameVolume(SEQ_SFX, CVar_GetFloat("gFanfareVolume", 1)); } - void LoadSettings() { - + void LoadPadSettings() { const std::shared_ptr pConf = GlobalCtx2::GetInstance()->GetConfig(); ConfigFile& Conf = *pConf; - // Debug - SohImGui::console->opened = stob(Conf[ConfSection]["console"]); - Settings.debug.menu_bar = stob(Conf[ConfSection]["menu_bar"]); - Settings.debug.soh = stob(Conf[ConfSection]["soh_debug"]); + for (const auto& [i, controllers] : Ship::Window::Controllers) { + for (const auto& controller : controllers) { + if (auto padConfSection = controller->GetPadConfSection()) { + } + } + } + } - Settings.debug.n64mode = stob(Conf[ConfSection]["n64_mode"]); - - // Enhancements - Settings.enhancements.fast_text = stob(Conf[EnhancementSection]["fast_text"]); - CVar_SetS32(const_cast("gFastText"), Settings.enhancements.fast_text); - - Settings.enhancements.disable_lod = stob(Conf[EnhancementSection]["disable_lod"]); - CVar_SetS32(const_cast("gDisableLOD"), Settings.enhancements.disable_lod); - - Settings.enhancements.animated_pause_menu = stob(Conf[EnhancementSection]["animated_pause_menu"]); - CVar_SetS32(const_cast("gPauseLiveLink"), Settings.enhancements.animated_pause_menu); - - Settings.enhancements.debug_mode = stob(Conf[EnhancementSection]["debug_mode"]); - CVar_SetS32(const_cast("gDebugEnabled"), Settings.enhancements.debug_mode); - - Settings.audio.master = Ship::stof(Conf[AudioSection]["master"]); - CVar_SetFloat(const_cast("gGameMasterVolume"), Settings.audio.master); - - Settings.audio.music_main = Ship::stof(Conf[AudioSection]["music_main"]); - CVar_SetFloat(const_cast("gMainMusicVolume"), Settings.audio.music_main); - - Settings.audio.music_sub = Ship::stof(Conf[AudioSection]["music_sub"]); - CVar_SetFloat(const_cast("gSubMusicVolume"), Settings.audio.music_sub); - - Settings.audio.sfx = Ship::stof(Conf[AudioSection]["sfx"]); - CVar_SetFloat(const_cast("gSFXMusicVolume"), Settings.audio.sfx); - - Settings.audio.fanfare = Ship::stof(Conf[AudioSection]["fanfare"]); - CVar_SetFloat(const_cast("gFanfareVolume"), Settings.audio.fanfare); - - Settings.controller.gyro_sensitivity = Ship::stof(Conf[ControllerSection]["gyro_sensitivity"]); - CVar_SetFloat(const_cast("gGyroSensitivity"), Settings.controller.gyro_sensitivity); - - Settings.controller.rumble_strength = Ship::stof(Conf[ControllerSection]["rumble_strength"]); - CVar_SetFloat(const_cast("gRumbleStrength"), Settings.controller.rumble_strength); - - Settings.controller.input_scale = Ship::stof(Conf[ControllerSection]["input_scale"]); - CVar_SetFloat(const_cast("gInputScale"), Settings.controller.input_scale); - - Settings.controller.input_enabled = stob(Conf[ControllerSection]["input_enabled"]); - CVar_SetS32(const_cast("gInputEnabled"), Settings.controller.input_enabled); - - UpdateAudio(); + void LoadSettings() { + DebugConsole_LoadCVars(); } void SaveSettings() { - const std::shared_ptr pConf = GlobalCtx2::GetInstance()->GetConfig(); - ConfigFile& Conf = *pConf; - - // Debug - Conf[ConfSection]["console"] = std::to_string(SohImGui::console->opened); - Conf[ConfSection]["menu_bar"] = std::to_string(Settings.debug.menu_bar); - Conf[ConfSection]["soh_debug"] = std::to_string(Settings.debug.soh); - Conf[ConfSection]["n64_mode"] = std::to_string(Settings.debug.n64mode); - - // Audio - Conf[AudioSection]["master"] = std::to_string(Settings.audio.master); - Conf[AudioSection]["music_main"] = std::to_string(Settings.audio.music_main); - Conf[AudioSection]["music_sub"] = std::to_string(Settings.audio.music_sub); - Conf[AudioSection]["sfx"] = std::to_string(Settings.audio.sfx); - Conf[AudioSection]["fanfare"] = std::to_string(Settings.audio.fanfare); - - // Enhancements - Conf[EnhancementSection]["fast_text"] = std::to_string(Settings.enhancements.fast_text); - Conf[EnhancementSection]["disable_lod"] = std::to_string(Settings.enhancements.disable_lod); - Conf[EnhancementSection]["animated_pause_menu"] = std::to_string(Settings.enhancements.animated_pause_menu); - Conf[EnhancementSection]["debug_mode"] = std::to_string(Settings.enhancements.debug_mode); - - Conf[ControllerSection]["gyro_sensitivity"] = std::to_string(Settings.controller.gyro_sensitivity); - Conf[ControllerSection]["rumble_strength"] = std::to_string(Settings.controller.rumble_strength); - Conf[ControllerSection]["input_scale"] = std::to_string(Settings.controller.input_scale); - Conf[ControllerSection]["input_enabled"] = std::to_string(Settings.controller.input_enabled); - - Conf.Save(); + DebugConsole_SaveCVars(); } void InitSettings() { ModInternal::registerHookListener({ AUDIO_INIT, [](HookEvent ev) { UpdateAudio(); }}); + ModInternal::registerHookListener({ GFX_INIT, [](HookEvent ev) { + gfx_get_current_rendering_api()->set_texture_filter((FilteringMode) CVar_GetS32("gTextureFilter", THREE_POINT)); + SohImGui::console->opened = CVar_GetS32("gConsoleEnabled", 0); + UpdateAudio(); + }}); } void SetSeqPlayerVolume(SeqPlayers playerId, float volume) { Audio_SetGameVolume(playerId, volume); } -} \ No newline at end of file +} diff --git a/libultraship/libultraship/GameSettings.h b/libultraship/libultraship/GameSettings.h index 35d948d89..0a9aa0ee6 100644 --- a/libultraship/libultraship/GameSettings.h +++ b/libultraship/libultraship/GameSettings.h @@ -1,39 +1,5 @@ #pragma once -struct SoHConfigType { - // Debug - struct { - bool soh = false; - bool n64mode = false; - bool menu_bar = false; - bool soh_sink = true; - } debug; - - // Audio - struct { - float master = 1.0f; - float music_main = 1.0f; - float fanfare = 1.0f; - float sfx = 1.0f; - float music_sub = 1.0f; - } audio; - - // Enhancements - struct { - bool fast_text = false; - bool disable_lod = false; - bool animated_pause_menu = false; - bool debug_mode = false; - } enhancements; - - struct { - float gyro_sensitivity = 1.0f; - float rumble_strength = 1.0f; - float input_scale = 1.0f; - bool input_enabled = false; - } controller; -}; - enum SeqPlayers { /* 0 */ SEQ_BGM_MAIN, /* 1 */ SEQ_FANFARE, @@ -42,15 +8,10 @@ enum SeqPlayers { /* 4 */ SEQ_MAX }; -#define DEBUG_SECTION "DEBUG SETTINGS" -#define AUDIO_SECTION "AUDIO SETTINGS" -#define CONTROLLER_SECTION "CONTROLLER SECTION" -#define ENHANCEMENTS_SECTION "ENHANCEMENT SETTINGS" - namespace Game { - extern SoHConfigType Settings; void InitSettings(); void LoadSettings(); + void LoadPadSettings(); void SaveSettings(); void SetSeqPlayerVolume(SeqPlayers playerId, float volume); } diff --git a/libultraship/libultraship/GameVersions.h b/libultraship/libultraship/GameVersions.h new file mode 100644 index 000000000..8d3753b21 --- /dev/null +++ b/libultraship/libultraship/GameVersions.h @@ -0,0 +1,25 @@ +#ifndef GAME_VERSION_H +#define GAME_VERSION_H + +#pragma once + +#define OOT_NTSC_10 0xEC7011B7 +#define OOT_NTSC_11 0xD43DA81F +#define OOT_NTSC_12 0x693BA2AE +#define OOT_PAL_10 0xB044B569 +#define OOT_PAL_11 0xB2055FBD +#define OOT_NTSC_JP_GC_CE 0xF7F52DB8 +#define OOT_NTSC_JP_GC 0xF611F4BA +#define OOT_NTSC_US_GC 0xF3DD35BA +#define OOT_PAL_GC 0x09465AC3 +#define OOT_NTSC_JP_MQ 0xF43B45BA +#define OOT_NTSC_US_MQ 0xF034001A +#define OOT_PAL_MQ 0x1D4136F3 +#define OOT_PAL_GC_DBG1 0x871E1C92 // 03-21-2002 build +#define OOT_PAL_GC_DBG2 0x87121EFE // 03-13-2002 build +#define OOT_PAL_GC_MQ_DBG 0x917D18F6 +#define OOT_IQUE_TW 0x3D81FB3E +#define OOT_IQUE_CN 0xB1E1E07B +#define OOT_UNKNOWN 0xFFFFFFFF + +#endif diff --git a/libultraship/libultraship/GlobalCtx2.cpp b/libultraship/libultraship/GlobalCtx2.cpp index dd8125bcc..5ce59f5ab 100644 --- a/libultraship/libultraship/GlobalCtx2.cpp +++ b/libultraship/libultraship/GlobalCtx2.cpp @@ -30,7 +30,7 @@ namespace Ship { } GlobalCtx2::GlobalCtx2(const std::string& Name) : Name(Name), MainPath(""), PatchesPath("") { - + } GlobalCtx2::~GlobalCtx2() { @@ -54,7 +54,11 @@ namespace Ship { if (!ResMan->DidLoadSuccessfully()) { +#ifdef _WIN32 MessageBox(NULL, L"Main OTR file not found!", L"Uh oh", MB_OK); +#else + SPDLOG_ERROR("Main OTR file not found!"); +#endif exit(1); } INSTANCE = new ModManager(ResMan); diff --git a/libultraship/libultraship/GlobalCtx2.h b/libultraship/libultraship/GlobalCtx2.h index a10421ec0..1ed512347 100644 --- a/libultraship/libultraship/GlobalCtx2.h +++ b/libultraship/libultraship/GlobalCtx2.h @@ -1,3 +1,6 @@ +#ifndef GLOBAL_CTX_2 +#define GLOBAL_CTX_2 + #pragma once #ifdef __cplusplus @@ -38,4 +41,6 @@ namespace Ship { std::string PatchesPath; }; } -#endif \ No newline at end of file +#endif + +#endif diff --git a/libultraship/libultraship/KeyboardController.cpp b/libultraship/libultraship/KeyboardController.cpp index 6f78a1678..13014c6a7 100644 --- a/libultraship/libultraship/KeyboardController.cpp +++ b/libultraship/libultraship/KeyboardController.cpp @@ -53,4 +53,4 @@ namespace Ship { std::string KeyboardController::GetBindingConfSection() { return GetControllerType() + " CONTROLLER BINDING " + std::to_string(GetControllerNumber() + 1); } -} \ No newline at end of file +} diff --git a/libultraship/libultraship/KeyboardController.h b/libultraship/libultraship/KeyboardController.h index ab0f98e64..f6c109ca7 100644 --- a/libultraship/libultraship/KeyboardController.h +++ b/libultraship/libultraship/KeyboardController.h @@ -10,11 +10,16 @@ namespace Ship { void ReadFromSource(); void WriteToSource(ControllerCallback* controller); + bool Connected() const { return true; } + bool CanRumble() const { return false; } bool PressButton(int32_t dwScancode); bool ReleaseButton(int32_t dwScancode); void ReleaseAllButtons(); + bool HasPadConf() const { return false; } + std::optional GetPadConfSection() { return {}; } + protected: std::string GetControllerType(); std::string GetConfSection(); diff --git a/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/gbi.h b/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/gbi.h index 843cb3cd6..a9e4f035e 100644 --- a/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/gbi.h +++ b/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/gbi.h @@ -170,6 +170,12 @@ #define G_TEXRECT_WIDE 0x37 #define G_FILLWIDERECT 0x38 +/* GFX Effects */ + +// RDP Cmd +#define G_SETGRAYSCALE 0x39 +#define G_SETINTENSITY 0x40 + /* * The following commands are the "generated" RDP commands; the user * never sees them, the RSP microcode generates them. @@ -998,7 +1004,7 @@ #define G_DL_PUSH 0x00 #define G_DL_NOPUSH 0x01 -#if _MSC_VER +#if defined(_MSC_VER) || defined(__GNUC__) #define _LANGUAGE_C #endif @@ -2821,6 +2827,14 @@ _DW({ \ _g->words.w1 = 0; \ } +#define gsSPGrayscale(pkt, state) \ +{ \ + Gfx *_g = (Gfx *)(pkt); \ + \ + _g->words.w0 = _SHIFTL(G_SETGRAYSCALE, 24, 8); \ + _g->words.w1 = state; \ +} + #ifdef F3DEX_GBI_2 /* * One gSPGeometryMode(pkt,c,s) GBI is equal to these two GBIs. @@ -3118,7 +3132,7 @@ _DW({ \ #endif */ -#ifdef _MSC_VER +#if defined(_MSC_VER) #define CALL_2(A,B) A B #define CALL_3(A,B,C) A B C @@ -3129,12 +3143,12 @@ _DW({ \ #define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b) #endif -#if _MSC_VER +#if defined(_MSC_VER) || defined(__GNUC__) #define CALL_2(A,B) A B #define CALL_3(A,B,C) A B C -#define gsDPSetCombineMode(a, b) CALL_2(gsDPSetCombineLERP, (a, b)) - //#define gsDPSetCombineMode(a, b) _SHIFTL(0, 24, 8), 0 +// #define gsDPSetCombineMode(a, b) CALL_2(gsDPSetCombineLERP, (a, b)) +// #define gsDPSetCombineMode(a, b) _SHIFTL(0, 24, 8), 0 #else #define gsDPSetCombineMode(a, b) gsDPSetCombineLERP(a, b) #endif @@ -3161,6 +3175,8 @@ _DW({ \ (_SHIFTL(r, 24, 8) | _SHIFTL(g, 16, 8) | \ _SHIFTL(b, 8, 8) | _SHIFTL(a, 0, 8))) +#define gsDPSetGrayscaleColor(pkt, r, g, b, lerp) \ + DPRGBColor(pkt, G_SETINTENSITY, r, g, b, lerp) #define gDPSetEnvColor(pkt, r, g, b, a) \ DPRGBColor(pkt, G_SETENVCOLOR, r,g,b,a) #define gsDPSetEnvColor(r, g, b, a) \ @@ -3177,7 +3193,6 @@ _DW({ \ gDPSetColor(pkt, G_SETFILLCOLOR, (d)) #define gsDPSetFillColor(d) \ gsDPSetColor(G_SETFILLCOLOR, (d)) - #define gDPSetPrimDepth(pkt, z, dz) \ gDPSetColor(pkt, G_SETPRIMDEPTH, \ _SHIFTL(z, 16, 16) | _SHIFTL(dz, 0, 16)) @@ -4223,6 +4238,17 @@ _DW({ \ gDPPipeSync(pkt); \ }) +#define gDPLoadTLUT_pal128(pkt, pal, dram) \ +_DW({ \ + gDPSetTextureImage(pkt, G_IM_FMT_RGBA, G_IM_SIZ_16b, 1, dram); \ + gDPTileSync(pkt); \ + gDPSetTile(pkt, 0, 0, 0, 256 + ((pal)&1)*128, \ + G_TX_LOADTILE, 0 , 0, 0, 0, 0, 0, 0); \ + gDPLoadSync(pkt); \ + gDPLoadTLUTCmd(pkt, G_TX_LOADTILE, 127); \ + gDPPipeSync(pkt); \ +}) + #else /* **** WORKAROUND hardware 1 load_tlut bug ****** */ #define gDPLoadTLUT_pal256(pkt, dram) \ @@ -4549,6 +4575,20 @@ _DW({ \ _g2->words.w1 = (_SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16)); \ } +# define gsSPWideTextureRectangle(xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ +{{ \ + (_SHIFTL(G_TEXRECT_WIDE, 24, 8) | _SHIFTL((xh), 0, 24)), \ + _SHIFTL((yh), 0, 24), \ +}}, \ +{{ \ + (_SHIFTL((tile), 24, 3) | _SHIFTL((xl), 0, 24)), \ + _SHIFTL((yl), 0, 24), \ +}}, \ +{{ \ + _SHIFTL(s, 16, 16) | _SHIFTL(t, 0, 16), \ + _SHIFTL(dsdx, 16, 16) | _SHIFTL(dtdy, 0, 16) \ +}} + /* like gSPTextureRectangle but accepts negative position arguments */ #define gSPScisTextureRectangle(pkt, xl, yl, xh, yh, tile, s, t, dsdx, dtdy) \ _DW({ \ diff --git a/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/mbi.h b/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/mbi.h index fd6042ff5..988c309df 100644 --- a/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/mbi.h +++ b/libultraship/libultraship/Lib/Fast3D/U64/PR/ultra64/mbi.h @@ -33,6 +33,7 @@ #define G_OFF (0) #include +#include "types.h" #include "gbi.h" #include "abi.h" diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_cc.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_cc.cpp index 25ae8b324..c92a05b8b 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_cc.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_cc.cpp @@ -16,6 +16,7 @@ void gfx_cc_get_features(uint64_t shader_id0, uint32_t shader_id1, struct CCFeat cc_features->opt_2cyc = (shader_id1 & SHADER_OPT_2CYC) != 0; cc_features->opt_alpha_threshold = (shader_id1 & SHADER_OPT_ALPHA_THRESHOLD) != 0; cc_features->opt_invisible = (shader_id1 & SHADER_OPT_INVISIBLE) != 0; + cc_features->opt_grayscale = (shader_id1 & SHADER_OPT_GRAYSCALE) != 0; cc_features->clamp[0][0] = (shader_id1 & SHADER_OPT_TEXEL0_CLAMP_S); cc_features->clamp[0][1] = (shader_id1 & SHADER_OPT_TEXEL0_CLAMP_T); diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_cc.h b/libultraship/libultraship/Lib/Fast3D/gfx_cc.h index 7bf415f84..f0a9f2eca 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_cc.h +++ b/libultraship/libultraship/Lib/Fast3D/gfx_cc.h @@ -39,10 +39,11 @@ enum { #define SHADER_OPT_2CYC (1 << 4) #define SHADER_OPT_ALPHA_THRESHOLD (1 << 5) #define SHADER_OPT_INVISIBLE (1 << 6) -#define SHADER_OPT_TEXEL0_CLAMP_S (1 << 7) -#define SHADER_OPT_TEXEL0_CLAMP_T (1 << 8) -#define SHADER_OPT_TEXEL1_CLAMP_S (1 << 9) -#define SHADER_OPT_TEXEL1_CLAMP_T (1 << 10) +#define SHADER_OPT_GRAYSCALE (1 << 7) +#define SHADER_OPT_TEXEL0_CLAMP_S (1 << 8) +#define SHADER_OPT_TEXEL0_CLAMP_T (1 << 9) +#define SHADER_OPT_TEXEL1_CLAMP_S (1 << 10) +#define SHADER_OPT_TEXEL1_CLAMP_T (1 << 11) #define CC_SHADER_OPT_POS 56 struct CCFeatures { @@ -54,6 +55,7 @@ struct CCFeatures { bool opt_2cyc; bool opt_alpha_threshold; bool opt_invisible; + bool opt_grayscale; bool used_textures[2]; bool clamp[2][2]; int num_inputs; diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_direct3d11.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_direct3d11.cpp index c989290c6..4664a0faa 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_direct3d11.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_direct3d11.cpp @@ -15,11 +15,9 @@ #ifndef _LANGUAGE_C #define _LANGUAGE_C #endif -#include +#include "PR/ultra64/gbi.h" -#include "gfx_cc.h" #include "gfx_window_manager_api.h" -#include "gfx_rendering_api.h" #include "gfx_direct3d_common.h" #define DECLARE_GFX_DXGI_FUNCTIONS @@ -28,7 +26,9 @@ #include "gfx_screen_config.h" #include "../../SohImGuiImpl.h" -#define THREE_POINT_FILTERING 0 +#include "gfx_cc.h" +#include "gfx_rendering_api.h" +#include "gfx_pc.h" #define DEBUG_D3D 0 using namespace Microsoft::WRL; // For ComPtr @@ -37,9 +37,8 @@ namespace { struct PerFrameCB { uint32_t noise_frame; - float noise_scale_x; - float noise_scale_y; - uint32_t padding; + float noise_scale; + uint32_t padding[2]; // constant buffers must be multiples of 16 bytes in size }; struct PerDrawCB { @@ -51,12 +50,12 @@ struct PerDrawCB { } textures[2]; }; -struct CoordCB { - float x, y; - float padding[2]; // structure size must be multiple of 16 +struct Coord { + int x, y; }; struct TextureData { + ComPtr texture; ComPtr resource_view; ComPtr sampler_state; uint32_t width; @@ -64,10 +63,13 @@ struct TextureData { bool linear_filtering; }; -struct FramebufferData { +struct Framebuffer { ComPtr render_target_view; ComPtr depth_stencil_view; + ComPtr depth_stencil_srv; uint32_t texture_id; + bool has_depth_buffer; + uint32_t msaa_level; }; struct ShaderProgramD3D11 { @@ -86,39 +88,35 @@ struct ShaderProgramD3D11 { static struct { HMODULE d3d11_module; PFN_D3D11_CREATE_DEVICE D3D11CreateDevice; - + HMODULE d3dcompiler_module; pD3DCompile D3DCompile; - + D3D_FEATURE_LEVEL feature_level; - + uint32_t msaa_num_quality_levels[D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT]; + ComPtr device; ComPtr swap_chain; ComPtr context; - ComPtr backbuffer_view; - ComPtr depth_stencil_view; - ComPtr depth_stencil_srv; ComPtr rasterizer_state; ComPtr depth_stencil_state; ComPtr vertex_buffer; ComPtr per_frame_cb; ComPtr per_draw_cb; - ComPtr depth_stencil_texture; - ComPtr depth_stencil_copy_texture; ComPtr coord_buffer; + ComPtr coord_buffer_srv; ComPtr depth_value_output_buffer; ComPtr depth_value_output_buffer_copy; ComPtr depth_value_output_uav; - ComPtr depth_value_sampler; ComPtr compute_shader; - bool copied_depth_buffer; + ComPtr compute_shader_msaa; + ComPtr compute_shader_msaa_blob; + size_t coord_buffer_size; #if DEBUG_D3D ComPtr debug; #endif - DXGI_SAMPLE_DESC sample_description; - PerFrameCB per_frame_cb_data; PerDrawCB per_draw_cb_data; @@ -128,14 +126,16 @@ static struct { int current_tile; uint32_t current_texture_ids[2]; - std::vector framebuffers; + std::vector framebuffers; // Current state struct ShaderProgramD3D11 *shader_program; - uint32_t current_width, current_height; + //uint32_t current_width, current_height; uint32_t render_target_height; + int current_framebuffer; + FilteringMode current_filter_mode = NONE; int8_t depth_test; int8_t depth_mask; @@ -156,7 +156,9 @@ static struct { static LARGE_INTEGER last_time, accumulated_time, frequency; -void create_depth_stencil_objects(uint32_t width, uint32_t height, ID3D11Texture2D **texture, ID3D11DepthStencilView **view, ID3D11ShaderResourceView **srv) { +int gfx_d3d11_create_framebuffer(void); + +static void create_depth_stencil_objects(uint32_t width, uint32_t height, uint32_t msaa_count, ID3D11DepthStencilView **view, ID3D11ShaderResourceView **srv) { D3D11_TEXTURE2D_DESC texture_desc; texture_desc.Width = width; texture_desc.Height = height; @@ -164,93 +166,42 @@ void create_depth_stencil_objects(uint32_t width, uint32_t height, ID3D11Texture texture_desc.ArraySize = 1; texture_desc.Format = d3d.feature_level >= D3D_FEATURE_LEVEL_10_0 ? DXGI_FORMAT_R32_TYPELESS : DXGI_FORMAT_R24G8_TYPELESS; - texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Count = msaa_count; texture_desc.SampleDesc.Quality = 0; texture_desc.Usage = D3D11_USAGE_DEFAULT; texture_desc.BindFlags = D3D11_BIND_DEPTH_STENCIL | (srv != nullptr ? D3D11_BIND_SHADER_RESOURCE : 0); texture_desc.CPUAccessFlags = 0; texture_desc.MiscFlags = 0; - ThrowIfFailed(d3d.device->CreateTexture2D(&texture_desc, nullptr, texture)); + ComPtr texture; + ThrowIfFailed(d3d.device->CreateTexture2D(&texture_desc, nullptr, texture.GetAddressOf())); D3D11_DEPTH_STENCIL_VIEW_DESC view_desc; view_desc.Format = d3d.feature_level >= D3D_FEATURE_LEVEL_10_0 ? DXGI_FORMAT_D32_FLOAT : DXGI_FORMAT_D24_UNORM_S8_UINT; - view_desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; view_desc.Flags = 0; - view_desc.Texture2D.MipSlice = 0; + if (msaa_count > 1) { + view_desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DMS; + view_desc.Texture2DMS.UnusedField_NothingToDefine = 0; + } else { + view_desc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + view_desc.Texture2D.MipSlice = 0; + } - ThrowIfFailed(d3d.device->CreateDepthStencilView(*texture, &view_desc, view)); + ThrowIfFailed(d3d.device->CreateDepthStencilView(texture.Get(), &view_desc, view)); if (srv != nullptr) { D3D11_SHADER_RESOURCE_VIEW_DESC srv_desc; srv_desc.Format = d3d.feature_level >= D3D_FEATURE_LEVEL_10_0 ? DXGI_FORMAT_R32_FLOAT : DXGI_FORMAT_R24_UNORM_X8_TYPELESS; - srv_desc.ViewDimension = D3D11_SRV_DIMENSION_TEXTURE2D; + srv_desc.ViewDimension = msaa_count > 1 ? D3D11_SRV_DIMENSION_TEXTURE2DMS : D3D11_SRV_DIMENSION_TEXTURE2D; srv_desc.Texture2D.MostDetailedMip = 0; srv_desc.Texture2D.MipLevels = -1; - ThrowIfFailed(d3d.device->CreateShaderResourceView(*texture, &srv_desc, srv)); + ThrowIfFailed(d3d.device->CreateShaderResourceView(texture.Get(), &srv_desc, srv)); } } -static void create_render_target_views(bool is_resize) { - DXGI_SWAP_CHAIN_DESC1 desc1; - - if (is_resize) { - // Release previous stuff (if any) - - d3d.backbuffer_view.Reset(); - d3d.depth_stencil_texture.Reset(); - d3d.depth_stencil_view.Reset(); - d3d.depth_stencil_srv.Reset(); - d3d.depth_stencil_copy_texture.Reset(); - - // Resize swap chain buffers - - ThrowIfFailed(d3d.swap_chain->GetDesc1(&desc1)); - ThrowIfFailed(d3d.swap_chain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, desc1.Flags), - gfx_dxgi_get_h_wnd(), "Failed to resize IDXGISwapChain buffers."); - } - - // Get new size - - ThrowIfFailed(d3d.swap_chain->GetDesc1(&desc1)); - - // Create back buffer - - ComPtr backbuffer_texture; - ThrowIfFailed(d3d.swap_chain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID *) backbuffer_texture.GetAddressOf()), - gfx_dxgi_get_h_wnd(), "Failed to get backbuffer from IDXGISwapChain."); - - ThrowIfFailed(d3d.device->CreateRenderTargetView(backbuffer_texture.Get(), nullptr, d3d.backbuffer_view.GetAddressOf()), - gfx_dxgi_get_h_wnd(), "Failed to create render target view."); - - // Create depth buffer - create_depth_stencil_objects(desc1.Width, desc1.Height, d3d.depth_stencil_texture.GetAddressOf(), d3d.depth_stencil_view.GetAddressOf(), d3d.depth_stencil_srv.GetAddressOf()); - - // Create texture that can be used to retrieve depth value - - D3D11_TEXTURE2D_DESC depth_texture = {}; - depth_texture.Width = desc1.Width; - depth_texture.Height = desc1.Height; - depth_texture.MipLevels = 1; - depth_texture.ArraySize = 1; - depth_texture.Format = DXGI_FORMAT_D32_FLOAT; - depth_texture.SampleDesc.Count = 1; - depth_texture.SampleDesc.Quality = 0; - depth_texture.Usage = D3D11_USAGE_STAGING; - depth_texture.BindFlags = 0; - depth_texture.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - depth_texture.MiscFlags = 0; - ThrowIfFailed(d3d.device->CreateTexture2D(&depth_texture, nullptr, d3d.depth_stencil_copy_texture.GetAddressOf())); - - // Save resolution - - d3d.current_width = desc1.Width; - d3d.current_height = desc1.Height; -} - static void gfx_d3d11_init(void) { // Load d3d11.dll d3d.d3d11_module = LoadLibraryW(L"d3d11.dll"); @@ -300,11 +251,6 @@ static void gfx_d3d11_init(void) { } }); - // Sample description to be used in back buffer and depth buffer - - d3d.sample_description.Count = 1; - d3d.sample_description.Quality = 0; - // Create the swap chain d3d.swap_chain = gfx_dxgi_create_swap_chain(d3d.device.Get()); @@ -315,9 +261,19 @@ static void gfx_d3d11_init(void) { gfx_dxgi_get_h_wnd(), "Failed to get ID3D11Debug device."); #endif - // Create views + // Create the default framebuffer which represents the window + Framebuffer& fb = d3d.framebuffers[gfx_d3d11_create_framebuffer()]; - create_render_target_views(false); + // Check the size of the window + DXGI_SWAP_CHAIN_DESC1 swap_chain_desc; + ThrowIfFailed(d3d.swap_chain->GetDesc1(&swap_chain_desc)); + d3d.textures[fb.texture_id].width = swap_chain_desc.Width; + d3d.textures[fb.texture_id].height = swap_chain_desc.Height; + fb.msaa_level = 1; + + for (uint32_t sample_count = 1; sample_count <= D3D11_MAX_MULTISAMPLE_SAMPLE_COUNT; sample_count++) { + ThrowIfFailed(d3d.device->CheckMultisampleQualityLevels(DXGI_FORMAT_R8G8B8A8_UNORM, sample_count, &d3d.msaa_num_quality_levels[sample_count - 1])); + } // Create main vertex buffer @@ -364,61 +320,30 @@ static void gfx_d3d11_init(void) { // Create compute shader that can be used to retrieve depth buffer values - D3D11_BUFFER_DESC coord_cb_desc; - coord_cb_desc.Usage = D3D11_USAGE_DYNAMIC; - coord_cb_desc.ByteWidth = sizeof(CoordCB); - coord_cb_desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - coord_cb_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - coord_cb_desc.MiscFlags = 0; - coord_cb_desc.StructureByteStride = 0; - - ThrowIfFailed(d3d.device->CreateBuffer(&coord_cb_desc, nullptr, d3d.coord_buffer.GetAddressOf())); - - D3D11_SAMPLER_DESC sampler_desc = {}; - sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; - sampler_desc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; - sampler_desc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; - sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; - sampler_desc.MinLOD = 0; - sampler_desc.MaxLOD = D3D11_FLOAT32_MAX; - ThrowIfFailed(d3d.device->CreateSamplerState(&sampler_desc, d3d.depth_value_sampler.GetAddressOf())); - - D3D11_BUFFER_DESC output_buffer_desc; - output_buffer_desc.Usage = D3D11_USAGE_DEFAULT; - output_buffer_desc.ByteWidth = sizeof(float); - output_buffer_desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS; - output_buffer_desc.CPUAccessFlags = 0; - output_buffer_desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; - output_buffer_desc.StructureByteStride = sizeof(float); - ThrowIfFailed(d3d.device->CreateBuffer(&output_buffer_desc, nullptr, d3d.depth_value_output_buffer.GetAddressOf())); - - D3D11_UNORDERED_ACCESS_VIEW_DESC output_buffer_uav_desc; - output_buffer_uav_desc.Format = DXGI_FORMAT_UNKNOWN; - output_buffer_uav_desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; - output_buffer_uav_desc.Buffer.FirstElement = 0; - output_buffer_uav_desc.Buffer.NumElements = 1; - output_buffer_uav_desc.Buffer.Flags = 0; - ThrowIfFailed(d3d.device->CreateUnorderedAccessView(d3d.depth_value_output_buffer.Get(), &output_buffer_uav_desc, d3d.depth_value_output_uav.GetAddressOf())); - - output_buffer_desc.Usage = D3D11_USAGE_STAGING; - output_buffer_desc.BindFlags = 0; - output_buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; - ThrowIfFailed(d3d.device->CreateBuffer(&output_buffer_desc, nullptr, d3d.depth_value_output_buffer_copy.GetAddressOf())); - const char* shader_source = R"( sampler my_sampler : register(s0); Texture2D tex : register(t0); -cbuffer coordCB : register(b0) { - float2 coord; -} - +StructuredBuffer coord : register(t1); RWStructuredBuffer output : register(u0); [numthreads(1, 1, 1)] void CSMain(uint3 DTid : SV_DispatchThreadID) { - output[0] = tex.SampleLevel(my_sampler, coord, 0); + output[DTid.x] = tex.Load(int3(coord[DTid.x], 0)); } )"; + + const char* shader_source_msaa = R"( +sampler my_sampler : register(s0); +Texture2DMS tex : register(t0); +StructuredBuffer coord : register(t1); +RWStructuredBuffer output : register(u0); + +[numthreads(1, 1, 1)] +void CSMain(uint3 DTid : SV_DispatchThreadID) { + output[DTid.x] = tex.Load(coord[DTid.x], 0); +} +)"; + #if DEBUG_D3D UINT compile_flags = D3DCOMPILE_DEBUG; #else @@ -426,7 +351,9 @@ void CSMain(uint3 DTid : SV_DispatchThreadID) { #endif ComPtr cs, error_blob; - HRESULT hr = d3d.D3DCompile(shader_source, strlen(shader_source), nullptr, nullptr, nullptr, "CSMain", "cs_4_0", compile_flags, 0, cs.GetAddressOf(), error_blob.GetAddressOf()); + HRESULT hr; + + hr = d3d.D3DCompile(shader_source, strlen(shader_source), nullptr, nullptr, nullptr, "CSMain", "cs_4_0", compile_flags, 0, cs.GetAddressOf(), error_blob.GetAddressOf()); if (FAILED(hr)) { char* err = (char*)error_blob->GetBufferPointer(); @@ -436,6 +363,14 @@ void CSMain(uint3 DTid : SV_DispatchThreadID) { ThrowIfFailed(d3d.device->CreateComputeShader(cs->GetBufferPointer(), cs->GetBufferSize(), nullptr, d3d.compute_shader.GetAddressOf())); + hr = d3d.D3DCompile(shader_source_msaa, strlen(shader_source_msaa), nullptr, nullptr, nullptr, "CSMain", "cs_4_1", compile_flags, 0, d3d.compute_shader_msaa_blob.GetAddressOf(), error_blob.ReleaseAndGetAddressOf()); + + if (FAILED(hr)) { + char* err = (char*)error_blob->GetBufferPointer(); + MessageBoxA(gfx_dxgi_get_h_wnd(), err, "Error", MB_OK | MB_ICONERROR); + throw hr; + } + // Create ImGui SohImGui::WindowImpl window_impl; @@ -445,8 +380,8 @@ void CSMain(uint3 DTid : SV_DispatchThreadID) { } -static bool gfx_d3d11_z_is_from_0_to_1(void) { - return true; +static struct GfxClipParameters gfx_d3d11_get_clip_parameters(void) { + return { true, false }; } static void gfx_d3d11_unload_shader(struct ShaderProgram *old_prg) { @@ -463,7 +398,7 @@ static struct ShaderProgram *gfx_d3d11_create_and_load_new_shader(uint64_t shade char buf[4096]; size_t len, num_floats; - gfx_direct3d_common_build_shader(buf, len, num_floats, cc_features, false, THREE_POINT_FILTERING); + gfx_direct3d_common_build_shader(buf, len, num_floats, cc_features, false, d3d.current_filter_mode == THREE_POINT); ComPtr vs, ps; ComPtr error_blob; @@ -514,6 +449,9 @@ static struct ShaderProgram *gfx_d3d11_create_and_load_new_shader(uint64_t shade if (cc_features.opt_fog) { ied[ied_index++] = { "FOG", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }; } + if (cc_features.opt_grayscale) { + ied[ied_index++] = { "GRAYSCALE", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }; + } for (unsigned int i = 0; i < cc_features.num_inputs; i++) { DXGI_FORMAT format = cc_features.opt_alpha ? DXGI_FORMAT_R32G32B32A32_FLOAT : DXGI_FORMAT_R32G32B32_FLOAT; ied[ied_index++] = { "INPUT", i, format, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }; @@ -531,8 +469,8 @@ static struct ShaderProgram *gfx_d3d11_create_and_load_new_shader(uint64_t shade blend_desc.RenderTarget[0].SrcBlend = D3D11_BLEND_SRC_ALPHA; blend_desc.RenderTarget[0].DestBlend = D3D11_BLEND_INV_SRC_ALPHA; blend_desc.RenderTarget[0].BlendOp = D3D11_BLEND_OP_ADD; - blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ONE; - blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ZERO; + blend_desc.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_ZERO; + blend_desc.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_ONE; // We initially clear alpha to 1.0f and want to keep it at 1.0f blend_desc.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD; blend_desc.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL; } else { @@ -592,6 +530,10 @@ static D3D11_TEXTURE_ADDRESS_MODE gfx_cm_to_d3d11(uint32_t val) { static void gfx_d3d11_upload_texture(const uint8_t *rgba32_buf, uint32_t width, uint32_t height) { // Create texture + TextureData *texture_data = &d3d.textures[d3d.current_texture_ids[d3d.current_tile]]; + texture_data->width = width; + texture_data->height = height; + D3D11_TEXTURE2D_DESC texture_desc; ZeroMemory(&texture_desc, sizeof(D3D11_TEXTURE2D_DESC)); @@ -612,32 +554,19 @@ static void gfx_d3d11_upload_texture(const uint8_t *rgba32_buf, uint32_t width, resource_data.SysMemPitch = width * 4; resource_data.SysMemSlicePitch = resource_data.SysMemPitch * height; - ComPtr texture; - ThrowIfFailed(d3d.device->CreateTexture2D(&texture_desc, &resource_data, texture.GetAddressOf())); - - TextureData *texture_data = &d3d.textures[d3d.current_texture_ids[d3d.current_tile]]; - texture_data->width = width; - texture_data->height = height; + ThrowIfFailed(d3d.device->CreateTexture2D(&texture_desc, &resource_data, texture_data->texture.ReleaseAndGetAddressOf())); // Create shader resource view from texture - if (texture_data->resource_view.Get() != nullptr) { - // Free the previous texture in this slot - texture_data->resource_view.Reset(); - } - - ThrowIfFailed(d3d.device->CreateShaderResourceView(texture.Get(), nullptr, texture_data->resource_view.GetAddressOf())); + ThrowIfFailed(d3d.device->CreateShaderResourceView(texture_data->texture.Get(), nullptr, texture_data->resource_view.ReleaseAndGetAddressOf())); } static void gfx_d3d11_set_sampler_parameters(int tile, bool linear_filter, uint32_t cms, uint32_t cmt) { D3D11_SAMPLER_DESC sampler_desc; ZeroMemory(&sampler_desc, sizeof(D3D11_SAMPLER_DESC)); -#if THREE_POINT_FILTERING - sampler_desc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; -#else - sampler_desc.Filter = linear_filter ? D3D11_FILTER_MIN_MAG_MIP_LINEAR : D3D11_FILTER_MIN_MAG_MIP_POINT; -#endif + sampler_desc.Filter = linear_filter && d3d.current_filter_mode == LINEAR ? D3D11_FILTER_MIN_MAG_MIP_LINEAR : D3D11_FILTER_MIN_MAG_MIP_POINT; + sampler_desc.AddressU = gfx_cm_to_d3d11(cms); sampler_desc.AddressV = gfx_cm_to_d3d11(cmt); sampler_desc.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; @@ -741,12 +670,12 @@ static void gfx_d3d11_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t d3d.last_resource_views[i] = d3d.textures[d3d.current_texture_ids[i]].resource_view.Get(); d3d.context->PSSetShaderResources(i, 1, d3d.textures[d3d.current_texture_ids[i]].resource_view.GetAddressOf()); -#if THREE_POINT_FILTERING - d3d.per_draw_cb_data.textures[i].width = d3d.textures[d3d.current_texture_ids[i]].width; - d3d.per_draw_cb_data.textures[i].height = d3d.textures[d3d.current_texture_ids[i]].height; - d3d.per_draw_cb_data.textures[i].linear_filtering = d3d.textures[d3d.current_texture_ids[i]].linear_filtering; - textures_changed = true; -#endif + if (d3d.current_filter_mode == THREE_POINT) { + d3d.per_draw_cb_data.textures[i].width = d3d.textures[d3d.current_texture_ids[i]].width; + d3d.per_draw_cb_data.textures[i].height = d3d.textures[d3d.current_texture_ids[i]].height; + d3d.per_draw_cb_data.textures[i].linear_filtering = d3d.textures[d3d.current_texture_ids[i]].linear_filtering; + textures_changed = true; + } if (d3d.last_sampler_states[i].Get() != d3d.textures[d3d.current_texture_ids[i]].sampler_state.Get()) { d3d.last_sampler_states[i] = d3d.textures[d3d.current_texture_ids[i]].sampler_state.Get(); @@ -803,20 +732,10 @@ static void gfx_d3d11_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_t } static void gfx_d3d11_on_resize(void) { - create_render_target_views(true); + //create_render_target_views(true); } static void gfx_d3d11_start_frame(void) { - // Set render targets - - d3d.context->OMSetRenderTargets(1, d3d.backbuffer_view.GetAddressOf(), d3d.depth_stencil_view.Get()); - - // Clear render targets - - const float clearColor[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - d3d.context->ClearRenderTargetView(d3d.backbuffer_view.Get(), clearColor); - d3d.context->ClearDepthStencilView(d3d.depth_stencil_view.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0); - // Set per-frame constant buffer d3d.per_frame_cb_data.noise_frame++; @@ -824,22 +743,9 @@ static void gfx_d3d11_start_frame(void) { // No high values, as noise starts to look ugly d3d.per_frame_cb_data.noise_frame = 0; } - float aspect_ratio = (float) d3d.current_width / (float) d3d.current_height; - d3d.render_target_height = d3d.current_height; - d3d.per_frame_cb_data.noise_scale_x = 120 * aspect_ratio; // 120 = N64 height resolution (240) / 2 - d3d.per_frame_cb_data.noise_scale_y = 120; - - D3D11_MAPPED_SUBRESOURCE ms; - ZeroMemory(&ms, sizeof(D3D11_MAPPED_SUBRESOURCE)); - d3d.context->Map(d3d.per_frame_cb.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &ms); - memcpy(ms.pData, &d3d.per_frame_cb_data, sizeof(PerFrameCB)); - d3d.context->Unmap(d3d.per_frame_cb.Get(), 0); - - d3d.copied_depth_buffer = false; } static void gfx_d3d11_end_frame(void) { - SohImGui::Draw(); d3d.context->Flush(); } @@ -847,43 +753,13 @@ static void gfx_d3d11_finish_render(void) { d3d.context->Flush(); } -void gfx_d3d11_resize_framebuffer(int fb, uint32_t width, uint32_t height) { - FramebufferData& fd = d3d.framebuffers[fb]; - TextureData& td = d3d.textures[fd.texture_id]; - - ComPtr texture, depth_stencil_texture; - - D3D11_TEXTURE2D_DESC texture_desc; - texture_desc.Width = width; - texture_desc.Height = height; - texture_desc.Usage = D3D11_USAGE_DEFAULT; - texture_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET; - texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; - texture_desc.CPUAccessFlags = 0; - texture_desc.MiscFlags = 0; - texture_desc.ArraySize = 1; - texture_desc.MipLevels = 1; - texture_desc.SampleDesc.Count = 1; - texture_desc.SampleDesc.Quality = 0; - - ThrowIfFailed(d3d.device->CreateTexture2D(&texture_desc, nullptr, texture.GetAddressOf())); - create_depth_stencil_objects(width, height, depth_stencil_texture.GetAddressOf(), fd.depth_stencil_view.ReleaseAndGetAddressOf(), nullptr); - ThrowIfFailed(d3d.device->CreateRenderTargetView(texture.Get(), nullptr, fd.render_target_view.ReleaseAndGetAddressOf())); - ThrowIfFailed(d3d.device->CreateShaderResourceView(texture.Get(), nullptr, td.resource_view.ReleaseAndGetAddressOf())); - - td.width = width; - td.height = height; -} - -int gfx_d3d11_create_framebuffer(uint32_t width, uint32_t height) { +int gfx_d3d11_create_framebuffer(void) { uint32_t texture_id = gfx_d3d11_new_texture(); TextureData& t = d3d.textures[texture_id]; - t.width = width; - t.height = height; size_t index = d3d.framebuffers.size(); d3d.framebuffers.resize(d3d.framebuffers.size() + 1); - FramebufferData& data = d3d.framebuffers.back(); + Framebuffer& data = d3d.framebuffers.back(); data.texture_id = texture_id; uint32_t tile = 0; @@ -892,24 +768,109 @@ int gfx_d3d11_create_framebuffer(uint32_t width, uint32_t height) { gfx_d3d11_set_sampler_parameters(0, true, G_TX_WRAP, G_TX_WRAP); d3d.current_texture_ids[tile] = saved; - gfx_d3d11_resize_framebuffer(index, width, height); - return (int)index; } -void gfx_d3d11_set_framebuffer(int fb) { - d3d.render_target_height = d3d.textures[d3d.framebuffers[fb].texture_id].height; +static void gfx_d3d11_update_framebuffer_parameters(int fb_id, uint32_t width, uint32_t height, uint32_t msaa_level, bool opengl_invert_y, bool render_target, bool has_depth_buffer, bool can_extract_depth) { + Framebuffer& fb = d3d.framebuffers[fb_id]; + TextureData& tex = d3d.textures[fb.texture_id]; - d3d.context->OMSetRenderTargets(1, d3d.framebuffers[fb].render_target_view.GetAddressOf(), d3d.framebuffers[fb].depth_stencil_view.Get()); + width = max(width, 1U); + height = max(height, 1U); + while (msaa_level > 1 && d3d.msaa_num_quality_levels[msaa_level - 1] == 0) { + --msaa_level; + } - const float clearColor[] = { 0.0f, 0.0f, 0.0f, 1.0f }; - d3d.context->ClearRenderTargetView(d3d.framebuffers[fb].render_target_view.Get(), clearColor); - d3d.context->ClearDepthStencilView(d3d.framebuffers[fb].depth_stencil_view.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0); + bool diff = tex.width != width || tex.height != height || fb.msaa_level != msaa_level; + + if (diff || (fb.render_target_view.Get() != nullptr) != render_target) { + if (fb_id != 0) { + D3D11_TEXTURE2D_DESC texture_desc; + texture_desc.Width = width; + texture_desc.Height = height; + texture_desc.Usage = D3D11_USAGE_DEFAULT; + texture_desc.BindFlags = (msaa_level <= 1 ? D3D11_BIND_SHADER_RESOURCE : 0) | (render_target ? D3D11_BIND_RENDER_TARGET : 0); + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + texture_desc.ArraySize = 1; + texture_desc.MipLevels = 1; + texture_desc.SampleDesc.Count = msaa_level; + texture_desc.SampleDesc.Quality = 0; + + ThrowIfFailed(d3d.device->CreateTexture2D(&texture_desc, nullptr, tex.texture.ReleaseAndGetAddressOf())); + + if (msaa_level <= 1) { + ThrowIfFailed(d3d.device->CreateShaderResourceView(tex.texture.Get(), nullptr, tex.resource_view.ReleaseAndGetAddressOf())); + } + } else if (diff) { + DXGI_SWAP_CHAIN_DESC1 desc1; + ThrowIfFailed(d3d.swap_chain->GetDesc1(&desc1)); + if (desc1.Width != width || desc1.Height != height) { + fb.render_target_view.Reset(); + tex.texture.Reset(); + ThrowIfFailed(d3d.swap_chain->ResizeBuffers(0, 0, 0, DXGI_FORMAT_UNKNOWN, desc1.Flags)); + } + ThrowIfFailed(d3d.swap_chain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID *)tex.texture.ReleaseAndGetAddressOf())); + } + if (render_target) { + ThrowIfFailed(d3d.device->CreateRenderTargetView(tex.texture.Get(), nullptr, fb.render_target_view.ReleaseAndGetAddressOf())); + } + + tex.width = width; + tex.height = height; + } + + if (has_depth_buffer && (diff || !fb.has_depth_buffer || (fb.depth_stencil_srv.Get() != nullptr) != can_extract_depth)) { + fb.depth_stencil_srv.Reset(); + create_depth_stencil_objects(width, height, msaa_level, fb.depth_stencil_view.ReleaseAndGetAddressOf(), can_extract_depth ? fb.depth_stencil_srv.GetAddressOf() : nullptr); + } + if (!has_depth_buffer) { + fb.depth_stencil_view.Reset(); + fb.depth_stencil_srv.Reset(); + } + + fb.has_depth_buffer = has_depth_buffer; + fb.msaa_level = msaa_level; } -void gfx_d3d11_reset_framebuffer(void) { - d3d.render_target_height = d3d.current_height; - d3d.context->OMSetRenderTargets(1, d3d.backbuffer_view.GetAddressOf(), d3d.depth_stencil_view.Get()); +void gfx_d3d11_start_draw_to_framebuffer(int fb_id, float noise_scale) { + Framebuffer& fb = d3d.framebuffers[fb_id]; + d3d.render_target_height = d3d.textures[fb.texture_id].height; + + d3d.context->OMSetRenderTargets(1, fb.render_target_view.GetAddressOf(), fb.has_depth_buffer ? fb.depth_stencil_view.Get() : nullptr); + + d3d.current_framebuffer = fb_id; + + if (noise_scale != 0.0f) { + d3d.per_frame_cb_data.noise_scale = 1.0f / noise_scale; + } + + D3D11_MAPPED_SUBRESOURCE ms; + ZeroMemory(&ms, sizeof(D3D11_MAPPED_SUBRESOURCE)); + d3d.context->Map(d3d.per_frame_cb.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &ms); + memcpy(ms.pData, &d3d.per_frame_cb_data, sizeof(PerFrameCB)); + d3d.context->Unmap(d3d.per_frame_cb.Get(), 0); +} + +void gfx_d3d11_clear_framebuffer(void) { + Framebuffer& fb = d3d.framebuffers[d3d.current_framebuffer]; + const float clearColor[] = { 0.0f, 0.0f, 0.0f, 1.0f }; + d3d.context->ClearRenderTargetView(fb.render_target_view.Get(), clearColor); + if (fb.has_depth_buffer) { + d3d.context->ClearDepthStencilView(fb.depth_stencil_view.Get(), D3D11_CLEAR_DEPTH, 1.0f, 0); + } +} + +void gfx_d3d11_resolve_msaa_color_buffer(int fb_id_target, int fb_id_source) { + Framebuffer& fb_dst = d3d.framebuffers[fb_id_target]; + Framebuffer& fb_src = d3d.framebuffers[fb_id_source]; + + d3d.context->ResolveSubresource(d3d.textures[fb_dst.texture_id].texture.Get(), 0, d3d.textures[fb_src.texture_id].texture.Get(), 0, DXGI_FORMAT_R8G8B8A8_UNORM); +} + +void *gfx_d3d11_get_framebuffer_texture_id(int fb_id) { + return (void *)d3d.textures[d3d.framebuffers[fb_id].texture_id].resource_view.Get(); } void gfx_d3d11_select_texture_fb(int fbID) { @@ -917,72 +878,126 @@ void gfx_d3d11_select_texture_fb(int fbID) { gfx_d3d11_select_texture(tile, d3d.framebuffers[fbID].texture_id); } -uint16_t gfx_d3d11_get_pixel_depth(float x, float y) { +void gfx_d3d11_set_texture_filter(FilteringMode mode) { + d3d.current_filter_mode = mode; + gfx_texture_cache_clear(); +} + +FilteringMode gfx_d3d11_get_texture_filter(void) { + return d3d.current_filter_mode; +} + +std::map, uint16_t> gfx_d3d11_get_pixel_depth(int fb_id, const std::set>& coordinates) { + Framebuffer& fb = d3d.framebuffers[fb_id]; + TextureData& td = d3d.textures[fb.texture_id]; + + if (coordinates.size() > d3d.coord_buffer_size) { + d3d.coord_buffer.Reset(); + d3d.coord_buffer_srv.Reset(); + d3d.depth_value_output_buffer.Reset(); + d3d.depth_value_output_uav.Reset(); + d3d.depth_value_output_buffer_copy.Reset(); + + D3D11_BUFFER_DESC coord_buf_desc; + coord_buf_desc.Usage = D3D11_USAGE_DYNAMIC; + coord_buf_desc.ByteWidth = sizeof(Coord) * coordinates.size(); + coord_buf_desc.BindFlags = D3D11_BIND_SHADER_RESOURCE; + coord_buf_desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; + coord_buf_desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + coord_buf_desc.StructureByteStride = sizeof(Coord); + + ThrowIfFailed(d3d.device->CreateBuffer(&coord_buf_desc, nullptr, d3d.coord_buffer.GetAddressOf())); + + D3D11_SHADER_RESOURCE_VIEW_DESC coord_buf_srv_desc; + coord_buf_srv_desc.Format = DXGI_FORMAT_UNKNOWN; + coord_buf_srv_desc.ViewDimension = D3D11_SRV_DIMENSION_BUFFER; + coord_buf_srv_desc.Buffer.FirstElement = 0; + coord_buf_srv_desc.Buffer.NumElements = coordinates.size(); + + ThrowIfFailed(d3d.device->CreateShaderResourceView(d3d.coord_buffer.Get(), &coord_buf_srv_desc, d3d.coord_buffer_srv.GetAddressOf())); + + D3D11_BUFFER_DESC output_buffer_desc; + output_buffer_desc.Usage = D3D11_USAGE_DEFAULT; + output_buffer_desc.ByteWidth = sizeof(float) * coordinates.size(); + output_buffer_desc.BindFlags = D3D11_BIND_UNORDERED_ACCESS; + output_buffer_desc.CPUAccessFlags = 0; + output_buffer_desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED; + output_buffer_desc.StructureByteStride = sizeof(float); + ThrowIfFailed(d3d.device->CreateBuffer(&output_buffer_desc, nullptr, d3d.depth_value_output_buffer.GetAddressOf())); + + D3D11_UNORDERED_ACCESS_VIEW_DESC output_buffer_uav_desc; + output_buffer_uav_desc.Format = DXGI_FORMAT_UNKNOWN; + output_buffer_uav_desc.ViewDimension = D3D11_UAV_DIMENSION_BUFFER; + output_buffer_uav_desc.Buffer.FirstElement = 0; + output_buffer_uav_desc.Buffer.NumElements = coordinates.size(); + output_buffer_uav_desc.Buffer.Flags = 0; + ThrowIfFailed(d3d.device->CreateUnorderedAccessView(d3d.depth_value_output_buffer.Get(), &output_buffer_uav_desc, d3d.depth_value_output_uav.GetAddressOf())); + + output_buffer_desc.Usage = D3D11_USAGE_STAGING; + output_buffer_desc.BindFlags = 0; + output_buffer_desc.CPUAccessFlags = D3D11_CPU_ACCESS_READ; + ThrowIfFailed(d3d.device->CreateBuffer(&output_buffer_desc, nullptr, d3d.depth_value_output_buffer_copy.GetAddressOf())); + + d3d.coord_buffer_size = coordinates.size(); + } + D3D11_MAPPED_SUBRESOURCE ms; + if (fb.msaa_level > 1 && d3d.compute_shader_msaa.Get() == nullptr) { + ThrowIfFailed(d3d.device->CreateComputeShader(d3d.compute_shader_msaa_blob->GetBufferPointer(), d3d.compute_shader_msaa_blob->GetBufferSize(), nullptr, d3d.compute_shader_msaa.GetAddressOf())); + } + // ImGui overwrites these values, so we cannot set them once at init - d3d.context->CSSetShader(d3d.compute_shader.Get(), nullptr, 0); - d3d.context->CSSetConstantBuffers(0, 1, d3d.coord_buffer.GetAddressOf()); - d3d.context->CSSetSamplers(0, 1, d3d.depth_value_sampler.GetAddressOf()); + d3d.context->CSSetShader(fb.msaa_level > 1 ? d3d.compute_shader_msaa.Get() : d3d.compute_shader.Get(), nullptr, 0); d3d.context->CSSetUnorderedAccessViews(0, 1, d3d.depth_value_output_uav.GetAddressOf(), nullptr); ThrowIfFailed(d3d.context->Map(d3d.coord_buffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &ms)); - CoordCB* coord_cb = (CoordCB*)ms.pData; - coord_cb->x = x / d3d.current_width; - // We invert y because the game assumes OpenGL coordinates (bottom-left corner is origin), while DX's origin is top-left corner - coord_cb->y = 1 - y / d3d.current_height; + Coord *coord_cb = (Coord *)ms.pData; + { + size_t i = 0; + for (const auto& coord : coordinates) { + coord_cb[i].x = coord.first; + // We invert y because the gfx_pc assumes OpenGL coordinates (bottom-left corner is origin), while DX's origin is top-left corner + coord_cb[i].y = td.height - 1 - coord.second; + ++i; + } + } d3d.context->Unmap(d3d.coord_buffer.Get(), 0); - // The depth stencil texture can only have one mapping at a time, so temporarily unbind from the OM - d3d.context->OMSetRenderTargets(1, d3d.backbuffer_view.GetAddressOf(), nullptr); - d3d.context->CSSetShaderResources(0, 1, d3d.depth_stencil_srv.GetAddressOf()); + // The depth stencil texture can only have one mapping at a time, so unbind from the OM + ID3D11RenderTargetView* null_arr1[1] = { nullptr }; + d3d.context->OMSetRenderTargets(1, null_arr1, nullptr); - d3d.context->Dispatch(1, 1, 1); + ID3D11ShaderResourceView *srvs[] = { fb.depth_stencil_srv.Get(), d3d.coord_buffer_srv.Get() }; + d3d.context->CSSetShaderResources(0, 2, srvs); + + d3d.context->Dispatch(coordinates.size(), 1, 1); d3d.context->CopyResource(d3d.depth_value_output_buffer_copy.Get(), d3d.depth_value_output_buffer.Get()); ThrowIfFailed(d3d.context->Map(d3d.depth_value_output_buffer_copy.Get(), 0, D3D11_MAP_READ, 0, &ms)); - float res = *(float *)ms.pData; - d3d.context->Unmap(d3d.depth_value_output_buffer_copy.Get(), 0); - - ID3D11ShaderResourceView *null_arr[1] = { nullptr }; - d3d.context->CSSetShaderResources(0, 1, null_arr); - d3d.context->OMSetRenderTargets(1, d3d.backbuffer_view.GetAddressOf(), d3d.depth_stencil_view.Get()); - - return res * 65532.0f; -} - -uint16_t gfx_d3d11_get_pixel_depth_old(float x, float y) { - // This approach, compared to using a compute shader, might have better performance on nvidia cards - - if (!d3d.copied_depth_buffer) { - d3d.context->CopyResource(d3d.depth_stencil_copy_texture.Get(), d3d.depth_stencil_texture.Get()); - d3d.copied_depth_buffer = true; - } - - D3D11_MAPPED_SUBRESOURCE mapping_desc; - d3d.context->Map(d3d.depth_stencil_copy_texture.Get(), 0, D3D11_MAP_READ, 0, &mapping_desc); - float res = 0; - if (mapping_desc.pData != nullptr) { - float *addr = (float *)mapping_desc.pData; - uint32_t num_pixels = mapping_desc.DepthPitch / sizeof(float); - uint32_t width = mapping_desc.RowPitch / sizeof(float); - uint32_t height = width == 0 ? 0 : num_pixels / width; - if (x >= 0 && x < width && y >= 0 && y < height) { - res = addr[width * (height - 1 - (int)y) + (int)x]; + std::map, uint16_t> res; + { + size_t i = 0; + for (const auto& coord : coordinates) { + res.emplace(coord, ((float *)ms.pData)[i++] * 65532.0f); } } - d3d.context->Unmap(d3d.depth_stencil_copy_texture.Get(), 0); - return res * 65532.0f; + d3d.context->Unmap(d3d.depth_value_output_buffer_copy.Get(), 0); + + ID3D11ShaderResourceView *null_arr[2] = { nullptr, nullptr }; + d3d.context->CSSetShaderResources(0, 2, null_arr); + + return res; } } // namespace -void* SohImGui::GetTextureByID(int id) { +ImTextureID gfx_d3d11_get_texture_by_id(int id) { return d3d.textures[id].resource_view.Get(); } struct GfxRenderingAPI gfx_direct3d11_api = { - gfx_d3d11_z_is_from_0_to_1, + gfx_d3d11_get_clip_parameters, gfx_d3d11_unload_shader, gfx_d3d11_load_shader, gfx_d3d11_create_and_load_new_shader, @@ -993,7 +1008,6 @@ struct GfxRenderingAPI gfx_direct3d11_api = { gfx_d3d11_upload_texture, gfx_d3d11_set_sampler_parameters, gfx_d3d11_set_depth_test_and_mask, - gfx_d3d11_get_pixel_depth, gfx_d3d11_set_zmode_decal, gfx_d3d11_set_viewport, gfx_d3d11_set_scissor, @@ -1005,11 +1019,16 @@ struct GfxRenderingAPI gfx_direct3d11_api = { gfx_d3d11_end_frame, gfx_d3d11_finish_render, gfx_d3d11_create_framebuffer, - gfx_d3d11_resize_framebuffer, - gfx_d3d11_set_framebuffer, - gfx_d3d11_reset_framebuffer, + gfx_d3d11_update_framebuffer_parameters, + gfx_d3d11_start_draw_to_framebuffer, + gfx_d3d11_clear_framebuffer, + gfx_d3d11_resolve_msaa_color_buffer, + gfx_d3d11_get_pixel_depth, + gfx_d3d11_get_framebuffer_texture_id, gfx_d3d11_select_texture_fb, - gfx_d3d11_delete_texture + gfx_d3d11_delete_texture, + gfx_d3d11_set_texture_filter, + gfx_d3d11_get_texture_filter }; #endif diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_direct3d_common.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_direct3d_common.cpp index ca60aef8b..2c10e6605 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_direct3d_common.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_direct3d_common.cpp @@ -134,13 +134,14 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f } } } - if (cc_features.opt_alpha && cc_features.opt_noise) { - append_line(buf, &len, " float4 screenPos : TEXCOORD2;"); - } if (cc_features.opt_fog) { append_line(buf, &len, " float4 fog : FOG;"); num_floats += 4; } + if (cc_features.opt_grayscale) { + append_line(buf, &len, " float4 grayscale : GRAYSCALE;"); + num_floats += 4; + } for (int i = 0; i < cc_features.num_inputs; i++) { len += sprintf(buf + len, " float%d input%d : INPUT%d;\r\n", cc_features.opt_alpha ? 4 : 3, i + 1, i); num_floats += cc_features.opt_alpha ? 4 : 3; @@ -163,7 +164,7 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f if (cc_features.opt_alpha && cc_features.opt_noise) { append_line(buf, &len, "cbuffer PerFrameCB : register(b0) {"); append_line(buf, &len, " uint noise_frame;"); - append_line(buf, &len, " float2 noise_scale;"); + append_line(buf, &len, " float noise_scale;"); append_line(buf, &len, "}"); append_line(buf, &len, "float random(in float3 value) {"); @@ -211,15 +212,15 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f if (cc_features.opt_fog) { append_str(buf, &len, ", float4 fog : FOG"); } + if (cc_features.opt_grayscale) { + append_str(buf, &len, ", float4 grayscale : GRAYSCALE"); + } for (int i = 0; i < cc_features.num_inputs; i++) { len += sprintf(buf + len, ", float%d input%d : INPUT%d", cc_features.opt_alpha ? 4 : 3, i + 1, i); } append_line(buf, &len, ") {"); append_line(buf, &len, " PSInput result;"); append_line(buf, &len, " result.position = position;"); - if (cc_features.opt_alpha && cc_features.opt_noise) { - append_line(buf, &len, " result.screenPos = position;"); - } for (int i = 0; i < 2; i++) { if (cc_features.used_textures[i]) { len += sprintf(buf + len, " result.uv%d = uv%d;\r\n", i, i); @@ -234,6 +235,9 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f if (cc_features.opt_fog) { append_line(buf, &len, " result.fog = fog;"); } + if (cc_features.opt_grayscale) { + append_line(buf, &len, " result.grayscale = grayscale;"); + } for (int i = 0; i < cc_features.num_inputs; i++) { len += sprintf(buf + len, " result.input%d = input%d;\r\n", i + 1, i + 1); } @@ -244,7 +248,11 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f if (include_root_signature) { append_line(buf, &len, "[RootSignature(RS)]"); } - append_line(buf, &len, "float4 PSMain(PSInput input) : SV_TARGET {"); + if (cc_features.opt_alpha && cc_features.opt_noise) { + append_line(buf, &len, "float4 PSMain(PSInput input, float4 screenSpace : SV_Position) : SV_TARGET {"); + } else { + append_line(buf, &len, "float4 PSMain(PSInput input) : SV_TARGET {"); + } for (int i = 0; i < 2; i++) { if (cc_features.used_textures[i]) { len += sprintf(buf + len, " float2 tc%d = input.uv%d;\r\n", i, i); @@ -300,8 +308,14 @@ void gfx_direct3d_common_build_shader(char buf[4096], size_t& len, size_t& num_f } } + if (cc_features.opt_grayscale) { + append_line(buf, &len, "float intensity = (texel.r + texel.g + texel.b) / 3.0;"); + append_line(buf, &len, "float3 new_texel = input.grayscale.rgb * intensity;"); + append_line(buf, &len, "texel.rgb = lerp(texel.rgb, new_texel, input.grayscale.a);"); + } + if (cc_features.opt_alpha && cc_features.opt_noise) { - append_line(buf, &len, " float2 coords = (input.screenPos.xy / input.screenPos.w) * noise_scale;"); + append_line(buf, &len, " float2 coords = screenSpace.xy * noise_scale;"); append_line(buf, &len, " texel.a *= round(saturate(random(float3(floor(coords), noise_frame)) + texel.a - 0.5));"); } diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp index 6cfc3cf32..49abe0b28 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_dxgi.cpp @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -61,6 +62,7 @@ static struct { RECT last_window_rect; bool is_full_screen, last_maximized_state; + bool dxgi1_4; ComPtr factory; ComPtr swap_chain; HANDLE waitable_object; @@ -197,17 +199,6 @@ static void toggle_borderless_window_full_screen(bool enable, bool call_callback } } -static void gfx_dxgi_on_resize(void) { - if (dxgi.swap_chain.Get() != nullptr) { - gfx_get_current_rendering_api()->on_resize(); - - DXGI_SWAP_CHAIN_DESC1 desc1; - ThrowIfFailed(dxgi.swap_chain->GetDesc1(&desc1)); - dxgi.current_width = desc1.Width; - dxgi.current_height = desc1.Height; - } -} - static void onkeydown(WPARAM w_param, LPARAM l_param) { int key = ((l_param >> 16) & 0x1ff); if (dxgi.on_key_down != nullptr) { @@ -227,7 +218,8 @@ static LRESULT CALLBACK gfx_dxgi_wnd_proc(HWND h_wnd, UINT message, WPARAM w_par SohImGui::Update(event_impl); switch (message) { case WM_SIZE: - gfx_dxgi_on_resize(); + dxgi.current_width = (uint32_t)(l_param & 0xffff); + dxgi.current_height = (uint32_t)(l_param >> 16); break; case WM_DESTROY: exit(0); @@ -573,6 +565,13 @@ void gfx_dxgi_create_factory_and_device(bool debug, int d3d_version, bool (*crea ThrowIfFailed(dxgi.CreateDXGIFactory1(__uuidof(IDXGIFactory2), &dxgi.factory)); } + { + ComPtr factory4; + if (dxgi.factory->QueryInterface(__uuidof(IDXGIFactory4), &factory4) == S_OK) { + dxgi.dxgi1_4 = true; + } + } + ComPtr adapter; for (UINT i = 0; dxgi.factory->EnumAdapters1(i, &adapter) != DXGI_ERROR_NOT_FOUND; i++) { DXGI_ADAPTER_DESC1 desc; @@ -604,7 +603,9 @@ ComPtr gfx_dxgi_create_swap_chain(IUnknown *device) { swap_chain_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; swap_chain_desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; swap_chain_desc.Scaling = win8 ? DXGI_SCALING_NONE : DXGI_SCALING_STRETCH; - swap_chain_desc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // Apparently this was backported to Win 7 Platform Update + swap_chain_desc.SwapEffect = dxgi.dxgi1_4 ? + DXGI_SWAP_EFFECT_FLIP_DISCARD : // Introduced in DXGI 1.4 and Windows 10 + DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; // Apparently flip sequential was also backported to Win 7 Platform Update swap_chain_desc.Flags = dxgi_13 ? DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT : 0; swap_chain_desc.SampleDesc.Count = 1; diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp index 66bb5c182..d450558b2 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_glx.cpp @@ -150,29 +150,29 @@ static struct { Display *dpy; Window root; Window win; - + Atom atom_wm_state; Atom atom_wm_state_fullscreen; Atom atom_wm_delete_window; - + bool is_fullscreen; void (*on_fullscreen_changed)(bool is_now_fullscreen); - + int keymap[256]; bool (*on_key_down)(int scancode); bool (*on_key_up)(int scancode); void (*on_all_keys_up)(void); - + PFNGLXGETSYNCVALUESOMLPROC glXGetSyncValuesOML; PFNGLXSWAPBUFFERSMSCOMLPROC glXSwapBuffersMscOML; PFNGLXWAITFORSBCOMLPROC glXWaitForSbcOML; - + PFNGLXSWAPINTERVALEXTPROC glXSwapIntervalEXT; PFNGLXSWAPINTERVALSGIPROC glXSwapIntervalSGI; - + PFNGLXGETVIDEOSYNCSGIPROC glXGetVideoSyncSGI; PFNGLXWAITVIDEOSYNCSGIPROC glXWaitVideoSyncSGI; - + bool has_oml_sync_control; uint64_t ust0; int64_t last_msc; @@ -181,7 +181,7 @@ static struct { uint64_t last_ust; int64_t target_msc; bool dropped_frame; - + bool has_sgi_video_sync; uint64_t last_sync_counter; int64_t this_msc; @@ -220,7 +220,7 @@ static int64_t glXGetVideoSyncSGI_wrapper(void) { static void init_keymap(void) { XkbDescPtr desc = XkbGetMap(glx.dpy, 0, XkbUseCoreKbd); XkbGetNames(glx.dpy, XkbKeyNamesMask, desc); - + for (int i = desc->min_key_code; i <= desc->max_key_code && i < 256; i++) { char name[XkbKeyNameLength + 1]; memcpy(name, desc->names->keys[i].name, XkbKeyNameLength); @@ -232,7 +232,7 @@ static void init_keymap(void) { } } } - + XkbFreeNames(desc, XkbKeyNamesMask, True); XkbFreeKeyboard(desc, 0, True); } @@ -265,7 +265,7 @@ static void gfx_glx_set_fullscreen_state(bool on, bool call_callback) { return; } glx.is_fullscreen = on; - + XEvent xev; xev.xany.type = ClientMessage; xev.xclient.message_type = glx.atom_wm_state; @@ -276,8 +276,8 @@ static void gfx_glx_set_fullscreen_state(bool on, bool call_callback) { xev.xclient.data.l[2] = 0; xev.xclient.data.l[3] = 0; XSendEvent(glx.dpy, glx.root, 0, SubstructureNotifyMask | SubstructureRedirectMask, &xev); - gfx_glx_ShowHideMouse(on); - + gfx_glx_show_cursor(on); + if (glx.on_fullscreen_changed != NULL && call_callback) { glx.on_fullscreen_changed(on); } @@ -303,7 +303,7 @@ static void gfx_glx_init(const char *game_name, bool start_in_fullscreen) { // which means that glXSwapBuffers should be non-blocking, // if we are sure to wait at least one vsync interval between calls. setenv("__GL_MaxFramesAllowed", "2", true); - + glx.dpy = XOpenDisplay(NULL); if (glx.dpy == NULL) { fprintf(stderr, "Cannot connect to X server\n"); @@ -311,7 +311,7 @@ static void gfx_glx_init(const char *game_name, bool start_in_fullscreen) { } int screen = DefaultScreen(glx.dpy); glx.root = RootWindow(glx.dpy, screen); - + GLint att[] = { GLX_RGBA, GLX_DEPTH_SIZE, 24, GLX_DOUBLEBUFFER, None }; XVisualInfo *vi = glXChooseVisual(glx.dpy, 0, att); if (vi == NULL) { @@ -323,7 +323,7 @@ static void gfx_glx_init(const char *game_name, bool start_in_fullscreen) { swa.colormap = cmap; swa.event_mask = ExposureMask | KeyPressMask | KeyReleaseMask | FocusChangeMask; glx.win = XCreateWindow(glx.dpy, glx.root, 0, 0, DESIRED_SCREEN_WIDTH, DESIRED_SCREEN_HEIGHT, 0, vi->depth, InputOutput, vi->visual, CWColormap | CWEventMask, &swa); - + glx.atom_wm_state = XInternAtom(glx.dpy, "_NET_WM_STATE", False); glx.atom_wm_state_fullscreen = XInternAtom(glx.dpy, "_NET_WM_STATE_FULLSCREEN", False); glx.atom_wm_delete_window = XInternAtom(glx.dpy, "WM_DELETE_WINDOW", False); @@ -340,11 +340,11 @@ static void gfx_glx_init(const char *game_name, bool start_in_fullscreen) { XStoreName(glx.dpy, glx.win, title); GLXContext glc = glXCreateContext(glx.dpy, vi, NULL, GL_TRUE); glXMakeCurrent(glx.dpy, glx.win, glc); - + init_keymap(); - + const char *extensions = glXQueryExtensionsString(glx.dpy, screen); - + if (gfx_glx_check_extension(extensions, "GLX_OML_sync_control")) { glx.glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glXGetProcAddressARB((const GLubyte *)"glXGetSyncValuesOML"); glx.glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glXGetProcAddressARB((const GLubyte *)"glXSwapBuffersMscOML"); @@ -360,7 +360,7 @@ static void gfx_glx_init(const char *game_name, bool start_in_fullscreen) { glx.glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXGetVideoSyncSGI"); glx.glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glXGetProcAddressARB((const GLubyte *)"glXWaitVideoSyncSGI"); } - + int64_t ust, msc, sbc; if (glx.glXGetSyncValuesOML != NULL && glx.glXGetSyncValuesOML(glx.dpy, glx.win, &ust, &msc, &sbc)) { glx.has_oml_sync_control = true; @@ -439,7 +439,7 @@ static void gfx_glx_handle_events(void) { } } } - if (xev.type == ClientMessage && xev.xclient.data.l[0] == glx.atom_wm_delete_window) { + if (xev.type == ClientMessage && (Atom)xev.xclient.data.l[0] == glx.atom_wm_delete_window) { exit(0); } } @@ -451,19 +451,19 @@ static bool gfx_glx_start_frame(void) { static void gfx_glx_swap_buffers_begin(void) { glx.wanted_ust += FRAME_INTERVAL_US_NUMERATOR; // advance 1/30 seconds on JP/US or 1/25 seconds on EU - + if (!glx.has_oml_sync_control && !glx.has_sgi_video_sync) { glFlush(); - + uint64_t target = glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR; uint64_t now; while (target > (now = (uint64_t)get_time() - glx.ust0)) { - struct timespec ts = {(target - now) / 1000000, ((target - now) % 1000000) * 1000}; + struct timespec ts = {(time_t)((target - now) / 1000000), (time_t)(((target - now) % 1000000) * 1000)}; if (nanosleep(&ts, NULL) == 0) { break; } } - + if (target + 2 * FRAME_INTERVAL_US_NUMERATOR / FRAME_INTERVAL_US_DENOMINATOR < now) { if (target + 32 * FRAME_INTERVAL_US_NUMERATOR / FRAME_INTERVAL_US_DENOMINATOR >= now) { printf("Dropping frame\n"); @@ -476,10 +476,10 @@ static void gfx_glx_swap_buffers_begin(void) { } glXSwapBuffers(glx.dpy, glx.win); glx.dropped_frame = false; - + return; } - + double vsyncs_to_wait = (int64_t)(glx.wanted_ust / FRAME_INTERVAL_US_DENOMINATOR - glx.last_ust) / (double)glx.vsync_interval; if (vsyncs_to_wait <= 0) { printf("Dropping frame\n"); @@ -519,17 +519,17 @@ static void gfx_glx_swap_buffers_begin(void) { vsyncs_to_wait = 2; } glx.target_msc = glx.last_msc + vsyncs_to_wait; - + if (glx.has_oml_sync_control) { glx.glXSwapBuffersMscOML(glx.dpy, glx.win, glx.target_msc, 0, 0); } else if (glx.has_sgi_video_sync) { glFlush(); // Try to submit pending work. Don't use glFinish since that busy loops on NVIDIA proprietary driver. - + //uint64_t counter0; uint64_t counter1, counter2; - + //uint64_t before_wait = get_time(); - + counter1 = glXGetVideoSyncSGI_wrapper(); //counter0 = counter1; //int waits = 0; @@ -537,17 +537,17 @@ static void gfx_glx_swap_buffers_begin(void) { counter1 = glXWaitVideoSyncSGI_wrapper(); //++waits; } - + //uint64_t before = get_time(); glXSwapBuffers(glx.dpy, glx.win); - - + + counter2 = glXGetVideoSyncSGI_wrapper(); while (counter2 < (uint64_t)glx.target_msc) { counter2 = glXWaitVideoSyncSGI_wrapper(); } uint64_t after = get_time(); - + //printf("%.3f %.3f %.3f\t%.3f\t%u %d %.2f %u %d\n", before_wait * 0.000060, before * 0.000060, after * 0.000060, (after - before) * 0.000060, counter0, counter2 - counter0, vsyncs_to_wait, (unsigned int)glx.target_msc, waits); glx.this_msc = counter2; glx.this_ust = after; @@ -558,7 +558,7 @@ static void gfx_glx_swap_buffers_end(void) { if (glx.dropped_frame || (!glx.has_oml_sync_control && !glx.has_sgi_video_sync)) { return; } - + int64_t ust, msc, sbc; if (glx.has_oml_sync_control) { if (!glx.glXWaitForSbcOML(glx.dpy, glx.win, 0, &ust, &msc, &sbc)) { @@ -600,6 +600,10 @@ static double gfx_glx_get_time(void) { return 0.0; } +static void gfx_glx_set_frame_divisor(int divisor) { + // TODO +} + struct GfxWindowManagerAPI gfx_glx = { gfx_glx_init, gfx_glx_set_keyboard_callbacks, @@ -612,7 +616,8 @@ struct GfxWindowManagerAPI gfx_glx = { gfx_glx_start_frame, gfx_glx_swap_buffers_begin, gfx_glx_swap_buffers_end, - gfx_glx_get_time + gfx_glx_get_time, + gfx_glx_set_frame_divisor, }; #endif diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_glx.h b/libultraship/libultraship/Lib/Fast3D/gfx_glx.h index fe78db948..1ca410901 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_glx.h +++ b/libultraship/libultraship/Lib/Fast3D/gfx_glx.h @@ -3,6 +3,6 @@ #include "gfx_window_manager_api.h" -struct GfxWindowManagerAPI gfx_glx; +extern struct GfxWindowManagerAPI gfx_glx; #endif diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp index 52815bc1c..b2db3186a 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp @@ -29,8 +29,9 @@ #include "SDL_opengl.h" #else #include +#include #define GL_GLEXT_PROTOTYPES 1 -#include +// #include #endif #include "gfx_cc.h" @@ -52,19 +53,34 @@ struct ShaderProgram { uint8_t num_attribs; bool used_noise; GLint frame_count_location; - GLint window_height_location; + GLint noise_scale_location; +}; + +struct Framebuffer { + uint32_t width, height; + bool has_depth_buffer; + uint32_t msaa_level; + bool invert_y; + + GLuint fbo, clrbuf, clrbuf_msaa, rbo; }; static map, struct ShaderProgram> shader_program_pool; static GLuint opengl_vbo; - -static uint32_t frame_count; -static uint32_t current_height; -static map> fb2tex; static bool current_depth_mask; -static bool gfx_opengl_z_is_from_0_to_1(void) { - return false; +static uint32_t frame_count; + +static vector framebuffers; +static size_t current_framebuffer; +static float current_noise_scale; +static FilteringMode current_filter_mode = THREE_POINT; + +GLuint pixel_depth_rb, pixel_depth_fb; +size_t pixel_depth_rb_size; + +static struct GfxClipParameters gfx_opengl_get_clip_parameters(void) { + return { false, framebuffers[current_framebuffer].invert_y }; } static void gfx_opengl_vertex_array_set_attribs(struct ShaderProgram *prg) { @@ -81,7 +97,7 @@ static void gfx_opengl_vertex_array_set_attribs(struct ShaderProgram *prg) { static void gfx_opengl_set_uniforms(struct ShaderProgram *prg) { if (prg->used_noise) { glUniform1i(prg->frame_count_location, frame_count); - glUniform1i(prg->window_height_location, current_height); + glUniform1f(prg->noise_scale_location, current_noise_scale); } } @@ -163,6 +179,7 @@ static const char *shader_item_to_str(uint32_t item, bool with_alpha, bool only_ return "texel.a"; } } + return ""; } static void append_formula(char *buf, size_t *len, uint8_t c[2][4], bool do_single, bool do_multiply, bool do_mix, bool with_alpha, bool only_alpha, bool opt_alpha) { @@ -197,7 +214,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad gfx_cc_get_features(shader_id0, shader_id1, &cc_features); char vs_buf[1024]; - char fs_buf[1024]; + char fs_buf[3000]; size_t vs_len = 0; size_t fs_len = 0; size_t num_floats = 4; @@ -224,6 +241,13 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad append_line(vs_buf, &vs_len, "varying vec4 vFog;"); num_floats += 4; } + + if (cc_features.opt_grayscale) { + append_line(vs_buf, &vs_len, "attribute vec4 aGrayscaleColor;"); + append_line(vs_buf, &vs_len, "varying vec4 vGrayscaleColor;"); + num_floats += 4; + } + for (int i = 0; i < cc_features.num_inputs; i++) { vs_len += sprintf(vs_buf + vs_len, "attribute vec%d aInput%d;\n", cc_features.opt_alpha ? 4 : 3, i + 1); vs_len += sprintf(vs_buf + vs_len, "varying vec%d vInput%d;\n", cc_features.opt_alpha ? 4 : 3, i + 1); @@ -243,6 +267,9 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad if (cc_features.opt_fog) { append_line(vs_buf, &vs_len, "vFog = aFog;"); } + if (cc_features.opt_grayscale) { + append_line(vs_buf, &vs_len, "vGrayscaleColor = aGrayscaleColor;"); + } for (int i = 0; i < cc_features.num_inputs; i++) { vs_len += sprintf(vs_buf + vs_len, "vInput%d = aInput%d;\n", i + 1, i + 1); } @@ -265,6 +292,9 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad if (cc_features.opt_fog) { append_line(fs_buf, &fs_len, "varying vec4 vFog;"); } + if (cc_features.opt_grayscale) { + append_line(fs_buf, &fs_len, "varying vec4 vGrayscaleColor;"); + } for (int i = 0; i < cc_features.num_inputs; i++) { fs_len += sprintf(fs_buf + fs_len, "varying vec%d vInput%d;\n", cc_features.opt_alpha ? 4 : 3, i + 1); } @@ -277,7 +307,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad if (cc_features.opt_alpha && cc_features.opt_noise) { append_line(fs_buf, &fs_len, "uniform int frame_count;"); - append_line(fs_buf, &fs_len, "uniform int window_height;"); + append_line(fs_buf, &fs_len, "uniform float noise_scale;"); append_line(fs_buf, &fs_len, "float random(in vec3 value) {"); append_line(fs_buf, &fs_len, " float random = dot(sin(value), vec3(12.9898, 78.233, 37.719));"); @@ -285,21 +315,42 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad append_line(fs_buf, &fs_len, "}"); } + if (current_filter_mode == THREE_POINT) { + append_line(fs_buf, &fs_len, "#define TEX_OFFSET(off) texture2D(tex, texCoord - (off)/texSize)"); + append_line(fs_buf, &fs_len, "vec4 filter3point(in sampler2D tex, in vec2 texCoord, in vec2 texSize) {"); + append_line(fs_buf, &fs_len, " vec2 offset = fract(texCoord*texSize - vec2(0.5));"); + append_line(fs_buf, &fs_len, " offset -= step(1.0, offset.x + offset.y);"); + append_line(fs_buf, &fs_len, " vec4 c0 = TEX_OFFSET(offset);"); + append_line(fs_buf, &fs_len, " vec4 c1 = TEX_OFFSET(vec2(offset.x - sign(offset.x), offset.y));"); + append_line(fs_buf, &fs_len, " vec4 c2 = TEX_OFFSET(vec2(offset.x, offset.y - sign(offset.y)));"); + append_line(fs_buf, &fs_len, " return c0 + abs(offset.x)*(c1-c0) + abs(offset.y)*(c2-c0);"); + append_line(fs_buf, &fs_len, "}"); + append_line(fs_buf, &fs_len, "vec4 hookTexture2D(in sampler2D tex, in vec2 uv, in vec2 texSize) {"); + append_line(fs_buf, &fs_len, " return filter3point(tex, uv, texSize);"); + append_line(fs_buf, &fs_len, "}"); + } else { + append_line(fs_buf, &fs_len, "vec4 hookTexture2D(in sampler2D tex, in vec2 uv, in vec2 texSize) {"); + append_line(fs_buf, &fs_len, " return texture2D(tex, uv);"); + append_line(fs_buf, &fs_len, "}"); + } + append_line(fs_buf, &fs_len, "void main() {"); for (int i = 0; i < 2; i++) { if (cc_features.used_textures[i]) { bool s = cc_features.clamp[i][0], t = cc_features.clamp[i][1]; + + fs_len += sprintf(fs_buf + fs_len, "vec2 texSize%d = textureSize(uTex%d, 0);\n", i, i); + if (!s && !t) { - fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = texture2D(uTex%d, vTexCoord%d);\n", i, i, i); + fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = hookTexture2D(uTex%d, vTexCoord%d, texSize%d);\n", i, i, i, i); } else { - fs_len += sprintf(fs_buf + fs_len, "vec2 texSize%d = textureSize(uTex%d, 0);\n", i, i); if (s && t) { - fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = texture2D(uTex%d, clamp(vTexCoord%d, 0.5 / texSize%d, vec2(vTexClampS%d, vTexClampT%d)));\n", i, i, i, i, i, i); + fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = hookTexture2D(uTex%d, clamp(vTexCoord%d, 0.5 / texSize%d, vec2(vTexClampS%d, vTexClampT%d)), texSize%d);\n", i, i, i, i, i, i, i); } else if (s) { - fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = texture2D(uTex%d, vec2(clamp(vTexCoord%d.s, 0.5 / texSize%d.s, vTexClampS%d), vTexCoord%d.t));\n", i, i, i, i, i, i); + fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = hookTexture2D(uTex%d, vec2(clamp(vTexCoord%d.s, 0.5 / texSize%d.s, vTexClampS%d), vTexCoord%d.t), texSize%d);\n", i, i, i, i, i, i, i); } else { - fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = texture2D(uTex%d, vec2(vTexCoord%d.s, clamp(vTexCoord%d.t, 0.5 / texSize%d.t, vTexClampT%d)));\n", i, i, i, i, i, i); + fs_len += sprintf(fs_buf + fs_len, "vec4 texVal%d = hookTexture2D(uTex%d, vec2(vTexCoord%d.s, clamp(vTexCoord%d.t, 0.5 / texSize%d.t, vTexClampT%d)), texSize%d);\n", i, i, i, i, i, i, i); } } } @@ -338,7 +389,13 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad } if (cc_features.opt_alpha && cc_features.opt_noise) { - append_line(fs_buf, &fs_len, "texel.a *= floor(clamp(random(vec3(floor(gl_FragCoord.xy * (240.0 / float(window_height))), float(frame_count))) + texel.a, 0.0, 1.0));"); + append_line(fs_buf, &fs_len, "texel.a *= floor(clamp(random(vec3(floor(gl_FragCoord.xy * noise_scale), float(frame_count))) + texel.a, 0.0, 1.0));"); + } + + if (cc_features.opt_grayscale) { + append_line(fs_buf, &fs_len, "float intensity = (texel.r + texel.g + texel.b) / 3.0;"); + append_line(fs_buf, &fs_len, "vec3 new_texel = vGrayscaleColor.rgb * intensity;"); + append_line(fs_buf, &fs_len, "texel.rgb = mix(texel.rgb, new_texel, vGrayscaleColor.a);"); } if (cc_features.opt_alpha) { @@ -389,9 +446,9 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad GLint max_length = 0; glGetShaderiv(fragment_shader, GL_INFO_LOG_LENGTH, &max_length); char error_log[1024]; - //fprintf(stderr, "Fragment shader compilation failed\n"); + fprintf(stderr, "Fragment shader compilation failed\n"); glGetShaderInfoLog(fragment_shader, max_length, &max_length, &error_log[0]); - //fprintf(stderr, "%s\n", &error_log[0]); + fprintf(stderr, "%s\n", &error_log[0]); abort(); } @@ -432,6 +489,12 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad ++cnt; } + if (cc_features.opt_grayscale) { + prg->attrib_locations[cnt] = glGetAttribLocation(shader_program, "aGrayscaleColor"); + prg->attrib_sizes[cnt] = 4; + ++cnt; + } + for (int i = 0; i < cc_features.num_inputs; i++) { char name[16]; sprintf(name, "aInput%d", i + 1); @@ -460,7 +523,7 @@ static struct ShaderProgram* gfx_opengl_create_and_load_new_shader(uint64_t shad if (cc_features.opt_alpha && cc_features.opt_noise) { prg->frame_count_location = glGetUniformLocation(shader_program, "frame_count"); - prg->window_height_location = glGetUniformLocation(shader_program, "window_height"); + prg->noise_scale_location = glGetUniformLocation(shader_program, "noise_scale"); prg->used_noise = true; } else { prg->used_noise = false; @@ -496,7 +559,7 @@ static void gfx_opengl_select_texture(int tile, GLuint texture_id) { } static void gfx_opengl_upload_texture(const uint8_t *rgba32_buf, uint32_t width, uint32_t height) { - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba32_buf); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, rgba32_buf); } static uint32_t gfx_cm_to_opengl(uint32_t val) { @@ -510,12 +573,14 @@ static uint32_t gfx_cm_to_opengl(uint32_t val) { case G_TX_NOMIRROR | G_TX_WRAP: return GL_REPEAT; } + return 0; } static void gfx_opengl_set_sampler_parameters(int tile, bool linear_filter, uint32_t cms, uint32_t cmt) { + const GLint filter = linear_filter && current_filter_mode == LINEAR ? GL_LINEAR : GL_NEAREST; glActiveTexture(GL_TEXTURE0 + tile); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, linear_filter ? GL_LINEAR : GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, filter); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, filter); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, gfx_cm_to_opengl(cms)); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, gfx_cm_to_opengl(cmt)); } @@ -543,7 +608,6 @@ static void gfx_opengl_set_zmode_decal(bool zmode_decal) { static void gfx_opengl_set_viewport(int x, int y, int width, int height) { glViewport(x, y, width, height); - current_height = height; } static void gfx_opengl_set_scissor(int x, int y, int width, int height) { @@ -564,10 +628,6 @@ static void gfx_opengl_draw_triangles(float buf_vbo[], size_t buf_vbo_len, size_ glDrawArrays(GL_TRIANGLES, 0, 3 * buf_vbo_num_tris); } -static unsigned int framebuffer; -static unsigned int textureColorbuffer; -static unsigned int rbo; - static void gfx_opengl_init(void) { //#if FOR_WINDOWS glewInit(); @@ -576,137 +636,230 @@ static void gfx_opengl_init(void) { glGenBuffers(1, &opengl_vbo); glBindBuffer(GL_ARRAY_BUFFER, opengl_vbo); - glGenFramebuffers(1, &framebuffer); - glGenTextures(1, &textureColorbuffer); - glGenRenderbuffers(1, &rbo); - - SohUtils::saveEnvironmentVar("framebuffer", std::to_string(textureColorbuffer)); + glEnable(GL_DEPTH_CLAMP); glDepthFunc(GL_LEQUAL); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + + framebuffers.resize(1); // for the default screen buffer + + glGenRenderbuffers(1, &pixel_depth_rb); + glBindRenderbuffer(GL_RENDERBUFFER, pixel_depth_rb); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1, 1); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + + glGenFramebuffers(1, &pixel_depth_fb); + glBindFramebuffer(GL_FRAMEBUFFER, pixel_depth_fb); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, pixel_depth_rb); + glBindFramebuffer(GL_FRAMEBUFFER, 0); + + pixel_depth_rb_size = 1; } static void gfx_opengl_on_resize(void) { } static void gfx_opengl_start_frame(void) { - GLsizei framebuffer_width = gfx_current_dimensions.width; - GLsizei framebuffer_height = gfx_current_dimensions.height; - glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); - std::shared_ptr wnd = Ship::GlobalCtx2::GetInstance()->GetWindow(); - glBindTexture(GL_TEXTURE_2D, textureColorbuffer); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, framebuffer_width, framebuffer_height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureColorbuffer, 0); - glBindRenderbuffer(GL_RENDERBUFFER, rbo); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, framebuffer_width, framebuffer_height); // use a single renderbuffer object for both a depth AND stencil buffer. - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo); // now actually attach it - glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); - frame_count++; - - glDisable(GL_SCISSOR_TEST); - glDepthMask(GL_TRUE); - glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - glEnable(GL_SCISSOR_TEST); - glEnable(GL_DEPTH_CLAMP); - current_depth_mask = true; } static void gfx_opengl_end_frame(void) { - - glBindFramebuffer(GL_FRAMEBUFFER, 0); - glClearColor(1.0f, 1.0f, 1.0f, 1.0f); - glClear(GL_COLOR_BUFFER_BIT); - - GLint last_program; - glGetIntegerv(GL_CURRENT_PROGRAM, &last_program); - glUseProgram(0); - SohImGui::Draw(); - glUseProgram(last_program); + glFlush(); } static void gfx_opengl_finish_render(void) { } -static int gfx_opengl_create_framebuffer(uint32_t width, uint32_t height) { - GLuint textureColorbuffer; - - glGenTextures(1, &textureColorbuffer); - glBindTexture(GL_TEXTURE_2D, textureColorbuffer); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); +static int gfx_opengl_create_framebuffer() { + GLuint clrbuf; + glGenTextures(1, &clrbuf); + glBindTexture(GL_TEXTURE_2D, clrbuf); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, 1, 1, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glBindTexture(GL_TEXTURE_2D, 0); + GLuint clrbuf_msaa; + glGenRenderbuffers(1, &clrbuf_msaa); + GLuint rbo; glGenRenderbuffers(1, &rbo); glBindRenderbuffer(GL_RENDERBUFFER, rbo); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, 1, 1); glBindRenderbuffer(GL_RENDERBUFFER, 0); GLuint fbo; glGenFramebuffers(1, &fbo); - glBindFramebuffer(GL_FRAMEBUFFER, fbo); - glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureColorbuffer, 0); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, rbo); - glBindFramebuffer(GL_FRAMEBUFFER, fbo); + size_t i = framebuffers.size(); + framebuffers.resize(i + 1); - fb2tex[fbo] = make_pair(textureColorbuffer, rbo); + framebuffers[i].fbo = fbo; + framebuffers[i].clrbuf = clrbuf; + framebuffers[i].clrbuf_msaa = clrbuf_msaa; + framebuffers[i].rbo = rbo; - //glBindFramebuffer(GL_FRAMEBUFFER, 0); - - return fbo; + return i; } -static void gfx_opengl_resize_framebuffer(int fb, uint32_t width, uint32_t height) { - glBindTexture(GL_TEXTURE_2D, fb2tex[fb].first); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); - glBindTexture(GL_TEXTURE_2D, 0); +static void gfx_opengl_update_framebuffer_parameters(int fb_id, uint32_t width, uint32_t height, uint32_t msaa_level, bool opengl_invert_y, bool render_target, bool has_depth_buffer, bool can_extract_depth) { + Framebuffer& fb = framebuffers[fb_id]; - glBindRenderbuffer(GL_RENDERBUFFER, fb2tex[fb].second); - glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); - glBindRenderbuffer(GL_RENDERBUFFER, 0); + width = max(width, 1U); + height = max(height, 1U); + + glBindFramebuffer(GL_FRAMEBUFFER, fb.fbo); + + if (fb_id != 0) { + if (fb.width != width || fb.height != height || fb.msaa_level != msaa_level) { + if (msaa_level <= 1) { + glBindTexture(GL_TEXTURE_2D, fb.clrbuf); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, 0, GL_RGB, GL_UNSIGNED_BYTE, NULL); + glBindTexture(GL_TEXTURE_2D, 0); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fb.clrbuf, 0); + } else { + glBindRenderbuffer(GL_RENDERBUFFER, fb.clrbuf_msaa); + glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa_level, GL_RGB8, width, height); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, fb.clrbuf_msaa); + } + } + + if (has_depth_buffer && (fb.width != width || fb.height != height || fb.msaa_level != msaa_level || !fb.has_depth_buffer)) { + glBindRenderbuffer(GL_RENDERBUFFER, fb.rbo); + if (msaa_level <= 1) { + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, width, height); + } else { + glRenderbufferStorageMultisample(GL_RENDERBUFFER, msaa_level, GL_DEPTH24_STENCIL8, width, height); + } + glBindRenderbuffer(GL_RENDERBUFFER, 0); + } + + if (!fb.has_depth_buffer && has_depth_buffer) { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, fb.rbo); + } else if (fb.has_depth_buffer && !has_depth_buffer) { + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0); + } + } + + fb.width = width; + fb.height = height; + fb.has_depth_buffer = has_depth_buffer; + fb.msaa_level = msaa_level; + fb.invert_y = opengl_invert_y; } -void gfx_opengl_set_framebuffer(int fb) -{ - glClipControl(GL_UPPER_LEFT, GL_NEGATIVE_ONE_TO_ONE); // Set origin to upper left corner, to match N64 and DX11 - glBindFramebuffer(GL_FRAMEBUFFER_EXT, fb); +void gfx_opengl_start_draw_to_framebuffer(int fb_id, float noise_scale) { + Framebuffer& fb = framebuffers[fb_id]; + if (noise_scale != 0.0f) { + current_noise_scale = 1.0f / noise_scale; + } + + glBindFramebuffer(GL_FRAMEBUFFER, fb.fbo); + + current_framebuffer = fb_id; +} + +void gfx_opengl_clear_framebuffer() { + glDisable(GL_SCISSOR_TEST); glDepthMask(GL_TRUE); glClearColor(0.0f, 0.0f, 0.0f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glDepthMask(current_depth_mask ? GL_TRUE : GL_FALSE); + glEnable(GL_SCISSOR_TEST); } -void gfx_opengl_reset_framebuffer(void) -{ - glBindFramebuffer(GL_FRAMEBUFFER, 0); - - glBindFramebuffer(GL_FRAMEBUFFER_EXT, framebuffer); - glClipControl(GL_LOWER_LEFT, GL_NEGATIVE_ONE_TO_ONE); +void gfx_opengl_resolve_msaa_color_buffer(int fb_id_target, int fb_id_source) { + Framebuffer& fb_dst = framebuffers[fb_id_target]; + Framebuffer& fb_src = framebuffers[fb_id_source]; + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, fb_dst.fbo); + glBindFramebuffer(GL_READ_FRAMEBUFFER, fb_src.fbo); + glBlitFramebuffer(0, 0, fb_src.width, fb_src.height, 0, 0, fb_dst.width, fb_dst.height, GL_COLOR_BUFFER_BIT, GL_NEAREST); + glBindFramebuffer(GL_FRAMEBUFFER, current_framebuffer); } -void gfx_opengl_select_texture_fb(int fbID) -{ +void *gfx_opengl_get_framebuffer_texture_id(int fb_id) { + return (void *)(uintptr_t)framebuffers[fb_id].clrbuf; +} + +void gfx_opengl_select_texture_fb(int fb_id) { //glDisable(GL_DEPTH_TEST); glActiveTexture(GL_TEXTURE0 + 0); - glBindTexture(GL_TEXTURE_2D, fb2tex[fbID].first); + glBindTexture(GL_TEXTURE_2D, framebuffers[fb_id].clrbuf); } -static uint16_t gfx_opengl_get_pixel_depth(float x, float y) { - float depth; - glBindFramebuffer(GL_FRAMEBUFFER, framebuffer); - glReadPixels(x, y, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, &depth); - glBindFramebuffer(GL_FRAMEBUFFER, 0); - return depth * 65532.0f; +static std::map, uint16_t> gfx_opengl_get_pixel_depth(int fb_id, const std::set>& coordinates) { + std::map, uint16_t> res; + + Framebuffer& fb = framebuffers[fb_id]; + + if (coordinates.size() == 1) { + uint32_t depth_stencil_value; + glBindFramebuffer(GL_FRAMEBUFFER, fb.fbo); + int x = coordinates.begin()->first; + int y = coordinates.begin()->second; + glReadPixels(x, fb.invert_y ? fb.height - y : y, 1, 1, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, &depth_stencil_value); + res.emplace(*coordinates.begin(), (depth_stencil_value >> 18) << 2); + } else { + if (pixel_depth_rb_size < coordinates.size()) { + // Resizing a renderbuffer seems broken with Intel's driver, so recreate one instead. + glBindFramebuffer(GL_FRAMEBUFFER, pixel_depth_fb); + glDeleteRenderbuffers(1, &pixel_depth_rb); + glGenRenderbuffers(1, &pixel_depth_rb); + glBindRenderbuffer(GL_RENDERBUFFER, pixel_depth_rb); + glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, coordinates.size(), 1); + glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, pixel_depth_rb); + glBindRenderbuffer(GL_RENDERBUFFER, 0); + + pixel_depth_rb_size = coordinates.size(); + } + + glBindFramebuffer(GL_READ_FRAMEBUFFER, fb.fbo); + glBindFramebuffer(GL_DRAW_FRAMEBUFFER, pixel_depth_fb); + + glDisable(GL_SCISSOR_TEST); // needed for the blit operation + + { + size_t i = 0; + for (const auto& coord : coordinates) { + int x = coord.first; + int y = coord.second; + if (fb.invert_y) { + y = fb.height - y; + } + glBlitFramebuffer(x, y, x + 1, y + 1, i, 0, i + 1, 1, GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); + ++i; + } + } + + glBindFramebuffer(GL_READ_FRAMEBUFFER, pixel_depth_fb); + vector depth_stencil_values(coordinates.size()); + glReadPixels(0, 0, coordinates.size(), 1, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, depth_stencil_values.data()); + + { + size_t i = 0; + for (const auto& coord : coordinates) { + res.emplace(coord, (depth_stencil_values[i++] >> 18) << 2); + } + } + } + + glBindFramebuffer(GL_FRAMEBUFFER, current_framebuffer); + + return res; +} + +void gfx_opengl_set_texture_filter(FilteringMode mode) { + current_filter_mode = mode; + gfx_texture_cache_clear(); +} + +FilteringMode gfx_opengl_get_texture_filter(void) { + return current_filter_mode; } struct GfxRenderingAPI gfx_opengl_api = { - gfx_opengl_z_is_from_0_to_1, + gfx_opengl_get_clip_parameters, gfx_opengl_unload_shader, gfx_opengl_load_shader, gfx_opengl_create_and_load_new_shader, @@ -717,7 +870,6 @@ struct GfxRenderingAPI gfx_opengl_api = { gfx_opengl_upload_texture, gfx_opengl_set_sampler_parameters, gfx_opengl_set_depth_test_and_mask, - gfx_opengl_get_pixel_depth, gfx_opengl_set_zmode_decal, gfx_opengl_set_viewport, gfx_opengl_set_scissor, @@ -729,11 +881,16 @@ struct GfxRenderingAPI gfx_opengl_api = { gfx_opengl_end_frame, gfx_opengl_finish_render, gfx_opengl_create_framebuffer, - gfx_opengl_resize_framebuffer, - gfx_opengl_set_framebuffer, - gfx_opengl_reset_framebuffer, + gfx_opengl_update_framebuffer_parameters, + gfx_opengl_start_draw_to_framebuffer, + gfx_opengl_clear_framebuffer, + gfx_opengl_resolve_msaa_color_buffer, + gfx_opengl_get_pixel_depth, + gfx_opengl_get_framebuffer_texture_id, gfx_opengl_select_texture_fb, - gfx_opengl_delete_texture + gfx_opengl_delete_texture, + gfx_opengl_set_texture_filter, + gfx_opengl_get_texture_filter }; #endif diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp index 3f7bd7f9b..6f7e8c271 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp @@ -7,8 +7,10 @@ #include #include +#include #include #include +#include #ifndef _LANGUAGE_C #define _LANGUAGE_C @@ -27,6 +29,10 @@ #include "../../luslog.h" #include "../StrHash64.h" +#include "../../SohImGuiImpl.h" +#include "../../Environment.h" +#include "../../GameVersions.h" +#include "../../ResourceMgr.h" // OTRTODO: fix header files for these extern "C" { @@ -42,6 +48,8 @@ extern "C" { using namespace std; +#define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1) + #define SUPPORT_CHECK(x) assert(x) // SCALE_M_N: upscale/downscale M-bit integer to N-bit @@ -71,10 +79,6 @@ struct RGBA { uint8_t r, g, b, a; }; -struct XYWidthHeight { - uint16_t x, y, width, height; -}; - struct LoadedVertex { float x, y, z, w; float u, v; @@ -125,7 +129,7 @@ static struct RSP { } rsp; static struct RDP { - const uint8_t *palette; + const uint8_t *palettes[2]; struct { const uint8_t *addr; uint8_t siz; @@ -145,6 +149,7 @@ static struct RDP { uint8_t cms, cmt; uint8_t shifts, shiftt; uint16_t uls, ult, lrs, lrt; // U10.2 + uint16_t tmem; // 0-511, in 64-bit word units uint32_t line_size_bytes; uint8_t palette; uint8_t tmem_index; // 0 or 1 for offset 0 kB or offset 2 kB, respectively @@ -155,9 +160,10 @@ static struct RDP { uint32_t other_mode_l, other_mode_h; uint64_t combine_mode; + bool grayscale; uint8_t prim_lod_fraction; - struct RGBA env_color, prim_color, fog_color, fill_color; + struct RGBA env_color, prim_color, fog_color, fill_color, grayscale_color; struct XYWidthHeight viewport, scissor; bool viewport_or_scissor_changed; void *z_buf_address; @@ -173,11 +179,23 @@ static struct RenderingState { TextureCacheNode *textures[2]; } rendering_state; +struct GfxDimensions gfx_current_window_dimensions; struct GfxDimensions gfx_current_dimensions; static struct GfxDimensions gfx_prev_dimensions; +struct XYWidthHeight gfx_current_game_window_viewport; + +static bool game_renders_to_framebuffer; +static int game_framebuffer; +static int game_framebuffer_msaa_resolved; + +uint32_t gfx_msaa_level = 1; + +static bool has_drawn_imgui_menu; static bool dropped_frame; +static const std::unordered_map *current_mtx_replacements; + static float buf_vbo[MAX_BUFFERED * (32 * 3)]; // 3 vertices in a triangle and 32 floats per vtx static size_t buf_vbo_len; static size_t buf_vbo_num_tris; @@ -197,7 +215,10 @@ static bool fbActive = 0; static map::iterator active_fb; static map framebuffers; -#ifdef _MSC_VER +static set> get_pixel_depth_pending; +static map, uint16_t> get_pixel_depth_cached; + +#ifdef _WIN32 // TODO: Properly implement for MSVC static unsigned long get_time(void) { @@ -435,15 +456,15 @@ static void gfx_generate_cc(struct ColorCombiner *comb, uint64_t cc_id) { val = SHADER_COMBINED; break; } - // fallthrough for G_ACMUX_LOD_FRACTION c[i][1][j] = G_CCMUX_LOD_FRACTION; + [[fallthrough]]; // for G_ACMUX_LOD_FRACTION case G_ACMUX_1: //case G_ACMUX_PRIM_LOD_FRAC: same numerical value if (j != 2) { val = SHADER_1; break; } - // fallthrough for G_ACMUX_PRIM_LOD_FRAC + [[fallthrough]]; // for G_ACMUX_PRIM_LOD_FRAC case G_ACMUX_PRIMITIVE: case G_ACMUX_SHADE: case G_ACMUX_ENVIRONMENT: @@ -490,8 +511,22 @@ void gfx_texture_cache_clear() gfx_texture_cache.lru.clear(); } -static bool gfx_texture_cache_lookup(int i, TextureCacheNode **n, const uint8_t *orig_addr, uint32_t fmt, uint32_t siz, uint32_t palette_index) { - TextureCacheKey key = { orig_addr, fmt, siz, palette_index }; +static bool gfx_texture_cache_lookup(int i, int tile) { + uint8_t fmt = rdp.texture_tile[tile].fmt; + uint8_t siz = rdp.texture_tile[tile].siz; + uint32_t tmem_index = rdp.texture_tile[tile].tmem_index; + + TextureCacheNode** n = &rendering_state.textures[i]; + const uint8_t* orig_addr = rdp.loaded_texture[tmem_index].addr; + uint8_t palette_index = rdp.texture_tile[tile].palette; + + TextureCacheKey key; + if (fmt == G_IM_FMT_CI) { + key = { orig_addr, { rdp.palettes[0], rdp.palettes[1] }, fmt, siz, palette_index }; + } else { + key = { orig_addr, { }, fmt, siz, palette_index }; + } + auto it = gfx_texture_cache.map.find(key); if (it != gfx_texture_cache.map.end()) { @@ -538,7 +573,7 @@ static void gfx_texture_cache_delete(const uint8_t* orig_addr) if (it->first.texture_addr == orig_addr) { gfx_texture_cache.lru.erase(*(list::iterator*)&it->second.lru_location); gfx_texture_cache.free_texture_ids.push_back(it->second.texture_id); - gfx_texture_cache.map.erase(it); + gfx_texture_cache.map.erase(it->first); again = true; break; } @@ -735,7 +770,8 @@ static void import_texture_ci4(int tile) { uint32_t size_bytes = rdp.loaded_texture[rdp.texture_tile[tile].tmem_index].size_bytes; uint32_t full_image_line_size_bytes = rdp.loaded_texture[rdp.texture_tile[tile].tmem_index].full_image_line_size_bytes; uint32_t line_size_bytes = rdp.loaded_texture[rdp.texture_tile[tile].tmem_index].line_size_bytes; - const uint8_t *palette = rdp.palette + rdp.texture_tile[tile].palette * 16 * 2; // 16 pixel entries, 16 bits each + uint32_t pal_idx = rdp.texture_tile[tile].palette; // 0-15 + const uint8_t *palette = rdp.palettes[pal_idx / 8] + (pal_idx % 8) * 16 * 2; // 16 pixel entries, 16 bits each SUPPORT_CHECK(full_image_line_size_bytes == line_size_bytes); for (uint32_t i = 0; i < size_bytes * 2; i++) { @@ -770,7 +806,7 @@ static void import_texture_ci8(int tile) { { for (uint32_t k = 0; k < line_size_bytes; i++, k++, j++) { uint8_t idx = addr[j]; - uint16_t col16 = (rdp.palette[idx * 2] << 8) | rdp.palette[idx * 2 + 1]; // Big endian load + uint16_t col16 = (rdp.palettes[idx / 128][(idx % 128) * 2] << 8) | rdp.palettes[idx / 128][(idx % 128) * 2 + 1]; // Big endian load uint8_t a = col16 & 1; uint8_t r = col16 >> 11; uint8_t g = (col16 >> 6) & 0x1f; @@ -799,23 +835,7 @@ static void import_texture(int i, int tile) { uint8_t siz = rdp.texture_tile[tile].siz; uint32_t tmem_index = rdp.texture_tile[tile].tmem_index; - // OTRTODO: Move it to a function to be faster - // ModInternal::bindHook(LOOKUP_TEXTURE); - // ModInternal::initBindHook(8, - // HOOK_PARAMETER("gfx_api", gfx_get_current_rendering_api()), - // HOOK_PARAMETER("path", rdp.loaded_texture[tmem_index].otr_path), - // HOOK_PARAMETER("node", &rendering_state.textures[i]), - // HOOK_PARAMETER("fmt", &fmt), - // HOOK_PARAMETER("siz", &siz), - // HOOK_PARAMETER("tile", &i), - // HOOK_PARAMETER("palette", &rdp.texture_tile[tile].palette), - // HOOK_PARAMETER("addr", const_cast(rdp.loaded_texture[tmem_index].addr)) - // ); - // - // if (ModInternal::callBindHook(0)) - // return; - - if (gfx_texture_cache_lookup(i, &rendering_state.textures[i], rdp.loaded_texture[tmem_index].addr, fmt, siz, rdp.texture_tile[tile].palette)) + if (gfx_texture_cache_lookup(i, tile)) { return; } @@ -900,20 +920,31 @@ static void gfx_matrix_mul(float res[4][4], const float a[4][4], const float b[4 static void gfx_sp_matrix(uint8_t parameters, const int32_t *addr) { float matrix[4][4]; -#ifndef GBI_FLOATS - // Original GBI where fixed point matrices are used - for (int i = 0; i < 4; i++) { - for (int j = 0; j < 4; j += 2) { - int32_t int_part = addr[i * 2 + j / 2]; - uint32_t frac_part = addr[8 + i * 2 + j / 2]; - matrix[i][j] = (int32_t)((int_part & 0xffff0000) | (frac_part >> 16)) / 65536.0f; - matrix[i][j + 1] = (int32_t)((int_part << 16) | (frac_part & 0xffff)) / 65536.0f; + + if (auto it = current_mtx_replacements->find((Mtx *)addr); it != current_mtx_replacements->end()) { + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j++) { + float v = it->second.mf[i][j]; + int as_int = (int)(v * 65536.0f); + matrix[i][j] = as_int * (1.0f / 65536.0f); + } + } + } else { +#ifndef GBI_FLOATS + // Original GBI where fixed point matrices are used + for (int i = 0; i < 4; i++) { + for (int j = 0; j < 4; j += 2) { + int32_t int_part = addr[i * 2 + j / 2]; + uint32_t frac_part = addr[8 + i * 2 + j / 2]; + matrix[i][j] = (int32_t)((int_part & 0xffff0000) | (frac_part >> 16)) / 65536.0f; + matrix[i][j + 1] = (int32_t)((int_part << 16) | (frac_part & 0xffff)) / 65536.0f; + } } - } #else - // For a modified GBI where fixed point values are replaced with floats - memcpy(matrix, addr, sizeof(matrix)); + // For a modified GBI where fixed point values are replaced with floats + memcpy(matrix, addr, sizeof(matrix)); #endif + } if (parameters & G_MTX_PROJECTION) { if (parameters & G_MTX_LOAD) { @@ -1194,7 +1225,6 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo uint64_t cc_id = rdp.combine_mode; - //bool use_alpha = (rdp.other_mode_l & (3 << 18)) == G_BL_1MA || (rdp.other_mode_l & (3 << 16)) == G_BL_1MA; bool use_alpha = (rdp.other_mode_l & (3 << 20)) == (G_BL_CLR_MEM << 20) && (rdp.other_mode_l & (3 << 16)) == (G_BL_1MA << 16); bool use_fog = (rdp.other_mode_l >> 30) == G_BL_CLR_FOG; bool texture_edge = (rdp.other_mode_l & CVG_X_ALPHA) == CVG_X_ALPHA; @@ -1202,6 +1232,7 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo bool use_2cyc = (rdp.other_mode_h & (3U << G_MDSFT_CYCLETYPE)) == G_CYC_2CYCLE; bool alpha_threshold = (rdp.other_mode_l & (3U << G_MDSFT_ALPHACOMPARE)) == G_AC_THRESHOLD; bool invisible = (rdp.other_mode_l & (3 << 24)) == (G_BL_0 << 24) && (rdp.other_mode_l & (3 << 20)) == (G_BL_CLR_MEM << 20); + bool use_grayscale = rdp.grayscale; if (texture_edge) { use_alpha = true; @@ -1214,12 +1245,13 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo if (use_2cyc) cc_id |= (uint64_t)SHADER_OPT_2CYC << CC_SHADER_OPT_POS; if (alpha_threshold) cc_id |= (uint64_t)SHADER_OPT_ALPHA_THRESHOLD << CC_SHADER_OPT_POS; if (invisible) cc_id |= (uint64_t)SHADER_OPT_INVISIBLE << CC_SHADER_OPT_POS; + if (use_grayscale) cc_id |= (uint64_t)SHADER_OPT_GRAYSCALE << CC_SHADER_OPT_POS; if (!use_alpha) { cc_id &= ~((0xfff << 16) | ((uint64_t)0xfff << 44)); } - struct ColorCombiner* comb = gfx_lookup_or_create_color_combiner(cc_id); + ColorCombiner* comb = gfx_lookup_or_create_color_combiner(cc_id); uint32_t tm = 0; uint32_t tex_width[2], tex_height[2], tex_width2[2], tex_height2[2]; @@ -1310,11 +1342,11 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo gfx_rapi->shader_get_info(prg, &num_inputs, used_textures); - bool z_is_from_0_to_1 = gfx_rapi->z_is_from_0_to_1(); + struct GfxClipParameters clip_parameters = gfx_rapi->get_clip_parameters(); for (int i = 0; i < 3; i++) { float z = v_arr[i]->z, w = v_arr[i]->w; - if (z_is_from_0_to_1) { + if (clip_parameters.z_is_from_0_to_1) { z = (z + w) / 2.0f; } @@ -1324,7 +1356,7 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo } buf_vbo[buf_vbo_len++] = v_arr[i]->x; - buf_vbo[buf_vbo_len++] = v_arr[i]->y; + buf_vbo[buf_vbo_len++] = clip_parameters.invert_y ? -v_arr[i]->y : v_arr[i]->y; buf_vbo[buf_vbo_len++] = z; buf_vbo[buf_vbo_len++] = w; @@ -1381,6 +1413,13 @@ static void gfx_sp_tri1(uint8_t vtx1_idx, uint8_t vtx2_idx, uint8_t vtx3_idx, bo buf_vbo[buf_vbo_len++] = v_arr[i]->color.a / 255.0f; // fog factor (not alpha) } + if (use_grayscale) { + buf_vbo[buf_vbo_len++] = rdp.grayscale_color.r / 255.0f; + buf_vbo[buf_vbo_len++] = rdp.grayscale_color.g / 255.0f; + buf_vbo[buf_vbo_len++] = rdp.grayscale_color.b / 255.0f; + buf_vbo[buf_vbo_len++] = rdp.grayscale_color.a / 255.0f; // lerp interpolation factor (not alpha) + } + for (int j = 0; j < num_inputs; j++) { struct RGBA* color = 0; struct RGBA tmp; @@ -1475,6 +1514,27 @@ static void gfx_sp_geometry_mode(uint32_t clear, uint32_t set) { rsp.geometry_mode |= set; } +static void gfx_adjust_viewport_or_scissor(XYWidthHeight *area) { + if (!fbActive) { + area->width *= RATIO_X; + area->height *= RATIO_Y; + area->x *= RATIO_X; + area->y = SCREEN_HEIGHT - area->y; + area->y *= RATIO_Y; + + if (!game_renders_to_framebuffer || (gfx_msaa_level > 1 && gfx_current_dimensions.width == gfx_current_game_window_viewport.width && gfx_current_dimensions.height == gfx_current_game_window_viewport.height)) { + area->x += gfx_current_game_window_viewport.x; + area->y += gfx_current_window_dimensions.height - (gfx_current_game_window_viewport.y + gfx_current_game_window_viewport.height); + } + } else { + area->width *= RATIO_Y; + area->height *= RATIO_Y; + area->x *= RATIO_Y; + area->y = active_fb->second.orig_height - area->y; + area->y *= RATIO_Y; + } +} + static void gfx_calc_and_set_viewport(const Vp_t *viewport) { // 2 bits fraction float width = 2.0f * viewport->vscale[0] / 4.0f; @@ -1482,25 +1542,13 @@ static void gfx_calc_and_set_viewport(const Vp_t *viewport) { float x = (viewport->vtrans[0] / 4.0f) - width / 2.0f; float y = ((viewport->vtrans[1] / 4.0f) + height / 2.0f); - if (!fbActive) { - width *= RATIO_X; - height *= RATIO_Y; - x *= RATIO_X; - y = SCREEN_HEIGHT - y; - y *= RATIO_Y; - } else { - width *= RATIO_Y; - height *= RATIO_Y; - x *= RATIO_Y; - y = active_fb->second.orig_height - y; - y *= RATIO_Y; - } - rdp.viewport.x = x; rdp.viewport.y = y; rdp.viewport.width = width; rdp.viewport.height = height; + gfx_adjust_viewport_or_scissor(&rdp.viewport); + rdp.viewport_or_scissor_changed = true; } @@ -1569,11 +1617,6 @@ static void gfx_sp_texture(uint16_t sc, uint16_t tc, uint8_t level, uint8_t tile rdp.textures_changed[1] = true; } - if (tile > 8) - { - int bp = 0; - } - rdp.first_tile_index = tile; } @@ -1583,25 +1626,13 @@ static void gfx_dp_set_scissor(uint32_t mode, uint32_t ulx, uint32_t uly, uint32 float width = (lrx - ulx) / 4.0f; float height = (lry - uly) / 4.0f; - if (!fbActive) { - x *= RATIO_X; - y = SCREEN_HEIGHT - y; - y *= RATIO_Y; - width *= RATIO_X; - height *= RATIO_Y; - } else { - width *= RATIO_Y; - height *= RATIO_Y; - x *= RATIO_Y; - y = active_fb->second.orig_height - y; - y *= RATIO_Y; - } - rdp.scissor.x = x; rdp.scissor.y = y; rdp.scissor.width = width; rdp.scissor.height = height; + gfx_adjust_viewport_or_scissor(&rdp.scissor); + rdp.viewport_or_scissor_changed = true; } @@ -1638,6 +1669,7 @@ static void gfx_dp_set_tile(uint8_t fmt, uint32_t siz, uint32_t line, uint32_t t int bp = 0; } + rdp.texture_tile[tile].tmem = tmem; //rdp.texture_tile[tile].tmem_index = tmem / 256; // tmem is the 64-bit word offset, so 256 words means 2 kB rdp.texture_tile[tile].tmem_index = tmem != 0; // assume one texture is loaded at address 0 and another texture at any other address rdp.textures_changed[0] = true; @@ -1654,10 +1686,19 @@ static void gfx_dp_set_tile_size(uint8_t tile, uint16_t uls, uint16_t ult, uint1 } static void gfx_dp_load_tlut(uint8_t tile, uint32_t high_index) { - //SUPPORT_CHECK(tile == G_TX_LOADTILE); - //SUPPORT_CHECK(rdp.texture_to_load.siz == G_IM_SIZ_16b); + SUPPORT_CHECK(tile == G_TX_LOADTILE); + SUPPORT_CHECK(rdp.texture_to_load.siz == G_IM_SIZ_16b); - rdp.palette = rdp.texture_to_load.addr; + SUPPORT_CHECK((rdp.texture_tile[tile].tmem == 256 && (high_index <= 127 || high_index == 255)) || (rdp.texture_tile[tile].tmem == 384 && high_index == 127)); + + if (rdp.texture_tile[tile].tmem == 256) { + rdp.palettes[0] = rdp.texture_to_load.addr; + if (high_index == 255) { + rdp.palettes[1] = rdp.texture_to_load.addr + 2 * 128; + } + } else { + rdp.palettes[1] = rdp.texture_to_load.addr; + } } static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, uint32_t dxt) { @@ -1671,7 +1712,7 @@ static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t SUPPORT_CHECK(ult == 0); // The lrs field rather seems to be number of pixels to load - uint32_t word_size_shift; + uint32_t word_size_shift = 0; switch (rdp.texture_to_load.siz) { case G_IM_SIZ_4b: word_size_shift = 0; // Or -1? It's unused in SM64 anyway. @@ -1699,7 +1740,7 @@ static void gfx_dp_load_block(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t static void gfx_dp_load_tile(uint8_t tile, uint32_t uls, uint32_t ult, uint32_t lrs, uint32_t lrt) { SUPPORT_CHECK(tile == G_TX_LOADTILE); - uint32_t word_size_shift; + uint32_t word_size_shift = 0; switch (rdp.texture_to_load.siz) { case G_IM_SIZ_4b: word_size_shift = 0; @@ -1779,6 +1820,13 @@ static inline uint32_t alpha_comb(uint32_t a, uint32_t b, uint32_t c, uint32_t d return (a & 7) | ((b & 7) << 3) | ((c & 7) << 6) | ((d & 7) << 9); } +static void gfx_dp_set_grayscale_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { + rdp.grayscale_color.r = r; + rdp.grayscale_color.g = g; + rdp.grayscale_color.b = b; + rdp.grayscale_color.a = a; +} + static void gfx_dp_set_env_color(uint8_t r, uint8_t g, uint8_t b, uint8_t a) { rdp.env_color.r = r; rdp.env_color.g = g; @@ -1861,10 +1909,12 @@ static void gfx_draw_rectangle(int32_t ulx, int32_t uly, int32_t lrx, int32_t lr ur->w = 1.0f; // The coordinates for texture rectangle shall bypass the viewport setting - struct XYWidthHeight default_viewport = { 0, 0, gfx_current_dimensions.width, gfx_current_dimensions.height }; + struct XYWidthHeight default_viewport = { 0, SCREEN_HEIGHT, SCREEN_WIDTH, SCREEN_HEIGHT }; struct XYWidthHeight viewport_saved = rdp.viewport; uint32_t geometry_mode_saved = rsp.geometry_mode; + gfx_adjust_viewport_or_scissor(&default_viewport); + rdp.viewport = default_viewport; rdp.viewport_or_scissor_changed = true; rsp.geometry_mode = 0; @@ -2030,12 +2080,11 @@ static void gfx_s2dex_bg_copy(const uObjBg* bg) { static inline void* seg_addr(uintptr_t w1) { // Segmented? - if (w1 >= 0xF0000000) + if (w1 & 1) { uint32_t segNum = (w1 >> 24); - segNum -= 0xF0; - uint32_t offset = w1 & 0x00FFFFFF; + uint32_t offset = w1 & 0x00FFFFFE; //offset = 0; // Cursed Malon bug if (segmentPointers[segNum] != 0) @@ -2052,7 +2101,7 @@ static inline void* seg_addr(uintptr_t w1) #define C0(pos, width) ((cmd->words.w0 >> (pos)) & ((1U << width) - 1)) #define C1(pos, width) ((cmd->words.w1 >> (pos)) & ((1U << width) - 1)) -int dListBP; +unsigned int dListBP; int matrixBP; uintptr_t clearMtx; @@ -2119,8 +2168,16 @@ static void gfx_run_dl(Gfx* cmd) { uintptr_t mtxAddr = cmd->words.w1; // OTRTODO: Temp way of dealing with gMtxClear. Need something more elegant in the future... - if (mtxAddr == 0xF012DB20 || mtxAddr == 0xF012DB40) - mtxAddr = clearMtx; + uint32_t gameVersion = Ship::GlobalCtx2::GetInstance()->GetResourceManager()->GetGameVersion(); + if (gameVersion == OOT_PAL_GC) { + if (mtxAddr == SEG_ADDR(0, 0x0FBC20)) { + mtxAddr = clearMtx; + } + } else { + if (mtxAddr == SEG_ADDR(0, 0x12DB20) || mtxAddr == SEG_ADDR(0, 0x12DB40)) { + mtxAddr = clearMtx; + } + } #ifdef F3DEX_GBI_2 gfx_sp_matrix(C0(0, 8) ^ G_MTX_PUSH, (const int32_t *) seg_addr(mtxAddr)); @@ -2220,7 +2277,7 @@ static void gfx_run_dl(Gfx* cmd) { cmd--; - if (ourHash != -1) + if (ourHash != (uint64_t)-1) ResourceMgr_RegisterResourcePatch(ourHash, cmd - dListStart, cmd->words.w1); cmd->words.w1 = (uintptr_t)vtx; @@ -2338,7 +2395,7 @@ static void gfx_run_dl(Gfx* cmd) { case G_QUAD: { int bp = 0; - // fallthrough + [[fallthrough]]; } #endif #if defined(F3DEX_GBI) || defined(F3DLP_GBI) @@ -2368,11 +2425,11 @@ static void gfx_run_dl(Gfx* cmd) { char* imgData = (char*)i; - if ((i & 0xF0000000) != 0xF0000000) + if ((i & 1) != 1) if (ResourceMgr_OTRSigCheck(imgData) == 1) i = (uintptr_t)ResourceMgr_LoadTexByName(imgData); - gfx_dp_set_texture_image(C0(21, 3), C0(19, 2), C0(0, 10), (void*) i, imgData); + gfx_dp_set_texture_image(C0(21, 3), C0(19, 2), C0(0, 10), (void*) i, imgData); break; } case G_SETTIMG_OTR: @@ -2381,15 +2438,15 @@ static void gfx_run_dl(Gfx* cmd) { cmd++; uint64_t hash = ((uint64_t)cmd->words.w0 << 32) + (uint64_t)cmd->words.w1; ResourceMgr_GetNameByCRC(hash, fileName); +#if _DEBUG && 0 char* tex = ResourceMgr_LoadTexByCRC(hash); - - -#if _DEBUG - //ResourceMgr_GetNameByCRC(hash, fileName); - //printf("G_SETTIMG_OTR: %s, %08X\n", fileName, hash); + ResourceMgr_GetNameByCRC(hash, fileName); + printf("G_SETTIMG_OTR: %s, %08X\n", fileName, hash); +#else + char* tex = NULL; #endif - if (addr != NULL) + if (addr != 0) { tex = (char*)addr; } @@ -2403,7 +2460,7 @@ static void gfx_run_dl(Gfx* cmd) { uintptr_t oldData = cmd->words.w1; cmd->words.w1 = (uintptr_t)tex; - if (ourHash != -1) + if (ourHash != (uint64_t)-1) ResourceMgr_RegisterResourcePatch(ourHash, cmd - dListStart, oldData); cmd++; @@ -2421,24 +2478,24 @@ static void gfx_run_dl(Gfx* cmd) { gfx_dp_set_texture_image(fmt, size, width, tex, fileName); cmd++; - } break; + } case G_SETFB: { gfx_flush(); fbActive = 1; active_fb = framebuffers.find(cmd->words.w1); - gfx_rapi->set_framebuffer(active_fb->first); - } + gfx_rapi->start_draw_to_framebuffer(active_fb->first, (float)active_fb->second.applied_height / active_fb->second.orig_height); + gfx_rapi->clear_framebuffer(); break; + } case G_RESETFB: { gfx_flush(); fbActive = 0; - gfx_rapi->reset_framebuffer(); + gfx_rapi->start_draw_to_framebuffer(game_renders_to_framebuffer ? game_framebuffer : 0, (float)gfx_current_dimensions.height / SCREEN_HEIGHT); break; } - break; case G_SETTIMG_FB: { gfx_flush(); @@ -2448,8 +2505,13 @@ static void gfx_run_dl(Gfx* cmd) { //if (texPtr != NULL) //gfx_dp_set_texture_image(C0(21, 3), C0(19, 2), C0(0, 10), texPtr); + break; + } + case G_SETGRAYSCALE: + { + rdp.grayscale = cmd->words.w1; + break; } - break; case G_LOADBLOCK: gfx_dp_load_block(C1(24, 3), C0(12, 12), C0(0, 12), C1(12, 12), C1(0, 12)); break; @@ -2477,6 +2539,9 @@ static void gfx_run_dl(Gfx* cmd) { case G_SETFILLCOLOR: gfx_dp_set_fill_color(cmd->words.w1); break; + case G_SETINTENSITY: + gfx_dp_set_grayscale_color(C1(24, 8), C1(16, 8), C1(8, 8), C1(0, 8)); + break; case G_SETCOMBINE: gfx_dp_set_combine_mode( color_comb(C0(20, 4), C1(28, 4), C0(15, 5), C1(15, 3)), @@ -2519,7 +2584,7 @@ static void gfx_run_dl(Gfx* cmd) { gfx_dp_texture_rectangle(ulx, uly, lrx, lry, tile, uls, ult, dsdx, dtdy, opcode == G_TEXRECTFLIP); break; } - case G_TEXRECT_WIDE: + case G_TEXRECT_WIDE: { int32_t lrx, lry, tile, ulx, uly; uint32_t uls, ult, dsdx, dtdy; @@ -2602,12 +2667,15 @@ void gfx_init(struct GfxWindowManagerAPI *wapi, struct GfxRenderingAPI *rapi, co gfx_rapi = rapi; gfx_wapi->init(game_name, start_in_fullscreen); gfx_rapi->init(); + gfx_rapi->update_framebuffer_parameters(0, SCREEN_WIDTH, SCREEN_HEIGHT, 1, false, true, true, true); gfx_current_dimensions.internal_mul = 1; gfx_current_dimensions.width = SCREEN_WIDTH; gfx_current_dimensions.height = SCREEN_HEIGHT; + game_framebuffer = gfx_rapi->create_framebuffer(); + game_framebuffer_msaa_resolved = gfx_rapi->create_framebuffer(); for (int i = 0; i < 16; i++) - segmentPointers[i] = NULL; + segmentPointers[i] = 0; // Used in the 120 star TAS static uint32_t precomp_shaders[] = { @@ -2653,7 +2721,9 @@ struct GfxRenderingAPI *gfx_get_current_rendering_api(void) { void gfx_start_frame(void) { gfx_wapi->handle_events(); - // gfx_wapi->get_dimensions(&gfx_current_dimensions.width, &gfx_current_dimensions.height); + gfx_wapi->get_dimensions(&gfx_current_window_dimensions.width, &gfx_current_window_dimensions.height); + SohImGui::DrawMainMenuAndCalculateGameSize(); + has_drawn_imgui_menu = true; if (gfx_current_dimensions.height == 0) { // Avoid division by zero gfx_current_dimensions.height = 1; @@ -2665,7 +2735,7 @@ void gfx_start_frame(void) { uint32_t width = fb.second.orig_width, height = fb.second.orig_height; gfx_adjust_width_height_for_scale(width, height); if (width != fb.second.applied_width || height != fb.second.applied_height) { - gfx_rapi->resize_framebuffer(fb.first, width, height); + gfx_rapi->update_framebuffer_parameters(fb.first, width, height, 1, true, true, true, true); fb.second.applied_width = width; fb.second.applied_height = height; } @@ -2673,28 +2743,81 @@ void gfx_start_frame(void) { } gfx_prev_dimensions = gfx_current_dimensions; + bool different_size = gfx_current_dimensions.width != gfx_current_game_window_viewport.width || gfx_current_dimensions.height != gfx_current_game_window_viewport.height; + if (different_size || gfx_msaa_level > 1) { + game_renders_to_framebuffer = true; + if (different_size) { + gfx_rapi->update_framebuffer_parameters(game_framebuffer, gfx_current_dimensions.width, gfx_current_dimensions.height, gfx_msaa_level, true, true, true, true); + } else { + // MSAA framebuffer needs to be resolved to an equally sized target when complete, which must therefore match the window size + gfx_rapi->update_framebuffer_parameters(game_framebuffer, gfx_current_window_dimensions.width, gfx_current_window_dimensions.height, gfx_msaa_level, false, true, true, true); + } + if (gfx_msaa_level > 1 && different_size) { + gfx_rapi->update_framebuffer_parameters(game_framebuffer_msaa_resolved, gfx_current_dimensions.width, gfx_current_dimensions.height, 1, false, false, false, false); + } + } else { + game_renders_to_framebuffer = false; + } + fbActive = 0; } -void gfx_run(Gfx *commands) { +void gfx_run(Gfx *commands, const std::unordered_map& mtx_replacements) { gfx_sp_reset(); //puts("New frame"); + get_pixel_depth_pending.clear(); + get_pixel_depth_cached.clear(); if (!gfx_wapi->start_frame()) { dropped_frame = true; + if (has_drawn_imgui_menu) { + SohImGui::DrawFramebufferAndGameInput(); + SohImGui::CancelFrame(); + has_drawn_imgui_menu = false; + } return; } dropped_frame = false; + if (!has_drawn_imgui_menu) { + SohImGui::DrawMainMenuAndCalculateGameSize(); + } + + current_mtx_replacements = &mtx_replacements; + double t0 = gfx_wapi->get_time(); + gfx_rapi->update_framebuffer_parameters(0, gfx_current_window_dimensions.width, gfx_current_window_dimensions.height, 1, false, true, true, !game_renders_to_framebuffer); gfx_rapi->start_frame(); + gfx_rapi->start_draw_to_framebuffer(game_renders_to_framebuffer ? game_framebuffer : 0, (float)gfx_current_dimensions.height / SCREEN_HEIGHT); + gfx_rapi->clear_framebuffer(); gfx_run_dl(commands); gfx_flush(); + SohUtils::saveEnvironmentVar("framebuffer", string()); + if (game_renders_to_framebuffer) { + gfx_rapi->start_draw_to_framebuffer(0, 1); + gfx_rapi->clear_framebuffer(); + + if (gfx_msaa_level > 1) { + bool different_size = gfx_current_dimensions.width != gfx_current_game_window_viewport.width || gfx_current_dimensions.height != gfx_current_game_window_viewport.height; + + if (different_size) { + gfx_rapi->resolve_msaa_color_buffer(game_framebuffer_msaa_resolved, game_framebuffer); + SohUtils::saveEnvironmentVar("framebuffer", std::to_string((uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer_msaa_resolved))); + } else { + gfx_rapi->resolve_msaa_color_buffer(0, game_framebuffer); + } + } else { + SohUtils::saveEnvironmentVar("framebuffer", std::to_string((uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer))); + } + } + SohImGui::DrawFramebufferAndGameInput(); + SohImGui::Render(); double t1 = gfx_wapi->get_time(); //printf("Process %f %f\n", t1, t1 - t0); gfx_rapi->end_frame(); gfx_wapi->swap_buffers_begin(); + has_drawn_imgui_menu = false; } void gfx_end_frame(void) { @@ -2711,21 +2834,47 @@ void gfx_set_framedivisor(int divisor) { int gfx_create_framebuffer(uint32_t width, uint32_t height) { uint32_t orig_width = width, orig_height = height; gfx_adjust_width_height_for_scale(width, height); - int fb = gfx_rapi->create_framebuffer(width, height); + int fb = gfx_rapi->create_framebuffer(); + gfx_rapi->update_framebuffer_parameters(fb, width, height, 1, true, true, true, true); framebuffers[fb] = { orig_width, orig_height, width, height }; return fb; } -void gfx_set_framebuffer(int fb) -{ - gfx_rapi->set_framebuffer(fb); +void gfx_set_framebuffer(int fb, float noise_scale) { + gfx_rapi->start_draw_to_framebuffer(fb, noise_scale); + gfx_rapi->clear_framebuffer(); } -void gfx_reset_framebuffer() -{ - gfx_rapi->reset_framebuffer(); +void gfx_reset_framebuffer() { + gfx_rapi->start_draw_to_framebuffer(0, (float)gfx_current_dimensions.height / SCREEN_HEIGHT); +} + +static void adjust_pixel_depth_coordinates(float& x, float& y) { + x = x * RATIO_Y - (SCREEN_WIDTH * RATIO_Y - gfx_current_dimensions.width) / 2; + y *= RATIO_Y; + if (!game_renders_to_framebuffer || (gfx_msaa_level > 1 && gfx_current_dimensions.width == gfx_current_game_window_viewport.width && gfx_current_dimensions.height == gfx_current_game_window_viewport.height)) { + x += gfx_current_game_window_viewport.x; + y += gfx_current_window_dimensions.height - (gfx_current_game_window_viewport.y + gfx_current_game_window_viewport.height); + } +} + +void gfx_get_pixel_depth_prepare(float x, float y) { + adjust_pixel_depth_coordinates(x, y); + get_pixel_depth_pending.emplace(x, y); } uint16_t gfx_get_pixel_depth(float x, float y) { - return gfx_rapi->get_pixel_depth(x * RATIO_Y - (SCREEN_WIDTH * RATIO_Y - gfx_current_dimensions.width) / 2, y * RATIO_Y); + adjust_pixel_depth_coordinates(x, y); + + if (auto it = get_pixel_depth_cached.find(make_pair(x, y)); it != get_pixel_depth_cached.end()) { + return it->second; + } + + get_pixel_depth_pending.emplace(x, y); + + map, uint16_t> res = gfx_rapi->get_pixel_depth(game_renders_to_framebuffer ? game_framebuffer : 0, get_pixel_depth_pending); + get_pixel_depth_cached.merge(res); + get_pixel_depth_pending.clear(); + + return get_pixel_depth_cached.find(make_pair(x, y))->second; } \ No newline at end of file diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_pc.h b/libultraship/libultraship/Lib/Fast3D/gfx_pc.h index 2e6a5a2a0..62f80ab3c 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_pc.h +++ b/libultraship/libultraship/Lib/Fast3D/gfx_pc.h @@ -4,12 +4,19 @@ #include #include #include +#include + +#include "U64/PR/ultra64/types.h" struct GfxRenderingAPI; struct GfxWindowManagerAPI; -struct GfxDimensions -{ +struct XYWidthHeight { + int16_t x, y; + uint32_t width, height; +}; + +struct GfxDimensions { uint32_t internal_mul; uint32_t width, height; float aspect_ratio; @@ -17,6 +24,7 @@ struct GfxDimensions struct TextureCacheKey { const uint8_t* texture_addr; + const uint8_t* palette_addrs[2]; uint8_t fmt, siz; uint8_t palette_index; @@ -46,22 +54,24 @@ struct TextureCacheValue { #endif }; -#ifdef __cplusplus extern "C" { -#endif -extern struct GfxDimensions gfx_current_dimensions; + +extern struct GfxDimensions gfx_current_window_dimensions; // The dimensions of the window +extern struct GfxDimensions gfx_current_dimensions; // The dimensions of the draw area the game draws to, before scaling (if applicable) +extern struct XYWidthHeight gfx_current_game_window_viewport; // The area of the window the game is drawn to, (0, 0) is top-left corner +extern uint32_t gfx_msaa_level; + +} void gfx_init(struct GfxWindowManagerAPI* wapi, struct GfxRenderingAPI* rapi, const char* game_name, bool start_in_fullscreen); struct GfxRenderingAPI* gfx_get_current_rendering_api(void); void gfx_start_frame(void); -void gfx_run(Gfx* commands); +void gfx_run(Gfx* commands, const std::unordered_map& mtx_replacements); void gfx_end_frame(void); void gfx_set_framedivisor(int); void gfx_texture_cache_clear(); -int gfx_create_framebuffer(uint32_t width, uint32_t height); +extern "C" int gfx_create_framebuffer(uint32_t width, uint32_t height); +void gfx_get_pixel_depth_prepare(float x, float y); uint16_t gfx_get_pixel_depth(float x, float y); -#ifdef __cplusplus -} -#endif #endif diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_rendering_api.h b/libultraship/libultraship/Lib/Fast3D/gfx_rendering_api.h index 9283ee236..6318be492 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_rendering_api.h +++ b/libultraship/libultraship/Lib/Fast3D/gfx_rendering_api.h @@ -5,10 +5,24 @@ #include #include +#include +#include + struct ShaderProgram; +struct GfxClipParameters { + bool z_is_from_0_to_1; + bool invert_y; +}; + +enum FilteringMode { + THREE_POINT, + LINEAR, + NONE +}; + struct GfxRenderingAPI { - bool (*z_is_from_0_to_1)(void); + struct GfxClipParameters (*get_clip_parameters)(void); void (*unload_shader)(struct ShaderProgram *old_prg); void (*load_shader)(struct ShaderProgram *new_prg); struct ShaderProgram *(*create_and_load_new_shader)(uint64_t shader_id0, uint32_t shader_id1); @@ -19,7 +33,6 @@ struct GfxRenderingAPI { void (*upload_texture)(const uint8_t *rgba32_buf, uint32_t width, uint32_t height); void (*set_sampler_parameters)(int sampler, bool linear_filter, uint32_t cms, uint32_t cmt); void (*set_depth_test_and_mask)(bool depth_test, bool z_upd); - uint16_t (*get_pixel_depth)(float x, float y); void (*set_zmode_decal)(bool zmode_decal); void (*set_viewport)(int x, int y, int width, int height); void (*set_scissor)(int x, int y, int width, int height); @@ -30,12 +43,17 @@ struct GfxRenderingAPI { void (*start_frame)(void); void (*end_frame)(void); void (*finish_render)(void); - int (*create_framebuffer)(uint32_t width, uint32_t height); - void (*resize_framebuffer)(int fb, uint32_t width, uint32_t height); - void (*set_framebuffer)(int fb); - void (*reset_framebuffer)(); - void (*select_texture_fb)(int fbID); + int (*create_framebuffer)(); + void (*update_framebuffer_parameters)(int fb_id, uint32_t width, uint32_t height, uint32_t msaa_level, bool opengl_invert_y, bool render_target, bool has_depth_buffer, bool can_extract_depth); + void (*start_draw_to_framebuffer)(int fb_id, float noise_scale); + void (*clear_framebuffer)(void); + void (*resolve_msaa_color_buffer)(int fb_id_target, int fb_id_source); + std::map, uint16_t> (*get_pixel_depth)(int fb_id, const std::set>& coordinates); + void *(*get_framebuffer_texture_id)(int fb_id); + void (*select_texture_fb)(int fb_id); void (*delete_texture)(uint32_t texID); + void (*set_texture_filter)(FilteringMode mode); + FilteringMode(*get_texture_filter)(void); }; #endif diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp index ffc46f369..e80097c81 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_sdl2.cpp @@ -1,6 +1,6 @@ #include -#if !defined(__linux__) && defined(ENABLE_OPENGL) +#if defined(ENABLE_OPENGL) #ifdef __MINGW32__ #define FOR_WINDOWS 1 @@ -23,7 +23,9 @@ #include "gfx_window_manager_api.h" #include "gfx_screen_config.h" +#ifdef _WIN32 #include +#endif #include #define GFX_API_NAME "SDL2 - OpenGL" @@ -41,7 +43,7 @@ static bool (*on_key_up_callback)(int scancode); static void (*on_all_keys_up_callback)(void); const SDL_Scancode windows_scancode_table[] = -{ +{ /* 0 1 2 3 4 5 6 7 */ /* 8 9 A B C D E F */ SDL_SCANCODE_UNKNOWN, SDL_SCANCODE_ESCAPE, SDL_SCANCODE_1, SDL_SCANCODE_2, SDL_SCANCODE_3, SDL_SCANCODE_4, SDL_SCANCODE_5, SDL_SCANCODE_6, /* 0 */ @@ -117,7 +119,9 @@ static void set_fullscreen(bool on, bool call_callback) { } static uint64_t previous_time; +#ifndef __linux__ static HANDLE timer; +#endif static int frameDivisor = 1; @@ -131,7 +135,9 @@ static void gfx_sdl_init(const char *game_name, bool start_in_fullscreen) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); +#ifndef __linux timer = CreateWaitableTimer(nullptr, false, nullptr); +#endif //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); //SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, 4); @@ -188,7 +194,7 @@ static void gfx_sdl_set_keyboard_callbacks(bool (*on_key_down)(int scancode), bo } static void gfx_sdl_main_loop(void (*run_one_game_iter)(void)) { - while (1) + while (1) { run_one_game_iter(); } diff --git a/libultraship/libultraship/Lib/ImGui/imgui.h b/libultraship/libultraship/Lib/ImGui/imgui.h index fa2dadcda..323832071 100644 --- a/libultraship/libultraship/Lib/ImGui/imgui.h +++ b/libultraship/libultraship/Lib/ImGui/imgui.h @@ -502,7 +502,6 @@ namespace ImGui IMGUI_API bool SmallButton(const char* label); // button with FramePadding=(0,0) to easily embed within text IMGUI_API bool InvisibleButton(const char* str_id, const ImVec2& size, ImGuiButtonFlags flags = 0); // flexible button behavior without the visuals, frequently useful to build custom behaviors using the public api (along with IsItemActive, IsItemHovered, etc.) IMGUI_API bool ArrowButton(const char* str_id, ImGuiDir dir); // square button with an arrow shape - IMGUI_API void ImageRotated(ImTextureID tex_id, ImVec2 center, ImVec2 size, float angle); IMGUI_API void Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), const ImVec4& tint_col = ImVec4(1,1,1,1), const ImVec4& border_col = ImVec4(0,0,0,0)); IMGUI_API bool ImageButton(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0 = ImVec2(0, 0), const ImVec2& uv1 = ImVec2(1,1), int frame_padding = -1, const ImVec4& bg_col = ImVec4(0,0,0,0), const ImVec4& tint_col = ImVec4(1,1,1,1)); // <0 frame_padding uses default frame padding settings. 0 for no padding IMGUI_API bool Checkbox(const char* label, bool* v); diff --git a/libultraship/libultraship/Lib/ImGui/imgui_widgets.cpp b/libultraship/libultraship/Lib/ImGui/imgui_widgets.cpp index 3d165580b..8e4210002 100644 --- a/libultraship/libultraship/Lib/ImGui/imgui_widgets.cpp +++ b/libultraship/libultraship/Lib/ImGui/imgui_widgets.cpp @@ -1007,33 +1007,6 @@ bool ImGui::ScrollbarEx(const ImRect& bb_frame, ImGuiID id, ImGuiAxis axis, ImS6 return held; } -void ImGui::ImageRotated(ImTextureID tex_id, ImVec2 center, ImVec2 size, float angle) { - - ImGuiWindow* window = GetCurrentWindow(); - if (window->SkipItems) - return; - - ImDrawList* draw_list = ImGui::GetWindowDrawList(); - ImRect bb(window->DC.CursorPos + ImVec2(size.x / 2, size.y / 2), window->DC.CursorPos + size); - - ImVec2 pos[4] = - { - center + bb.Min + ImVec2(-size.x * 0.5f, -size.y * 0.5f), - center + bb.Min + ImVec2(+size.x * 0.5f, -size.y * 0.5f), - center + bb.Min + ImVec2(+size.x * 0.5f, +size.y * 0.5f), - center + bb.Min + ImVec2(-size.x * 0.5f, +size.y * 0.5f) - }; - ImVec2 uvs[4] = - { - ImVec2(0.0f, 1.0f), - ImVec2(1.0f, 1.0f), - ImVec2(1.0f, 0.0f), - ImVec2(0.0f, 0.0f) - }; - - draw_list->AddImageQuad(tex_id, pos[0], pos[1], pos[2], pos[3], uvs[0], uvs[1], uvs[2], uvs[3], IM_COL32_WHITE); -} - void ImGui::Image(ImTextureID user_texture_id, const ImVec2& size, const ImVec2& uv0, const ImVec2& uv1, const ImVec4& tint_col, const ImVec4& border_col) { ImGuiWindow* window = GetCurrentWindow(); diff --git a/libultraship/libultraship/Lib/StrHash64.h b/libultraship/libultraship/Lib/StrHash64.h index 35401bbf8..d8cc8ff62 100644 --- a/libultraship/libultraship/Lib/StrHash64.h +++ b/libultraship/libultraship/Lib/StrHash64.h @@ -86,14 +86,8 @@ #include -#define u8 uint8_t -#define u16 uint16_t -#define u32 uint32_t -#define u64 uint64_t -#define unint uint32_t - #define INITIAL_CRC64 0xffffffffffffffffULL -extern uint64_t update_crc64(const void* buf, unint len, u64 crc); -extern u64 crc64(const void* buf, unint len); -extern u64 CRC64(const char* t); \ No newline at end of file +extern uint64_t update_crc64(const void* buf, uint32_t len, uint64_t crc); +extern uint64_t crc64(const void* buf, uint32_t len); +extern uint64_t CRC64(const char* t); \ No newline at end of file diff --git a/libultraship/libultraship/Lib/spdlog/include/spdlog/sinks/sohconsole_sink.h b/libultraship/libultraship/Lib/spdlog/include/spdlog/sinks/sohconsole_sink.h index 08729f4dc..4fa03b5e0 100644 --- a/libultraship/libultraship/Lib/spdlog/include/spdlog/sinks/sohconsole_sink.h +++ b/libultraship/libultraship/Lib/spdlog/include/spdlog/sinks/sohconsole_sink.h @@ -10,6 +10,7 @@ #include #include "SohImGuiImpl.h" #include "GameSettings.h" +#include "Cvar.h" #include #include #include @@ -45,8 +46,8 @@ protected: } formatted.push_back('\0'); const char *msg_output = formatted.data(); - if (Game::Settings.debug.soh_sink && SohImGui::console->opened) - SohImGui::console->Append("SoH Logging", priority, msg_output); + if (CVar_GetS32("gSinkEnabled", 0) && SohImGui::console->opened) + SohImGui::console->Append("SoH Logging", priority, "%s", msg_output); } void flush_() override {} @@ -66,6 +67,8 @@ private: return Priority::ERROR_LVL; case spdlog::level::critical: return Priority::ERROR_LVL; + default: + break; } return Priority::LOG_LVL; } diff --git a/libultraship/libultraship/Model.cpp b/libultraship/libultraship/Model.cpp index 27220e3bc..9e37de177 100644 --- a/libultraship/libultraship/Model.cpp +++ b/libultraship/libultraship/Model.cpp @@ -39,7 +39,7 @@ namespace Ship Vertex* vtxData = new Vertex[numVerts]; uint32_t* indicesData = new uint32_t[numPolys]; - if (vertices != NULL) + if (vertices != 0) { reader->Seek(headerStart + vertices, SeekOffsetType::Start); @@ -47,7 +47,7 @@ namespace Ship vtxData[i].pos = reader->ReadVec3f(); } - if (normals != NULL) + if (normals != 0) { reader->Seek(headerStart + normals, SeekOffsetType::Start); @@ -55,7 +55,7 @@ namespace Ship vtxData[i].normal = reader->ReadVec3f(); } - if (vertexColors != NULL) + if (vertexColors != 0) { reader->Seek(headerStart + vertexColors, SeekOffsetType::Start); @@ -63,7 +63,7 @@ namespace Ship vtxData[i].color = reader->ReadColor3b(); } - if (uvCoords != NULL) + if (uvCoords != 0) { reader->Seek(headerStart + uvCoords, SeekOffsetType::Start); @@ -71,7 +71,7 @@ namespace Ship vtxData[i].uv = reader->ReadVec2f(); } - if (boneWeights != NULL) + if (boneWeights != 0) { reader->Seek(headerStart + boneWeights, SeekOffsetType::Start); @@ -81,7 +81,7 @@ namespace Ship mdl->boneWeights[i] = reader->ReadVec2f(); } - if (faces != NULL) + if (faces != 0) { reader->Seek(headerStart + faces, SeekOffsetType::Start); reader->Read((char*)indicesData, numPolys * sizeof(uint32_t)); diff --git a/libultraship/libultraship/PulseAudioPlayer.cpp b/libultraship/libultraship/PulseAudioPlayer.cpp new file mode 100644 index 000000000..955b225d1 --- /dev/null +++ b/libultraship/libultraship/PulseAudioPlayer.cpp @@ -0,0 +1,173 @@ +#if defined(__linux__) || defined(__BSD__) + +#include "PulseAudioPlayer.h" +#include + +namespace Ship +{ + static void pas_context_state_cb(pa_context *c, void *userdata) { + switch (pa_context_get_state(c)) { + case PA_CONTEXT_READY: + case PA_CONTEXT_TERMINATED: + case PA_CONTEXT_FAILED: + *(bool*)userdata = true; + break; + default: + break; + } + } + + static void pas_stream_state_cb(pa_stream *s, void *userdata) { + switch (pa_stream_get_state(s)) { + case PA_STREAM_READY: + case PA_STREAM_FAILED: + case PA_STREAM_TERMINATED: + *(bool*)userdata = true; + break; + default: + break; + } + } + + static void pas_stream_write_cb(pa_stream* s, size_t length, void* userdata) { + } + + static void pas_update_complete(pa_stream* stream, int success, void* userdata) { + *(bool*)userdata = true; + } + + static void pas_write_complete(void* userdata) { + *(bool*)userdata = true; + } + + bool PulseAudioPlayer::Init() + { + bool done = false; + const pa_buffer_attr* applied_attr = nullptr; + + // Create mainloop + m_MainLoop = pa_mainloop_new(); + if (m_MainLoop == NULL) { + return false; + } + + // Create context and connect + m_Context = pa_context_new(pa_mainloop_get_api(m_MainLoop), "Ocarina of Time"); + if (m_Context == NULL) { + goto fail; + } + + pa_context_set_state_callback(m_Context, pas_context_state_cb, &done); + + if (pa_context_connect(m_Context, NULL, PA_CONTEXT_NOFLAGS, NULL) < 0) { + goto fail; + } + + while (!done) { + pa_mainloop_iterate(m_MainLoop, true, NULL); + } + pa_context_set_state_callback(m_Context, NULL, NULL); + if (pa_context_get_state(m_Context) != PA_CONTEXT_READY) { + goto fail; + } + + // Create stream + pa_sample_spec ss; + ss.format = PA_SAMPLE_S16LE; + ss.rate = 32000; + ss.channels = 2; + + pa_buffer_attr attr; + attr.maxlength = (1600 + 544 + 528 + 1600) * 4; + attr.tlength = (528*2 + 544) * 4; + attr.prebuf = 1500 * 4; + attr.minreq = 161 * 4; + attr.fragsize = (uint32_t)-1; + + m_Stream = pa_stream_new(m_Context, "zelda", &ss, NULL); + if (m_Stream == NULL) { + goto fail; + } + + done = false; + pa_stream_set_state_callback(m_Stream, pas_stream_state_cb, &done); + pa_stream_set_write_callback(m_Stream, pas_stream_write_cb, NULL); + if (pa_stream_connect_playback(m_Stream, NULL, &attr, PA_STREAM_ADJUST_LATENCY, NULL, NULL) < 0) { + goto fail; + } + + while (!done) { + pa_mainloop_iterate(m_MainLoop, true, NULL); + } + pa_stream_set_state_callback(m_Stream, NULL, NULL); + if (pa_stream_get_state(m_Stream) != PA_STREAM_READY) { + goto fail; + } + + applied_attr = pa_stream_get_buffer_attr(m_Stream); + SPDLOG_TRACE("maxlength: {}\ntlength: {}\nprebuf: {}\nminreq: {}\nfragsize: {}\n", + applied_attr->maxlength, applied_attr->tlength, applied_attr->prebuf, applied_attr->minreq, applied_attr->fragsize); + m_Attr = *applied_attr; + + return true; + + fail: + if (m_Stream != NULL) { + pa_stream_unref(m_Stream); + m_Stream = NULL; + } + if (m_Context != NULL) { + pa_context_disconnect(m_Context); + pa_context_unref(m_Context); + m_Context = NULL; + } + if (m_MainLoop != NULL) { + pa_mainloop_free(m_MainLoop); + m_MainLoop = NULL; + } + return false; + } + + int PulseAudioPlayer::Buffered() + { + if (m_Stream == NULL) { + return 0; + } + + bool done = false; + pa_stream_update_timing_info(m_Stream, pas_update_complete, &done); + while (!done) { + pa_mainloop_iterate(m_MainLoop, true, NULL); + } + + const pa_timing_info *info = pa_stream_get_timing_info(m_Stream); + if (info == NULL) { + SPDLOG_ERROR("pa_stream_get_timing_info failed, state is %d\n", pa_stream_get_state(m_Stream)); + } + return (info->write_index - info->read_index) / 4; + } + + int PulseAudioPlayer::GetDesiredBuffered() + { + // return 1100; + return 1680; + } + + void PulseAudioPlayer::Play(const uint8_t* buff, uint32_t len) + { + size_t ws = m_Attr.maxlength - Buffered() * 4; + if (ws < len) { + len = ws; + } + if (pa_stream_write_ext_free(m_Stream, buff, len, pas_write_complete, &m_WriteComplete, 0LL, PA_SEEK_RELATIVE) < 0) { + SPDLOG_ERROR("pa_stream_write failed"); + return; + } + while (!m_WriteComplete) { + pa_mainloop_iterate(m_MainLoop, true, NULL); + } + m_WriteComplete = false; + } +} + +#endif \ No newline at end of file diff --git a/libultraship/libultraship/PulseAudioPlayer.h b/libultraship/libultraship/PulseAudioPlayer.h new file mode 100644 index 000000000..7bc72b097 --- /dev/null +++ b/libultraship/libultraship/PulseAudioPlayer.h @@ -0,0 +1,26 @@ +#pragma once + +#if defined(__linux__) || defined(__BSD__) + +#include "AudioPlayer.h" +#include + +namespace Ship { + class PulseAudioPlayer : public AudioPlayer { + public: + PulseAudioPlayer() {} + + bool Init() override; + int Buffered() override; + int GetDesiredBuffered() override; + void Play(const uint8_t* buff, uint32_t len) override; + + private: + pa_context* m_Context = nullptr; + pa_stream* m_Stream = nullptr; + pa_mainloop* m_MainLoop = nullptr; + bool m_WriteComplete = false; + pa_buffer_attr m_Attr = {0}; + }; +} +#endif diff --git a/libultraship/libultraship/Resource.cpp b/libultraship/libultraship/Resource.cpp index 5bdfc5efd..04fc2bfbb 100644 --- a/libultraship/libultraship/Resource.cpp +++ b/libultraship/libultraship/Resource.cpp @@ -2,8 +2,8 @@ #include "DisplayList.h" #include "ResourceMgr.h" #include "Utils/BinaryReader.h" -#include "lib/tinyxml2/tinyxml2.h" -#include "lib/Fast3D/U64/PR/ultra64/gbi.h" +#include "Lib/tinyxml2/tinyxml2.h" +#include "Lib/Fast3D/U64/PR/ultra64/gbi.h" namespace Ship { @@ -25,7 +25,7 @@ namespace Ship void ResourceFile::WriteFileBinary(BinaryWriter* writer, Resource* res) { - + } void ResourceFile::WriteFileXML(tinyxml2::XMLElement* writer, Resource* res) @@ -35,17 +35,17 @@ namespace Ship Resource::~Resource() { - free(cachedGameAsset); + free(cachedGameAsset); cachedGameAsset = nullptr; - for (int i = 0; i < patches.size(); i++) + for (size_t i = 0; i < patches.size(); i++) { std::string hashStr = resMgr->HashToString(patches[i].crc); auto resShared = resMgr->GetCachedFile(hashStr); if (resShared != nullptr) { auto res = (Ship::DisplayList*)resShared.get(); - + Gfx* gfx = (Gfx*)&res->instructions[patches[i].index]; gfx->words.w1 = patches[i].origData; } diff --git a/libultraship/libultraship/Resource.h b/libultraship/libultraship/Resource.h index 1df5c5ed7..ae8dc6ce5 100644 --- a/libultraship/libultraship/Resource.h +++ b/libultraship/libultraship/Resource.h @@ -6,7 +6,7 @@ #include "GlobalCtx2.h" #include "StrHash.h" #include "File.h" -#include "lib/tinyxml2/tinyxml2.h" +#include "Lib/tinyxml2/tinyxml2.h" namespace Ship { @@ -101,10 +101,10 @@ namespace Ship class ResourcePromise { public: - std::shared_ptr Resource; - std::shared_ptr File; - std::condition_variable ResourceLoadNotifier; - std::mutex ResourceLoadMutex; + std::shared_ptr resource; + std::shared_ptr file; + std::condition_variable resourceLoadNotifier; + std::mutex resourceLoadMutex; bool bHasResourceLoaded = false; }; } \ No newline at end of file diff --git a/libultraship/libultraship/ResourceMgr.cpp b/libultraship/libultraship/ResourceMgr.cpp index 6c8b1a10c..de0296d12 100644 --- a/libultraship/libultraship/ResourceMgr.cpp +++ b/libultraship/libultraship/ResourceMgr.cpp @@ -3,6 +3,7 @@ #include "spdlog/spdlog.h" #include "File.h" #include "Archive.h" +#include "GameVersions.h" #include #include "Lib/StormLib/StormLib.h" @@ -11,6 +12,8 @@ namespace Ship { ResourceMgr::ResourceMgr(std::shared_ptr Context, std::string MainPath, std::string PatchesPath) : Context(Context), bIsRunning(false), FileLoadThread(nullptr) { OTR = std::make_shared(MainPath, PatchesPath, false); + gameVersion = OOT_UNKNOWN; + if (OTR->IsMainMPQValid()) Start(); } @@ -40,7 +43,7 @@ namespace Ship { const std::lock_guard ResLock(ResourceLoadMutex); bIsRunning = false; } - + FileLoadNotifier.notify_all(); ResourceLoadNotifier.notify_all(); FileLoadThread->join(); @@ -86,7 +89,10 @@ namespace Ship { OTR->LoadFile(ToLoad->path, true, ToLoad); //Lock.lock(); - FileCache[ToLoad->path] = ToLoad->bIsLoaded && !ToLoad->bHasLoadError ? ToLoad : nullptr; + + if (!ToLoad->bHasLoadError) + FileCache[ToLoad->path] = ToLoad->bIsLoaded && !ToLoad->bHasLoadError ? ToLoad : nullptr; + //Lock.unlock(); SPDLOG_DEBUG("Loaded File {} on ResourceMgr thread", ToLoad->path); @@ -118,50 +124,68 @@ namespace Ship { // Wait for the underlying File to complete loading { - std::unique_lock FileLock(ToLoad->File->FileLoadMutex); - while (!ToLoad->File->bIsLoaded && !ToLoad->File->bHasLoadError) { - ToLoad->File->FileLoadNotifier.wait(FileLock); + std::unique_lock FileLock(ToLoad->file->FileLoadMutex); + while (!ToLoad->file->bIsLoaded && !ToLoad->file->bHasLoadError) { + ToLoad->file->FileLoadNotifier.wait(FileLock); } } - auto UnmanagedRes = ResourceLoader::LoadResource(ToLoad->File); - - if (UnmanagedRes != nullptr) + if (!ToLoad->file->bHasLoadError) { - UnmanagedRes->resMgr = this; - auto Res = std::shared_ptr(UnmanagedRes); + auto UnmanagedRes = ResourceLoader::LoadResource(ToLoad->file); - if (Res != nullptr) { - std::unique_lock Lock(ToLoad->ResourceLoadMutex); + if (UnmanagedRes != nullptr) + { + UnmanagedRes->resMgr = this; + auto Res = std::shared_ptr(UnmanagedRes); - ToLoad->bHasResourceLoaded = true; - ToLoad->Resource = Res; - ResourceCache[Res->file->path] = Res; + if (Res != nullptr) { + std::unique_lock Lock(ToLoad->resourceLoadMutex); - SPDLOG_DEBUG("Loaded Resource {} on ResourceMgr thread", ToLoad->File->path); + ToLoad->bHasResourceLoaded = true; + ToLoad->resource = Res; + ResourceCache[Res->file->path] = Res; - // Disabled for now because it can cause random crashes - //FileCache[Res->File->path] = nullptr; - //FileCache.erase(FileCache.find(Res->File->path)); - Res->file = nullptr; + SPDLOG_DEBUG("Loaded Resource {} on ResourceMgr thread", ToLoad->file->path); + + // Disabled for now because it can cause random crashes + //FileCache[Res->File->path] = nullptr; + //FileCache.erase(FileCache.find(Res->File->path)); + Res->file = nullptr; + } + else { + ToLoad->bHasResourceLoaded = false; + ToLoad->resource = nullptr; + + SPDLOG_ERROR("Resource load FAILED {} on ResourceMgr thread", ToLoad->file->path); + } + + //ResLock.lock(); + //ResLock.unlock(); } - else { - ToLoad->bHasResourceLoaded = false; - ToLoad->Resource = nullptr; - - SPDLOG_ERROR("Resource load FAILED {} on ResourceMgr thread", ToLoad->File->path); - } - - //ResLock.lock(); - //ResLock.unlock(); - - ToLoad->ResourceLoadNotifier.notify_all(); } + else + { + ToLoad->bHasResourceLoaded = false; + ToLoad->resource = nullptr; + } + + ToLoad->resourceLoadNotifier.notify_all(); } SPDLOG_INFO("Resource Manager LoadResourceThread ended"); } + uint32_t ResourceMgr::GetGameVersion() + { + return gameVersion; + } + + void ResourceMgr::SetGameVersion(uint32_t newGameVersion) + { + gameVersion = newGameVersion; + } + std::shared_ptr ResourceMgr::LoadFileAsync(std::string FilePath) { const std::lock_guard Lock(FileLoadMutex); // File NOT already loaded...? @@ -193,9 +217,12 @@ namespace Ship { std::shared_ptr ResourceMgr::GetCachedFile(std::string FilePath) { auto resCacheFind = ResourceCache.find(FilePath); - - if (resCacheFind != ResourceCache.end()) + + if (resCacheFind != ResourceCache.end() && + resCacheFind->second.use_count() > 0) + { return resCacheFind->second; + } else return nullptr; } @@ -205,17 +232,17 @@ namespace Ship { if (!Promise->bHasResourceLoaded) { - std::unique_lock Lock(Promise->ResourceLoadMutex); + std::unique_lock Lock(Promise->resourceLoadMutex); while (!Promise->bHasResourceLoaded) { - Promise->ResourceLoadNotifier.wait(Lock); + Promise->resourceLoadNotifier.wait(Lock); } } - return Promise->Resource; + return Promise->resource; } std::shared_ptr ResourceMgr::LoadResourceAsync(std::string FilePath) { - StringHelper::ReplaceOriginal(FilePath, "/", "\\"); + StringHelper::ReplaceOriginal(FilePath, "\\", "/"); if (StringHelper::StartsWith(FilePath, "__OTR__")) FilePath = StringHelper::Split(FilePath, "__OTR__")[1]; @@ -230,14 +257,21 @@ namespace Ship { } std::shared_ptr FileData = LoadFile(FilePath); - Promise->File = FileData; + Promise->file = FileData; - Promise->bHasResourceLoaded = false; - ResourceLoadQueue.push(Promise); - ResourceLoadNotifier.notify_all(); + if (Promise->file->bHasLoadError) + { + Promise->bHasResourceLoaded = true; + } + else + { + Promise->bHasResourceLoaded = false; + ResourceLoadQueue.push(Promise); + ResourceLoadNotifier.notify_all(); + } } else { Promise->bHasResourceLoaded = true; - Promise->Resource = resCacheFind->second; + Promise->resource = resCacheFind->second; } return Promise; @@ -261,37 +295,37 @@ namespace Ship { auto PromiseList = CacheDirectoryAsync(SearchMask); auto LoadedList = std::make_shared>>(); - for (int32_t i = 0; i < PromiseList->size(); i++) { + for (size_t i = 0; i < PromiseList->size(); i++) { auto Promise = PromiseList->at(i); - std::unique_lock Lock(Promise->ResourceLoadMutex); + std::unique_lock Lock(Promise->resourceLoadMutex); while (!Promise->bHasResourceLoaded) { - Promise->ResourceLoadNotifier.wait(Lock); + Promise->resourceLoadNotifier.wait(Lock); } - LoadedList->push_back(Promise->Resource); + LoadedList->push_back(Promise->resource); } return LoadedList; } - std::shared_ptr>> ResourceMgr::DirtyDirectory(std::string SearchMask) + std::shared_ptr>> ResourceMgr::DirtyDirectory(std::string SearchMask) { auto PromiseList = CacheDirectoryAsync(SearchMask); auto LoadedList = std::make_shared>>(); - for (int32_t i = 0; i < PromiseList->size(); i++) { + for (size_t i = 0; i < PromiseList->size(); i++) { auto Promise = PromiseList->at(i); - std::unique_lock Lock(Promise->ResourceLoadMutex); + std::unique_lock Lock(Promise->resourceLoadMutex); while (!Promise->bHasResourceLoaded) { - Promise->ResourceLoadNotifier.wait(Lock); + Promise->resourceLoadNotifier.wait(Lock); } - if (Promise->Resource != nullptr) - Promise->Resource->isDirty = true; + if (Promise->resource != nullptr) + Promise->resource->isDirty = true; - LoadedList->push_back(Promise->Resource); + LoadedList->push_back(Promise->resource); } return LoadedList; diff --git a/libultraship/libultraship/ResourceMgr.h b/libultraship/libultraship/ResourceMgr.h index 86e0cc268..28e77e537 100644 --- a/libultraship/libultraship/ResourceMgr.h +++ b/libultraship/libultraship/ResourceMgr.h @@ -28,7 +28,9 @@ namespace Ship std::string HashToString(uint64_t Hash); void InvalidateResourceCache(); - + + uint32_t GetGameVersion(); + void SetGameVersion(uint32_t newGameVersion); std::shared_ptr LoadFileAsync(std::string FilePath); std::shared_ptr LoadFile(std::string FilePath); std::shared_ptr GetCachedFile(std::string FilePath); @@ -46,6 +48,7 @@ namespace Ship private: std::weak_ptr Context; + volatile bool bIsRunning; std::map> FileCache; std::map> ResourceCache; std::queue> FileLoadQueue; @@ -57,6 +60,6 @@ namespace Ship std::mutex ResourceLoadMutex; std::condition_variable FileLoadNotifier; std::condition_variable ResourceLoadNotifier; - volatile bool bIsRunning; + uint32_t gameVersion; }; } \ No newline at end of file diff --git a/libultraship/libultraship/SDLController.cpp b/libultraship/libultraship/SDLController.cpp index 3d6d6800d..ab2c48b30 100644 --- a/libultraship/libultraship/SDLController.cpp +++ b/libultraship/libultraship/SDLController.cpp @@ -5,14 +5,12 @@ #include "spdlog/spdlog.h" #include "stox.h" #include "Window.h" +#include "Cvar.h" +#include extern "C" uint8_t __osMaxControllers; -float gyroDriftX; -float gyroDriftY; namespace Ship { - - SDLController::SDLController(int32_t dwControllerNumber) : Controller(dwControllerNumber), Cont(nullptr), guid(INVALID_SDL_CONTROLLER_GUID) { } @@ -63,30 +61,36 @@ namespace Ship { if (Conf[ConfSection]["GUID"].compare("") == 0 || Conf[ConfSection]["GUID"].compare(INVALID_SDL_CONTROLLER_GUID) == 0 || Conf[ConfSection]["GUID"].compare(NewGuid) == 0) { auto NewCont = SDL_GameControllerOpen(i); - if (SDL_GameControllerHasSensor(NewCont, SDL_SENSOR_GYRO)) - { - SDL_GameControllerSetSensorEnabled(NewCont, SDL_SENSOR_GYRO, SDL_TRUE); - } - // We failed to load the controller. Go to next. if (NewCont == nullptr) { SPDLOG_ERROR("SDL Controller failed to open: ({})", SDL_GetError()); continue; } + if (SDL_GameControllerHasSensor(NewCont, SDL_SENSOR_GYRO)) + { + SDL_GameControllerSetSensorEnabled(NewCont, SDL_SENSOR_GYRO, SDL_TRUE); + } + guid = NewGuid; Cont = NewCont; std::string BindingConfSection = GetBindingConfSection(); - std::shared_ptr pBindingConf = GlobalCtx2::GetInstance()->GetConfig(); - ConfigFile& BindingConf = *pBindingConf.get(); + std::string PadConfSection = *GetPadConfSection(); + std::shared_ptr config = GlobalCtx2::GetInstance()->GetConfig(); - if (!BindingConf.has(BindingConfSection)) { + if (!config->has(BindingConfSection)) { CreateDefaultBinding(); } + if (!config->has(PadConfSection)) { + CreateDefaultPadConf(); + } + LoadBinding(); LoadAxisThresholds(); + // Update per-controller settings in ImGui menu after opening controller. + Game::LoadPadSettings(); break; } @@ -97,6 +101,9 @@ namespace Ship { } bool SDLController::Close() { + if (CanRumble()) { + SDL_GameControllerRumble(Cont, 0, 0, 0); + } if (Cont != nullptr) { SDL_GameControllerClose(Cont); } @@ -147,8 +154,8 @@ namespace Ship { //bound diagonals to an octagonal range {-68 ... +68} if (ax != 0.0 && ay != 0.0) { auto slope = ay / ax; - auto edgex = copysign(85.0 / (abs(slope) + wAxisThreshold / 69.0), ax); - auto edgey = copysign(std::min(abs(edgex * slope), 85.0 / (1.0 / abs(slope) + wAxisThreshold / 69.0)), ay); + auto edgex = copysign(85.0 / (abs(slope) + 16.0 / 69.0), ax); + auto edgey = copysign(std::min(abs(edgex * slope), 85.0 / (1.0 / abs(slope) + 16.0 / 69.0)), ay); edgex = edgey / slope; auto scale = sqrt(edgex * edgex + edgey * edgey) / 85.0; @@ -182,37 +189,44 @@ namespace Ship { if (SDL_GameControllerHasSensor(Cont, SDL_SENSOR_GYRO)) { + size_t contNumber = GetControllerNumber(); + float gyroData[3]; SDL_GameControllerGetSensorData(Cont, SDL_SENSOR_GYRO, gyroData, 3); const char* contName = SDL_GameControllerName(Cont); - const int isSpecialController = strcmp("PS5 Controller", contName); - const float gyroSensitivity = Game::Settings.controller.gyro_sensitivity; + const int isSpecialController = !strcmp("PS5 Controller", contName); + float gyro_drift_x = CVar_GetFloat(StringHelper::Sprintf("gCont%i_GyroDriftX", contNumber).c_str(), 0.0f); + float gyro_drift_y = CVar_GetFloat(StringHelper::Sprintf("gCont%i_GyroDriftY", contNumber).c_str(), 0.0f); + const float gyro_sensitivity = CVar_GetFloat(StringHelper::Sprintf("gCont%i_GyroSensitivity", contNumber).c_str(), 1.0f); - if (gyroDriftX == 0) { - if (isSpecialController == 0) { - gyroDriftX = gyroData[2]; + if (gyro_drift_x == 0) { + gyro_drift_x = gyroData[0]; + } + + if (gyro_drift_y == 0) { + if (isSpecialController == 1) { + gyro_drift_y = gyroData[2]; } else { - gyroDriftX = gyroData[0]; + gyro_drift_y = gyroData[1]; } } - if (gyroDriftY == 0) { - gyroDriftY = gyroData[1]; - } + CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftX", contNumber).c_str(), gyro_drift_x); + CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftY", contNumber).c_str(), gyro_drift_y); - if (isSpecialController == 0) { - wGyroX = gyroData[2] - gyroDriftX; + if (isSpecialController == 1) { + wGyroX = gyroData[0] - gyro_drift_x; + wGyroY = -gyroData[2] - gyro_drift_y; } else { - wGyroX = gyroData[0] - gyroDriftX; + wGyroX = gyroData[0] - gyro_drift_x; + wGyroY = gyroData[1] - gyro_drift_y; } - wGyroY = gyroData[1] - gyroDriftY; - - wGyroX *= gyroSensitivity; - wGyroY *= gyroSensitivity; + wGyroX *= gyro_sensitivity; + wGyroY *= gyro_sensitivity; } for (int32_t i = SDL_CONTROLLER_BUTTON_A; i < SDL_CONTROLLER_BUTTON_MAX; i++) { @@ -333,18 +347,29 @@ namespace Ship { void SDLController::WriteToSource(ControllerCallback* controller) { - if (SDL_GameControllerHasRumble(Cont)) { + if (CanRumble()) { if (controller->rumble > 0) { - SDL_GameControllerRumble(Cont, 0xFFFF * Game::Settings.controller.rumble_strength, 0xFFFF * Game::Settings.controller.rumble_strength, 1); + float rumble_strength = CVar_GetFloat(StringHelper::Sprintf("gCont%i_RumbleStrength", GetControllerNumber()).c_str(), 1.0f); + SDL_GameControllerRumble(Cont, 0xFFFF * rumble_strength, 0xFFFF * rumble_strength, 0); + } else { + SDL_GameControllerRumble(Cont, 0, 0, 0); } } if (SDL_GameControllerHasLED(Cont)) { - if (controller->ledColor == 1) { + switch (controller->ledColor) { + case 0: SDL_JoystickSetLED(SDL_GameControllerGetJoystick(Cont), 255, 0, 0); - } - else { - SDL_JoystickSetLED(SDL_GameControllerGetJoystick(Cont), 0, 255, 0); + break; + case 1: + SDL_JoystickSetLED(SDL_GameControllerGetJoystick(Cont), 0x1E, 0x69, 0x1B); + break; + case 2: + SDL_JoystickSetLED(SDL_GameControllerGetJoystick(Cont), 0x64, 0x14, 0x00); + break; + case 3: + SDL_JoystickSetLED(SDL_GameControllerGetJoystick(Cont), 0x00, 0x3C, 0x64); + break; } } } @@ -387,6 +412,14 @@ namespace Ship { Conf.Save(); } + void SDLController::CreateDefaultPadConf() { + std::string ConfSection = *GetPadConfSection(); + std::shared_ptr pConf = GlobalCtx2::GetInstance()->GetConfig(); + ConfigFile& Conf = *pConf.get(); + + Conf.Save(); + } + void SDLController::SetButtonMapping(const std::string& szButtonName, int32_t dwScancode) { if (guid.compare(INVALID_SDL_CONTROLLER_GUID)) { return; @@ -406,4 +439,8 @@ namespace Ship { std::string SDLController::GetBindingConfSection() { return GetControllerType() + " CONTROLLER BINDING " + guid; } -} \ No newline at end of file + + std::optional SDLController::GetPadConfSection() { + return GetControllerType() + " CONTROLLER PAD " + guid; + } +} diff --git a/libultraship/libultraship/SDLController.h b/libultraship/libultraship/SDLController.h index 5c71c50a9..fbffa478f 100644 --- a/libultraship/libultraship/SDLController.h +++ b/libultraship/libultraship/SDLController.h @@ -12,20 +12,31 @@ namespace Ship { void ReadFromSource(); void WriteToSource(ControllerCallback* controller); + bool Connected() const { return Cont != nullptr; } + bool CanRumble() const { +#if SDL_COMPILEDVERSION >= SDL_VERSIONNUM(2,0,18) + return SDL_GameControllerHasRumble(Cont); +#endif + return true; + } std::string GetGuid() { return guid; }; + bool HasPadConf() const { return true; } + std::optional GetPadConfSection(); + protected: std::string GetControllerType(); void SetButtonMapping(const std::string& szButtonName, int32_t dwScancode); std::string GetConfSection(); std::string GetBindingConfSection(); void CreateDefaultBinding(); + void CreateDefaultPadConf(); static bool IsGuidInUse(const std::string& guid); private: - std::string guid; SDL_GameController* Cont; + std::string guid; std::map ThresholdMapping; void LoadAxisThresholds(); diff --git a/libultraship/libultraship/Scene.cpp b/libultraship/libultraship/Scene.cpp index 9468e3a59..17d2b6976 100644 --- a/libultraship/libultraship/Scene.cpp +++ b/libultraship/libultraship/Scene.cpp @@ -137,8 +137,8 @@ namespace Ship y = 0; z = 0; unk_06 = 0; - opa; - xlu; + // opa; + // xlu; } SetMesh::SetMesh(BinaryReader* reader) : SceneCommand(reader) @@ -398,18 +398,18 @@ namespace Ship LightInfo light = LightInfo(); light.type = reader->ReadUByte(); - + light.x = reader->ReadInt16(); - light.y = reader->ReadInt16(); + light.y = reader->ReadInt16(); light.z = reader->ReadInt16(); light.r = reader->ReadUByte(); light.g = reader->ReadUByte(); light.b = reader->ReadUByte(); - + light.drawGlow = reader->ReadUByte(); light.radius = reader->ReadInt16(); - + lights.push_back(light); } } diff --git a/libultraship/libultraship/SkeletonLimb.cpp b/libultraship/libultraship/SkeletonLimb.cpp index 5020fe8f5..75fd46780 100644 --- a/libultraship/libultraship/SkeletonLimb.cpp +++ b/libultraship/libultraship/SkeletonLimb.cpp @@ -15,7 +15,7 @@ namespace Ship limb->skinVtxCnt = reader->ReadUInt16(); uint32_t skinCnt = reader->ReadUInt32(); - for (int i = 0; i < skinCnt; i++) + for (size_t i = 0; i < skinCnt; i++) { Struct_800A598C struc; diff --git a/libultraship/libultraship/SohConsole.cpp b/libultraship/libultraship/SohConsole.cpp index 71a067196..6f04bc917 100644 --- a/libultraship/libultraship/SohConsole.cpp +++ b/libultraship/libultraship/SohConsole.cpp @@ -16,7 +16,7 @@ std::map BindingToggle; static bool HelpCommand(const std::vector&) { INFO("SoH Commands:"); for(const auto& cmd : SohImGui::console->Commands) { - INFO((" - " + cmd.first).c_str()); + INFO("%s", (" - " + cmd.first).c_str()); } return CMD_SUCCESS; } @@ -35,7 +35,7 @@ std::string toLowerCase(std::string in) { static bool BindCommand(const std::vector& args) { if(args.size() > 2) { const ImGuiIO* io = &ImGui::GetIO();; - for (int k = 0; k < std::size(io->KeysData); k++) { + for (size_t k = 0; k < std::size(io->KeysData); k++) { std::string key(ImGui::GetKeyName(k)); if(toLowerCase(args[1]) == toLowerCase(key)) { @@ -55,7 +55,7 @@ static bool BindCommand(const std::vector& args) { static bool BindToggleCommand(const std::vector& args) { if (args.size() > 2) { const ImGuiIO* io = &ImGui::GetIO();; - for (int k = 0; k < std::size(io->KeysData); k++) { + for (size_t k = 0; k < std::size(io->KeysData); k++) { std::string key(ImGui::GetKeyName(k)); if (toLowerCase(args[1]) == toLowerCase(key)) { @@ -92,7 +92,7 @@ void Console::Update() { } for (auto [key, var] : BindingToggle) { if (ImGui::IsKeyPressed(key)) { - CVar* cvar = CVar_GetVar(const_cast(var.c_str())); + CVar* cvar = CVar_Get(var.c_str()); Dispatch("set " + var + " " + std::to_string(cvar == nullptr ? 0 : !static_cast(cvar->value.valueS32))); } } @@ -106,7 +106,7 @@ void Console::Draw() { if (!this->opened) return; ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver); - ImGui::Begin("Console", &this->opened); + ImGui::Begin("Console", nullptr, ImGuiWindowFlags_NoFocusOnAppearing); const ImVec2 pos = ImGui::GetWindowPos(); const ImVec2 size = ImGui::GetWindowSize(); @@ -177,8 +177,10 @@ void Console::Draw() { for (const auto& filter : priority_filters) { const bool is_selected = (filter == std::string(this->level_filter)); if (ImGui::Selectable(filter.c_str(), is_selected)) + { this->level_filter = filter; if (is_selected) ImGui::SetItemDefaultFocus(); + } } ImGui::EndCombo(); } @@ -194,7 +196,7 @@ void Console::Draw() { if (ImGui::BeginTable("History", 1)) { if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_DownArrow))) - if (this->selectedId < this->Log.size() - 1) ++this->selectedId; + if (this->selectedId < (int)this->Log.size() - 1) ++this->selectedId; if (ImGui::IsKeyPressed(ImGui::GetKeyIndex(ImGuiKey_UpArrow))) if (this->selectedId > 0) --this->selectedId; @@ -226,7 +228,7 @@ void Console::Draw() { ImGui::EndChild(); // Renders input textfield - constexpr ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackEdit | + constexpr ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue | ImGuiInputTextFlags_CallbackEdit | ImGuiInputTextFlags_CallbackCompletion | ImGuiInputTextFlags_CallbackHistory; ImGui::PushItemWidth(-1); if(ImGui::InputTextWithHint("CMDInput", ">", this->InputBuffer, MAX_BUFFER_SIZE, flags, &Console::CallbackStub, this)) { @@ -317,7 +319,7 @@ int Console::CallbackStub(ImGuiInputTextCallbackData* data) { return 0; } -void Console::Append(const std::string& channel, Priority priority, const char* fmt, ...) IM_FMTARGS(4) { +void Console::Append(const std::string& channel, Priority priority, const char* fmt, ...) { char buf[1024]; va_list args; va_start(args, fmt); diff --git a/libultraship/libultraship/SohConsole.h b/libultraship/libultraship/SohConsole.h index 57ad182f8..bfbffd0b9 100644 --- a/libultraship/libultraship/SohConsole.h +++ b/libultraship/libultraship/SohConsole.h @@ -7,10 +7,10 @@ #include "Lib/ImGui/imgui.h" -#define LOG(msg, ...) SohImGui::console->Append("Main", Priority::LOG_LVL, msg, __VA_ARGS__) -#define INFO(msg, ...) SohImGui::console->Append("Main", Priority::INFO_LVL, msg, __VA_ARGS__) -#define WARNING(msg, ...) SohImGui::console->Append("Main", Priority::WARNING_LVL, msg, __VA_ARGS__) -#define ERROR(msg, ...) SohImGui::console->Append("Main", Priority::ERROR_LVL, msg, __VA_ARGS__) +#define LOG(msg, ...) SohImGui::console->Append("Main", Priority::LOG_LVL, msg, ##__VA_ARGS__) +#define INFO(msg, ...) SohImGui::console->Append("Main", Priority::INFO_LVL, msg, ##__VA_ARGS__) +#define WARNING(msg, ...) SohImGui::console->Append("Main", Priority::WARNING_LVL, msg, ##__VA_ARGS__) +#define ERROR(msg, ...) SohImGui::console->Append("Main", Priority::ERROR_LVL, msg, ##__VA_ARGS__) #define CMD_SUCCESS true #define CMD_FAILED false #define MAX_BUFFER_SIZE 255 @@ -75,7 +75,7 @@ public: void Init(); void Update(); void Draw(); - void Append(const std::string& channel, Priority priority, const char* fmt, ...); + void Append(const std::string& channel, Priority priority, const char* fmt, ...) IM_FMTARGS(4); void Dispatch(const std::string& line); static int CallbackStub(ImGuiInputTextCallbackData* data); }; \ No newline at end of file diff --git a/libultraship/libultraship/SohHooks.cpp b/libultraship/libultraship/SohHooks.cpp index d40ab87e2..7ede525d7 100644 --- a/libultraship/libultraship/SohHooks.cpp +++ b/libultraship/libultraship/SohHooks.cpp @@ -24,7 +24,7 @@ namespace ModInternal { bool handleHook(std::shared_ptr call) { std::string hookName = std::string(call->name); - for (int l = 0; l < listeners[hookName].size(); l++) { + for (size_t l = 0; l < listeners[hookName].size(); l++) { (listeners[hookName][l])(call); } return call->cancelled; diff --git a/libultraship/libultraship/SohHooks.h b/libultraship/libultraship/SohHooks.h index 111f789d0..9a41eeb0e 100644 --- a/libultraship/libultraship/SohHooks.h +++ b/libultraship/libultraship/SohHooks.h @@ -47,6 +47,7 @@ struct HookParameter { #include #include #include +#include struct HookCall { std::string name; diff --git a/libultraship/libultraship/SohImGuiImpl.cpp b/libultraship/libultraship/SohImGuiImpl.cpp index 22b47f680..785a29dee 100644 --- a/libultraship/libultraship/SohImGuiImpl.cpp +++ b/libultraship/libultraship/SohImGuiImpl.cpp @@ -1,7 +1,11 @@ #include "SohImGuiImpl.h" #include +#include #include +#include +#include +#include #include "Archive.h" #include "Environment.h" @@ -14,9 +18,12 @@ #include "TextureMod.h" #include "Window.h" #include "Cvar.h" +#include "GameOverlay.h" +#include "Texture.h" #include "../Fast3D/gfx_pc.h" #include "Lib/stb/stb_image.h" #include "Lib/Fast3D/gfx_rendering_api.h" +#include "Lib/spdlog/include/spdlog/common.h" #include "Utils/StringHelper.h" #ifdef ENABLE_OPENGL @@ -37,6 +44,11 @@ IMGUI_IMPL_API LRESULT ImGui_ImplWin32_WndProcHandler(HWND hWnd, UINT msg, WPAR using namespace Ship; bool oldCursorState = true; +#define EXPERIMENTAL() \ + ImGui::PushStyleColor(ImGuiCol_Text, IM_COL32(255, 50, 50, 255)); \ + ImGui::Text("Experimental"); \ + ImGui::PopStyleColor(); \ + ImGui::Separator(); #define TOGGLE_BTN ImGuiKey_F1 #define HOOK(b) if(b) needs_save = true; OSContPad* pads; @@ -48,18 +60,94 @@ namespace SohImGui { WindowImpl impl; ImGuiIO* io; Console* console = new Console; + GameOverlay* overlay = new GameOverlay; bool p_open = false; bool needs_save = false; + std::vector CustomTexts; + int SelectedLanguage = CVar_GetS32("gLanguages", 0); //Default Language to 0=English 1=German 2=French + float kokiri_col[3] = { 0.118f, 0.41f, 0.106f }; + float goron_col[3] = { 0.392f, 0.078f, 0.0f }; + float zora_col[3] = { 0.0f, 0.235f, 0.392f }; + + float navi_idle_i_col[3] = { 0.0f, 0.0f, 0.0f }; + float navi_idle_o_col[3] = { 0.0f, 0.0f, 0.0f }; + + float navi_npc_i_col[3] = { 0.0f, 0.0f, 0.0f }; + float navi_npc_o_col[3] = { 0.0f, 0.0f, 0.0f }; + + float navi_enemy_i_col[3] = { 0.0f, 0.0f, 0.0f }; + float navi_enemy_o_col[3] = { 0.0f, 0.0f, 0.0f }; + + float navi_prop_i_col[3] = { 0.0f, 0.0f, 0.0f }; + float navi_prop_o_col[3] = { 0.0f, 0.0f, 0.0f }; + + const char* filters[3] = { + "Three-Point", + "Linear", + "None" + }; + + std::map> windowCategories; + std::map customWindows; void ImGuiWMInit() { switch (impl.backend) { case Backend::SDL: ImGui_ImplSDL2_InitForOpenGL(static_cast(impl.sdl.window), impl.sdl.context); break; +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) case Backend::DX11: ImGui_ImplWin32_Init(impl.dx11.window); break; +#endif + default: + break; } + + // OTRTODO: This gameplay specific stuff should not be in libultraship. This needs to be moved to soh and use sTunicColors + kokiri_col[0] = 30 / 255.0f; + kokiri_col[1] = 105 / 255.0f; + kokiri_col[2] = 27 / 255.0f; + + goron_col[0] = 100 / 255.0f; + goron_col[1] = 20 / 255.0f; + goron_col[2] = 0; + + zora_col[0] = 0; + zora_col[1] = 60 / 255.0f; + zora_col[2] = 100 / 255.0f; + + navi_idle_i_col[0] = 0; + navi_idle_i_col[1] = 0; + navi_idle_i_col[2] = 0; + + navi_idle_o_col[0] = 0; + navi_idle_o_col[1] = 0; + navi_idle_o_col[2] = 0; + + navi_npc_i_col[0] = 0; + navi_npc_i_col[1] = 0; + navi_npc_i_col[2] = 0; + + navi_npc_o_col[0] = 0; + navi_npc_o_col[1] = 0; + navi_npc_o_col[2] = 0; + + navi_enemy_i_col[0] = 0; + navi_enemy_i_col[1] = 0; + navi_enemy_i_col[2] = 0; + + navi_enemy_o_col[0] = 0; + navi_enemy_o_col[1] = 0; + navi_enemy_o_col[2] = 0; + + navi_prop_i_col[0] = 0; + navi_prop_i_col[1] = 0; + navi_prop_i_col[2] = 0; + + navi_prop_o_col[0] = 0; + navi_prop_o_col[1] = 0; + navi_prop_o_col[2] = 0; } void ImGuiBackendInit() { @@ -67,9 +155,14 @@ namespace SohImGui { case Backend::SDL: ImGui_ImplOpenGL3_Init("#version 120"); break; + +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) case Backend::DX11: ImGui_ImplDX11_Init(static_cast(impl.dx11.device), static_cast(impl.dx11.device_context)); break; +#endif + default: + break; } } @@ -78,9 +171,13 @@ namespace SohImGui { case Backend::SDL: ImGui_ImplSDL2_ProcessEvent(static_cast(event.sdl.event)); break; +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) case Backend::DX11: ImGui_ImplWin32_WndProcHandler(static_cast(event.win32.handle), event.win32.msg, event.win32.wparam, event.win32.lparam); break; +#endif + default: + break; } } @@ -89,9 +186,13 @@ namespace SohImGui { case Backend::SDL: ImGui_ImplSDL2_NewFrame(static_cast(impl.sdl.window)); break; +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) case Backend::DX11: ImGui_ImplWin32_NewFrame(); break; +#endif + default: + break; } } @@ -100,9 +201,13 @@ namespace SohImGui { case Backend::SDL: ImGui_ImplOpenGL3_NewFrame(); break; +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) case Backend::DX11: ImGui_ImplDX11_NewFrame(); break; +#endif + default: + break; } } @@ -111,35 +216,32 @@ namespace SohImGui { case Backend::SDL: ImGui_ImplOpenGL3_RenderDrawData(data); break; +#if defined(ENABLE_DX11) || defined(ENABLE_DX12) case Backend::DX11: ImGui_ImplDX11_RenderDrawData(data); break; +#endif + default: + break; } } - bool UseInternalRes() { - switch (impl.backend) { - case Backend::SDL: - return true; - } - return false; - } - bool UseViewports() { switch (impl.backend) { case Backend::DX11: return true; + default: + return false; } - return false; } - void SohImGui::ShowCursor(bool hide, Dialogues d) { + void ShowCursor(bool hide, Dialogues d) { if (d == Dialogues::dLoadSettings) { GlobalCtx2::GetInstance()->GetWindow()->ShowCursor(hide); return; } - if (d == Dialogues::dConsole && Game::Settings.debug.menu_bar) { + if (d == Dialogues::dConsole && CVar_GetS32("gOpenMenuBar", 0)) { return; } if (!GlobalCtx2::GetInstance()->GetWindow()->IsFullscreen()) { @@ -153,9 +255,9 @@ namespace SohImGui { } } - void LoadTexture(std::string name, std::string path) { + void LoadTexture(const std::string& name, const std::string& path) { GfxRenderingAPI* api = gfx_get_current_rendering_api(); - const auto res = GlobalCtx2::GetInstance()->GetResourceManager()->LoadFile(normalize(path)); + const auto res = GlobalCtx2::GetInstance()->GetResourceManager()->LoadFile(path); const auto asset = new GameAsset{ api->new_texture() }; uint8_t* img_data = stbi_load_from_memory(reinterpret_cast(res->buffer.get()), res->dwBufferSize, &asset->width, &asset->height, nullptr, 4); @@ -173,24 +275,71 @@ namespace SohImGui { stbi_image_free(img_data); } + void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint) { + GfxRenderingAPI* api = gfx_get_current_rendering_api(); + const auto res = static_cast(GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(path).get()); + + std::vector texBuffer; + texBuffer.reserve(res->width * res->height * 4); + + switch (res->texType) { + case Ship::TextureType::RGBA32bpp: + texBuffer.assign(res->imageData, res->imageData + (res->width * res->height * 4)); + break; + case Ship::TextureType::GrayscaleAlpha8bpp: + for (int32_t i = 0; i < res->width * res->height; i++) { + uint8_t ia = res->imageData[i]; + uint8_t color = ((ia >> 4) & 0xF) * 255 / 15; + uint8_t alpha = (ia & 0xF) * 255 / 15; + texBuffer.push_back(color); + texBuffer.push_back(color); + texBuffer.push_back(color); + texBuffer.push_back(alpha); + } + break; + default: + // TODO convert other image types + SPDLOG_WARN("SohImGui::LoadResource: Attempting to load unsupporting image type %s", path.c_str()); + return; + } + + for (size_t pixel = 0; pixel < texBuffer.size() / 4; pixel++) { + texBuffer[pixel * 4 + 0] *= tint.x; + texBuffer[pixel * 4 + 1] *= tint.y; + texBuffer[pixel * 4 + 2] *= tint.z; + texBuffer[pixel * 4 + 3] *= tint.w; + } + + const auto asset = new GameAsset{ api->new_texture() }; + + api->select_texture(0, asset->textureId); + api->set_sampler_parameters(0, false, 0, 0); + api->upload_texture(texBuffer.data(), res->width, res->height); + + DefaultAssets[name] = asset; + } + void Init(WindowImpl window_impl) { - impl = window_impl; Game::LoadSettings(); + impl = window_impl; ImGuiContext* ctx = ImGui::CreateContext(); ImGui::SetCurrentContext(ctx); io = &ImGui::GetIO(); io->ConfigFlags |= ImGuiConfigFlags_DockingEnable; + io->Fonts->AddFontDefault(); + if (UseViewports()) { io->ConfigFlags |= ImGuiConfigFlags_ViewportsEnable; } console->Init(); + overlay->Init(); ImGuiWMInit(); ImGuiBackendInit(); ModInternal::registerHookListener({ GFX_INIT, [](const HookEvent ev) { if (GlobalCtx2::GetInstance()->GetWindow()->IsFullscreen()) - ShowCursor(Game::Settings.debug.menu_bar, Dialogues::dLoadSettings); + ShowCursor(CVar_GetS32("gOpenMenuBar", 0), Dialogues::dLoadSettings); LoadTexture("Game_Icon", "assets/ship_of_harkinian/icons/gSohIcon.png"); LoadTexture("A-Btn", "assets/ship_of_harkinian/buttons/ABtn.png"); @@ -205,9 +354,16 @@ namespace SohImGui { LoadTexture("C-Down", "assets/ship_of_harkinian/buttons/CDown.png"); } }); + for (const auto& [i, controllers] : Ship::Window::Controllers) + { + CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftX", i).c_str(), 0); + CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftY", i).c_str(), 0); + needs_save = true; + } + ModInternal::registerHookListener({ CONTROLLER_READ, [](const HookEvent ev) { pads = static_cast(ev->baseArgs["cont_pad"]); - } }); + }}); Game::InitSettings(); } @@ -219,41 +375,159 @@ namespace SohImGui { ImGuiProcessEvent(event); } -#define BindButton(btn, status) ImGui::Image(impl.backend == Backend::DX11 ? GetTextureByID(DefaultAssets[btn]->textureId) : (ImTextureID)(DefaultAssets[btn]->textureId), ImVec2(16.0f * scale, 16.0f * scale), ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, (status) ? 255 : 0)); +#define BindButton(btn, status) ImGui::Image(GetTextureByID(DefaultAssets[btn]->textureId), ImVec2(16.0f * scale, 16.0f * scale), ImVec2(0, 0), ImVec2(1.0f, 1.0f), ImVec4(255, 255, 255, (status) ? 255 : 0)); - void BindAudioSlider(const char* name, const char* key, float* value, SeqPlayers playerId) { - ImGui::Text(name, static_cast(100 * *(value))); - if (ImGui::SliderFloat((std::string("##") + key).c_str(), value, 0.0f, 1.0f, "")) { - const float volume = floorf(*(value) * 100) / 100; - CVar_SetFloat(const_cast(key), volume); + void BindAudioSlider(const char* name, const char* key, float defaultValue, SeqPlayers playerId) + { + float value = CVar_GetFloat(key, defaultValue); + + ImGui::Text(name, static_cast(100 * value)); + if (ImGui::SliderFloat((std::string("##") + key).c_str(), &value, 0.0f, 1.0f, "")) { + const float volume = floorf(value * 100) / 100; + CVar_SetFloat(key, volume); needs_save = true; Game::SetSeqPlayerVolume(playerId, volume); } } - void Draw() { + void EnhancementRadioButton(std::string text, std::string 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", 0); + EnhancementRadioButton("German", "gLanguages", 1); + EnhancementRadioButton("French", "gLanguages", 2); + */ + int val = CVar_GetS32(cvarName.c_str(), 0); + if (ImGui::RadioButton(text.c_str(), id==val)) { + CVar_SetS32(cvarName.c_str(), (int)id); + needs_save = true; + } + } + void EnhancementCheckbox(std::string text, std::string cvarName) + { + bool val = (bool)CVar_GetS32(cvarName.c_str(), 0); + if (ImGui::Checkbox(text.c_str(), &val)) { + CVar_SetS32(cvarName.c_str(), val); + needs_save = true; + } + } + + void EnhancementButton(std::string text, std::string cvarName) + { + bool val = (bool)CVar_GetS32(cvarName.c_str(), 0); + if (ImGui::Button(text.c_str())) { + CVar_SetS32(cvarName.c_str(), !val); + needs_save = true; + } + } + + void EnhancementSliderInt(std::string text, std::string id, std::string cvarName, int min, int max, std::string format) + { + int val = CVar_GetS32(cvarName.c_str(), 0); + + ImGui::Text(text.c_str(), val); + + if (ImGui::SliderInt(id.c_str(), &val, min, max, format.c_str())) + { + CVar_SetS32(cvarName.c_str(), val); + needs_save = true; + } + + if (val < min) + { + val = min; + CVar_SetS32(cvarName.c_str(), val); + needs_save = true; + } + + if (val > max) + { + val = max; + CVar_SetS32(cvarName.c_str(), val); + needs_save = true; + } + } + + void EnhancementSliderFloat(std::string text, std::string id, std::string cvarName, float min, float max, std::string format, float defaultValue, bool isPercentage) + { + float val = CVar_GetFloat(cvarName.c_str(), defaultValue); + + if (!isPercentage) + ImGui::Text(text.c_str(), val); + else + ImGui::Text(text.c_str(), static_cast(100 * val)); + + if (ImGui::SliderFloat(id.c_str(), &val, min, max, format.c_str())) + { + CVar_SetFloat(cvarName.c_str(), val); + needs_save = true; + } + + if (val < min) + { + val = min; + CVar_SetFloat(cvarName.c_str(), val); + needs_save = true; + } + + if (val > max) + { + val = max; + CVar_SetFloat(cvarName.c_str(), val); + needs_save = true; + } + } + + void EnhancementColor3(std::string text, std::string cvarName, float defaultColors[3]) + { + int r = CVar_GetS32((cvarName + "_Red").c_str(), (defaultColors[0] * 255.0f)); + int g = CVar_GetS32((cvarName + "_Green").c_str(), (defaultColors[1] * 255.0f)); + int b = CVar_GetS32((cvarName + "_Blue").c_str(), (defaultColors[2] * 255.0f)); + + float colors[3]; + colors[0] = r / 255.0f; + colors[1] = g / 255.0f; + colors[2] = b / 255.0f; + + { + if (ImGui::ColorEdit3(text.c_str(), colors)) + { + CVar_SetS32((cvarName + "_Red").c_str(), (int)(colors[0] * 255)); + CVar_SetS32((cvarName + "_Green").c_str(), (int)(colors[1] * 255)); + CVar_SetS32((cvarName + "_Blue").c_str(), (int)(colors[2] * 255)); + needs_save = true; + } + } + } + + void DrawMainMenuAndCalculateGameSize() { console->Update(); ImGuiBackendNewFrame(); ImGuiWMNewFrame(); ImGui::NewFrame(); const std::shared_ptr wnd = GlobalCtx2::GetInstance()->GetWindow(); - ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDocking | + ImGuiWindowFlags window_flags = ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBringToFrontOnFocus | ImGuiWindowFlags_NoNavFocus | ImGuiWindowFlags_NoResize; - if (UseViewports()) { - window_flags |= ImGuiWindowFlags_NoBackground; - } - if (Game::Settings.debug.menu_bar) window_flags |= ImGuiWindowFlags_MenuBar; + if (CVar_GetS32("gOpenMenuBar", 0)) window_flags |= ImGuiWindowFlags_MenuBar; const ImGuiViewport* viewport = ImGui::GetMainViewport(); ImGui::SetNextWindowPos(viewport->WorkPos); ImGui::SetNextWindowSize(ImVec2(wnd->GetCurrentWidth(), wnd->GetCurrentHeight())); ImGui::SetNextWindowViewport(viewport->ID); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0.0f, 0.0f)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); + ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f); ImGui::Begin("Main - Deck", nullptr, window_flags); - ImGui::PopStyleVar(); + ImGui::PopStyleVar(3); + + ImVec2 top_left_pos = ImGui::GetWindowPos(); const ImGuiID dockId = ImGui::GetID("main_dock"); @@ -269,16 +543,17 @@ namespace SohImGui { ImGui::DockSpace(dockId, ImVec2(0.0f, 0.0f), ImGuiDockNodeFlags_None); if (ImGui::IsKeyPressed(TOGGLE_BTN)) { - Game::Settings.debug.menu_bar = !Game::Settings.debug.menu_bar; + bool menu_bar = CVar_GetS32("gOpenMenuBar", 0); + CVar_SetS32("gOpenMenuBar", !menu_bar); needs_save = true; - GlobalCtx2::GetInstance()->GetWindow()->dwMenubar = Game::Settings.debug.menu_bar; - ShowCursor(Game::Settings.debug.menu_bar, Dialogues::dMenubar); + GlobalCtx2::GetInstance()->GetWindow()->dwMenubar = menu_bar; + ShowCursor(menu_bar, Dialogues::dMenubar); } if (ImGui::BeginMenuBar()) { if (DefaultAssets.contains("Game_Icon")) { ImGui::SetCursorPos(ImVec2(5, 2.5f)); - ImGui::Image(impl.backend == Backend::DX11 ? GetTextureByID(DefaultAssets["Game_Icon"]->textureId) : reinterpret_cast(DefaultAssets["Game_Icon"]->textureId), ImVec2(16.0f, 16.0f)); + ImGui::Image(GetTextureByID(DefaultAssets["Game_Icon"]->textureId), ImVec2(16.0f, 16.0f)); ImGui::SameLine(); ImGui::SetCursorPos(ImVec2(25, 0)); } @@ -286,141 +561,292 @@ namespace SohImGui { ImGui::Separator(); if (ImGui::BeginMenu("Audio")) { - const float volume = Game::Settings.audio.master; - ImGui::Text("Master Volume: %d %%", static_cast(100 * volume)); - if (ImGui::SliderFloat("##Master_Vol", &Game::Settings.audio.master, 0.0f, 1.0f, "")) { - CVar_SetFloat(const_cast("gGameMasterVolume"), volume); - needs_save = true; - } + EnhancementSliderFloat("Master Volume: %d %%", "##Master_Vol", "gGameMasterVolume", 0.0f, 1.0f, "", 1.0f, true); - BindAudioSlider("Main Music Volume: %d %%", "gMainMusicVolume", &Game::Settings.audio.music_main, SEQ_BGM_MAIN); - BindAudioSlider("Sub Music Volume: %d %%", "gSubMusicVolume", &Game::Settings.audio.music_sub, SEQ_BGM_SUB); - BindAudioSlider("Sound Effects Volume: %d %%", "gSFXMusicVolume", &Game::Settings.audio.sfx, SEQ_SFX); - BindAudioSlider("Fanfare Volume: %d %%", "gFanfareVolume", &Game::Settings.audio.fanfare, SEQ_FANFARE); + BindAudioSlider("Main Music Volume: %d %%", "gMainMusicVolume", 1.0f, SEQ_BGM_MAIN); + BindAudioSlider("Sub Music Volume: %d %%", "gSubMusicVolume", 1.0f, SEQ_BGM_SUB); + BindAudioSlider("Sound Effects Volume: %d %%", "gSFXMusicVolume", 1.0f, SEQ_SFX); + BindAudioSlider("Fanfare Volume: %d %%", "gFanfareVolume", 1.0f, SEQ_FANFARE); ImGui::EndMenu(); } - if (ImGui::BeginMenu("Controller")) { - ImGui::Text("Gyro Sensitivity: %d %%", static_cast(100 * Game::Settings.controller.gyro_sensitivity)); - if (ImGui::SliderFloat("##GYROSCOPE", &Game::Settings.controller.gyro_sensitivity, 0.0f, 1.0f, "")) { - needs_save = true; - } - ImGui::Text("Rumble Strength: %d %%", static_cast(100 * Game::Settings.controller.rumble_strength)); - if (ImGui::SliderFloat("##RUMBLE", &Game::Settings.controller.rumble_strength, 0.0f, 1.0f, "")) { - needs_save = true; + if (ImGui::BeginMenu("Controller")) + { + for (const auto& [i, controllers] : Ship::Window::Controllers) + { + bool hasPad = std::find_if(controllers.begin(), controllers.end(), [](const auto& c) { + return c->HasPadConf() && c->Connected(); + }) != controllers.end(); + + if (!hasPad) continue; + + auto menuLabel = "Controller " + std::to_string(i + 1); + if (ImGui::BeginMenu(menuLabel.c_str())) + { + EnhancementSliderFloat("Gyro Sensitivity: %d %%", "##GYROSCOPE", StringHelper::Sprintf("gCont%i_GyroSensitivity", i), 0.0f, 1.0f, "", 1.0f, true); + + if (ImGui::Button("Recalibrate Gyro")) + { + CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftX", i).c_str(), 0); + CVar_SetFloat(StringHelper::Sprintf("gCont%i_GyroDriftY", i).c_str(), 0); + needs_save = true; + } + + ImGui::Separator(); + + EnhancementSliderFloat("Rumble Strength: %d %%", "##RUMBLE", StringHelper::Sprintf("gCont%i_RumbleStrength", i), 0.0f, 1.0f, "", 1.0f, true); + + ImGui::EndMenu(); + } + ImGui::Separator(); } - if (ImGui::Checkbox("Show Inputs", &Game::Settings.controller.input_enabled)) { - needs_save = true; - } + EnhancementCheckbox("Show Inputs", "gInputEnabled"); + EnhancementCheckbox("Rumble Enabled", "gRumbleEnabled"); - ImGui::Text("Input Scale: %.1f", Game::Settings.controller.input_scale); - if (ImGui::SliderFloat("##Input", &Game::Settings.controller.input_scale, 1.0f, 3.0f, "")) { - needs_save = true; - } + EnhancementSliderFloat("Input Scale: %.1f", "##Input", "gInputScale", 1.0f, 3.0f, "", 1.0f, false); + + ImGui::Separator(); + + EnhancementCheckbox("Dpad Support on Pause and File Select", "gDpadPauseName"); + EnhancementCheckbox("DPad Support in Ocarina and Text Choice", "gDpadOcarinaText"); + EnhancementCheckbox("DPad Support for Browsing Shop Items", "gDpadShop"); ImGui::EndMenu(); } - if (ImGui::BeginMenu("Enhancements")) { + if (ImGui::BeginMenu("Graphics")) + { + EnhancementSliderInt("Internal Resolution: %dx", "##IMul", "gInternalResolution", 1, 8, ""); + gfx_current_dimensions.internal_mul = CVar_GetS32("gInternalResolution", 1); + EnhancementSliderInt("MSAA: %d", "##IMSAA", "gMSAAValue", 1, 8, ""); + gfx_msaa_level = CVar_GetS32("gMSAAValue", 1); + EXPERIMENTAL(); + ImGui::Text("Texture Filter (Needs reload)"); + GfxRenderingAPI* gapi = gfx_get_current_rendering_api(); + if (ImGui::BeginCombo("##filters", filters[gapi->get_texture_filter()])) { + for (int fId = 0; fId <= FilteringMode::NONE; fId++) { + if (ImGui::Selectable(filters[fId], fId == gapi->get_texture_filter())) { + INFO("New Filter: %s", filters[fId]); + gapi->set_texture_filter((FilteringMode)fId); + + CVar_SetS32("gTextureFilter", (int) fId); + needs_save = true; + } + + } + ImGui::EndCombo(); + } + overlay->DrawSettings(); + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Languages")) { + EnhancementRadioButton("English", "gLanguages", 0); + EnhancementRadioButton("German", "gLanguages", 1); + EnhancementRadioButton("French", "gLanguages", 2); + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Enhancements")) + { ImGui::Text("Gameplay"); ImGui::Separator(); - if (ImGui::Checkbox("Fast Text", &Game::Settings.enhancements.fast_text)) { - CVar_SetS32(const_cast("gFastText"), Game::Settings.enhancements.fast_text); - needs_save = true; - } + EnhancementSliderInt("Text Speed: %dx", "##TEXTSPEED", "gTextSpeed", 1, 5, ""); + EnhancementSliderInt("King Zora Speed: %dx", "##WEEPSPEED", "gMweepSpeed", 1, 5, ""); + + EnhancementCheckbox("Skip Text", "gSkipText"); + EnhancementCheckbox("Minimal UI", "gMinimalUI"); + EnhancementCheckbox("MM Bunny Hood", "gMMBunnyHood"); + EnhancementCheckbox("Visual Stone of Agony", "gVisualAgony"); ImGui::Text("Graphics"); ImGui::Separator(); - if (UseInternalRes()) { - HOOK(ImGui::Checkbox("N64 Mode", &Game::Settings.debug.n64mode)); - } + EnhancementCheckbox("N64 Mode", "gN64Mode"); - if (ImGui::Checkbox("Animated Link in Pause Menu", &Game::Settings.enhancements.animated_pause_menu)) { - CVar_SetS32(const_cast("gPauseLiveLink"), Game::Settings.enhancements.animated_pause_menu); - needs_save = true; - } + EnhancementCheckbox("Animated Link in Pause Menu", "gPauseLiveLink"); + EnhancementCheckbox("Enable 3D Dropped items", "gNewDrops"); + EnhancementCheckbox("Faster Block Push", "gFasterBlockPush"); + EnhancementCheckbox("Dynamic Wallet Icon", "gDynamicWalletIcon"); + EnhancementCheckbox("Always show dungeon entrances", "gAlwaysShowDungeonMinimapIcon"); - if (ImGui::Checkbox("Disable LOD", &Game::Settings.enhancements.disable_lod)) { - CVar_SetS32(const_cast("gDisableLOD"), Game::Settings.enhancements.disable_lod); - needs_save = true; - } - - ImGui::Text("Debugging"); + ImGui::Text("Fixes"); ImGui::Separator(); + EnhancementCheckbox("Fix L&R Pause menu", "gUniformLR"); + EnhancementCheckbox("Fix Dungeon entrances", "gFixDungeonMinimapIcon"); - if (ImGui::Checkbox("Debug Mode", &Game::Settings.enhancements.debug_mode)) { - CVar_SetS32(const_cast("gDebugEnabled"), Game::Settings.enhancements.debug_mode); - needs_save = true; - } + EXPERIMENTAL(); + + EnhancementCheckbox("60 fps interpolation", "g60FPS"); + EnhancementCheckbox("Disable LOD", "gDisableLOD"); ImGui::EndMenu(); } - if (ImGui::BeginMenu("Developer Tools")) { - HOOK(ImGui::MenuItem("Stats", nullptr, &Game::Settings.debug.soh)); - HOOK(ImGui::MenuItem("Console", nullptr, &console->opened)); + if (ImGui::BeginMenu("Cosmetics")) + { + ImGui::Text("Tunics"); + ImGui::Separator(); + + EnhancementColor3("Kokiri Tunic", "gTunic_Kokiri", kokiri_col); + EnhancementColor3("Goron Tunic", "gTunic_Goron", goron_col); + EnhancementColor3("Zora Tunic", "gTunic_Zora", zora_col); + + ImGui::Text("Navi"); + ImGui::Separator(); + + EnhancementColor3("Navi Idle Inner", "gNavi_Idle_Inner", navi_idle_i_col); + EnhancementColor3("Navi Idle Outer", "gNavi_Idle_Outer", navi_idle_o_col); + EnhancementColor3("Navi NPC Inner", "gNavi_NPC_Inner", navi_npc_i_col); + EnhancementColor3("Navi NPC Outer", "gNavi_NPC_Outer", navi_npc_o_col); + EnhancementColor3("Navi Enemy Inner", "gNavi_Enemy_Inner", navi_enemy_i_col); + EnhancementColor3("Navi Enemy Outer", "gNavi_Enemy_Outer", navi_enemy_o_col); + EnhancementColor3("Navi Prop Inner", "gNavi_Prop_Inner", navi_prop_i_col); + EnhancementColor3("Navi Prop Outer", "gNavi_Prop_Outer", navi_prop_o_col); + ImGui::EndMenu(); } + if (ImGui::BeginMenu("Cheats")) + { + if (ImGui::BeginMenu("Infinite...")) { + EnhancementCheckbox("Money", "gInfiniteMoney"); + EnhancementCheckbox("Health", "gInfiniteHealth"); + EnhancementCheckbox("Ammo", "gInfiniteAmmo"); + EnhancementCheckbox("Magic", "gInfiniteMagic"); + EnhancementCheckbox("Nayru's Love", "gInfiniteNayru"); + + ImGui::EndMenu(); + } + + EnhancementCheckbox("No Clip", "gNoClip"); + EnhancementCheckbox("Climb Everything", "gClimbEverything"); + EnhancementCheckbox("Moon Jump on L", "gMoonJumpOnL"); + EnhancementCheckbox("Super Tunic", "gSuperTunic"); + EnhancementCheckbox("Easy ISG", "gEzISG"); + EnhancementCheckbox("Unrestricted Items", "gNoRestrictItems"); + EnhancementCheckbox("Freeze Time", "gFreezeTime"); + + ImGui::EndMenu(); + } + + if (ImGui::BeginMenu("Developer Tools")) + { + EnhancementCheckbox("OoT Debug Mode", "gDebugEnabled"); + ImGui::Separator(); + EnhancementCheckbox("Stats", "gStatsEnabled"); + EnhancementCheckbox("Console", "gConsoleEnabled"); + console->opened = CVar_GetS32("gConsoleEnabled", 0); + + ImGui::EndMenu(); + } + + for (const auto& category : windowCategories) { + if (ImGui::BeginMenu(category.first.c_str())) { + for (const std::string& name : category.second) { + std::string varName(name); + varName.erase(std::ranges::remove_if(varName, isspace).begin(), varName.end()); + std::string toggleName = "g" + varName + "Enabled"; + + EnhancementCheckbox(name, toggleName); + customWindows[name].enabled = CVar_GetS32(toggleName.c_str(), 0); + } + ImGui::EndMenu(); + } + + } + ImGui::EndMenuBar(); } ImGui::End(); - ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); - ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); - ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove; - if (UseViewports()) { - flags |= ImGuiWindowFlags_NoBackground; - } - ImGui::Begin("OoT Master Quest", nullptr, flags); - ImGui::PopStyleVar(); - ImGui::PopStyleColor(); - ImVec2 main_pos = ImGui::GetWindowPos(); - ImVec2 size = ImGui::GetContentRegionAvail(); - ImVec2 pos = ImVec2(0, 0); - gfx_current_dimensions.width = size.x * gfx_current_dimensions.internal_mul; - gfx_current_dimensions.height = size.y * gfx_current_dimensions.internal_mul; - if (UseInternalRes()) { - if (Game::Settings.debug.n64mode) { - gfx_current_dimensions.width = 320; - gfx_current_dimensions.height = 240; - const int sw = size.y * 320 / 240; - pos = ImVec2(size.x / 2 - sw / 2, 0); - size = ImVec2(sw, size.y); - } - } - - if (UseInternalRes()) { - int fbuf = std::stoi(SohUtils::getEnvironmentVar("framebuffer")); - ImGui::ImageRotated(reinterpret_cast(fbuf), pos, size, 0.0f); - } - ImGui::End(); - - if (Game::Settings.debug.soh) { + if (CVar_GetS32("gStatsEnabled", 0)) { const float framerate = ImGui::GetIO().Framerate; ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0, 0, 0, 0)); - ImGui::Begin("Debug Stats", nullptr, ImGuiWindowFlags_None); + ImGui::Begin("Debug Stats", nullptr, ImGuiWindowFlags_NoFocusOnAppearing); +#ifdef _WIN32 ImGui::Text("Platform: Windows"); +#else + ImGui::Text("Platform: Linux"); +#endif ImGui::Text("Status: %.3f ms/frame (%.1f FPS)", 1000.0f / framerate, framerate); - if (UseInternalRes()) { - ImGui::Text("Internal Resolution:"); - ImGui::SliderInt("Mul", reinterpret_cast(&gfx_current_dimensions.internal_mul), 1, 8); - } ImGui::End(); ImGui::PopStyleColor(); } - const float scale = Game::Settings.controller.input_scale; + console->Draw(); + + for (auto& windowIter : customWindows) { + CustomWindow& window = windowIter.second; + if (window.drawFunc != nullptr) { + window.drawFunc(window.enabled); + } + } + + ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(0, 0)); + ImGui::PushStyleVar(ImGuiStyleVar_WindowBorderSize, 0.0f); + ImGui::PushStyleVar(ImGuiStyleVar_ChildBorderSize, 0.0f); + ImGui::PushStyleColor(ImGuiCol_ChildBg, ImVec4(0.0f, 0.0f, 0.0f, 0.0f)); + ImGuiWindowFlags flags = ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground; + ImGui::Begin("OoT Master Quest", nullptr, flags); + ImGui::PopStyleVar(3); + ImGui::PopStyleColor(); + + ImVec2 main_pos = ImGui::GetWindowPos(); + main_pos.x -= top_left_pos.x; + main_pos.y -= top_left_pos.y; + ImVec2 size = ImGui::GetContentRegionAvail(); + ImVec2 pos = ImVec2(0, 0); + gfx_current_dimensions.width = size.x * gfx_current_dimensions.internal_mul; + gfx_current_dimensions.height = size.y * gfx_current_dimensions.internal_mul; + gfx_current_game_window_viewport.x = main_pos.x; + gfx_current_game_window_viewport.y = main_pos.y; + gfx_current_game_window_viewport.width = size.x; + gfx_current_game_window_viewport.height = size.y; + + if (CVar_GetS32("gN64Mode", 0)) + { + gfx_current_dimensions.width = 320; + gfx_current_dimensions.height = 240; + const int sw = size.y * 320 / 240; + gfx_current_game_window_viewport.x += (size.x - sw) / 2; + gfx_current_game_window_viewport.width = sw; + pos = ImVec2(size.x / 2 - sw / 2, 0); + size = ImVec2(sw, size.y); + } + + overlay->Draw(); + } + + void DrawFramebufferAndGameInput() { + ImVec2 main_pos = ImGui::GetWindowPos(); + ImVec2 size = ImGui::GetContentRegionAvail(); + ImVec2 pos = ImVec2(0, 0); + if (CVar_GetS32("gN64Mode", 0)) { + const int sw = size.y * 320 / 240; + pos = ImVec2(size.x / 2 - sw / 2, 0); + size = ImVec2(sw, size.y); + } + std::string fb_str = SohUtils::getEnvironmentVar("framebuffer"); + if (!fb_str.empty()) { + uintptr_t fbuf = (uintptr_t)std::stoull(fb_str); + //ImGui::ImageSimple(reinterpret_cast(fbuf), pos, size); + ImGui::SetCursorPos(pos); + ImGui::Image(reinterpret_cast(fbuf), size); + } + + ImGui::End(); + + const float scale = CVar_GetFloat("gInputScale", 1.0f); ImVec2 BtnPos = ImVec2(160 * scale, 85 * scale); - if(Game::Settings.controller.input_enabled) { + if (CVar_GetS32("gInputEnabled", 0)) { ImGui::SetNextWindowSize(BtnPos); ImGui::SetNextWindowPos(ImVec2(main_pos.x + size.x - BtnPos.x - 20, main_pos.y + size.y - BtnPos.y - 20)); @@ -466,9 +892,9 @@ namespace SohImGui { ImGui::End(); } } + } - console->Draw(); - + void Render() { ImGui::Render(); ImGuiRenderDrawData(ImGui::GetDrawData()); if (UseViewports()) { @@ -477,7 +903,43 @@ namespace SohImGui { } } + void CancelFrame() { + ImGui::EndFrame(); + if (UseViewports()) { + ImGui::UpdatePlatformWindows(); + } + } + void BindCmd(const std::string& cmd, CommandEntry entry) { console->Commands[cmd] = std::move(entry); } -} \ No newline at end of file + + void AddWindow(const std::string& category, const std::string& name, WindowDrawFunc drawFunc) { + if (customWindows.contains(name)) { + SPDLOG_ERROR("SohImGui::AddWindow: Attempting to add duplicate window name %s", name.c_str()); + return; + } + + customWindows[name] = { + .enabled = false, + .drawFunc = drawFunc + }; + + windowCategories[category].emplace_back(name); + } + + ImTextureID GetTextureByName(const std::string& name) { + return GetTextureByID(DefaultAssets[name]->textureId); + } + + ImTextureID GetTextureByID(int id) { +#ifdef ENABLE_DX11 + if (impl.backend == Backend::DX11) + { + ImTextureID gfx_d3d11_get_texture_by_id(int id); + return gfx_d3d11_get_texture_by_id(id); + } +#endif + return reinterpret_cast(id); + } +} diff --git a/libultraship/libultraship/SohImGuiImpl.h b/libultraship/libultraship/SohImGuiImpl.h index b7c946eff..dd0ec9fd3 100644 --- a/libultraship/libultraship/SohImGuiImpl.h +++ b/libultraship/libultraship/SohImGuiImpl.h @@ -1,5 +1,7 @@ #pragma once +#include "GameOverlay.h" +#include "Lib/ImGui/imgui.h" #include "SohConsole.h" struct GameAsset { @@ -47,11 +49,35 @@ namespace SohImGui { } sdl; } EventImpl; + extern WindowImpl impl; + + using WindowDrawFunc = void(*)(bool& enabled); + + typedef struct { + bool enabled; + WindowDrawFunc drawFunc; + } CustomWindow; + extern Console* console; + extern Ship::GameOverlay* overlay; + extern bool needs_save; void Init(WindowImpl window_impl); void Update(EventImpl event); - void Draw(void); + + void EnhancementRadioButton(std::string text, std::string cvarName, int value); + void EnhancementCheckbox(std::string text, std::string cvarName); + void EnhancementSliderInt(std::string text, std::string id, std::string cvarName, int min, int max, std::string format); + void EnhancementSliderFloat(std::string text, std::string id, std::string cvarName, float min, float max, std::string format, float defaultValue); + + void DrawMainMenuAndCalculateGameSize(void); + + void DrawFramebufferAndGameInput(void); + void Render(void); + void CancelFrame(void); void ShowCursor(bool hide, Dialogues w); void BindCmd(const std::string& cmd, CommandEntry entry); - void* GetTextureByID(int id); + void AddWindow(const std::string& category, const std::string& name, WindowDrawFunc drawFunc); + void LoadResource(const std::string& name, const std::string& path, const ImVec4& tint = ImVec4(1, 1, 1, 1)); + ImTextureID GetTextureByID(int id); + ImTextureID GetTextureByName(const std::string& name); } diff --git a/libultraship/libultraship/TextureMod.cpp b/libultraship/libultraship/TextureMod.cpp index dd2d6fc3a..b44987a62 100644 --- a/libultraship/libultraship/TextureMod.cpp +++ b/libultraship/libultraship/TextureMod.cpp @@ -43,7 +43,7 @@ namespace Ship { if (raw_path == nullptr) return; const auto api = BIND_PTR("gfx_api", GfxRenderingAPI*); - const auto path = normalize(raw_path) + ".png"; + const auto path = std::string(raw_path) + ".png"; const auto node = BIND_PTR("node", TextureCacheNode**); const auto fmt = BIND_VAR("fmt", uint32_t*); const auto siz = BIND_VAR("siz", uint32_t*); @@ -80,7 +80,7 @@ namespace Ship { if (!this->TextureCache.contains(path)) this->TextureCache[path].resize(10); - TextureCacheKey key = { orig_addr, static_cast(fmt), static_cast(siz), static_cast(palette) }; + TextureCacheKey key = { orig_addr, { }, static_cast(fmt), static_cast(siz), static_cast(palette) }; TextureCacheValue value = { api->new_texture(), 0, 0, false }; const auto entry = new TextureCacheNode(key, value); api->select_texture(tile, entry->second.texture_id); diff --git a/libultraship/libultraship/TextureMod.h b/libultraship/libultraship/TextureMod.h index 987a0c6f3..8dac99387 100644 --- a/libultraship/libultraship/TextureMod.h +++ b/libultraship/libultraship/TextureMod.h @@ -36,15 +36,6 @@ namespace Ship { void Hook_InvalidateTexture(HookEvent event); }; - inline std::string normalize(std::string path) { -#ifdef _WIN32 - std::ranges::replace(path, '/', '\\'); -#else - std::replace(path.begin(), path.end(), '\\', '/'); -#endif - return path; - } - inline void GrayOutTexture(uint8_t* data, int width, int height) { for (int x = 0; x < width * height * 4; x += 4) { diff --git a/libultraship/libultraship/Utils.cpp b/libultraship/libultraship/Utils.cpp index e36ba29f5..d54952c77 100644 --- a/libultraship/libultraship/Utils.cpp +++ b/libultraship/libultraship/Utils.cpp @@ -1,9 +1,14 @@ #include "Utils.h" +#include + +#ifdef _MSC_VER +#define strdup _strdup +#endif namespace Utils { std::vector SplitText(const std::string text, char separator = ' ', bool keep_quotes = false) { std::vector args; - char* input = _strdup(text.c_str()); + char* input = strdup(text.c_str()); const size_t length = strlen(input); bool inQuotes = false; diff --git a/libultraship/libultraship/WasapiAudioPlayer.cpp b/libultraship/libultraship/WasapiAudioPlayer.cpp index 26e4504d3..30cb10905 100644 --- a/libultraship/libultraship/WasapiAudioPlayer.cpp +++ b/libultraship/libultraship/WasapiAudioPlayer.cpp @@ -1,3 +1,4 @@ +#ifdef _WIN32 #include "WasapiAudioPlayer.h" #include "spdlog/spdlog.h" @@ -169,4 +170,5 @@ namespace Ship { } return S_OK; } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/libultraship/libultraship/WasapiAudioPlayer.h b/libultraship/libultraship/WasapiAudioPlayer.h index 5067d01a2..dac7dd7a7 100644 --- a/libultraship/libultraship/WasapiAudioPlayer.h +++ b/libultraship/libultraship/WasapiAudioPlayer.h @@ -1,4 +1,7 @@ #pragma once + +#ifdef _WIN32 + #include "AudioPlayer.h" #include #include @@ -39,3 +42,4 @@ namespace Ship { bool started; }; } +#endif diff --git a/libultraship/libultraship/Window.cpp b/libultraship/libultraship/Window.cpp index 24fda1ade..588e3af50 100644 --- a/libultraship/libultraship/Window.cpp +++ b/libultraship/libultraship/Window.cpp @@ -12,6 +12,8 @@ #include "Matrix.h" #include "AudioPlayer.h" #include "WasapiAudioPlayer.h" +#include "PulseAudioPlayer.h" +#include "SDLAudioPlayer.h" #include "Lib/Fast3D/gfx_pc.h" #include "Lib/Fast3D/gfx_sdl.h" #include "Lib/Fast3D/gfx_opengl.h" @@ -22,6 +24,7 @@ #include #include "SohHooks.h" #include "SohConsole.h" + #include extern "C" { @@ -39,8 +42,16 @@ extern "C" { exit(EXIT_FAILURE); } + const char* controllerDb = "gamecontrollerdb.txt"; + int mappingsAdded = SDL_GameControllerAddMappingsFromFile(controllerDb); + if (mappingsAdded >= 0) { + SPDLOG_INFO("Added SDL game controllers from \"{}\" ({})", controllerDb, mappingsAdded); + } else { + SPDLOG_ERROR("Failed add SDL game controller mappings from \"{}\" ({})", controllerDb, SDL_GetError()); + } + // TODO: This for loop is debug. Burn it with fire. - for (size_t i = 0; i < SDL_NumJoysticks(); i++) { + for (int i = 0; i < SDL_NumJoysticks(); i++) { if (SDL_IsGameController(i)) { // Get the GUID from SDL char buf[33]; @@ -199,7 +210,7 @@ extern "C" { return (char*)res->imageData; } - void ResourceMgr_WriteTexS16ByName(char* texPath, int index, s16 value) { + void ResourceMgr_WriteTexS16ByName(char* texPath, size_t index, s16 value) { const auto res = static_cast(Ship::GlobalCtx2::GetInstance()->GetResourceManager()->LoadResource(texPath).get()); if (res != nullptr) @@ -229,7 +240,7 @@ extern "C" { } } -extern "C" GfxWindowManagerAPI gfx_sdl; +extern GfxWindowManagerAPI gfx_sdl; void SetWindowManager(GfxWindowManagerAPI** WmApi, GfxRenderingAPI** RenderingApi, const std::string& gfx_backend); namespace Ship { @@ -267,9 +278,16 @@ namespace Ship { WmApi->set_keyboard_callbacks(Window::KeyDown, Window::KeyUp, Window::AllKeysUp); } - void Window::RunCommands(Gfx* Commands) { + void Window::StartFrame() { gfx_start_frame(); - gfx_run(Commands); + } + + void Window::RunCommands(Gfx* Commands, const std::vector>& mtx_replacements) { + for (const auto& m : mtx_replacements) { + gfx_run(Commands, m); + gfx_end_frame(); + } + gfx_run(Commands, {}); gfx_end_frame(); } @@ -278,6 +296,10 @@ namespace Ship { //gfx_set_framedivisor(0); } + void Window::GetPixelDepthPrepare(float x, float y) { + gfx_get_pixel_depth_prepare(x, y); + } + uint16_t Window::GetPixelDepth(float x, float y) { return gfx_get_pixel_depth(x, y); } @@ -311,6 +333,8 @@ namespace Ship { GlobalCtx2::GetInstance()->GetWindow()->ToggleFullscreen(); } + + // OTRTODO: Rig with Kirito's console? //if (dwScancode == Ship::stoi(Conf["KEYBOARD SHORTCUTS"]["KEY_CONSOLE"])) { // ToggleConsole(); @@ -382,6 +406,12 @@ namespace Ship { } void Window::SetAudioPlayer() { +#ifdef _WIN32 APlayer = std::make_shared(); +#elif defined(__linux) + APlayer = std::make_shared(); +#else + APlayer = std::make_shared(); +#endif } } diff --git a/libultraship/libultraship/Window.h b/libultraship/libultraship/Window.h index 6046ca4ae..04886c53e 100644 --- a/libultraship/libultraship/Window.h +++ b/libultraship/libultraship/Window.h @@ -18,8 +18,10 @@ namespace Ship { ~Window(); void MainLoop(void (*MainFunction)(void)); void Init(); - void RunCommands(Gfx* Commands); + void StartFrame(); + void RunCommands(Gfx* Commands, const std::vector>& mtx_replacements); void SetFrameDivisor(int divisor); + void GetPixelDepthPrepare(float x, float y); uint16_t GetPixelDepth(float x, float y); void ToggleFullscreen(); void SetFullscreen(bool bIsFullscreen); diff --git a/libultraship/libultraship/WindowShim.cpp b/libultraship/libultraship/WindowShim.cpp index 96b636aff..4469c5c29 100644 --- a/libultraship/libultraship/WindowShim.cpp +++ b/libultraship/libultraship/WindowShim.cpp @@ -23,7 +23,9 @@ void SetWindowManager(struct GfxWindowManagerAPI** WmApi, struct GfxRenderingAPI #ifdef ENABLE_OPENGL *RenderingApi = &gfx_opengl_api; #if defined(__linux__) - *WmApi = &gfx_glx; + // LINUX_TODO: + // *WmApi = &gfx_glx; + *WmApi = &gfx_sdl; #else *WmApi = &gfx_sdl; #endif diff --git a/libultraship/libultraship/libultraship.vcxproj b/libultraship/libultraship/libultraship.vcxproj index 8443b6b11..b3448e7b0 100644 --- a/libultraship/libultraship/libultraship.vcxproj +++ b/libultraship/libultraship/libultraship.vcxproj @@ -101,31 +101,49 @@ true $(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)Lib\Fast3D\U64;$(ProjectDir)Lib\libjpeg\include;$(ProjectDir)Lib\spdlog\include;$(ProjectDir)Lib\SDL;$(ProjectDir)Lib\GLEW;$(IncludePath) $(ProjectDir)Lib\SDL\lib\x86;$(LibraryPath) + MinimumRecommendedRules.ruleset + + true $(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)Lib\Fast3D\U64;$(ProjectDir)Lib\libjpeg\include;$(ProjectDir)Lib\spdlog\include;$(ProjectDir)Lib\SDL;$(ProjectDir)Lib\GLEW;$(IncludePath) $(ProjectDir)Lib\SDL\lib\x86;$(LibraryPath) + MinimumRecommendedRules.ruleset + + false $(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)Lib\Fast3D\U64;$(ProjectDir)Lib\spdlog\include;$(ProjectDir)Lib\SDL;$(ProjectDir)Lib\GLEW;$(IncludePath) $(ProjectDir)Lib\SDL\lib\x86;$(LibraryPath) + MinimumRecommendedRules.ruleset + + true $(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)Lib\Fast3D\U64;$(ProjectDir)Lib\spdlog\include;$(ProjectDir)Lib\SDL;$(ProjectDir)Lib\GLEW;$(IncludePath) $(ProjectDir)Lib\SDL\lib\x64;$(LibraryPath) + MinimumRecommendedRules.ruleset + + true $(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)Lib\Fast3D\U64;$(ProjectDir)Lib\spdlog\include;$(ProjectDir)Lib\SDL;$(ProjectDir)Lib\GLEW;$(IncludePath) $(ProjectDir)Lib\SDL\lib\x64;$(LibraryPath) + MinimumRecommendedRules.ruleset + + false $(ProjectDir)..\..\ZAPDTR\ZAPDUtils;$(ProjectDir)Lib\Fast3D\U64;$(ProjectDir)Lib\spdlog\include;$(ProjectDir)Lib\SDL;$(ProjectDir)Lib\GLEW;$(IncludePath) $(ProjectDir)Lib\SDL\lib\x64;$(LibraryPath) + MinimumRecommendedRules.ruleset + + @@ -238,6 +256,7 @@ + @@ -325,7 +344,9 @@ + + @@ -416,6 +437,12 @@ + + + {02d10590-9542-3f55-aaf8-6055677e2a2a} + false + + diff --git a/libultraship/libultraship/libultraship.vcxproj.filters b/libultraship/libultraship/libultraship.vcxproj.filters index deed867c8..8ac4f0afb 100644 --- a/libultraship/libultraship/libultraship.vcxproj.filters +++ b/libultraship/libultraship/libultraship.vcxproj.filters @@ -88,6 +88,9 @@ {bd6557f1-9480-413b-b0cd-843f8efc1939} + + {3285ab8a-06d8-4dac-9af9-efb2a9723ab1} + @@ -339,6 +342,9 @@ Source Files\CustomImpl + + Source Files\CustomImpl\Overlay + @@ -626,5 +632,11 @@ Source Files\CustomImpl + + Source Files\Resources + + + Source Files\CustomImpl\Overlay + \ No newline at end of file diff --git a/libultraship/libultraship/mixer.c b/libultraship/libultraship/mixer.c index b81eb915a..302a54ef4 100644 --- a/libultraship/libultraship/mixer.c +++ b/libultraship/libultraship/mixer.c @@ -449,13 +449,16 @@ void aFilterImpl(uint8_t flags, uint16_t count_or_buf, int16_t *state_or_filter) int16_t *buf = BUF_S16(count_or_buf); if (flags == A_INIT) { +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wmemset-elt-size" memset(tmp, 0, 8 * sizeof(int16_t)); +#pragma GCC diagnostic pop memset(tmp2, 0, 8 * sizeof(int16_t)); } else { memcpy(tmp, state_or_filter, 8 * sizeof(int16_t)); memcpy(tmp2, state_or_filter + 8, 8 * sizeof(int16_t)); } - + for (int i = 0; i < 8; i++) { rspa.filter[i] = (tmp2[i] + rspa.filter[i]) / 2; } diff --git a/libultraship/libultraship/stox.cpp b/libultraship/libultraship/stox.cpp index 75fcdfbf0..fa2dff974 100644 --- a/libultraship/libultraship/stox.cpp +++ b/libultraship/libultraship/stox.cpp @@ -1,3 +1,4 @@ +#include #include "stox.h" #include "spdlog/spdlog.h" diff --git a/soh/.gitignore b/soh/.gitignore index fafae443d..5920cfba7 100644 --- a/soh/.gitignore +++ b/soh/.gitignore @@ -25,6 +25,10 @@ docs/doxygen/ *.map *.dump out.txt +shipofharkinian.ini +imgui.ini +oot.otr +oot_save.sav # Tool artifacts tools/mipspro7.2_compiler/ @@ -279,7 +283,7 @@ ClientBin/ *.publishsettings orleans.codegen.cs -# Including strong name files can present a security risk +# Including strong name files can present a security risk # (https://github.com/github/gitignore/pull/2483#issue-259490424) #*.snk @@ -375,7 +379,7 @@ __pycache__/ # OpenCover UI analysis results OpenCover/ -# Azure Stream Analytics local run output +# Azure Stream Analytics local run output ASALocalRun/ # MSBuild Binary and Structured Log @@ -384,7 +388,7 @@ ASALocalRun/ # NVidia Nsight GPU debugger configuration file *.nvuser -# MFractors (Xamarin productivity tool) working folder +# MFractors (Xamarin productivity tool) working folder .mfractor/ *.out @@ -397,6 +401,7 @@ ZAPDUtils/ZAPDUtils.a build/ ZAPDUtils/build/ ZAPD/BuildInfo.h +cvars.cfg DebugObj/* ReleaseObj/* \ No newline at end of file diff --git a/soh/Makefile b/soh/Makefile new file mode 100644 index 000000000..be46f55e7 --- /dev/null +++ b/soh/Makefile @@ -0,0 +1,158 @@ +CXX := g++ +CC := gcc +LD := lld +AR := ar +FORMAT := clang-format-11 +ZAPD := ../ZAPDTR/ZAPD.out + +LIBULTRASHIP := ../libultraship/libultraship.a +ZAPDUTILS := ../ZAPDTR/ZAPDUtils/ZAPDUtils.a + +ASAN ?= 0 +DEBUG ?= 1 +OPTFLAGS ?= -O0 +LTO ?= 0 + +WARN := \ + -Wno-return-type \ + -funsigned-char \ + -m32 -mhard-float -fno-stack-protector -fno-common -fno-zero-initialized-in-bss -fno-strict-aliasing -fno-inline-functions -fno-inline-small-functions -fno-toplevel-reorder -ffreestanding -fwrapv \ + +CXXFLAGS := $(WARN) -std=c++20 -D_GNU_SOURCE -fpermissive -no-pie -nostdlib -march=i386 +CFLAGS := $(WARN) -std=c99 -D_GNU_SOURCE -no-pie -nostdlib -march=i386 +LDFLAGS := -m32 +CPPFLAGS := -MMD + +ifneq ($(DEBUG),0) + CXXFLAGS += -g + CFLAGS += -g +endif + +ifneq ($(ASAN),0) + CXXFLAGS += -fsanitize=address + LDFLAGS += -fsanitize=address +endif + +ifneq ($(LTO),0) + CXXFLAGS += -flto + LDFLAGS += -flto +endif + +TARGET := soh.elf + +INC_DIRS := $(addprefix -I, \ + . \ + assets \ + build \ + include \ + src \ + ../ZAPDTR/ZAPDUtils \ + ../libultraship/libultraship \ + ../libultraship/libultraship/Lib/spdlog/include \ + ../libultraship/libultraship/Lib/Fast3D/U64 \ + ../libultraship/libultraship/Lib/Fast3D/U64/PR \ +) + +LDDIRS := $(addprefix -L, \ + ../external \ + ../libultraship/ \ +) + +LDLIBS := \ + $(ZAPDUTILS) \ + $(addprefix -l, \ + X11 \ + dl \ + bz2 \ + z \ + pthread \ + atomic \ + SDL2 \ + GL \ + GLEW \ + storm \ + pulse\ + ultraship \ +) \ + +ASSET_BIN_DIRS := $(shell find assets/* -type d -not -path "assets/xml*") +ASSET_FILES_XML := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.xml)) +ASSET_FILES_BIN := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.bin)) +ASSET_FILES_OUT := $(foreach f,$(ASSET_FILES_XML:.xml=.c),$f) \ + $(foreach f,$(ASSET_FILES_BIN:.bin=.bin.inc.c),build/$f) + +TEXTURE_FILES_PNG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.png)) +TEXTURE_FILES_JPG := $(foreach dir,$(ASSET_BIN_DIRS),$(wildcard $(dir)/*.jpg)) +TEXTURE_FILES_OUT := $(foreach f,$(TEXTURE_FILES_PNG:.png=.inc.c),build/$f) \ + $(foreach f,$(TEXTURE_FILES_JPG:.jpg=.jpg.inc.c),build/$f) \ + +CXX_FILES := \ + $(shell find soh -type f -name *.cpp) + +C_FILES := \ + $(shell find soh -type f -name *.c) \ + $(shell find src/boot -type f -name *.c) \ + $(shell find src/buffers -type f -name *.c) \ + $(shell find src/code -type f -name *.c) \ + $(shell find src/overlays -type f -name *.c) \ + src/libultra/gu/coss.c \ + src/libultra/gu/guLookAt.c \ + src/libultra/gu/guLookAtHilite.c \ + src/libultra/gu/guPerspectiveF.c \ + src/libultra/gu/guPosition.c \ + src/libultra/gu/guS2DInitBg.c \ + src/libultra/gu/ortho.c \ + src/libultra/gu/rotate.c \ + src/libultra/gu/sins.c \ + src/libultra/gu/sintable.c \ + src/libultra/libc/sprintf.c + +O_FILES := \ + $(C_FILES:%.c=build/%.o) \ + $(CXX_FILES:%.cpp=build/%.o) +D_FILES := $(O_FILES:%.o=%.d) + +# create build directory +SRC_DIRS := $(shell find . -type d -a -not -path "*build*") +$(shell mkdir -p $(SRC_DIRS:%=build/%)) + +all: + $(MAKE) -C ../libultraship + $(MAKE) $(TARGET) + +setup: + cd ../OTRExporter && python3 extract_baserom.py + $(MAKE) mpq + +mpq: + $(MAKE) -C ../libultraship + $(MAKE) -C ../OTRExporter/OTRExporter + $(MAKE) -C ../ZAPDTR + rm -rf ../OTRExporter/oot.otr + cd ../OTRExporter && python3 extract_assets.py + cp ../OTRExporter/oot.otr . + +distclean: clean + $(RM) -r baserom/ + $(MAKE) clean -C ../libultraship + $(MAKE) clean -C ../OTRExporter/OTRExporter + $(MAKE) clean -C ../ZAPDTR + +clean: + rm -rf build $(TARGET) + +.PHONY: all clean distclean setup mpq + +build/%.o: %.cpp + $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) $< -o $@ + +build/%.o: %.c + $(CC) -c $(CFLAGS) $(CPPFLAGS) $(OPTFLAGS) $(INC_DIRS) $< -o $@ + +# make soh depend on libultraship +$(TARGET): $(LIBULTRASHIP) + +$(TARGET): $(O_FILES) + $(CXX) $^ -o $@ $(LDFLAGS) -fuse-ld=$(LD) $(LDDIRS) $(LDLIBS) + +-include $(D_FILES) \ No newline at end of file diff --git a/soh/assets/xml/code/fbdemo_circle.xml b/soh/assets/xml/GC_NMQ_D/code/fbdemo_circle.xml similarity index 100% rename from soh/assets/xml/code/fbdemo_circle.xml rename to soh/assets/xml/GC_NMQ_D/code/fbdemo_circle.xml diff --git a/soh/assets/xml/code/fbdemo_triforce.xml b/soh/assets/xml/GC_NMQ_D/code/fbdemo_triforce.xml similarity index 100% rename from soh/assets/xml/code/fbdemo_triforce.xml rename to soh/assets/xml/GC_NMQ_D/code/fbdemo_triforce.xml diff --git a/soh/assets/xml/code/fbdemo_wipe1.xml b/soh/assets/xml/GC_NMQ_D/code/fbdemo_wipe1.xml similarity index 100% rename from soh/assets/xml/code/fbdemo_wipe1.xml rename to soh/assets/xml/GC_NMQ_D/code/fbdemo_wipe1.xml diff --git a/soh/assets/xml/misc/link_animetion.xml b/soh/assets/xml/GC_NMQ_D/misc/link_animetion.xml similarity index 100% rename from soh/assets/xml/misc/link_animetion.xml rename to soh/assets/xml/GC_NMQ_D/misc/link_animetion.xml diff --git a/soh/assets/xml/objects/gameplay_dangeon_keep.xml b/soh/assets/xml/GC_NMQ_D/objects/gameplay_dangeon_keep.xml similarity index 100% rename from soh/assets/xml/objects/gameplay_dangeon_keep.xml rename to soh/assets/xml/GC_NMQ_D/objects/gameplay_dangeon_keep.xml diff --git a/soh/assets/xml/objects/gameplay_field_keep.xml b/soh/assets/xml/GC_NMQ_D/objects/gameplay_field_keep.xml similarity index 100% rename from soh/assets/xml/objects/gameplay_field_keep.xml rename to soh/assets/xml/GC_NMQ_D/objects/gameplay_field_keep.xml diff --git a/soh/assets/xml/objects/gameplay_keep.xml b/soh/assets/xml/GC_NMQ_D/objects/gameplay_keep.xml similarity index 100% rename from soh/assets/xml/objects/gameplay_keep.xml rename to soh/assets/xml/GC_NMQ_D/objects/gameplay_keep.xml diff --git a/soh/assets/xml/objects/object_Bb.xml b/soh/assets/xml/GC_NMQ_D/objects/object_Bb.xml similarity index 100% rename from soh/assets/xml/objects/object_Bb.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_Bb.xml diff --git a/soh/assets/xml/objects/object_ahg.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ahg.xml similarity index 100% rename from soh/assets/xml/objects/object_ahg.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ahg.xml diff --git a/soh/assets/xml/objects/object_am.xml b/soh/assets/xml/GC_NMQ_D/objects/object_am.xml similarity index 100% rename from soh/assets/xml/objects/object_am.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_am.xml diff --git a/soh/assets/xml/objects/object_ane.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ane.xml similarity index 100% rename from soh/assets/xml/objects/object_ane.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ane.xml diff --git a/soh/assets/xml/objects/object_ani.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ani.xml similarity index 100% rename from soh/assets/xml/objects/object_ani.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ani.xml diff --git a/soh/assets/xml/objects/object_anubice.xml b/soh/assets/xml/GC_NMQ_D/objects/object_anubice.xml similarity index 100% rename from soh/assets/xml/objects/object_anubice.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_anubice.xml diff --git a/soh/assets/xml/objects/object_aob.xml b/soh/assets/xml/GC_NMQ_D/objects/object_aob.xml similarity index 100% rename from soh/assets/xml/objects/object_aob.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_aob.xml diff --git a/soh/assets/xml/objects/object_b_heart.xml b/soh/assets/xml/GC_NMQ_D/objects/object_b_heart.xml similarity index 100% rename from soh/assets/xml/objects/object_b_heart.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_b_heart.xml diff --git a/soh/assets/xml/objects/object_bba.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bba.xml similarity index 100% rename from soh/assets/xml/objects/object_bba.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bba.xml diff --git a/soh/assets/xml/objects/object_bdan_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bdan_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_bdan_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bdan_objects.xml diff --git a/soh/assets/xml/objects/object_bdoor.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bdoor.xml similarity index 100% rename from soh/assets/xml/objects/object_bdoor.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bdoor.xml diff --git a/soh/assets/xml/objects/object_bg.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bg.xml similarity index 100% rename from soh/assets/xml/objects/object_bg.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bg.xml diff --git a/soh/assets/xml/objects/object_bigokuta.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bigokuta.xml similarity index 100% rename from soh/assets/xml/objects/object_bigokuta.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bigokuta.xml diff --git a/soh/assets/xml/objects/object_bird.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bird.xml similarity index 100% rename from soh/assets/xml/objects/object_bird.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bird.xml diff --git a/soh/assets/xml/objects/object_bji.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bji.xml similarity index 100% rename from soh/assets/xml/objects/object_bji.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bji.xml diff --git a/soh/assets/xml/objects/object_bl.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bl.xml similarity index 100% rename from soh/assets/xml/objects/object_bl.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bl.xml diff --git a/soh/assets/xml/objects/object_blkobj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_blkobj.xml similarity index 100% rename from soh/assets/xml/objects/object_blkobj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_blkobj.xml diff --git a/soh/assets/xml/objects/object_bob.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bob.xml similarity index 100% rename from soh/assets/xml/objects/object_bob.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bob.xml diff --git a/soh/assets/xml/objects/object_boj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_boj.xml similarity index 100% rename from soh/assets/xml/objects/object_boj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_boj.xml diff --git a/soh/assets/xml/objects/object_bombf.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bombf.xml similarity index 100% rename from soh/assets/xml/objects/object_bombf.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bombf.xml diff --git a/soh/assets/xml/objects/object_bombiwa.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bombiwa.xml similarity index 100% rename from soh/assets/xml/objects/object_bombiwa.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bombiwa.xml diff --git a/soh/assets/xml/objects/object_bowl.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bowl.xml similarity index 100% rename from soh/assets/xml/objects/object_bowl.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bowl.xml diff --git a/soh/assets/xml/objects/object_box.xml b/soh/assets/xml/GC_NMQ_D/objects/object_box.xml similarity index 100% rename from soh/assets/xml/objects/object_box.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_box.xml diff --git a/soh/assets/xml/objects/object_brob.xml b/soh/assets/xml/GC_NMQ_D/objects/object_brob.xml similarity index 100% rename from soh/assets/xml/objects/object_brob.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_brob.xml diff --git a/soh/assets/xml/objects/object_bubble.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bubble.xml similarity index 100% rename from soh/assets/xml/objects/object_bubble.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bubble.xml diff --git a/soh/assets/xml/objects/object_bv.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bv.xml similarity index 100% rename from soh/assets/xml/objects/object_bv.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bv.xml diff --git a/soh/assets/xml/objects/object_bw.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bw.xml similarity index 100% rename from soh/assets/xml/objects/object_bw.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bw.xml diff --git a/soh/assets/xml/objects/object_bwall.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bwall.xml similarity index 100% rename from soh/assets/xml/objects/object_bwall.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bwall.xml diff --git a/soh/assets/xml/objects/object_bxa.xml b/soh/assets/xml/GC_NMQ_D/objects/object_bxa.xml similarity index 100% rename from soh/assets/xml/objects/object_bxa.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_bxa.xml diff --git a/soh/assets/xml/objects/object_cne.xml b/soh/assets/xml/GC_NMQ_D/objects/object_cne.xml similarity index 100% rename from soh/assets/xml/objects/object_cne.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_cne.xml diff --git a/soh/assets/xml/objects/object_cob.xml b/soh/assets/xml/GC_NMQ_D/objects/object_cob.xml similarity index 100% rename from soh/assets/xml/objects/object_cob.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_cob.xml diff --git a/soh/assets/xml/objects/object_cow.xml b/soh/assets/xml/GC_NMQ_D/objects/object_cow.xml similarity index 100% rename from soh/assets/xml/objects/object_cow.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_cow.xml diff --git a/soh/assets/xml/objects/object_crow.xml b/soh/assets/xml/GC_NMQ_D/objects/object_crow.xml similarity index 100% rename from soh/assets/xml/objects/object_crow.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_crow.xml diff --git a/soh/assets/xml/objects/object_cs.xml b/soh/assets/xml/GC_NMQ_D/objects/object_cs.xml similarity index 100% rename from soh/assets/xml/objects/object_cs.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_cs.xml diff --git a/soh/assets/xml/objects/object_d_elevator.xml b/soh/assets/xml/GC_NMQ_D/objects/object_d_elevator.xml similarity index 100% rename from soh/assets/xml/objects/object_d_elevator.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_d_elevator.xml diff --git a/soh/assets/xml/objects/object_d_hsblock.xml b/soh/assets/xml/GC_NMQ_D/objects/object_d_hsblock.xml similarity index 100% rename from soh/assets/xml/objects/object_d_hsblock.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_d_hsblock.xml diff --git a/soh/assets/xml/objects/object_d_lift.xml b/soh/assets/xml/GC_NMQ_D/objects/object_d_lift.xml similarity index 100% rename from soh/assets/xml/objects/object_d_lift.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_d_lift.xml diff --git a/soh/assets/xml/objects/object_daiku.xml b/soh/assets/xml/GC_NMQ_D/objects/object_daiku.xml similarity index 100% rename from soh/assets/xml/objects/object_daiku.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_daiku.xml diff --git a/soh/assets/xml/objects/object_ddan_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ddan_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_ddan_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ddan_objects.xml diff --git a/soh/assets/xml/objects/object_dekubaba.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dekubaba.xml similarity index 100% rename from soh/assets/xml/objects/object_dekubaba.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dekubaba.xml diff --git a/soh/assets/xml/objects/object_dekujr.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dekujr.xml similarity index 100% rename from soh/assets/xml/objects/object_dekujr.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dekujr.xml diff --git a/soh/assets/xml/objects/object_dekunuts.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dekunuts.xml similarity index 100% rename from soh/assets/xml/objects/object_dekunuts.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dekunuts.xml diff --git a/soh/assets/xml/objects/object_demo_6k.xml b/soh/assets/xml/GC_NMQ_D/objects/object_demo_6k.xml similarity index 100% rename from soh/assets/xml/objects/object_demo_6k.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_demo_6k.xml diff --git a/soh/assets/xml/objects/object_demo_kekkai.xml b/soh/assets/xml/GC_NMQ_D/objects/object_demo_kekkai.xml similarity index 100% rename from soh/assets/xml/objects/object_demo_kekkai.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_demo_kekkai.xml diff --git a/soh/assets/xml/objects/object_demo_tre_lgt.xml b/soh/assets/xml/GC_NMQ_D/objects/object_demo_tre_lgt.xml similarity index 100% rename from soh/assets/xml/objects/object_demo_tre_lgt.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_demo_tre_lgt.xml diff --git a/soh/assets/xml/objects/object_dh.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dh.xml similarity index 100% rename from soh/assets/xml/objects/object_dh.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dh.xml diff --git a/soh/assets/xml/objects/object_dnk.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dnk.xml similarity index 100% rename from soh/assets/xml/objects/object_dnk.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dnk.xml diff --git a/soh/assets/xml/objects/object_dns.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dns.xml similarity index 100% rename from soh/assets/xml/objects/object_dns.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dns.xml diff --git a/soh/assets/xml/objects/object_dodojr.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dodojr.xml similarity index 100% rename from soh/assets/xml/objects/object_dodojr.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dodojr.xml diff --git a/soh/assets/xml/objects/object_dodongo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dodongo.xml similarity index 100% rename from soh/assets/xml/objects/object_dodongo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dodongo.xml diff --git a/soh/assets/xml/objects/object_dog.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dog.xml similarity index 100% rename from soh/assets/xml/objects/object_dog.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dog.xml diff --git a/soh/assets/xml/objects/object_door_gerudo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_door_gerudo.xml similarity index 100% rename from soh/assets/xml/objects/object_door_gerudo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_door_gerudo.xml diff --git a/soh/assets/xml/objects/object_door_killer.xml b/soh/assets/xml/GC_NMQ_D/objects/object_door_killer.xml similarity index 100% rename from soh/assets/xml/objects/object_door_killer.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_door_killer.xml diff --git a/soh/assets/xml/objects/object_ds.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ds.xml similarity index 100% rename from soh/assets/xml/objects/object_ds.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ds.xml diff --git a/soh/assets/xml/objects/object_ds2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ds2.xml similarity index 100% rename from soh/assets/xml/objects/object_ds2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ds2.xml diff --git a/soh/assets/xml/objects/object_du.xml b/soh/assets/xml/GC_NMQ_D/objects/object_du.xml similarity index 100% rename from soh/assets/xml/objects/object_du.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_du.xml diff --git a/soh/assets/xml/objects/object_dy_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_dy_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_dy_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_dy_obj.xml diff --git a/soh/assets/xml/objects/object_ec.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ec.xml similarity index 100% rename from soh/assets/xml/objects/object_ec.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ec.xml diff --git a/soh/assets/xml/objects/object_efc_crystal_light.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_crystal_light.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_crystal_light.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_crystal_light.xml diff --git a/soh/assets/xml/objects/object_efc_doughnut.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_doughnut.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_doughnut.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_doughnut.xml diff --git a/soh/assets/xml/objects/object_efc_erupc.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_erupc.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_erupc.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_erupc.xml diff --git a/soh/assets/xml/objects/object_efc_fire_ball.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_fire_ball.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_fire_ball.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_fire_ball.xml diff --git a/soh/assets/xml/objects/object_efc_flash.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_flash.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_flash.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_flash.xml diff --git a/soh/assets/xml/objects/object_efc_lgt_shower.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_lgt_shower.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_lgt_shower.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_lgt_shower.xml diff --git a/soh/assets/xml/objects/object_efc_star_field.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_star_field.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_star_field.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_star_field.xml diff --git a/soh/assets/xml/objects/object_efc_tw.xml b/soh/assets/xml/GC_NMQ_D/objects/object_efc_tw.xml similarity index 100% rename from soh/assets/xml/objects/object_efc_tw.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_efc_tw.xml diff --git a/soh/assets/xml/objects/object_ei.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ei.xml similarity index 100% rename from soh/assets/xml/objects/object_ei.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ei.xml diff --git a/soh/assets/xml/objects/object_fa.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fa.xml similarity index 100% rename from soh/assets/xml/objects/object_fa.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fa.xml diff --git a/soh/assets/xml/objects/object_fd.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fd.xml similarity index 100% rename from soh/assets/xml/objects/object_fd.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fd.xml diff --git a/soh/assets/xml/objects/object_fd2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fd2.xml similarity index 100% rename from soh/assets/xml/objects/object_fd2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fd2.xml diff --git a/soh/assets/xml/objects/object_fhg.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fhg.xml similarity index 100% rename from soh/assets/xml/objects/object_fhg.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fhg.xml diff --git a/soh/assets/xml/objects/object_fire.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fire.xml similarity index 100% rename from soh/assets/xml/objects/object_fire.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fire.xml diff --git a/soh/assets/xml/objects/object_firefly.xml b/soh/assets/xml/GC_NMQ_D/objects/object_firefly.xml similarity index 100% rename from soh/assets/xml/objects/object_firefly.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_firefly.xml diff --git a/soh/assets/xml/objects/object_fish.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fish.xml similarity index 100% rename from soh/assets/xml/objects/object_fish.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fish.xml diff --git a/soh/assets/xml/objects/object_fr.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fr.xml similarity index 100% rename from soh/assets/xml/objects/object_fr.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fr.xml diff --git a/soh/assets/xml/objects/object_fu.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fu.xml similarity index 100% rename from soh/assets/xml/objects/object_fu.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fu.xml diff --git a/soh/assets/xml/objects/object_fw.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fw.xml similarity index 100% rename from soh/assets/xml/objects/object_fw.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fw.xml diff --git a/soh/assets/xml/objects/object_fz.xml b/soh/assets/xml/GC_NMQ_D/objects/object_fz.xml similarity index 100% rename from soh/assets/xml/objects/object_fz.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_fz.xml diff --git a/soh/assets/xml/objects/object_ganon.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ganon.xml similarity index 100% rename from soh/assets/xml/objects/object_ganon.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ganon.xml diff --git a/soh/assets/xml/objects/object_ganon2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ganon2.xml similarity index 100% rename from soh/assets/xml/objects/object_ganon2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ganon2.xml diff --git a/soh/assets/xml/objects/object_ganon_anime1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ganon_anime1.xml similarity index 100% rename from soh/assets/xml/objects/object_ganon_anime1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ganon_anime1.xml diff --git a/soh/assets/xml/objects/object_ganon_anime2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ganon_anime2.xml similarity index 100% rename from soh/assets/xml/objects/object_ganon_anime2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ganon_anime2.xml diff --git a/soh/assets/xml/objects/object_ganon_anime3.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ganon_anime3.xml similarity index 100% rename from soh/assets/xml/objects/object_ganon_anime3.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ganon_anime3.xml diff --git a/soh/assets/xml/objects/object_ganon_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ganon_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_ganon_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ganon_objects.xml diff --git a/soh/assets/xml/objects/object_ge1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ge1.xml similarity index 100% rename from soh/assets/xml/objects/object_ge1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ge1.xml diff --git a/soh/assets/xml/objects/object_geff.xml b/soh/assets/xml/GC_NMQ_D/objects/object_geff.xml similarity index 100% rename from soh/assets/xml/objects/object_geff.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_geff.xml diff --git a/soh/assets/xml/objects/object_geldb.xml b/soh/assets/xml/GC_NMQ_D/objects/object_geldb.xml similarity index 100% rename from soh/assets/xml/objects/object_geldb.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_geldb.xml diff --git a/soh/assets/xml/objects/object_gi_arrow.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_arrow.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_arrow.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_arrow.xml diff --git a/soh/assets/xml/objects/object_gi_arrowcase.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_arrowcase.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_arrowcase.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_arrowcase.xml diff --git a/soh/assets/xml/objects/object_gi_bean.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bean.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bean.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bean.xml diff --git a/soh/assets/xml/objects/object_gi_bomb_1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bomb_1.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bomb_1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bomb_1.xml diff --git a/soh/assets/xml/objects/object_gi_bomb_2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bomb_2.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bomb_2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bomb_2.xml diff --git a/soh/assets/xml/objects/object_gi_bombpouch.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bombpouch.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bombpouch.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bombpouch.xml diff --git a/soh/assets/xml/objects/object_gi_boomerang.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_boomerang.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_boomerang.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_boomerang.xml diff --git a/soh/assets/xml/objects/object_gi_boots_2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_boots_2.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_boots_2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_boots_2.xml diff --git a/soh/assets/xml/objects/object_gi_bosskey.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bosskey.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bosskey.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bosskey.xml diff --git a/soh/assets/xml/objects/object_gi_bottle.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bottle.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bottle.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bottle.xml diff --git a/soh/assets/xml/objects/object_gi_bottle_letter.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bottle_letter.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bottle_letter.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bottle_letter.xml diff --git a/soh/assets/xml/objects/object_gi_bow.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bow.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bow.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bow.xml diff --git a/soh/assets/xml/objects/object_gi_bracelet.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_bracelet.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_bracelet.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_bracelet.xml diff --git a/soh/assets/xml/objects/object_gi_brokensword.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_brokensword.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_brokensword.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_brokensword.xml diff --git a/soh/assets/xml/objects/object_gi_butterfly.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_butterfly.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_butterfly.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_butterfly.xml diff --git a/soh/assets/xml/objects/object_gi_clothes.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_clothes.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_clothes.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_clothes.xml diff --git a/soh/assets/xml/objects/object_gi_coin.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_coin.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_coin.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_coin.xml diff --git a/soh/assets/xml/objects/object_gi_compass.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_compass.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_compass.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_compass.xml diff --git a/soh/assets/xml/objects/object_gi_dekupouch.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_dekupouch.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_dekupouch.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_dekupouch.xml diff --git a/soh/assets/xml/objects/object_gi_egg.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_egg.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_egg.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_egg.xml diff --git a/soh/assets/xml/objects/object_gi_eye_lotion.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_eye_lotion.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_eye_lotion.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_eye_lotion.xml diff --git a/soh/assets/xml/objects/object_gi_fire.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_fire.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_fire.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_fire.xml diff --git a/soh/assets/xml/objects/object_gi_fish.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_fish.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_fish.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_fish.xml diff --git a/soh/assets/xml/objects/object_gi_frog.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_frog.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_frog.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_frog.xml diff --git a/soh/assets/xml/objects/object_gi_gerudo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_gerudo.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_gerudo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_gerudo.xml diff --git a/soh/assets/xml/objects/object_gi_gerudomask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_gerudomask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_gerudomask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_gerudomask.xml diff --git a/soh/assets/xml/objects/object_gi_ghost.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_ghost.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_ghost.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_ghost.xml diff --git a/soh/assets/xml/objects/object_gi_glasses.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_glasses.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_glasses.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_glasses.xml diff --git a/soh/assets/xml/objects/object_gi_gloves.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_gloves.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_gloves.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_gloves.xml diff --git a/soh/assets/xml/objects/object_gi_goddess.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_goddess.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_goddess.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_goddess.xml diff --git a/soh/assets/xml/objects/object_gi_golonmask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_golonmask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_golonmask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_golonmask.xml diff --git a/soh/assets/xml/objects/object_gi_grass.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_grass.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_grass.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_grass.xml diff --git a/soh/assets/xml/objects/object_gi_hammer.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_hammer.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_hammer.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_hammer.xml diff --git a/soh/assets/xml/objects/object_gi_heart.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_heart.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_heart.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_heart.xml diff --git a/soh/assets/xml/objects/object_gi_hearts.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_hearts.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_hearts.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_hearts.xml diff --git a/soh/assets/xml/objects/object_gi_hookshot.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_hookshot.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_hookshot.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_hookshot.xml diff --git a/soh/assets/xml/objects/object_gi_hoverboots.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_hoverboots.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_hoverboots.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_hoverboots.xml diff --git a/soh/assets/xml/objects/object_gi_insect.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_insect.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_insect.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_insect.xml diff --git a/soh/assets/xml/objects/object_gi_jewel.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_jewel.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_jewel.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_jewel.xml diff --git a/soh/assets/xml/objects/object_gi_key.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_key.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_key.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_key.xml diff --git a/soh/assets/xml/objects/object_gi_ki_tan_mask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_ki_tan_mask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_ki_tan_mask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_ki_tan_mask.xml diff --git a/soh/assets/xml/objects/object_gi_letter.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_letter.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_letter.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_letter.xml diff --git a/soh/assets/xml/objects/object_gi_liquid.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_liquid.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_liquid.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_liquid.xml diff --git a/soh/assets/xml/objects/object_gi_longsword.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_longsword.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_longsword.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_longsword.xml diff --git a/soh/assets/xml/objects/object_gi_m_arrow.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_m_arrow.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_m_arrow.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_m_arrow.xml diff --git a/soh/assets/xml/objects/object_gi_magicpot.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_magicpot.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_magicpot.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_magicpot.xml diff --git a/soh/assets/xml/objects/object_gi_map.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_map.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_map.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_map.xml diff --git a/soh/assets/xml/objects/object_gi_medal.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_medal.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_medal.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_medal.xml diff --git a/soh/assets/xml/objects/object_gi_melody.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_melody.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_melody.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_melody.xml diff --git a/soh/assets/xml/objects/object_gi_milk.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_milk.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_milk.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_milk.xml diff --git a/soh/assets/xml/objects/object_gi_mushroom.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_mushroom.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_mushroom.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_mushroom.xml diff --git a/soh/assets/xml/objects/object_gi_niwatori.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_niwatori.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_niwatori.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_niwatori.xml diff --git a/soh/assets/xml/objects/object_gi_nuts.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_nuts.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_nuts.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_nuts.xml diff --git a/soh/assets/xml/objects/object_gi_ocarina.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_ocarina.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_ocarina.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_ocarina.xml diff --git a/soh/assets/xml/objects/object_gi_ocarina_0.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_ocarina_0.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_ocarina_0.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_ocarina_0.xml diff --git a/soh/assets/xml/objects/object_gi_pachinko.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_pachinko.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_pachinko.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_pachinko.xml diff --git a/soh/assets/xml/objects/object_gi_powder.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_powder.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_powder.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_powder.xml diff --git a/soh/assets/xml/objects/object_gi_prescription.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_prescription.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_prescription.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_prescription.xml diff --git a/soh/assets/xml/objects/object_gi_purse.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_purse.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_purse.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_purse.xml diff --git a/soh/assets/xml/objects/object_gi_rabit_mask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_rabit_mask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_rabit_mask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_rabit_mask.xml diff --git a/soh/assets/xml/objects/object_gi_redead_mask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_redead_mask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_redead_mask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_redead_mask.xml diff --git a/soh/assets/xml/objects/object_gi_rupy.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_rupy.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_rupy.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_rupy.xml diff --git a/soh/assets/xml/objects/object_gi_saw.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_saw.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_saw.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_saw.xml diff --git a/soh/assets/xml/objects/object_gi_scale.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_scale.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_scale.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_scale.xml diff --git a/soh/assets/xml/objects/object_gi_seed.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_seed.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_seed.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_seed.xml diff --git a/soh/assets/xml/objects/object_gi_shield_1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_shield_1.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_shield_1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_shield_1.xml diff --git a/soh/assets/xml/objects/object_gi_shield_2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_shield_2.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_shield_2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_shield_2.xml diff --git a/soh/assets/xml/objects/object_gi_shield_3.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_shield_3.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_shield_3.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_shield_3.xml diff --git a/soh/assets/xml/objects/object_gi_skj_mask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_skj_mask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_skj_mask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_skj_mask.xml diff --git a/soh/assets/xml/objects/object_gi_soldout.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_soldout.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_soldout.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_soldout.xml diff --git a/soh/assets/xml/objects/object_gi_soul.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_soul.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_soul.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_soul.xml diff --git a/soh/assets/xml/objects/object_gi_stick.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_stick.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_stick.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_stick.xml diff --git a/soh/assets/xml/objects/object_gi_sutaru.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_sutaru.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_sutaru.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_sutaru.xml diff --git a/soh/assets/xml/objects/object_gi_sword_1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_sword_1.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_sword_1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_sword_1.xml diff --git a/soh/assets/xml/objects/object_gi_ticketstone.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_ticketstone.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_ticketstone.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_ticketstone.xml diff --git a/soh/assets/xml/objects/object_gi_truth_mask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_truth_mask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_truth_mask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_truth_mask.xml diff --git a/soh/assets/xml/objects/object_gi_zoramask.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gi_zoramask.xml similarity index 100% rename from soh/assets/xml/objects/object_gi_zoramask.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gi_zoramask.xml diff --git a/soh/assets/xml/objects/object_gj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gj.xml similarity index 100% rename from soh/assets/xml/objects/object_gj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gj.xml diff --git a/soh/assets/xml/objects/object_gjyo_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gjyo_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_gjyo_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gjyo_objects.xml diff --git a/soh/assets/xml/objects/object_gla.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gla.xml similarity index 100% rename from soh/assets/xml/objects/object_gla.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gla.xml diff --git a/soh/assets/xml/objects/object_gm.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gm.xml similarity index 100% rename from soh/assets/xml/objects/object_gm.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gm.xml diff --git a/soh/assets/xml/objects/object_gnd.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gnd.xml similarity index 100% rename from soh/assets/xml/objects/object_gnd.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gnd.xml diff --git a/soh/assets/xml/objects/object_gnd_magic.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gnd_magic.xml similarity index 100% rename from soh/assets/xml/objects/object_gnd_magic.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gnd_magic.xml diff --git a/soh/assets/xml/objects/object_gndd.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gndd.xml similarity index 100% rename from soh/assets/xml/objects/object_gndd.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gndd.xml diff --git a/soh/assets/xml/objects/object_god_lgt.xml b/soh/assets/xml/GC_NMQ_D/objects/object_god_lgt.xml similarity index 100% rename from soh/assets/xml/objects/object_god_lgt.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_god_lgt.xml diff --git a/soh/assets/xml/objects/object_gol.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gol.xml similarity index 100% rename from soh/assets/xml/objects/object_gol.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gol.xml diff --git a/soh/assets/xml/objects/object_goma.xml b/soh/assets/xml/GC_NMQ_D/objects/object_goma.xml similarity index 100% rename from soh/assets/xml/objects/object_goma.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_goma.xml diff --git a/soh/assets/xml/objects/object_goroiwa.xml b/soh/assets/xml/GC_NMQ_D/objects/object_goroiwa.xml similarity index 100% rename from soh/assets/xml/objects/object_goroiwa.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_goroiwa.xml diff --git a/soh/assets/xml/objects/object_gr.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gr.xml similarity index 100% rename from soh/assets/xml/objects/object_gr.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gr.xml diff --git a/soh/assets/xml/objects/object_gs.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gs.xml similarity index 100% rename from soh/assets/xml/objects/object_gs.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gs.xml diff --git a/soh/assets/xml/objects/object_gt.xml b/soh/assets/xml/GC_NMQ_D/objects/object_gt.xml similarity index 100% rename from soh/assets/xml/objects/object_gt.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_gt.xml diff --git a/soh/assets/xml/objects/object_haka.xml b/soh/assets/xml/GC_NMQ_D/objects/object_haka.xml similarity index 100% rename from soh/assets/xml/objects/object_haka.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_haka.xml diff --git a/soh/assets/xml/objects/object_haka_door.xml b/soh/assets/xml/GC_NMQ_D/objects/object_haka_door.xml similarity index 100% rename from soh/assets/xml/objects/object_haka_door.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_haka_door.xml diff --git a/soh/assets/xml/objects/object_haka_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_haka_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_haka_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_haka_objects.xml diff --git a/soh/assets/xml/objects/object_hakach_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_hakach_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_hakach_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_hakach_objects.xml diff --git a/soh/assets/xml/objects/object_hata.xml b/soh/assets/xml/GC_NMQ_D/objects/object_hata.xml similarity index 100% rename from soh/assets/xml/objects/object_hata.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_hata.xml diff --git a/soh/assets/xml/objects/object_heavy_object.xml b/soh/assets/xml/GC_NMQ_D/objects/object_heavy_object.xml similarity index 100% rename from soh/assets/xml/objects/object_heavy_object.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_heavy_object.xml diff --git a/soh/assets/xml/objects/object_hidan_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_hidan_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_hidan_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_hidan_objects.xml diff --git a/soh/assets/xml/objects/object_hintnuts.xml b/soh/assets/xml/GC_NMQ_D/objects/object_hintnuts.xml similarity index 100% rename from soh/assets/xml/objects/object_hintnuts.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_hintnuts.xml diff --git a/soh/assets/xml/objects/object_hni.xml b/soh/assets/xml/GC_NMQ_D/objects/object_hni.xml similarity index 100% rename from soh/assets/xml/objects/object_hni.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_hni.xml diff --git a/soh/assets/xml/objects/object_horse.xml b/soh/assets/xml/GC_NMQ_D/objects/object_horse.xml similarity index 100% rename from soh/assets/xml/objects/object_horse.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_horse.xml diff --git a/soh/assets/xml/objects/object_horse_ganon.xml b/soh/assets/xml/GC_NMQ_D/objects/object_horse_ganon.xml similarity index 100% rename from soh/assets/xml/objects/object_horse_ganon.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_horse_ganon.xml diff --git a/soh/assets/xml/objects/object_horse_link_child.xml b/soh/assets/xml/GC_NMQ_D/objects/object_horse_link_child.xml similarity index 100% rename from soh/assets/xml/objects/object_horse_link_child.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_horse_link_child.xml diff --git a/soh/assets/xml/objects/object_horse_normal.xml b/soh/assets/xml/GC_NMQ_D/objects/object_horse_normal.xml similarity index 100% rename from soh/assets/xml/objects/object_horse_normal.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_horse_normal.xml diff --git a/soh/assets/xml/objects/object_horse_zelda.xml b/soh/assets/xml/GC_NMQ_D/objects/object_horse_zelda.xml similarity index 100% rename from soh/assets/xml/objects/object_horse_zelda.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_horse_zelda.xml diff --git a/soh/assets/xml/objects/object_hs.xml b/soh/assets/xml/GC_NMQ_D/objects/object_hs.xml similarity index 100% rename from soh/assets/xml/objects/object_hs.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_hs.xml diff --git a/soh/assets/xml/objects/object_human.xml b/soh/assets/xml/GC_NMQ_D/objects/object_human.xml similarity index 100% rename from soh/assets/xml/objects/object_human.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_human.xml diff --git a/soh/assets/xml/objects/object_ice_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ice_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_ice_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ice_objects.xml diff --git a/soh/assets/xml/objects/object_ik.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ik.xml similarity index 100% rename from soh/assets/xml/objects/object_ik.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ik.xml diff --git a/soh/assets/xml/objects/object_im.xml b/soh/assets/xml/GC_NMQ_D/objects/object_im.xml similarity index 100% rename from soh/assets/xml/objects/object_im.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_im.xml diff --git a/soh/assets/xml/objects/object_in.xml b/soh/assets/xml/GC_NMQ_D/objects/object_in.xml similarity index 100% rename from soh/assets/xml/objects/object_in.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_in.xml diff --git a/soh/assets/xml/objects/object_ingate.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ingate.xml similarity index 100% rename from soh/assets/xml/objects/object_ingate.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ingate.xml diff --git a/soh/assets/xml/objects/object_jj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_jj.xml similarity index 100% rename from soh/assets/xml/objects/object_jj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_jj.xml diff --git a/soh/assets/xml/objects/object_js.xml b/soh/assets/xml/GC_NMQ_D/objects/object_js.xml similarity index 100% rename from soh/assets/xml/objects/object_js.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_js.xml diff --git a/soh/assets/xml/objects/object_jya_door.xml b/soh/assets/xml/GC_NMQ_D/objects/object_jya_door.xml similarity index 100% rename from soh/assets/xml/objects/object_jya_door.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_jya_door.xml diff --git a/soh/assets/xml/objects/object_jya_iron.xml b/soh/assets/xml/GC_NMQ_D/objects/object_jya_iron.xml similarity index 100% rename from soh/assets/xml/objects/object_jya_iron.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_jya_iron.xml diff --git a/soh/assets/xml/objects/object_jya_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_jya_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_jya_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_jya_obj.xml diff --git a/soh/assets/xml/objects/object_ka.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ka.xml similarity index 100% rename from soh/assets/xml/objects/object_ka.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ka.xml diff --git a/soh/assets/xml/objects/object_kanban.xml b/soh/assets/xml/GC_NMQ_D/objects/object_kanban.xml similarity index 100% rename from soh/assets/xml/objects/object_kanban.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_kanban.xml diff --git a/soh/assets/xml/objects/object_kibako2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_kibako2.xml similarity index 100% rename from soh/assets/xml/objects/object_kibako2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_kibako2.xml diff --git a/soh/assets/xml/objects/object_kingdodongo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_kingdodongo.xml similarity index 100% rename from soh/assets/xml/objects/object_kingdodongo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_kingdodongo.xml diff --git a/soh/assets/xml/objects/object_km1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_km1.xml similarity index 100% rename from soh/assets/xml/objects/object_km1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_km1.xml diff --git a/soh/assets/xml/objects/object_kusa.xml b/soh/assets/xml/GC_NMQ_D/objects/object_kusa.xml similarity index 100% rename from soh/assets/xml/objects/object_kusa.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_kusa.xml diff --git a/soh/assets/xml/objects/object_kw1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_kw1.xml similarity index 100% rename from soh/assets/xml/objects/object_kw1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_kw1.xml diff --git a/soh/assets/xml/objects/object_kz.xml b/soh/assets/xml/GC_NMQ_D/objects/object_kz.xml similarity index 100% rename from soh/assets/xml/objects/object_kz.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_kz.xml diff --git a/soh/assets/xml/objects/object_light_ring.xml b/soh/assets/xml/GC_NMQ_D/objects/object_light_ring.xml similarity index 100% rename from soh/assets/xml/objects/object_light_ring.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_light_ring.xml diff --git a/soh/assets/xml/objects/object_lightbox.xml b/soh/assets/xml/GC_NMQ_D/objects/object_lightbox.xml similarity index 100% rename from soh/assets/xml/objects/object_lightbox.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_lightbox.xml diff --git a/soh/assets/xml/objects/object_lightswitch.xml b/soh/assets/xml/GC_NMQ_D/objects/object_lightswitch.xml similarity index 100% rename from soh/assets/xml/objects/object_lightswitch.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_lightswitch.xml diff --git a/soh/assets/xml/objects/object_link_boy.xml b/soh/assets/xml/GC_NMQ_D/objects/object_link_boy.xml similarity index 100% rename from soh/assets/xml/objects/object_link_boy.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_link_boy.xml diff --git a/soh/assets/xml/objects/object_link_child.xml b/soh/assets/xml/GC_NMQ_D/objects/object_link_child.xml similarity index 100% rename from soh/assets/xml/objects/object_link_child.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_link_child.xml diff --git a/soh/assets/xml/objects/object_ma1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ma1.xml similarity index 100% rename from soh/assets/xml/objects/object_ma1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ma1.xml diff --git a/soh/assets/xml/objects/object_ma2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ma2.xml similarity index 100% rename from soh/assets/xml/objects/object_ma2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ma2.xml diff --git a/soh/assets/xml/objects/object_mag.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mag.xml similarity index 100% rename from soh/assets/xml/objects/object_mag.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mag.xml diff --git a/soh/assets/xml/objects/object_mamenoki.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mamenoki.xml similarity index 100% rename from soh/assets/xml/objects/object_mamenoki.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mamenoki.xml diff --git a/soh/assets/xml/objects/object_mastergolon.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mastergolon.xml similarity index 100% rename from soh/assets/xml/objects/object_mastergolon.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mastergolon.xml diff --git a/soh/assets/xml/objects/object_masterkokiri.xml b/soh/assets/xml/GC_NMQ_D/objects/object_masterkokiri.xml similarity index 100% rename from soh/assets/xml/objects/object_masterkokiri.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_masterkokiri.xml diff --git a/soh/assets/xml/objects/object_masterkokirihead.xml b/soh/assets/xml/GC_NMQ_D/objects/object_masterkokirihead.xml similarity index 100% rename from soh/assets/xml/objects/object_masterkokirihead.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_masterkokirihead.xml diff --git a/soh/assets/xml/objects/object_masterzoora.xml b/soh/assets/xml/GC_NMQ_D/objects/object_masterzoora.xml similarity index 100% rename from soh/assets/xml/objects/object_masterzoora.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_masterzoora.xml diff --git a/soh/assets/xml/objects/object_mb.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mb.xml similarity index 100% rename from soh/assets/xml/objects/object_mb.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mb.xml diff --git a/soh/assets/xml/objects/object_md.xml b/soh/assets/xml/GC_NMQ_D/objects/object_md.xml similarity index 100% rename from soh/assets/xml/objects/object_md.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_md.xml diff --git a/soh/assets/xml/objects/object_medal.xml b/soh/assets/xml/GC_NMQ_D/objects/object_medal.xml similarity index 100% rename from soh/assets/xml/objects/object_medal.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_medal.xml diff --git a/soh/assets/xml/objects/object_menkuri_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_menkuri_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_menkuri_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_menkuri_objects.xml diff --git a/soh/assets/xml/objects/object_mir_ray.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mir_ray.xml similarity index 100% rename from soh/assets/xml/objects/object_mir_ray.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mir_ray.xml diff --git a/soh/assets/xml/objects/object_mizu_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mizu_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_mizu_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mizu_objects.xml diff --git a/soh/assets/xml/objects/object_mjin.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin.xml diff --git a/soh/assets/xml/objects/object_mjin_dark.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_dark.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_dark.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_dark.xml diff --git a/soh/assets/xml/objects/object_mjin_flame.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_flame.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_flame.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_flame.xml diff --git a/soh/assets/xml/objects/object_mjin_flash.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_flash.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_flash.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_flash.xml diff --git a/soh/assets/xml/objects/object_mjin_ice.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_ice.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_ice.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_ice.xml diff --git a/soh/assets/xml/objects/object_mjin_oka.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_oka.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_oka.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_oka.xml diff --git a/soh/assets/xml/objects/object_mjin_soul.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_soul.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_soul.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_soul.xml diff --git a/soh/assets/xml/objects/object_mjin_wind.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mjin_wind.xml similarity index 100% rename from soh/assets/xml/objects/object_mjin_wind.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mjin_wind.xml diff --git a/soh/assets/xml/objects/object_mk.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mk.xml similarity index 100% rename from soh/assets/xml/objects/object_mk.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mk.xml diff --git a/soh/assets/xml/objects/object_mm.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mm.xml similarity index 100% rename from soh/assets/xml/objects/object_mm.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mm.xml diff --git a/soh/assets/xml/objects/object_mo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mo.xml similarity index 100% rename from soh/assets/xml/objects/object_mo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mo.xml diff --git a/soh/assets/xml/objects/object_mori_hineri1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri1.xml similarity index 100% rename from soh/assets/xml/objects/object_mori_hineri1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri1.xml diff --git a/soh/assets/xml/objects/object_mori_hineri1a.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri1a.xml similarity index 100% rename from soh/assets/xml/objects/object_mori_hineri1a.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri1a.xml diff --git a/soh/assets/xml/objects/object_mori_hineri2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri2.xml similarity index 100% rename from soh/assets/xml/objects/object_mori_hineri2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri2.xml diff --git a/soh/assets/xml/objects/object_mori_hineri2a.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri2a.xml similarity index 100% rename from soh/assets/xml/objects/object_mori_hineri2a.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mori_hineri2a.xml diff --git a/soh/assets/xml/objects/object_mori_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mori_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_mori_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mori_objects.xml diff --git a/soh/assets/xml/objects/object_mori_tex.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mori_tex.xml similarity index 100% rename from soh/assets/xml/objects/object_mori_tex.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mori_tex.xml diff --git a/soh/assets/xml/objects/object_ms.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ms.xml similarity index 100% rename from soh/assets/xml/objects/object_ms.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ms.xml diff --git a/soh/assets/xml/objects/object_mu.xml b/soh/assets/xml/GC_NMQ_D/objects/object_mu.xml similarity index 100% rename from soh/assets/xml/objects/object_mu.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_mu.xml diff --git a/soh/assets/xml/objects/object_nb.xml b/soh/assets/xml/GC_NMQ_D/objects/object_nb.xml similarity index 100% rename from soh/assets/xml/objects/object_nb.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_nb.xml diff --git a/soh/assets/xml/objects/object_niw.xml b/soh/assets/xml/GC_NMQ_D/objects/object_niw.xml similarity index 100% rename from soh/assets/xml/objects/object_niw.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_niw.xml diff --git a/soh/assets/xml/objects/object_nwc.xml b/soh/assets/xml/GC_NMQ_D/objects/object_nwc.xml similarity index 100% rename from soh/assets/xml/objects/object_nwc.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_nwc.xml diff --git a/soh/assets/xml/objects/object_ny.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ny.xml similarity index 100% rename from soh/assets/xml/objects/object_ny.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ny.xml diff --git a/soh/assets/xml/objects/object_oA1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA1.xml similarity index 100% rename from soh/assets/xml/objects/object_oA1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA1.xml diff --git a/soh/assets/xml/objects/object_oA10.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA10.xml similarity index 100% rename from soh/assets/xml/objects/object_oA10.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA10.xml diff --git a/soh/assets/xml/objects/object_oA11.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA11.xml similarity index 100% rename from soh/assets/xml/objects/object_oA11.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA11.xml diff --git a/soh/assets/xml/objects/object_oA2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA2.xml similarity index 100% rename from soh/assets/xml/objects/object_oA2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA2.xml diff --git a/soh/assets/xml/objects/object_oA3.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA3.xml similarity index 100% rename from soh/assets/xml/objects/object_oA3.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA3.xml diff --git a/soh/assets/xml/objects/object_oA4.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA4.xml similarity index 100% rename from soh/assets/xml/objects/object_oA4.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA4.xml diff --git a/soh/assets/xml/objects/object_oA5.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA5.xml similarity index 100% rename from soh/assets/xml/objects/object_oA5.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA5.xml diff --git a/soh/assets/xml/objects/object_oA6.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA6.xml similarity index 100% rename from soh/assets/xml/objects/object_oA6.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA6.xml diff --git a/soh/assets/xml/objects/object_oA7.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA7.xml similarity index 100% rename from soh/assets/xml/objects/object_oA7.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA7.xml diff --git a/soh/assets/xml/objects/object_oA8.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA8.xml similarity index 100% rename from soh/assets/xml/objects/object_oA8.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA8.xml diff --git a/soh/assets/xml/objects/object_oA9.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oA9.xml similarity index 100% rename from soh/assets/xml/objects/object_oA9.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oA9.xml diff --git a/soh/assets/xml/objects/object_oB1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oB1.xml similarity index 100% rename from soh/assets/xml/objects/object_oB1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oB1.xml diff --git a/soh/assets/xml/objects/object_oB2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oB2.xml similarity index 100% rename from soh/assets/xml/objects/object_oB2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oB2.xml diff --git a/soh/assets/xml/objects/object_oB3.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oB3.xml similarity index 100% rename from soh/assets/xml/objects/object_oB3.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oB3.xml diff --git a/soh/assets/xml/objects/object_oB4.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oB4.xml similarity index 100% rename from soh/assets/xml/objects/object_oB4.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oB4.xml diff --git a/soh/assets/xml/objects/object_oE1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE1.xml similarity index 100% rename from soh/assets/xml/objects/object_oE1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE1.xml diff --git a/soh/assets/xml/objects/object_oE10.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE10.xml similarity index 100% rename from soh/assets/xml/objects/object_oE10.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE10.xml diff --git a/soh/assets/xml/objects/object_oE11.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE11.xml similarity index 100% rename from soh/assets/xml/objects/object_oE11.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE11.xml diff --git a/soh/assets/xml/objects/object_oE12.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE12.xml similarity index 100% rename from soh/assets/xml/objects/object_oE12.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE12.xml diff --git a/soh/assets/xml/objects/object_oE1s.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE1s.xml similarity index 100% rename from soh/assets/xml/objects/object_oE1s.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE1s.xml diff --git a/soh/assets/xml/objects/object_oE2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE2.xml similarity index 100% rename from soh/assets/xml/objects/object_oE2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE2.xml diff --git a/soh/assets/xml/objects/object_oE3.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE3.xml similarity index 100% rename from soh/assets/xml/objects/object_oE3.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE3.xml diff --git a/soh/assets/xml/objects/object_oE4.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE4.xml similarity index 100% rename from soh/assets/xml/objects/object_oE4.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE4.xml diff --git a/soh/assets/xml/objects/object_oE4s.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE4s.xml similarity index 100% rename from soh/assets/xml/objects/object_oE4s.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE4s.xml diff --git a/soh/assets/xml/objects/object_oE5.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE5.xml similarity index 100% rename from soh/assets/xml/objects/object_oE5.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE5.xml diff --git a/soh/assets/xml/objects/object_oE6.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE6.xml similarity index 100% rename from soh/assets/xml/objects/object_oE6.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE6.xml diff --git a/soh/assets/xml/objects/object_oE7.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE7.xml similarity index 100% rename from soh/assets/xml/objects/object_oE7.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE7.xml diff --git a/soh/assets/xml/objects/object_oE8.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE8.xml similarity index 100% rename from soh/assets/xml/objects/object_oE8.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE8.xml diff --git a/soh/assets/xml/objects/object_oE9.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE9.xml similarity index 100% rename from soh/assets/xml/objects/object_oE9.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE9.xml diff --git a/soh/assets/xml/objects/object_oE_anime.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oE_anime.xml similarity index 100% rename from soh/assets/xml/objects/object_oE_anime.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oE_anime.xml diff --git a/soh/assets/xml/objects/object_oF1d_map.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oF1d_map.xml similarity index 100% rename from soh/assets/xml/objects/object_oF1d_map.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oF1d_map.xml diff --git a/soh/assets/xml/objects/object_oF1s.xml b/soh/assets/xml/GC_NMQ_D/objects/object_oF1s.xml similarity index 100% rename from soh/assets/xml/objects/object_oF1s.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_oF1s.xml diff --git a/soh/assets/xml/objects/object_o_anime.xml b/soh/assets/xml/GC_NMQ_D/objects/object_o_anime.xml similarity index 100% rename from soh/assets/xml/objects/object_o_anime.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_o_anime.xml diff --git a/soh/assets/xml/objects/object_okuta.xml b/soh/assets/xml/GC_NMQ_D/objects/object_okuta.xml similarity index 100% rename from soh/assets/xml/objects/object_okuta.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_okuta.xml diff --git a/soh/assets/xml/objects/object_opening_demo1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_opening_demo1.xml similarity index 100% rename from soh/assets/xml/objects/object_opening_demo1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_opening_demo1.xml diff --git a/soh/assets/xml/objects/object_os.xml b/soh/assets/xml/GC_NMQ_D/objects/object_os.xml similarity index 100% rename from soh/assets/xml/objects/object_os.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_os.xml diff --git a/soh/assets/xml/objects/object_os_anime.xml b/soh/assets/xml/GC_NMQ_D/objects/object_os_anime.xml similarity index 100% rename from soh/assets/xml/objects/object_os_anime.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_os_anime.xml diff --git a/soh/assets/xml/objects/object_ossan.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ossan.xml similarity index 100% rename from soh/assets/xml/objects/object_ossan.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ossan.xml diff --git a/soh/assets/xml/objects/object_ouke_haka.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ouke_haka.xml similarity index 100% rename from soh/assets/xml/objects/object_ouke_haka.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ouke_haka.xml diff --git a/soh/assets/xml/objects/object_owl.xml b/soh/assets/xml/GC_NMQ_D/objects/object_owl.xml similarity index 100% rename from soh/assets/xml/objects/object_owl.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_owl.xml diff --git a/soh/assets/xml/objects/object_peehat.xml b/soh/assets/xml/GC_NMQ_D/objects/object_peehat.xml similarity index 100% rename from soh/assets/xml/objects/object_peehat.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_peehat.xml diff --git a/soh/assets/xml/objects/object_po_composer.xml b/soh/assets/xml/GC_NMQ_D/objects/object_po_composer.xml similarity index 100% rename from soh/assets/xml/objects/object_po_composer.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_po_composer.xml diff --git a/soh/assets/xml/objects/object_po_field.xml b/soh/assets/xml/GC_NMQ_D/objects/object_po_field.xml similarity index 100% rename from soh/assets/xml/objects/object_po_field.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_po_field.xml diff --git a/soh/assets/xml/objects/object_po_sisters.xml b/soh/assets/xml/GC_NMQ_D/objects/object_po_sisters.xml similarity index 100% rename from soh/assets/xml/objects/object_po_sisters.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_po_sisters.xml diff --git a/soh/assets/xml/objects/object_poh.xml b/soh/assets/xml/GC_NMQ_D/objects/object_poh.xml similarity index 100% rename from soh/assets/xml/objects/object_poh.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_poh.xml diff --git a/soh/assets/xml/objects/object_ps.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ps.xml similarity index 100% rename from soh/assets/xml/objects/object_ps.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ps.xml diff --git a/soh/assets/xml/objects/object_pu_box.xml b/soh/assets/xml/GC_NMQ_D/objects/object_pu_box.xml similarity index 100% rename from soh/assets/xml/objects/object_pu_box.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_pu_box.xml diff --git a/soh/assets/xml/objects/object_rd.xml b/soh/assets/xml/GC_NMQ_D/objects/object_rd.xml similarity index 100% rename from soh/assets/xml/objects/object_rd.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_rd.xml diff --git a/soh/assets/xml/objects/object_reeba.xml b/soh/assets/xml/GC_NMQ_D/objects/object_reeba.xml similarity index 100% rename from soh/assets/xml/objects/object_reeba.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_reeba.xml diff --git a/soh/assets/xml/objects/object_relay_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_relay_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_relay_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_relay_objects.xml diff --git a/soh/assets/xml/objects/object_rl.xml b/soh/assets/xml/GC_NMQ_D/objects/object_rl.xml similarity index 100% rename from soh/assets/xml/objects/object_rl.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_rl.xml diff --git a/soh/assets/xml/objects/object_rr.xml b/soh/assets/xml/GC_NMQ_D/objects/object_rr.xml similarity index 100% rename from soh/assets/xml/objects/object_rr.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_rr.xml diff --git a/soh/assets/xml/objects/object_rs.xml b/soh/assets/xml/GC_NMQ_D/objects/object_rs.xml similarity index 100% rename from soh/assets/xml/objects/object_rs.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_rs.xml diff --git a/soh/assets/xml/objects/object_ru1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ru1.xml similarity index 100% rename from soh/assets/xml/objects/object_ru1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ru1.xml diff --git a/soh/assets/xml/objects/object_ru2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ru2.xml similarity index 100% rename from soh/assets/xml/objects/object_ru2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ru2.xml diff --git a/soh/assets/xml/objects/object_sa.xml b/soh/assets/xml/GC_NMQ_D/objects/object_sa.xml similarity index 100% rename from soh/assets/xml/objects/object_sa.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_sa.xml diff --git a/soh/assets/xml/objects/object_sb.xml b/soh/assets/xml/GC_NMQ_D/objects/object_sb.xml similarity index 100% rename from soh/assets/xml/objects/object_sb.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_sb.xml diff --git a/soh/assets/xml/objects/object_sd.xml b/soh/assets/xml/GC_NMQ_D/objects/object_sd.xml similarity index 100% rename from soh/assets/xml/objects/object_sd.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_sd.xml diff --git a/soh/assets/xml/objects/object_shop_dungen.xml b/soh/assets/xml/GC_NMQ_D/objects/object_shop_dungen.xml similarity index 100% rename from soh/assets/xml/objects/object_shop_dungen.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_shop_dungen.xml diff --git a/soh/assets/xml/objects/object_shopnuts.xml b/soh/assets/xml/GC_NMQ_D/objects/object_shopnuts.xml similarity index 100% rename from soh/assets/xml/objects/object_shopnuts.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_shopnuts.xml diff --git a/soh/assets/xml/objects/object_siofuki.xml b/soh/assets/xml/GC_NMQ_D/objects/object_siofuki.xml similarity index 100% rename from soh/assets/xml/objects/object_siofuki.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_siofuki.xml diff --git a/soh/assets/xml/objects/object_sk2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_sk2.xml similarity index 100% rename from soh/assets/xml/objects/object_sk2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_sk2.xml diff --git a/soh/assets/xml/objects/object_skb.xml b/soh/assets/xml/GC_NMQ_D/objects/object_skb.xml similarity index 100% rename from soh/assets/xml/objects/object_skb.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_skb.xml diff --git a/soh/assets/xml/objects/object_skj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_skj.xml similarity index 100% rename from soh/assets/xml/objects/object_skj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_skj.xml diff --git a/soh/assets/xml/objects/object_spot00_break.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot00_break.xml similarity index 100% rename from soh/assets/xml/objects/object_spot00_break.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot00_break.xml diff --git a/soh/assets/xml/objects/object_spot00_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot00_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_spot00_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot00_objects.xml diff --git a/soh/assets/xml/objects/object_spot01_matoya.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot01_matoya.xml similarity index 100% rename from soh/assets/xml/objects/object_spot01_matoya.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot01_matoya.xml diff --git a/soh/assets/xml/objects/object_spot01_matoyab.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot01_matoyab.xml similarity index 100% rename from soh/assets/xml/objects/object_spot01_matoyab.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot01_matoyab.xml diff --git a/soh/assets/xml/objects/object_spot01_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot01_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_spot01_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot01_objects.xml diff --git a/soh/assets/xml/objects/object_spot01_objects2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot01_objects2.xml similarity index 100% rename from soh/assets/xml/objects/object_spot01_objects2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot01_objects2.xml diff --git a/soh/assets/xml/objects/object_spot02_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot02_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_spot02_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot02_objects.xml diff --git a/soh/assets/xml/objects/object_spot03_object.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot03_object.xml similarity index 100% rename from soh/assets/xml/objects/object_spot03_object.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot03_object.xml diff --git a/soh/assets/xml/objects/object_spot04_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot04_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_spot04_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot04_objects.xml diff --git a/soh/assets/xml/objects/object_spot05_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot05_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_spot05_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot05_objects.xml diff --git a/soh/assets/xml/objects/object_spot06_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot06_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_spot06_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot06_objects.xml diff --git a/soh/assets/xml/objects/object_spot07_object.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot07_object.xml similarity index 100% rename from soh/assets/xml/objects/object_spot07_object.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot07_object.xml diff --git a/soh/assets/xml/objects/object_spot08_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot08_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot08_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot08_obj.xml diff --git a/soh/assets/xml/objects/object_spot09_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot09_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot09_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot09_obj.xml diff --git a/soh/assets/xml/objects/object_spot11_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot11_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot11_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot11_obj.xml diff --git a/soh/assets/xml/objects/object_spot12_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot12_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot12_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot12_obj.xml diff --git a/soh/assets/xml/objects/object_spot15_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot15_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot15_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot15_obj.xml diff --git a/soh/assets/xml/objects/object_spot16_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot16_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot16_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot16_obj.xml diff --git a/soh/assets/xml/objects/object_spot17_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot17_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot17_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot17_obj.xml diff --git a/soh/assets/xml/objects/object_spot18_obj.xml b/soh/assets/xml/GC_NMQ_D/objects/object_spot18_obj.xml similarity index 100% rename from soh/assets/xml/objects/object_spot18_obj.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_spot18_obj.xml diff --git a/soh/assets/xml/objects/object_ssh.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ssh.xml similarity index 100% rename from soh/assets/xml/objects/object_ssh.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ssh.xml diff --git a/soh/assets/xml/objects/object_sst.xml b/soh/assets/xml/GC_NMQ_D/objects/object_sst.xml similarity index 100% rename from soh/assets/xml/objects/object_sst.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_sst.xml diff --git a/soh/assets/xml/objects/object_st.xml b/soh/assets/xml/GC_NMQ_D/objects/object_st.xml similarity index 100% rename from soh/assets/xml/objects/object_st.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_st.xml diff --git a/soh/assets/xml/objects/object_stream.xml b/soh/assets/xml/GC_NMQ_D/objects/object_stream.xml similarity index 100% rename from soh/assets/xml/objects/object_stream.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_stream.xml diff --git a/soh/assets/xml/objects/object_syokudai.xml b/soh/assets/xml/GC_NMQ_D/objects/object_syokudai.xml similarity index 100% rename from soh/assets/xml/objects/object_syokudai.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_syokudai.xml diff --git a/soh/assets/xml/objects/object_ta.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ta.xml similarity index 100% rename from soh/assets/xml/objects/object_ta.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ta.xml diff --git a/soh/assets/xml/objects/object_timeblock.xml b/soh/assets/xml/GC_NMQ_D/objects/object_timeblock.xml similarity index 100% rename from soh/assets/xml/objects/object_timeblock.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_timeblock.xml diff --git a/soh/assets/xml/objects/object_tite.xml b/soh/assets/xml/GC_NMQ_D/objects/object_tite.xml similarity index 100% rename from soh/assets/xml/objects/object_tite.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_tite.xml diff --git a/soh/assets/xml/objects/object_tk.xml b/soh/assets/xml/GC_NMQ_D/objects/object_tk.xml similarity index 100% rename from soh/assets/xml/objects/object_tk.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_tk.xml diff --git a/soh/assets/xml/objects/object_toki_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_toki_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_toki_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_toki_objects.xml diff --git a/soh/assets/xml/objects/object_torch2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_torch2.xml similarity index 100% rename from soh/assets/xml/objects/object_torch2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_torch2.xml diff --git a/soh/assets/xml/objects/object_toryo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_toryo.xml similarity index 100% rename from soh/assets/xml/objects/object_toryo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_toryo.xml diff --git a/soh/assets/xml/objects/object_tp.xml b/soh/assets/xml/GC_NMQ_D/objects/object_tp.xml similarity index 100% rename from soh/assets/xml/objects/object_tp.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_tp.xml diff --git a/soh/assets/xml/objects/object_tr.xml b/soh/assets/xml/GC_NMQ_D/objects/object_tr.xml similarity index 100% rename from soh/assets/xml/objects/object_tr.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_tr.xml diff --git a/soh/assets/xml/objects/object_trap.xml b/soh/assets/xml/GC_NMQ_D/objects/object_trap.xml similarity index 100% rename from soh/assets/xml/objects/object_trap.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_trap.xml diff --git a/soh/assets/xml/GC_NMQ_D/objects/object_triforce_spot.xml b/soh/assets/xml/GC_NMQ_D/objects/object_triforce_spot.xml new file mode 100644 index 000000000..87d449458 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_D/objects/object_triforce_spot.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/objects/object_ts.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ts.xml similarity index 100% rename from soh/assets/xml/objects/object_ts.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ts.xml diff --git a/soh/assets/xml/objects/object_tsubo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_tsubo.xml similarity index 100% rename from soh/assets/xml/objects/object_tsubo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_tsubo.xml diff --git a/soh/assets/xml/objects/object_tw.xml b/soh/assets/xml/GC_NMQ_D/objects/object_tw.xml similarity index 100% rename from soh/assets/xml/objects/object_tw.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_tw.xml diff --git a/soh/assets/xml/objects/object_umajump.xml b/soh/assets/xml/GC_NMQ_D/objects/object_umajump.xml similarity index 100% rename from soh/assets/xml/objects/object_umajump.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_umajump.xml diff --git a/soh/assets/xml/objects/object_vali.xml b/soh/assets/xml/GC_NMQ_D/objects/object_vali.xml similarity index 100% rename from soh/assets/xml/objects/object_vali.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_vali.xml diff --git a/soh/assets/xml/objects/object_vase.xml b/soh/assets/xml/GC_NMQ_D/objects/object_vase.xml similarity index 100% rename from soh/assets/xml/objects/object_vase.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_vase.xml diff --git a/soh/assets/xml/objects/object_vm.xml b/soh/assets/xml/GC_NMQ_D/objects/object_vm.xml similarity index 100% rename from soh/assets/xml/objects/object_vm.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_vm.xml diff --git a/soh/assets/xml/objects/object_wallmaster.xml b/soh/assets/xml/GC_NMQ_D/objects/object_wallmaster.xml similarity index 100% rename from soh/assets/xml/objects/object_wallmaster.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_wallmaster.xml diff --git a/soh/assets/xml/objects/object_warp1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_warp1.xml similarity index 100% rename from soh/assets/xml/objects/object_warp1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_warp1.xml diff --git a/soh/assets/xml/objects/object_warp2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_warp2.xml similarity index 100% rename from soh/assets/xml/objects/object_warp2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_warp2.xml diff --git a/soh/assets/xml/objects/object_wf.xml b/soh/assets/xml/GC_NMQ_D/objects/object_wf.xml similarity index 100% rename from soh/assets/xml/objects/object_wf.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_wf.xml diff --git a/soh/assets/xml/objects/object_wood02.xml b/soh/assets/xml/GC_NMQ_D/objects/object_wood02.xml similarity index 100% rename from soh/assets/xml/objects/object_wood02.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_wood02.xml diff --git a/soh/assets/xml/objects/object_xc.xml b/soh/assets/xml/GC_NMQ_D/objects/object_xc.xml similarity index 100% rename from soh/assets/xml/objects/object_xc.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_xc.xml diff --git a/soh/assets/xml/objects/object_yabusame_point.xml b/soh/assets/xml/GC_NMQ_D/objects/object_yabusame_point.xml similarity index 100% rename from soh/assets/xml/objects/object_yabusame_point.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_yabusame_point.xml diff --git a/soh/assets/xml/objects/object_ydan_objects.xml b/soh/assets/xml/GC_NMQ_D/objects/object_ydan_objects.xml similarity index 100% rename from soh/assets/xml/objects/object_ydan_objects.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_ydan_objects.xml diff --git a/soh/assets/xml/objects/object_yukabyun.xml b/soh/assets/xml/GC_NMQ_D/objects/object_yukabyun.xml similarity index 100% rename from soh/assets/xml/objects/object_yukabyun.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_yukabyun.xml diff --git a/soh/assets/xml/objects/object_zf.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zf.xml similarity index 100% rename from soh/assets/xml/objects/object_zf.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zf.xml diff --git a/soh/assets/xml/objects/object_zg.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zg.xml similarity index 100% rename from soh/assets/xml/objects/object_zg.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zg.xml diff --git a/soh/assets/xml/objects/object_zl1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zl1.xml similarity index 100% rename from soh/assets/xml/objects/object_zl1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zl1.xml diff --git a/soh/assets/xml/objects/object_zl2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zl2.xml similarity index 100% rename from soh/assets/xml/objects/object_zl2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zl2.xml diff --git a/soh/assets/xml/objects/object_zl2_anime1.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zl2_anime1.xml similarity index 100% rename from soh/assets/xml/objects/object_zl2_anime1.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zl2_anime1.xml diff --git a/soh/assets/xml/objects/object_zl2_anime2.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zl2_anime2.xml similarity index 100% rename from soh/assets/xml/objects/object_zl2_anime2.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zl2_anime2.xml diff --git a/soh/assets/xml/objects/object_zl4.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zl4.xml similarity index 100% rename from soh/assets/xml/objects/object_zl4.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zl4.xml diff --git a/soh/assets/xml/objects/object_zo.xml b/soh/assets/xml/GC_NMQ_D/objects/object_zo.xml similarity index 100% rename from soh/assets/xml/objects/object_zo.xml rename to soh/assets/xml/GC_NMQ_D/objects/object_zo.xml diff --git a/soh/assets/xml/overlays/ovl_Arrow_Fire.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Arrow_Fire.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Arrow_Fire.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Arrow_Fire.xml diff --git a/soh/assets/xml/overlays/ovl_Arrow_Ice.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Arrow_Ice.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Arrow_Ice.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Arrow_Ice.xml diff --git a/soh/assets/xml/overlays/ovl_Arrow_Light.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Arrow_Light.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Arrow_Light.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Arrow_Light.xml diff --git a/soh/assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Bg_Ganon_Otyuka.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Bg_Ganon_Otyuka.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Bg_Ganon_Otyuka.xml diff --git a/soh/assets/xml/overlays/ovl_Bg_Jya_Cobra.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Bg_Jya_Cobra.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Bg_Jya_Cobra.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Bg_Jya_Cobra.xml diff --git a/soh/assets/xml/overlays/ovl_Boss_Dodongo.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Dodongo.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Boss_Dodongo.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Dodongo.xml diff --git a/soh/assets/xml/overlays/ovl_Boss_Ganon.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Ganon.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Boss_Ganon.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Ganon.xml diff --git a/soh/assets/xml/overlays/ovl_Boss_Ganon2.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Ganon2.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Boss_Ganon2.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Ganon2.xml diff --git a/soh/assets/xml/overlays/ovl_Boss_Sst.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Sst.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Boss_Sst.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Boss_Sst.xml diff --git a/soh/assets/xml/overlays/ovl_Demo_Shd.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Demo_Shd.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Demo_Shd.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Demo_Shd.xml diff --git a/soh/assets/xml/overlays/ovl_Elf_Msg.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Elf_Msg.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Elf_Msg.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Elf_Msg.xml diff --git a/soh/assets/xml/overlays/ovl_Elf_Msg2.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Elf_Msg2.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Elf_Msg2.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Elf_Msg2.xml diff --git a/soh/assets/xml/overlays/ovl_En_Bili.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Bili.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Bili.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Bili.xml diff --git a/soh/assets/xml/overlays/ovl_En_Clear_Tag.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Clear_Tag.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Clear_Tag.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Clear_Tag.xml diff --git a/soh/assets/xml/overlays/ovl_En_Ganon_Mant.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Ganon_Mant.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Ganon_Mant.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Ganon_Mant.xml diff --git a/soh/assets/xml/overlays/ovl_En_Ganon_Organ.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Ganon_Organ.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Ganon_Organ.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Ganon_Organ.xml diff --git a/soh/assets/xml/overlays/ovl_En_Holl.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Holl.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Holl.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Holl.xml diff --git a/soh/assets/xml/overlays/ovl_En_Jsjutan.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Jsjutan.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Jsjutan.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Jsjutan.xml diff --git a/soh/assets/xml/overlays/ovl_En_Kanban.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Kanban.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Kanban.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Kanban.xml diff --git a/soh/assets/xml/overlays/ovl_En_Sda.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Sda.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Sda.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Sda.xml diff --git a/soh/assets/xml/overlays/ovl_En_Ssh.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Ssh.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Ssh.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Ssh.xml diff --git a/soh/assets/xml/overlays/ovl_En_St.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_St.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_St.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_St.xml diff --git a/soh/assets/xml/overlays/ovl_En_Sth.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Sth.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_En_Sth.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_En_Sth.xml diff --git a/soh/assets/xml/overlays/ovl_End_Title.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_End_Title.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_End_Title.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_End_Title.xml diff --git a/soh/assets/xml/overlays/ovl_File_Choose.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_File_Choose.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_File_Choose.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_File_Choose.xml diff --git a/soh/assets/xml/overlays/ovl_Magic_Dark.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Magic_Dark.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Magic_Dark.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Magic_Dark.xml diff --git a/soh/assets/xml/overlays/ovl_Magic_Fire.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Magic_Fire.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Magic_Fire.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Magic_Fire.xml diff --git a/soh/assets/xml/overlays/ovl_Magic_Wind.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Magic_Wind.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Magic_Wind.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Magic_Wind.xml diff --git a/soh/assets/xml/overlays/ovl_Oceff_Spot.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Spot.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Oceff_Spot.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Spot.xml diff --git a/soh/assets/xml/overlays/ovl_Oceff_Storm.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Storm.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Oceff_Storm.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Storm.xml diff --git a/soh/assets/xml/overlays/ovl_Oceff_Wipe.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Oceff_Wipe.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe.xml diff --git a/soh/assets/xml/overlays/ovl_Oceff_Wipe2.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe2.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Oceff_Wipe2.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe2.xml diff --git a/soh/assets/xml/overlays/ovl_Oceff_Wipe3.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe3.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Oceff_Wipe3.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe3.xml diff --git a/soh/assets/xml/overlays/ovl_Oceff_Wipe4.xml b/soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe4.xml similarity index 100% rename from soh/assets/xml/overlays/ovl_Oceff_Wipe4.xml rename to soh/assets/xml/GC_NMQ_D/overlays/ovl_Oceff_Wipe4.xml diff --git a/soh/assets/xml/scenes/dungeons/Bmori1.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/Bmori1.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/Bmori1.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/Bmori1.xml diff --git a/soh/assets/xml/scenes/dungeons/FIRE_bs.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/FIRE_bs.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/FIRE_bs.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/FIRE_bs.xml diff --git a/soh/assets/xml/scenes/dungeons/HAKAdan.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/HAKAdan.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/HAKAdan.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/HAKAdan.xml diff --git a/soh/assets/xml/scenes/dungeons/HAKAdanCH.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/HAKAdanCH.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/HAKAdanCH.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/HAKAdanCH.xml diff --git a/soh/assets/xml/scenes/dungeons/HAKAdan_bs.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/HAKAdan_bs.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/HAKAdan_bs.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/HAKAdan_bs.xml diff --git a/soh/assets/xml/scenes/dungeons/HIDAN.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/HIDAN.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/HIDAN.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/HIDAN.xml diff --git a/soh/assets/xml/scenes/dungeons/MIZUsin.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/MIZUsin.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/MIZUsin.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/MIZUsin.xml diff --git a/soh/assets/xml/scenes/dungeons/MIZUsin_bs.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/MIZUsin_bs.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/MIZUsin_bs.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/MIZUsin_bs.xml diff --git a/soh/assets/xml/scenes/dungeons/bdan.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/bdan.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/bdan.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/bdan.xml diff --git a/soh/assets/xml/scenes/dungeons/bdan_boss.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/bdan_boss.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/bdan_boss.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/bdan_boss.xml diff --git a/soh/assets/xml/scenes/dungeons/ddan.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ddan.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ddan.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ddan.xml diff --git a/soh/assets/xml/scenes/dungeons/ddan_boss.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ddan_boss.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ddan_boss.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ddan_boss.xml diff --git a/soh/assets/xml/scenes/dungeons/ganon.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganon.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon.xml diff --git a/soh/assets/xml/scenes/dungeons/ganon_boss.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_boss.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganon_boss.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_boss.xml diff --git a/soh/assets/xml/scenes/dungeons/ganon_demo.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_demo.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganon_demo.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_demo.xml diff --git a/soh/assets/xml/scenes/dungeons/ganon_final.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_final.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganon_final.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_final.xml diff --git a/soh/assets/xml/scenes/dungeons/ganon_sonogo.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_sonogo.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganon_sonogo.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_sonogo.xml diff --git a/soh/assets/xml/scenes/dungeons/ganon_tou.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_tou.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganon_tou.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganon_tou.xml diff --git a/soh/assets/xml/scenes/dungeons/ganontika.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganontika.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganontika.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganontika.xml diff --git a/soh/assets/xml/scenes/dungeons/ganontikasonogo.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganontikasonogo.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ganontikasonogo.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ganontikasonogo.xml diff --git a/soh/assets/xml/scenes/dungeons/gerudoway.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/gerudoway.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/gerudoway.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/gerudoway.xml diff --git a/soh/assets/xml/scenes/dungeons/ice_doukutu.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ice_doukutu.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ice_doukutu.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ice_doukutu.xml diff --git a/soh/assets/xml/scenes/dungeons/jyasinboss.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/jyasinboss.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/jyasinboss.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/jyasinboss.xml diff --git a/soh/assets/xml/scenes/dungeons/jyasinzou.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/jyasinzou.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/jyasinzou.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/jyasinzou.xml diff --git a/soh/assets/xml/scenes/dungeons/men.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/men.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/men.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/men.xml diff --git a/soh/assets/xml/scenes/dungeons/moribossroom.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/moribossroom.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/moribossroom.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/moribossroom.xml diff --git a/soh/assets/xml/scenes/dungeons/ydan.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ydan.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ydan.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ydan.xml diff --git a/soh/assets/xml/scenes/dungeons/ydan_boss.xml b/soh/assets/xml/GC_NMQ_D/scenes/dungeons/ydan_boss.xml similarity index 100% rename from soh/assets/xml/scenes/dungeons/ydan_boss.xml rename to soh/assets/xml/GC_NMQ_D/scenes/dungeons/ydan_boss.xml diff --git a/soh/assets/xml/scenes/indoors/bowling.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/bowling.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/bowling.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/bowling.xml diff --git a/soh/assets/xml/scenes/indoors/daiyousei_izumi.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/daiyousei_izumi.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/daiyousei_izumi.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/daiyousei_izumi.xml diff --git a/soh/assets/xml/scenes/indoors/hairal_niwa.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/hairal_niwa.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/hairal_niwa.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/hairal_niwa.xml diff --git a/soh/assets/xml/scenes/indoors/hairal_niwa2.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/hairal_niwa2.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/hairal_niwa2.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/hairal_niwa2.xml diff --git a/soh/assets/xml/scenes/indoors/hairal_niwa_n.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/hairal_niwa_n.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/hairal_niwa_n.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/hairal_niwa_n.xml diff --git a/soh/assets/xml/scenes/indoors/hakasitarelay.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/hakasitarelay.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/hakasitarelay.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/hakasitarelay.xml diff --git a/soh/assets/xml/scenes/indoors/hut.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/hut.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/hut.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/hut.xml diff --git a/soh/assets/xml/scenes/indoors/hylia_labo.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/hylia_labo.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/hylia_labo.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/hylia_labo.xml diff --git a/soh/assets/xml/scenes/indoors/impa.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/impa.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/impa.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/impa.xml diff --git a/soh/assets/xml/scenes/indoors/kakariko.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/kakariko.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/kakariko.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/kakariko.xml diff --git a/soh/assets/xml/scenes/indoors/kenjyanoma.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/kenjyanoma.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/kenjyanoma.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/kenjyanoma.xml diff --git a/soh/assets/xml/scenes/indoors/kokiri_home.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/kokiri_home.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home.xml diff --git a/soh/assets/xml/scenes/indoors/kokiri_home3.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home3.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/kokiri_home3.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home3.xml diff --git a/soh/assets/xml/scenes/indoors/kokiri_home4.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home4.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/kokiri_home4.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home4.xml diff --git a/soh/assets/xml/scenes/indoors/kokiri_home5.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home5.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/kokiri_home5.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/kokiri_home5.xml diff --git a/soh/assets/xml/scenes/indoors/labo.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/labo.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/labo.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/labo.xml diff --git a/soh/assets/xml/scenes/indoors/link_home.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/link_home.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/link_home.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/link_home.xml diff --git a/soh/assets/xml/scenes/indoors/mahouya.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/mahouya.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/mahouya.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/mahouya.xml diff --git a/soh/assets/xml/scenes/indoors/malon_stable.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/malon_stable.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/malon_stable.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/malon_stable.xml diff --git a/soh/assets/xml/scenes/indoors/miharigoya.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/miharigoya.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/miharigoya.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/miharigoya.xml diff --git a/soh/assets/xml/scenes/indoors/nakaniwa.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/nakaniwa.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/nakaniwa.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/nakaniwa.xml diff --git a/soh/assets/xml/scenes/indoors/syatekijyou.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/syatekijyou.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/syatekijyou.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/syatekijyou.xml diff --git a/soh/assets/xml/scenes/indoors/takaraya.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/takaraya.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/takaraya.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/takaraya.xml diff --git a/soh/assets/xml/scenes/indoors/tent.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/tent.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/tent.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/tent.xml diff --git a/soh/assets/xml/scenes/indoors/tokinoma.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/tokinoma.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/tokinoma.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/tokinoma.xml diff --git a/soh/assets/xml/scenes/indoors/yousei_izumi_tate.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/yousei_izumi_tate.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/yousei_izumi_tate.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/yousei_izumi_tate.xml diff --git a/soh/assets/xml/scenes/indoors/yousei_izumi_yoko.xml b/soh/assets/xml/GC_NMQ_D/scenes/indoors/yousei_izumi_yoko.xml similarity index 100% rename from soh/assets/xml/scenes/indoors/yousei_izumi_yoko.xml rename to soh/assets/xml/GC_NMQ_D/scenes/indoors/yousei_izumi_yoko.xml diff --git a/soh/assets/xml/scenes/misc/enrui.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/enrui.xml similarity index 100% rename from soh/assets/xml/scenes/misc/enrui.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/enrui.xml diff --git a/soh/assets/xml/scenes/misc/entra_n.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/entra_n.xml similarity index 100% rename from soh/assets/xml/scenes/misc/entra_n.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/entra_n.xml diff --git a/soh/assets/xml/scenes/misc/hakaana.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/hakaana.xml similarity index 100% rename from soh/assets/xml/scenes/misc/hakaana.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/hakaana.xml diff --git a/soh/assets/xml/scenes/misc/hakaana2.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/hakaana2.xml similarity index 100% rename from soh/assets/xml/scenes/misc/hakaana2.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/hakaana2.xml diff --git a/soh/assets/xml/scenes/misc/hakaana_ouke.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/hakaana_ouke.xml similarity index 100% rename from soh/assets/xml/scenes/misc/hakaana_ouke.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/hakaana_ouke.xml diff --git a/soh/assets/xml/scenes/misc/hiral_demo.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/hiral_demo.xml similarity index 100% rename from soh/assets/xml/scenes/misc/hiral_demo.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/hiral_demo.xml diff --git a/soh/assets/xml/scenes/misc/kakariko3.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/kakariko3.xml similarity index 100% rename from soh/assets/xml/scenes/misc/kakariko3.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/kakariko3.xml diff --git a/soh/assets/xml/scenes/misc/kakusiana.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/kakusiana.xml similarity index 100% rename from soh/assets/xml/scenes/misc/kakusiana.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/kakusiana.xml diff --git a/soh/assets/xml/scenes/misc/kinsuta.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/kinsuta.xml similarity index 100% rename from soh/assets/xml/scenes/misc/kinsuta.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/kinsuta.xml diff --git a/soh/assets/xml/scenes/misc/market_alley.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/market_alley.xml similarity index 100% rename from soh/assets/xml/scenes/misc/market_alley.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/market_alley.xml diff --git a/soh/assets/xml/scenes/misc/market_alley_n.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/market_alley_n.xml similarity index 100% rename from soh/assets/xml/scenes/misc/market_alley_n.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/market_alley_n.xml diff --git a/soh/assets/xml/scenes/misc/market_day.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/market_day.xml similarity index 100% rename from soh/assets/xml/scenes/misc/market_day.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/market_day.xml diff --git a/soh/assets/xml/scenes/misc/market_night.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/market_night.xml similarity index 100% rename from soh/assets/xml/scenes/misc/market_night.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/market_night.xml diff --git a/soh/assets/xml/scenes/misc/market_ruins.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/market_ruins.xml similarity index 100% rename from soh/assets/xml/scenes/misc/market_ruins.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/market_ruins.xml diff --git a/soh/assets/xml/scenes/misc/shrine.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/shrine.xml similarity index 100% rename from soh/assets/xml/scenes/misc/shrine.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/shrine.xml diff --git a/soh/assets/xml/scenes/misc/shrine_n.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/shrine_n.xml similarity index 100% rename from soh/assets/xml/scenes/misc/shrine_n.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/shrine_n.xml diff --git a/soh/assets/xml/scenes/misc/shrine_r.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/shrine_r.xml similarity index 100% rename from soh/assets/xml/scenes/misc/shrine_r.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/shrine_r.xml diff --git a/soh/assets/xml/scenes/misc/turibori.xml b/soh/assets/xml/GC_NMQ_D/scenes/misc/turibori.xml similarity index 100% rename from soh/assets/xml/scenes/misc/turibori.xml rename to soh/assets/xml/GC_NMQ_D/scenes/misc/turibori.xml diff --git a/soh/assets/xml/scenes/overworld/entra.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/entra.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/entra.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/entra.xml diff --git a/soh/assets/xml/scenes/overworld/souko.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/souko.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/souko.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/souko.xml diff --git a/soh/assets/xml/scenes/overworld/spot00.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot00.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot00.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot00.xml diff --git a/soh/assets/xml/scenes/overworld/spot01.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot01.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot01.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot01.xml diff --git a/soh/assets/xml/scenes/overworld/spot02.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot02.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot02.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot02.xml diff --git a/soh/assets/xml/scenes/overworld/spot03.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot03.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot03.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot03.xml diff --git a/soh/assets/xml/scenes/overworld/spot04.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot04.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot04.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot04.xml diff --git a/soh/assets/xml/scenes/overworld/spot05.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot05.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot05.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot05.xml diff --git a/soh/assets/xml/scenes/overworld/spot06.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot06.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot06.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot06.xml diff --git a/soh/assets/xml/scenes/overworld/spot07.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot07.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot07.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot07.xml diff --git a/soh/assets/xml/scenes/overworld/spot08.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot08.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot08.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot08.xml diff --git a/soh/assets/xml/scenes/overworld/spot09.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot09.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot09.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot09.xml diff --git a/soh/assets/xml/scenes/overworld/spot10.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot10.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot10.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot10.xml diff --git a/soh/assets/xml/scenes/overworld/spot11.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot11.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot11.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot11.xml diff --git a/soh/assets/xml/scenes/overworld/spot12.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot12.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot12.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot12.xml diff --git a/soh/assets/xml/scenes/overworld/spot13.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot13.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot13.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot13.xml diff --git a/soh/assets/xml/scenes/overworld/spot15.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot15.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot15.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot15.xml diff --git a/soh/assets/xml/scenes/overworld/spot16.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot16.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot16.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot16.xml diff --git a/soh/assets/xml/scenes/overworld/spot17.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot17.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot17.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot17.xml diff --git a/soh/assets/xml/scenes/overworld/spot18.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot18.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot18.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot18.xml diff --git a/soh/assets/xml/scenes/overworld/spot20.xml b/soh/assets/xml/GC_NMQ_D/scenes/overworld/spot20.xml similarity index 100% rename from soh/assets/xml/scenes/overworld/spot20.xml rename to soh/assets/xml/GC_NMQ_D/scenes/overworld/spot20.xml diff --git a/soh/assets/xml/scenes/shops/alley_shop.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/alley_shop.xml similarity index 100% rename from soh/assets/xml/scenes/shops/alley_shop.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/alley_shop.xml diff --git a/soh/assets/xml/scenes/shops/drag.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/drag.xml similarity index 100% rename from soh/assets/xml/scenes/shops/drag.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/drag.xml diff --git a/soh/assets/xml/scenes/shops/face_shop.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/face_shop.xml similarity index 100% rename from soh/assets/xml/scenes/shops/face_shop.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/face_shop.xml diff --git a/soh/assets/xml/scenes/shops/golon.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/golon.xml similarity index 100% rename from soh/assets/xml/scenes/shops/golon.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/golon.xml diff --git a/soh/assets/xml/scenes/shops/kokiri_shop.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/kokiri_shop.xml similarity index 100% rename from soh/assets/xml/scenes/shops/kokiri_shop.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/kokiri_shop.xml diff --git a/soh/assets/xml/scenes/shops/night_shop.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/night_shop.xml similarity index 100% rename from soh/assets/xml/scenes/shops/night_shop.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/night_shop.xml diff --git a/soh/assets/xml/scenes/shops/shop1.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/shop1.xml similarity index 100% rename from soh/assets/xml/scenes/shops/shop1.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/shop1.xml diff --git a/soh/assets/xml/scenes/shops/zoora.xml b/soh/assets/xml/GC_NMQ_D/scenes/shops/zoora.xml similarity index 100% rename from soh/assets/xml/scenes/shops/zoora.xml rename to soh/assets/xml/GC_NMQ_D/scenes/shops/zoora.xml diff --git a/soh/assets/xml/scenes/test_levels/besitu.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/besitu.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/besitu.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/besitu.xml diff --git a/soh/assets/xml/scenes/test_levels/depth_test.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/depth_test.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/depth_test.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/depth_test.xml diff --git a/soh/assets/xml/scenes/test_levels/sasatest.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/sasatest.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/sasatest.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/sasatest.xml diff --git a/soh/assets/xml/scenes/test_levels/sutaru.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/sutaru.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/sutaru.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/sutaru.xml diff --git a/soh/assets/xml/scenes/test_levels/syotes.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/syotes.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/syotes.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/syotes.xml diff --git a/soh/assets/xml/scenes/test_levels/syotes2.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/syotes2.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/syotes2.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/syotes2.xml diff --git a/soh/assets/xml/scenes/test_levels/test01.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/test01.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/test01.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/test01.xml diff --git a/soh/assets/xml/scenes/test_levels/testroom.xml b/soh/assets/xml/GC_NMQ_D/scenes/test_levels/testroom.xml similarity index 100% rename from soh/assets/xml/scenes/test_levels/testroom.xml rename to soh/assets/xml/GC_NMQ_D/scenes/test_levels/testroom.xml diff --git a/soh/assets/xml/text/elf_message_field.xml b/soh/assets/xml/GC_NMQ_D/text/elf_message_field.xml similarity index 100% rename from soh/assets/xml/text/elf_message_field.xml rename to soh/assets/xml/GC_NMQ_D/text/elf_message_field.xml diff --git a/soh/assets/xml/text/elf_message_ydan.xml b/soh/assets/xml/GC_NMQ_D/text/elf_message_ydan.xml similarity index 100% rename from soh/assets/xml/text/elf_message_ydan.xml rename to soh/assets/xml/GC_NMQ_D/text/elf_message_ydan.xml diff --git a/soh/assets/xml/GC_NMQ_D/text/message_data_static.xml b/soh/assets/xml/GC_NMQ_D/text/message_data_static.xml new file mode 100644 index 000000000..223493596 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_D/text/message_data_static.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/textures/backgrounds.xml b/soh/assets/xml/GC_NMQ_D/textures/backgrounds.xml similarity index 100% rename from soh/assets/xml/textures/backgrounds.xml rename to soh/assets/xml/GC_NMQ_D/textures/backgrounds.xml diff --git a/soh/assets/xml/textures/do_action_static.xml b/soh/assets/xml/GC_NMQ_D/textures/do_action_static.xml similarity index 100% rename from soh/assets/xml/textures/do_action_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/do_action_static.xml diff --git a/soh/assets/xml/textures/icon_item_24_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_24_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_24_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_24_static.xml diff --git a/soh/assets/xml/textures/icon_item_dungeon_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_dungeon_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_dungeon_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_dungeon_static.xml diff --git a/soh/assets/xml/textures/icon_item_field_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_field_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_field_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_field_static.xml diff --git a/soh/assets/xml/textures/icon_item_fra_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_fra_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_fra_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_fra_static.xml diff --git a/soh/assets/xml/textures/icon_item_gameover_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_gameover_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_gameover_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_gameover_static.xml diff --git a/soh/assets/xml/textures/icon_item_ger_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_ger_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_ger_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_ger_static.xml diff --git a/soh/assets/xml/textures/icon_item_nes_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_nes_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_nes_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_nes_static.xml diff --git a/soh/assets/xml/textures/icon_item_static.xml b/soh/assets/xml/GC_NMQ_D/textures/icon_item_static.xml similarity index 100% rename from soh/assets/xml/textures/icon_item_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/icon_item_static.xml diff --git a/soh/assets/xml/textures/item_name_static.xml b/soh/assets/xml/GC_NMQ_D/textures/item_name_static.xml similarity index 100% rename from soh/assets/xml/textures/item_name_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/item_name_static.xml diff --git a/soh/assets/xml/textures/map_48x85_static.xml b/soh/assets/xml/GC_NMQ_D/textures/map_48x85_static.xml similarity index 73% rename from soh/assets/xml/textures/map_48x85_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/map_48x85_static.xml index b5b1d1a85..2788498a8 100644 --- a/soh/assets/xml/textures/map_48x85_static.xml +++ b/soh/assets/xml/GC_NMQ_D/textures/map_48x85_static.xml @@ -1,72 +1,72 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/textures/map_grand_static.xml b/soh/assets/xml/GC_NMQ_D/textures/map_grand_static.xml similarity index 100% rename from soh/assets/xml/textures/map_grand_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/map_grand_static.xml diff --git a/soh/assets/xml/textures/map_i_static.xml b/soh/assets/xml/GC_NMQ_D/textures/map_i_static.xml similarity index 100% rename from soh/assets/xml/textures/map_i_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/map_i_static.xml diff --git a/soh/assets/xml/textures/map_name_static.xml b/soh/assets/xml/GC_NMQ_D/textures/map_name_static.xml similarity index 100% rename from soh/assets/xml/textures/map_name_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/map_name_static.xml diff --git a/soh/assets/xml/textures/message_static.xml b/soh/assets/xml/GC_NMQ_D/textures/message_static.xml similarity index 100% rename from soh/assets/xml/textures/message_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/message_static.xml diff --git a/soh/assets/xml/textures/message_texture_static.xml b/soh/assets/xml/GC_NMQ_D/textures/message_texture_static.xml similarity index 100% rename from soh/assets/xml/textures/message_texture_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/message_texture_static.xml diff --git a/soh/assets/xml/textures/nes_font_static.xml b/soh/assets/xml/GC_NMQ_D/textures/nes_font_static.xml similarity index 100% rename from soh/assets/xml/textures/nes_font_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/nes_font_static.xml diff --git a/soh/assets/xml/textures/nintendo_rogo_static.xml b/soh/assets/xml/GC_NMQ_D/textures/nintendo_rogo_static.xml similarity index 100% rename from soh/assets/xml/textures/nintendo_rogo_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/nintendo_rogo_static.xml diff --git a/soh/assets/xml/textures/parameter_static.xml b/soh/assets/xml/GC_NMQ_D/textures/parameter_static.xml similarity index 100% rename from soh/assets/xml/textures/parameter_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/parameter_static.xml diff --git a/soh/assets/xml/textures/place_title_cards.xml b/soh/assets/xml/GC_NMQ_D/textures/place_title_cards.xml similarity index 100% rename from soh/assets/xml/textures/place_title_cards.xml rename to soh/assets/xml/GC_NMQ_D/textures/place_title_cards.xml diff --git a/soh/assets/xml/textures/skyboxes.xml b/soh/assets/xml/GC_NMQ_D/textures/skyboxes.xml similarity index 100% rename from soh/assets/xml/textures/skyboxes.xml rename to soh/assets/xml/GC_NMQ_D/textures/skyboxes.xml diff --git a/soh/assets/xml/textures/title_static.xml b/soh/assets/xml/GC_NMQ_D/textures/title_static.xml similarity index 100% rename from soh/assets/xml/textures/title_static.xml rename to soh/assets/xml/GC_NMQ_D/textures/title_static.xml diff --git a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml new file mode 100644 index 000000000..a3add03bc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_circle.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml new file mode 100644 index 000000000..f4eff13ae --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_triforce.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml new file mode 100644 index 000000000..537706cd1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/code/fbdemo_wipe1.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/misc/link_animetion.xml b/soh/assets/xml/GC_NMQ_PAL_F/misc/link_animetion.xml new file mode 100644 index 000000000..9de1e92d3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/misc/link_animetion.xml @@ -0,0 +1,577 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_dangeon_keep.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_dangeon_keep.xml new file mode 100644 index 000000000..d16eb4c41 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_dangeon_keep.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_field_keep.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_field_keep.xml new file mode 100644 index 000000000..28fa975d7 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_field_keep.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_keep.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_keep.xml new file mode 100644 index 000000000..45c669307 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/gameplay_keep.xml @@ -0,0 +1,960 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_Bb.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_Bb.xml new file mode 100644 index 000000000..5d04bde45 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_Bb.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ahg.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ahg.xml new file mode 100644 index 000000000..a32c00914 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ahg.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_am.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_am.xml new file mode 100644 index 000000000..0a4b88ddf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_am.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ane.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ane.xml new file mode 100644 index 000000000..1e29b351e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ane.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ani.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ani.xml new file mode 100644 index 000000000..c69656043 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ani.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_anubice.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_anubice.xml new file mode 100644 index 000000000..2140187e4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_anubice.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_aob.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_aob.xml new file mode 100644 index 000000000..e6202d0cf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_aob.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_b_heart.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_b_heart.xml new file mode 100644 index 000000000..00f7cd677 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_b_heart.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bba.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bba.xml new file mode 100644 index 000000000..ccc5c2136 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bba.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bdan_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bdan_objects.xml new file mode 100644 index 000000000..dcd56d385 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bdan_objects.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bdoor.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bdoor.xml new file mode 100644 index 000000000..644c06ea8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bdoor.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bg.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bg.xml new file mode 100644 index 000000000..791226b71 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bg.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bigokuta.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bigokuta.xml new file mode 100644 index 000000000..1c7d39e31 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bigokuta.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bird.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bird.xml new file mode 100644 index 000000000..167a5022d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bird.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bji.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bji.xml new file mode 100644 index 000000000..e6b6c4221 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bji.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bl.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bl.xml new file mode 100644 index 000000000..1c2ef4ec6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bl.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_blkobj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_blkobj.xml new file mode 100644 index 000000000..a073077b8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_blkobj.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bob.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bob.xml new file mode 100644 index 000000000..289e994e4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bob.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_boj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_boj.xml new file mode 100644 index 000000000..4cc39906e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_boj.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bombf.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bombf.xml new file mode 100644 index 000000000..83e60248d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bombf.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bombiwa.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bombiwa.xml new file mode 100644 index 000000000..26ab6b4f3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bombiwa.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bowl.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bowl.xml new file mode 100644 index 000000000..ffe6d43db --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bowl.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_box.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_box.xml new file mode 100644 index 000000000..efcec619b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_box.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_brob.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_brob.xml new file mode 100644 index 000000000..718dcd561 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_brob.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bubble.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bubble.xml new file mode 100644 index 000000000..f5de18692 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bubble.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bv.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bv.xml new file mode 100644 index 000000000..83ff039f5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bv.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bw.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bw.xml new file mode 100644 index 000000000..f7d5ecead --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bw.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bwall.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bwall.xml new file mode 100644 index 000000000..d4f43ddc1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bwall.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bxa.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bxa.xml new file mode 100644 index 000000000..fb78c117e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_bxa.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cne.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cne.xml new file mode 100644 index 000000000..ce9c16082 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cne.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cob.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cob.xml new file mode 100644 index 000000000..ba051cfa7 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cob.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cow.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cow.xml new file mode 100644 index 000000000..5d067c329 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cow.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_crow.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_crow.xml new file mode 100644 index 000000000..77337c644 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_crow.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cs.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cs.xml new file mode 100644 index 000000000..83804ccaf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_cs.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_elevator.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_elevator.xml new file mode 100644 index 000000000..6be59c154 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_elevator.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_hsblock.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_hsblock.xml new file mode 100644 index 000000000..b9111b38b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_hsblock.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_lift.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_lift.xml new file mode 100644 index 000000000..291238519 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_d_lift.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_daiku.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_daiku.xml new file mode 100644 index 000000000..1524c7a26 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_daiku.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ddan_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ddan_objects.xml new file mode 100644 index 000000000..3fc563b96 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ddan_objects.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekubaba.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekubaba.xml new file mode 100644 index 000000000..7202a833f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekubaba.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekujr.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekujr.xml new file mode 100644 index 000000000..e906bf61c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekujr.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekunuts.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekunuts.xml new file mode 100644 index 000000000..5fceef416 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dekunuts.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_6k.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_6k.xml new file mode 100644 index 000000000..73058d5e4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_6k.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_kekkai.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_kekkai.xml new file mode 100644 index 000000000..1b9c9b402 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_kekkai.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_tre_lgt.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_tre_lgt.xml new file mode 100644 index 000000000..9ea19012b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_demo_tre_lgt.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dh.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dh.xml new file mode 100644 index 000000000..7a52d7dbe --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dh.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dnk.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dnk.xml new file mode 100644 index 000000000..b1e79464b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dnk.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dns.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dns.xml new file mode 100644 index 000000000..086c4bd11 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dns.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dodojr.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dodojr.xml new file mode 100644 index 000000000..4dfd7d6e4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dodojr.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dodongo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dodongo.xml new file mode 100644 index 000000000..779e20e9d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dodongo.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dog.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dog.xml new file mode 100644 index 000000000..ef00442b6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dog.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_door_gerudo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_door_gerudo.xml new file mode 100644 index 000000000..2f1726204 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_door_gerudo.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_door_killer.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_door_killer.xml new file mode 100644 index 000000000..a37f590d6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_door_killer.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ds.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ds.xml new file mode 100644 index 000000000..0413a9e2e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ds.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ds2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ds2.xml new file mode 100644 index 000000000..683bcc68d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ds2.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_du.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_du.xml new file mode 100644 index 000000000..44bbd1aa0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_du.xml @@ -0,0 +1,81 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dy_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dy_obj.xml new file mode 100644 index 000000000..4d141d546 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_dy_obj.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ec.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ec.xml new file mode 100644 index 000000000..7ec83e284 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ec.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_crystal_light.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_crystal_light.xml new file mode 100644 index 000000000..9215b6a39 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_crystal_light.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_doughnut.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_doughnut.xml new file mode 100644 index 000000000..7f12c56f5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_doughnut.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_erupc.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_erupc.xml new file mode 100644 index 000000000..800d9535f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_erupc.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_fire_ball.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_fire_ball.xml new file mode 100644 index 000000000..2fc65b16f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_fire_ball.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_flash.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_flash.xml new file mode 100644 index 000000000..5f962f162 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_flash.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_lgt_shower.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_lgt_shower.xml new file mode 100644 index 000000000..67ef5ce7e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_lgt_shower.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_star_field.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_star_field.xml new file mode 100644 index 000000000..00b47c460 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_star_field.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_tw.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_tw.xml new file mode 100644 index 000000000..de5376569 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_efc_tw.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ei.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ei.xml new file mode 100644 index 000000000..e4132491f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ei.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fa.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fa.xml new file mode 100644 index 000000000..2f1bf9a5e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fa.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fd.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fd.xml new file mode 100644 index 000000000..1b96e9f22 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fd.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fd2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fd2.xml new file mode 100644 index 000000000..8689098b9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fd2.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fhg.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fhg.xml new file mode 100644 index 000000000..f3a4a55ca --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fhg.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fire.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fire.xml new file mode 100644 index 000000000..49bf620cb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fire.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_firefly.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_firefly.xml new file mode 100644 index 000000000..8c26a4341 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_firefly.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fish.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fish.xml new file mode 100644 index 000000000..f5ad4f6da --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fish.xml @@ -0,0 +1,180 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fr.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fr.xml new file mode 100644 index 000000000..25ee2ad42 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fr.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fu.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fu.xml new file mode 100644 index 000000000..82c449e3d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fu.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fw.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fw.xml new file mode 100644 index 000000000..e71f83092 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fw.xml @@ -0,0 +1,105 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fz.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fz.xml new file mode 100644 index 000000000..dad6fec5c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_fz.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon.xml new file mode 100644 index 000000000..96adabb2b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon2.xml new file mode 100644 index 000000000..8b66cfcc2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon2.xml @@ -0,0 +1,158 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime1.xml new file mode 100644 index 000000000..6021fdd9b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime1.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime2.xml new file mode 100644 index 000000000..96121689e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime2.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime3.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime3.xml new file mode 100644 index 000000000..2af1e94f9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_anime3.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_objects.xml new file mode 100644 index 000000000..5e32610ff --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ganon_objects.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ge1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ge1.xml new file mode 100644 index 000000000..79e0768b8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ge1.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_geff.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_geff.xml new file mode 100644 index 000000000..f0667743b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_geff.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_geldb.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_geldb.xml new file mode 100644 index 000000000..a1dbd18f4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_geldb.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_arrow.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_arrow.xml new file mode 100644 index 000000000..4b58787a9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_arrow.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_arrowcase.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_arrowcase.xml new file mode 100644 index 000000000..267b0a734 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_arrowcase.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bean.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bean.xml new file mode 100644 index 000000000..e74247816 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bean.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bomb_1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bomb_1.xml new file mode 100644 index 000000000..bae86c11d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bomb_1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bomb_2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bomb_2.xml new file mode 100644 index 000000000..1400c4a4d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bomb_2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bombpouch.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bombpouch.xml new file mode 100644 index 000000000..07134748c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bombpouch.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_boomerang.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_boomerang.xml new file mode 100644 index 000000000..3c1a0fe7f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_boomerang.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_boots_2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_boots_2.xml new file mode 100644 index 000000000..8e9cd1028 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_boots_2.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bosskey.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bosskey.xml new file mode 100644 index 000000000..e5e4bc86c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bosskey.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bottle.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bottle.xml new file mode 100644 index 000000000..3b0884a03 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bottle.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bottle_letter.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bottle_letter.xml new file mode 100644 index 000000000..443219caf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bottle_letter.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bow.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bow.xml new file mode 100644 index 000000000..946e9c496 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bow.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bracelet.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bracelet.xml new file mode 100644 index 000000000..5a0b62a60 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_bracelet.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_brokensword.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_brokensword.xml new file mode 100644 index 000000000..408741ac5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_brokensword.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_butterfly.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_butterfly.xml new file mode 100644 index 000000000..76ac70609 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_butterfly.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_clothes.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_clothes.xml new file mode 100644 index 000000000..2a10dce11 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_clothes.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_coin.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_coin.xml new file mode 100644 index 000000000..22e29f255 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_coin.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_compass.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_compass.xml new file mode 100644 index 000000000..076229b11 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_compass.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_dekupouch.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_dekupouch.xml new file mode 100644 index 000000000..3d6d95d98 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_dekupouch.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_egg.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_egg.xml new file mode 100644 index 000000000..2b2e2847d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_egg.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_eye_lotion.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_eye_lotion.xml new file mode 100644 index 000000000..5128c5f6f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_eye_lotion.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_fire.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_fire.xml new file mode 100644 index 000000000..a57fba6e8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_fire.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_fish.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_fish.xml new file mode 100644 index 000000000..edb39dc29 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_fish.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_frog.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_frog.xml new file mode 100644 index 000000000..f180fd267 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_frog.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gerudo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gerudo.xml new file mode 100644 index 000000000..3be8d3462 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gerudo.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gerudomask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gerudomask.xml new file mode 100644 index 000000000..b53bf24af --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gerudomask.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ghost.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ghost.xml new file mode 100644 index 000000000..186f4c74b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ghost.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_glasses.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_glasses.xml new file mode 100644 index 000000000..63d32ab5a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_glasses.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gloves.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gloves.xml new file mode 100644 index 000000000..1b4282dca --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_gloves.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_goddess.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_goddess.xml new file mode 100644 index 000000000..50cbdd891 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_goddess.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_golonmask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_golonmask.xml new file mode 100644 index 000000000..98f53f1c2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_golonmask.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_grass.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_grass.xml new file mode 100644 index 000000000..ae7834201 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_grass.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hammer.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hammer.xml new file mode 100644 index 000000000..feb5c8659 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hammer.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_heart.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_heart.xml new file mode 100644 index 000000000..48e78b1b5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_heart.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hearts.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hearts.xml new file mode 100644 index 000000000..d2e763e63 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hearts.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hookshot.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hookshot.xml new file mode 100644 index 000000000..a6b3b0fda --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hookshot.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hoverboots.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hoverboots.xml new file mode 100644 index 000000000..c4a67877b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_hoverboots.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_insect.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_insect.xml new file mode 100644 index 000000000..7af5b5b3b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_insect.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_jewel.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_jewel.xml new file mode 100644 index 000000000..e83c65116 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_jewel.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_key.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_key.xml new file mode 100644 index 000000000..a37d45a71 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_key.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ki_tan_mask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ki_tan_mask.xml new file mode 100644 index 000000000..f66535af3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ki_tan_mask.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_letter.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_letter.xml new file mode 100644 index 000000000..167a7ff5d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_letter.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_liquid.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_liquid.xml new file mode 100644 index 000000000..5eeeca0fd --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_liquid.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_longsword.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_longsword.xml new file mode 100644 index 000000000..7161e42e3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_longsword.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_m_arrow.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_m_arrow.xml new file mode 100644 index 000000000..0fd659ae9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_m_arrow.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_magicpot.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_magicpot.xml new file mode 100644 index 000000000..7623e6353 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_magicpot.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_map.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_map.xml new file mode 100644 index 000000000..8887dd22c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_map.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_medal.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_medal.xml new file mode 100644 index 000000000..28e5b1e68 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_medal.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_melody.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_melody.xml new file mode 100644 index 000000000..b01fca953 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_melody.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_milk.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_milk.xml new file mode 100644 index 000000000..00b9530d9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_milk.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_mushroom.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_mushroom.xml new file mode 100644 index 000000000..5b19bca74 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_mushroom.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_niwatori.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_niwatori.xml new file mode 100644 index 000000000..713cc1ce5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_niwatori.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_nuts.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_nuts.xml new file mode 100644 index 000000000..5508fe856 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_nuts.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ocarina.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ocarina.xml new file mode 100644 index 000000000..7693cc122 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ocarina.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ocarina_0.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ocarina_0.xml new file mode 100644 index 000000000..336d33894 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ocarina_0.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_pachinko.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_pachinko.xml new file mode 100644 index 000000000..5f808baf9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_pachinko.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_powder.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_powder.xml new file mode 100644 index 000000000..fb7dc0155 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_powder.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_prescription.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_prescription.xml new file mode 100644 index 000000000..081de301c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_prescription.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_purse.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_purse.xml new file mode 100644 index 000000000..3034942ff --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_purse.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_rabit_mask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_rabit_mask.xml new file mode 100644 index 000000000..75f855550 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_rabit_mask.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_redead_mask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_redead_mask.xml new file mode 100644 index 000000000..7de08487f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_redead_mask.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_rupy.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_rupy.xml new file mode 100644 index 000000000..0a1af96d0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_rupy.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_saw.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_saw.xml new file mode 100644 index 000000000..dcc038b7c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_saw.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_scale.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_scale.xml new file mode 100644 index 000000000..1cf5de5b9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_scale.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_seed.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_seed.xml new file mode 100644 index 000000000..82c15c82d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_seed.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_1.xml new file mode 100644 index 000000000..2e9369569 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_2.xml new file mode 100644 index 000000000..176ae025f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_2.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_3.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_3.xml new file mode 100644 index 000000000..250bf7fea --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_shield_3.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_skj_mask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_skj_mask.xml new file mode 100644 index 000000000..e6c90f76f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_skj_mask.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_soldout.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_soldout.xml new file mode 100644 index 000000000..ae3f4685f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_soldout.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_soul.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_soul.xml new file mode 100644 index 000000000..76ffc5685 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_soul.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_stick.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_stick.xml new file mode 100644 index 000000000..fed89f465 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_stick.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_sutaru.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_sutaru.xml new file mode 100644 index 000000000..a2606afbe --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_sutaru.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_sword_1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_sword_1.xml new file mode 100644 index 000000000..e1119abca --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_sword_1.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ticketstone.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ticketstone.xml new file mode 100644 index 000000000..0fa37fe11 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_ticketstone.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_truth_mask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_truth_mask.xml new file mode 100644 index 000000000..f28c7cbca --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_truth_mask.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_zoramask.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_zoramask.xml new file mode 100644 index 000000000..096fdeedf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gi_zoramask.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gj.xml new file mode 100644 index 000000000..50d6337b4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gj.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gjyo_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gjyo_objects.xml new file mode 100644 index 000000000..ea4f8444f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gjyo_objects.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gla.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gla.xml new file mode 100644 index 000000000..499a3720d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gla.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gm.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gm.xml new file mode 100644 index 000000000..91b10cc42 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gm.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gnd.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gnd.xml new file mode 100644 index 000000000..dfbe02315 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gnd.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gnd_magic.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gnd_magic.xml new file mode 100644 index 000000000..a88d419d7 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gnd_magic.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gndd.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gndd.xml new file mode 100644 index 000000000..96e264c34 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gndd.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_god_lgt.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_god_lgt.xml new file mode 100644 index 000000000..60df9e469 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_god_lgt.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gol.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gol.xml new file mode 100644 index 000000000..7e04508cb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gol.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_goma.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_goma.xml new file mode 100644 index 000000000..e7a6d0a54 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_goma.xml @@ -0,0 +1,169 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_goroiwa.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_goroiwa.xml new file mode 100644 index 000000000..5d406e957 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_goroiwa.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gr.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gr.xml new file mode 100644 index 000000000..103d4412e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gr.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gs.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gs.xml new file mode 100644 index 000000000..145be1665 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gs.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gt.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gt.xml new file mode 100644 index 000000000..1d79d4e39 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_gt.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka.xml new file mode 100644 index 000000000..f6b263c37 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka_door.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka_door.xml new file mode 100644 index 000000000..753492445 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka_door.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka_objects.xml new file mode 100644 index 000000000..3ca6d27c0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_haka_objects.xml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hakach_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hakach_objects.xml new file mode 100644 index 000000000..b978e77a3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hakach_objects.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hata.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hata.xml new file mode 100644 index 000000000..b0324c3be --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hata.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_heavy_object.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_heavy_object.xml new file mode 100644 index 000000000..ecc795321 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_heavy_object.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hidan_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hidan_objects.xml new file mode 100644 index 000000000..5c54244bb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hidan_objects.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hintnuts.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hintnuts.xml new file mode 100644 index 000000000..f419f7546 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hintnuts.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hni.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hni.xml new file mode 100644 index 000000000..6b317eb7a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hni.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse.xml new file mode 100644 index 000000000..74619e597 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_ganon.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_ganon.xml new file mode 100644 index 000000000..98babb080 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_ganon.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_link_child.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_link_child.xml new file mode 100644 index 000000000..1491189a1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_link_child.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_normal.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_normal.xml new file mode 100644 index 000000000..2bc2cb0c6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_normal.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_zelda.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_zelda.xml new file mode 100644 index 000000000..9595c3245 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_horse_zelda.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hs.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hs.xml new file mode 100644 index 000000000..cf5d06e1a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_hs.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_human.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_human.xml new file mode 100644 index 000000000..c52398446 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_human.xml @@ -0,0 +1,213 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ice_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ice_objects.xml new file mode 100644 index 000000000..a4e2e9b12 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ice_objects.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ik.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ik.xml new file mode 100644 index 000000000..95606e6df --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ik.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_im.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_im.xml new file mode 100644 index 000000000..a628a113a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_im.xml @@ -0,0 +1,79 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_in.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_in.xml new file mode 100644 index 000000000..84c114047 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_in.xml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ingate.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ingate.xml new file mode 100644 index 000000000..e6be42beb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ingate.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jj.xml new file mode 100644 index 000000000..62bae8cb9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jj.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_js.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_js.xml new file mode 100644 index 000000000..ff7bd3efa --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_js.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_door.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_door.xml new file mode 100644 index 000000000..60a7b3788 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_door.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_iron.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_iron.xml new file mode 100644 index 000000000..c6f6773c6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_iron.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_obj.xml new file mode 100644 index 000000000..4a203b0b9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_jya_obj.xml @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ka.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ka.xml new file mode 100644 index 000000000..eb952732b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ka.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kanban.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kanban.xml new file mode 100644 index 000000000..9ffc7a2ce --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kanban.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kibako2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kibako2.xml new file mode 100644 index 000000000..a701b294d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kibako2.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kingdodongo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kingdodongo.xml new file mode 100644 index 000000000..9b104b3ea --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kingdodongo.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_km1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_km1.xml new file mode 100644 index 000000000..0a918a798 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_km1.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kusa.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kusa.xml new file mode 100644 index 000000000..67291a554 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kusa.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kw1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kw1.xml new file mode 100644 index 000000000..eab561b1f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kw1.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kz.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kz.xml new file mode 100644 index 000000000..20aeec4d9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_kz.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_light_ring.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_light_ring.xml new file mode 100644 index 000000000..babe7d2aa --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_light_ring.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_lightbox.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_lightbox.xml new file mode 100644 index 000000000..552a79d7c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_lightbox.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_lightswitch.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_lightswitch.xml new file mode 100644 index 000000000..cfd5dcfb4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_lightswitch.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_link_boy.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_link_boy.xml new file mode 100644 index 000000000..2f3cd943c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_link_boy.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_link_child.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_link_child.xml new file mode 100644 index 000000000..0de400373 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_link_child.xml @@ -0,0 +1,225 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ma1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ma1.xml new file mode 100644 index 000000000..63eeb3895 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ma1.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ma2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ma2.xml new file mode 100644 index 000000000..ce5910fb8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ma2.xml @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mag.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mag.xml new file mode 100644 index 000000000..e691fbeb3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mag.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mamenoki.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mamenoki.xml new file mode 100644 index 000000000..819d89022 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mamenoki.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mastergolon.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mastergolon.xml new file mode 100644 index 000000000..6dd9d1659 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mastergolon.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterkokiri.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterkokiri.xml new file mode 100644 index 000000000..af5a9ec15 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterkokiri.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterkokirihead.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterkokirihead.xml new file mode 100644 index 000000000..1e489323c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterkokirihead.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterzoora.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterzoora.xml new file mode 100644 index 000000000..2c703274e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_masterzoora.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mb.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mb.xml new file mode 100644 index 000000000..a8471429d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mb.xml @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_md.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_md.xml new file mode 100644 index 000000000..0c80fb780 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_md.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_medal.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_medal.xml new file mode 100644 index 000000000..533872a55 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_medal.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_menkuri_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_menkuri_objects.xml new file mode 100644 index 000000000..4c2b51df5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_menkuri_objects.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mir_ray.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mir_ray.xml new file mode 100644 index 000000000..2acc9391a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mir_ray.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mizu_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mizu_objects.xml new file mode 100644 index 000000000..1abd73bc0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mizu_objects.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin.xml new file mode 100644 index 000000000..daf9b0541 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_dark.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_dark.xml new file mode 100644 index 000000000..2fa0bdbe4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_dark.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_flame.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_flame.xml new file mode 100644 index 000000000..6274feaee --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_flame.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_flash.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_flash.xml new file mode 100644 index 000000000..c1040ea11 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_flash.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_ice.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_ice.xml new file mode 100644 index 000000000..1aaeea193 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_ice.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_oka.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_oka.xml new file mode 100644 index 000000000..0f823b923 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_oka.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_soul.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_soul.xml new file mode 100644 index 000000000..6386f7f9e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_soul.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_wind.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_wind.xml new file mode 100644 index 000000000..8bba7eb91 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mjin_wind.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mk.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mk.xml new file mode 100644 index 000000000..0b4aaae8a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mk.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mm.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mm.xml new file mode 100644 index 000000000..834afe5ef --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mm.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mo.xml new file mode 100644 index 000000000..526fa94dd --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mo.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri1.xml new file mode 100644 index 000000000..bb1b31e2f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri1.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri1a.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri1a.xml new file mode 100644 index 000000000..c750ce20d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri1a.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri2.xml new file mode 100644 index 000000000..785b85857 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri2.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri2a.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri2a.xml new file mode 100644 index 000000000..ad1bb4d5f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_hineri2a.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_objects.xml new file mode 100644 index 000000000..58ea8c085 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_objects.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_tex.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_tex.xml new file mode 100644 index 000000000..b1a4b803c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mori_tex.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ms.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ms.xml new file mode 100644 index 000000000..a87d0e6b3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ms.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mu.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mu.xml new file mode 100644 index 000000000..7251ff721 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_mu.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_nb.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_nb.xml new file mode 100644 index 000000000..74de9e285 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_nb.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_niw.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_niw.xml new file mode 100644 index 000000000..a74cbe7da --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_niw.xml @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_nwc.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_nwc.xml new file mode 100644 index 000000000..96ffa3238 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_nwc.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ny.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ny.xml new file mode 100644 index 000000000..e2e8187ff --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ny.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA1.xml new file mode 100644 index 000000000..1d665f101 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA1.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA10.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA10.xml new file mode 100644 index 000000000..65d080834 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA10.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA11.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA11.xml new file mode 100644 index 000000000..92ae474b6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA11.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA2.xml new file mode 100644 index 000000000..ffdcd7989 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA2.xml @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA3.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA3.xml new file mode 100644 index 000000000..a492bd875 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA4.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA4.xml new file mode 100644 index 000000000..dcdbbfff9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA4.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA5.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA5.xml new file mode 100644 index 000000000..55072176d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA5.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA6.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA6.xml new file mode 100644 index 000000000..c17a51088 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA6.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA7.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA7.xml new file mode 100644 index 000000000..52c68f639 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA7.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA8.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA8.xml new file mode 100644 index 000000000..8ed2d3df5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA8.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA9.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA9.xml new file mode 100644 index 000000000..d5c16abfc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oA9.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB1.xml new file mode 100644 index 000000000..2f50c967b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB1.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB2.xml new file mode 100644 index 000000000..230783cea --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB2.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB3.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB3.xml new file mode 100644 index 000000000..1c42ddacc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB3.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB4.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB4.xml new file mode 100644 index 000000000..2924c9e75 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oB4.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE1.xml new file mode 100644 index 000000000..4d5b1663f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE1.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE10.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE10.xml new file mode 100644 index 000000000..04ce91437 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE10.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE11.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE11.xml new file mode 100644 index 000000000..04f6f186d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE11.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE12.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE12.xml new file mode 100644 index 000000000..a5fa39fd2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE12.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE1s.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE1s.xml new file mode 100644 index 000000000..faf6ab734 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE1s.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE2.xml new file mode 100644 index 000000000..af62ad6d1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE2.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE3.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE3.xml new file mode 100644 index 000000000..95227da38 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE3.xml @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE4.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE4.xml new file mode 100644 index 000000000..ae48d2ade --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE4.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE4s.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE4s.xml new file mode 100644 index 000000000..584019568 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE4s.xml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE5.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE5.xml new file mode 100644 index 000000000..f5edf745a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE5.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE6.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE6.xml new file mode 100644 index 000000000..95bb602b6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE6.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE7.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE7.xml new file mode 100644 index 000000000..b3e588d4c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE7.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE8.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE8.xml new file mode 100644 index 000000000..be5de2494 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE8.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE9.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE9.xml new file mode 100644 index 000000000..8ea7ee18c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE9.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE_anime.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE_anime.xml new file mode 100644 index 000000000..f6b4659e2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oE_anime.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oF1d_map.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oF1d_map.xml new file mode 100644 index 000000000..c4f3a41f8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oF1d_map.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oF1s.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oF1s.xml new file mode 100644 index 000000000..11359eff5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_oF1s.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_o_anime.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_o_anime.xml new file mode 100644 index 000000000..4ef4ac44c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_o_anime.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_okuta.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_okuta.xml new file mode 100644 index 000000000..b4fccea6f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_okuta.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_opening_demo1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_opening_demo1.xml new file mode 100644 index 000000000..fd0323027 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_opening_demo1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_os.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_os.xml new file mode 100644 index 000000000..7c3029443 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_os.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_os_anime.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_os_anime.xml new file mode 100644 index 000000000..c90e37b37 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_os_anime.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ossan.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ossan.xml new file mode 100644 index 000000000..963053f3f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ossan.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ouke_haka.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ouke_haka.xml new file mode 100644 index 000000000..11da9b26e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ouke_haka.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_owl.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_owl.xml new file mode 100644 index 000000000..fdc64b3aa --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_owl.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_peehat.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_peehat.xml new file mode 100644 index 000000000..42ee66cde --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_peehat.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_composer.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_composer.xml new file mode 100644 index 000000000..2ab8d64d8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_composer.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_field.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_field.xml new file mode 100644 index 000000000..10b402e2c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_field.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_sisters.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_sisters.xml new file mode 100644 index 000000000..e0c9f0834 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_po_sisters.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_poh.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_poh.xml new file mode 100644 index 000000000..009d0fca3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_poh.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ps.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ps.xml new file mode 100644 index 000000000..043e232d6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ps.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_pu_box.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_pu_box.xml new file mode 100644 index 000000000..e1d686e97 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_pu_box.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rd.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rd.xml new file mode 100644 index 000000000..05fa416d7 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rd.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_reeba.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_reeba.xml new file mode 100644 index 000000000..32c697bd9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_reeba.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_relay_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_relay_objects.xml new file mode 100644 index 000000000..47b92fcd2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_relay_objects.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rl.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rl.xml new file mode 100644 index 000000000..625ab83a1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rl.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rr.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rr.xml new file mode 100644 index 000000000..98726b14b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rr.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rs.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rs.xml new file mode 100644 index 000000000..1da1488af --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_rs.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ru1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ru1.xml new file mode 100644 index 000000000..3d413619f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ru1.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ru2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ru2.xml new file mode 100644 index 000000000..2a8d70af3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ru2.xml @@ -0,0 +1,90 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sa.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sa.xml new file mode 100644 index 000000000..a19446453 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sa.xml @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sb.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sb.xml new file mode 100644 index 000000000..64d3bb005 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sb.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sd.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sd.xml new file mode 100644 index 000000000..c72efeae1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sd.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_shop_dungen.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_shop_dungen.xml new file mode 100644 index 000000000..594c43d39 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_shop_dungen.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_shopnuts.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_shopnuts.xml new file mode 100644 index 000000000..a4e12e38a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_shopnuts.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_siofuki.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_siofuki.xml new file mode 100644 index 000000000..a23240a72 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_siofuki.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sk2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sk2.xml new file mode 100644 index 000000000..f2e7ef6d8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sk2.xml @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_skb.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_skb.xml new file mode 100644 index 000000000..5b5efb484 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_skb.xml @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_skj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_skj.xml new file mode 100644 index 000000000..3abdd610f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_skj.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot00_break.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot00_break.xml new file mode 100644 index 000000000..d3be88315 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot00_break.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot00_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot00_objects.xml new file mode 100644 index 000000000..10fb13aea --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot00_objects.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_matoya.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_matoya.xml new file mode 100644 index 000000000..d44b944e0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_matoya.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_matoyab.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_matoyab.xml new file mode 100644 index 000000000..720f50cd3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_matoyab.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_objects.xml new file mode 100644 index 000000000..413e032a9 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_objects.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_objects2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_objects2.xml new file mode 100644 index 000000000..36741a949 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot01_objects2.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot02_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot02_objects.xml new file mode 100644 index 000000000..65f45ff51 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot02_objects.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot03_object.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot03_object.xml new file mode 100644 index 000000000..f182e7d99 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot03_object.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot04_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot04_objects.xml new file mode 100644 index 000000000..66293d752 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot04_objects.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot05_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot05_objects.xml new file mode 100644 index 000000000..6e7079149 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot05_objects.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot06_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot06_objects.xml new file mode 100644 index 000000000..e3da63b0f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot06_objects.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot07_object.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot07_object.xml new file mode 100644 index 000000000..5bc2bfb6b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot07_object.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot08_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot08_obj.xml new file mode 100644 index 000000000..4d71f3473 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot08_obj.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot09_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot09_obj.xml new file mode 100644 index 000000000..b4d9ae42a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot09_obj.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot11_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot11_obj.xml new file mode 100644 index 000000000..257298f7c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot11_obj.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot12_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot12_obj.xml new file mode 100644 index 000000000..d619c781e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot12_obj.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot15_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot15_obj.xml new file mode 100644 index 000000000..bd59b8cd1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot15_obj.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot16_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot16_obj.xml new file mode 100644 index 000000000..d39de812a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot16_obj.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot17_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot17_obj.xml new file mode 100644 index 000000000..d4239d8d2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot17_obj.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot18_obj.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot18_obj.xml new file mode 100644 index 000000000..cc12b7894 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_spot18_obj.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ssh.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ssh.xml new file mode 100644 index 000000000..6283f8e9f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ssh.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sst.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sst.xml new file mode 100644 index 000000000..a80780741 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_sst.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_st.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_st.xml new file mode 100644 index 000000000..fe617cf14 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_st.xml @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_stream.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_stream.xml new file mode 100644 index 000000000..59b0838e4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_stream.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_syokudai.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_syokudai.xml new file mode 100644 index 000000000..c1670edec --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_syokudai.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ta.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ta.xml new file mode 100644 index 000000000..5e446bf5c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ta.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_timeblock.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_timeblock.xml new file mode 100644 index 000000000..1d6b9e698 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_timeblock.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tite.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tite.xml new file mode 100644 index 000000000..1be65c495 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tite.xml @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tk.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tk.xml new file mode 100644 index 000000000..6869280e6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tk.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_toki_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_toki_objects.xml new file mode 100644 index 000000000..cd07e60d2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_toki_objects.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_torch2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_torch2.xml new file mode 100644 index 000000000..ec55bbe26 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_torch2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_toryo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_toryo.xml new file mode 100644 index 000000000..73f3dcb1e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_toryo.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tp.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tp.xml new file mode 100644 index 000000000..8ea908825 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tp.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tr.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tr.xml new file mode 100644 index 000000000..e84d0896d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tr.xml @@ -0,0 +1,149 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_trap.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_trap.xml new file mode 100644 index 000000000..56195cf41 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_trap.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/objects/object_triforce_spot.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_triforce_spot.xml similarity index 100% rename from soh/assets/xml/objects/object_triforce_spot.xml rename to soh/assets/xml/GC_NMQ_PAL_F/objects/object_triforce_spot.xml diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ts.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ts.xml new file mode 100644 index 000000000..567277bc3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ts.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tsubo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tsubo.xml new file mode 100644 index 000000000..ee2c5e184 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tsubo.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tw.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tw.xml new file mode 100644 index 000000000..66cd3a7c2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_tw.xml @@ -0,0 +1,332 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_umajump.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_umajump.xml new file mode 100644 index 000000000..2ee4ade46 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_umajump.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vali.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vali.xml new file mode 100644 index 000000000..2bab5efaa --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vali.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vase.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vase.xml new file mode 100644 index 000000000..091d4c51e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vase.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vm.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vm.xml new file mode 100644 index 000000000..c5b949b36 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_vm.xml @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wallmaster.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wallmaster.xml new file mode 100644 index 000000000..fbbc4f4af --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wallmaster.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_warp1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_warp1.xml new file mode 100644 index 000000000..1497d7a10 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_warp1.xml @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_warp2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_warp2.xml new file mode 100644 index 000000000..b6d1b3624 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_warp2.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wf.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wf.xml new file mode 100644 index 000000000..ebfb708d2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wf.xml @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wood02.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wood02.xml new file mode 100644 index 000000000..47ec342ca --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_wood02.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_xc.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_xc.xml new file mode 100644 index 000000000..030ae9394 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_xc.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_yabusame_point.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_yabusame_point.xml new file mode 100644 index 000000000..bed9e8a60 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_yabusame_point.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ydan_objects.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ydan_objects.xml new file mode 100644 index 000000000..e2adf307f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_ydan_objects.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_yukabyun.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_yukabyun.xml new file mode 100644 index 000000000..d594ebbb8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_yukabyun.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zf.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zf.xml new file mode 100644 index 000000000..7f20eb786 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zf.xml @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zg.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zg.xml new file mode 100644 index 000000000..79005516c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zg.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl1.xml new file mode 100644 index 000000000..c7082a3db --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl1.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2.xml new file mode 100644 index 000000000..9af0a6527 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2_anime1.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2_anime1.xml new file mode 100644 index 000000000..cada50486 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2_anime1.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2_anime2.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2_anime2.xml new file mode 100644 index 000000000..47016e2e0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl2_anime2.xml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl4.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl4.xml new file mode 100644 index 000000000..b43e5ba34 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zl4.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zo.xml b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zo.xml new file mode 100644 index 000000000..77465760e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/objects/object_zo.xml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml new file mode 100644 index 000000000..0f91c80be --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Fire.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml new file mode 100644 index 000000000..001ac51d5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Ice.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml new file mode 100644 index 000000000..e6e5c9776 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Arrow_Light.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml new file mode 100644 index 000000000..e1ea84996 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Ganon_Otyuka.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml new file mode 100644 index 000000000..857a14922 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Bg_Jya_Cobra.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Dodongo.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Dodongo.xml new file mode 100644 index 000000000..f2ee5b7b8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Dodongo.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml new file mode 100644 index 000000000..9f0e6e1f4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon.xml @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml new file mode 100644 index 000000000..dfb01ba07 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Ganon2.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml new file mode 100644 index 000000000..4e08c34f1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Boss_Sst.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml new file mode 100644 index 000000000..1682fd16a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Demo_Shd.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml new file mode 100644 index 000000000..8a77b7bd3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Bili.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml new file mode 100644 index 000000000..fee5c6302 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Clear_Tag.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Mant.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Mant.xml new file mode 100644 index 000000000..900ec46ac --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Mant.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml new file mode 100644 index 000000000..91a5e31ac --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ganon_Organ.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml new file mode 100644 index 000000000..65673c5ea --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Holl.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml new file mode 100644 index 000000000..d7f2859cb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Jsjutan.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml new file mode 100644 index 000000000..c2f8f7c23 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Kanban.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml new file mode 100644 index 000000000..91321c648 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sda.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml new file mode 100644 index 000000000..f12c4ee19 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Ssh.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml new file mode 100644 index 000000000..d7b6b20cf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_St.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml new file mode 100644 index 000000000..13daffa63 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_En_Sth.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml new file mode 100644 index 000000000..77c39c63a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_End_Title.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml new file mode 100644 index 000000000..f9aad776d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_File_Choose.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml new file mode 100644 index 000000000..e6315effd --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Dark.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Fire.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Fire.xml new file mode 100644 index 000000000..0ddfe4cfc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Fire.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml new file mode 100644 index 000000000..3736e985e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Magic_Wind.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Spot.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Spot.xml new file mode 100644 index 000000000..9a53952f0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Spot.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml new file mode 100644 index 000000000..cb043eeb8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Storm.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml new file mode 100644 index 000000000..4ca01b04c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml new file mode 100644 index 000000000..051f2177e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe3.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe3.xml new file mode 100644 index 000000000..11f278866 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe3.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml new file mode 100644 index 000000000..a4e410eba --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/overlays/ovl_Oceff_Wipe4.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/Bmori1.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/Bmori1.xml new file mode 100644 index 000000000..70aac3464 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/Bmori1.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/FIRE_bs.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/FIRE_bs.xml new file mode 100644 index 000000000..9e65ba617 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/FIRE_bs.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdan.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdan.xml new file mode 100644 index 000000000..cc2935a1c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdan.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdanCH.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdanCH.xml new file mode 100644 index 000000000..eb55a19f5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdanCH.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdan_bs.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdan_bs.xml new file mode 100644 index 000000000..d3280ffe6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HAKAdan_bs.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HIDAN.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HIDAN.xml new file mode 100644 index 000000000..dc4d56849 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/HIDAN.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/MIZUsin.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/MIZUsin.xml new file mode 100644 index 000000000..beb765c85 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/MIZUsin.xml @@ -0,0 +1,77 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/MIZUsin_bs.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/MIZUsin_bs.xml new file mode 100644 index 000000000..b64089530 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/MIZUsin_bs.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/bdan.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/bdan.xml new file mode 100644 index 000000000..c4edc9bea --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/bdan.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/bdan_boss.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/bdan_boss.xml new file mode 100644 index 000000000..12d8d3e12 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/bdan_boss.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ddan.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ddan.xml new file mode 100644 index 000000000..f6572b9f8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ddan.xml @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ddan_boss.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ddan_boss.xml new file mode 100644 index 000000000..03eb73ea3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ddan_boss.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon.xml new file mode 100644 index 000000000..0582da79f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_boss.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_boss.xml new file mode 100644 index 000000000..c75914c29 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_boss.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_demo.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_demo.xml new file mode 100644 index 000000000..779cb9335 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_demo.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_final.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_final.xml new file mode 100644 index 000000000..afe1cffdf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_final.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_sonogo.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_sonogo.xml new file mode 100644 index 000000000..70313c8cf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_sonogo.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_tou.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_tou.xml new file mode 100644 index 000000000..6642a8902 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganon_tou.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganontika.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganontika.xml new file mode 100644 index 000000000..de24b26ff --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganontika.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganontikasonogo.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganontikasonogo.xml new file mode 100644 index 000000000..60020188f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ganontikasonogo.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/gerudoway.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/gerudoway.xml new file mode 100644 index 000000000..531724ead --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/gerudoway.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ice_doukutu.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ice_doukutu.xml new file mode 100644 index 000000000..4d25aa74f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ice_doukutu.xml @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/jyasinboss.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/jyasinboss.xml new file mode 100644 index 000000000..0f81c26fb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/jyasinboss.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/jyasinzou.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/jyasinzou.xml new file mode 100644 index 000000000..ca5d0024a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/jyasinzou.xml @@ -0,0 +1,95 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/men.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/men.xml new file mode 100644 index 000000000..acba3e7cb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/men.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/moribossroom.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/moribossroom.xml new file mode 100644 index 000000000..9c4552e9e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/moribossroom.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ydan.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ydan.xml new file mode 100644 index 000000000..465c5f0ca --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ydan.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ydan_boss.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ydan_boss.xml new file mode 100644 index 000000000..f4971e7fe --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/dungeons/ydan_boss.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/bowling.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/bowling.xml new file mode 100644 index 000000000..e12fd269a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/bowling.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/daiyousei_izumi.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/daiyousei_izumi.xml new file mode 100644 index 000000000..3c1fafb8d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/daiyousei_izumi.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hairal_niwa.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hairal_niwa.xml new file mode 100644 index 000000000..04547ab21 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hairal_niwa.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hairal_niwa_n.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hairal_niwa_n.xml new file mode 100644 index 000000000..a33d77b07 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hairal_niwa_n.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hakasitarelay.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hakasitarelay.xml new file mode 100644 index 000000000..bc1e2b966 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hakasitarelay.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hut.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hut.xml new file mode 100644 index 000000000..a4ef5715f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hut.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hylia_labo.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hylia_labo.xml new file mode 100644 index 000000000..829708604 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/hylia_labo.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/impa.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/impa.xml new file mode 100644 index 000000000..db757e3d3 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/impa.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kakariko.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kakariko.xml new file mode 100644 index 000000000..e4e9b102c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kakariko.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kenjyanoma.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kenjyanoma.xml new file mode 100644 index 000000000..e6bcef90a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kenjyanoma.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home.xml new file mode 100644 index 000000000..8c0305493 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home3.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home3.xml new file mode 100644 index 000000000..9f36eb41c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home3.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home4.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home4.xml new file mode 100644 index 000000000..eb861aedb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home4.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home5.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home5.xml new file mode 100644 index 000000000..974987fed --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/kokiri_home5.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/labo.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/labo.xml new file mode 100644 index 000000000..c0a9d2eb8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/labo.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/link_home.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/link_home.xml new file mode 100644 index 000000000..2fb88ae34 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/link_home.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/mahouya.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/mahouya.xml new file mode 100644 index 000000000..653cffc3b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/mahouya.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/malon_stable.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/malon_stable.xml new file mode 100644 index 000000000..aff97eeb8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/malon_stable.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/miharigoya.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/miharigoya.xml new file mode 100644 index 000000000..41ff2db9f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/miharigoya.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/nakaniwa.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/nakaniwa.xml new file mode 100644 index 000000000..49ff4a29c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/nakaniwa.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/syatekijyou.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/syatekijyou.xml new file mode 100644 index 000000000..5490e84f1 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/syatekijyou.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/takaraya.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/takaraya.xml new file mode 100644 index 000000000..ddee91543 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/takaraya.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/tent.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/tent.xml new file mode 100644 index 000000000..de72cc5f4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/tent.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/tokinoma.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/tokinoma.xml new file mode 100644 index 000000000..e43f0a933 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/tokinoma.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/yousei_izumi_tate.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/yousei_izumi_tate.xml new file mode 100644 index 000000000..990e1763b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/yousei_izumi_tate.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/yousei_izumi_yoko.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/yousei_izumi_yoko.xml new file mode 100644 index 000000000..98923c569 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/indoors/yousei_izumi_yoko.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/enrui.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/enrui.xml new file mode 100644 index 000000000..d8c06e545 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/enrui.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/entra_n.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/entra_n.xml new file mode 100644 index 000000000..5b408ac3a --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/entra_n.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana.xml new file mode 100644 index 000000000..b13273bed --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana2.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana2.xml new file mode 100644 index 000000000..146d0ce45 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana2.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana_ouke.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana_ouke.xml new file mode 100644 index 000000000..1d31d66a4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hakaana_ouke.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hiral_demo.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hiral_demo.xml new file mode 100644 index 000000000..1331fdd4c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/hiral_demo.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kakariko3.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kakariko3.xml new file mode 100644 index 000000000..07b62c44d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kakariko3.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kakusiana.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kakusiana.xml new file mode 100644 index 000000000..e4254b750 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kakusiana.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kinsuta.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kinsuta.xml new file mode 100644 index 000000000..d5dbacdb7 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/kinsuta.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_alley.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_alley.xml new file mode 100644 index 000000000..c30467303 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_alley.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_alley_n.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_alley_n.xml new file mode 100644 index 000000000..65db60411 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_alley_n.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_day.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_day.xml new file mode 100644 index 000000000..00887e69c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_day.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_night.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_night.xml new file mode 100644 index 000000000..c58e38744 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_night.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_ruins.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_ruins.xml new file mode 100644 index 000000000..f0ec75e75 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/market_ruins.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine.xml new file mode 100644 index 000000000..b9ddf2cf7 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine_n.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine_n.xml new file mode 100644 index 000000000..4878338aa --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine_n.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine_r.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine_r.xml new file mode 100644 index 000000000..122036791 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/shrine_r.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/turibori.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/turibori.xml new file mode 100644 index 000000000..ef6848edf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/misc/turibori.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/entra.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/entra.xml new file mode 100644 index 000000000..92ee57f59 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/entra.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/souko.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/souko.xml new file mode 100644 index 000000000..508beb85d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/souko.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot00.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot00.xml new file mode 100644 index 000000000..4e933910c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot00.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot01.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot01.xml new file mode 100644 index 000000000..e2da37e2d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot01.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot02.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot02.xml new file mode 100644 index 000000000..334d0e599 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot02.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot03.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot03.xml new file mode 100644 index 000000000..bf4039249 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot03.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot04.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot04.xml new file mode 100644 index 000000000..c5824727f --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot04.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot05.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot05.xml new file mode 100644 index 000000000..7c2c012bf --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot05.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot06.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot06.xml new file mode 100644 index 000000000..c369533bb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot06.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot07.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot07.xml new file mode 100644 index 000000000..e083e336d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot07.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot08.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot08.xml new file mode 100644 index 000000000..136727c6d --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot08.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot09.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot09.xml new file mode 100644 index 000000000..175fac890 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot09.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot10.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot10.xml new file mode 100644 index 000000000..06349cf1e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot10.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot11.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot11.xml new file mode 100644 index 000000000..99bf24c82 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot11.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot12.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot12.xml new file mode 100644 index 000000000..77b0cfb07 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot12.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot13.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot13.xml new file mode 100644 index 000000000..5686bbde5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot13.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot15.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot15.xml new file mode 100644 index 000000000..f17e76d55 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot15.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot16.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot16.xml new file mode 100644 index 000000000..026da9fd2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot16.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot17.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot17.xml new file mode 100644 index 000000000..3aecc15a6 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot17.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot18.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot18.xml new file mode 100644 index 000000000..513e67cbc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot18.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot20.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot20.xml new file mode 100644 index 000000000..b75f3f5c0 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/overworld/spot20.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/alley_shop.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/alley_shop.xml new file mode 100644 index 000000000..95548de1b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/alley_shop.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/drag.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/drag.xml new file mode 100644 index 000000000..acb6515fb --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/drag.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/face_shop.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/face_shop.xml new file mode 100644 index 000000000..16a974608 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/face_shop.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/golon.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/golon.xml new file mode 100644 index 000000000..c58672798 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/golon.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/kokiri_shop.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/kokiri_shop.xml new file mode 100644 index 000000000..50cd633e5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/kokiri_shop.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/night_shop.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/night_shop.xml new file mode 100644 index 000000000..5954d9c83 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/night_shop.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/shop1.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/shop1.xml new file mode 100644 index 000000000..525a06d63 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/shop1.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/zoora.xml b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/zoora.xml new file mode 100644 index 000000000..0e4ac18f8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/scenes/shops/zoora.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/text/elf_message_field.xml b/soh/assets/xml/GC_NMQ_PAL_F/text/elf_message_field.xml new file mode 100644 index 000000000..789a554ce --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/text/elf_message_field.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/soh/assets/xml/GC_NMQ_PAL_F/text/elf_message_ydan.xml b/soh/assets/xml/GC_NMQ_PAL_F/text/elf_message_ydan.xml new file mode 100644 index 000000000..f784afcf4 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/text/elf_message_ydan.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/soh/assets/xml/GC_NMQ_PAL_F/text/message_data_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/text/message_data_static.xml new file mode 100644 index 000000000..400a27e27 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/text/message_data_static.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/backgrounds.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/backgrounds.xml new file mode 100644 index 000000000..474734e71 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/backgrounds.xml @@ -0,0 +1,246 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/do_action_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/do_action_static.xml new file mode 100644 index 000000000..9ae8d9815 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/do_action_static.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_24_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_24_static.xml new file mode 100644 index 000000000..0c5f7621e --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_24_static.xml @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_dungeon_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_dungeon_static.xml new file mode 100644 index 000000000..873c490fc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_dungeon_static.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_field_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_field_static.xml new file mode 100644 index 000000000..ed991406b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_field_static.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_fra_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_fra_static.xml new file mode 100644 index 000000000..2c8ccad5b --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_fra_static.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_gameover_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_gameover_static.xml new file mode 100644 index 000000000..fc2a50642 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_gameover_static.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_ger_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_ger_static.xml new file mode 100644 index 000000000..ea71dda35 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_ger_static.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_nes_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_nes_static.xml new file mode 100644 index 000000000..6cd92acfc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_nes_static.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_static.xml new file mode 100644 index 000000000..7b61cf35c --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/icon_item_static.xml @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/item_name_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/item_name_static.xml new file mode 100644 index 000000000..00c497490 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/item_name_static.xml @@ -0,0 +1,373 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/map_48x85_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_48x85_static.xml new file mode 100644 index 000000000..b2ea46340 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_48x85_static.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/map_grand_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_grand_static.xml new file mode 100644 index 000000000..201955bfc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_grand_static.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/map_i_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_i_static.xml new file mode 100644 index 000000000..1721f6d84 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_i_static.xml @@ -0,0 +1,243 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/map_name_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_name_static.xml new file mode 100644 index 000000000..7f9d31589 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/map_name_static.xml @@ -0,0 +1,106 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/message_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/message_static.xml new file mode 100644 index 000000000..afdde60de --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/message_static.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/message_texture_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/message_texture_static.xml new file mode 100644 index 000000000..bbf7e1259 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/message_texture_static.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/nes_font_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/nes_font_static.xml new file mode 100644 index 000000000..b01646cb5 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/nes_font_static.xml @@ -0,0 +1,145 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/nintendo_rogo_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/nintendo_rogo_static.xml new file mode 100644 index 000000000..7a60524b2 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/nintendo_rogo_static.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/parameter_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/parameter_static.xml new file mode 100644 index 000000000..bd4173431 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/parameter_static.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/place_title_cards.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/place_title_cards.xml new file mode 100644 index 000000000..c1771d4c8 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/place_title_cards.xml @@ -0,0 +1,287 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/skyboxes.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/skyboxes.xml new file mode 100644 index 000000000..9ff554c94 --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/skyboxes.xml @@ -0,0 +1,113 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/GC_NMQ_PAL_F/textures/title_static.xml b/soh/assets/xml/GC_NMQ_PAL_F/textures/title_static.xml new file mode 100644 index 000000000..422b60cdc --- /dev/null +++ b/soh/assets/xml/GC_NMQ_PAL_F/textures/title_static.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/xml/text/nes_message_data_static.xml b/soh/assets/xml/text/nes_message_data_static.xml deleted file mode 100644 index d7c0559c5..000000000 --- a/soh/assets/xml/text/nes_message_data_static.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/soh/assets/xml/text/staff_message_data_static.xml b/soh/assets/xml/text/staff_message_data_static.xml deleted file mode 100644 index 447b91ccd..000000000 --- a/soh/assets/xml/text/staff_message_data_static.xml +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/soh/build.c b/soh/build.c deleted file mode 100644 index acb8d151d..000000000 --- a/soh/build.c +++ /dev/null @@ -1,8 +0,0 @@ -const char gBuildVersion[] = "DECKARD"; -const char gBuildTeam[] = "github.com/harbourmasters"; -#ifdef __TIMESTAMP__ -const char gBuildDate[] = __TIMESTAMP__; -#else -const char gBuildDate[] = __DATE__ " " __TIME__; -#endif -const char gBuildMakeOption[] = ""; \ No newline at end of file diff --git a/soh/extract_baserom.py b/soh/extract_baserom.py deleted file mode 100755 index a3eb83a8f..000000000 --- a/soh/extract_baserom.py +++ /dev/null @@ -1,1608 +0,0 @@ -#!/usr/bin/python3 - -import os -import sys -import struct -from multiprocessing import Pool, cpu_count - - -ROM_FILE_NAME = 'baserom_non_mq.z64' -FILE_TABLE_OFFSET = 0x12F70 - -FILE_NAMES = [ - 'makerom', - 'boot', - 'dmadata', - 'Audiobank', - 'Audioseq', - 'Audiotable', - 'link_animetion', - 'icon_item_static', - 'icon_item_24_static', - 'icon_item_field_static', - 'icon_item_dungeon_static', - 'icon_item_gameover_static', - 'icon_item_nes_static', - 'icon_item_ger_static', - 'icon_item_fra_static', - 'item_name_static', - 'map_name_static', - 'do_action_static', - 'message_static', - 'message_texture_static', - 'nes_font_static', - 'nes_message_data_static', - 'ger_message_data_static', - 'fra_message_data_static', - 'staff_message_data_static', - 'map_grand_static', - 'map_i_static', - 'map_48x85_static', - 'code', - 'ovl_title', - 'ovl_select', - 'ovl_opening', - 'ovl_file_choose', - 'ovl_kaleido_scope', - 'ovl_player_actor', - 'ovl_map_mark_data', - 'ovl_En_Test', - 'ovl_Arms_Hook', - 'ovl_Arrow_Fire', - 'ovl_Arrow_Ice', - 'ovl_Arrow_Light', - 'ovl_Bg_Bdan_Objects', - 'ovl_Bg_Bdan_Switch', - 'ovl_Bg_Bom_Guard', - 'ovl_Bg_Bombwall', - 'ovl_Bg_Bowl_Wall', - 'ovl_Bg_Breakwall', - 'ovl_Bg_Ddan_Jd', - 'ovl_Bg_Ddan_Kd', - 'ovl_Bg_Dodoago', - 'ovl_Bg_Dy_Yoseizo', - 'ovl_Bg_Ganon_Otyuka', - 'ovl_Bg_Gate_Shutter', - 'ovl_Bg_Gjyo_Bridge', - 'ovl_Bg_Gnd_Darkmeiro', - 'ovl_Bg_Gnd_Firemeiro', - 'ovl_Bg_Gnd_Iceblock', - 'ovl_Bg_Gnd_Nisekabe', - 'ovl_Bg_Gnd_Soulmeiro', - 'ovl_Bg_Haka', - 'ovl_Bg_Haka_Gate', - 'ovl_Bg_Haka_Huta', - 'ovl_Bg_Haka_Megane', - 'ovl_Bg_Haka_MeganeBG', - 'ovl_Bg_Haka_Sgami', - 'ovl_Bg_Haka_Ship', - 'ovl_Bg_Haka_Trap', - 'ovl_Bg_Haka_Tubo', - 'ovl_Bg_Haka_Water', - 'ovl_Bg_Haka_Zou', - 'ovl_Bg_Heavy_Block', - 'ovl_Bg_Hidan_Curtain', - 'ovl_Bg_Hidan_Dalm', - 'ovl_Bg_Hidan_Firewall', - 'ovl_Bg_Hidan_Fslift', - 'ovl_Bg_Hidan_Fwbig', - 'ovl_Bg_Hidan_Hamstep', - 'ovl_Bg_Hidan_Hrock', - 'ovl_Bg_Hidan_Kousi', - 'ovl_Bg_Hidan_Kowarerukabe', - 'ovl_Bg_Hidan_Rock', - 'ovl_Bg_Hidan_Rsekizou', - 'ovl_Bg_Hidan_Sekizou', - 'ovl_Bg_Hidan_Sima', - 'ovl_Bg_Hidan_Syoku', - 'ovl_Bg_Ice_Objects', - 'ovl_Bg_Ice_Shelter', - 'ovl_Bg_Ice_Shutter', - 'ovl_Bg_Ice_Turara', - 'ovl_Bg_Ingate', - 'ovl_Bg_Jya_1flift', - 'ovl_Bg_Jya_Amishutter', - 'ovl_Bg_Jya_Bigmirror', - 'ovl_Bg_Jya_Block', - 'ovl_Bg_Jya_Bombchuiwa', - 'ovl_Bg_Jya_Bombiwa', - 'ovl_Bg_Jya_Cobra', - 'ovl_Bg_Jya_Goroiwa', - 'ovl_Bg_Jya_Haheniron', - 'ovl_Bg_Jya_Ironobj', - 'ovl_Bg_Jya_Kanaami', - 'ovl_Bg_Jya_Lift', - 'ovl_Bg_Jya_Megami', - 'ovl_Bg_Jya_Zurerukabe', - 'ovl_Bg_Menkuri_Eye', - 'ovl_Bg_Menkuri_Kaiten', - 'ovl_Bg_Menkuri_Nisekabe', - 'ovl_Bg_Mizu_Bwall', - 'ovl_Bg_Mizu_Movebg', - 'ovl_Bg_Mizu_Shutter', - 'ovl_Bg_Mizu_Uzu', - 'ovl_Bg_Mizu_Water', - 'ovl_Bg_Mjin', - 'ovl_Bg_Mori_Bigst', - 'ovl_Bg_Mori_Elevator', - 'ovl_Bg_Mori_Hashigo', - 'ovl_Bg_Mori_Hashira4', - 'ovl_Bg_Mori_Hineri', - 'ovl_Bg_Mori_Idomizu', - 'ovl_Bg_Mori_Kaitenkabe', - 'ovl_Bg_Mori_Rakkatenjo', - 'ovl_Bg_Po_Event', - 'ovl_Bg_Po_Syokudai', - 'ovl_Bg_Pushbox', - 'ovl_Bg_Relay_Objects', - 'ovl_Bg_Spot00_Break', - 'ovl_Bg_Spot00_Hanebasi', - 'ovl_Bg_Spot01_Fusya', - 'ovl_Bg_Spot01_Idohashira', - 'ovl_Bg_Spot01_Idomizu', - 'ovl_Bg_Spot01_Idosoko', - 'ovl_Bg_Spot01_Objects2', - 'ovl_Bg_Spot02_Objects', - 'ovl_Bg_Spot03_Taki', - 'ovl_Bg_Spot05_Soko', - 'ovl_Bg_Spot06_Objects', - 'ovl_Bg_Spot07_Taki', - 'ovl_Bg_Spot08_Bakudankabe', - 'ovl_Bg_Spot08_Iceblock', - 'ovl_Bg_Spot09_Obj', - 'ovl_Bg_Spot11_Bakudankabe', - 'ovl_Bg_Spot11_Oasis', - 'ovl_Bg_Spot12_Gate', - 'ovl_Bg_Spot12_Saku', - 'ovl_Bg_Spot15_Rrbox', - 'ovl_Bg_Spot15_Saku', - 'ovl_Bg_Spot16_Bombstone', - 'ovl_Bg_Spot16_Doughnut', - 'ovl_Bg_Spot17_Bakudankabe', - 'ovl_Bg_Spot17_Funen', - 'ovl_Bg_Spot18_Basket', - 'ovl_Bg_Spot18_Futa', - 'ovl_Bg_Spot18_Obj', - 'ovl_Bg_Spot18_Shutter', - 'ovl_Bg_Sst_Floor', - 'ovl_Bg_Toki_Hikari', - 'ovl_Bg_Toki_Swd', - 'ovl_Bg_Treemouth', - 'ovl_Bg_Umajump', - 'ovl_Bg_Vb_Sima', - 'ovl_Bg_Ydan_Hasi', - 'ovl_Bg_Ydan_Maruta', - 'ovl_Bg_Ydan_Sp', - 'ovl_Bg_Zg', - 'ovl_Boss_Dodongo', - 'ovl_Boss_Fd', - 'ovl_Boss_Fd2', - 'ovl_Boss_Ganon', - 'ovl_Boss_Ganon2', - 'ovl_Boss_Ganondrof', - 'ovl_Boss_Goma', - 'ovl_Boss_Mo', - 'ovl_Boss_Sst', - 'ovl_Boss_Tw', - 'ovl_Boss_Va', - 'ovl_Demo_6K', - 'ovl_Demo_Du', - 'ovl_Demo_Ec', - 'ovl_Demo_Effect', - 'ovl_Demo_Ext', - 'ovl_Demo_Geff', - 'ovl_Demo_Gj', - 'ovl_Demo_Go', - 'ovl_Demo_Gt', - 'ovl_Demo_Ik', - 'ovl_Demo_Im', - 'ovl_Demo_Kankyo', - 'ovl_Demo_Kekkai', - 'ovl_Demo_Sa', - 'ovl_Demo_Shd', - 'ovl_Demo_Tre_Lgt', - 'ovl_Door_Ana', - 'ovl_Door_Gerudo', - 'ovl_Door_Killer', - 'ovl_Door_Shutter', - 'ovl_Door_Toki', - 'ovl_Door_Warp1', - 'ovl_Efc_Erupc', - 'ovl_Eff_Dust', - 'ovl_Effect_Ss_Blast', - 'ovl_Effect_Ss_Bomb', - 'ovl_Effect_Ss_Bomb2', - 'ovl_Effect_Ss_Bubble', - 'ovl_Effect_Ss_D_Fire', - 'ovl_Effect_Ss_Dead_Db', - 'ovl_Effect_Ss_Dead_Dd', - 'ovl_Effect_Ss_Dead_Ds', - 'ovl_Effect_Ss_Dead_Sound', - 'ovl_Effect_Ss_Dt_Bubble', - 'ovl_Effect_Ss_Dust', - 'ovl_Effect_Ss_En_Fire', - 'ovl_Effect_Ss_En_Ice', - 'ovl_Effect_Ss_Extra', - 'ovl_Effect_Ss_Fcircle', - 'ovl_Effect_Ss_Fhg_Flash', - 'ovl_Effect_Ss_Fire_Tail', - 'ovl_Effect_Ss_G_Fire', - 'ovl_Effect_Ss_G_Magma', - 'ovl_Effect_Ss_G_Magma2', - 'ovl_Effect_Ss_G_Ripple', - 'ovl_Effect_Ss_G_Spk', - 'ovl_Effect_Ss_G_Splash', - 'ovl_Effect_Ss_Hahen', - 'ovl_Effect_Ss_HitMark', - 'ovl_Effect_Ss_Ice_Piece', - 'ovl_Effect_Ss_Ice_Smoke', - 'ovl_Effect_Ss_K_Fire', - 'ovl_Effect_Ss_Kakera', - 'ovl_Effect_Ss_KiraKira', - 'ovl_Effect_Ss_Lightning', - 'ovl_Effect_Ss_Sibuki', - 'ovl_Effect_Ss_Sibuki2', - 'ovl_Effect_Ss_Solder_Srch_Ball', - 'ovl_Effect_Ss_Stick', - 'ovl_Effect_Ss_Stone1', - 'ovl_Elf_Msg', - 'ovl_Elf_Msg2', - 'ovl_En_Am', - 'ovl_En_Ani', - 'ovl_En_Anubice', - 'ovl_En_Anubice_Fire', - 'ovl_En_Anubice_Tag', - 'ovl_En_Arow_Trap', - 'ovl_En_Arrow', - 'ovl_En_Attack_Niw', - 'ovl_En_Ba', - 'ovl_En_Bb', - 'ovl_En_Bdfire', - 'ovl_En_Bigokuta', - 'ovl_En_Bili', - 'ovl_En_Bird', - 'ovl_En_Blkobj', - 'ovl_En_Bom', - 'ovl_En_Bom_Bowl_Man', - 'ovl_En_Bom_Bowl_Pit', - 'ovl_En_Bom_Chu', - 'ovl_En_Bombf', - 'ovl_En_Boom', - 'ovl_En_Box', - 'ovl_En_Brob', - 'ovl_En_Bubble', - 'ovl_En_Butte', - 'ovl_En_Bw', - 'ovl_En_Bx', - 'ovl_En_Changer', - 'ovl_En_Clear_Tag', - 'ovl_En_Cow', - 'ovl_En_Crow', - 'ovl_En_Cs', - 'ovl_En_Daiku', - 'ovl_En_Daiku_Kakariko', - 'ovl_En_Dekubaba', - 'ovl_En_Dekunuts', - 'ovl_En_Dh', - 'ovl_En_Dha', - 'ovl_En_Diving_Game', - 'ovl_En_Dns', - 'ovl_En_Dnt_Demo', - 'ovl_En_Dnt_Jiji', - 'ovl_En_Dnt_Nomal', - 'ovl_En_Dodojr', - 'ovl_En_Dodongo', - 'ovl_En_Dog', - 'ovl_En_Door', - 'ovl_En_Ds', - 'ovl_En_Du', - 'ovl_En_Dy_Extra', - 'ovl_En_Eg', - 'ovl_En_Eiyer', - 'ovl_En_Elf', - 'ovl_En_Encount1', - 'ovl_En_Encount2', - 'ovl_En_Ex_Item', - 'ovl_En_Ex_Ruppy', - 'ovl_En_Fd', - 'ovl_En_Fd_Fire', - 'ovl_En_Fhg_Fire', - 'ovl_En_Fire_Rock', - 'ovl_En_Firefly', - 'ovl_En_Fish', - 'ovl_En_Floormas', - 'ovl_En_Fr', - 'ovl_En_Fu', - 'ovl_En_Fw', - 'ovl_En_Fz', - 'ovl_En_G_Switch', - 'ovl_En_Ganon_Mant', - 'ovl_En_Ganon_Organ', - 'ovl_En_Gb', - 'ovl_En_Ge1', - 'ovl_En_Ge2', - 'ovl_En_Ge3', - 'ovl_En_GeldB', - 'ovl_En_GirlA', - 'ovl_En_Gm', - 'ovl_En_Go', - 'ovl_En_Go2', - 'ovl_En_Goma', - 'ovl_En_Goroiwa', - 'ovl_En_Gs', - 'ovl_En_Guest', - 'ovl_En_Hata', - 'ovl_En_Heishi1', - 'ovl_En_Heishi2', - 'ovl_En_Heishi3', - 'ovl_En_Heishi4', - 'ovl_En_Hintnuts', - 'ovl_En_Holl', - 'ovl_En_Honotrap', - 'ovl_En_Horse', - 'ovl_En_Horse_Game_Check', - 'ovl_En_Horse_Ganon', - 'ovl_En_Horse_Link_Child', - 'ovl_En_Horse_Normal', - 'ovl_En_Horse_Zelda', - 'ovl_En_Hs', - 'ovl_En_Hs2', - 'ovl_En_Hy', - 'ovl_En_Ice_Hono', - 'ovl_En_Ik', - 'ovl_En_In', - 'ovl_En_Insect', - 'ovl_En_Ishi', - 'ovl_En_It', - 'ovl_En_Jj', - 'ovl_En_Js', - 'ovl_En_Jsjutan', - 'ovl_En_Kakasi', - 'ovl_En_Kakasi2', - 'ovl_En_Kakasi3', - 'ovl_En_Kanban', - 'ovl_En_Karebaba', - 'ovl_En_Ko', - 'ovl_En_Kusa', - 'ovl_En_Kz', - 'ovl_En_Light', - 'ovl_En_Lightbox', - 'ovl_En_M_Fire1', - 'ovl_En_M_Thunder', - 'ovl_En_Ma1', - 'ovl_En_Ma2', - 'ovl_En_Ma3', - 'ovl_En_Mag', - 'ovl_En_Mb', - 'ovl_En_Md', - 'ovl_En_Mk', - 'ovl_En_Mm', - 'ovl_En_Mm2', - 'ovl_En_Ms', - 'ovl_En_Mu', - 'ovl_En_Nb', - 'ovl_En_Niw', - 'ovl_En_Niw_Girl', - 'ovl_En_Niw_Lady', - 'ovl_En_Nutsball', - 'ovl_En_Nwc', - 'ovl_En_Ny', - 'ovl_En_OE2', - 'ovl_En_Okarina_Effect', - 'ovl_En_Okarina_Tag', - 'ovl_En_Okuta', - 'ovl_En_Ossan', - 'ovl_En_Owl', - 'ovl_En_Part', - 'ovl_En_Peehat', - 'ovl_En_Po_Desert', - 'ovl_En_Po_Field', - 'ovl_En_Po_Relay', - 'ovl_En_Po_Sisters', - 'ovl_En_Poh', - 'ovl_En_Pu_box', - 'ovl_En_Rd', - 'ovl_En_Reeba', - 'ovl_En_River_Sound', - 'ovl_En_Rl', - 'ovl_En_Rr', - 'ovl_En_Ru1', - 'ovl_En_Ru2', - 'ovl_En_Sa', - 'ovl_En_Sb', - 'ovl_En_Scene_Change', - 'ovl_En_Sda', - 'ovl_En_Shopnuts', - 'ovl_En_Si', - 'ovl_En_Siofuki', - 'ovl_En_Skb', - 'ovl_En_Skj', - 'ovl_En_Skjneedle', - 'ovl_En_Ssh', - 'ovl_En_St', - 'ovl_En_Sth', - 'ovl_En_Stream', - 'ovl_En_Sw', - 'ovl_En_Syateki_Itm', - 'ovl_En_Syateki_Man', - 'ovl_En_Syateki_Niw', - 'ovl_En_Ta', - 'ovl_En_Takara_Man', - 'ovl_En_Tana', - 'ovl_En_Tg', - 'ovl_En_Tite', - 'ovl_En_Tk', - 'ovl_En_Torch', - 'ovl_En_Torch2', - 'ovl_En_Toryo', - 'ovl_En_Tp', - 'ovl_En_Tr', - 'ovl_En_Trap', - 'ovl_En_Tubo_Trap', - 'ovl_En_Vali', - 'ovl_En_Vase', - 'ovl_En_Vb_Ball', - 'ovl_En_Viewer', - 'ovl_En_Vm', - 'ovl_En_Wall_Tubo', - 'ovl_En_Wallmas', - 'ovl_En_Weather_Tag', - 'ovl_En_Weiyer', - 'ovl_En_Wf', - 'ovl_En_Wonder_Item', - 'ovl_En_Wonder_Talk', - 'ovl_En_Wonder_Talk2', - 'ovl_En_Wood02', - 'ovl_En_Xc', - 'ovl_En_Yabusame_Mark', - 'ovl_En_Yukabyun', - 'ovl_En_Zf', - 'ovl_En_Zl1', - 'ovl_En_Zl2', - 'ovl_En_Zl3', - 'ovl_En_Zl4', - 'ovl_En_Zo', - 'ovl_En_fHG', - 'ovl_End_Title', - 'ovl_Fishing', - 'ovl_Item_B_Heart', - 'ovl_Item_Etcetera', - 'ovl_Item_Inbox', - 'ovl_Item_Ocarina', - 'ovl_Item_Shield', - 'ovl_Magic_Dark', - 'ovl_Magic_Fire', - 'ovl_Magic_Wind', - 'ovl_Mir_Ray', - 'ovl_Obj_Bean', - 'ovl_Obj_Blockstop', - 'ovl_Obj_Bombiwa', - 'ovl_Obj_Comb', - 'ovl_Obj_Dekujr', - 'ovl_Obj_Elevator', - 'ovl_Obj_Hamishi', - 'ovl_Obj_Hana', - 'ovl_Obj_Hsblock', - 'ovl_Obj_Ice_Poly', - 'ovl_Obj_Kibako', - 'ovl_Obj_Kibako2', - 'ovl_Obj_Lift', - 'ovl_Obj_Lightswitch', - 'ovl_Obj_Makekinsuta', - 'ovl_Obj_Makeoshihiki', - 'ovl_Obj_Mure', - 'ovl_Obj_Mure2', - 'ovl_Obj_Mure3', - 'ovl_Obj_Oshihiki', - 'ovl_Obj_Roomtimer', - 'ovl_Obj_Switch', - 'ovl_Obj_Syokudai', - 'ovl_Obj_Timeblock', - 'ovl_Obj_Tsubo', - 'ovl_Obj_Warp2block', - 'ovl_Object_Kankyo', - 'ovl_Oceff_Spot', - 'ovl_Oceff_Storm', - 'ovl_Oceff_Wipe', - 'ovl_Oceff_Wipe2', - 'ovl_Oceff_Wipe3', - 'ovl_Oceff_Wipe4', - 'ovl_Shot_Sun', - 'gameplay_keep', - 'gameplay_field_keep', - 'gameplay_dangeon_keep', - 'gameplay_object_exchange_static', - 'object_link_boy', - 'object_link_child', - 'object_box', - 'object_human', - 'object_okuta', - 'object_poh', - 'object_wallmaster', - 'object_dy_obj', - 'object_firefly', - 'object_dodongo', - 'object_fire', - 'object_niw', - 'object_tite', - 'object_reeba', - 'object_peehat', - 'object_kingdodongo', - 'object_horse', - 'object_zf', - 'object_goma', - 'object_zl1', - 'object_gol', - 'object_bubble', - 'object_dodojr', - 'object_torch2', - 'object_bl', - 'object_tp', - 'object_oA1', - 'object_st', - 'object_bw', - 'object_ei', - 'object_horse_normal', - 'object_oB1', - 'object_o_anime', - 'object_spot04_objects', - 'object_ddan_objects', - 'object_hidan_objects', - 'object_horse_ganon', - 'object_oA2', - 'object_spot00_objects', - 'object_mb', - 'object_bombf', - 'object_sk2', - 'object_oE1', - 'object_oE_anime', - 'object_oE2', - 'object_ydan_objects', - 'object_gnd', - 'object_am', - 'object_dekubaba', - 'object_oA3', - 'object_oA4', - 'object_oA5', - 'object_oA6', - 'object_oA7', - 'object_jj', - 'object_oA8', - 'object_oA9', - 'object_oB2', - 'object_oB3', - 'object_oB4', - 'object_horse_zelda', - 'object_opening_demo1', - 'object_warp1', - 'object_b_heart', - 'object_dekunuts', - 'object_oE3', - 'object_oE4', - 'object_menkuri_objects', - 'object_oE5', - 'object_oE6', - 'object_oE7', - 'object_oE8', - 'object_oE9', - 'object_oE10', - 'object_oE11', - 'object_oE12', - 'object_vali', - 'object_oA10', - 'object_oA11', - 'object_mizu_objects', - 'object_fhg', - 'object_ossan', - 'object_mori_hineri1', - 'object_Bb', - 'object_toki_objects', - 'object_yukabyun', - 'object_zl2', - 'object_mjin', - 'object_mjin_flash', - 'object_mjin_dark', - 'object_mjin_flame', - 'object_mjin_ice', - 'object_mjin_soul', - 'object_mjin_wind', - 'object_mjin_oka', - 'object_haka_objects', - 'object_spot06_objects', - 'object_ice_objects', - 'object_relay_objects', - 'object_mori_hineri1a', - 'object_mori_hineri2', - 'object_mori_hineri2a', - 'object_mori_objects', - 'object_mori_tex', - 'object_spot08_obj', - 'object_warp2', - 'object_hata', - 'object_bird', - 'object_wood02', - 'object_lightbox', - 'object_pu_box', - 'object_trap', - 'object_vase', - 'object_im', - 'object_ta', - 'object_tk', - 'object_xc', - 'object_vm', - 'object_bv', - 'object_hakach_objects', - 'object_efc_crystal_light', - 'object_efc_fire_ball', - 'object_efc_flash', - 'object_efc_lgt_shower', - 'object_efc_star_field', - 'object_god_lgt', - 'object_light_ring', - 'object_triforce_spot', - 'object_medal', - 'object_bdan_objects', - 'object_sd', - 'object_rd', - 'object_po_sisters', - 'object_heavy_object', - 'object_gndd', - 'object_fd', - 'object_du', - 'object_fw', - 'object_horse_link_child', - 'object_spot02_objects', - 'object_haka', - 'object_ru1', - 'object_syokudai', - 'object_fd2', - 'object_dh', - 'object_rl', - 'object_efc_tw', - 'object_demo_tre_lgt', - 'object_gi_key', - 'object_mir_ray', - 'object_brob', - 'object_gi_jewel', - 'object_spot09_obj', - 'object_spot18_obj', - 'object_bdoor', - 'object_spot17_obj', - 'object_shop_dungen', - 'object_nb', - 'object_mo', - 'object_sb', - 'object_gi_melody', - 'object_gi_heart', - 'object_gi_compass', - 'object_gi_bosskey', - 'object_gi_medal', - 'object_gi_nuts', - 'object_sa', - 'object_gi_hearts', - 'object_gi_arrowcase', - 'object_gi_bombpouch', - 'object_in', - 'object_tr', - 'object_spot16_obj', - 'object_oE1s', - 'object_oE4s', - 'object_os_anime', - 'object_gi_bottle', - 'object_gi_stick', - 'object_gi_map', - 'object_oF1d_map', - 'object_ru2', - 'object_gi_shield_1', - 'object_dekujr', - 'object_gi_magicpot', - 'object_gi_bomb_1', - 'object_oF1s', - 'object_ma2', - 'object_gi_purse', - 'object_hni', - 'object_tw', - 'object_rr', - 'object_bxa', - 'object_anubice', - 'object_gi_gerudo', - 'object_gi_arrow', - 'object_gi_bomb_2', - 'object_gi_egg', - 'object_gi_scale', - 'object_gi_shield_2', - 'object_gi_hookshot', - 'object_gi_ocarina', - 'object_gi_milk', - 'object_ma1', - 'object_ganon', - 'object_sst', - 'object_ny', - 'object_fr', - 'object_gi_pachinko', - 'object_gi_boomerang', - 'object_gi_bow', - 'object_gi_glasses', - 'object_gi_liquid', - 'object_ani', - 'object_demo_6k', - 'object_gi_shield_3', - 'object_gi_letter', - 'object_spot15_obj', - 'object_jya_obj', - 'object_gi_clothes', - 'object_gi_bean', - 'object_gi_fish', - 'object_gi_saw', - 'object_gi_hammer', - 'object_gi_grass', - 'object_gi_longsword', - 'object_spot01_objects', - 'object_md', - 'object_km1', - 'object_kw1', - 'object_zo', - 'object_kz', - 'object_umajump', - 'object_masterkokiri', - 'object_masterkokirihead', - 'object_mastergolon', - 'object_masterzoora', - 'object_aob', - 'object_ik', - 'object_ahg', - 'object_cne', - 'object_gi_niwatori', - 'object_skj', - 'object_gi_bottle_letter', - 'object_bji', - 'object_bba', - 'object_gi_ocarina_0', - 'object_ds', - 'object_ane', - 'object_boj', - 'object_spot03_object', - 'object_spot07_object', - 'object_fz', - 'object_bob', - 'object_ge1', - 'object_yabusame_point', - 'object_gi_boots_2', - 'object_gi_seed', - 'object_gnd_magic', - 'object_d_elevator', - 'object_d_hsblock', - 'object_d_lift', - 'object_mamenoki', - 'object_goroiwa', - 'object_toryo', - 'object_daiku', - 'object_nwc', - 'object_blkobj', - 'object_gm', - 'object_ms', - 'object_hs', - 'object_ingate', - 'object_lightswitch', - 'object_kusa', - 'object_tsubo', - 'object_gi_gloves', - 'object_gi_coin', - 'object_kanban', - 'object_gjyo_objects', - 'object_owl', - 'object_mk', - 'object_fu', - 'object_gi_ki_tan_mask', - 'object_gi_redead_mask', - 'object_gi_skj_mask', - 'object_gi_rabit_mask', - 'object_gi_truth_mask', - 'object_ganon_objects', - 'object_siofuki', - 'object_stream', - 'object_mm', - 'object_fa', - 'object_os', - 'object_gi_eye_lotion', - 'object_gi_powder', - 'object_gi_mushroom', - 'object_gi_ticketstone', - 'object_gi_brokensword', - 'object_js', - 'object_cs', - 'object_gi_prescription', - 'object_gi_bracelet', - 'object_gi_soldout', - 'object_gi_frog', - 'object_mag', - 'object_door_gerudo', - 'object_gt', - 'object_efc_erupc', - 'object_zl2_anime1', - 'object_zl2_anime2', - 'object_gi_golonmask', - 'object_gi_zoramask', - 'object_gi_gerudomask', - 'object_ganon2', - 'object_ka', - 'object_ts', - 'object_zg', - 'object_gi_hoverboots', - 'object_gi_m_arrow', - 'object_ds2', - 'object_ec', - 'object_fish', - 'object_gi_sutaru', - 'object_gi_goddess', - 'object_ssh', - 'object_bigokuta', - 'object_bg', - 'object_spot05_objects', - 'object_spot12_obj', - 'object_bombiwa', - 'object_hintnuts', - 'object_rs', - 'object_spot00_break', - 'object_gla', - 'object_shopnuts', - 'object_geldb', - 'object_gr', - 'object_dog', - 'object_jya_iron', - 'object_jya_door', - 'object_spot01_objects2', - 'object_spot11_obj', - 'object_kibako2', - 'object_dns', - 'object_dnk', - 'object_gi_fire', - 'object_gi_insect', - 'object_gi_butterfly', - 'object_gi_ghost', - 'object_gi_soul', - 'object_bowl', - 'object_po_field', - 'object_demo_kekkai', - 'object_efc_doughnut', - 'object_gi_dekupouch', - 'object_ganon_anime1', - 'object_ganon_anime2', - 'object_ganon_anime3', - 'object_gi_rupy', - 'object_spot01_matoya', - 'object_spot01_matoyab', - 'object_po_composer', - 'object_mu', - 'object_wf', - 'object_skb', - 'object_gj', - 'object_geff', - 'object_haka_door', - 'object_gs', - 'object_ps', - 'object_bwall', - 'object_crow', - 'object_cow', - 'object_cob', - 'object_gi_sword_1', - 'object_door_killer', - 'object_ouke_haka', - 'object_timeblock', - 'object_zl4', - 'g_pn_01', - 'g_pn_02', - 'g_pn_03', - 'g_pn_04', - 'g_pn_05', - 'g_pn_06', - 'g_pn_07', - 'g_pn_08', - 'g_pn_09', - 'g_pn_10', - 'g_pn_11', - 'g_pn_12', - 'g_pn_13', - 'g_pn_14', - 'g_pn_15', - 'g_pn_16', - 'g_pn_17', - 'g_pn_18', - 'g_pn_19', - 'g_pn_20', - 'g_pn_21', - 'g_pn_22', - 'g_pn_23', - 'g_pn_24', - 'g_pn_25', - 'g_pn_26', - 'g_pn_27', - 'g_pn_28', - 'g_pn_29', - 'g_pn_30', - 'g_pn_31', - 'g_pn_32', - 'g_pn_33', - 'g_pn_34', - 'g_pn_35', - 'g_pn_36', - 'g_pn_37', - 'g_pn_38', - 'g_pn_39', - 'g_pn_40', - 'g_pn_41', - 'g_pn_42', - 'g_pn_43', - 'g_pn_44', - 'g_pn_45', - 'g_pn_46', - 'g_pn_47', - 'g_pn_48', - 'g_pn_49', - 'g_pn_50', - 'g_pn_51', - 'g_pn_52', - 'g_pn_53', - 'g_pn_54', - 'g_pn_55', - 'g_pn_56', - 'g_pn_57', - 'z_select_static', - 'nintendo_rogo_static', - 'title_static', - 'parameter_static', - 'vr_fine0_static', - 'vr_fine0_pal_static', - 'vr_fine1_static', - 'vr_fine1_pal_static', - 'vr_fine2_static', - 'vr_fine2_pal_static', - 'vr_fine3_static', - 'vr_fine3_pal_static', - 'vr_cloud0_static', - 'vr_cloud0_pal_static', - 'vr_cloud1_static', - 'vr_cloud1_pal_static', - 'vr_cloud2_static', - 'vr_cloud2_pal_static', - 'vr_cloud3_static', - 'vr_cloud3_pal_static', - 'vr_holy0_static', - 'vr_holy0_pal_static', - 'vr_holy1_static', - 'vr_holy1_pal_static', - 'vr_MDVR_static', - 'vr_MDVR_pal_static', - 'vr_MNVR_static', - 'vr_MNVR_pal_static', - 'vr_RUVR_static', - 'vr_RUVR_pal_static', - 'vr_LHVR_static', - 'vr_LHVR_pal_static', - 'vr_KHVR_static', - 'vr_KHVR_pal_static', - 'vr_K3VR_static', - 'vr_K3VR_pal_static', - 'vr_K4VR_static', - 'vr_K4VR_pal_static', - 'vr_K5VR_static', - 'vr_K5VR_pal_static', - 'vr_SP1a_static', - 'vr_SP1a_pal_static', - 'vr_MLVR_static', - 'vr_MLVR_pal_static', - 'vr_KKRVR_static', - 'vr_KKRVR_pal_static', - 'vr_KR3VR_static', - 'vr_KR3VR_pal_static', - 'vr_IPVR_static', - 'vr_IPVR_pal_static', - 'vr_KSVR_static', - 'vr_KSVR_pal_static', - 'vr_GLVR_static', - 'vr_GLVR_pal_static', - 'vr_ZRVR_static', - 'vr_ZRVR_pal_static', - 'vr_DGVR_static', - 'vr_DGVR_pal_static', - 'vr_ALVR_static', - 'vr_ALVR_pal_static', - 'vr_NSVR_static', - 'vr_NSVR_pal_static', - 'vr_LBVR_static', - 'vr_LBVR_pal_static', - 'vr_TTVR_static', - 'vr_TTVR_pal_static', - 'vr_FCVR_static', - 'vr_FCVR_pal_static', - 'elf_message_field', - 'elf_message_ydan', - 'syotes_scene', - 'syotes_room_0', - 'syotes2_scene', - 'syotes2_room_0', - 'depth_test_scene', - 'depth_test_room_0', - 'spot00_scene', - 'spot00_room_0', - 'spot01_scene', - 'spot01_room_0', - 'spot02_scene', - 'spot02_room_0', - 'spot02_room_1', - 'spot03_scene', - 'spot03_room_0', - 'spot03_room_1', - 'spot04_scene', - 'spot04_room_0', - 'spot04_room_1', - 'spot04_room_2', - 'spot05_scene', - 'spot05_room_0', - 'spot06_scene', - 'spot06_room_0', - 'spot07_scene', - 'spot07_room_0', - 'spot07_room_1', - 'spot08_scene', - 'spot08_room_0', - 'spot09_scene', - 'spot09_room_0', - 'spot10_scene', - 'spot10_room_0', - 'spot10_room_1', - 'spot10_room_2', - 'spot10_room_3', - 'spot10_room_4', - 'spot10_room_5', - 'spot10_room_6', - 'spot10_room_7', - 'spot10_room_8', - 'spot10_room_9', - 'spot11_scene', - 'spot11_room_0', - 'spot12_scene', - 'spot12_room_0', - 'spot12_room_1', - 'spot13_scene', - 'spot13_room_0', - 'spot13_room_1', - 'spot15_scene', - 'spot15_room_0', - 'spot16_scene', - 'spot16_room_0', - 'spot17_scene', - 'spot17_room_0', - 'spot17_room_1', - 'spot18_scene', - 'spot18_room_0', - 'spot18_room_1', - 'spot18_room_2', - 'spot18_room_3', - 'ydan_scene', - 'ydan_room_0', - 'ydan_room_1', - 'ydan_room_2', - 'ydan_room_3', - 'ydan_room_4', - 'ydan_room_5', - 'ydan_room_6', - 'ydan_room_7', - 'ydan_room_8', - 'ydan_room_9', - 'ydan_room_10', - 'ydan_room_11', - 'ddan_scene', - 'ddan_room_0', - 'ddan_room_1', - 'ddan_room_2', - 'ddan_room_3', - 'ddan_room_4', - 'ddan_room_5', - 'ddan_room_6', - 'ddan_room_7', - 'ddan_room_8', - 'ddan_room_9', - 'ddan_room_10', - 'ddan_room_11', - 'ddan_room_12', - 'ddan_room_13', - 'ddan_room_14', - 'ddan_room_15', - 'ddan_room_16', - 'bdan_scene', - 'bdan_room_0', - 'bdan_room_1', - 'bdan_room_2', - 'bdan_room_3', - 'bdan_room_4', - 'bdan_room_5', - 'bdan_room_6', - 'bdan_room_7', - 'bdan_room_8', - 'bdan_room_9', - 'bdan_room_10', - 'bdan_room_11', - 'bdan_room_12', - 'bdan_room_13', - 'bdan_room_14', - 'bdan_room_15', - 'Bmori1_scene', - 'Bmori1_room_0', - 'Bmori1_room_1', - 'Bmori1_room_2', - 'Bmori1_room_3', - 'Bmori1_room_4', - 'Bmori1_room_5', - 'Bmori1_room_6', - 'Bmori1_room_7', - 'Bmori1_room_8', - 'Bmori1_room_9', - 'Bmori1_room_10', - 'Bmori1_room_11', - 'Bmori1_room_12', - 'Bmori1_room_13', - 'Bmori1_room_14', - 'Bmori1_room_15', - 'Bmori1_room_16', - 'Bmori1_room_17', - 'Bmori1_room_18', - 'Bmori1_room_19', - 'Bmori1_room_20', - 'Bmori1_room_21', - 'Bmori1_room_22', - 'HIDAN_scene', - 'HIDAN_room_0', - 'HIDAN_room_1', - 'HIDAN_room_2', - 'HIDAN_room_3', - 'HIDAN_room_4', - 'HIDAN_room_5', - 'HIDAN_room_6', - 'HIDAN_room_7', - 'HIDAN_room_8', - 'HIDAN_room_9', - 'HIDAN_room_10', - 'HIDAN_room_11', - 'HIDAN_room_12', - 'HIDAN_room_13', - 'HIDAN_room_14', - 'HIDAN_room_15', - 'HIDAN_room_16', - 'HIDAN_room_17', - 'HIDAN_room_18', - 'HIDAN_room_19', - 'HIDAN_room_20', - 'HIDAN_room_21', - 'HIDAN_room_22', - 'HIDAN_room_23', - 'HIDAN_room_24', - 'HIDAN_room_25', - 'HIDAN_room_26', - 'MIZUsin_scene', - 'MIZUsin_room_0', - 'MIZUsin_room_1', - 'MIZUsin_room_2', - 'MIZUsin_room_3', - 'MIZUsin_room_4', - 'MIZUsin_room_5', - 'MIZUsin_room_6', - 'MIZUsin_room_7', - 'MIZUsin_room_8', - 'MIZUsin_room_9', - 'MIZUsin_room_10', - 'MIZUsin_room_11', - 'MIZUsin_room_12', - 'MIZUsin_room_13', - 'MIZUsin_room_14', - 'MIZUsin_room_15', - 'MIZUsin_room_16', - 'MIZUsin_room_17', - 'MIZUsin_room_18', - 'MIZUsin_room_19', - 'MIZUsin_room_20', - 'MIZUsin_room_21', - 'MIZUsin_room_22', - 'jyasinzou_scene', - 'jyasinzou_room_0', - 'jyasinzou_room_1', - 'jyasinzou_room_2', - 'jyasinzou_room_3', - 'jyasinzou_room_4', - 'jyasinzou_room_5', - 'jyasinzou_room_6', - 'jyasinzou_room_7', - 'jyasinzou_room_8', - 'jyasinzou_room_9', - 'jyasinzou_room_10', - 'jyasinzou_room_11', - 'jyasinzou_room_12', - 'jyasinzou_room_13', - 'jyasinzou_room_14', - 'jyasinzou_room_15', - 'jyasinzou_room_16', - 'jyasinzou_room_17', - 'jyasinzou_room_18', - 'jyasinzou_room_19', - 'jyasinzou_room_20', - 'jyasinzou_room_21', - 'jyasinzou_room_22', - 'jyasinzou_room_23', - 'jyasinzou_room_24', - 'jyasinzou_room_25', - 'jyasinzou_room_26', - 'jyasinzou_room_27', - 'jyasinzou_room_28', - 'HAKAdan_scene', - 'HAKAdan_room_0', - 'HAKAdan_room_1', - 'HAKAdan_room_2', - 'HAKAdan_room_3', - 'HAKAdan_room_4', - 'HAKAdan_room_5', - 'HAKAdan_room_6', - 'HAKAdan_room_7', - 'HAKAdan_room_8', - 'HAKAdan_room_9', - 'HAKAdan_room_10', - 'HAKAdan_room_11', - 'HAKAdan_room_12', - 'HAKAdan_room_13', - 'HAKAdan_room_14', - 'HAKAdan_room_15', - 'HAKAdan_room_16', - 'HAKAdan_room_17', - 'HAKAdan_room_18', - 'HAKAdan_room_19', - 'HAKAdan_room_20', - 'HAKAdan_room_21', - 'HAKAdan_room_22', - 'HAKAdanCH_scene', - 'HAKAdanCH_room_0', - 'HAKAdanCH_room_1', - 'HAKAdanCH_room_2', - 'HAKAdanCH_room_3', - 'HAKAdanCH_room_4', - 'HAKAdanCH_room_5', - 'HAKAdanCH_room_6', - 'ice_doukutu_scene', - 'ice_doukutu_room_0', - 'ice_doukutu_room_1', - 'ice_doukutu_room_2', - 'ice_doukutu_room_3', - 'ice_doukutu_room_4', - 'ice_doukutu_room_5', - 'ice_doukutu_room_6', - 'ice_doukutu_room_7', - 'ice_doukutu_room_8', - 'ice_doukutu_room_9', - 'ice_doukutu_room_10', - 'ice_doukutu_room_11', - 'men_scene', - 'men_room_0', - 'men_room_1', - 'men_room_2', - 'men_room_3', - 'men_room_4', - 'men_room_5', - 'men_room_6', - 'men_room_7', - 'men_room_8', - 'men_room_9', - 'men_room_10', - 'ganontika_scene', - 'ganontika_room_0', - 'ganontika_room_1', - 'ganontika_room_2', - 'ganontika_room_3', - 'ganontika_room_4', - 'ganontika_room_5', - 'ganontika_room_6', - 'ganontika_room_7', - 'ganontika_room_8', - 'ganontika_room_9', - 'ganontika_room_10', - 'ganontika_room_11', - 'ganontika_room_12', - 'ganontika_room_13', - 'ganontika_room_14', - 'ganontika_room_15', - 'ganontika_room_16', - 'ganontika_room_17', - 'ganontika_room_18', - 'ganontika_room_19', - 'market_day_scene', - 'market_day_room_0', - 'market_night_scene', - 'market_night_room_0', - 'testroom_scene', - 'testroom_room_0', - 'testroom_room_1', - 'testroom_room_2', - 'testroom_room_3', - 'testroom_room_4', - 'kenjyanoma_scene', - 'kenjyanoma_room_0', - 'tokinoma_scene', - 'tokinoma_room_0', - 'tokinoma_room_1', - 'sutaru_scene', - 'sutaru_room_0', - 'link_home_scene', - 'link_home_room_0', - 'kokiri_shop_scene', - 'kokiri_shop_room_0', - 'kokiri_home_scene', - 'kokiri_home_room_0', - 'kakusiana_scene', - 'kakusiana_room_0', - 'kakusiana_room_1', - 'kakusiana_room_2', - 'kakusiana_room_3', - 'kakusiana_room_4', - 'kakusiana_room_5', - 'kakusiana_room_6', - 'kakusiana_room_7', - 'kakusiana_room_8', - 'kakusiana_room_9', - 'kakusiana_room_10', - 'kakusiana_room_11', - 'kakusiana_room_12', - 'kakusiana_room_13', - 'entra_scene', - 'entra_room_0', - 'moribossroom_scene', - 'moribossroom_room_0', - 'moribossroom_room_1', - 'syatekijyou_scene', - 'syatekijyou_room_0', - 'shop1_scene', - 'shop1_room_0', - 'hairal_niwa_scene', - 'hairal_niwa_room_0', - 'ganon_tou_scene', - 'ganon_tou_room_0', - 'sasatest_scene', - 'sasatest_room_0', - 'market_alley_scene', - 'market_alley_room_0', - 'spot20_scene', - 'spot20_room_0', - 'market_ruins_scene', - 'market_ruins_room_0', - 'entra_n_scene', - 'entra_n_room_0', - 'enrui_scene', - 'enrui_room_0', - 'market_alley_n_scene', - 'market_alley_n_room_0', - 'hiral_demo_scene', - 'hiral_demo_room_0', - 'kokiri_home3_scene', - 'kokiri_home3_room_0', - 'malon_stable_scene', - 'malon_stable_room_0', - 'kakariko_scene', - 'kakariko_room_0', - 'bdan_boss_scene', - 'bdan_boss_room_0', - 'bdan_boss_room_1', - 'FIRE_bs_scene', - 'FIRE_bs_room_0', - 'FIRE_bs_room_1', - 'hut_scene', - 'hut_room_0', - 'daiyousei_izumi_scene', - 'daiyousei_izumi_room_0', - 'hakaana_scene', - 'hakaana_room_0', - 'yousei_izumi_tate_scene', - 'yousei_izumi_tate_room_0', - 'yousei_izumi_yoko_scene', - 'yousei_izumi_yoko_room_0', - 'golon_scene', - 'golon_room_0', - 'zoora_scene', - 'zoora_room_0', - 'drag_scene', - 'drag_room_0', - 'alley_shop_scene', - 'alley_shop_room_0', - 'night_shop_scene', - 'night_shop_room_0', - 'impa_scene', - 'impa_room_0', - 'labo_scene', - 'labo_room_0', - 'tent_scene', - 'tent_room_0', - 'nakaniwa_scene', - 'nakaniwa_room_0', - 'ddan_boss_scene', - 'ddan_boss_room_0', - 'ddan_boss_room_1', - 'ydan_boss_scene', - 'ydan_boss_room_0', - 'ydan_boss_room_1', - 'HAKAdan_bs_scene', - 'HAKAdan_bs_room_0', - 'HAKAdan_bs_room_1', - 'MIZUsin_bs_scene', - 'MIZUsin_bs_room_0', - 'MIZUsin_bs_room_1', - 'ganon_scene', - 'ganon_room_0', - 'ganon_room_1', - 'ganon_room_2', - 'ganon_room_3', - 'ganon_room_4', - 'ganon_room_5', - 'ganon_room_6', - 'ganon_room_7', - 'ganon_room_8', - 'ganon_room_9', - 'ganon_boss_scene', - 'ganon_boss_room_0', - 'jyasinboss_scene', - 'jyasinboss_room_0', - 'jyasinboss_room_1', - 'jyasinboss_room_2', - 'jyasinboss_room_3', - 'kokiri_home4_scene', - 'kokiri_home4_room_0', - 'kokiri_home5_scene', - 'kokiri_home5_room_0', - 'ganon_final_scene', - 'ganon_final_room_0', - 'kakariko3_scene', - 'kakariko3_room_0', - 'hairal_niwa2_scene', - 'hairal_niwa2_room_0', - 'hakasitarelay_scene', - 'hakasitarelay_room_0', - 'hakasitarelay_room_1', - 'hakasitarelay_room_2', - 'hakasitarelay_room_3', - 'hakasitarelay_room_4', - 'hakasitarelay_room_5', - 'hakasitarelay_room_6', - 'shrine_scene', - 'shrine_room_0', - 'turibori_scene', - 'turibori_room_0', - 'shrine_n_scene', - 'shrine_n_room_0', - 'shrine_r_scene', - 'shrine_r_room_0', - 'hakaana2_scene', - 'hakaana2_room_0', - 'gerudoway_scene', - 'gerudoway_room_0', - 'gerudoway_room_1', - 'gerudoway_room_2', - 'gerudoway_room_3', - 'gerudoway_room_4', - 'gerudoway_room_5', - 'hairal_niwa_n_scene', - 'hairal_niwa_n_room_0', - 'bowling_scene', - 'bowling_room_0', - 'hakaana_ouke_scene', - 'hakaana_ouke_room_0', - 'hakaana_ouke_room_1', - 'hakaana_ouke_room_2', - 'hylia_labo_scene', - 'hylia_labo_room_0', - 'souko_scene', - 'souko_room_0', - 'souko_room_1', - 'souko_room_2', - 'miharigoya_scene', - 'miharigoya_room_0', - 'mahouya_scene', - 'mahouya_room_0', - 'takaraya_scene', - 'takaraya_room_0', - 'takaraya_room_1', - 'takaraya_room_2', - 'takaraya_room_3', - 'takaraya_room_4', - 'takaraya_room_5', - 'takaraya_room_6', - 'ganon_sonogo_scene', - 'ganon_sonogo_room_0', - 'ganon_sonogo_room_1', - 'ganon_sonogo_room_2', - 'ganon_sonogo_room_3', - 'ganon_sonogo_room_4', - 'ganon_demo_scene', - 'ganon_demo_room_0', - 'besitu_scene', - 'besitu_room_0', - 'face_shop_scene', - 'face_shop_room_0', - 'kinsuta_scene', - 'kinsuta_room_0', - 'ganontikasonogo_scene', - 'ganontikasonogo_room_0', - 'ganontikasonogo_room_1', - 'test01_scene', - 'test01_room_0', - 'bump_texture_static', - 'anime_model_1_static', - 'anime_model_2_static', - 'anime_model_3_static', - 'anime_model_4_static', - 'anime_model_5_static', - 'anime_model_6_static', - 'anime_texture_1_static', - 'anime_texture_2_static', - 'anime_texture_3_static', - 'anime_texture_4_static', - 'anime_texture_5_static', - 'anime_texture_6_static', - 'softsprite_matrix_static', -] - -romData = None - - -def initialize_worker(rom_data): - global romData - romData = rom_data - -def read_uint32_be(offset): - return struct.unpack('>I', romData[offset:offset+4])[0] - -def write_output_file(name, offset, size): - try: - with open(name, 'wb') as f: - f.write(romData[offset:offset+size]) - except IOError: - print('failed to write file ' + name) - -def ExtractFunc(i): - filename = 'baserom/' + FILE_NAMES[i] - entryOffset = FILE_TABLE_OFFSET + 16 * i - - virtStart = read_uint32_be(entryOffset + 0) - virtEnd = read_uint32_be(entryOffset + 4) - physStart = read_uint32_be(entryOffset + 8) - physEnd = read_uint32_be(entryOffset + 12) - - if physEnd == 0: # uncompressed - compressed = False - size = virtEnd - virtStart - else: # compressed - compressed = True - size = physEnd - physStart - - print('extracting ' + filename + " (0x%08X, 0x%08X)" % (virtStart, virtEnd)) - write_output_file(filename, physStart, size) - if compressed: - os.system('tools/yaz0 -d ' + filename + ' ' + filename) - -##################################################################### - -def main(): - try: - os.mkdir('baserom') - except: - pass - - # read baserom data - try: - with open(ROM_FILE_NAME, 'rb') as f: - rom_data = f.read() - except IOError: - print('failed to read ' + ROM_FILE_NAME) - sys.exit(1) - - # extract files - num_cores = cpu_count() - print("Extracting baserom with " + str(num_cores) + " CPU cores.") - with Pool(num_cores, initialize_worker, (rom_data,)) as p: - p.map(ExtractFunc, range(len(FILE_NAMES))) - -if __name__ == "__main__": - main() diff --git a/soh/include/alloca.h b/soh/include/alloca.h index 9c6a0ab94..10025b7f7 100644 --- a/soh/include/alloca.h +++ b/soh/include/alloca.h @@ -1,7 +1,7 @@ #ifndef ALLOCA_H #define ALLOCA_H -void* alloca(u32); +// void* alloca(u32); //#define alloca __builtin_alloca #define alloca malloc diff --git a/soh/include/functions.h b/soh/include/functions.h index 060022ac9..4631cdb92 100644 --- a/soh/include/functions.h +++ b/soh/include/functions.h @@ -14,7 +14,7 @@ extern "C" #if defined(INCLUDE_GAME_PRINTF) && !defined(NDEBUG) #define osSyncPrintf(fmt, ...) lusprintf(__FILE__, __LINE__, 0, fmt, __VA_ARGS__) #else -#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, __VA_ARGS__) +#define osSyncPrintf(fmt, ...) osSyncPrintfUnused(fmt, ##__VA_ARGS__) #endif f32 fabsf(f32 f); @@ -29,6 +29,7 @@ void gDPSetTextureImage(Gfx* pkt, u32 f, u32 s, u32 w, uintptr_t i); void gSPDisplayList(Gfx* pkt, Gfx* dl); void gSPDisplayListOffset(Gfx* pkt, Gfx* dl, int offset); void gSPVertex(Gfx* pkt, uintptr_t v, int n, int v0); +void gSPInvalidateTexCache(Gfx* pkt, uintptr_t texAddr); void cleararena(void); void bootproc(void); @@ -381,7 +382,7 @@ void Flags_UnsetTempClear(GlobalContext* globalCtx, s32 flag); s32 Flags_GetCollectible(GlobalContext* globalCtx, s32 flag); void Flags_SetCollectible(GlobalContext* globalCtx, s32 flag); void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, - u8 height); + u8 height, s16 hastranslation); void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, s32 y, s32 width, s32 height, s32 delay); s32 func_8002D53C(GlobalContext* globalCtx, TitleCardContext* titleCtx); @@ -656,10 +657,12 @@ Vec3s* SurfaceType_GetCamPosData(CollisionContext* colCtx, CollisionPoly* poly, u32 SurfaceType_GetSceneExitIndex(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 func_80041D4C(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 func_80041D70(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +u32 func_80041D94(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 func_80041DB8(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 func_80041DE4(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 func_80041E18(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); s32 func_80041E4C(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); +s32 func_80041E80(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 func_80041EA4(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 func_80041EC8(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); u32 SurfaceType_IsHorseBlocked(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId); @@ -977,6 +980,7 @@ void LightContext_RemoveLight(GlobalContext* globalCtx, LightContext* lightCtx, Lights* Lights_NewAndDraw(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB, u8 numLights, u8 r, u8 g, u8 b, s8 x, s8 y, s8 z); Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambientB); +void Lights_GlowCheckPrepare(GlobalContext* globalCtx); void Lights_GlowCheck(GlobalContext* globalCtx); void Lights_DrawGlow(GlobalContext* globalCtx); void ZeldaArena_CheckPointer(void* ptr, size_t size, const char* name, const char* action); @@ -2397,8 +2401,13 @@ void FileChoose_Destroy(GameState* thisx); char* SetQuote(); +void Heaps_Alloc(void); +void Heaps_Free(void); + #ifdef __cplusplus +#undef this }; +#undef this #endif #endif diff --git a/soh/include/global.h b/soh/include/global.h index 4845728dd..2e4808fe0 100644 --- a/soh/include/global.h +++ b/soh/include/global.h @@ -4,8 +4,8 @@ #include "functions.h" #include "variables.h" #include "macros.h" -#include "soh\OTRGlobals.h" -#include "soh\Enhancements\gameconsole.h" +#include "soh/OTRGlobals.h" +#include "soh/Enhancements/gameconsole.h" #include "Cvar.h" diff --git a/soh/include/libc/stddef.h b/soh/include/libc/stddef.h index c30e392f8..e5fbe2d22 100644 --- a/soh/include/libc/stddef.h +++ b/soh/include/libc/stddef.h @@ -1,7 +1,12 @@ #ifndef STDDEF_H #define STDDEF_H +#ifndef __cplusplus #define NULL ((void*)0) +#else +#define NULL nullptr +#endif + #if 0 #define size_t unsigned long #define ssize_t long diff --git a/soh/include/macros.h b/soh/include/macros.h index 0d86c56c3..7392274d9 100644 --- a/soh/include/macros.h +++ b/soh/include/macros.h @@ -126,17 +126,20 @@ extern GraphicsContext* __gfxCtx; -#define WORK_DISP __gfxCtx->work.p -#define POLY_OPA_DISP __gfxCtx->polyOpa.p -#define POLY_XLU_DISP __gfxCtx->polyXlu.p -#define POLY_KAL_DISP __gfxCtx->polyKal.p -#define OVERLAY_DISP __gfxCtx->overlay.p +#define WORK_DISP __gfxCtx->work.p +#define POLY_OPA_DISP __gfxCtx->polyOpa.p +#define POLY_XLU_DISP __gfxCtx->polyXlu.p +#define WORLD_OVERLAY_DISP __gfxCtx->worldOverlay.p +#define POLY_KAL_DISP __gfxCtx->polyKal.p +#define OVERLAY_DISP __gfxCtx->overlay.p // __gfxCtx shouldn't be used directly. // Use the DISP macros defined above when writing to display buffers. #ifndef NDEBUG #define OPEN_DISPS(gfxCtx, file, line) \ { \ + void FrameInterpolation_RecordOpenChild(const void* a, int b); \ + FrameInterpolation_RecordOpenChild(file, line); \ GraphicsContext* __gfxCtx; \ Gfx* dispRefs[4]; \ __gfxCtx = gfxCtx; \ @@ -145,6 +148,8 @@ extern GraphicsContext* __gfxCtx; #else #define OPEN_DISPS(gfxCtx, file, line) \ { \ + void FrameInterpolation_RecordOpenChild(const void* a, int b); \ + FrameInterpolation_RecordOpenChild(file, line); \ GraphicsContext* __gfxCtx; \ __gfxCtx = gfxCtx; \ (void)__gfxCtx; @@ -152,11 +157,15 @@ extern GraphicsContext* __gfxCtx; #ifndef NDEBUG #define CLOSE_DISPS(gfxCtx, file, line) \ + {void FrameInterpolation_RecordCloseChild(void); \ + FrameInterpolation_RecordCloseChild();} \ Graph_CloseDisps(dispRefs, gfxCtx, file, line); \ } \ (void)0 #else #define CLOSE_DISPS(gfxCtx, file, line) \ + {void FrameInterpolation_RecordCloseChild(void); \ + FrameInterpolation_RecordCloseChild();} \ (void)0; \ } \ (void)0 @@ -204,6 +213,14 @@ extern GraphicsContext* __gfxCtx; #define ALIGNED8 #endif -#define SEG_ADDR(seg, addr) (addr | (seg << 24) | 0xF0000000) +#define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1) + +#ifdef _MSC_VER +#define BOMSWAP16 _byteswap_ushort +#define BOMSWAP32 _byteswap_ulong +#else +#define BOMSWAP16 __builtin_bswap16 +#define BOMSWAP32 __builtin_bswap32 +#endif #endif diff --git a/soh/include/ultra64.h b/soh/include/ultra64.h index 65ef6d147..c2e0e9b29 100644 --- a/soh/include/ultra64.h +++ b/soh/include/ultra64.h @@ -1,6 +1,9 @@ #ifndef ULTRA64_H #define ULTRA64_H +#include +#include +#include #include "ultra64/types.h" #include "unk.h" diff --git a/soh/include/variables.h b/soh/include/variables.h index 80e3b792d..64b8c75c7 100644 --- a/soh/include/variables.h +++ b/soh/include/variables.h @@ -99,6 +99,7 @@ extern "C" extern u32 gGsFlagsMasks[4]; extern u32 gGsFlagsShifts[4]; extern void* gItemIcons[0x82]; + extern u8 gItemAgeReqs[]; extern u8 gItemSlots[56]; extern void (*gSceneCmdHandlers[26])(GlobalContext*, SceneCmd*); extern s16 gLinkObjectIds[2]; @@ -237,8 +238,8 @@ extern void(*D_801755D0)(void); extern u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE]; // 0xC00 bytes extern u8 gGfxSPTaskStack[0x400]; // 0x400 bytes extern GfxPool gGfxPools[2]; // 0x24820 bytes - extern u8 gAudioHeap[0x38000]; // 0x38000 bytes - extern u8 gSystemHeap[]; + extern u8* gAudioHeap; + extern u8* gSystemHeap; #ifdef __cplusplus }; diff --git a/soh/include/z64.h b/soh/include/z64.h index 6e783eeb9..7720144b4 100644 --- a/soh/include/z64.h +++ b/soh/include/z64.h @@ -30,6 +30,9 @@ #include "ichain.h" #include "regs.h" +#define AUDIO_HEAP_SIZE 0x38000 +#define SYSTEM_HEAP_SIZE (1024 * 1024 * 4) + #ifdef __cplusplus namespace Ship { @@ -83,6 +86,7 @@ typedef struct { /* 0x00000 */ u16 headMagic; // GFXPOOL_HEAD_MAGIC /* 0x00008 */ Gfx polyOpaBuffer[0x2FC0]; /* 0x0BF08 */ Gfx polyXluBuffer[0x1000]; + /* 0xXXXXX */ Gfx worldOverlayBuffer[0x1000]; /* 0x0BF08 */ Gfx polyKalBuffer[0x1000]; /* 0x0FF08 */ Gfx overlayBuffer[0x800]; /* 0x11F08 */ Gfx workBuffer[0x100]; @@ -130,6 +134,7 @@ typedef struct OSScTask { typedef struct GraphicsContext { /* 0x0000 */ Gfx* polyOpaBuffer; // Pointer to "Zelda 0" /* 0x0004 */ Gfx* polyXluBuffer; // Pointer to "Zelda 1" + /* 0xXXX */ Gfx* worldOverlayBuffer; // Pointer to "Paris" /* 0xXXX */ Gfx* polyKalBuffer; // Pointer to "Rome" /* 0x0008 */ char unk_008[0x08]; // Unused, could this be pointers to "Zelda 2" / "Zelda 3" /* 0x0010 */ Gfx* overlayBuffer; // Pointer to "Zelda 4" @@ -149,6 +154,7 @@ typedef struct GraphicsContext { /* 0x02A8 */ TwoHeadGfxArena overlay; // "Zelda 4" /* 0x02B8 */ TwoHeadGfxArena polyOpa; // "Zelda 0" /* 0x02C8 */ TwoHeadGfxArena polyXlu; // "Zelda 1" + /* 0x0XXX */ TwoHeadGfxArena worldOverlay; // When in Paris... /* 0x0XXX */ TwoHeadGfxArena polyKal; // When in Rome... /* 0x02D8 */ u32 gfxPoolIdx; /* 0x02DC */ u16* curFrameBuffer; @@ -248,6 +254,8 @@ typedef struct { /* 0x0B */ u8 delayTimer; // how long the title card waits to appear /* 0x0C */ s16 alpha; /* 0x0E */ s16 intensity; + /* ---- */ s16 isBossCard; //To detect if that a Boss name title card. + /* ---- */ s16 hasTranslation; // to detect if the current title card has translation (used for bosses only) } TitleCardContext; // size = 0x10 typedef struct { @@ -336,16 +344,18 @@ typedef enum { } SkyboxId; typedef struct { - /* 0x000 */ char unk_00[0x128]; - /* 0x128 */ void* staticSegments[2]; - /* 0x130 */ u16 (*palettes)[256]; - /* 0x134 */ Gfx (*dListBuf)[150]; - /* 0x138 */ Gfx* unk_138; - /* 0x13C */ Vtx* roomVtx; - /* 0x140 */ s16 unk_140; - /* 0x144 */ Vec3f rot; - /* 0x150 */ char unk_150[0x10]; -} SkyboxContext; // size = 0x160 + char unk_00[0x128]; + s16 skyboxId; + void* textures[2][6]; + void* palettes[6]; + u16 palette_size; + Gfx (*dListBuf)[150]; + Gfx* unk_138; + Vtx* roomVtx; + s16 unk_140; + Vec3f rot; + char unk_150[0x10]; +} SkyboxContext; typedef enum { /* 0 */ OCARINA_SONG_MINUET, diff --git a/soh/include/z64effect.h b/soh/include/z64effect.h index c85c9d617..1b35d46b6 100644 --- a/soh/include/z64effect.h +++ b/soh/include/z64effect.h @@ -225,6 +225,7 @@ typedef struct EffectSs { /* 0x5C */ s16 life; // -1 means this entry is free /* 0x5E */ u8 priority; // Lower value means higher priority /* 0x5F */ u8 type; + u32 epoch; } EffectSs; // size = 0x60 typedef struct { diff --git a/soh/soh.vcxproj b/soh/soh.vcxproj index 9d5b509f2..0a2006122 100644 --- a/soh/soh.vcxproj +++ b/soh/soh.vcxproj @@ -112,9 +112,6 @@ true true - - copy /b $(ProjectDir)src\boot\build.c +,, - @@ -144,7 +141,7 @@ false INCLUDE_GAME_PRINTF;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS;ENABLE_DX11;%(PreprocessorDefinitions)GLEW_STATIC true - stdcpp17 + stdcpp20 MultiThreadedDebug true @@ -176,13 +173,20 @@ + + + + + + + @@ -276,6 +280,7 @@ + @@ -325,7 +330,6 @@ - @@ -875,6 +879,7 @@ + @@ -922,8 +927,15 @@ + + + + + + + diff --git a/soh/soh.vcxproj.filters b/soh/soh.vcxproj.filters index 30ca9d4ed..04f6030a8 100644 --- a/soh/soh.vcxproj.filters +++ b/soh/soh.vcxproj.filters @@ -76,6 +76,12 @@ {18b9727f-30de-4ab8-a317-916090d4a110} + + {9a4378ec-e30f-47b6-9ad6-5ce738b4cf99} + + + {04fc1c52-49ff-48e2-ae23-2c00867374f8} + @@ -624,9 +630,6 @@ Source Files\src\code - - Source Files\src\code - Source Files\src\code @@ -2169,6 +2172,29 @@ Source Files\src\overlays\actors + + Source Files\soh\Enhancements\debugger + + + Source Files\soh\Enhancements\debugger + + + Source Files\soh + + + Source Files\soh\Enhancements\debugger + + + Source Files\soh\Enhancements\debugger + + Source Files\soh + + + Source Files + + + Source Files\soh\Enhancements + @@ -3710,6 +3736,29 @@ Header Files + + Header Files\soh\Enhancements\debugger + + + Header Files\soh\Enhancements\debugger + + + Header Files\soh + + + Header Files\soh\Enhancements\debugger + + + Header Files\soh\Enhancements\debugger + + Header Files\soh + + + Source Files\soh\Enhancements + + + Source Files\soh + diff --git a/soh/soh/Enhancements/bootcommands.c b/soh/soh/Enhancements/bootcommands.c index 6901c4644..03742dae9 100644 --- a/soh/soh/Enhancements/bootcommands.c +++ b/soh/soh/Enhancements/bootcommands.c @@ -24,6 +24,12 @@ void BootCommands_Init() CVar_RegisterS32("gDisableLOD", 0); CVar_RegisterS32("gDebugEnabled", 0); CVar_RegisterS32("gPauseLiveLink", 0); + CVar_RegisterS32("gMinimalUI", 0); + CVar_RegisterS32("gRumbleEnabled", 0); + CVar_RegisterS32("gUniformLR", 1); + CVar_RegisterS32("gNewDrops", 0); + CVar_RegisterS32("gVisualAgony", 0); + CVar_RegisterS32("gLanguages", 0); //0 = English / 1 = German / 2 = French } //void BootCommands_ParseBootArgs(char* str) diff --git a/soh/soh/Enhancements/debugconsole.cpp b/soh/soh/Enhancements/debugconsole.cpp index 06126281f..1b892be74 100644 --- a/soh/soh/Enhancements/debugconsole.cpp +++ b/soh/soh/Enhancements/debugconsole.cpp @@ -1,12 +1,22 @@ +#ifdef _MSC_VER +#define NOGDI +#endif + #include "debugconsole.h" #include "../libultraship/SohImGuiImpl.h" +#include "savestates.h" + #include #include +#include "soh/OTRGlobals.h" + #define Path _Path #define PATH_HACK #include #include + +#include "Lib/ImGui/imgui_internal.h" #undef PATH_HACK #undef Path @@ -18,7 +28,7 @@ extern "C" { extern GlobalContext* gGlobalCtx; } -#include "cvar.h" +#include "Cvar.h" #define CMD_REGISTER SohImGui::BindCmd @@ -122,7 +132,7 @@ static bool RuppeHandler(const std::vector& args) { try { rupeeAmount = std::stoi(args[1]); } - catch (std::invalid_argument const& ex) { + catch (std::invalid_argument const& ex) { ERROR("[SOH] Rupee count must be an integer."); return CMD_FAILED; } @@ -168,13 +178,13 @@ static bool ResetHandler(std::vector args) { ERROR("GlobalCtx == nullptr"); return CMD_FAILED; } - + SET_NEXT_GAMESTATE(&gGlobalCtx->state, TitleSetup_Init, GameState); gGlobalCtx->state.running = false; return CMD_SUCCESS; } -const static std::map ammoItems{ +const static std::map ammoItems{ { "sticks", ITEM_STICK }, { "deku_sticks", ITEM_STICK }, { "nuts", ITEM_NUT }, { "deku_nuts", ITEM_NUT }, { "bombs", ITEM_BOMB }, { "arrows", ITEM_BOW }, @@ -194,7 +204,7 @@ static bool AmmoHandler(const std::vector& args) { try { count = std::stoi(args[2]); - } catch (std::invalid_argument const& ex) { + } catch (std::invalid_argument const& ex) { ERROR("Ammo count must be an integer"); return CMD_FAILED; } @@ -203,7 +213,7 @@ static bool AmmoHandler(const std::vector& args) { ERROR("Ammo count must be positive"); return CMD_FAILED; } - + const auto& it = ammoItems.find(args[1]); if (it == ammoItems.end()) { @@ -213,7 +223,7 @@ static bool AmmoHandler(const std::vector& args) { // I dont think you can do OOB with just this AMMO(it->second) = count; - + //To use a change by uncomment this //Inventory_ChangeAmmo(it->second, count); } @@ -236,7 +246,7 @@ static bool BottleHandler(const std::vector& args) { unsigned int slot; try { slot = std::stoi(args[2]); - } catch (std::invalid_argument const& ex) { + } catch (std::invalid_argument const& ex) { ERROR("[SOH] Bottle slot must be an integer."); return CMD_FAILED; } @@ -275,7 +285,7 @@ static bool ItemHandler(const std::vector& args) { return CMD_FAILED; } - gSaveContext.inventory.items[std::stoi(args[1])] = std::stoi(args[2]); + gSaveContext.inventory.items[std::stoi(args[1])] = std::stoi(args[2]); return CMD_SUCCESS; } @@ -301,6 +311,66 @@ static bool EntranceHandler(const std::vector& args) { gSaveContext.nextTransition = 11; } +static bool SaveStateHandler(const std::vector& args) { + unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); + const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::SAVE }); + + switch (rtn) { + case SaveStateReturn::SUCCESS: + INFO("[SOH] Saved state to slot %u", slot); + return CMD_SUCCESS; + case SaveStateReturn::FAIL_WRONG_GAMESTATE: + ERROR("[SOH] Can not save a state outside of \"GamePlay\""); + return CMD_FAILED; + + } +} + +static bool LoadStateHandler(const std::vector& args) { + unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); + const SaveStateReturn rtn = OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::LOAD }); + + switch (rtn) { + case SaveStateReturn::SUCCESS: + INFO("[SOH] Loaded state from slot %u", slot); + return CMD_SUCCESS; + case SaveStateReturn::FAIL_INVALID_SLOT: + ERROR("[SOH] Invalid State Slot Number (%u)", slot); + return CMD_FAILED; + case SaveStateReturn::FAIL_STATE_EMPTY: + ERROR("[SOH] State Slot (%u) is empty", slot); + return CMD_FAILED; + case SaveStateReturn::FAIL_WRONG_GAMESTATE: + ERROR("[SOH] Can not load a state outside of \"GamePlay\""); + return CMD_FAILED; + } + +} + +static bool StateSlotSelectHandler(const std::vector& args) { + if (args.size() != 2) { + ERROR("[SOH] Unexpected arguments passed"); + return CMD_FAILED; + } + int slot; + + try { + slot = std::stoi(args[1], nullptr, 10); + } catch (std::invalid_argument const& ex) { + ERROR("[SOH] SaveState slot value must be a number."); + return CMD_FAILED; + } + + if (slot < 0) { + ERROR("[SOH] Invalid slot passed. Slot must be between 0 and 2"); + return CMD_FAILED; + } + + OTRGlobals::Instance->gSaveStateMgr->SetCurrentSlot(slot); + INFO("[SOH] Slot %u selected", OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot()); + return CMD_SUCCESS; +} + #define VARTYPE_INTEGER 0 #define VARTYPE_FLOAT 1 #define VARTYPE_STRING 2 @@ -327,9 +397,6 @@ static int CheckVarType(const std::string& input) return result; } -void DebugConsole_LoadCVars(); -void DebugConsole_SaveCVars(); - static bool SetCVarHandler(const std::vector& args) { if (args.size() < 3) return CMD_FAILED; @@ -337,11 +404,11 @@ static bool SetCVarHandler(const std::vector& args) { int vType = CheckVarType(args[2]); if (vType == VARTYPE_STRING) - CVar_SetString((char*)args[1].c_str(), (char*)args[2].c_str()); + CVar_SetString(args[1].c_str(), args[2].c_str()); else if (vType == VARTYPE_FLOAT) - CVar_SetFloat((char*)args[1].c_str(), std::stof(args[2])); + CVar_SetFloat(args[1].c_str(), std::stof(args[2])); else - CVar_SetS32((char*)args[1].c_str(), std::stoi(args[2])); + CVar_SetS32(args[1].c_str(), std::stoi(args[2])); DebugConsole_SaveCVars(); @@ -354,7 +421,7 @@ static bool GetCVarHandler(const std::vector& args) { if (args.size() < 2) return CMD_FAILED; - CVar* cvar = CVar_GetVar((char*) args[1].c_str()); + CVar* cvar = CVar_Get(args[1].c_str()); if (cvar != nullptr) { @@ -418,16 +485,39 @@ void DebugConsole_Init(void) { CMD_REGISTER("entrance", { EntranceHandler, "Sends player to the entered entrance (hex)", { { "entrance", ArgumentType::NUMBER } } }); + CMD_REGISTER("save_state", { SaveStateHandler, "Save a state." }); + CMD_REGISTER("load_state", { LoadStateHandler, "Load a state." }); + CMD_REGISTER("set_slot", { StateSlotSelectHandler, "Selects a SaveState slot", { + { "Slot number", ArgumentType::NUMBER, } + } }); DebugConsole_LoadCVars(); } +template bool is_number(const std::string& s) { + Numeric n; + return ((std::istringstream(s) >> n >> std::ws).eof()); +} + void DebugConsole_LoadCVars() { if (File::Exists("cvars.cfg")) { const auto lines = File::ReadAllLines("cvars.cfg"); for (const std::string& line : lines) { - SohImGui::console->Dispatch(line); + std::vector cfg = StringHelper::Split(line, " = "); + if (line.empty()) continue; + if (cfg.size() < 2) continue; + if (cfg[1].find("\"") != std::string::npos) { + std::string value(cfg[1]); + value.erase(std::ranges::remove(value, '\"').begin(), value.end()); + CVar_SetString(cfg[0].c_str(), ImStrdup(value.c_str())); + } + if (is_number(cfg[1])) { + CVar_SetFloat(cfg[0].c_str(), std::stof(cfg[1])); + } + if (is_number(cfg[1])) { + CVar_SetS32(cfg[0].c_str(), std::stoi(cfg[1])); + } } } } @@ -438,12 +528,12 @@ void DebugConsole_SaveCVars() for (const auto &cvar : cvars) { if (cvar.second->type == CVAR_TYPE_STRING) - output += StringHelper::Sprintf("set %s %s\n", cvar.first.c_str(), cvar.second->value.valueStr); + output += StringHelper::Sprintf("%s = \"%s\"\n", cvar.first.c_str(), cvar.second->value.valueStr); else if (cvar.second->type == CVAR_TYPE_S32) - output += StringHelper::Sprintf("set %s %i\n", cvar.first.c_str(), cvar.second->value.valueS32); + output += StringHelper::Sprintf("%s = %i\n", cvar.first.c_str(), cvar.second->value.valueS32); else if (cvar.second->type == CVAR_TYPE_FLOAT) - output += StringHelper::Sprintf("set %s %f\n", cvar.first.c_str(), cvar.second->value.valueFloat); + output += StringHelper::Sprintf("%s = %f\n", cvar.first.c_str(), cvar.second->value.valueFloat); } File::WriteAllText("cvars.cfg", output); -} \ No newline at end of file +} diff --git a/soh/soh/Enhancements/debugconsole.h b/soh/soh/Enhancements/debugconsole.h index 21e0b51f1..581c19acd 100644 --- a/soh/soh/Enhancements/debugconsole.h +++ b/soh/soh/Enhancements/debugconsole.h @@ -1,3 +1,5 @@ #pragma once -void DebugConsole_Init(void); \ No newline at end of file +void DebugConsole_Init(void); +void DebugConsole_LoadCVars(); +void DebugConsole_SaveCVars(); \ No newline at end of file diff --git a/soh/soh/Enhancements/debugger/ImGuiHelpers.cpp b/soh/soh/Enhancements/debugger/ImGuiHelpers.cpp new file mode 100644 index 000000000..6f4f00637 --- /dev/null +++ b/soh/soh/Enhancements/debugger/ImGuiHelpers.cpp @@ -0,0 +1,21 @@ +#include "ImGuiHelpers.h" + +// Adds a text tooltip for the previous ImGui item +void SetLastItemHoverText(const std::string& text) { + if (ImGui::IsItemHovered()) { + ImGui::BeginTooltip(); + ImGui::Text(text.c_str()); + 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(text.c_str()); + ImGui::EndTooltip(); + } +} diff --git a/soh/soh/Enhancements/debugger/ImGuiHelpers.h b/soh/soh/Enhancements/debugger/ImGuiHelpers.h new file mode 100644 index 000000000..7f01e4580 --- /dev/null +++ b/soh/soh/Enhancements/debugger/ImGuiHelpers.h @@ -0,0 +1,8 @@ +#pragma once +#include "../libultraship/Lib/ImGui/imgui.h" + +#include + +void SetLastItemHoverText(const std::string& text); + +void InsertHelpHoverText(const std::string& text); diff --git a/soh/soh/Enhancements/debugger/colViewer.cpp b/soh/soh/Enhancements/debugger/colViewer.cpp new file mode 100644 index 000000000..f5c283aac --- /dev/null +++ b/soh/soh/Enhancements/debugger/colViewer.cpp @@ -0,0 +1,721 @@ +#include "colViewer.h" +#include "../libultraship/SohImGuiImpl.h" +#include "ImGuiHelpers.h" +#include "../../frame_interpolation.h" + +#include +#include +#include + +extern "C" { +#include +#include "variables.h" +#include "functions.h" +#include "macros.h" +extern GlobalContext* gGlobalCtx; +} + +enum class ColRenderSetting { + Disabled, + Solid, + Transparent, + NumSettings +}; + +std::string ColRenderSettingNames[] = { + "Disabled", + "Solid", + "Transparent", +}; + +static ColRenderSetting showSceneColSetting = ColRenderSetting::Disabled; +static ColRenderSetting showBgActorSetting = ColRenderSetting::Disabled; +static ColRenderSetting showColCheckSetting = ColRenderSetting::Disabled; +static ColRenderSetting showWaterboxSetting = ColRenderSetting::Disabled; + +static uint32_t sceneColor = 0xFFFFFFFF; +static uint32_t hookshotColor = 0x8080FFFF; +static uint32_t entranceColor = 0x00FF00FF; +static uint32_t specialSurfaceColor = 0xC0FFC0FF; +static uint32_t interactableColor = 0xC000C0FF; +static uint32_t slopeColor = 0xFFFF80FF; +static uint32_t voidColor = 0xFF0000FF; + +static uint32_t ocColor = 0xFFFFFFFF; +static uint32_t acColor = 0x0000FFFF; +static uint32_t atColor = 0xFF0000FF; + +static uint32_t waterboxColor = 0x0000FFFF; + +static bool applyAsDecal = false; +static bool isShaded = false; + +static std::vector opaDl; +static std::vector xluDl; +static std::vector vtxDl; +static std::vector mtxDl; + +// These DLs contain a cylinder/sphere model scaled to 128x (to have less error) +// The idea is to push a model view matrix, then draw the DL, to draw the shape somewhere with a certain size +static std::vector cylinderGfx; +static std::vector cylinderVtx; +static std::vector sphereGfx; +static std::vector sphereVtx; + +// Create a dropdown menu to set a ColRenderSetting +void DrawColRenderSetting(const std::string& name, ColRenderSetting& setting) { + if (ImGui::BeginCombo(name.c_str(), ColRenderSettingNames[static_cast(setting)].c_str())) { + for (int32_t settingIndex = 0; settingIndex < static_cast(ColRenderSetting::NumSettings); settingIndex++) { + if (ImGui::Selectable(ColRenderSettingNames[settingIndex].c_str())) { + setting = static_cast(settingIndex); + } + } + ImGui::EndCombo(); + } +} + +// Draw a color picker box +void DrawColorPicker(const std::string& name, uint32_t& color) { + float colorAsFloat[4]; + colorAsFloat[0] = ((color >> 24) & 0xFF) / 255.0f; + colorAsFloat[1] = ((color >> 16) & 0xFF) / 255.0f; + colorAsFloat[2] = ((color >> 8) & 0xFF) / 255.0f; + colorAsFloat[3] = (color & 0xFF) / 255.0f; + if (ImGui::ColorEdit4(name.c_str(), colorAsFloat, ImGuiColorEditFlags_NoInputs | ImGuiColorEditFlags_NoLabel)) { + color = static_cast(colorAsFloat[3] * 255) | + static_cast(colorAsFloat[2] * 255) << 8 | + static_cast(colorAsFloat[1] * 255) << 16 | + static_cast(colorAsFloat[0] * 255) << 24; + } + ImGui::SameLine(); + ImGui::Text(name.c_str()); +} + +// Draws the ImGui window for the collision viewer +void DrawColViewerWindow(bool& open) { + if (!open) { + return; + } + + ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver); + if (!ImGui::Begin("Collision Viewer", &open, ImGuiWindowFlags_NoFocusOnAppearing)) { + ImGui::End(); + return; + } + + DrawColRenderSetting("Scene", showSceneColSetting); + DrawColRenderSetting("Bg Actors", showBgActorSetting); + DrawColRenderSetting("Col Check", showColCheckSetting); + DrawColRenderSetting("Waterbox", showWaterboxSetting); + + ImGui::Checkbox("Apply as decal", &applyAsDecal); + InsertHelpHoverText("Applies the collision as a decal display. This can be useful if there is z-fighting occuring " + "with the scene geometry, but can cause other artifacts."); + ImGui::Checkbox("Shaded", &isShaded); + InsertHelpHoverText("Applies the scene's shading to the collision display."); + + // This has to be duplicated in both code paths due to the nature of ImGui::IsItemHovered() + const std::string colorHelpText = "View and change the colors used for collision display."; + if (ImGui::TreeNode("Colors")) { + InsertHelpHoverText(colorHelpText); + + DrawColorPicker("Normal", sceneColor); + DrawColorPicker("Hookshot", hookshotColor); + DrawColorPicker("Entrance", entranceColor); + DrawColorPicker("Special Surface (Grass/Sand/Etc)", specialSurfaceColor); + DrawColorPicker("Interactable (Vines/Crawlspace/Etc)", interactableColor); + DrawColorPicker("Slope", slopeColor); + DrawColorPicker("Void", voidColor); + DrawColorPicker("OC", ocColor); + DrawColorPicker("AC", acColor); + DrawColorPicker("AT", atColor); + DrawColorPicker("Waterbox", waterboxColor); + + ImGui::TreePop(); + } else { + InsertHelpHoverText(colorHelpText); + } + + ImGui::End(); +} + +// Calculates the normal for a triangle at the 3 specified points +void CalcTriNorm(const Vec3f& v1, const Vec3f& v2, const Vec3f& v3, Vec3f& norm) { + norm.x = (v2.y - v1.y) * (v3.z - v1.z) - (v2.z - v1.z) * (v3.y - v1.y); + norm.y = (v2.z - v1.z) * (v3.x - v1.x) - (v2.x - v1.x) * (v3.z - v1.z); + norm.z = (v2.x - v1.x) * (v3.y - v1.y) - (v2.y - v1.y) * (v3.x - v1.x); + float norm_d = sqrtf(norm.x * norm.x + norm.y * norm.y + norm.z * norm.z); + if (norm_d != 0.f) { + norm.x *= 127.f / norm_d; + norm.y *= 127.f / norm_d; + norm.z *= 127.f / norm_d; + } +} + +// Various macros used for creating verticies and rendering that aren't in gbi.h +#define G_CC_MODULATERGB_PRIM_ENVA PRIMITIVE, 0, SHADE, 0, 0, 0, 0, ENVIRONMENT +#define G_CC_PRIMITIVE_ENVA 0, 0, 0, PRIMITIVE, 0, 0, 0, ENVIRONMENT +#define qs105(n) ((int16_t)((n)*0x0020)) +#define gdSPDefVtxN(x, y, z, s, t, nx, ny, nz, ca) \ + { \ + .n = {.ob = { x, y, z }, .tc = { qs105(s), qs105(t) }, .n = { nx, ny, nz }, .a = ca } \ + } + + +void CreateCylinderData() { + constexpr int32_t CYL_DIVS = 12; + cylinderGfx.reserve(5 + CYL_DIVS * 2); + cylinderVtx.reserve(2 + CYL_DIVS * 2); + + cylinderVtx.push_back(gdSPDefVtxN(0, 0, 0, 0, 0, 0, -127, 0, 0xFF)); // Bottom center vertex + cylinderVtx.push_back(gdSPDefVtxN(0, 128, 0, 0, 0, 0, 127, 0, 0xFF)); // Top center vertex + // Create two rings of vertices + for (int i = 0; i < CYL_DIVS; ++i) { + short vtx_x = floorf(0.5f + cosf(2.f * M_PI * i / CYL_DIVS) * 128.f); + short vtx_z = floorf(0.5f - sinf(2.f * M_PI * i / CYL_DIVS) * 128.f); + signed char norm_x = cosf(2.f * M_PI * i / CYL_DIVS) * 127.f; + signed char norm_z = -sinf(2.f * M_PI * i / CYL_DIVS) * 127.f; + cylinderVtx.push_back(gdSPDefVtxN(vtx_x, 0, vtx_z, 0, 0, norm_x, 0, norm_z, 0xFF)); + cylinderVtx.push_back(gdSPDefVtxN(vtx_x, 128, vtx_z, 0, 0, norm_x, 0, norm_z, 0xFF)); + } + + // Draw edges + cylinderGfx.push_back(gsSPSetGeometryMode(G_CULL_BACK | G_SHADING_SMOOTH)); + cylinderGfx.push_back(gsSPVertex((uintptr_t)cylinderVtx.data(), 2 + CYL_DIVS * 2, 0)); + for (int i = 0; i < CYL_DIVS; ++i) { + int p = (i + CYL_DIVS - 1) % CYL_DIVS; + int v[4] = { + 2 + p * 2 + 0, + 2 + i * 2 + 0, + 2 + i * 2 + 1, + 2 + p * 2 + 1, + }; + cylinderGfx.push_back(gsSP2Triangles(v[0], v[1], v[2], 0, v[0], v[2], v[3], 0)); + } + + // Draw top & bottom + cylinderGfx.push_back(gsSPClearGeometryMode(G_SHADING_SMOOTH)); + for (int i = 0; i < CYL_DIVS; ++i) { + int p = (i + CYL_DIVS - 1) % CYL_DIVS; + int v[4] = { + 2 + p * 2 + 0, + 2 + i * 2 + 0, + 2 + i * 2 + 1, + 2 + p * 2 + 1, + }; + cylinderGfx.push_back(gsSP2Triangles(0, v[1], v[0], 0, 1, v[3], v[2], 0)); + } + + cylinderGfx.push_back(gsSPClearGeometryMode(G_CULL_BACK)); + cylinderGfx.push_back(gsSPEndDisplayList()); +} + +// This subdivides a face into four tris by placing new verticies at the midpoints of the sides (Like a triforce!), then blowing up the +// verticies so they are on the unit sphere +void CreateSphereFace(std::vector>& faces, int32_t v0Index, int32_t v1Index, int32_t v2Index) { + size_t nextIndex = sphereVtx.size(); + + size_t v01Index = nextIndex; + size_t v12Index = nextIndex + 1; + size_t v20Index = nextIndex + 2; + + faces.emplace_back(v0Index, v01Index, v20Index); + faces.emplace_back(v1Index, v12Index, v01Index); + faces.emplace_back(v2Index, v20Index, v12Index); + faces.emplace_back(v01Index, v12Index, v20Index); + + const Vtx& v0 = sphereVtx[v0Index]; + const Vtx& v1 = sphereVtx[v1Index]; + const Vtx& v2 = sphereVtx[v2Index]; + + // Create 3 new verticies at the midpoints + Vec3f vs[3] = { + Vec3f((v0.n.ob[0] + v1.n.ob[0]) / 2.0f, (v0.n.ob[1] + v1.n.ob[1]) / 2.0f, (v0.n.ob[2] + v1.n.ob[2]) / 2.0f), + Vec3f((v1.n.ob[0] + v2.n.ob[0]) / 2.0f, (v1.n.ob[1] + v2.n.ob[1]) / 2.0f, (v1.n.ob[2] + v2.n.ob[2]) / 2.0f), + Vec3f((v2.n.ob[0] + v0.n.ob[0]) / 2.0f, (v2.n.ob[1] + v0.n.ob[1]) / 2.0f, (v2.n.ob[2] + v0.n.ob[2]) / 2.0f) + }; + + // Normalize vertex positions so they are on the sphere + for (int32_t vAddIndex = 0; vAddIndex < 3; vAddIndex++) { + Vec3f& v = vs[vAddIndex]; + float mag = sqrtf(v.x * v.x + v.y * v.y + v.z * v.z); + v.x /= mag; + v.y /= mag; + v.z /= mag; + sphereVtx.push_back(gdSPDefVtxN((short)(v.x * 127), (short)(v.y * 127), (short)(v.z * 127), 0, 0, + (signed char)(v.x * 127), (signed char)(v.y * 127), (signed char)(v.z * 127), + 0xFF)); + } +} + +// Creates a sphere following the idea in here: http://blog.andreaskahler.com/2009/06/creating-icosphere-mesh-in-code.html +// Spcifically, create a icosahedron by realizing that the points can be placed on 3 rectangles that are on each unit plane. +// Then, subdividing each face. +void CreateSphereData() { + std::vector base; + + float d = (1.0f + sqrtf(5.0f)) / 2.0f; + + // Create the 12 starting verticies, 4 on each rectangle + base.emplace_back(-1, d, 0); + base.emplace_back(1, d, 0); + base.emplace_back(-1, -d, 0); + base.emplace_back(1, -d, 0); + + base.emplace_back(0, -1, d); + base.emplace_back(0, 1, d); + base.emplace_back(0, -1, -d); + base.emplace_back(0, 1, -d); + + base.emplace_back(d, 0, -1); + base.emplace_back(d, 0, 1); + base.emplace_back(-d, 0, -1); + base.emplace_back(-d, 0, 1); + + // Normalize verticies so they are on the unit sphere + for (Vec3f& v : base) { + float mag = sqrtf(v.x * v.x + v.y * v.y + v.z * v.z); + v.x /= mag; + v.y /= mag; + v.z /= mag; + sphereVtx.push_back(gdSPDefVtxN((short)(v.x * 128), (short)(v.y * 128), (short)(v.z * 128), 0, 0, + (signed char)(v.x * 127), (signed char)(v.y * 127), (signed char)(v.z * 127), + 0xFF)); + } + + std::vector> faces; + + // Subdivide faces + CreateSphereFace(faces, 0, 11, 5); + CreateSphereFace(faces, 0, 5, 1); + CreateSphereFace(faces, 0, 1, 7); + CreateSphereFace(faces, 0, 7, 10); + CreateSphereFace(faces, 0, 10, 11); + + CreateSphereFace(faces, 1, 5, 9); + CreateSphereFace(faces, 5, 11, 4); + CreateSphereFace(faces, 11, 10, 2); + CreateSphereFace(faces, 10, 7, 6); + CreateSphereFace(faces, 7, 1, 8); + + CreateSphereFace(faces, 3, 9, 4); + CreateSphereFace(faces, 3, 4, 2); + CreateSphereFace(faces, 3, 2, 6); + CreateSphereFace(faces, 3, 6, 8); + CreateSphereFace(faces, 3, 8, 9); + + CreateSphereFace(faces, 4, 9, 5); + CreateSphereFace(faces, 2, 4, 11); + CreateSphereFace(faces, 6, 2, 10); + CreateSphereFace(faces, 8, 6, 7); + CreateSphereFace(faces, 9, 8, 1); + + size_t vtxStartIndex = sphereVtx.size(); + sphereVtx.reserve(sphereVtx.size() + faces.size() * 3); + for (int32_t faceIndex = 0; faceIndex < faces.size(); faceIndex++) { + sphereVtx.push_back(sphereVtx[std::get<0>(faces[faceIndex])]); + sphereVtx.push_back(sphereVtx[std::get<1>(faces[faceIndex])]); + sphereVtx.push_back(sphereVtx[std::get<2>(faces[faceIndex])]); + sphereGfx.push_back(gsSPVertex((uintptr_t)(sphereVtx.data() + vtxStartIndex + faceIndex * 3), 3, 0)); + sphereGfx.push_back(gsSP1Triangle(0, 1, 2, 0)); + } + + sphereGfx.push_back(gsSPEndDisplayList()); +} + +void InitColViewer() { + SohImGui::AddWindow("Developer Tools", "Collision Viewer", DrawColViewerWindow); + + CreateCylinderData(); + CreateSphereData(); +} + +// Initializes the display list for a ColRenderSetting +void InitGfx(std::vector& gfx, ColRenderSetting setting) { + uint32_t rm; + uint32_t blc1; + uint32_t blc2; + uint8_t alpha; + uint64_t cm; + uint32_t gm; + + if (setting == ColRenderSetting::Transparent) { + rm = Z_CMP | IM_RD | CVG_DST_FULL | FORCE_BL; + blc1 = GBL_c1(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA); + blc2 = GBL_c2(G_BL_CLR_IN, G_BL_A_IN, G_BL_CLR_MEM, G_BL_1MA); + alpha = 0x80; + } else { + rm = Z_CMP | Z_UPD | CVG_DST_CLAMP | FORCE_BL; + blc1 = GBL_c1(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1); + blc2 = GBL_c2(G_BL_CLR_IN, G_BL_0, G_BL_CLR_IN, G_BL_1); + alpha = 0xFF; + } + + if (applyAsDecal) { + rm |= ZMODE_DEC; + } else if (setting == ColRenderSetting::Transparent) { + rm |= ZMODE_XLU; + } else { + rm |= ZMODE_OPA; + } + + gfx.push_back(gsSPTexture(0, 0, 0, G_TX_RENDERTILE, G_OFF)); + gfx.push_back(gsDPSetCycleType(G_CYC_1CYCLE)); + gfx.push_back(gsDPSetRenderMode(rm | blc1, rm | blc2)); + + if (isShaded) { + gfx.push_back(gsDPSetCombineMode(G_CC_MODULATERGB_PRIM_ENVA, G_CC_MODULATERGB_PRIM_ENVA)); + gfx.push_back(gsSPLoadGeometryMode(G_CULL_BACK | G_ZBUFFER | G_LIGHTING)); + } else { + gfx.push_back(gsDPSetCombineMode(G_CC_PRIMITIVE_ENVA, G_CC_PRIMITIVE_ENVA)); + gfx.push_back(gsSPLoadGeometryMode(G_ZBUFFER)); + } + + gfx.push_back(gsDPSetEnvColor(0xFF, 0xFF, 0xFF, alpha)); +} + +// Draws a dynapoly structure (scenes or Bg Actors) +void DrawDynapoly(std::vector& dl, CollisionHeader* col, int32_t bgId) { + uint32_t color = sceneColor; + uint32_t lastColor = color; + dl.push_back(gsDPSetPrimColor(0, 0, (color >> 24) & 0xFF, (color >> 16) & 0xFF, (color >> 8) & 0xFF, + (color >> 0) & 0xFF)); + + // This keeps track of if we have processed a poly, but not drawn it yet so we can batch them. + // This saves several hundred commands in larger scenes + bool previousPoly = false; + + for (int i = 0; i < col->numPolygons; i++) { + CollisionPoly* poly = &col->polyList[i]; + + if (SurfaceType_IsHookshotSurface(&gGlobalCtx->colCtx, poly, bgId)) { + color = hookshotColor; + } else if (func_80041D94(&gGlobalCtx->colCtx, poly, bgId) > 0x01) { + color = interactableColor; + } else if (func_80041E80(&gGlobalCtx->colCtx, poly, bgId) == 0x0C) { + color = voidColor; + } else if (SurfaceType_GetSceneExitIndex(&gGlobalCtx->colCtx, poly, bgId) || + func_80041E80(&gGlobalCtx->colCtx, poly, bgId) == 0x05) { + color = entranceColor; + } else if (func_80041D4C(&gGlobalCtx->colCtx, poly, bgId) != 0 || + SurfaceType_IsWallDamage(&gGlobalCtx->colCtx, poly, bgId)) { + color = specialSurfaceColor; + } else if (SurfaceType_GetSlope(&gGlobalCtx->colCtx, poly, bgId) == 0x01) { + color = slopeColor; + } else { + color = sceneColor; + } + + if (lastColor != color) { + // Color changed, flush previous poly + if (previousPoly) { + dl.push_back(gsSPVertex((uintptr_t)&vtxDl.at(vtxDl.size() - 3), 3, 0)); + dl.push_back(gsSP1Triangle(0, 1, 2, 0)); + previousPoly = false; + } + dl.push_back(gsDPSetPrimColor(0, 0, (color >> 24) & 0xFF, (color >> 16) & 0xFF, (color >> 8) & 0xFF, + (color >> 0) & 0xFF)); + } + lastColor = color; + + Vec3s* va = &col->vtxList[COLPOLY_VTX_INDEX(poly->flags_vIA)]; + Vec3s* vb = &col->vtxList[COLPOLY_VTX_INDEX(poly->flags_vIB)]; + Vec3s* vc = &col->vtxList[COLPOLY_VTX_INDEX(poly->vIC)]; + vtxDl.push_back(gdSPDefVtxN(va->x, va->y, va->z, 0, 0, (signed char)(poly->normal.x / 0x100), + (signed char)(poly->normal.y / 0x100), (signed char)(poly->normal.z / 0x100), + 0xFF)); + vtxDl.push_back(gdSPDefVtxN(vb->x, vb->y, vb->z, 0, 0, (signed char)(poly->normal.x / 0x100), + (signed char)(poly->normal.y / 0x100), (signed char)(poly->normal.z / 0x100), + 0xFF)); + vtxDl.push_back(gdSPDefVtxN(vc->x, vc->y, vc->z, 0, 0, (signed char)(poly->normal.x / 0x100), + (signed char)(poly->normal.y / 0x100), (signed char)(poly->normal.z / 0x100), + 0xFF)); + + if (previousPoly) { + dl.push_back(gsSPVertex((uintptr_t)&vtxDl.at(vtxDl.size() - 6), 6, 0)); + dl.push_back(gsSP2Triangles(0, 1, 2, 0, 3, 4, 5, 0)); + previousPoly = false; + } else { + previousPoly = true; + } + } + + // Flush previous poly if this is the end and there's no more coming + if (previousPoly) { + dl.push_back(gsSPVertex((uintptr_t)&vtxDl.at(vtxDl.size() - 3), 3, 0)); + dl.push_back(gsSP1Triangle(0, 1, 2, 0)); + previousPoly = false; + } +} + +// Draws the scene +void DrawSceneCollision() { + if (showSceneColSetting == ColRenderSetting::Disabled) { + return; + } + + std::vector& dl = (showSceneColSetting == ColRenderSetting::Transparent) ? xluDl : opaDl; + InitGfx(dl, showSceneColSetting); + dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH)); + + DrawDynapoly(dl, gGlobalCtx->colCtx.colHeader, BGCHECK_SCENE); +} + +// Draws all Bg Actors +void DrawBgActorCollision() { + if (showBgActorSetting == ColRenderSetting::Disabled) { + return; + } + + std::vector& dl = (showBgActorSetting == ColRenderSetting::Transparent) ? xluDl : opaDl; + InitGfx(dl, showBgActorSetting); + dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH)); + + for (int32_t bgIndex = 0; bgIndex < BG_ACTOR_MAX; bgIndex++) { + if (gGlobalCtx->colCtx.dyna.bgActorFlags[bgIndex] & 1) { + BgActor& bg = gGlobalCtx->colCtx.dyna.bgActors[bgIndex]; + Mtx m; + MtxF mf; + SkinMatrix_SetTranslateRotateYXZScale(&mf, bg.curTransform.scale.x, bg.curTransform.scale.y, + bg.curTransform.scale.z, bg.curTransform.rot.x, bg.curTransform.rot.y, + bg.curTransform.rot.z, bg.curTransform.pos.x, bg.curTransform.pos.y, + bg.curTransform.pos.z); + guMtxF2L(&mf, &m); + mtxDl.push_back(m); + dl.push_back(gsSPMatrix(&mtxDl.back(), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH)); + + DrawDynapoly(dl, bg.colHeader, bgIndex); + + dl.push_back(gsSPPopMatrix(G_MTX_MODELVIEW)); + } + } + +} + +// Draws a quad +void DrawQuad(std::vector& dl, Vec3f& v0, Vec3f& v1, Vec3f& v2, Vec3f& v3) { + Vec3f norm; + CalcTriNorm(v0, v1, v2, norm); + + vtxDl.push_back(gdSPDefVtxN((short)v0.x, (short)v0.y, (short)v0.z, 0, 0, (signed char)norm.x, (signed char)norm.y, + (signed char)norm.z, 0xFF)); + vtxDl.push_back(gdSPDefVtxN((short)v1.x, (short)v1.y, (short)v1.z, 0, 0, (signed char)norm.x, (signed char)norm.y, + (signed char)norm.z, 0xFF)); + vtxDl.push_back(gdSPDefVtxN((short)v2.x, (short)v2.y, (short)v2.z, 0, 0, (signed char)norm.x, (signed char)norm.y, + (signed char)norm.z, 0xFF)); + vtxDl.push_back(gdSPDefVtxN((short)v3.x, (short)v3.y, (short)v3.z, 0, 0, (signed char)norm.x, (signed char)norm.y, + (signed char)norm.z, 0xFF)); + dl.push_back(gsSPVertex((uintptr_t)&vtxDl.at(vtxDl.size() - 4), 4, 0)); + dl.push_back(gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0)); +} + +// Draws a list of Col Check objects +void DrawColCheckList(std::vector& dl, Collider** objects, int32_t count) { + for (int32_t colIndex = 0; colIndex < count; colIndex++) { + Collider* col = objects[colIndex]; + switch (col->shape) { + case COLSHAPE_JNTSPH: { + ColliderJntSph* jntSph = (ColliderJntSph*)col; + + for (int32_t sphereIndex = 0; sphereIndex < jntSph->count; sphereIndex++) { + ColliderJntSphElement* sph = &jntSph->elements[sphereIndex]; + + Mtx m; + MtxF mf; + SkinMatrix_SetTranslate(&mf, sph->dim.worldSphere.center.x, sph->dim.worldSphere.center.y, + sph->dim.worldSphere.center.z); + MtxF ms; + int32_t radius = sph->dim.worldSphere.radius == 0 ? 1 : sph->dim.worldSphere.radius; + SkinMatrix_SetScale(&ms, radius / 128.0f, radius / 128.0f, radius / 128.0f); + MtxF dest; + SkinMatrix_MtxFMtxFMult(&mf, &ms, &dest); + guMtxF2L(&dest, &m); + mtxDl.push_back(m); + + dl.push_back(gsSPMatrix(&mtxDl.back(), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH)); + dl.push_back(gsSPDisplayList(sphereGfx.data())); + dl.push_back(gsSPPopMatrix(G_MTX_MODELVIEW)); + } + } break; + case COLSHAPE_CYLINDER: { + ColliderCylinder* cyl = (ColliderCylinder*)col; + + Mtx m; + MtxF mt; + SkinMatrix_SetTranslate(&mt, cyl->dim.pos.x, cyl->dim.pos.y, cyl->dim.pos.z); + MtxF ms; + int32_t radius = cyl->dim.radius == 0 ? 1 : cyl->dim.radius; + SkinMatrix_SetScale(&ms, radius / 128.0f, cyl->dim.height / 128.0f, radius / 128.0f); + MtxF dest; + SkinMatrix_MtxFMtxFMult(&mt, &ms, &dest); + guMtxF2L(&dest, &m); + mtxDl.push_back(m); + + dl.push_back(gsSPMatrix(&mtxDl.back(), G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_PUSH)); + dl.push_back(gsSPDisplayList(cylinderGfx.data())); + dl.push_back(gsSPPopMatrix(G_MTX_MODELVIEW)); + } break; + case COLSHAPE_TRIS: { + ColliderTris* tris = (ColliderTris*)col; + for (int32_t triIndex = 0; triIndex < tris->count; triIndex++) { + ColliderTrisElement* tri = &tris->elements[triIndex]; + + vtxDl.push_back(gdSPDefVtxN((short)tri->dim.vtx[0].x, (short)tri->dim.vtx[0].y, + (short)tri->dim.vtx[0].z, 0, 0, (signed char)tri->dim.plane.normal.x, + (signed char)tri->dim.plane.normal.y, + (signed char)tri->dim.plane.normal.z, 0xFF)); + vtxDl.push_back(gdSPDefVtxN((short)tri->dim.vtx[1].x, (short)tri->dim.vtx[1].y, + (short)tri->dim.vtx[1].z, 0, 0, (signed char)tri->dim.plane.normal.x, + (signed char)tri->dim.plane.normal.y, + (signed char)tri->dim.plane.normal.z, 0xFF)); + vtxDl.push_back(gdSPDefVtxN((short)tri->dim.vtx[2].x, (short)tri->dim.vtx[2].y, + (short)tri->dim.vtx[2].z, 0, 0, (signed char)tri->dim.plane.normal.x, + (signed char)tri->dim.plane.normal.y, + (signed char)tri->dim.plane.normal.z, 0xFF)); + dl.push_back(gsSPVertex((uintptr_t)&vtxDl.at(vtxDl.size() - 3), 3, 0)); + dl.push_back(gsSP1Triangle(0, 1, 2, 0)); + } + } break; + case COLSHAPE_QUAD: { + ColliderQuad* quad = (ColliderQuad*)col; + DrawQuad(dl, quad->dim.quad[0], quad->dim.quad[2], quad->dim.quad[3], quad->dim.quad[1]); + } break; + default: + break; + } + } +} + +// Draws all Col Check objects +void DrawColCheckCollision() { + if (showColCheckSetting == ColRenderSetting::Disabled) { + return; + } + + std::vector& dl = (showColCheckSetting == ColRenderSetting::Transparent) ? xluDl : opaDl; + InitGfx(dl, showColCheckSetting); + dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH)); + + CollisionCheckContext& col = gGlobalCtx->colChkCtx; + + dl.push_back(gsDPSetPrimColor(0, 0, (ocColor >> 24) & 0xFF, (ocColor >> 16) & 0xFF, (ocColor >> 8) & 0xFF, + (ocColor >> 0) & 0xFF)); + DrawColCheckList(dl, col.colOC, col.colOCCount); + + dl.push_back(gsDPSetPrimColor(0, 0, (acColor >> 24) & 0xFF, (acColor >> 16) & 0xFF, (acColor >> 8) & 0xFF, + (acColor >> 0) & 0xFF)); + DrawColCheckList(dl, col.colAC, col.colACCount); + + dl.push_back(gsDPSetPrimColor(0, 0, (atColor >> 24) & 0xFF, (atColor >> 16) & 0xFF, (atColor >> 8) & 0xFF, + (atColor >> 0) & 0xFF)); + DrawColCheckList(dl, col.colAT, col.colATCount); +} + +// Draws a waterbox +void DrawWaterbox(std::vector& dl, WaterBox* water, float water_max_depth = -4000.0f) { + // Skip waterboxes that would be disabled in current room + int32_t room = ((water->properties >> 13) & 0x3F); + if ((room != gGlobalCtx->roomCtx.curRoom.num) && (room != 0x3F)) { + return; + } + + Vec3f vtx[] = { + { water->xMin, water->ySurface, water->zMin + water->zLength }, + { water->xMin + water->xLength, water->ySurface, water->zMin + water->zLength }, + { water->xMin + water->xLength, water->ySurface, water->zMin }, + { water->xMin, water->ySurface, water->zMin }, + { water->xMin, water_max_depth, water->zMin + water->zLength }, + { water->xMin + water->xLength, water_max_depth, water->zMin + water->zLength }, + { water->xMin + water->xLength, water_max_depth, water->zMin }, + { water->xMin, water_max_depth, water->zMin }, + }; + DrawQuad(dl, vtx[0], vtx[1], vtx[2], vtx[3]); + DrawQuad(dl, vtx[0], vtx[3], vtx[7], vtx[4]); + DrawQuad(dl, vtx[1], vtx[0], vtx[4], vtx[5]); + DrawQuad(dl, vtx[2], vtx[1], vtx[5], vtx[6]); + DrawQuad(dl, vtx[3], vtx[2], vtx[6], vtx[7]); +} + +extern "C" WaterBox zdWaterBox; +extern "C" f32 zdWaterBoxMinY; + +// Draws all waterboxes +void DrawWaterboxList() { + if (showWaterboxSetting == ColRenderSetting::Disabled) { + return; + } + + std::vector& dl = (showWaterboxSetting == ColRenderSetting::Transparent) ? xluDl : opaDl; + InitGfx(dl, showWaterboxSetting); + dl.push_back(gsSPMatrix(&gMtxClear, G_MTX_MODELVIEW | G_MTX_LOAD | G_MTX_NOPUSH)); + dl.push_back(gsDPSetPrimColor(0, 0, (waterboxColor >> 24) & 0xFF, (waterboxColor >> 16) & 0xFF, + (waterboxColor >> 8) & 0xFF, (waterboxColor >> 0) & 0xFF)); + + CollisionHeader* col = gGlobalCtx->colCtx.colHeader; + for (int32_t waterboxIndex = 0; waterboxIndex < col->numWaterBoxes; waterboxIndex++) { + WaterBox* water = &col->waterBoxes[waterboxIndex]; + DrawWaterbox(dl, water); + } + + // Zora's Domain has a special, hard-coded waterbox with a bottom so you can go under the waterfall + if (gGlobalCtx->sceneNum == SCENE_SPOT07) { + DrawWaterbox(dl, &zdWaterBox, zdWaterBoxMinY); + } +} + +// Resets a vector for the next frame and returns the capacity +template +size_t ResetVector(T& vec) { + size_t oldSize = vec.size(); + vec.clear(); + // Reserve slightly more space than last frame to account for variance (such as different amounts of bg actors) + vec.reserve(oldSize * 1.2); + return vec.capacity(); +} + +void DrawColViewer() { + if (gGlobalCtx == nullptr) { + return; + } + + ResetVector(opaDl); + ResetVector(xluDl); + size_t vtxDlCapacity = ResetVector(vtxDl); + size_t mtxDlCapacity = ResetVector(mtxDl); + + DrawSceneCollision(); + DrawBgActorCollision(); + DrawColCheckCollision(); + DrawWaterboxList(); + + // Check if we used up more space than we reserved. If so, redo the drawing with our new sizes. + // This is because we resized the vectors while drawing, invalidating pointers to them. + // This only matters for the Vtx and Mtx vectors. + if ((vtxDl.size() > vtxDlCapacity) || (mtxDl.size() > mtxDlCapacity)) { + ResetVector(opaDl); + ResetVector(xluDl); + vtxDlCapacity = ResetVector(vtxDl); + mtxDlCapacity = ResetVector(mtxDl); + + DrawSceneCollision(); + DrawBgActorCollision(); + DrawColCheckCollision(); + DrawWaterboxList(); + } + + if ((vtxDl.size() > vtxDlCapacity) || (mtxDl.size() > mtxDlCapacity)) { + // If the sizes somehow changed between the two draws, we can't continue because we may be using invalid data + printf("Error drawing collision, vertex/matrix sizes didn't settle.\n"); + return; + } + + OPEN_DISPS(gGlobalCtx->state.gfxCtx, "", 0); + + opaDl.push_back(gsSPEndDisplayList()); + gSPDisplayList(POLY_OPA_DISP++, opaDl.data()); + + xluDl.push_back(gsSPEndDisplayList()); + gSPDisplayList(POLY_XLU_DISP++, xluDl.data()); + + CLOSE_DISPS(gGlobalCtx->state.gfxCtx, "", 0); +} diff --git a/soh/soh/Enhancements/debugger/colViewer.h b/soh/soh/Enhancements/debugger/colViewer.h new file mode 100644 index 000000000..e38da7951 --- /dev/null +++ b/soh/soh/Enhancements/debugger/colViewer.h @@ -0,0 +1,4 @@ +#pragma once + +void InitColViewer(); +void DrawColViewer(); \ No newline at end of file diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.cpp b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp new file mode 100644 index 000000000..ca1b67798 --- /dev/null +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.cpp @@ -0,0 +1,1603 @@ +#include "debugSaveEditor.h" +#include "../../util.h" +#include "../libultraship/SohImGuiImpl.h" +#include "ImGuiHelpers.h" + +#include +#include +#include +#include + +extern "C" { +#include +#include "variables.h" +#include "functions.h" +#include "macros.h" +extern GlobalContext* gGlobalCtx; + +#include "textures/icon_item_static/icon_item_static.h" +#include "textures/icon_item_24_static/icon_item_24_static.h" +} + +typedef struct { + uint32_t id; + std::string name; + std::string nameFaded; + std::string texturePath; +} ItemMapEntry; + +#define ITEM_MAP_ENTRY(id) \ + { \ + id, { \ + id, #id, #id "_Faded", static_cast(gItemIcons[id]) \ + } \ + } + +// Maps items ids to info for use in ImGui +std::map itemMapping = { + ITEM_MAP_ENTRY(ITEM_STICK), + ITEM_MAP_ENTRY(ITEM_NUT), + ITEM_MAP_ENTRY(ITEM_BOMB), + ITEM_MAP_ENTRY(ITEM_BOW), + ITEM_MAP_ENTRY(ITEM_ARROW_FIRE), + ITEM_MAP_ENTRY(ITEM_DINS_FIRE), + ITEM_MAP_ENTRY(ITEM_SLINGSHOT), + ITEM_MAP_ENTRY(ITEM_OCARINA_FAIRY), + ITEM_MAP_ENTRY(ITEM_OCARINA_TIME), + ITEM_MAP_ENTRY(ITEM_BOMBCHU), + ITEM_MAP_ENTRY(ITEM_HOOKSHOT), + ITEM_MAP_ENTRY(ITEM_LONGSHOT), + ITEM_MAP_ENTRY(ITEM_ARROW_ICE), + ITEM_MAP_ENTRY(ITEM_FARORES_WIND), + ITEM_MAP_ENTRY(ITEM_BOOMERANG), + ITEM_MAP_ENTRY(ITEM_LENS), + ITEM_MAP_ENTRY(ITEM_BEAN), + ITEM_MAP_ENTRY(ITEM_HAMMER), + ITEM_MAP_ENTRY(ITEM_ARROW_LIGHT), + ITEM_MAP_ENTRY(ITEM_NAYRUS_LOVE), + ITEM_MAP_ENTRY(ITEM_BOTTLE), + ITEM_MAP_ENTRY(ITEM_POTION_RED), + ITEM_MAP_ENTRY(ITEM_POTION_GREEN), + ITEM_MAP_ENTRY(ITEM_POTION_BLUE), + ITEM_MAP_ENTRY(ITEM_FAIRY), + ITEM_MAP_ENTRY(ITEM_FISH), + ITEM_MAP_ENTRY(ITEM_MILK_BOTTLE), + ITEM_MAP_ENTRY(ITEM_LETTER_RUTO), + ITEM_MAP_ENTRY(ITEM_BLUE_FIRE), + ITEM_MAP_ENTRY(ITEM_BUG), + ITEM_MAP_ENTRY(ITEM_BIG_POE), + ITEM_MAP_ENTRY(ITEM_MILK_HALF), + ITEM_MAP_ENTRY(ITEM_POE), + ITEM_MAP_ENTRY(ITEM_WEIRD_EGG), + ITEM_MAP_ENTRY(ITEM_CHICKEN), + ITEM_MAP_ENTRY(ITEM_LETTER_ZELDA), + ITEM_MAP_ENTRY(ITEM_MASK_KEATON), + ITEM_MAP_ENTRY(ITEM_MASK_SKULL), + ITEM_MAP_ENTRY(ITEM_MASK_SPOOKY), + ITEM_MAP_ENTRY(ITEM_MASK_BUNNY), + ITEM_MAP_ENTRY(ITEM_MASK_GORON), + ITEM_MAP_ENTRY(ITEM_MASK_ZORA), + ITEM_MAP_ENTRY(ITEM_MASK_GERUDO), + ITEM_MAP_ENTRY(ITEM_MASK_TRUTH), + ITEM_MAP_ENTRY(ITEM_SOLD_OUT), + ITEM_MAP_ENTRY(ITEM_POCKET_EGG), + ITEM_MAP_ENTRY(ITEM_POCKET_CUCCO), + ITEM_MAP_ENTRY(ITEM_COJIRO), + ITEM_MAP_ENTRY(ITEM_ODD_MUSHROOM), + ITEM_MAP_ENTRY(ITEM_ODD_POTION), + ITEM_MAP_ENTRY(ITEM_SAW), + ITEM_MAP_ENTRY(ITEM_SWORD_BROKEN), + ITEM_MAP_ENTRY(ITEM_PRESCRIPTION), + ITEM_MAP_ENTRY(ITEM_FROG), + ITEM_MAP_ENTRY(ITEM_EYEDROPS), + ITEM_MAP_ENTRY(ITEM_CLAIM_CHECK), + ITEM_MAP_ENTRY(ITEM_BOW_ARROW_FIRE), + ITEM_MAP_ENTRY(ITEM_BOW_ARROW_ICE), + ITEM_MAP_ENTRY(ITEM_BOW_ARROW_LIGHT), + ITEM_MAP_ENTRY(ITEM_SWORD_KOKIRI), + ITEM_MAP_ENTRY(ITEM_SWORD_MASTER), + ITEM_MAP_ENTRY(ITEM_SWORD_BGS), + ITEM_MAP_ENTRY(ITEM_SHIELD_DEKU), + ITEM_MAP_ENTRY(ITEM_SHIELD_HYLIAN), + ITEM_MAP_ENTRY(ITEM_SHIELD_MIRROR), + ITEM_MAP_ENTRY(ITEM_TUNIC_KOKIRI), + ITEM_MAP_ENTRY(ITEM_TUNIC_GORON), + ITEM_MAP_ENTRY(ITEM_TUNIC_ZORA), + ITEM_MAP_ENTRY(ITEM_BOOTS_KOKIRI), + ITEM_MAP_ENTRY(ITEM_BOOTS_IRON), + ITEM_MAP_ENTRY(ITEM_BOOTS_HOVER), + ITEM_MAP_ENTRY(ITEM_BULLET_BAG_30), + ITEM_MAP_ENTRY(ITEM_BULLET_BAG_40), + ITEM_MAP_ENTRY(ITEM_BULLET_BAG_50), + ITEM_MAP_ENTRY(ITEM_QUIVER_30), + ITEM_MAP_ENTRY(ITEM_QUIVER_40), + ITEM_MAP_ENTRY(ITEM_QUIVER_50), + ITEM_MAP_ENTRY(ITEM_BOMB_BAG_20), + ITEM_MAP_ENTRY(ITEM_BOMB_BAG_30), + ITEM_MAP_ENTRY(ITEM_BOMB_BAG_40), + ITEM_MAP_ENTRY(ITEM_BRACELET), + ITEM_MAP_ENTRY(ITEM_GAUNTLETS_SILVER), + ITEM_MAP_ENTRY(ITEM_GAUNTLETS_GOLD), + ITEM_MAP_ENTRY(ITEM_SCALE_SILVER), + ITEM_MAP_ENTRY(ITEM_SCALE_GOLDEN), + ITEM_MAP_ENTRY(ITEM_SWORD_KNIFE), + ITEM_MAP_ENTRY(ITEM_WALLET_ADULT), + ITEM_MAP_ENTRY(ITEM_WALLET_GIANT), + ITEM_MAP_ENTRY(ITEM_SEEDS), + ITEM_MAP_ENTRY(ITEM_FISHING_POLE), + ITEM_MAP_ENTRY(ITEM_KEY_BOSS), + ITEM_MAP_ENTRY(ITEM_COMPASS), + ITEM_MAP_ENTRY(ITEM_DUNGEON_MAP), + ITEM_MAP_ENTRY(ITEM_KEY_SMALL), +}; + +// Maps entries in the GS flag array to the area name it represents +std::vector gsMapping = { + "Deku Tree", + "Dodongo's Cavern", + "Inside Jabu-Jabu's Belly", + "Forest Temple", + "Fire Temple", + "Water Temple", + "Spirit Temple", + "Shadow Temple", + "Bottom of the Well", + "Ice Cavern", + "Hyrule Field", + "Lon Lon Ranch", + "Kokiri Forest", + "Lost Woods, Sacred Forest Meadow", + "Castle Town and Ganon's Castle", + "Death Mountain Trail, Goron City", + "Kakariko Village", + "Zora Fountain, River", + "Lake Hylia", + "Gerudo Valley", + "Gerudo Fortress", + "Desert Colossus, Haunted Wasteland", +}; + +extern "C" u8 gAreaGsFlags[]; + +extern "C" u8 gAmmoItems[]; + +// Modification of gAmmoItems that replaces ITEM_NONE with the item in inventory slot it represents +u8 gAllAmmoItems[] = { + ITEM_STICK, ITEM_NUT, ITEM_BOMB, ITEM_BOW, ITEM_ARROW_FIRE, ITEM_DINS_FIRE, + ITEM_SLINGSHOT, ITEM_OCARINA_TIME, ITEM_BOMBCHU, ITEM_LONGSHOT, ITEM_ARROW_ICE, ITEM_FARORES_WIND, + ITEM_BOOMERANG, ITEM_LENS, ITEM_BEAN, ITEM_HAMMER, +}; + +typedef struct { + uint32_t id; + std::string name; + std::string nameFaded; + std::string texturePath; +} QuestMapEntry; + +#define QUEST_MAP_ENTRY(id, tex) \ + { \ + id, { \ + id, #id, #id "_Faded", tex \ + } \ + } + +// Maps quest items ids to info for use in ImGui +std::map questMapping = { + QUEST_MAP_ENTRY(QUEST_MEDALLION_FOREST, gForestMedallionIconTex), + QUEST_MAP_ENTRY(QUEST_MEDALLION_FIRE, gFireMedallionIconTex), + QUEST_MAP_ENTRY(QUEST_MEDALLION_WATER, gWaterMedallionIconTex), + QUEST_MAP_ENTRY(QUEST_MEDALLION_SPIRIT, gSpiritMedallionIconTex), + QUEST_MAP_ENTRY(QUEST_MEDALLION_SHADOW, gShadowMedallionIconTex), + QUEST_MAP_ENTRY(QUEST_MEDALLION_LIGHT, gLightMedallionIconTex), + QUEST_MAP_ENTRY(QUEST_KOKIRI_EMERALD, gKokiriEmeraldIconTex), + QUEST_MAP_ENTRY(QUEST_GORON_RUBY, gGoronRubyIconTex), + QUEST_MAP_ENTRY(QUEST_ZORA_SAPPHIRE, gZoraSapphireIconTex), + QUEST_MAP_ENTRY(QUEST_STONE_OF_AGONY, gStoneOfAgonyIconTex), + QUEST_MAP_ENTRY(QUEST_GERUDO_CARD, gGerudosCardIconTex), +}; + +typedef struct { + uint32_t id; + std::string name; + std::string nameFaded; + ImVec4 color; +} SongMapEntry; + +#define SONG_MAP_ENTRY(id, r, g, b) \ + { \ + id, #id, #id "_Faded", ImVec4(r / 255.0f, g / 255.0f, b / 255.0f, 1.0f) \ + } + +// Maps song ids to info for use in ImGui +std::array songMapping = { { + SONG_MAP_ENTRY(QUEST_SONG_LULLABY, 255, 255, 255), + SONG_MAP_ENTRY(QUEST_SONG_EPONA, 255, 255, 255), + SONG_MAP_ENTRY(QUEST_SONG_SARIA, 255, 255, 255), + SONG_MAP_ENTRY(QUEST_SONG_SUN, 255, 255, 255), + SONG_MAP_ENTRY(QUEST_SONG_TIME, 255, 255, 255), + SONG_MAP_ENTRY(QUEST_SONG_STORMS, 255, 255, 255), + SONG_MAP_ENTRY(QUEST_SONG_MINUET, 150, 255, 100), + SONG_MAP_ENTRY(QUEST_SONG_BOLERO, 255, 80, 40), + SONG_MAP_ENTRY(QUEST_SONG_SERENADE, 100, 150, 255), + SONG_MAP_ENTRY(QUEST_SONG_REQUIEM, 255, 160, 0), + SONG_MAP_ENTRY(QUEST_SONG_NOCTURNE, 255, 100, 255), + SONG_MAP_ENTRY(QUEST_SONG_PRELUDE, 255, 240, 100), +} }; + +// Encapsulates what is drawn by the passed-in function within a border +template +void DrawGroupWithBorder(T&& drawFunc) { + // First group encapsulates the inner portion and border + ImGui::BeginGroup(); + + ImVec2 padding = ImGui::GetStyle().FramePadding; + ImVec2 p0 = ImGui::GetCursorScreenPos(); + ImGui::SetCursorScreenPos(ImVec2(p0.x + padding.x, p0.y + padding.y)); + + // Second group encapsulates just the inner portion + ImGui::BeginGroup(); + + drawFunc(); + + ImGui::Dummy(padding); + ImGui::EndGroup(); + + ImVec2 p1 = ImGui::GetItemRectMax(); + p1.x += padding.x; + ImVec4 borderCol = ImGui::GetStyle().Colors[ImGuiCol_Border]; + ImGui::GetWindowDrawList()->AddRect(p0, p1, IM_COL32(borderCol.x * 255, borderCol.y * 255, borderCol.z * 255, borderCol.w * 255)); + + ImGui::EndGroup(); +} + +char z2ASCII(int code) { + int ret; + if (code < 10) { //Digits + ret = code + 0x30; + } else if (code >= 10 && code < 36) { //Uppercase letters + ret = code + 0x37; + } else if (code >= 36 && code < 62) { //Lowercase letters + ret = code + 0x3D; + } else if (code == 62) { //Space + ret = code - 0x1E; + } else if (code == 63 || code == 64) { // _ and . + ret = code - 0x12; + } else { + ret = code; + } + return char(ret); + +} + +void DrawInfoTab() { + // TODO Needs a better method for name changing but for now this will work. + std::string name; + ImU16 one = 1; + for (int i = 0; i < 8; i++) { + char letter = z2ASCII(gSaveContext.playerName[i]); + name += letter; + } + name += '\0'; + + ImGui::PushItemWidth(ImGui::GetFontSize() * 6); + + ImGui::Text("Name: %s", name.c_str()); + InsertHelpHoverText("Player Name"); + std::string nameID; + for (int i = 0; i < 8; i++) { + nameID = z2ASCII(i); + if (i % 4 != 0) { + ImGui::SameLine(); + } + ImGui::InputScalar(nameID.c_str(), ImGuiDataType_U8, &gSaveContext.playerName[i], &one, NULL); + } + + // Use an intermediary to keep the health from updating (and potentially killing the player) + // until it is done being edited + int16_t healthIntermediary = gSaveContext.healthCapacity; + ImGui::InputScalar("Max Health", ImGuiDataType_S16, &healthIntermediary); + if (ImGui::IsItemDeactivated()) { + gSaveContext.healthCapacity = healthIntermediary; + } + InsertHelpHoverText("Maximum health. 16 units per full heart"); + if (gSaveContext.health > gSaveContext.healthCapacity) { + gSaveContext.health = gSaveContext.healthCapacity; // Clamp health to new max + } + + const uint16_t healthMin = 0; + const uint16_t healthMax = gSaveContext.healthCapacity; + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); + ImGui::SliderScalar("Health", ImGuiDataType_S16, &gSaveContext.health, &healthMin, &healthMax); + InsertHelpHoverText("Current health. 16 units per full heart"); + + bool doubleDefense = gSaveContext.doubleDefense != 0; + if (ImGui::Checkbox("Double Defense", &doubleDefense)) { + gSaveContext.doubleDefense = doubleDefense; + gSaveContext.inventory.defenseHearts = + gSaveContext.doubleDefense ? 20 : 0; // Set to get the border drawn in the UI + } + InsertHelpHoverText("Is double defense unlocked?"); + + std::string magicName; + if (gSaveContext.magicLevel == 2) { + magicName = "Double"; + } else if (gSaveContext.magicLevel == 1) { + magicName = "Single"; + } else { + magicName = "None"; + } + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 6); + if (ImGui::BeginCombo("Magic Level", magicName.c_str())) { + if (ImGui::Selectable("Double")) { + gSaveContext.magicLevel = 2; + gSaveContext.magicAcquired = true; + gSaveContext.doubleMagic = true; + } + if (ImGui::Selectable("Single")) { + gSaveContext.magicLevel = 1; + gSaveContext.magicAcquired = true; + gSaveContext.doubleMagic = false; + } + if (ImGui::Selectable("None")) { + gSaveContext.magicLevel = 0; + gSaveContext.magicAcquired = false; + gSaveContext.doubleMagic = false; + } + + ImGui::EndCombo(); + } + InsertHelpHoverText("Current magic level"); + gSaveContext.unk_13F4 = gSaveContext.magicLevel * 0x30; // Set to get the bar drawn in the UI + if (gSaveContext.magic > gSaveContext.unk_13F4) { + gSaveContext.magic = gSaveContext.unk_13F4; // Clamp magic to new max + } + + const uint8_t magicMin = 0; + const uint8_t magicMax = gSaveContext.unk_13F4; + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); + ImGui::SliderScalar("Magic", ImGuiDataType_S8, &gSaveContext.magic, &magicMin, &magicMax); + InsertHelpHoverText("Current magic. 48 units per magic level"); + + ImGui::InputScalar("Rupees", ImGuiDataType_S16, &gSaveContext.rupees); + InsertHelpHoverText("Current rupees"); + + const uint16_t dayTimeMin = 0; + const uint16_t dayTimeMax = 0xFFFF; + ImGui::SetNextItemWidth(ImGui::GetFontSize() * 15); + ImGui::SliderScalar("Time", ImGuiDataType_U16, &gSaveContext.dayTime, &dayTimeMin, &dayTimeMax); + InsertHelpHoverText("Time of day"); + if (ImGui::Button("Dawn")) { + gSaveContext.dayTime = 0x4000; + } + ImGui::SameLine(); + if (ImGui::Button("Noon")) { + gSaveContext.dayTime = 0x8000; + } + ImGui::SameLine(); + if (ImGui::Button("Sunset")) { + gSaveContext.dayTime = 0xC000; + } + ImGui::SameLine(); + if (ImGui::Button("Midnight")) { + gSaveContext.dayTime = 0; + } + + ImGui::InputScalar("Total Days", ImGuiDataType_S32, &gSaveContext.totalDays); + InsertHelpHoverText("Total number of days elapsed since the start of the game"); + + ImGui::InputScalar("Deaths", ImGuiDataType_U16, &gSaveContext.deaths); + InsertHelpHoverText("Total number of deaths"); + + bool bgsFlag = gSaveContext.bgsFlag != 0; + if (ImGui::Checkbox("Has BGS", &bgsFlag)) { + gSaveContext.bgsFlag = bgsFlag; + } + InsertHelpHoverText("Is Biggoron sword unlocked? Replaces Giant's knife"); + + ImGui::InputScalar("Sword Health", ImGuiDataType_U16, &gSaveContext.swordHealth); + InsertHelpHoverText("Giant's knife health. Default is 8. Must be >0 for Biggoron sword to work"); + + ImGui::InputScalar("Bgs Day Count", ImGuiDataType_S32, &gSaveContext.bgsDayCount); + InsertHelpHoverText("Total number of days elapsed since giving Biggoron the claim check"); + + ImGui::InputScalar("Entrance Index", ImGuiDataType_S32, &gSaveContext.entranceIndex); + InsertHelpHoverText("From which entrance did Link arrive?"); + + ImGui::InputScalar("Cutscene Index", ImGuiDataType_S32, &gSaveContext.cutsceneIndex); + InsertHelpHoverText("Which cutscene is this?"); + + ImGui::InputScalar("Navi Timer", ImGuiDataType_U16, &gSaveContext.naviTimer); + InsertHelpHoverText("Navi wants to talk at 600 units, decides not to at 3000."); + + ImGui::InputScalar("Timer 1 State", ImGuiDataType_S16, &gSaveContext.timer1State); + InsertHelpHoverText("Heat timer, race timer, etc. Has white font"); + + ImGui::InputScalar("Timer 1 Value", ImGuiDataType_S16, &gSaveContext.timer1Value, &one, NULL); + InsertHelpHoverText("Time, in seconds"); + + ImGui::InputScalar("Timer 2 State", ImGuiDataType_S16, &gSaveContext.timer2State); + InsertHelpHoverText("Trade timer, Ganon collapse timer, etc. Has yellow font"); + + ImGui::InputScalar("Timer 2 Value", ImGuiDataType_S16, &gSaveContext.timer2Value, &one, NULL); + InsertHelpHoverText("Time, in seconds"); + + const char* audioName; + switch (gSaveContext.audioSetting) { + case 0: + audioName = "Stereo"; + break; + case 1: + audioName = "Mono"; + break; + case 2: + audioName = "Headset"; + break; + case 3: + audioName = "Surround"; + break; + default: + audioName = "?"; + } + if (ImGui::BeginCombo("Audio", audioName)) { + if (ImGui::Selectable("Stereo")) { + gSaveContext.audioSetting = 0; + } + if (ImGui::Selectable("Mono")) { + gSaveContext.audioSetting = 1; + } + if (ImGui::Selectable("Headset")) { + gSaveContext.audioSetting = 2; + } + if (ImGui::Selectable("Surround")) { + gSaveContext.audioSetting = 3; + } + + ImGui::EndCombo(); + } + InsertHelpHoverText("Sound setting"); + + bool n64DDFlag = gSaveContext.n64ddFlag != 0; + if (ImGui::Checkbox("64 DD file?", &n64DDFlag)) { + gSaveContext.n64ddFlag = n64DDFlag; + } + InsertHelpHoverText("WARNING! If you save, your file may be locked! Use caution!"); + + if (ImGui::BeginCombo("Z Target Mode", gSaveContext.zTargetSetting ? "Hold" : "Switch")) { + if (ImGui::Selectable("Switch")) { + gSaveContext.zTargetSetting = 0; + } + if (ImGui::Selectable("Hold")) { + gSaveContext.zTargetSetting = 1; + } + ImGui::EndCombo(); + } + InsertHelpHoverText("Z-Targeting behavior"); + + + ImGui::PushItemWidth(ImGui::GetFontSize() * 10); + static std::array minigameHS = { "Horseback Archery", + "Big Poe Points", + "Fishing", + "Malon's Obstacle Course", + "Running Man Race", + "?", + "Dampe's Race" }; + + if (ImGui::TreeNode("Minigames")) { + for (int i = 0; i < 7; i++) { + if (i == 5) { //HS_UNK_05 is unused + continue; + } + std::string minigameLbl = minigameHS[i]; + ImGui::InputScalar(minigameLbl.c_str(), ImGuiDataType_S32, &gSaveContext.highScores[i], &one, NULL); + } + + ImGui::TreePop(); + } + + ImGui::PopItemWidth(); +} + +void DrawInventoryTab() { + static bool restrictToValid = true; + + ImGui::Checkbox("Restrict to valid items", &restrictToValid); + InsertHelpHoverText("Restricts items and ammo to only what is possible to legally acquire in-game"); + + for (int32_t y = 0; y < 4; y++) { + for (int32_t x = 0; x < 6; x++) { + int32_t index = x + y * 6; + static int32_t selectedIndex = -1; + static const char* itemPopupPicker = "itemPopupPicker"; + + ImGui::PushID(index); + + if (x != 0) { + ImGui::SameLine(); + } + + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); + uint8_t item = gSaveContext.inventory.items[index]; + if (item != ITEM_NONE) { + const ItemMapEntry& slotEntry = itemMapping.find(item)->second; + if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + ImVec2(1, 1), 0)) { + selectedIndex = index; + ImGui::OpenPopup(itemPopupPicker); + } + } else { + if (ImGui::Button("##itemNone", ImVec2(32.0f, 32.0f))) { + selectedIndex = index; + ImGui::OpenPopup(itemPopupPicker); + } + } + ImGui::PopStyleVar(); + ImGui::PopStyleColor(); + + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); + if (ImGui::BeginPopup(itemPopupPicker)) { + if (ImGui::Button("##itemNonePicker", ImVec2(32.0f, 32.0f))) { + gSaveContext.inventory.items[selectedIndex] = ITEM_NONE; + ImGui::CloseCurrentPopup(); + } + SetLastItemHoverText("None"); + + std::vector possibleItems; + if (restrictToValid) { + // Scan gItemSlots to find legal items for this slot. Bottles are a special case + for (int slotIndex = 0; slotIndex < 56; slotIndex++) { + int testIndex = (selectedIndex == SLOT_BOTTLE_1 || selectedIndex == SLOT_BOTTLE_2 || + selectedIndex == SLOT_BOTTLE_3 || selectedIndex == SLOT_BOTTLE_4) + ? SLOT_BOTTLE_1 + : selectedIndex; + if (gItemSlots[slotIndex] == testIndex) { + possibleItems.push_back(itemMapping[slotIndex]); + } + } + } else { + for (const auto& entry : itemMapping) { + possibleItems.push_back(entry.second); + } + } + + for (int32_t pickerIndex = 0; pickerIndex < possibleItems.size(); pickerIndex++) { + if (((pickerIndex + 1) % 8) != 0) { + ImGui::SameLine(); + } + const ItemMapEntry& slotEntry = possibleItems[pickerIndex]; + if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), + ImVec2(0, 0), ImVec2(1, 1), 0)) { + gSaveContext.inventory.items[selectedIndex] = slotEntry.id; + ImGui::CloseCurrentPopup(); + } + SetLastItemHoverText(SohUtils::GetItemName(slotEntry.id)); + } + + ImGui::EndPopup(); + } + ImGui::PopStyleVar(); + + ImGui::PopID(); + } + } + + ImGui::Text("Ammo"); + for (uint32_t ammoIndex = 0, drawnAmmoItems = 0; ammoIndex < 16; ammoIndex++) { + uint8_t item = (restrictToValid) ? gAmmoItems[ammoIndex] : gAllAmmoItems[ammoIndex]; + if (item != ITEM_NONE) { + // For legal items, display as 1 row of 7. For unrestricted items, display rows of 6 to match + // inventory + if ((restrictToValid && (drawnAmmoItems != 0)) || ((drawnAmmoItems % 6) != 0)) { + ImGui::SameLine(); + } + drawnAmmoItems++; + + ImGui::PushID(ammoIndex); + ImGui::PushItemWidth(32.0f); + ImGui::BeginGroup(); + + ImGui::Image(SohImGui::GetTextureByName(itemMapping[item].name), ImVec2(32.0f, 32.0f)); + ImGui::InputScalar("##ammoInput", ImGuiDataType_S8, &AMMO(item)); + + ImGui::EndGroup(); + ImGui::PopItemWidth(); + ImGui::PopID(); + } + } +} + +// Draw a flag bitfield as an grid of checkboxes +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 (int32_t flagIndex = 15; flagIndex >= 0; flagIndex--) { + 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 DrawFlagsTab() { + if (ImGui::TreeNode("Current Scene")) { + if (gGlobalCtx != nullptr) { + ActorContext* act = &gGlobalCtx->actorCtx; + + DrawGroupWithBorder([&]() { + ImGui::Text("Switch"); + InsertHelpHoverText("Permanently-saved switch flags"); + DrawFlagArray32("Switch", act->flags.swch); + }); + + ImGui::SameLine(); + + DrawGroupWithBorder([&]() { + ImGui::Text("Temp Switch"); + InsertHelpHoverText("Temporary switch flags. Unset on scene transitions"); + DrawFlagArray32("Temp Switch", act->flags.tempSwch); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Clear"); + InsertHelpHoverText("Permanently-saved room-clear flags"); + DrawFlagArray32("Clear", act->flags.clear); + }); + + ImGui::SameLine(); + + DrawGroupWithBorder([&]() { + ImGui::Text("Temp Clear"); + InsertHelpHoverText("Temporary room-clear flags. Unset on scene transitions"); + DrawFlagArray32("Temp Clear", act->flags.tempClear); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Collect"); + InsertHelpHoverText("Permanently-saved collect flags"); + DrawFlagArray32("Collect", act->flags.collect); + }); + + ImGui::SameLine(); + + DrawGroupWithBorder([&]() { + ImGui::Text("Temp Collect"); + InsertHelpHoverText("Temporary collect flags. Unset on scene transitions"); + DrawFlagArray32("Temp Collect", act->flags.tempCollect); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Chest"); + InsertHelpHoverText("Permanently-saved chest flags"); + DrawFlagArray32("Chest", act->flags.chest); + }); + + ImGui::SameLine(); + + ImGui::BeginGroup(); + + if (ImGui::Button("Reload Flags")) { + act->flags.swch = gSaveContext.sceneFlags[gGlobalCtx->sceneNum].swch; + act->flags.clear = gSaveContext.sceneFlags[gGlobalCtx->sceneNum].clear; + act->flags.collect = gSaveContext.sceneFlags[gGlobalCtx->sceneNum].collect; + act->flags.chest = gSaveContext.sceneFlags[gGlobalCtx->sceneNum].chest; + } + SetLastItemHoverText("Load flags from saved scene flags. Normally happens on scene load"); + + if (ImGui::Button("Save Flags")) { + gSaveContext.sceneFlags[gGlobalCtx->sceneNum].swch = act->flags.swch; + gSaveContext.sceneFlags[gGlobalCtx->sceneNum].clear = act->flags.clear; + gSaveContext.sceneFlags[gGlobalCtx->sceneNum].collect = act->flags.collect; + gSaveContext.sceneFlags[gGlobalCtx->sceneNum].chest = act->flags.chest; + } + SetLastItemHoverText("Save current scene flags. Normally happens on scene exit"); + + ImGui::EndGroup(); + } else { + ImGui::Text("Current game state does not have an active scene"); + } + + ImGui::TreePop(); + } + + if (ImGui::TreeNode("Saved Scene Flags")) { + static uint32_t selectedSceneFlagMap = 0; + ImGui::Text("Map"); + ImGui::SameLine(); + if (ImGui::BeginCombo("##Map", SohUtils::GetSceneName(selectedSceneFlagMap).c_str())) { + for (int32_t sceneIndex = 0; sceneIndex < SCENE_ID_MAX; sceneIndex++) { + if (ImGui::Selectable(SohUtils::GetSceneName(sceneIndex).c_str())) { + selectedSceneFlagMap = sceneIndex; + } + } + + ImGui::EndCombo(); + } + + // Don't show current scene button if there is no current scene + if (gGlobalCtx != nullptr) { + ImGui::SameLine(); + if (ImGui::Button("Current")) { + selectedSceneFlagMap = gGlobalCtx->sceneNum; + } + SetLastItemHoverText("Open flags for current scene"); + } + + DrawGroupWithBorder([&]() { + ImGui::Text("Switch"); + InsertHelpHoverText("Switch flags"); + DrawFlagArray32("Switch", gSaveContext.sceneFlags[selectedSceneFlagMap].swch); + }); + + ImGui::SameLine(); + + DrawGroupWithBorder([&]() { + ImGui::Text("Clear"); + InsertHelpHoverText("Room-clear flags"); + DrawFlagArray32("Clear", gSaveContext.sceneFlags[selectedSceneFlagMap].clear); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Collect"); + InsertHelpHoverText("Collect flags"); + DrawFlagArray32("Collect", gSaveContext.sceneFlags[selectedSceneFlagMap].collect); + }); + + ImGui::SameLine(); + + DrawGroupWithBorder([&]() { + ImGui::Text("Chest"); + InsertHelpHoverText("Chest flags"); + DrawFlagArray32("Chest", gSaveContext.sceneFlags[selectedSceneFlagMap].chest); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Rooms"); + InsertHelpHoverText("Flags for visted rooms"); + DrawFlagArray32("Rooms", gSaveContext.sceneFlags[selectedSceneFlagMap].rooms); + }); + + ImGui::SameLine(); + + DrawGroupWithBorder([&]() { + ImGui::Text("Floors"); + InsertHelpHoverText("Flags for visted floors"); + DrawFlagArray32("Floors", gSaveContext.sceneFlags[selectedSceneFlagMap].floors); + }); + + ImGui::TreePop(); + } + + DrawGroupWithBorder([&]() { + static uint32_t selectedGsMap = 0; + ImGui::Text("Gold Skulltulas"); + ImGui::Text("Map"); + ImGui::SameLine(); + if (ImGui::BeginCombo("##Gold Skulltula Map", gsMapping[selectedGsMap].c_str())) { + for (int32_t gsIndex = 0; gsIndex < gsMapping.size(); gsIndex++) { + if (ImGui::Selectable(gsMapping[gsIndex].c_str())) { + selectedGsMap = gsIndex; + } + } + + ImGui::EndCombo(); + } + + // TODO We should write out descriptions for each one... ugh + ImGui::Text("Flags"); + uint32_t currentFlags = GET_GS_FLAGS(selectedGsMap); + uint32_t allFlags = gAreaGsFlags[selectedGsMap]; + uint32_t setMask = 1; + // Iterate over bitfield and create a checkbox for each skulltula + while (allFlags != 0) { + bool isThisSet = (currentFlags & 0x1) == 0x1; + + ImGui::SameLine(); + ImGui::PushID(allFlags); + if (ImGui::Checkbox("##gs", &isThisSet)) { + if (isThisSet) { + SET_GS_FLAGS(selectedGsMap, setMask); + } else { + // Have to do this roundabout method as the macro does not support clearing flags + uint32_t currentFlagsBase = GET_GS_FLAGS(selectedGsMap); + gSaveContext.gsFlags[selectedGsMap >> 2] &= ~gGsFlagsMasks[selectedGsMap & 3]; + SET_GS_FLAGS(selectedGsMap, currentFlagsBase & ~setMask); + } + } + + ImGui::PopID(); + + allFlags >>= 1; + currentFlags >>= 1; + setMask <<= 1; + } + + static bool keepGsCountUpdated = true; + ImGui::Checkbox("Keep GS Count Updated", &keepGsCountUpdated); + InsertHelpHoverText("Automatically adjust the number of gold skulltula tokens acquired based on set flags"); + int32_t gsCount = 0; + if (keepGsCountUpdated) { + for (int32_t gsFlagIndex = 0; gsFlagIndex < 6; gsFlagIndex++) { + gsCount += std::popcount(static_cast(gSaveContext.gsFlags[gsFlagIndex])); + } + gSaveContext.inventory.gsTokens = gsCount; + } + }); + + if (ImGui::TreeNode("Event Check Inf Flags")) { + DrawGroupWithBorder([&]() { + ImGui::Text("0"); + InsertHelpHoverText("Mostly Kokiri Forest related"); + DrawFlagArray16("eci0", gSaveContext.eventChkInf[0]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("1"); + InsertHelpHoverText("Mostly Lon Lon Ranch related"); + DrawFlagArray16("eci1", gSaveContext.eventChkInf[1]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("2"); + InsertHelpHoverText("Dodongo Related?"); + DrawFlagArray16("eci2", gSaveContext.eventChkInf[2]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("3"); + InsertHelpHoverText("Mostly Zora related"); + DrawFlagArray16("eci3", gSaveContext.eventChkInf[3]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("4"); + InsertHelpHoverText("Random"); + DrawFlagArray16("eci4", gSaveContext.eventChkInf[4]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("5"); + InsertHelpHoverText("Mostly song learning related"); + DrawFlagArray16("eci5", gSaveContext.eventChkInf[5]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("6"); + InsertHelpHoverText("Random"); + DrawFlagArray16("eci6", gSaveContext.eventChkInf[6]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("7"); + InsertHelpHoverText("Boss Battle related"); + DrawFlagArray16("eci7", gSaveContext.eventChkInf[7]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("8"); + InsertHelpHoverText("Mask related?"); + DrawFlagArray16("eci8", gSaveContext.eventChkInf[8]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("9"); + InsertHelpHoverText("Mostly carpenter related"); + DrawFlagArray16("eci9", gSaveContext.eventChkInf[9]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("A"); + InsertHelpHoverText("First-time overworld entrance cs related"); + DrawFlagArray16("eci1", gSaveContext.eventChkInf[10]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("B"); + InsertHelpHoverText("First-time dungeon entrance cs/trial cs related"); + DrawFlagArray16("eci11", gSaveContext.eventChkInf[11]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("C"); + InsertHelpHoverText("Random"); + DrawFlagArray16("eci12", gSaveContext.eventChkInf[12]); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("D"); + InsertHelpHoverText("Frog songs/GS rewards"); + DrawFlagArray16("eci13", gSaveContext.eventChkInf[13]); + }); + + ImGui::TreePop(); + } + if (ImGui::TreeNode("Inf Table Flags")) { + for (int i = 0; i < 30; i++) { + std::string it_id = "it" + std::to_string(i); + DrawGroupWithBorder([&]() { + ImGui::Text("%2d", i); + DrawFlagArray16(it_id, gSaveContext.infTable[i]); + }); + } + ImGui::TreePop(); + } + if (ImGui::TreeNode("Item Get Inf Flags")) { + for (int i = 0; i < 4; i++) { + std::string igi_id = "igi" + std::to_string(i); + DrawGroupWithBorder([&]() { + ImGui::Text("%d", i); + DrawFlagArray16(igi_id, gSaveContext.itemGetInf[i]); + }); + } + ImGui::TreePop(); + } + if (ImGui::TreeNode("Event Inf Flags")) { + for (int i = 0; i < 4; i++) { + std::string ei_id = "ei" + std::to_string(i); + DrawGroupWithBorder([&]() { + ImGui::Text("%d", i); + DrawFlagArray16(ei_id, gSaveContext.eventInf[i]); + }); + } + ImGui::TreePop(); + } +} + +// Draws a combo that lets you choose and upgrade value from a drop-down of text values +void DrawUpgrade(const std::string& categoryName, int32_t categoryId, const std::vector& names) { + ImGui::Text(categoryName.c_str()); + ImGui::SameLine(); + ImGui::PushID(categoryName.c_str()); + if (ImGui::BeginCombo("##upgrade", names[CUR_UPG_VALUE(categoryId)].c_str())) { + for (int32_t i = 0; i < names.size(); i++) { + if (ImGui::Selectable(names[i].c_str())) { + Inventory_ChangeUpgrade(categoryId, i); + } + } + + ImGui::EndCombo(); + } + ImGui::PopID(); + SetLastItemHoverText(categoryName.c_str()); +} + +// Draws a combo that lets you choose and upgrade value from a popup grid of icons +void DrawUpgradeIcon(const std::string& categoryName, int32_t categoryId, const std::vector& items) { + static const char* upgradePopupPicker = "upgradePopupPicker"; + + ImGui::PushID(categoryName.c_str()); + + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(1, 1, 1, 0)); + ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 1.0f); + uint8_t item = items[CUR_UPG_VALUE(categoryId)]; + if (item != ITEM_NONE) { + const ItemMapEntry& slotEntry = itemMapping[item]; + if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + ImVec2(1, 1), 0)) { + ImGui::OpenPopup(upgradePopupPicker); + } + } else { + if (ImGui::Button("##itemNone", ImVec2(32.0f, 32.0f))) { + ImGui::OpenPopup(upgradePopupPicker); + } + } + ImGui::PopStyleVar(); + ImGui::PopStyleColor(); + SetLastItemHoverText(categoryName.c_str()); + + ImGui::PushStyleVar(ImGuiStyleVar_ItemSpacing, ImVec2(0, 0)); + if (ImGui::BeginPopup(upgradePopupPicker)) { + for (int32_t pickerIndex = 0; pickerIndex < items.size(); pickerIndex++) { + if ((pickerIndex % 8) != 0) { + ImGui::SameLine(); + } + + if (items[pickerIndex] == ITEM_NONE) { + if (ImGui::Button("##upgradePopupPicker", ImVec2(32.0f, 32.0f))) { + Inventory_ChangeUpgrade(categoryId, pickerIndex); + ImGui::CloseCurrentPopup(); + } + SetLastItemHoverText("None"); + } else { + const ItemMapEntry& slotEntry = itemMapping[items[pickerIndex]]; + if (ImGui::ImageButton(SohImGui::GetTextureByName(slotEntry.name), ImVec2(32.0f, 32.0f), ImVec2(0, 0), + ImVec2(1, 1), 0)) { + Inventory_ChangeUpgrade(categoryId, pickerIndex); + ImGui::CloseCurrentPopup(); + } + SetLastItemHoverText(SohUtils::GetItemName(slotEntry.id)); + } + } + + ImGui::EndPopup(); + } + ImGui::PopStyleVar(); + + ImGui::PopID(); +} + +void DrawEquipmentTab() { + const std::vector equipmentValues = { + ITEM_SWORD_KOKIRI, ITEM_SWORD_MASTER, ITEM_SWORD_BGS, ITEM_SWORD_BROKEN, + ITEM_SHIELD_DEKU, ITEM_SHIELD_HYLIAN, ITEM_SHIELD_MIRROR, ITEM_NONE, + ITEM_TUNIC_KOKIRI, ITEM_TUNIC_GORON, ITEM_TUNIC_ZORA, ITEM_NONE, + ITEM_BOOTS_KOKIRI, ITEM_BOOTS_IRON, ITEM_BOOTS_HOVER, ITEM_NONE, + }; + for (int32_t i = 0; i < equipmentValues.size(); i++) { + // Skip over unused 4th slots for shields, boots, and tunics + if (equipmentValues[i] == ITEM_NONE) { + continue; + } + if ((i % 4) != 0) { + ImGui::SameLine(); + } + + ImGui::PushID(i); + uint32_t bitMask = 1 << i; + bool hasEquip = (bitMask & gSaveContext.inventory.equipment) != 0; + const ItemMapEntry& entry = itemMapping[equipmentValues[i]]; + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + if (ImGui::ImageButton(SohImGui::GetTextureByName(hasEquip ? entry.name : entry.nameFaded), + ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (hasEquip) { + gSaveContext.inventory.equipment &= ~bitMask; + } else { + gSaveContext.inventory.equipment |= bitMask; + } + } + ImGui::PopStyleColor(); + ImGui::PopID(); + SetLastItemHoverText(SohUtils::GetItemName(entry.id)); + } + + const std::vector bulletBagValues = { + ITEM_NONE, + ITEM_BULLET_BAG_30, + ITEM_BULLET_BAG_40, + ITEM_BULLET_BAG_50, + }; + DrawUpgradeIcon("Bullet Bag", UPG_BULLET_BAG, bulletBagValues); + + ImGui::SameLine(); + + const std::vector quiverValues = { + ITEM_NONE, + ITEM_QUIVER_30, + ITEM_QUIVER_40, + ITEM_QUIVER_50, + }; + DrawUpgradeIcon("Quiver", UPG_QUIVER, quiverValues); + + ImGui::SameLine(); + + const std::vector bombBagValues = { + ITEM_NONE, + ITEM_BOMB_BAG_20, + ITEM_BOMB_BAG_30, + ITEM_BOMB_BAG_40, + }; + DrawUpgradeIcon("Bomb Bag", UPG_BOMB_BAG, bombBagValues); + + ImGui::SameLine(); + + const std::vector scaleValues = { + ITEM_NONE, + ITEM_SCALE_SILVER, + ITEM_SCALE_GOLDEN, + }; + DrawUpgradeIcon("Scale", UPG_SCALE, scaleValues); + + ImGui::SameLine(); + + const std::vector strengthValues = { + ITEM_NONE, + ITEM_BRACELET, + ITEM_GAUNTLETS_SILVER, + ITEM_GAUNTLETS_GOLD, + }; + DrawUpgradeIcon("Strength", UPG_STRENGTH, strengthValues); + + // There is no icon for child wallet, so default to a text list + const std::vector walletNames = { + "Child (99)", + "Adult (200)", + "Giant (500)", + }; + DrawUpgrade("Wallet", UPG_WALLET, walletNames); + + const std::vector stickNames = { + "None", + "10", + "20", + "30", + }; + DrawUpgrade("Sticks", UPG_STICKS, stickNames); + + const std::vector nutNames = { + "None", + "20", + "30", + "40", + }; + DrawUpgrade("Deku Nuts", UPG_NUTS, nutNames); +} + +// Draws a toggleable icon for a quest item that is faded when disabled +void DrawQuestItemButton(uint32_t item) { + const QuestMapEntry& entry = questMapping[item]; + uint32_t bitMask = 1 << entry.id; + bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + if (ImGui::ImageButton(SohImGui::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), + ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (hasQuestItem) { + gSaveContext.inventory.questItems &= ~bitMask; + } else { + gSaveContext.inventory.questItems |= bitMask; + } + } + ImGui::PopStyleColor(); + SetLastItemHoverText(SohUtils::GetQuestItemName(entry.id)); +} + +// Draws a toggleable icon for a dungeon item that is faded when disabled +void DrawDungeonItemButton(uint32_t item, uint32_t scene) { + const ItemMapEntry& entry = itemMapping[item]; + uint32_t bitMask = 1 << (entry.id - ITEM_KEY_BOSS); // Bitset starts at ITEM_KEY_BOSS == 0. the rest are sequential + bool hasItem = (bitMask & gSaveContext.inventory.dungeonItems[scene]) != 0; + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + if (ImGui::ImageButton(SohImGui::GetTextureByName(hasItem ? entry.name : entry.nameFaded), + ImVec2(32.0f, 32.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (hasItem) { + gSaveContext.inventory.dungeonItems[scene] &= ~bitMask; + } else { + gSaveContext.inventory.dungeonItems[scene] |= bitMask; + } + } + ImGui::PopStyleColor(); + SetLastItemHoverText(SohUtils::GetItemName(entry.id)); +} + +void DrawQuestStatusTab() { + ImGui::PushItemWidth(ImGui::GetFontSize() * 6); + + for (int32_t i = QUEST_MEDALLION_FOREST; i < QUEST_MEDALLION_LIGHT + 1; i++) { + if (i != QUEST_MEDALLION_FOREST) { + ImGui::SameLine(); + } + DrawQuestItemButton(i); + } + + for (int32_t i = QUEST_KOKIRI_EMERALD; i < QUEST_ZORA_SAPPHIRE + 1; i++) { + if (i != QUEST_KOKIRI_EMERALD) { + ImGui::SameLine(); + } + DrawQuestItemButton(i); + } + + // Put Stone of Agony and Gerudo Card on the same line with a little space between them + ImGui::SameLine(); + ImGui::Dummy(ImVec2(20, 0)); + + ImGui::SameLine(); + DrawQuestItemButton(QUEST_STONE_OF_AGONY); + + ImGui::SameLine(); + DrawQuestItemButton(QUEST_GERUDO_CARD); + + for (const SongMapEntry& entry : songMapping) { + if ((entry.id != QUEST_SONG_MINUET) && (entry.id != QUEST_SONG_LULLABY)) { + ImGui::SameLine(); + } + + uint32_t bitMask = 1 << entry.id; + bool hasQuestItem = (bitMask & gSaveContext.inventory.questItems) != 0; + ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0)); + if (ImGui::ImageButton(SohImGui::GetTextureByName(hasQuestItem ? entry.name : entry.nameFaded), + ImVec2(16.0f, 24.0f), ImVec2(0, 0), ImVec2(1, 1), 0)) { + if (hasQuestItem) { + gSaveContext.inventory.questItems &= ~bitMask; + } else { + gSaveContext.inventory.questItems |= bitMask; + } + } + ImGui::PopStyleColor(); + SetLastItemHoverText(SohUtils::GetQuestItemName(entry.id)); + } + + ImGui::InputScalar("GS Count", ImGuiDataType_S16, &gSaveContext.inventory.gsTokens); + InsertHelpHoverText("Number of gold skulltula tokens aquired"); + + uint32_t bitMask = 1 << QUEST_SKULL_TOKEN; + bool gsUnlocked = (bitMask & gSaveContext.inventory.questItems) != 0; + if (ImGui::Checkbox("GS unlocked", &gsUnlocked)) { + if (gsUnlocked) { + gSaveContext.inventory.questItems |= bitMask; + } else { + gSaveContext.inventory.questItems &= ~bitMask; + } + } + InsertHelpHoverText("If unlocked, enables showing the gold skulltula count in the quest status menu"); + + int32_t pohCount = (gSaveContext.inventory.questItems & 0xF0000000) >> 28; + if (ImGui::BeginCombo("PoH count", std::to_string(pohCount).c_str())) { + for (int32_t i = 0; i < 4; i++) { + if (ImGui::Selectable(std::to_string(i).c_str(), pohCount == i)) { + gSaveContext.inventory.questItems &= ~0xF0000000; + gSaveContext.inventory.questItems |= (i << 28); + } + } + ImGui::EndCombo(); + } + InsertHelpHoverText("The number of pieces of heart acquired towards the next heart container"); + + DrawGroupWithBorder([&]() { + ImGui::Text("Dungeon Items"); + + static int32_t dungeonItemsScene = SCENE_YDAN; + ImGui::PushItemWidth(-ImGui::GetWindowWidth() * 0.35f); + if (ImGui::BeginCombo("##DungeonSelect", SohUtils::GetSceneName(dungeonItemsScene).c_str())) { + for (int32_t dungeonIndex = SCENE_YDAN; dungeonIndex < SCENE_BDAN_BOSS + 1; dungeonIndex++) { + if (ImGui::Selectable(SohUtils::GetSceneName(dungeonIndex).c_str(), + dungeonIndex == dungeonItemsScene)) { + dungeonItemsScene = dungeonIndex; + } + } + + ImGui::EndCombo(); + } + ImGui::PopItemWidth(); + + DrawDungeonItemButton(ITEM_KEY_BOSS, dungeonItemsScene); + ImGui::SameLine(); + DrawDungeonItemButton(ITEM_COMPASS, dungeonItemsScene); + ImGui::SameLine(); + DrawDungeonItemButton(ITEM_DUNGEON_MAP, dungeonItemsScene); + + if (dungeonItemsScene != SCENE_BDAN_BOSS) { + float lineHeight = ImGui::GetTextLineHeightWithSpacing(); + ImGui::Image(SohImGui::GetTextureByName(itemMapping[ITEM_KEY_SMALL].name), ImVec2(lineHeight, lineHeight)); + ImGui::SameLine(); + ImGui::InputScalar("##Keys", ImGuiDataType_S8, gSaveContext.inventory.dungeonKeys + dungeonItemsScene); + } else { + // dungeonItems is size 20 but dungeonKeys is size 19, so there are no keys for the last scene (Barinade's Lair) + ImGui::Text("Barinade's Lair does not have small keys"); + } + }); + + ImGui::PopItemWidth(); +} + +void DrawPlayerTab() { + if (gGlobalCtx != nullptr) { + Player* player = GET_PLAYER(gGlobalCtx); + const char* curSword; + const char* curShield; + const char* curTunic; + const char* curBoots; + + switch (player->currentSwordItem) { + case ITEM_SWORD_KOKIRI: + curSword = "Kokiri Sword"; + break; + case ITEM_SWORD_MASTER: + curSword = "Master Sword"; + break; + case ITEM_SWORD_BGS: + curSword = "Biggoron's Sword"; + break; + case ITEM_NONE: + curSword = "None"; + break; + default: + curSword = "None"; + break; + } + + switch (player->currentShield) { + case PLAYER_SHIELD_NONE: + curShield = "None"; + break; + case PLAYER_SHIELD_DEKU: + curShield = "Deku Shield"; + break; + case PLAYER_SHIELD_HYLIAN: + curShield = "Hylian Shield"; + break; + case PLAYER_SHIELD_MIRROR: + curShield = "Mirror Shield"; + break; + default: + break; + } + + switch (player->currentTunic) { + case PLAYER_TUNIC_KOKIRI: + curTunic = "Kokiri Tunic"; + break; + case PLAYER_TUNIC_GORON: + curTunic = "Goron Tunic"; + break; + case PLAYER_TUNIC_ZORA: + curTunic = "Zora Tunic"; + break; + default: + break; + } + + switch (player->currentBoots) { + case PLAYER_BOOTS_KOKIRI: + curBoots = "Kokiri Boots"; + break; + case PLAYER_BOOTS_IRON: + curBoots = "Iron Boots"; + break; + case PLAYER_BOOTS_HOVER: + curBoots = "Hover Boots"; + break; + default: + break; + } + + ImGui::PushItemWidth(ImGui::GetFontSize() * 6); + DrawGroupWithBorder([&]() { + ImGui::Text("Link's Position"); + ImGui::InputScalar("X Pos", ImGuiDataType_Float, &player->actor.world.pos.x); + ImGui::SameLine(); + ImGui::InputScalar("Y Pos", ImGuiDataType_Float, &player->actor.world.pos.y); + ImGui::SameLine(); + ImGui::InputScalar("Z Pos", ImGuiDataType_Float, &player->actor.world.pos.z); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Link's Rotation"); + InsertHelpHoverText("For Link's rotation in relation to the world"); + ImGui::InputScalar("X Rot", ImGuiDataType_S16, &player->actor.world.rot.x); + ImGui::SameLine(); + ImGui::InputScalar("Y Rot", ImGuiDataType_S16, &player->actor.world.rot.y); + ImGui::SameLine(); + ImGui::InputScalar("Z Rot", ImGuiDataType_S16, &player->actor.world.rot.z); + }); + + DrawGroupWithBorder([&]() { + ImGui::Text("Link's Model Rotation"); + InsertHelpHoverText("For Link's actual model"); + ImGui::InputScalar("X ModRot", ImGuiDataType_S16, &player->actor.shape.rot.x); + ImGui::SameLine(); + ImGui::InputScalar("Y ModRot", ImGuiDataType_S16, &player->actor.shape.rot.y); + ImGui::SameLine(); + ImGui::InputScalar("Z ModRot", ImGuiDataType_S16, &player->actor.shape.rot.z); + }); + + ImGui::InputScalar("Linear Velocity", ImGuiDataType_Float, &player->linearVelocity); + InsertHelpHoverText("Link's speed along the XZ plane"); + + ImGui::InputScalar("Y Velocity", ImGuiDataType_Float, &player->actor.velocity.y); + InsertHelpHoverText("Link's speed along the Y plane. Caps at -20"); + + ImGui::InputScalar("Wall Height", ImGuiDataType_Float, &player->wallHeight); + InsertHelpHoverText("\"height used to determine whether link can climb or grab a ledge at the top\""); + + ImGui::InputScalar("Invincibility Timer", ImGuiDataType_S8, &player->invincibilityTimer); + InsertHelpHoverText("Can't take damage while this is nonzero"); + + ImGui::InputScalar("Gravity", ImGuiDataType_Float, &player->actor.gravity); + InsertHelpHoverText("Rate at which Link falls. Default -4.0f"); + + if (ImGui::BeginCombo("Link Age on Load", gGlobalCtx->linkAgeOnLoad == 0 ? "Adult" : "Child")) { + if (ImGui::Selectable("Adult")) { + gGlobalCtx->linkAgeOnLoad = 0; + } + if (ImGui::Selectable("Child")) { + gGlobalCtx->linkAgeOnLoad = 1; + } + ImGui::EndCombo(); + } + + InsertHelpHoverText("This will change Link's age when you load a map"); + + ImGui::Separator(); + + ImGui::Text("Link's Current Equipment"); + ImGui::PushItemWidth(ImGui::GetFontSize() * 15); + if (ImGui::BeginCombo("Sword", curSword)) { + if (ImGui::Selectable("None")) { + player->currentSwordItem = ITEM_NONE; + gSaveContext.equips.buttonItems[0] = ITEM_NONE; + Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_NONE); + } + if (ImGui::Selectable("Kokiri Sword")) { + player->currentSwordItem = ITEM_SWORD_KOKIRI; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KOKIRI; + Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_KOKIRI); + } + if (ImGui::Selectable("Master Sword")) { + player->currentSwordItem = ITEM_SWORD_MASTER; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_MASTER; + Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_MASTER); + } + if (ImGui::Selectable("Biggoron's Sword")) { + if (gSaveContext.bgsFlag) { + if (gSaveContext.swordHealth < 8) { + gSaveContext.swordHealth = 8; + } + player->currentSwordItem = ITEM_SWORD_BGS; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_BGS; + } else { + if (gSaveContext.swordHealth < 8) { + gSaveContext.swordHealth = 8; + } + player->currentSwordItem = ITEM_SWORD_BGS; + gSaveContext.equips.buttonItems[0] = ITEM_SWORD_KNIFE; + } + + Inventory_ChangeEquipment(EQUIP_SWORD, PLAYER_SWORD_BGS); + } + ImGui::EndCombo(); + + } + if (ImGui::BeginCombo("Shield", curShield)) { + if (ImGui::Selectable("None")) { + player->currentShield = PLAYER_SHIELD_NONE; + Inventory_ChangeEquipment(EQUIP_SHIELD, PLAYER_SHIELD_NONE); + } + if (ImGui::Selectable("Deku Shield")) { + player->currentShield = PLAYER_SHIELD_DEKU; + Inventory_ChangeEquipment(EQUIP_SHIELD, PLAYER_SHIELD_DEKU); + } + if (ImGui::Selectable("Hylian Shield")) { + player->currentShield = PLAYER_SHIELD_HYLIAN; + Inventory_ChangeEquipment(EQUIP_SHIELD, PLAYER_SHIELD_HYLIAN); + } + if (ImGui::Selectable("Mirror Shield")) { + player->currentShield = PLAYER_SHIELD_MIRROR; + Inventory_ChangeEquipment(EQUIP_SHIELD, PLAYER_SHIELD_MIRROR); + } + ImGui::EndCombo(); + } + + if (ImGui::BeginCombo("Tunic", curTunic)) { + if (ImGui::Selectable("Kokiri Tunic")) { + player->currentTunic = PLAYER_TUNIC_KOKIRI; + Inventory_ChangeEquipment(EQUIP_TUNIC, PLAYER_TUNIC_KOKIRI + 1); + } + if (ImGui::Selectable("Goron Tunic")) { + player->currentTunic = PLAYER_TUNIC_GORON; + Inventory_ChangeEquipment(EQUIP_TUNIC, PLAYER_TUNIC_GORON + 1); + } + if (ImGui::Selectable("Zora Tunic")) { + player->currentTunic = PLAYER_TUNIC_ZORA; + Inventory_ChangeEquipment(EQUIP_TUNIC, PLAYER_TUNIC_ZORA + 1); + } + ImGui::EndCombo(); + } + + if (ImGui::BeginCombo("Boots", curBoots)) { + if (ImGui::Selectable("Kokiri Boots")) { + player->currentBoots = PLAYER_BOOTS_KOKIRI; + Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_KOKIRI + 1); + } + if (ImGui::Selectable("Iron Boots")) { + player->currentBoots = PLAYER_BOOTS_IRON; + Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_IRON + 1); + } + if (ImGui::Selectable("Hover Boots")) { + player->currentBoots = PLAYER_BOOTS_HOVER; + Inventory_ChangeEquipment(EQUIP_BOOTS, PLAYER_BOOTS_HOVER + 1); + } + ImGui::EndCombo(); + } + + ImU16 one = 1; + ImGui::PushItemWidth(ImGui::GetFontSize() * 6); + DrawGroupWithBorder([&]() { + ImGui::Text("Current C Equips"); + ImGui::InputScalar("C Left", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[1], &one, NULL); + ImGui::SameLine(); + ImGui::InputScalar("C Down", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[2], &one, NULL); + ImGui::SameLine(); + ImGui::InputScalar("C Right", ImGuiDataType_U8, &gSaveContext.equips.buttonItems[3], &one, NULL); + }); + + } else { + ImGui::Text("Global Context needed for player info!"); + } +} + +void DrawSaveEditor(bool& open) { + if (!open) { + return; + } + + ImGui::SetNextWindowSize(ImVec2(520, 600), ImGuiCond_FirstUseEver); + if (!ImGui::Begin("Save Editor", &open, ImGuiWindowFlags_NoFocusOnAppearing)) { + ImGui::End(); + return; + } + + if (ImGui::BeginTabBar("SaveContextTabBar", ImGuiTabBarFlags_NoCloseWithMiddleMouseButton)) { + if (ImGui::BeginTabItem("Info")) { + DrawInfoTab(); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Inventory")) { + DrawInventoryTab(); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Flags")) { + DrawFlagsTab(); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Equipment")) { + DrawEquipmentTab(); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Quest Status")) { + DrawQuestStatusTab(); + ImGui::EndTabItem(); + } + + if (ImGui::BeginTabItem("Player")) { + DrawPlayerTab(); + ImGui::EndTabItem(); + } + + ImGui::EndTabBar(); + } + + ImGui::End(); +} + +void InitSaveEditor() { + SohImGui::AddWindow("Developer Tools", "Save Editor", DrawSaveEditor); + + // Load item icons into ImGui + for (const auto& entry : itemMapping) { + SohImGui::LoadResource(entry.second.name, entry.second.texturePath); + SohImGui::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + } + for (const auto& entry : questMapping) { + SohImGui::LoadResource(entry.second.name, entry.second.texturePath); + SohImGui::LoadResource(entry.second.nameFaded, entry.second.texturePath, ImVec4(1, 1, 1, 0.3f)); + } + for (const auto& entry : songMapping) { + SohImGui::LoadResource(entry.name, gSongNoteTex, entry.color); + ImVec4 fadedCol = entry.color; + fadedCol.w = 0.3f; + SohImGui::LoadResource(entry.nameFaded, gSongNoteTex, fadedCol); + } +} diff --git a/soh/soh/Enhancements/debugger/debugSaveEditor.h b/soh/soh/Enhancements/debugger/debugSaveEditor.h new file mode 100644 index 000000000..084f7cadc --- /dev/null +++ b/soh/soh/Enhancements/debugger/debugSaveEditor.h @@ -0,0 +1,3 @@ +#pragma once + +void InitSaveEditor(); diff --git a/soh/soh/Enhancements/debugger/debugger.cpp b/soh/soh/Enhancements/debugger/debugger.cpp new file mode 100644 index 000000000..83e6a94a4 --- /dev/null +++ b/soh/soh/Enhancements/debugger/debugger.cpp @@ -0,0 +1,16 @@ +#include "debugger.h" +#include "debugSaveEditor.h" +#include "colViewer.h" + +extern "C" { + +void Debug_Init(void) { + InitSaveEditor(); + InitColViewer(); +} + +void Debug_Draw(void) { + DrawColViewer(); +} + +} diff --git a/soh/soh/Enhancements/debugger/debugger.h b/soh/soh/Enhancements/debugger/debugger.h new file mode 100644 index 000000000..bbefd2e21 --- /dev/null +++ b/soh/soh/Enhancements/debugger/debugger.h @@ -0,0 +1,12 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +void Debug_Init(void); +void Debug_Draw(void); + +#ifdef __cplusplus +} +#endif diff --git a/soh/soh/Enhancements/gameconsole.h b/soh/soh/Enhancements/gameconsole.h index d7052fce3..33301afe6 100644 --- a/soh/soh/Enhancements/gameconsole.h +++ b/soh/soh/Enhancements/gameconsole.h @@ -3,7 +3,7 @@ #include #include -#include "cvar.h" +#include "Cvar.h" #define MAX_CVARS 2048 diff --git a/soh/soh/Enhancements/savestates.cpp b/soh/soh/Enhancements/savestates.cpp new file mode 100644 index 000000000..2b6d27189 --- /dev/null +++ b/soh/soh/Enhancements/savestates.cpp @@ -0,0 +1,957 @@ +#include "savestates.h" + +#include "GameVersions.h" + +#include // std::sprintf + +#include "spdlog/spdlog.h" + +#include +#include + +#include + +#include "z64.h" +#include "z64save.h" +#include +#include +#include "z64map_mark.h" +#include "../../src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" +#include "../../src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h" +#include "../../src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h" +#include "../../src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.h" +#include "../../src/overlays/actors/ovl_En_Fr/z_en_fr.h" + +extern "C" GlobalContext* gGlobalCtx; + +// FROM z_lights.c +// I didn't feel like moving it into a header file. +#define LIGHTS_BUFFER_SIZE 32 + +typedef struct { + /* 0x000 */ s32 numOccupied; + /* 0x004 */ s32 searchIndex; + /* 0x008 */ LightNode buf[LIGHTS_BUFFER_SIZE]; +} LightsBuffer; // size = 0x188 + +#include "savestates_extern.inc" + +typedef struct SaveStateInfo { + unsigned char sysHeapCopy[SYSTEM_HEAP_SIZE]; + unsigned char audioHeapCopy[AUDIO_HEAP_SIZE]; + + SaveContext saveContextCopy; + GameInfo gameInfoCopy; + LightsBuffer lightBufferCopy; + AudioContext audioContextCopy; + MtxF mtxStackCopy[20]; // always 20 matricies + MtxF currentMtxCopy; + uint32_t rngSeed; + int16_t blueWarpTimerCopy; /* From door_warp_1 */ + + SeqScriptState seqScriptStateCopy[4];// Unrelocated + unk_D_8016E750 unk_D_8016E750Copy[4]; + + ActiveSound gActiveSoundsCopy[7][MAX_CHANNELS_PER_BANK]; + uint8_t gSoundBankMutedCopy[7]; + + u8 D_801333F0_copy; + u8 gAudioSfxSwapOff_copy; + uint16_t gAudioSfxSwapSource_copy[10]; + uint16_t gAudioSfxSwapTarget_copy[10]; + uint8_t gAudioSfxSwapMode_copy[10]; + void (*D_801755D0_copy)(void); + MapMarkData** sLoadedMarkDataTableCopy; + + //Static Data + + //Camera data + int32_t sInitRegs_copy; + int32_t gDbgCamEnabled_copy; + int32_t sDbgModeIdx_copy; + int16_t sNextUID_copy; + int32_t sCameraInterfaceFlags_copy; + int32_t sCameraInterfaceAlpha_copy; + int32_t sCameraShrinkWindowVal_copy; + int32_t D_8011D3AC_copy; + int32_t sDemo5PrevAction12Frame_copy; + int32_t sDemo5PrevSfxFrame_copy; + int32_t D_8011D3F0_copy; + OnePointCsFull D_8011D6AC_copy[3]; + OnePointCsFull D_8011D724_copy[3]; + OnePointCsFull D_8011D79C_copy[3]; + OnePointCsFull D_8011D83C_copy[2]; + OnePointCsFull D_8011D88C_copy[2]; + OnePointCsFull D_8011D8DC_copy[3]; + OnePointCsFull D_8011D954_copy[4]; + OnePointCsFull D_8011D9F4_copy[3]; + int16_t D_8011DB08_copy; + int16_t D_8011DB0C_copy; + int32_t sOOBTimer_copy; + f32 D_8015CE50_copy; + f32 D_8015CE54_copy; + CamColChk D_8015CE58_copy; + + //Gameover + uint16_t gGameOverTimer_copy; + + //One point demo + uint32_t sPrevFrameCs1100_copy; + CutsceneCameraPoint D_8012013C_copy[14]; + CutsceneCameraPoint D_8012021C_copy[14]; + CutsceneCameraPoint D_801204D4_copy[14]; + CutsceneCameraPoint D_801205B4_copy[14]; + OnePointCsFull D_801208EC_copy[3]; + OnePointCsFull D_80120964_copy[2]; + OnePointCsFull D_801209B4_copy[4]; + OnePointCsFull D_80120ACC_copy[5]; + OnePointCsFull D_80120B94_copy[11]; + OnePointCsFull D_80120D4C_copy[7]; + OnePointCsFull D_80120FA4_copy[6]; + OnePointCsFull D_80121184_copy[2]; + OnePointCsFull D_801211D4_copy[2]; + OnePointCsFull D_8012133C_copy[3]; + OnePointCsFull D_801213B4_copy[5]; + OnePointCsFull D_8012151C_copy[2]; + OnePointCsFull D_8012156C_copy[2]; + OnePointCsFull D_801215BC_copy[1]; + OnePointCsFull D_80121C24_copy[7]; + OnePointCsFull D_80121D3C_copy[3]; + OnePointCsFull D_80121F1C_copy[4]; + OnePointCsFull D_80121FBC_copy[4]; + OnePointCsFull D_801220D4_copy[5]; + OnePointCsFull D_80122714_copy[4]; + OnePointCsFull D_80122CB4_copy[2]; + OnePointCsFull D_80122D04_copy[2]; + OnePointCsFull D_80122E44_copy[2][7]; + OnePointCsFull D_8012313C_copy[3]; + OnePointCsFull D_801231B4_copy[4]; + OnePointCsFull D_80123254_copy[2]; + OnePointCsFull D_801232A4_copy[1]; + OnePointCsFull D_80123894_copy[3]; + OnePointCsFull D_8012390C_copy[2]; + OnePointCsFull D_8012395C_copy[3]; + OnePointCsFull D_801239D4_copy[3]; + + uint16_t gTimeIncrement_copy; + + //Overlay static data + // z_bg_ddan_kd + Vec3f sBgDdanKdVelocity_copy; + Vec3f sBgDdanKdAccel_copy; + + // z_bg_dodoago + s16 sBgDodoagoFirstExplosiveFlag_copy; + u8 sBgDodoagoDisableBombCatcher_copy; + s32 sBgDodoagoTimer_copy; + + // z_bg_haka_trap + uint32_t D_80880F30_copy; + uint32_t D_80881014_copy; + + // z_bg_hidan_rock + float D_8088BFC0_copy; + + // z_bg_menkuri_eye + int32_t D_8089C1A0_copy; + + // z_bg_mori_hineri + int16_t sBgMoriHineriNextCamIdx_copy; + + // z_bg_po_event + uint8_t sBgPoEventBlocksAtRest_copy; + uint8_t sBgPoEventPuzzleState_copy; + float sBgPoEventblockPushDist_copy; + + // z_bg_relay_objects + uint32_t D_808A9508_copy; + + // z_bg_spot18_basket + int16_t D_808B85D0_copy; + + // z_boss_ganon + uint32_t sBossGanonSeed1_copy; + uint32_t sBossGanonSeed2_copy; + uint32_t sBossGanonSeed3_copy; + void* sBossGanonGanondorf_copy; + void* sBossGanonZelda_copy; + void* sBossGanonCape_copy; + GanondorfEffect sBossGanonEffectBuf_copy[200]; + + // z_boss_ganon + uint32_t sBossGanonSeed1; + uint32_t sBossGanonSeed2; + uint32_t sBossGanonSeed3; + void* sBossGanonGanondorf; + void* sBossGanonZelda; + void* sBossGanonCape; + GanondorfEffect sBossGanonEffectBuf[200]; + + // z_boss_ganon2 + Vec3f D_8090EB20_copy; + int8_t D_80910638_copy; + void* sBossGanon2Zelda_copy; + void* D_8090EB30_copy; + int32_t sBossGanon2Seed1_copy; + int32_t sBossGanon2Seed2_copy; + int32_t sBossGanon2Seed3_copy; + Vec3f D_809105D8_copy[4]; + Vec3f D_80910608_copy[4]; + BossGanon2Effect sBossGanon2Particles_copy[100]; + + // z_boss_tw + uint8_t sTwInitalized_copy; + BossTwEffect sTwEffects_copy[150]; + + // z_demo_6k + Vec3f sDemo6kVelocity_copy; + + // z_demo_du + int32_t D_8096CE94_copy; + + // z_demo_kekkai + Vec3f demoKekkaiVel_copy; + + // z_en_bw + int32_t sSlugGroup_copy; + + // z_en_clear_tag + uint8_t sClearTagIsEffectInitialized_copy; + EnClearTagEffect sClearTagEffects_copy[CLEAR_TAG_EFFECT_MAX_COUNT]; + + // z_en_fr + EnFrPointers sEnFrPointers_copy; + + // z_en_goma + uint8_t sSpawnNum_copy; + + // z_en_insect + float D_80A7DEB0_copy; + int16_t D_80A7DEB4_copy; + int16_t D_80A7DEB8_copy; + + // z_en_ishi + int16_t sRockRotSpeedX_copy; + int16_t sRockRotSpeedY_copy; + + // z_en_niw + int16_t D_80AB85E0_copy; + uint8_t sLowerRiverSpawned_copy; + uint8_t sUpperRiverSpawned_copy; + + // z_en_po_field + int32_t sEnPoFieldNumSpawned_copy; + Vec3s sEnPoFieldSpawnPositions_copy[10]; + u8 sEnPoFieldSpawnSwitchFlags_copy[10]; + + // z_en_takara_man + uint8_t sTakaraIsInitialized_copy; + + // z_en_xc + int32_t D_80B41D90_copy; + int32_t sEnXcFlameSpawned_copy; + int32_t D_80B41DA8_copy; + int32_t D_80B41DAC_copy; + + // z_en_zf + int16_t D_80B4A1B0_copy; + int16_t D_80B4A1B4_copy; + + int32_t D_80B5A468_copy; + int32_t D_80B5A494_copy; + int32_t D_80B5A4BC_copy; + + uint8_t sKankyoIsSpawned_copy; + int16_t sTrailingFairies_copy; + + + //Misc static data + // z_map_exp + + s16 sPlayerInitialPosX_copy; + s16 sPlayerInitialPosZ_copy; + s16 sPlayerInitialDirection_copy; + + // code_800E(something. fill me in later) + u8 sOcarinaInpEnabled_copy; + s8 D_80130F10_copy; + u8 sCurOcarinaBtnVal_copy; + u8 sPrevOcarinaNoteVal_copy; + u8 sCurOcarinaBtnIdx_copy; + u8 sLearnSongLastBtn_copy; + f32 D_80130F24_copy; + f32 D_80130F28_copy; + s8 D_80130F2C_copy; + s8 D_80130F30_copy; + s8 D_80130F34_copy; + u8 sDisplayedNoteValue_copy; + u8 sPlaybackState_copy; + u32 D_80130F3C_copy; + u32 sNotePlaybackTimer_copy; + u16 sPlaybackNotePos_copy; + u16 sStaffPlaybackPos_copy; + + u32 sCurOcarinaBtnPress_copy; + u32 D_8016BA10_copy; + u32 sPrevOcarinaBtnPress_copy; + s32 D_8016BA18_copy; + s32 D_8016BA1C_copy; + u8 sCurOcarinaSong_copy[8]; + u8 sOcarinaSongAppendPos_copy; + u8 sOcarinaHasStartedSong_copy; + u8 sOcarinaSongNoteStartIdx_copy; + u8 sOcarinaSongCnt_copy; + u16 sOcarinaAvailSongs_copy; + u8 sStaffPlayingPos_copy; + u16 sLearnSongPos_copy[0x10]; + u16 D_8016BA50_copy[0x10]; + u16 D_8016BA70_copy[0x10]; + u8 sLearnSongExpectedNote_copy[0x10]; + OcarinaNote D_8016BAA0_copy; + u8 sAudioHasMalonBgm_copy; + f32 sAudioMalonBgmDist_copy; + + // Message_PAL + s16 sOcarinaNoteBufPos_copy; + s16 sOcarinaNoteBufLen_copy; + u8 sOcarinaNoteBuf_copy[12]; + + u8 D_8014B2F4_copy; + u8 sTextboxSkipped_copy; + u16 sNextTextId_copy; + s16 sLastPlayedSong_copy; + s16 sHasSunsSong_copy; + s16 sMessageHasSetSfx_copy; + u16 sOcarinaSongBitFlags_copy; + + +} SaveStateInfo; + +class SaveState { + friend class SaveStateMgr; + + public: + SaveState(std::shared_ptr mgr, unsigned int slot); + + private: + unsigned int slot; + std::shared_ptr saveStateMgr; + std::shared_ptr info; + + void Save(void); + void Load(void); + void BackupSeqScriptState(void); + void LoadSeqScriptState(void); + void BackupCameraData(void); + void LoadCameraData(void); + void SaveOnePointDemoData(void); + void LoadOnePointDemoData(void); + void SaveOverlayStaticData(void); + void LoadOverlayStaticData(void); + + void SaveMiscCodeData(void); + void LoadMiscCodeData(void); + + SaveStateInfo* GetSaveStateInfo(void); +}; + +SaveStateMgr::SaveStateMgr() { + this->SetCurrentSlot(0); +} +SaveStateMgr::~SaveStateMgr() { + this->states.clear(); +} + +SaveState::SaveState(std::shared_ptr mgr, unsigned int slot) : saveStateMgr(mgr), slot(slot), info(nullptr) { + this->info = std::make_shared(); +} + +void SaveState::BackupSeqScriptState(void) { + for (unsigned int i = 0; i < 4; i++) { + info->seqScriptStateCopy[i].value = gAudioContext.seqPlayers[i].scriptState.value; + + info->seqScriptStateCopy[i].remLoopIters[0] = gAudioContext.seqPlayers[i].scriptState.remLoopIters[0]; + info->seqScriptStateCopy[i].remLoopIters[1] = gAudioContext.seqPlayers[i].scriptState.remLoopIters[1]; + info->seqScriptStateCopy[i].remLoopIters[2] = gAudioContext.seqPlayers[i].scriptState.remLoopIters[2]; + info->seqScriptStateCopy[i].remLoopIters[3] = gAudioContext.seqPlayers[i].scriptState.remLoopIters[3]; + + info->seqScriptStateCopy[i].depth = gAudioContext.seqPlayers[i].scriptState.depth; + + info->seqScriptStateCopy[i].pc = (u8*)((uintptr_t)gAudioContext.seqPlayers[i].scriptState.pc - (uintptr_t)gAudioHeap); + + info->seqScriptStateCopy[i].stack[0] = + (u8*)((uintptr_t)gAudioContext.seqPlayers[i].scriptState.stack[0] - (uintptr_t)gAudioHeap); + info->seqScriptStateCopy[i].stack[1] = + (u8*)((uintptr_t)gAudioContext.seqPlayers[i].scriptState.stack[1] - (uintptr_t)gAudioHeap); + info->seqScriptStateCopy[i].stack[2] = + (u8*)((uintptr_t)gAudioContext.seqPlayers[i].scriptState.stack[2] - (uintptr_t)gAudioHeap); + info->seqScriptStateCopy[i].stack[3] = + (u8*)((uintptr_t)gAudioContext.seqPlayers[i].scriptState.stack[3] - (uintptr_t)gAudioHeap); + } +} + +void SaveState::LoadSeqScriptState(void) { + for (unsigned int i = 0; i < 4; i++) { + gAudioContext.seqPlayers[i].scriptState.value = info->seqScriptStateCopy[i].value; + + gAudioContext.seqPlayers[i].scriptState.remLoopIters[0] = info->seqScriptStateCopy[i].remLoopIters[0]; + gAudioContext.seqPlayers[i].scriptState.remLoopIters[1] = info->seqScriptStateCopy[i].remLoopIters[1]; + gAudioContext.seqPlayers[i].scriptState.remLoopIters[2] = info->seqScriptStateCopy[i].remLoopIters[2]; + gAudioContext.seqPlayers[i].scriptState.remLoopIters[3] = info->seqScriptStateCopy[i].remLoopIters[3]; + + gAudioContext.seqPlayers[i].scriptState.depth = info->seqScriptStateCopy[i].depth; + + gAudioContext.seqPlayers[i].scriptState.pc = + (u8*)((uintptr_t)info->seqScriptStateCopy[i].pc + (uintptr_t)gAudioHeap); + + gAudioContext.seqPlayers[i].scriptState.stack[0] = + (u8*)((uintptr_t)info->seqScriptStateCopy[i].stack[0] + (uintptr_t)gAudioHeap); + gAudioContext.seqPlayers[i].scriptState.stack[1] = + (u8*)((uintptr_t)info->seqScriptStateCopy[i].stack[1] + (uintptr_t)gAudioHeap); + gAudioContext.seqPlayers[i].scriptState.stack[2] = + (u8*)((uintptr_t)info->seqScriptStateCopy[i].stack[2] + (uintptr_t)gAudioHeap); + gAudioContext.seqPlayers[i].scriptState.stack[3] = + (u8*)((uintptr_t)info->seqScriptStateCopy[i].stack[3] + (uintptr_t)gAudioHeap); + } +} + +void SaveState::BackupCameraData(void) { + info->sInitRegs_copy = sInitRegs; + info->gDbgCamEnabled_copy = gDbgCamEnabled; + info->sNextUID_copy = sNextUID; + info->sCameraInterfaceFlags_copy = sCameraInterfaceFlags; + info->sCameraInterfaceAlpha_copy = sCameraInterfaceAlpha; + info->sCameraShrinkWindowVal_copy = sCameraShrinkWindowVal; + info->D_8011D3AC_copy = D_8011D3AC; + info->sDemo5PrevAction12Frame_copy = sDemo5PrevAction12Frame; + info->sDemo5PrevSfxFrame_copy = sDemo5PrevSfxFrame; + info->D_8011D3F0_copy = D_8011D3F0; + memcpy(info->D_8011D6AC_copy, D_8011D6AC, sizeof(info->D_8011D6AC_copy)); + memcpy(info->D_8011D724_copy, D_8011D724, sizeof(info->D_8011D724_copy)); + memcpy(info->D_8011D79C_copy, D_8011D79C, sizeof(info->D_8011D79C_copy)); + memcpy(info->D_8011D83C_copy, D_8011D83C, sizeof(info->D_8011D83C_copy)); + memcpy(info->D_8011D88C_copy, D_8011D88C, sizeof(info->D_8011D88C_copy)); + memcpy(info->D_8011D8DC_copy, D_8011D8DC, sizeof(info->D_8011D8DC_copy)); + memcpy(info->D_8011D954_copy, D_8011D954, sizeof(info->D_8011D954_copy)); + memcpy(info->D_8011D9F4_copy, D_8011D9F4, sizeof(info->D_8011D9F4_copy)); + info->D_8011DB08_copy = D_8011DB08; + info->D_8011DB0C_copy = D_8011DB0C; + info->sOOBTimer_copy = sOOBTimer; + info->D_8015CE50_copy = D_8015CE50; + info->D_8015CE54_copy = D_8015CE54; + memcpy(&info->D_8015CE58_copy, &D_8015CE58, sizeof(info->D_8015CE58_copy)); +} + +void SaveState::LoadCameraData(void) { + sInitRegs = info->sInitRegs_copy; + gDbgCamEnabled = info->gDbgCamEnabled_copy; + sDbgModeIdx = info->sDbgModeIdx_copy; + sNextUID = info->sNextUID_copy; + sCameraInterfaceAlpha = info->sCameraInterfaceAlpha_copy; + sCameraInterfaceFlags = info->sCameraInterfaceFlags_copy; + sCameraShrinkWindowVal = info->sCameraShrinkWindowVal_copy; + D_8011D3AC = info->D_8011D3AC_copy; + sDemo5PrevAction12Frame = info->sDemo5PrevAction12Frame_copy; + sDemo5PrevSfxFrame = info->sDemo5PrevSfxFrame_copy; + D_8011D3F0 = info->D_8011D3F0_copy; + memcpy(D_8011D6AC, info->D_8011D6AC_copy, sizeof(info->D_8011D6AC_copy)); + memcpy(D_8011D724, info->D_8011D724_copy, sizeof(info->D_8011D724_copy)); + memcpy(D_8011D79C, info->D_8011D79C_copy, sizeof(info->D_8011D79C_copy)); + memcpy(D_8011D83C, info->D_8011D83C_copy, sizeof(info->D_8011D83C_copy)); + memcpy(D_8011D88C, info->D_8011D88C_copy, sizeof(info->D_8011D88C_copy)); + memcpy(D_8011D8DC, info->D_8011D8DC_copy, sizeof(info->D_8011D8DC_copy)); + memcpy(D_8011D954, info->D_8011D954_copy, sizeof(info->D_8011D954_copy)); + memcpy(D_8011D9F4, info->D_8011D9F4_copy, sizeof(info->D_8011D9F4_copy)); + D_8011DB08 = info->D_8011DB08_copy; + D_8011DB0C = info->D_8011DB0C_copy; + sOOBTimer = info->sOOBTimer_copy; + D_8015CE50 = info->D_8015CE50_copy; + D_8015CE54 = info->D_8015CE54_copy; + memcpy(&D_8015CE58, &info->D_8015CE58_copy, sizeof(info->D_8015CE58_copy)); +} + +void SaveState::SaveOnePointDemoData(void) { + info->sPrevFrameCs1100_copy = sPrevFrameCs1100; + memcpy(info->D_8012013C_copy, D_8012013C, sizeof(info->D_8012013C_copy)); + memcpy(info->D_8012021C_copy, D_8012021C, sizeof(info->D_8012021C_copy)); + memcpy(info->D_801204D4_copy, D_801204D4, sizeof(info->D_801204D4_copy)); + memcpy(info->D_801205B4_copy, D_801205B4, sizeof(info->D_801205B4_copy)); + memcpy(info->D_801208EC_copy, D_801208EC, sizeof(info->D_801208EC_copy)); + memcpy(info->D_80120964_copy, D_80120964, sizeof(info->D_80120964_copy)); + memcpy(info->D_801209B4_copy, D_801209B4, sizeof(info->D_801209B4_copy)); + memcpy(info->D_80120ACC_copy, D_80120ACC, sizeof(info->D_80120ACC_copy)); + memcpy(info->D_80120B94_copy, D_80120B94, sizeof(info->D_80120B94_copy)); + memcpy(info->D_80120D4C_copy, D_80120D4C, sizeof(info->D_80120D4C_copy)); + memcpy(info->D_80120FA4_copy, D_80120FA4, sizeof(info->D_80120FA4_copy)); + memcpy(info->D_80121184_copy, D_80121184, sizeof(info->D_80121184_copy)); + memcpy(info->D_801211D4_copy, D_801211D4, sizeof(info->D_801211D4_copy)); + memcpy(info->D_8012133C_copy, D_8012133C, sizeof(info->D_8012133C_copy)); + memcpy(info->D_801213B4_copy, D_801213B4, sizeof(info->D_801213B4_copy)); + memcpy(info->D_8012151C_copy, D_8012151C, sizeof(info->D_8012151C_copy)); + memcpy(info->D_8012156C_copy, D_8012156C, sizeof(info->D_8012156C_copy)); + memcpy(info->D_801215BC_copy, D_801215BC, sizeof(info->D_801215BC_copy)); + memcpy(info->D_80121C24_copy, D_80121C24, sizeof(info->D_80121C24_copy)); + memcpy(info->D_80121D3C_copy, D_80121D3C, sizeof(info->D_80121D3C_copy)); + memcpy(info->D_80121F1C_copy, D_80121F1C, sizeof(info->D_80121F1C_copy)); + memcpy(info->D_80121FBC_copy, D_80121FBC, sizeof(info->D_80121FBC_copy)); + memcpy(info->D_801220D4_copy, D_801220D4, sizeof(info->D_801220D4_copy)); + memcpy(info->D_80122714_copy, D_80122714, sizeof(info->D_80122714_copy)); + memcpy(info->D_80122CB4_copy, D_80122CB4, sizeof(info->D_80122CB4_copy)); + memcpy(info->D_80122D04_copy, D_80122D04, sizeof(info->D_80122D04_copy)); + memcpy(info->D_80122E44_copy, D_80122E44, sizeof(info->D_80122E44_copy)); + memcpy(info->D_8012313C_copy, D_8012313C, sizeof(info->D_8012313C_copy)); + memcpy(info->D_801231B4_copy, D_801231B4, sizeof(info->D_801231B4_copy)); + memcpy(info->D_80123254_copy, D_80123254, sizeof(info->D_80123254_copy)); + memcpy(info->D_801232A4_copy, D_801232A4, sizeof(info->D_801232A4_copy)); + memcpy(info->D_80123894_copy, D_80123894, sizeof(info->D_80123894_copy)); + memcpy(info->D_8012390C_copy, D_8012390C, sizeof(info->D_8012390C_copy)); + memcpy(info->D_8012395C_copy, D_8012395C, sizeof(info->D_8012395C_copy)); + memcpy(info->D_801239D4_copy, D_801239D4, sizeof(info->D_801239D4_copy)); +} + +void SaveState::LoadOnePointDemoData(void) { + sPrevFrameCs1100 = info->sPrevFrameCs1100_copy; + memcpy(D_8012013C, info->D_8012013C_copy, sizeof(info->D_8012013C_copy)); + memcpy(D_8012021C, info->D_8012021C_copy, sizeof(info->D_8012021C_copy)); + memcpy(D_801204D4, info->D_801204D4_copy, sizeof(info->D_801204D4_copy)); + memcpy(D_801205B4, info->D_801205B4_copy, sizeof(info->D_801205B4_copy)); + memcpy(D_801208EC, info->D_801208EC_copy, sizeof(info->D_801208EC_copy)); + memcpy(D_80120964, info->D_80120964_copy, sizeof(info->D_80120964_copy)); + memcpy(D_801209B4, info->D_801209B4_copy, sizeof(info->D_801209B4_copy)); + memcpy(D_80120ACC, info->D_80120ACC_copy, sizeof(info->D_80120ACC_copy)); + memcpy(D_80120B94, info->D_80120B94_copy, sizeof(info->D_80120B94_copy)); + memcpy(D_80120D4C, info->D_80120D4C_copy, sizeof(info->D_80120D4C_copy)); + memcpy(D_80120FA4, info->D_80120FA4_copy, sizeof(info->D_80120FA4_copy)); + memcpy(D_80121184, info->D_80121184_copy, sizeof(info->D_80121184_copy)); + memcpy(D_801211D4, info->D_801211D4_copy, sizeof(info->D_801211D4_copy)); + memcpy(D_8012133C, info->D_8012133C_copy, sizeof(info->D_8012133C_copy)); + memcpy(D_801213B4, info->D_801213B4_copy, sizeof(info->D_801213B4_copy)); + memcpy(D_8012151C, info->D_8012151C_copy, sizeof(info->D_8012151C_copy)); + memcpy(D_8012156C, info->D_8012156C_copy, sizeof(info->D_8012156C_copy)); + memcpy(D_801215BC, info->D_801215BC_copy, sizeof(info->D_801215BC_copy)); + memcpy(D_80121C24, info->D_80121C24_copy, sizeof(info->D_80121C24_copy)); + memcpy(D_80121D3C, info->D_80121D3C_copy, sizeof(info->D_80121D3C_copy)); + memcpy(D_80121F1C, info->D_80121F1C_copy, sizeof(info->D_80121F1C_copy)); + memcpy(D_80121FBC, info->D_80121FBC_copy, sizeof(info->D_80121FBC_copy)); + memcpy(D_801220D4, info->D_801220D4_copy, sizeof(info->D_801220D4_copy)); + memcpy(D_80122714, info->D_80122714_copy, sizeof(info->D_80122714_copy)); + memcpy(D_80122CB4, info->D_80122CB4_copy, sizeof(info->D_80122CB4_copy)); + memcpy(D_80122D04, info->D_80122D04_copy, sizeof(info->D_80122D04_copy)); + memcpy(D_80122E44, info->D_80122E44_copy, sizeof(info->D_80122E44_copy)); + memcpy(D_8012313C, info->D_8012313C_copy, sizeof(info->D_8012313C_copy)); + memcpy(D_801231B4, info->D_801231B4_copy, sizeof(info->D_801231B4_copy)); + memcpy(D_80123254, info->D_80123254_copy, sizeof(info->D_80123254_copy)); + memcpy(D_801232A4, info->D_801232A4_copy, sizeof(info->D_801232A4_copy)); + memcpy(D_80123894, info->D_80123894_copy, sizeof(info->D_80123894_copy)); + memcpy(D_8012390C, info->D_8012390C_copy, sizeof(info->D_8012390C_copy)); + memcpy(D_8012395C, info->D_8012395C_copy, sizeof(info->D_8012395C_copy)); + memcpy(D_801239D4, info->D_801239D4_copy, sizeof(info->D_801239D4_copy)); +} + +void SaveState::SaveOverlayStaticData(void) { + info->sBgDdanKdVelocity_copy = sBgDdanKdVelocity; + info->sBgDdanKdAccel_copy = sBgDdanKdAccel; + info->sBgDodoagoFirstExplosiveFlag_copy = sBgDodoagoFirstExplosiveFlag; + info->sBgDodoagoDisableBombCatcher_copy = sBgDodoagoDisableBombCatcher; + info->sBgDodoagoTimer_copy = sBgDodoagoTimer; + info->D_80880F30_copy = D_80880F30; + info->D_80881014_copy = D_80881014; + info->D_8088BFC0_copy = D_8088BFC0; + info->sBgMoriHineriNextCamIdx_copy = sBgMoriHineriNextCamIdx; + info->sBgPoEventBlocksAtRest_copy = sBgPoEventBlocksAtRest; + info->sBgPoEventPuzzleState_copy = sBgPoEventPuzzleState; + info->sBgPoEventblockPushDist_copy = sBgPoEventblockPushDist; + info->D_808A9508_copy = D_808A9508; + info->D_808B85D0_copy = D_808B85D0; + info->sBossGanonSeed1_copy = sBossGanonSeed1; + info->sBossGanonSeed2_copy = sBossGanonSeed2; + info->sBossGanonSeed3_copy = sBossGanonSeed3; + info->sBossGanonGanondorf_copy = sBossGanonGanondorf; + info->sBossGanonZelda_copy = sBossGanonZelda; + info->sBossGanonCape_copy = sBossGanonCape; + memcpy(info->sBossGanonEffectBuf_copy, sBossGanonEffectBuf, sizeof(info->sBossGanonEffectBuf_copy)); + info->D_8090EB20_copy = D_8090EB20; + info->D_80910638_copy = D_80910638; + info->sBossGanon2Zelda_copy = sBossGanon2Zelda; + info->D_8090EB30_copy = D_8090EB30; + info->sBossGanon2Seed1_copy = sBossGanon2Seed1; + info->sBossGanon2Seed2_copy = sBossGanon2Seed2; + info->sBossGanon2Seed3_copy = sBossGanon2Seed3; + memcpy(info->D_809105D8_copy, D_809105D8, sizeof(D_809105D8)); + memcpy(info->D_80910608_copy, D_80910608, sizeof(D_80910608)); + memcpy(info->sBossGanon2Particles_copy, sBossGanon2Particles, sizeof(sBossGanon2Particles)); + info->sTwInitalized_copy = sTwInitalized; + memcpy(info->sTwEffects_copy, sTwEffects, sizeof(sTwEffects)); + info->sDemo6kVelocity_copy = sDemo6kVelocity; + info->D_8096CE94_copy = D_8096CE94; + info->demoKekkaiVel_copy = demoKekkaiVel; + info->sSlugGroup_copy = sSlugGroup; + info->sClearTagIsEffectInitialized_copy = sClearTagIsEffectsInitialized; + memcpy(info->sClearTagEffects_copy, sClearTagEffects, sizeof(sClearTagEffects)); + + memcpy(&info->sEnFrPointers_copy, &sEnFrPointers, sizeof(info->sEnFrPointers_copy)); + info->sSpawnNum_copy = sSpawnNum; + + info->D_80A7DEB0_copy = D_80A7DEB0; + info->D_80A7DEB4_copy = D_80A7DEB4; + info->D_80A7DEB8_copy = D_80A7DEB8; + info->sRockRotSpeedX_copy = sRockRotSpeedX; + info->sRockRotSpeedY_copy = sRockRotSpeedY; + info->D_80AB85E0_copy = D_80AB85E0; + info->sLowerRiverSpawned_copy = sLowerRiverSpawned; + info->sUpperRiverSpawned_copy = sUpperRiverSpawned; + info->sEnPoFieldNumSpawned_copy = sEnPoFieldNumSpawned; + memcpy(info->sEnPoFieldSpawnPositions_copy, sEnPoFieldSpawnPositions, sizeof(info->sEnPoFieldSpawnPositions_copy)); + memcpy(info->sEnPoFieldSpawnSwitchFlags_copy, sEnPoFieldSpawnSwitchFlags, sizeof(info->sEnPoFieldSpawnSwitchFlags_copy)); + + info->sTakaraIsInitialized_copy = sTakaraIsInitialized; + info->D_80B41D90_copy = D_80B41D90; + info->sEnXcFlameSpawned_copy = sEnXcFlameSpawned; + info->D_80B41DA8_copy = D_80B41DA8; + info->D_80B41DAC_copy = D_80B41DAC; + info->D_80B4A1B0_copy = D_80B4A1B0; + info->D_80B4A1B4_copy = D_80B4A1B4; + info->D_80B5A468_copy = D_80B5A468; + info->D_80B5A494_copy = D_80B5A494; + info->D_80B5A4BC_copy = D_80B5A4BC; + info->sKankyoIsSpawned_copy = sKankyoIsSpawned; + info->sTrailingFairies_copy = sTrailingFairies; + +} + +void SaveState::LoadOverlayStaticData(void) { + sBgDdanKdVelocity = info->sBgDdanKdVelocity_copy; + sBgDdanKdAccel = info->sBgDdanKdAccel_copy; + sBgDodoagoFirstExplosiveFlag = info->sBgDodoagoFirstExplosiveFlag_copy; + sBgDodoagoDisableBombCatcher = info->sBgDodoagoDisableBombCatcher_copy; + sBgDodoagoTimer = info->sBgDodoagoTimer_copy; + D_80880F30 = info->D_80880F30_copy; + D_80881014 = info->D_80881014_copy; + D_8088BFC0 = info->D_8088BFC0_copy; + sBgMoriHineriNextCamIdx = info->sBgMoriHineriNextCamIdx_copy; + sBgPoEventBlocksAtRest = info->sBgPoEventBlocksAtRest_copy; + sBgPoEventPuzzleState = info->sBgPoEventPuzzleState_copy; + sBgPoEventblockPushDist = info->sBgPoEventblockPushDist_copy; + D_808A9508 = info->D_808A9508_copy; + D_808B85D0 = info->D_808B85D0_copy; + sBossGanonSeed1 = info->sBossGanonSeed1_copy; + sBossGanonSeed2 = info->sBossGanonSeed2_copy; + sBossGanonSeed3 = info->sBossGanonSeed3_copy; + sBossGanonGanondorf = info->sBossGanonGanondorf_copy; + sBossGanonZelda = info->sBossGanonZelda_copy; + sBossGanonCape = info->sBossGanonCape_copy; + memcpy(sBossGanonEffectBuf, info->sBossGanonEffectBuf_copy, sizeof(info->sBossGanonEffectBuf_copy)); + + D_8090EB20 = info->D_8090EB20_copy; + D_80910638 = info->D_80910638_copy; + sBossGanon2Zelda = info->sBossGanon2Zelda_copy; + D_8090EB30 = info->D_8090EB30_copy; + sBossGanon2Seed1 = info->sBossGanon2Seed1_copy; + sBossGanon2Seed2 = info->sBossGanon2Seed2_copy; + sBossGanon2Seed3 = info->sBossGanon2Seed3_copy; + memcpy(D_809105D8, info->D_809105D8_copy, sizeof(D_809105D8)); + memcpy(D_80910608, info->D_80910608_copy, sizeof(D_80910608)); + memcpy(sBossGanon2Particles, info->sBossGanon2Particles_copy, sizeof(sBossGanon2Particles)); + sTwInitalized = info->sTwInitalized_copy; + memcpy(sTwEffects, info->sTwEffects_copy, sizeof(sTwEffects)); + sDemo6kVelocity = info->sDemo6kVelocity_copy; + + D_8096CE94 = info->D_8096CE94_copy; + demoKekkaiVel = info->demoKekkaiVel_copy; + sSlugGroup = info->sSlugGroup_copy; + sClearTagIsEffectsInitialized = info->sClearTagIsEffectInitialized_copy; + memcpy(sClearTagEffects, info->sClearTagEffects_copy, sizeof(sClearTagEffects)); + + D_80A7DEB0 = info->D_80A7DEB0_copy; + D_80A7DEB4 = info->D_80A7DEB4_copy; + D_80A7DEB8 = info->D_80A7DEB8_copy; + sRockRotSpeedX = info->sRockRotSpeedX_copy; + sRockRotSpeedY = info->sRockRotSpeedY_copy; + D_80AB85E0 = info->D_80AB85E0_copy; + sLowerRiverSpawned = info->sLowerRiverSpawned_copy; + sUpperRiverSpawned = info->sUpperRiverSpawned_copy; + sEnPoFieldNumSpawned = info->sEnPoFieldNumSpawned_copy; + memcpy(sEnPoFieldSpawnPositions, info->sEnPoFieldSpawnPositions_copy, sizeof(info->sEnPoFieldSpawnPositions_copy)); + memcpy(sEnPoFieldSpawnSwitchFlags, info->sEnPoFieldSpawnSwitchFlags_copy, sizeof(info->sEnPoFieldSpawnSwitchFlags_copy)); + + sTakaraIsInitialized = info->sTakaraIsInitialized_copy; + D_80B41D90 = info->D_80B41D90_copy; + sEnXcFlameSpawned = info->sEnXcFlameSpawned_copy; + D_80B41DA8 = info->D_80B41DA8_copy; + D_80B41DAC = info->D_80B41DAC_copy; + D_80B4A1B0 = info->D_80B4A1B0_copy; + D_80B4A1B4 = info->D_80B4A1B4_copy; + D_80B5A468 = info->D_80B5A468_copy; + D_80B5A494 = info->D_80B5A494_copy; + D_80B5A4BC = info->D_80B5A4BC_copy; + sKankyoIsSpawned = info->sKankyoIsSpawned_copy; + sTrailingFairies = info->sTrailingFairies_copy; +} + +void SaveState::SaveMiscCodeData(void) { + info->gGameOverTimer_copy = gGameOverTimer; + info->gTimeIncrement_copy = gTimeIncrement; + info->sLoadedMarkDataTableCopy = sLoadedMarkDataTable; + + info->sPlayerInitialPosX_copy = sPlayerInitialPosX; + info->sPlayerInitialPosZ_copy = sPlayerInitialPosZ; + info->sPlayerInitialDirection_copy = sPlayerInitialDirection; + + info->sOcarinaInpEnabled_copy = sOcarinaInpEnabled; + info->D_80130F10_copy = D_80130F10; + info->sCurOcarinaBtnVal_copy = sCurOcarinaBtnVal; + info->sPrevOcarinaNoteVal_copy = sPrevOcarinaNoteVal; + info->sCurOcarinaBtnIdx_copy = sCurOcarinaBtnIdx; + info->sLearnSongLastBtn_copy = sLearnSongLastBtn; + info->D_80130F24_copy = D_80130F24; + info->D_80130F28_copy = D_80130F28; + info->D_80130F2C_copy = D_80130F2C; + info->D_80130F30_copy = D_80130F30; + info->D_80130F34_copy = D_80130F34; + info->sPlaybackState_copy = sPlaybackState; + info->D_80130F3C_copy = D_80130F3C; + info->sNotePlaybackTimer_copy = sNotePlaybackTimer; + info->sPlaybackNotePos_copy = sPlaybackNotePos; + info->sStaffPlaybackPos_copy = sStaffPlaybackPos; + + + info->sCurOcarinaBtnPress_copy = sCurOcarinaBtnPress; + info->D_8016BA10_copy = D_8016BA10; + info->sPrevOcarinaBtnPress_copy = sPrevOcarinaBtnPress; + info->D_8016BA18_copy = D_8016BA18; + info->D_8016BA1C_copy = D_8016BA1C; + memcpy(info->sCurOcarinaSong_copy, sCurOcarinaSong, sizeof(sCurOcarinaSong)); + info->sOcarinaSongAppendPos_copy = sOcarinaSongAppendPos; + info->sOcarinaHasStartedSong_copy = sOcarinaHasStartedSong; + info->sOcarinaSongNoteStartIdx_copy = sOcarinaSongNoteStartIdx; + info->sOcarinaSongCnt_copy = sOcarinaSongCnt; + info->sOcarinaAvailSongs_copy = sOcarinaAvailSongs; + info->sStaffPlayingPos_copy = sStaffPlayingPos; + memcpy(info->sLearnSongPos_copy, sLearnSongPos, sizeof(sLearnSongPos)); + memcpy(info->D_8016BA50_copy, D_8016BA50, sizeof(D_8016BA50)); + memcpy(info->D_8016BA70_copy, D_8016BA70, sizeof(D_8016BA70)); + memcpy(info->sLearnSongExpectedNote_copy, sLearnSongExpectedNote, sizeof(sLearnSongExpectedNote)); + memcpy(&info->D_8016BAA0_copy, &D_8016BAA0, sizeof(D_8016BAA0)); + info->sAudioHasMalonBgm_copy = sAudioHasMalonBgm; + info->sAudioMalonBgmDist_copy = sAudioMalonBgmDist; + info->sDisplayedNoteValue_copy = sDisplayedNoteValue; + + + info->sOcarinaNoteBufPos_copy = sOcarinaNoteBufPos; + info->sOcarinaNoteBufLen_copy = sOcarinaNoteBufLen; + memcpy(info->sOcarinaNoteBuf_copy, sOcarinaNoteBuf, sizeof(sOcarinaNoteBuf)); + info->D_8014B2F4_copy = D_8014B2F4; + info->sTextboxSkipped_copy = sTextboxSkipped; + info->sNextTextId_copy = sNextTextId; + info->sLastPlayedSong_copy = sLastPlayedSong; + info->sHasSunsSong_copy = sHasSunsSong; + info->sMessageHasSetSfx_copy = sMessageHasSetSfx; + info->sOcarinaSongBitFlags_copy = sOcarinaSongBitFlags; +} + +void SaveState::LoadMiscCodeData(void) { + gGameOverTimer = info->gGameOverTimer_copy; + gTimeIncrement = info->gTimeIncrement_copy; + sLoadedMarkDataTable = info->sLoadedMarkDataTableCopy; + + sPlayerInitialPosX = info->sPlayerInitialPosX_copy; + sPlayerInitialPosZ = info->sPlayerInitialPosZ_copy; + sPlayerInitialDirection = info->sPlayerInitialDirection_copy; + + sOcarinaInpEnabled = info->sOcarinaInpEnabled_copy; + D_80130F10 = info->D_80130F10_copy; + sCurOcarinaBtnVal = info->sCurOcarinaBtnVal_copy; + sPrevOcarinaNoteVal = info->sPrevOcarinaNoteVal_copy; + sCurOcarinaBtnIdx = info->sCurOcarinaBtnIdx_copy; + sLearnSongLastBtn = info->sLearnSongLastBtn_copy; + D_80130F24 = info->D_80130F24_copy; + D_80130F28 = info->D_80130F28_copy; + D_80130F2C = info->D_80130F2C_copy; + D_80130F30 = info->D_80130F30_copy; + D_80130F34 = info->D_80130F34_copy; + sPlaybackState = info->sPlaybackState_copy; + D_80130F3C = info->D_80130F3C_copy; + sNotePlaybackTimer = info->sNotePlaybackTimer_copy; + sPlaybackNotePos = info->sPlaybackNotePos_copy; + sStaffPlaybackPos = info->sStaffPlaybackPos_copy; + + sCurOcarinaBtnPress = info->sCurOcarinaBtnPress_copy; + D_8016BA10 = info->D_8016BA10_copy; + sPrevOcarinaBtnPress = info->sPrevOcarinaBtnPress_copy; + D_8016BA18 = info->D_8016BA18_copy; + D_8016BA1C = info->D_8016BA1C_copy; + memcpy(sCurOcarinaSong, info->sCurOcarinaSong_copy, sizeof(sCurOcarinaSong)); + sOcarinaSongAppendPos = info->sOcarinaSongAppendPos_copy; + sOcarinaHasStartedSong = info->sOcarinaHasStartedSong_copy; + sOcarinaSongNoteStartIdx = info->sOcarinaSongNoteStartIdx_copy; + sOcarinaSongCnt = info->sOcarinaSongCnt_copy; + sOcarinaAvailSongs = info->sOcarinaAvailSongs_copy; + sStaffPlayingPos = info->sStaffPlayingPos_copy; + memcpy(info->sLearnSongPos_copy, info->sLearnSongPos_copy, sizeof(sLearnSongPos)); + memcpy(info->D_8016BA50_copy, info->D_8016BA50_copy, sizeof(D_8016BA50)); + memcpy(info->D_8016BA70_copy, info->D_8016BA70_copy, sizeof(D_8016BA70)); + memcpy(info->sLearnSongExpectedNote_copy, info->sLearnSongExpectedNote_copy, sizeof(sLearnSongExpectedNote)); + memcpy(&D_8016BAA0, &info->D_8016BAA0_copy, sizeof(D_8016BAA0)); + sAudioHasMalonBgm = info->sAudioHasMalonBgm_copy; + sAudioMalonBgmDist = info->sAudioMalonBgmDist_copy; + sDisplayedNoteValue = info->sDisplayedNoteValue_copy; + + sOcarinaNoteBufPos = info->sOcarinaNoteBufPos_copy; + sOcarinaNoteBufLen = info->sOcarinaNoteBufLen_copy; + memcpy(sOcarinaNoteBuf, info->sOcarinaNoteBuf_copy, sizeof(sOcarinaNoteBuf)); + + D_8014B2F4 = info->D_8014B2F4_copy; + sTextboxSkipped = info->sTextboxSkipped_copy; + sNextTextId = info->sNextTextId_copy; + sLastPlayedSong = info->sLastPlayedSong_copy; + sHasSunsSong = info->sHasSunsSong_copy; + sMessageHasSetSfx = info->sMessageHasSetSfx_copy; + sOcarinaSongBitFlags = info->sOcarinaSongBitFlags_copy; + + +} + +extern "C" void ProcessSaveStateRequests(void) { + OTRGlobals::Instance->gSaveStateMgr->ProcessSaveStateRequests(); +} + +void SaveStateMgr::SetCurrentSlot(unsigned int slot) { + SohImGui::overlay->TextDrawNotification(1.0f, true, "slot %u set", slot); + this->currentSlot = slot; +} + +unsigned int SaveStateMgr::GetCurrentSlot(void) { + return this->currentSlot; +} + +void SaveStateMgr::ProcessSaveStateRequests(void) { + while (!this->requests.empty()) { + const auto& request = this->requests.front(); + + switch (request.type) { + case RequestType::SAVE: + if (!this->states.contains(request.slot)) { + this->states[request.slot] = std::make_shared(OTRGlobals::Instance->gSaveStateMgr, request.slot); + } + this->states[request.slot]->Save(); + SohImGui::overlay->TextDrawNotification(1.0f, true, "saved state %u", request.slot); + break; + case RequestType::LOAD: + if (this->states.contains(request.slot)) { + this->states[request.slot]->Load(); + SohImGui::overlay->TextDrawNotification(1.0f, true, "loaded state %u", request.slot); + } else { + SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); + } + break; + [[unlikely]] default: + SPDLOG_ERROR("Invalid SaveState request type: {}", request.type); + break; + } + this->requests.pop(); + } +} + +SaveStateReturn SaveStateMgr::AddRequest(const SaveStateRequest request) { + if (gGlobalCtx == nullptr) { + SPDLOG_ERROR("[SOH] Can not save or load a state outside of \"GamePlay\""); + SohImGui::overlay->TextDrawNotification(1.0f, true, "states not available here", request.slot); + return SaveStateReturn::FAIL_WRONG_GAMESTATE; + } + + switch (request.type) { + case RequestType::SAVE: + requests.push(request); + break; + case RequestType::LOAD: + if (states.contains(request.slot)) { + requests.push(request); + } else { + SPDLOG_ERROR("Invalid SaveState slot: {}", request.type); + SohImGui::overlay->TextDrawNotification(1.0f, true, "state slot %u empty", request.slot); + return SaveStateReturn::FAIL_INVALID_SLOT; + } + break; + [[unlikely]] default: + SPDLOG_ERROR("Invalid SaveState request type: {}", request.type); + return SaveStateReturn::FAIL_BAD_REQUEST; + break; + + } +} + +void SaveState::Save(void) { + std::unique_lock Lock(audio.mutex); + memcpy(&info->sysHeapCopy, gSystemHeap, SYSTEM_HEAP_SIZE /* sizeof(gSystemHeap) */); + memcpy(&info->audioHeapCopy, gAudioHeap, AUDIO_HEAP_SIZE /* sizeof(gAudioContext) */); + + memcpy(&info->audioContextCopy, &gAudioContext, sizeof(AudioContext)); + memcpy(&info->unk_D_8016E750Copy, D_8016E750, sizeof(info->unk_D_8016E750Copy)); + BackupSeqScriptState(); + + memcpy(info->gActiveSoundsCopy, gActiveSounds, sizeof(gActiveSounds)); + memcpy(&info->gSoundBankMutedCopy, gSoundBankMuted, sizeof(info->gSoundBankMutedCopy)); + + info->D_801333F0_copy = D_801333F0; + info->gAudioSfxSwapOff_copy = gAudioSfxSwapOff; + + memcpy(&info->gAudioSfxSwapSource_copy, gAudioSfxSwapSource, + sizeof(info->gAudioSfxSwapSource_copy)); + memcpy(&info->gAudioSfxSwapTarget_copy, gAudioSfxSwapTarget, + sizeof(info->gAudioSfxSwapTarget_copy)); + memcpy(&info->gAudioSfxSwapMode_copy, gAudioSfxSwapMode, + sizeof(info->gAudioSfxSwapMode_copy)); + + info->D_801755D0_copy = D_801755D0; + + memcpy(&info->saveContextCopy, &gSaveContext, sizeof(gSaveContext)); + memcpy(&info->gameInfoCopy, gGameInfo, sizeof(*gGameInfo)); + memcpy(&info->lightBufferCopy, &sLightsBuffer, sizeof(sLightsBuffer)); + memcpy(&info->mtxStackCopy, &sMatrixStack, sizeof(MtxF) * 20); + memcpy(&info->currentMtxCopy, &sCurrentMatrix, sizeof(MtxF)); + + //Various static data + info->blueWarpTimerCopy = sWarpTimerTarget; + BackupCameraData(); + SaveOnePointDemoData(); + SaveOverlayStaticData(); + SaveMiscCodeData(); + +} + +void SaveState::Load(void) { + std::unique_lock Lock(audio.mutex); + memcpy(gSystemHeap, &info->sysHeapCopy, SYSTEM_HEAP_SIZE); + memcpy(gAudioHeap, &info->audioHeapCopy, AUDIO_HEAP_SIZE); + + memcpy(&gAudioContext, &info->audioContextCopy, sizeof(AudioContext)); + memcpy(D_8016E750, &info->unk_D_8016E750Copy, sizeof(info->unk_D_8016E750Copy)); + LoadSeqScriptState(); + + memcpy(&gSaveContext, &info->saveContextCopy, sizeof(gSaveContext)); + memcpy(gGameInfo, &info->gameInfoCopy, sizeof(*gGameInfo)); + memcpy(&sLightsBuffer, &info->lightBufferCopy, sizeof(sLightsBuffer)); + memcpy(&sMatrixStack, &info->mtxStackCopy, sizeof(MtxF) * 20); + memcpy(&sCurrentMatrix, &info->currentMtxCopy, sizeof(MtxF)); + sWarpTimerTarget = info->blueWarpTimerCopy; + + memcpy(gActiveSounds, info->gActiveSoundsCopy, sizeof(gActiveSounds)); + memcpy(gSoundBankMuted, &info->gSoundBankMutedCopy, sizeof(info->gSoundBankMutedCopy)); + D_801333F0 = info->D_801333F0_copy; + gAudioSfxSwapOff = info->gAudioSfxSwapOff_copy; + + memcpy(gAudioSfxSwapSource, &info->gAudioSfxSwapSource_copy, + sizeof(info->gAudioSfxSwapSource_copy)); + memcpy(gAudioSfxSwapTarget, &info->gAudioSfxSwapTarget_copy, + sizeof(info->gAudioSfxSwapTarget_copy)); + memcpy(gAudioSfxSwapMode, &info->gAudioSfxSwapMode_copy, + sizeof(info->gAudioSfxSwapMode_copy)); + + //Various static data + D_801755D0 = info->D_801755D0_copy; + LoadCameraData(); + LoadOnePointDemoData(); + LoadOverlayStaticData(); + LoadMiscCodeData(); + +} diff --git a/soh/soh/Enhancements/savestates.h b/soh/soh/Enhancements/savestates.h new file mode 100644 index 000000000..4ac142172 --- /dev/null +++ b/soh/soh/Enhancements/savestates.h @@ -0,0 +1,62 @@ +#ifndef SAVE_STATES_H +#define SAVE_STATES_H + +#include +#include +#include +#include +#include + +enum class SaveStateReturn { + SUCCESS, + FAIL_INVALID_SLOT, + FAIL_NO_MEMORY, + FAIL_STATE_EMPTY, + FAIL_WRONG_GAMESTATE, + FAIL_BAD_REQUEST, +}; + +typedef struct SaveStateHeader { + uint32_t stateMagic; + uint32_t stateVersion; + //uint32_t gameVersion; +} SaveStateHeader; + +enum class RequestType { + SAVE, + LOAD, +}; + +typedef struct SaveStateRequest { + unsigned int slot; + RequestType type; +} SaveStateRequest; + +class SaveState; + +class SaveStateMgr { + friend class SaveState; + private: + unsigned int currentSlot; + std::unordered_map> states; + std::queue requests; + std::mutex mutex; + + public: + + SaveStateReturn AddRequest(const SaveStateRequest request); + SaveStateMgr(); + ~SaveStateMgr(); + + void SetCurrentSlot(unsigned int slot); + unsigned int GetCurrentSlot(void); + + SaveStateMgr& operator=(const SaveStateMgr& rhs) = delete; + SaveStateMgr(const SaveStateMgr& rhs) = delete; + + void ProcessSaveStateRequests(void); + +}; +extern std::shared_ptr gSaveStateMgr; + +#endif diff --git a/soh/soh/Enhancements/savestates_extern.inc b/soh/soh/Enhancements/savestates_extern.inc new file mode 100644 index 000000000..c3b129a32 --- /dev/null +++ b/soh/soh/Enhancements/savestates_extern.inc @@ -0,0 +1,257 @@ +extern "C" MtxF* sMatrixStack; +extern "C" MtxF* sCurrentMatrix; +extern "C" LightsBuffer sLightsBuffer; +extern "C" s16 sWarpTimerTarget; +extern "C" MapMarkData** sLoadedMarkDataTable; + +//Camera static data +extern "C" int32_t sInitRegs; +extern "C" int32_t gDbgCamEnabled; +extern "C" int32_t sDbgModeIdx; +extern "C" int16_t sNextUID; +extern "C" int32_t sCameraInterfaceFlags; +extern "C" int32_t sCameraInterfaceAlpha; +extern "C" int32_t sCameraShrinkWindowVal; +extern "C" int32_t D_8011D3AC; +extern "C" int32_t sDemo5PrevAction12Frame; +extern "C" int32_t sDemo5PrevSfxFrame; +extern "C" int32_t D_8011D3F0; +extern "C" OnePointCsFull D_8011D6AC[]; +extern "C" OnePointCsFull D_8011D724[]; +extern "C" OnePointCsFull D_8011D79C[]; +extern "C" OnePointCsFull D_8011D83C[]; +extern "C" OnePointCsFull D_8011D88C[]; +extern "C" OnePointCsFull D_8011D8DC[]; +extern "C" OnePointCsFull D_8011D954[]; +extern "C" OnePointCsFull D_8011D9F4[]; +extern "C" int16_t D_8011DB08; +extern "C" int16_t D_8011DB0C; +extern "C" int32_t sOOBTimer; +extern "C" f32 D_8015CE50; +extern "C" f32 D_8015CE54; +extern "C" CamColChk D_8015CE58; + +//Gameover +extern "C" uint16_t gGameOverTimer; + +//One Point Demo +extern "C" uint32_t sPrevFrameCs1100; +extern "C" CutsceneCameraPoint D_8012013C[14]; +extern "C" CutsceneCameraPoint D_8012021C[14]; +extern "C" CutsceneCameraPoint D_801204D4[14]; +extern "C" CutsceneCameraPoint D_801205B4[14]; +extern "C" OnePointCsFull D_801208EC[3]; +extern "C" OnePointCsFull D_80120964[2]; +extern "C" OnePointCsFull D_801209B4[4]; +extern "C" OnePointCsFull D_80120ACC[5]; +extern "C" OnePointCsFull D_80120B94[11]; +extern "C" OnePointCsFull D_80120D4C[7]; +extern "C" OnePointCsFull D_80120FA4[6]; +extern "C" OnePointCsFull D_80121184[2]; +extern "C" OnePointCsFull D_801211D4[2]; +extern "C" OnePointCsFull D_8012133C[3]; +extern "C" OnePointCsFull D_801213B4[5]; +extern "C" OnePointCsFull D_8012151C[2]; +extern "C" OnePointCsFull D_8012156C[2]; +extern "C" OnePointCsFull D_801215BC[1]; +extern "C" OnePointCsFull D_80121C24[7]; +extern "C" OnePointCsFull D_80121D3C[3]; +extern "C" OnePointCsFull D_80121F1C[4]; +extern "C" OnePointCsFull D_80121FBC[4]; +extern "C" OnePointCsFull D_801220D4[5]; +extern "C" OnePointCsFull D_80122714[4]; +extern "C" OnePointCsFull D_80122CB4[2]; +extern "C" OnePointCsFull D_80122D04[2]; +extern "C" OnePointCsFull D_80122E44[2][7]; +extern "C" OnePointCsFull D_8012313C[3]; +extern "C" OnePointCsFull D_801231B4[4]; +extern "C" OnePointCsFull D_80123254[2]; +extern "C" OnePointCsFull D_801232A4[1]; +extern "C" OnePointCsFull D_80123894[3]; +extern "C" OnePointCsFull D_8012390C[2]; +extern "C" OnePointCsFull D_8012395C[3]; +extern "C" OnePointCsFull D_801239D4[3]; + +// z_bg_ddan_kd +extern "C" Vec3f sBgDdanKdVelocity; +extern "C" Vec3f sBgDdanKdAccel; + +// z_bg_dodoago +extern "C" s16 sBgDodoagoFirstExplosiveFlag; +extern "C" u8 sBgDodoagoDisableBombCatcher; +extern "C" s32 sBgDodoagoTimer; + +// z_bg_haka_trap +extern "C" uint32_t D_80880F30; +extern "C" uint32_t D_80881014; + +// z_bg_hidan_rock +extern "C" float D_8088BFC0; + +// z_bg_menkuri_eye +extern "C" int32_t D_8089C1A0; + +// z_bg_mori_hineri +extern "C" int16_t sBgMoriHineriNextCamIdx; + +// z_bg_po_event +extern "C" uint8_t sBgPoEventBlocksAtRest; +extern "C" uint8_t sBgPoEventPuzzleState; +extern "C" float sBgPoEventblockPushDist; + +// z_bg_relay_objects +extern "C" uint32_t D_808A9508; + +// z_bg_spot18_basket +extern "C" int16_t D_808B85D0; + +// z_boss_ganon +extern "C" uint32_t sBossGanonSeed1; +extern "C" uint32_t sBossGanonSeed2; +extern "C" uint32_t sBossGanonSeed3; +extern "C" void* sBossGanonGanondorf; +extern "C" void* sBossGanonZelda; +extern "C" void* sBossGanonCape; +extern "C" GanondorfEffect sBossGanonEffectBuf[200]; + +// z_boss_ganon2 +extern "C" Vec3f D_8090EB20; +extern "C" int8_t D_80910638; +extern "C" void* sBossGanon2Zelda; +extern "C" void* D_8090EB30; +extern "C" int32_t sBossGanon2Seed1; +extern "C" int32_t sBossGanon2Seed2; +extern "C" int32_t sBossGanon2Seed3; +extern "C" Vec3f D_809105D8[4]; +extern "C" Vec3f D_80910608[4]; +extern "C" BossGanon2Effect sBossGanon2Particles[100]; + +// z_boss_tw +extern "C" uint8_t sTwInitalized; +extern "C" BossTwEffect sTwEffects[150]; + +// z_demo_6k +extern "C" Vec3f sDemo6kVelocity; + +// z_demo_du +extern "C" int32_t D_8096CE94; + +// z_demo_kekkai +extern "C" Vec3f demoKekkaiVel; + +// z_en_bw +extern "C" int32_t sSlugGroup; + +// z_en_clear_tag +extern "C" uint8_t sClearTagIsEffectsInitialized; +extern "C" EnClearTagEffect sClearTagEffects[CLEAR_TAG_EFFECT_MAX_COUNT]; + +// z_en_fr +extern "C" EnFrPointers sEnFrPointers; + +// z_en_goma +extern "C" uint8_t sSpawnNum; + +// z_en_in +extern "C" int32_t D_80A7B998; + +// z_en_insect +extern "C" float D_80A7DEB0; +extern "C" int16_t D_80A7DEB4; +extern "C" int16_t D_80A7DEB8; + +// z_en_ishi +extern "C" int16_t sRockRotSpeedX; +extern "C" int16_t sRockRotSpeedY; + +// z_en_niw +extern "C" int16_t D_80AB85E0; +extern "C" uint8_t sLowerRiverSpawned; +extern "C" uint8_t sUpperRiverSpawned; + +// z_en_po_field +extern "C" int32_t sEnPoFieldNumSpawned; +extern "C" Vec3s sEnPoFieldSpawnPositions[10]; +extern "C" u8 sEnPoFieldSpawnSwitchFlags[10]; + +// z_en_takara_man +extern "C" uint8_t sTakaraIsInitialized; + +// z_en_xc +extern "C" int32_t D_80B41D90; +extern "C" int32_t sEnXcFlameSpawned; +extern "C" int32_t D_80B41DA8; +extern "C" int32_t D_80B41DAC; + +// z_en_zf +extern "C" int16_t D_80B4A1B0; +extern "C" int16_t D_80B4A1B4; + +extern "C" int32_t D_80B5A468; +extern "C" int32_t D_80B5A494; +extern "C" int32_t D_80B5A4BC; + +extern "C" uint8_t sKankyoIsSpawned; +extern "C" int16_t sTrailingFairies; + +extern "C" uint16_t gTimeIncrement; + +extern "C" s16 sPlayerInitialPosX; +extern "C" s16 sPlayerInitialPosZ; +extern "C" s16 sPlayerInitialDirection; + +// code_800EC960 +// Related to ocarina +extern "C" u8 sOcarinaInpEnabled; +extern "C" s8 D_80130F10; +extern "C" u8 sCurOcarinaBtnVal; +extern "C" u8 sPrevOcarinaNoteVal; +extern "C" u8 sCurOcarinaBtnIdx; +extern "C" u8 sLearnSongLastBtn; +extern "C" f32 D_80130F24; +extern "C" f32 D_80130F28; +extern "C" s8 D_80130F2C; +extern "C" s8 D_80130F30; +extern "C" s8 D_80130F34; +extern "C" u8 sPlaybackState; +extern "C" u32 D_80130F3C; +extern "C" u32 sNotePlaybackTimer; +extern "C" u16 sPlaybackNotePos; +extern "C" u16 sStaffPlaybackPos; + +//IDK what this is but it looks important +extern "C" u32 sCurOcarinaBtnPress; +extern "C" u32 D_8016BA10; +extern "C" u32 sPrevOcarinaBtnPress; +extern "C" s32 D_8016BA18; +extern "C" s32 D_8016BA1C; +extern "C" u8 sCurOcarinaSong[8]; +extern "C" u8 sOcarinaSongAppendPos; +extern "C" u8 sOcarinaHasStartedSong; +extern "C" u8 sOcarinaSongNoteStartIdx; +extern "C" u8 sOcarinaSongCnt; +extern "C" u16 sOcarinaAvailSongs; +extern "C" u8 sStaffPlayingPos; +extern "C" u16 sLearnSongPos[0x10]; +extern "C" u16 D_8016BA50[0x10]; +extern "C" u16 D_8016BA70[0x10]; +extern "C" u8 sLearnSongExpectedNote[0x10]; +extern "C" OcarinaNote D_8016BAA0; +extern "C" u8 sAudioHasMalonBgm; +extern "C" f32 sAudioMalonBgmDist; +extern "C" u8 sDisplayedNoteValue; + + + +// z_message_PAL +extern "C" s16 sOcarinaNoteBufPos; +extern "C" s16 sOcarinaNoteBufLen; +extern "C" u8 sOcarinaNoteBuf[12]; + +extern "C" u8 D_8014B2F4; +extern "C" u8 sTextboxSkipped; +extern "C" u16 sNextTextId; +extern "C" s16 sLastPlayedSong; +extern "C" s16 sHasSunsSong; +extern "C" s16 sMessageHasSetSfx; +extern "C" u16 sOcarinaSongBitFlags; \ No newline at end of file diff --git a/soh/soh/GbiWrap.cpp b/soh/soh/GbiWrap.cpp index 1f6a8003c..9f71f1717 100644 --- a/soh/soh/GbiWrap.cpp +++ b/soh/soh/GbiWrap.cpp @@ -5,10 +5,12 @@ extern "C" { void InitOTR(); void Graph_ProcessFrame(void (*run_one_game_iter)(void)); +void Graph_StartFrame(); void Graph_ProcessGfxCommands(Gfx* commands); void OTRLogString(const char* src); void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char)); void OTRSetFrameDivisor(int divisor); +void OTRGetPixelDepthPrepare(float x, float y); uint16_t OTRGetPixelDepth(float x, float y); int32_t OTRGetLastScancode(); void ResourceMgr_CacheDirectory(const char* resName); diff --git a/soh/soh/OTRAudio.h b/soh/soh/OTRAudio.h new file mode 100644 index 000000000..ee0ec46a2 --- /dev/null +++ b/soh/soh/OTRAudio.h @@ -0,0 +1,8 @@ +#pragma once + +static struct { + std::condition_variable cv_to_thread, cv_from_thread; + std::mutex mutex; + bool initialized; + bool processing; +} audio; diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 0732a80e1..e8e1b31c1 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -1,8 +1,10 @@ #include "OTRGlobals.h" +#include "OTRAudio.h" #include #include #include #include "GlobalCtx2.h" +#include "GameSettings.h" #include "ResourceMgr.h" #include "DisplayList.h" #include "PlayerAnimation.h" @@ -10,10 +12,14 @@ #include "Window.h" #include "z64animation.h" #include "z64bgcheck.h" -#include "../soh/enhancements/gameconsole.h" +#include "Enhancements/gameconsole.h" #include #include +#ifdef _WIN32 #include +#else +#include +#endif #include #include #include @@ -21,12 +27,22 @@ #include #include "Lib/stb/stb_image.h" #include "AudioPlayer.h" -#include "../soh/Enhancements/debugconsole.h" +#include "Enhancements/debugconsole.h" +#include "Enhancements/debugger/debugger.h" +#include "soh/frame_interpolation.h" +#include "Utils/BitConverter.h" +#include "variables.h" +#include "macros.h" +#include + +#include OTRGlobals* OTRGlobals::Instance; OTRGlobals::OTRGlobals() { + context = Ship::GlobalCtx2::CreateInstance("Ship of Harkinian"); + gSaveStateMgr = std::make_shared(); context->GetWindow()->Init(); } @@ -37,15 +53,30 @@ extern uintptr_t clearMtx; extern "C" Mtx gMtxClear; extern "C" MtxF gMtxFClear; extern "C" void OTRMessage_Init(); +extern "C" void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples); +extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len); +extern "C" int AudioPlayer_Buffered(void); +extern "C" int AudioPlayer_GetDesiredBuffered(void); // C->C++ Bridge extern "C" void InitOTR() { OTRGlobals::Instance = new OTRGlobals(); + auto t = OTRGlobals::Instance->context->GetResourceManager()->LoadFile("version"); + + if (!t->bHasLoadError) + { + //uint32_t gameVersion = BitConverter::ToUInt32BE((uint8_t*)t->buffer.get(), 0); + uint32_t gameVersion = *((uint32_t*)t->buffer.get()); + OTRGlobals::Instance->context->GetResourceManager()->SetGameVersion(gameVersion); + } + clearMtx = (uintptr_t)&gMtxClear; OTRMessage_Init(); DebugConsole_Init(); + Debug_Init(); } +#ifdef _WIN32 extern "C" uint64_t GetFrequency() { LARGE_INTEGER nFreq; @@ -60,15 +91,156 @@ extern "C" uint64_t GetPerfCounter() { return ticks.QuadPart; } +#else +extern "C" uint64_t GetFrequency() { + return 1000; // sec -> ms +} + +extern "C" uint64_t GetPerfCounter() { + struct timespec monotime; + clock_gettime(CLOCK_MONOTONIC, &monotime); + + uint64_t remainingMs = (monotime.tv_nsec / 1000000); + + // in milliseconds + return monotime.tv_sec * 1000 + remainingMs; +} +#endif // C->C++ Bridge extern "C" void Graph_ProcessFrame(void (*run_one_game_iter)(void)) { OTRGlobals::Instance->context->GetWindow()->MainLoop(run_one_game_iter); } +extern "C" void Graph_StartFrame() { + // Why -1? + int32_t dwScancode = OTRGlobals::Instance->context->GetWindow()->lastScancode; + OTRGlobals::Instance->context->GetWindow()->lastScancode = -1; + + switch (dwScancode - 1) { + case SDL_SCANCODE_F5: { + const unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); + const SaveStateReturn stateReturn = + OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::SAVE }); + + switch (stateReturn) { + case SaveStateReturn::SUCCESS: + SPDLOG_INFO("[SOH] Saved state to slot {}", slot); + break; + case SaveStateReturn::FAIL_WRONG_GAMESTATE: + SPDLOG_ERROR("[SOH] Can not save a state outside of \"GamePlay\""); + break; + [[unlikely]] default: + break; + } + break; + } + case SDL_SCANCODE_F6: { + unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); + slot++; + if (slot > 5) { + slot = 0; + } + OTRGlobals::Instance->gSaveStateMgr->SetCurrentSlot(slot); + SPDLOG_INFO("Set SaveState slot to {}.", slot); + break; + } + case SDL_SCANCODE_F7: { + const unsigned int slot = OTRGlobals::Instance->gSaveStateMgr->GetCurrentSlot(); + const SaveStateReturn stateReturn = + OTRGlobals::Instance->gSaveStateMgr->AddRequest({ slot, RequestType::LOAD }); + + switch (stateReturn) { + case SaveStateReturn::SUCCESS: + SPDLOG_INFO("[SOH] Loaded state from slot {}", slot); + break; + case SaveStateReturn::FAIL_INVALID_SLOT: + SPDLOG_ERROR("[SOH] Invalid State Slot Number {}", slot); + break; + case SaveStateReturn::FAIL_STATE_EMPTY: + SPDLOG_ERROR("[SOH] State Slot {} is empty", slot); + break; + case SaveStateReturn::FAIL_WRONG_GAMESTATE: + SPDLOG_ERROR("[SOH] Can not load a state outside of \"GamePlay\""); + break; + [[unlikely]] default: + break; + } + + break; + } + } + OTRGlobals::Instance->context->GetWindow()->StartFrame(); +} + // C->C++ Bridge extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { - OTRGlobals::Instance->context->GetWindow()->RunCommands(commands); + OTRGlobals::Instance->context->GetWindow()->SetFrameDivisor(CVar_GetS32("g60FPS", 0) == 0 ? R_UPDATE_RATE : 1); + + if (!audio.initialized) { + audio.initialized = true; + std::thread([]() { + for (;;) { + { + std::unique_lock Lock(audio.mutex); + while (!audio.processing) { + audio.cv_to_thread.wait(Lock); + } + } + std::unique_lock Lock(audio.mutex); + //AudioMgr_ThreadEntry(&gAudioMgr); + // 528 and 544 relate to 60 fps at 32 kHz 32000/60 = 533.333.. + // in an ideal world, one third of the calls should use num_samples=544 and two thirds num_samples=528 + #define SAMPLES_HIGH 560 + #define SAMPLES_LOW 528 + // PAL values + //#define SAMPLES_HIGH 656 + //#define SAMPLES_LOW 624 + #define AUDIO_FRAMES_PER_UPDATE (R_UPDATE_RATE > 0 ? R_UPDATE_RATE : 1 ) + #define NUM_AUDIO_CHANNELS 2 + int samples_left = AudioPlayer_Buffered(); + u32 num_audio_samples = samples_left < AudioPlayer_GetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW; + // printf("Audio samples: %d %u\n", samples_left, num_audio_samples); + + // 3 is the maximum authentic frame divisor. + s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3]; + for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) { + AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples); + } + //for (uint32_t i = 0; i < 2 * num_audio_samples; i++) { + // audio_buffer[i] = Rand_Next() & 0xFF; + //} + // printf("Audio samples before submitting: %d\n", audio_api->buffered()); + AudioPlayer_Play((u8*)audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE)); + + audio.processing = false; + audio.cv_from_thread.notify_one(); + } + }).detach(); + } + + { + std::unique_lock Lock(audio.mutex); + audio.processing = true; + } + audio.cv_to_thread.notify_one(); + + std::vector> mtx_replacements; + if (CVar_GetS32("g60FPS", 0) != 0) { + int to = R_UPDATE_RATE; + for (int i = 1; i < to; i++) { + mtx_replacements.push_back(FrameInterpolation_Interpolate(i / (float)to)); + } + } + + OTRGlobals::Instance->context->GetWindow()->RunCommands(commands, mtx_replacements); + + { + std::unique_lock Lock(audio.mutex); + while (audio.processing) { + audio.cv_from_thread.wait(Lock); + } + } // OTRTODO: FIGURE OUT END FRAME POINT /* if (OTRGlobals::Instance->context->GetWindow()->lastScancode != -1) @@ -78,8 +250,8 @@ extern "C" void Graph_ProcessGfxCommands(Gfx* commands) { float divisor_num = 0.0f; -extern "C" void OTRSetFrameDivisor(int divisor) { - OTRGlobals::Instance->context->GetWindow()->SetFrameDivisor(divisor); +extern "C" void OTRGetPixelDepthPrepare(float x, float y) { + OTRGlobals::Instance->context->GetWindow()->GetPixelDepthPrepare(x, y); } extern "C" uint16_t OTRGetPixelDepth(float x, float y) { @@ -96,6 +268,11 @@ extern "C" void OTRResetScancode() OTRGlobals::Instance->context->GetWindow()->lastScancode = -1; } +extern "C" uint32_t ResourceMgr_GetGameVersion() +{ + return OTRGlobals::Instance->context->GetResourceManager()->GetGameVersion(); +} + extern "C" void ResourceMgr_CacheDirectory(const char* resName) { OTRGlobals::Instance->context->GetResourceManager()->CacheDirectory(resName); } @@ -168,9 +345,9 @@ extern "C" char* ResourceMgr_LoadJPEG(char* data, int dataSize) return (char*)finalBuffer; } -extern "C" char* ResourceMgr_LoadTexByName(char* texPath); +extern "C" char* ResourceMgr_LoadTexByName(const char* texPath); -extern "C" char* ResourceMgr_LoadTexOrDListByName(char* filePath) { +extern "C" char* ResourceMgr_LoadTexOrDListByName(const char* filePath) { auto res = OTRGlobals::Instance->context->GetResourceManager()->LoadResource(filePath); if (res->resType == Ship::ResourceType::DisplayList) @@ -181,34 +358,41 @@ extern "C" char* ResourceMgr_LoadTexOrDListByName(char* filePath) { return ResourceMgr_LoadTexByName(filePath); } -extern "C" char* ResourceMgr_LoadPlayerAnimByName(char* animPath) { +extern "C" char* ResourceMgr_LoadPlayerAnimByName(const char* animPath) { auto anim = std::static_pointer_cast( OTRGlobals::Instance->context->GetResourceManager()->LoadResource(animPath)); return (char*)&anim->limbRotData[0]; } -extern "C" Gfx* ResourceMgr_LoadGfxByName(char* path) +extern "C" Gfx* ResourceMgr_LoadGfxByName(const char* path) { auto res = std::static_pointer_cast( OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); return (Gfx*)&res->instructions[0]; } -extern "C" char* ResourceMgr_LoadArrayByName(char* path) +extern "C" Gfx* ResourceMgr_PatchGfxByName(const char* path, int size) { + auto res = std::static_pointer_cast( + OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); + res->instructions.resize(res->instructions.size() + size); + return (Gfx*)&res->instructions[0]; +} + +extern "C" char* ResourceMgr_LoadArrayByName(const char* path) { auto res = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); return (char*)res->scalars.data(); } -extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(char* path) { +extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(const char* path) { auto res = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); if (res->cachedGameAsset != nullptr) return (char*)res->cachedGameAsset; - else + else { Vec3s* data = (Vec3s*)malloc(sizeof(Vec3s) * res->scalars.size()); @@ -224,7 +408,7 @@ extern "C" char* ResourceMgr_LoadArrayByNameAsVec3s(char* path) { } } -extern "C" CollisionHeader* ResourceMgr_LoadColByName(char* path) +extern "C" CollisionHeader* ResourceMgr_LoadColByName(const char* path) { auto colRes = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); @@ -318,7 +502,7 @@ extern "C" CollisionHeader* ResourceMgr_LoadColByName(char* path) return (CollisionHeader*)colHeader; } -extern "C" Vtx * ResourceMgr_LoadVtxByName(char* path) +extern "C" Vtx * ResourceMgr_LoadVtxByName(const char* path) { auto res = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); return (Vtx*)res->vertices.data(); @@ -328,7 +512,7 @@ extern "C" int ResourceMgr_OTRSigCheck(char* imgData) { uintptr_t i = (uintptr_t)(imgData); - if (i == 0xD9000000 || i == 0xE7000000 || (i & 0xF0000000) == 0xF0000000) + if (i == 0xD9000000 || i == 0xE7000000 || (i & 1) == 1) return 0; if ((i & 0xFF000000) != 0xAB000000 && (i & 0xFF000000) != 0xCD000000 && i != 0) { @@ -340,7 +524,7 @@ extern "C" int ResourceMgr_OTRSigCheck(char* imgData) return 0; } -extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(char* path) { +extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(const char* path) { auto res = std::static_pointer_cast( OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); @@ -409,7 +593,7 @@ extern "C" AnimationHeaderCommon* ResourceMgr_LoadAnimByName(char* path) { return anim; } -extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { +extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path) { auto res = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); if (res->cachedGameAsset != nullptr) @@ -455,14 +639,14 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { limbC->sibling = limb->siblingIndex; if (limb->dListPtr != "") { - auto dList = ResourceMgr_LoadGfxByName((char*)limb->dListPtr.c_str()); + auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str()); limbC->dLists[0] = dList; } else { limbC->dLists[0] = nullptr; } if (limb->dList2Ptr != "") { - auto dList = ResourceMgr_LoadGfxByName((char*)limb->dList2Ptr.c_str()); + auto dList = ResourceMgr_LoadGfxByName(limb->dList2Ptr.c_str()); limbC->dLists[1] = dList; } else { limbC->dLists[1] = nullptr; @@ -481,7 +665,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { limbC->dList = nullptr; if (!limb->dListPtr.empty()) { - const auto dList = ResourceMgr_LoadGfxByName(const_cast(limb->dListPtr.c_str())); + const auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str()); limbC->dList = dList; } @@ -497,12 +681,12 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { limbC->dList[1] = nullptr; if (!limb->dListPtr.empty()) { - const auto dList = ResourceMgr_LoadGfxByName(const_cast(limb->dListPtr.c_str())); + const auto dList = ResourceMgr_LoadGfxByName(limb->dListPtr.c_str()); limbC->dList[0] = dList; } if (!limb->dList2Ptr.empty()) { - const auto dList = ResourceMgr_LoadGfxByName(const_cast(limb->dList2Ptr.c_str())); + const auto dList = ResourceMgr_LoadGfxByName(limb->dList2Ptr.c_str()); limbC->dList[1] = dList; } @@ -528,7 +712,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { limbC->segmentType = 0; if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_DList) - limbC->segment = ResourceMgr_LoadGfxByName(const_cast(limb->skinDList.c_str())); + limbC->segment = ResourceMgr_LoadGfxByName(limb->skinDList.c_str()); else if (limb->skinSegmentType == Ship::ZLimbSkinType::SkinType_4) { const auto animData = new SkinAnimatedLimbData; const int skinDataSize = limb->skinData.size(); @@ -536,7 +720,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { animData->totalVtxCount = limb->skinVtxCnt; animData->limbModifCount = skinDataSize; animData->limbModifications = new SkinLimbModif[animData->limbModifCount]; - animData->dlist = ResourceMgr_LoadGfxByName(const_cast(limb->skinDList2.c_str())); + animData->dlist = ResourceMgr_LoadGfxByName(limb->skinDList2.c_str()); for (int i = 0; i < skinDataSize; i++) { @@ -596,7 +780,7 @@ extern "C" SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path) { return baseHeader; } -extern "C" s32* ResourceMgr_LoadCSByName(char* path) +extern "C" s32* ResourceMgr_LoadCSByName(const char* path) { auto res = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(path)); return (s32*)res->commands.data(); @@ -722,24 +906,24 @@ extern "C" int16_t OTRGetRectDimensionFromRightEdge(float v) { } extern "C" void bswapSoundFontSound(SoundFontSound* swappable) { - swappable->sample = (SoundFontSample*)_byteswap_ulong((u32)swappable->sample); - swappable->tuningAsU32 = _byteswap_ulong((u32)swappable->tuningAsU32); + swappable->sample = (SoundFontSample*)BOMSWAP32((u32)swappable->sample); + swappable->tuningAsU32 = BOMSWAP32((u32)swappable->tuningAsU32); } extern "C" void bswapDrum(Drum* swappable) { bswapSoundFontSound(&swappable->sound); - swappable->envelope = (AdsrEnvelope*)_byteswap_ulong((u32)swappable->envelope); + swappable->envelope = (AdsrEnvelope*)BOMSWAP32((u32)swappable->envelope); } extern "C" void bswapInstrument(Instrument* swappable) { - swappable->envelope = (AdsrEnvelope*)_byteswap_ulong((u32)swappable->envelope); + swappable->envelope = (AdsrEnvelope*)BOMSWAP32((u32)swappable->envelope); bswapSoundFontSound(&swappable->lowNotesSound); bswapSoundFontSound(&swappable->normalNotesSound); bswapSoundFontSound(&swappable->highNotesSound); } extern "C" void bswapSoundFontSample(SoundFontSample* swappable) { - u32 origBitfield = _byteswap_ulong(swappable->asU32); + u32 origBitfield = BOMSWAP32(swappable->asU32); swappable->codec = (origBitfield >> 28) & 0x0F; swappable->medium = (origBitfield >> 24) & 0x03; @@ -747,29 +931,29 @@ extern "C" void bswapSoundFontSample(SoundFontSample* swappable) { swappable->unk_bit25 = (origBitfield >> 21) & 0x01; swappable->size = (origBitfield) & 0x00FFFFFF; - swappable->sampleAddr = (u8*)_byteswap_ulong((u32)swappable->sampleAddr); - swappable->loop = (AdpcmLoop*)_byteswap_ulong((u32)swappable->loop); - swappable->book = (AdpcmBook*)_byteswap_ulong((u32)swappable->book); + swappable->sampleAddr = (u8*)BOMSWAP32((u32)swappable->sampleAddr); + swappable->loop = (AdpcmLoop*)BOMSWAP32((u32)swappable->loop); + swappable->book = (AdpcmBook*)BOMSWAP32((u32)swappable->book); } extern "C" void bswapAdpcmLoop(AdpcmLoop* swappable) { - swappable->start = (u32)_byteswap_ulong((u32)swappable->start); - swappable->end = (u32)_byteswap_ulong((u32)swappable->end); - swappable->count = (u32)_byteswap_ulong((u32)swappable->count); + swappable->start = (u32)BOMSWAP32((u32)swappable->start); + swappable->end = (u32)BOMSWAP32((u32)swappable->end); + swappable->count = (u32)BOMSWAP32((u32)swappable->count); if (swappable->count != 0) { for (int i = 0; i < 16; i++) { - swappable->state[i] = (s16)_byteswap_ushort(swappable->state[i]); + swappable->state[i] = (s16)BOMSWAP16(swappable->state[i]); } } } extern "C" void bswapAdpcmBook(AdpcmBook* swappable) { - swappable->order = (u32)_byteswap_ulong((u32)swappable->order); - swappable->npredictors = (u32)_byteswap_ulong((u32)swappable->npredictors); + swappable->order = (u32)BOMSWAP32((u32)swappable->order); + swappable->npredictors = (u32)BOMSWAP32((u32)swappable->npredictors); for (int i = 0; i < swappable->npredictors * swappable->order * sizeof(s16) * 4; i++) - swappable->book[i] = (s16)_byteswap_ushort(swappable->book[i]); + swappable->book[i] = (s16)BOMSWAP16(swappable->book[i]); } extern "C" bool AudioPlayer_Init(void) { @@ -797,3 +981,16 @@ extern "C" void AudioPlayer_Play(const uint8_t* buf, uint32_t len) { OTRGlobals::Instance->context->GetWindow()->GetAudioPlayer()->Play(buf, len); } } + +extern "C" int Controller_ShouldRumble(size_t i) { + for (const auto& controller : Ship::Window::Controllers.at(i)) + { + float rumble_strength = CVar_GetFloat(StringHelper::Sprintf("gCont%i_RumbleStrength", i).c_str(), 1.0f); + + if (controller->CanRumble() && rumble_strength > 0.001f) { + return 1; + } + } + + return 0; +} diff --git a/soh/soh/OTRGlobals.h b/soh/soh/OTRGlobals.h index f7e525834..0a318de73 100644 --- a/soh/soh/OTRGlobals.h +++ b/soh/soh/OTRGlobals.h @@ -1,17 +1,22 @@ +#ifndef OTR_GLOBALS_H +#define OTR_GLOBALS_H + #pragma once #include "GlobalCtx2.h" #ifdef __cplusplus +#include "Enhancements/savestates.h" class OTRGlobals { public: - static OTRGlobals* Instance; + static OTRGlobals* Instance; - std::shared_ptr context; + std::shared_ptr context; + std::shared_ptr gSaveStateMgr; - OTRGlobals(); - ~OTRGlobals(); + OTRGlobals(); + ~OTRGlobals(); private: @@ -21,26 +26,29 @@ private: #ifndef __cplusplus void InitOTR(); void Graph_ProcessFrame(void (*run_one_game_iter)(void)); +void Graph_StartFrame(); void Graph_ProcessGfxCommands(Gfx* commands); void OTRLogString(const char* src); void OTRGfxPrint(const char* str, void* printer, void (*printImpl)(void*, char)); -void OTRSetFrameDivisor(int divisor); +void OTRGetPixelDepthPrepare(float x, float y); uint16_t OTRGetPixelDepth(float x, float y); int32_t OTRGetLastScancode(); +uint32_t ResourceMgr_GetGameVersion(); void ResourceMgr_CacheDirectory(const char* resName); void ResourceMgr_LoadFile(const char* resName); char* ResourceMgr_LoadFileFromDisk(const char* filePath); -char* ResourceMgr_LoadTexByName(char* texPath); -char* ResourceMgr_LoadTexOrDListByName(char* filePath); -char* ResourceMgr_LoadPlayerAnimByName(char* animPath); +char* ResourceMgr_LoadTexByName(const char* texPath); +char* ResourceMgr_LoadTexOrDListByName(const char* filePath); +char* ResourceMgr_LoadPlayerAnimByName(const char* animPath); char* ResourceMgr_GetNameByCRC(uint64_t crc, char* alloc); Gfx* ResourceMgr_LoadGfxByCRC(uint64_t crc); -Gfx* ResourceMgr_LoadGfxByName(char* path); +Gfx* ResourceMgr_LoadGfxByName(const char* path); +Gfx* ResourceMgr_PatchGfxByName(const char* path, int size); Vtx* ResourceMgr_LoadVtxByCRC(uint64_t crc); -Vtx* ResourceMgr_LoadVtxByName(char* path); -CollisionHeader* ResourceMgr_LoadColByName(char* path); +Vtx* ResourceMgr_LoadVtxByName(const char* path); +CollisionHeader* ResourceMgr_LoadColByName(const char* path); uint64_t GetPerfCounter(); -struct SkeletonHeader* ResourceMgr_LoadSkeletonByName(char* path); +struct SkeletonHeader* ResourceMgr_LoadSkeletonByName(const char* path); int ResourceMgr_OTRSigCheck(char* imgData); uint64_t osGetTime(void); uint32_t osGetCount(void); @@ -63,4 +71,7 @@ int AudioPlayer_Buffered(void); int AudioPlayer_GetDesiredBuffered(void); void AudioPlayer_Play(const uint8_t* buf, uint32_t len); void AudioMgr_CreateNextAudioBuffer(s16* samples, u32 num_samples); +int Controller_ShouldRumble(size_t i); #endif + +#endif \ No newline at end of file diff --git a/soh/soh/frame_interpolation.cpp b/soh/soh/frame_interpolation.cpp new file mode 100644 index 000000000..bd85d41ce --- /dev/null +++ b/soh/soh/frame_interpolation.cpp @@ -0,0 +1,732 @@ +#include "Cvar.h" + +#include +#include +#include +#include + +#include "frame_interpolation.h" + +/* +Frame interpolation. + +The idea of this code is to interpolate all matrices. + +The code contains two approaches. The first is to interpolate +all inputs in transformations, such as angles, scale and distances, +and then perform the same transformations with the interpolated values. +After evaluation for some reason some animations such rolling look strange. + +The second approach is to simply interpolate the final matrices. This will +more or less simply interpolate the world coordinates for movements. +This will however make rotations ~180 degrees get the "paper effect". +The mitigation is to identify this case for actors and interpolate the +matrix but in model coordinates instead, by "removing" the rotation- +translation before interpolating, create a rotation matrix with the +interpolated angle which is then applied to the matrix. + +Currently the code contains both methods but only the second one is currently +used. + +Both approaches build a tree of instructions, containing matrices +at leaves. Every node is built from OPEN_DISPS/CLOSE_DISPS and manually +inserted FrameInterpolation_OpenChild/FrameInterpolation_Close child calls. +These nodes contain information that should suffice to identify the matrix, +so we can find it in an adjacent frame. + +We can interpolate an arbitrary amount of frames between two original frames, +given a specific interpolation factor (0=old frame, 0.5=average of frames, +1.0=new frame). +*/ + +extern "C" { + +void Matrix_Init(struct GameState* gameState); +void Matrix_Push(void); +void Matrix_Pop(void); +void Matrix_Get(MtxF* dest); +void Matrix_Put(MtxF* src); +void Matrix_Mult(MtxF* mf, u8 mode); +void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode); +void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode); +void Matrix_RotateX(f32 x, u8 mode); +void Matrix_RotateY(f32 y, u8 mode); +void Matrix_RotateZ(f32 z, u8 mode); +void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode); +void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation); +void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot); +Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest); +Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line); +Mtx* Matrix_NewMtx(struct GraphicsContext* gfxCtx, char* file, s32 line); +Mtx* Matrix_MtxFToNewMtx(MtxF* src, struct GraphicsContext* gfxCtx); +void Matrix_MultVec3f(Vec3f* src, Vec3f* dest); +void Matrix_MtxFCopy(MtxF* dest, MtxF* src); +void Matrix_MtxToMtxF(Mtx* src, MtxF* dest); +void Matrix_MultVec3fExt(Vec3f* src, Vec3f* dest, MtxF* mf); +void Matrix_Transpose(MtxF* mf); +void Matrix_ReplaceRotation(MtxF* mf); +void Matrix_MtxFToYXZRotS(MtxF* mf, Vec3s* rotDest, s32 flag); +void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag); +void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode); +MtxF* Matrix_CheckFloats(MtxF* mf, char* file, s32 line); +void Matrix_SetTranslateScaleMtx2(Mtx* mtx, f32 scaleX, f32 scaleY, f32 scaleZ, f32 translateX, f32 translateY, + f32 translateZ); + +MtxF* Matrix_GetCurrent(void); + +void SkinMatrix_MtxFMtxFMult(MtxF* mfA, MtxF* mfB, MtxF* dest); + +} + +static bool invert_matrix(const float m[16], float invOut[16]); + +using namespace std; + +namespace { + + enum class Op { + OpenChild, + CloseChild, + + MatrixPush, + MatrixPop, + MatrixPut, + MatrixMult, + MatrixTranslate, + MatrixScale, + MatrixRotate1Coord, + MatrixRotateZYX, + MatrixTranslateRotateZYX, + MatrixSetTranslateRotateYXZ, + MatrixMtxFToMtx, + MatrixToMtx, + MatrixReplaceRotation, + MatrixRotateAxis, + SkinMatrixMtxFToMtx + }; + + typedef pair label; + + union Data { + Data() { + } + + struct { + MtxF src; + } matrix_put; + + struct { + MtxF mf; + u8 mode; + } matrix_mult; + + struct { + f32 x, y, z; + u8 mode; + } matrix_translate, matrix_scale; + + struct { + u32 coord; + f32 value; + u8 mode; + } matrix_rotate_1_coord; + + struct { + s16 x, y, z; + u8 mode; + } matrix_rotate_zyx; + + struct { + Vec3f translation; + Vec3s rotation; + } matrix_translate_rotate_zyx; + + struct { + f32 translateX, translateY, translateZ; + Vec3s rot; + //MtxF mtx; + bool has_mtx; + } matrix_set_translate_rotate_yxz; + + struct { + MtxF src; + Mtx* dest; + } matrix_mtxf_to_mtx; + + struct { + Mtx* dest; + MtxF src; + bool has_adjusted; + } matrix_to_mtx; + + struct { + MtxF mf; + } matrix_replace_rotation; + + struct { + f32 angle; + Vec3f axis; + u8 mode; + } matrix_rotate_axis; + + struct { + label key; + size_t idx; + } open_child; + }; + + struct Path { + map> children; + map> ops; + vector> items; + }; + + struct Recording { + Path root_path; + }; + + bool is_recording; + vector current_path; + uint32_t camera_epoch; + uint32_t previous_camera_epoch; + Recording current_recording; + Recording previous_recording; + + bool next_is_actor_pos_rot_matrix; + bool has_inv_actor_mtx; + MtxF inv_actor_mtx; + size_t inv_actor_mtx_path_index; + + Data& append(Op op) { + auto& m = current_path.back()->ops[op]; + current_path.back()->items.emplace_back(op, m.size()); + return m.emplace_back(); + } + + struct InterpolateCtx { + float step; + float w; + unordered_map mtx_replacements; + MtxF tmp_mtxf, tmp_mtxf2; + Vec3f tmp_vec3f; + Vec3s tmp_vec3s; + MtxF actor_mtx; + + MtxF* new_replacement(Mtx* addr) { + return &mtx_replacements[addr]; + } + + void interpolate_mtxf(MtxF* res, MtxF* o, MtxF* n) { + for (size_t i = 0; i < 4; i++) { + for (size_t j = 0; j < 4; j++) { + res->mf[i][j] = w * o->mf[i][j] + step * n->mf[i][j]; + } + } + } + + float lerp(f32 o, f32 n) { + return w * o + step * n; + } + + void lerp_vec3f(Vec3f* res, Vec3f* o, Vec3f* n) { + res->x = lerp(o->x, n->x); + res->y = lerp(o->y, n->y); + res->z = lerp(o->z, n->z); + } + + float interpolate_angle(f32 o, f32 n) { + if (o == n) + return n; + o = fmodf(o, 2 * M_PI); + if (o < 0.0f) { + o += 2 * M_PI; + } + n = fmodf(n, 2 * M_PI); + if (n < 0.0f) { + n += 2 * M_PI; + } + if (fabsf(o - n) > M_PI) { + if (o < n) { + o += 2 * M_PI; + } else { + n += 2 * M_PI; + } + } + if (fabsf(o - n) > M_PI / 2) { + //return n; + } + return lerp(o, n); + } + + s16 interpolate_angle(s16 os, s16 ns) { + if (os == ns) + return 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); + } else { + if (o < n) { + o += 0x10000; + } else { + n += 0x10000; + } + diff = o - n; + if (diff < -0x4000 || diff > 0x4000) { + return ns; + } + res = (u16)(w * o + step * n); + } + if (os / 327 == ns / 327 && (s16)res / 327 != os / 327) { + int bp = 0; + } + return res; + } + + void interpolate_angles(Vec3s* res, Vec3s* o, Vec3s* n) { + res->x = interpolate_angle(o->x, n->x); + res->y = interpolate_angle(o->y, n->y); + res->z = interpolate_angle(o->z, n->z); + } + + void interpolate_branch(Path* old_path, Path *new_path) { + for (auto& item : new_path->items) { + Data& new_op = new_path->ops[item.first][item.second]; + + if (item.first == Op::OpenChild) { + if (auto it = old_path->children.find(new_op.open_child.key); + it != old_path->children.end() && new_op.open_child.idx < it->second.size()) { + interpolate_branch(&it->second[new_op.open_child.idx], + &new_path->children.find(new_op.open_child.key)->second[new_op.open_child.idx]); + } else { + interpolate_branch( + &new_path->children.find(new_op.open_child.key)->second[new_op.open_child.idx], + &new_path->children.find(new_op.open_child.key)->second[new_op.open_child.idx]); + } + continue; + } + + if (auto it = old_path->ops.find(item.first); it != old_path->ops.end()) { + if (item.second < it->second.size()) { + Data& old_op = it->second[item.second]; + switch (item.first) { + case Op::OpenChild: + break; + case Op::CloseChild: + break; + + case Op::MatrixPush: + Matrix_Push(); + break; + + case Op::MatrixPop: + Matrix_Pop(); + break; + + case Op::MatrixPut: + interpolate_mtxf(&tmp_mtxf, &old_op.matrix_put.src, &new_op.matrix_put.src); + Matrix_Put(&tmp_mtxf); + break; + + case Op::MatrixMult: + interpolate_mtxf(&tmp_mtxf, &old_op.matrix_mult.mf, &new_op.matrix_mult.mf); + Matrix_Mult(&tmp_mtxf, new_op.matrix_mult.mode); + break; + + case Op::MatrixTranslate: + Matrix_Translate(lerp(old_op.matrix_translate.x, new_op.matrix_translate.x), + lerp(old_op.matrix_translate.y, new_op.matrix_translate.y), + lerp(old_op.matrix_translate.z, new_op.matrix_translate.z), + new_op.matrix_translate.mode); + break; + + case Op::MatrixScale: + Matrix_Scale(lerp(old_op.matrix_scale.x, new_op.matrix_scale.x), + lerp(old_op.matrix_scale.y, new_op.matrix_scale.y), + lerp(old_op.matrix_scale.z, new_op.matrix_scale.z), + new_op.matrix_scale.mode); + break; + + case Op::MatrixRotate1Coord: { + float v = interpolate_angle(old_op.matrix_rotate_1_coord.value, new_op.matrix_rotate_1_coord.value); + u8 mode = new_op.matrix_rotate_1_coord.mode; + switch (new_op.matrix_rotate_1_coord.coord) { + case 0: + Matrix_RotateX(v, mode); + break; + + case 1: + Matrix_RotateY(v, mode); + break; + + case 2: + Matrix_RotateZ(v, mode); + break; + } + break; + } + + case Op::MatrixRotateZYX: + Matrix_RotateZYX(interpolate_angle(old_op.matrix_rotate_zyx.x, new_op.matrix_rotate_zyx.x), + interpolate_angle(old_op.matrix_rotate_zyx.y, new_op.matrix_rotate_zyx.y), + interpolate_angle(old_op.matrix_rotate_zyx.z, new_op.matrix_rotate_zyx.z), + new_op.matrix_rotate_zyx.mode); + break; + + case Op::MatrixTranslateRotateZYX: + lerp_vec3f(&tmp_vec3f, &old_op.matrix_translate_rotate_zyx.translation, &new_op.matrix_translate_rotate_zyx.translation); + interpolate_angles(&tmp_vec3s, &old_op.matrix_translate_rotate_zyx.rotation, &new_op.matrix_translate_rotate_zyx.rotation); + Matrix_TranslateRotateZYX(&tmp_vec3f, &tmp_vec3s); + break; + + case Op::MatrixSetTranslateRotateYXZ: + interpolate_angles(&tmp_vec3s, &old_op.matrix_set_translate_rotate_yxz.rot, + &new_op.matrix_set_translate_rotate_yxz.rot); + Matrix_SetTranslateRotateYXZ(lerp(old_op.matrix_set_translate_rotate_yxz.translateX, + new_op.matrix_set_translate_rotate_yxz.translateX), + lerp(old_op.matrix_set_translate_rotate_yxz.translateY, + new_op.matrix_set_translate_rotate_yxz.translateY), + lerp(old_op.matrix_set_translate_rotate_yxz.translateZ, + new_op.matrix_set_translate_rotate_yxz.translateZ), + &tmp_vec3s); + if (new_op.matrix_set_translate_rotate_yxz.has_mtx && old_op.matrix_set_translate_rotate_yxz.has_mtx) { + actor_mtx = *Matrix_GetCurrent(); + } + break; + + case Op::MatrixMtxFToMtx: + interpolate_mtxf(new_replacement(new_op.matrix_mtxf_to_mtx.dest), + &old_op.matrix_mtxf_to_mtx.src, &new_op.matrix_mtxf_to_mtx.src); + break; + + case Op::MatrixToMtx: { + //*new_replacement(new_op.matrix_to_mtx.dest) = *Matrix_GetCurrent(); + if (old_op.matrix_to_mtx.has_adjusted && new_op.matrix_to_mtx.has_adjusted) { + interpolate_mtxf(&tmp_mtxf, &old_op.matrix_to_mtx.src, &new_op.matrix_to_mtx.src); + SkinMatrix_MtxFMtxFMult(&actor_mtx, &tmp_mtxf, new_replacement(new_op.matrix_to_mtx.dest)); + } else { + interpolate_mtxf(new_replacement(new_op.matrix_to_mtx.dest), + &old_op.matrix_to_mtx.src, &new_op.matrix_to_mtx.src); + } + break; + } + + case Op::MatrixReplaceRotation: + interpolate_mtxf(&tmp_mtxf, &old_op.matrix_replace_rotation.mf, &new_op.matrix_replace_rotation.mf); + Matrix_ReplaceRotation(&tmp_mtxf); + break; + + case Op::MatrixRotateAxis: + lerp_vec3f(&tmp_vec3f, &old_op.matrix_rotate_axis.axis, &new_op.matrix_rotate_axis.axis); + Matrix_RotateAxis(interpolate_angle(old_op.matrix_rotate_axis.angle, new_op.matrix_rotate_axis.angle), + &tmp_vec3f, new_op.matrix_rotate_axis.mode); + break; + + case Op::SkinMatrixMtxFToMtx: + break; + } + } + } + } + } + }; + +} // anonymous namespace + +unordered_map FrameInterpolation_Interpolate(float step) { + InterpolateCtx ctx; + ctx.step = step; + ctx.w = 1.0f - step; + ctx.interpolate_branch(&previous_recording.root_path, ¤t_recording.root_path); + return ctx.mtx_replacements; +} + +void FrameInterpolation_StartRecord(void) { + previous_recording = move(current_recording); + current_recording = {}; + current_path.clear(); + current_path.push_back(¤t_recording.root_path); + if (CVar_GetS32("g60FPS", 0) != 0) { + is_recording = true; + } +} + +void FrameInterpolation_StopRecord(void) { + previous_camera_epoch = camera_epoch; + is_recording = false; +} + +void FrameInterpolation_RecordOpenChild(const void* a, int b) { + if (!is_recording) + return; + label key = { a, b }; + auto& m = current_path.back()->children[key]; + append(Op::OpenChild).open_child = { key, m.size() }; + current_path.push_back(&m.emplace_back()); +} + +void FrameInterpolation_RecordCloseChild(void) { + if (!is_recording) + return; + //append(Op::CloseChild); + if (has_inv_actor_mtx && current_path.size() == inv_actor_mtx_path_index) { + has_inv_actor_mtx = false; + } + current_path.pop_back(); +} + +void FrameInterpolation_DontInterpolateCamera(void) { + camera_epoch = previous_camera_epoch + 1; +} + +int FrameInterpolation_GetCameraEpoch(void) { + return (int)camera_epoch; +} + +void FrameInterpolation_RecordActorPosRotMatrix(void) { + if (!is_recording) + return; + next_is_actor_pos_rot_matrix = true; +} + +void FrameInterpolation_RecordMatrixPush(void) { + if (!is_recording) + return; + append(Op::MatrixPush); +} + +void FrameInterpolation_RecordMatrixPop(void) { + if (!is_recording) + return; + append(Op::MatrixPop); +} + +void FrameInterpolation_RecordMatrixPut(MtxF* src) { + if (!is_recording) + return; + append(Op::MatrixPut).matrix_put = { *src }; +} + +void FrameInterpolation_RecordMatrixMult(MtxF* mf, u8 mode) { + if (!is_recording) + return; + append(Op::MatrixMult).matrix_mult = { *mf, mode }; +} + +void FrameInterpolation_RecordMatrixTranslate(f32 x, f32 y, f32 z, u8 mode) { + if (!is_recording) + return; + append(Op::MatrixTranslate).matrix_translate = { x, y, z, mode }; +} + +void FrameInterpolation_RecordMatrixScale(f32 x, f32 y, f32 z, u8 mode) { + if (!is_recording) + return; + append(Op::MatrixScale).matrix_scale = { x, y, z, mode }; +} + +void FrameInterpolation_RecordMatrixRotate1Coord(u32 coord, f32 value, u8 mode) { + if (!is_recording) + return; + append(Op::MatrixRotate1Coord).matrix_rotate_1_coord = { coord, value, mode }; +} + +void FrameInterpolation_RecordMatrixRotateZYX(s16 x, s16 y, s16 z, u8 mode) { + if (!is_recording) + return; + append(Op::MatrixRotateZYX).matrix_rotate_zyx = { x, y, z, mode }; +} + +void FrameInterpolation_RecordMatrixTranslateRotateZYX(Vec3f* translation, Vec3s* rotation) { + if (!is_recording) + return; + append(Op::MatrixTranslateRotateZYX).matrix_translate_rotate_zyx = { *translation, *rotation }; +} + +void FrameInterpolation_RecordMatrixSetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot) { + if (!is_recording) + return; + auto& d = append(Op::MatrixSetTranslateRotateYXZ).matrix_set_translate_rotate_yxz = { translateX, translateY, translateZ, + *rot }; + if (next_is_actor_pos_rot_matrix) { + d.has_mtx = true; + //d.mtx = *Matrix_GetCurrent(); + invert_matrix((const float *)Matrix_GetCurrent()->mf, (float *)inv_actor_mtx.mf); + next_is_actor_pos_rot_matrix = false; + has_inv_actor_mtx = true; + inv_actor_mtx_path_index = current_path.size(); + } +} + +void FrameInterpolation_RecordMatrixMtxFToMtx(MtxF* src, Mtx* dest) { + if (!is_recording) + return; + append(Op::MatrixMtxFToMtx).matrix_mtxf_to_mtx = { *src, dest }; +} + +void FrameInterpolation_RecordMatrixToMtx(Mtx* dest, char* file, s32 line) { + if (!is_recording) + return; + auto& d = append(Op::MatrixToMtx).matrix_to_mtx = { dest }; + if (has_inv_actor_mtx) { + d.has_adjusted = true; + SkinMatrix_MtxFMtxFMult(&inv_actor_mtx, Matrix_GetCurrent(), &d.src); + } else { + d.src = *Matrix_GetCurrent(); + } +} + +void FrameInterpolation_RecordMatrixReplaceRotation(MtxF* mf) { + if (!is_recording) + return; + append(Op::MatrixReplaceRotation).matrix_replace_rotation = { *mf }; +} + +void FrameInterpolation_RecordMatrixRotateAxis(f32 angle, Vec3f* axis, u8 mode) { + if (!is_recording) + return; + append(Op::MatrixRotateAxis).matrix_rotate_axis = { angle, *axis, mode }; +} + +void FrameInterpolation_RecordSkinMatrixMtxFToMtx(MtxF* src, Mtx* dest) { + if (!is_recording) + return; + FrameInterpolation_RecordMatrixMtxFToMtx(src, dest); +} + +// https://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix +static bool invert_matrix(const float m[16], float invOut[16]) { + float inv[16], det; + int i; + + inv[0] = m[5] * m[10] * m[15] - + m[5] * m[11] * m[14] - + m[9] * m[6] * m[15] + + m[9] * m[7] * m[14] + + m[13] * m[6] * m[11] - + m[13] * m[7] * m[10]; + + inv[4] = -m[4] * m[10] * m[15] + + m[4] * m[11] * m[14] + + m[8] * m[6] * m[15] - + m[8] * m[7] * m[14] - + m[12] * m[6] * m[11] + + m[12] * m[7] * m[10]; + + inv[8] = m[4] * m[9] * m[15] - + m[4] * m[11] * m[13] - + m[8] * m[5] * m[15] + + m[8] * m[7] * m[13] + + m[12] * m[5] * m[11] - + m[12] * m[7] * m[9]; + + inv[12] = -m[4] * m[9] * m[14] + + m[4] * m[10] * m[13] + + m[8] * m[5] * m[14] - + m[8] * m[6] * m[13] - + m[12] * m[5] * m[10] + + m[12] * m[6] * m[9]; + + inv[1] = -m[1] * m[10] * m[15] + + m[1] * m[11] * m[14] + + m[9] * m[2] * m[15] - + m[9] * m[3] * m[14] - + m[13] * m[2] * m[11] + + m[13] * m[3] * m[10]; + + inv[5] = m[0] * m[10] * m[15] - + m[0] * m[11] * m[14] - + m[8] * m[2] * m[15] + + m[8] * m[3] * m[14] + + m[12] * m[2] * m[11] - + m[12] * m[3] * m[10]; + + inv[9] = -m[0] * m[9] * m[15] + + m[0] * m[11] * m[13] + + m[8] * m[1] * m[15] - + m[8] * m[3] * m[13] - + m[12] * m[1] * m[11] + + m[12] * m[3] * m[9]; + + inv[13] = m[0] * m[9] * m[14] - + m[0] * m[10] * m[13] - + m[8] * m[1] * m[14] + + m[8] * m[2] * m[13] + + m[12] * m[1] * m[10] - + m[12] * m[2] * m[9]; + + inv[2] = m[1] * m[6] * m[15] - + m[1] * m[7] * m[14] - + m[5] * m[2] * m[15] + + m[5] * m[3] * m[14] + + m[13] * m[2] * m[7] - + m[13] * m[3] * m[6]; + + inv[6] = -m[0] * m[6] * m[15] + + m[0] * m[7] * m[14] + + m[4] * m[2] * m[15] - + m[4] * m[3] * m[14] - + m[12] * m[2] * m[7] + + m[12] * m[3] * m[6]; + + inv[10] = m[0] * m[5] * m[15] - + m[0] * m[7] * m[13] - + m[4] * m[1] * m[15] + + m[4] * m[3] * m[13] + + m[12] * m[1] * m[7] - + m[12] * m[3] * m[5]; + + inv[14] = -m[0] * m[5] * m[14] + + m[0] * m[6] * m[13] + + m[4] * m[1] * m[14] - + m[4] * m[2] * m[13] - + m[12] * m[1] * m[6] + + m[12] * m[2] * m[5]; + + inv[3] = -m[1] * m[6] * m[11] + + m[1] * m[7] * m[10] + + m[5] * m[2] * m[11] - + m[5] * m[3] * m[10] - + m[9] * m[2] * m[7] + + m[9] * m[3] * m[6]; + + inv[7] = m[0] * m[6] * m[11] - + m[0] * m[7] * m[10] - + m[4] * m[2] * m[11] + + m[4] * m[3] * m[10] + + m[8] * m[2] * m[7] - + m[8] * m[3] * m[6]; + + inv[11] = -m[0] * m[5] * m[11] + + m[0] * m[7] * m[9] + + m[4] * m[1] * m[11] - + m[4] * m[3] * m[9] - + m[8] * m[1] * m[7] + + m[8] * m[3] * m[5]; + + inv[15] = m[0] * m[5] * m[10] - + m[0] * m[6] * m[9] - + m[4] * m[1] * m[10] + + m[4] * m[2] * m[9] + + m[8] * m[1] * m[6] - + m[8] * m[2] * m[5]; + + det = m[0] * inv[0] + m[1] * inv[4] + m[2] * inv[8] + m[3] * inv[12]; + + if (det == 0) { + return false; + } + + det = 1.0 / det; + + for (i = 0; i < 16; i++) { + invOut[i] = inv[i] * det; + } + + return true; +} diff --git a/soh/soh/frame_interpolation.h b/soh/soh/frame_interpolation.h new file mode 100644 index 000000000..64c7197cd --- /dev/null +++ b/soh/soh/frame_interpolation.h @@ -0,0 +1,61 @@ +#pragma once + +#include "include/z64math.h" + +#ifdef __cplusplus + +#include + +std::unordered_map FrameInterpolation_Interpolate(float step); + +extern "C" { + +#endif + +void FrameInterpolation_StartRecord(void); + +void FrameInterpolation_StopRecord(void); + +void FrameInterpolation_RecordOpenChild(const void* a, int b); + +void FrameInterpolation_RecordCloseChild(void); + +void FrameInterpolation_DontInterpolateCamera(void); + +int FrameInterpolation_GetCameraEpoch(void); + +void FrameInterpolation_RecordActorPosRotMatrix(void); + +void FrameInterpolation_RecordMatrixPush(void); + +void FrameInterpolation_RecordMatrixPop(void); + +void FrameInterpolation_RecordMatrixPut(MtxF* src); + +void FrameInterpolation_RecordMatrixMult(MtxF* mf, u8 mode); + +void FrameInterpolation_RecordMatrixTranslate(f32 x, f32 y, f32 z, u8 mode); + +void FrameInterpolation_RecordMatrixScale(f32 x, f32 y, f32 z, u8 mode); + +void FrameInterpolation_RecordMatrixRotate1Coord(u32 coord, f32 value, u8 mode); + +void FrameInterpolation_RecordMatrixRotateZYX(s16 x, s16 y, s16 z, u8 mode); + +void FrameInterpolation_RecordMatrixTranslateRotateZYX(Vec3f* translation, Vec3s* rotation); + +void FrameInterpolation_RecordMatrixSetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ, Vec3s* rot); + +void FrameInterpolation_RecordMatrixMtxFToMtx(MtxF* src, Mtx* dest); + +void FrameInterpolation_RecordMatrixToMtx(Mtx* dest, char* file, s32 line); + +void FrameInterpolation_RecordMatrixReplaceRotation(MtxF* mf); + +void FrameInterpolation_RecordMatrixRotateAxis(f32 angle, Vec3f* axis, u8 mode); + +void FrameInterpolation_RecordSkinMatrixMtxFToMtx(MtxF* src, Mtx* dest); + +#ifdef __cplusplus +} +#endif diff --git a/soh/soh/stubs.c b/soh/soh/stubs.c index 871d5ca22..98f3b4823 100644 --- a/soh/soh/stubs.c +++ b/soh/soh/stubs.c @@ -12,12 +12,12 @@ OSViMode osViModeNtscLan1; OSViMode osViModeMpalLan1; OSViMode osViModeFpalLan1; OSViMode osViModePalLan1; -AudioContext gAudioContext; -unk_D_8016E750 D_8016E750[4]; +// AudioContext gAudioContext; +// unk_D_8016E750 D_8016E750[4]; u8 gLetterTLUT[4][32]; u8 gFontFF[999]; DmaEntry gDmaDataTable[0x60C]; -u8 D_80133418; +// u8 D_80133418; u16 gAudioSEFlagSwapSource[64]; u16 gAudioSEFlagSwapTarget[64]; u8 gAudioSEFlagSwapMode[64]; @@ -102,7 +102,7 @@ void osCreateViManager(OSPri pri) s32 osMotorInit(OSMesgQueue* ctrlrqueue, OSPfs* pfs, s32 channel) { - + return 0; } u32 osAiGetLength(void) @@ -2099,4 +2099,4 @@ u8 gSequenceFontTable[0x1C0] = { 0x01, 0x12, 0x01, 0x24, 0x01, 0x18, 0x01, 0x19, 0x01, 0x13, 0x01, 0x20, 0x01, 0x1B, 0x01, 0x1C, 0x01, 0x1D, 0x01, 0x03, 0x01, 0x1F, 0x01, 0x20, 0x01, 0x20, 0x01, 0x09, 0x01, 0x21, 0x01, 0x22, 0x01, 0x21, 0x01, 0x09, 0x01, 0x20, 0x01, 0x03, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -}; \ No newline at end of file +}; diff --git a/soh/soh/util.cpp b/soh/soh/util.cpp new file mode 100644 index 000000000..7a5d0205d --- /dev/null +++ b/soh/soh/util.cpp @@ -0,0 +1,314 @@ +#include "util.h" + +#include + +std::vector sceneNames = { + "Inside the Deku Tree", + "Dodongo's Cavern", + "Inside Jabu-Jabu's Belly", + "Forest Temple", + "Fire Temple", + "Water Temple", + "Spirit Temple", + "Shadow Temple", + "Bottom of the Well", + "Ice Cavern", + "Ganon's Tower", + "Gerudo Training Ground", + "Thieves' Hideout", + "Inside Ganon's Castle", + "Ganon's Tower (Collapsing)", + "Inside Ganon's Castle (Collapsing)", + "Treasure Box Shop", + "Gohma's Lair", + "King Dodongo's Lair", + "Barinade's Lair", + "Phantom Ganon's Lair", + "Volvagia's Lair", + "Morpha's Lair", + "Twinrova's Lair & Nabooru's Mini-Boss Room", + "Bongo Bongo's Lair", + "Ganondorf's Lair", + "Tower Collapse Exterior", + "Market Entrance (Child - Day)", + "Market Entrance (Child - Night)", + "Market Entrance (Ruins)", + "Back Alley (Child - Day)", + "Back Alley (Child - Night)", + "Market (Child - Day)", + "Market (Child - Night)", + "Market (Ruins)", + "Temple of Time Exterior (Child - Day)", + "Temple of Time Exterior (Child - Night)", + "Temple of Time Exterior (Ruins)", + "Know-It-All Brothers' House", + "House of Twins", + "Mido's House", + "Saria's House", + "Carpenter Boss's House", + "Back Alley House (Man in Green)", + "Bazaar", + "Kokiri Shop", + "Goron Shop", + "Zora Shop", + "Kakariko Potion Shop", + "Market Potion Shop", + "Bombchu Shop", + "Happy Mask Shop", + "Link's House", + "Back Alley House (Dog Lady)", + "Stable", + "Impa's House", + "Lakeside Laboratory", + "Carpenters' Tent", + "Gravekeeper's Hut", + "Great Fairy's Fountain (Upgrades)", + "Fairy's Fountain", + "Great Fairy's Fountain (Spells)", + "Grottos", + "Grave (Redead)", + "Grave (Fairy's Fountain)", + "Royal Family's Tomb", + "Shooting Gallery", + "Temple of Time", + "Chamber of the Sages", + "Castle Hedge Maze (Day)", + "Castle Hedge Maze (Night)", + "Cutscene Map", + "Dampé's Grave & Windmill", + "Fishing Pond", + "Castle Courtyard", + "Bombchu Bowling Alley", + "Ranch House & Silo", + "Guard House", + "Granny's Potion Shop", + "Ganon's Tower Collapse & Battle Arena", + "House of Skulltula", + "Spot 00 - Hyrule Field", + "Spot 01 - Kakariko Village", + "Spot 02 - Graveyard", + "Spot 03 - Zora's River", + "Spot 04 - Kokiri Forest", + "Spot 05 - Sacred Forest Meadow", + "Spot 06 - Lake Hylia", + "Spot 07 - Zora's Domain", + "Spot 08 - Zora's Fountain", + "Spot 09 - Gerudo Valley", + "Spot 10 - Lost Woods", + "Spot 11 - Desert Colossus", + "Spot 12 - Gerudo's Fortress", + "Spot 13 - Haunted Wasteland", + "Spot 15 - Hyrule Castle", + "Spot 16 - Death Mountain Trail", + "Spot 17 - Death Mountain Crater", + "Spot 18 - Goron City", + "Spot 20 - Lon Lon Ranch", + "Ganon's Castle Exterior", + "Jungle Gym", + "Ganondorf Test Room", + "Depth Test", + "Stalfos Mini-Boss Room", + "Stalfos Boss Room", + "Sutaru", + "Castle Hedge Maze (Early)", + "Sasa Test", + "Treasure Chest Room", +}; + +std::vector itemNames = { + "Deku Stick", + "Deku Nut", + "Bomb", + "Fairy Bow", + "Fire Arrow", + "Din's Fire", + "Fairy Slingshot", + "Fairy Ocarina", + "Ocarina of Time", + "Bombchu", + "Hookshot", + "Longshot", + "Ice Arrow", + "Farore's Wind", + "Boomerang", + "Lens of Truth", + "Magic Bean", + "Megaton Hammer", + "Light Arrow", + "Nayru's Love", + "Empty Bottle", + "Red Potion", + "Green Potion", + "Blue Potion", + "Bottled Fairy", + "Fish", + "Lon Lon Milk & Bottle", + "Ruto's Letter", + "Blue Fire", + "Bug", + "Big Poe", + "Lon Lon Milk (Half)", + "Poe", + "Weird Egg", + "Chicken", + "Zelda's Letter", + "Keaton Mask", + "Skull Mask", + "Spooky Mask", + "Bunny Hood", + "Goron Mask", + "Zora Mask", + "Gerudo Mask", + "Mask of Truth", + "SOLD OUT", + "Pocket Egg", + "Pocket Cucco", + "Cojiro", + "Odd Mushroom", + "Odd Potion", + "Poacher's Saw", + "Goron's Sword (Broken)", + "Prescription", + "Eyeball Frog", + "Eye Drops", + "Claim Check", + "Fairy Bow & Fire Arrow", + "Fairy Bow & Ice Arrow", + "Fairy Bow & Light Arrow", + "Kokiri Sword", + "Master Sword", + "Giant's Knife & Biggoron's Sword", + "Deku Shield", + "Hylian Shield", + "Mirror Shield", + "Kokiri Tunic", + "Goron Tunic", + "Zora Tunic", + "Kokiri Boots", + "Iron Boots", + "Hover Boots", + "Bullet Bag (30)", + "Bullet Bag (40)", + "Bullet Bag (50)", + "Quiver (30)", + "Big Quiver (40)", + "Biggest Quiver (50)", + "Bomb Bag (20)", + "Big Bomb Bag (30)", + "Biggest Bomb Bag (40)", + "Goron's Bracelet", + "Silver Gauntlets", + "Golden Gauntlets", + "Silver Scale", + "Golden Scale", + "Giant's Knife (Broken)", + "Adult's Wallet", + "Giant's Wallet", + "Deku Seeds (5)", + "Fishing Pole", + "Minuet of Forest", + "Bolero of Fire", + "Serenade of Water", + "Requiem of Spirit", + "Nocturne of Shadow", + "Prelude of Light", + "Zelda's Lullaby", + "Epona's Song", + "Saria's Song", + "Sun's Song", + "Song of Time", + "Song of Storms", + "Forest Medallion", + "Fire Medallion", + "Water Medallion", + "Spirit Medallion", + "Shadow Medallion", + "Light Medallion", + "Kokiri's Emerald", + "Goron's Ruby", + "Zora's Sapphire", + "Stone of Agony", + "Gerudo's Card", + "Gold Skulltula Token", + "Heart Container", + "Piece of Heart [?]", + "Big Key", + "Compass", + "Dungeon Map", + "Small Key", + "Small Magic Jar", + "Large Magic Jar", + "Piece of Heart", + "[Removed]", + "[Removed]", + "[Removed]", + "[Removed]", + "[Removed]", + "[Removed]", + "[Removed]", + "Lon Lon Milk", + "Recovery Heart", + "Green Rupee", + "Blue Rupee", + "Red Rupee", + "Purple Rupee", + "Huge Rupee", + "[Removed]", + "Deku Sticks (5)", + "Deku Sticks (10)", + "Deku Nuts (5)", + "Deku Nuts (10)", + "Bombs (5)", + "Bombs (10)", + "Bombs (20)", + "Bombs (30)", + "Arrows (Small)", + "Arrows (Medium)", + "Arrows (Large)", + "Deku Seeds (30)", + "Bombchu (5)", + "Bombchu (20)", + "Deku Stick Upgrade (20)", + "Deku Stick Upgrade (30)", + "Deku Nut Upgrade (30)", + "Deku Nut Upgrade (40)", +}; + +std::vector questItemNames = { + "Forest Medallion", + "Fire Medallion", + "Water Medallion", + "Spirit Medallion", + "Shadow Medallion", + "Light Medallion", + "Minuet of Forest", + "Bolero of Fire", + "Serenade of Water", + "Requiem of Spirit", + "Nocturne of Shadow", + "Prelude of Light", + "Zelda's Lullaby", + "Epona's Song", + "Saria's Song", + "Sun's Song", + "Song of Time", + "Song of Storms", + "Kokiri's Emerald", + "Goron's Ruby", + "Zora's Sapphire", + "Stone of Agony", + "Gerudo's Card", + "Gold Skulltula Token", +}; + +const std::string& SohUtils::GetSceneName(int32_t scene) { + return sceneNames[scene]; +} + +const std::string& SohUtils::GetItemName(int32_t item) { + return itemNames[item]; +} + +const std::string& SohUtils::GetQuestItemName(int32_t item) { + return questItemNames[item]; +} diff --git a/soh/soh/util.h b/soh/soh/util.h new file mode 100644 index 000000000..9fd806f18 --- /dev/null +++ b/soh/soh/util.h @@ -0,0 +1,11 @@ +#pragma once +#include +#include + +namespace SohUtils { + const std::string& GetSceneName(int32_t scene); + + const std::string& GetItemName(int32_t item); + + const std::string& GetQuestItemName(int32_t item); +} // namespace SohUtils diff --git a/soh/soh/z_message_OTR.cpp b/soh/soh/z_message_OTR.cpp index 354997e16..ac1f013c2 100644 --- a/soh/soh/z_message_OTR.cpp +++ b/soh/soh/z_message_OTR.cpp @@ -8,27 +8,37 @@ #include extern "C" MessageTableEntry* sNesMessageEntryTablePtr; +extern "C" MessageTableEntry* sGerMessageEntryTablePtr; +extern "C" MessageTableEntry* sFraMessageEntryTablePtr; extern "C" MessageTableEntry* sStaffMessageEntryTablePtr; -//extern "C" MessageTableEntry* _message_0xFFFC_nes; +//extern "C" MessageTableEntry* _message_0xFFFC_nes; + +MessageTableEntry* OTRMessage_LoadTable(const char* filePath, bool isNES) { + auto file = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource(filePath)); + + if (file == nullptr) + return nullptr; + + MessageTableEntry* table = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * file->messages.size()); + + for (int i = 0; i < file->messages.size(); i++) { + table[i].textId = file->messages[i].id; + table[i].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos; + table[i].segment = file->messages[i].msg.c_str(); + table[i].msgSize = file->messages[i].msg.size(); + + if (isNES && file->messages[i].id == 0xFFFC) + _message_0xFFFC_nes = (char*)file->messages[i].msg.c_str(); + } + + return table; +} extern "C" void OTRMessage_Init() { - auto file = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/nes_message_data_static/nes_message_data_static")); - - sNesMessageEntryTablePtr = (MessageTableEntry*)malloc(sizeof(MessageTableEntry) * file->messages.size()); - - for (int i = 0; i < file->messages.size(); i++) - { - sNesMessageEntryTablePtr[i].textId = file->messages[i].id; - sNesMessageEntryTablePtr[i].typePos = (file->messages[i].textboxType << 4) | file->messages[i].textboxYPos; - sNesMessageEntryTablePtr[i].segment = file->messages[i].msg.c_str(); - sNesMessageEntryTablePtr[i].msgSize = file->messages[i].msg.size(); - - if (file->messages[i].id == 0xFFFC) - { - _message_0xFFFC_nes = (char*)file->messages[i].msg.c_str(); - } - } + sNesMessageEntryTablePtr = OTRMessage_LoadTable("text/nes_message_data_static/nes_message_data_static", true); + sGerMessageEntryTablePtr = OTRMessage_LoadTable("text/ger_message_data_static/ger_message_data_static", false); + sFraMessageEntryTablePtr = OTRMessage_LoadTable("text/fra_message_data_static/fra_message_data_static", false); auto file2 = std::static_pointer_cast(OTRGlobals::Instance->context->GetResourceManager()->LoadResource("text/staff_message_data_static/staff_message_data_static")); diff --git a/soh/soh/z_play_otr.cpp b/soh/soh/z_play_otr.cpp index 6d6c4bb30..3e2a990d7 100644 --- a/soh/soh/z_play_otr.cpp +++ b/soh/soh/z_play_otr.cpp @@ -12,7 +12,7 @@ void OTRGameplay_InitScene(GlobalContext* globalCtx, s32 spawn); s32 OTRScene_ExecuteCommands(GlobalContext* globalCtx, Ship::Scene* sceneCmd); //Ship::OTRResource* OTRGameplay_LoadFile(GlobalContext* globalCtx, RomFile* file) { -Ship::Resource* OTRGameplay_LoadFile(GlobalContext* globalCtx, const char* fileName) +Ship::Resource* OTRGameplay_LoadFile(GlobalContext* globalCtx, const char* fileName) { auto res = OTRGlobals::Instance->context->GetResourceManager()->LoadResource(fileName); return res.get(); @@ -28,16 +28,26 @@ extern "C" void OTRGameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s //osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f); - std::string scenePath = StringHelper::Sprintf("scenes\\%s\\%s", scene->sceneFile.fileName, scene->sceneFile.fileName); + std::string scenePath = StringHelper::Sprintf("scenes/%s/%s", scene->sceneFile.fileName, scene->sceneFile.fileName); globalCtx->sceneSegment = (Ship::Scene*)OTRGameplay_LoadFile(globalCtx, scenePath.c_str()); + + // Failed to load scene... default to doodongs cavern + if (globalCtx->sceneSegment == nullptr) + { + lusprintf(__FILE__, __LINE__, 2, "Unable to load scene %s... Defaulting to Doodong's Cavern!\n", + scenePath.c_str()); + OTRGameplay_SpawnScene(globalCtx, 0x01, 0); + return; + } + scene->unk_13 = 0; //ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); //gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); OTRGameplay_InitScene(globalCtx, spawn); - + osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(globalCtx, &globalCtx->roomCtx) / 1024.0f); } @@ -62,7 +72,7 @@ void OTRGameplay_InitScene(GlobalContext* globalCtx, s32 spawn) { ->GetResourceManager() ->LoadResource("object_link_child\\object_link_childVtx_01FE08") .get()); - + auto data2 = ResourceMgr_LoadVtxByCRC(0x68d4ea06044e228f);*/ volatile int a = 0; diff --git a/soh/soh/z_scene_otr.cpp b/soh/soh/z_scene_otr.cpp index f63df81e4..123f9c636 100644 --- a/soh/soh/z_scene_otr.cpp +++ b/soh/soh/z_scene_otr.cpp @@ -72,7 +72,7 @@ bool func_800985DC(GlobalContext* globalCtx, Ship::SceneCommand* cmd) { else { ActorEntry* entries = (ActorEntry*)malloc(cmdActor->entries.size() * sizeof(ActorEntry)); - + for (int i = 0; i < cmdActor->entries.size(); i++) { entries[i].id = cmdActor->entries[i].actorNum; @@ -241,7 +241,7 @@ bool func_800987F8(GlobalContext* globalCtx, Ship::SceneCommand* cmd) globalCtx->setupEntranceList[i].room = otrEntrance->entrances[i].roomToLoad; globalCtx->setupEntranceList[i].spawn = otrEntrance->entrances[i].startPositionIndex; } - + otrEntrance->cachedGameData = globalCtx->setupEntranceList; } @@ -252,11 +252,11 @@ bool func_800987F8(GlobalContext* globalCtx, Ship::SceneCommand* cmd) bool func_8009883C(GlobalContext* globalCtx, Ship::SceneCommand* cmd) { Ship::SetSpecialObjects* otrSpecial = (Ship::SetSpecialObjects*)cmd; - + if (otrSpecial->globalObject != 0) globalCtx->objectCtx.subKeepIndex = Object_Spawn(&globalCtx->objectCtx, otrSpecial->globalObject); - if (otrSpecial->elfMessage != 0) + if (otrSpecial->elfMessage != 0) { auto res = (Ship::Blob*)OTRGameplay_LoadFile(globalCtx, sNaviMsgFiles[otrSpecial->elfMessage - 1].fileName); globalCtx->cUpElfMsgs = (ElfMessage*)res->data.data(); @@ -436,7 +436,7 @@ extern "C" void* func_800982FC(ObjectContext * objectCtx, s32 bankIndex, s16 obj bool func_8009899C(GlobalContext* globalCtx, Ship::SceneCommand* cmd) { Ship::SetObjectList* cmdObj = (Ship::SetObjectList*)cmd; - + s32 i; s32 j; s32 k; @@ -743,7 +743,7 @@ bool func_8009918C(GlobalContext* globalCtx, Ship::SceneCommand* cmd) } // Scene Command 0x18: Alternate Headers -bool func_800991A0(GlobalContext* globalCtx, Ship::SceneCommand* cmd) +bool func_800991A0(GlobalContext* globalCtx, Ship::SceneCommand* cmd) { Ship::SetAlternateHeaders* cmdHeaders = (Ship::SetAlternateHeaders*)cmd; @@ -754,7 +754,7 @@ bool func_800991A0(GlobalContext* globalCtx, Ship::SceneCommand* cmd) //osSyncPrintf("\n[ZU]sceneset time =[%X]", ((void)0, gSaveContext.cutsceneIndex)); //osSyncPrintf("\n[ZU]sceneset counter=[%X]", ((void)0, gSaveContext.sceneSetupIndex)); - if (gSaveContext.sceneSetupIndex != 0) + if (gSaveContext.sceneSetupIndex != 0) { std::string desiredHeader = cmdHeaders->headers[gSaveContext.sceneSetupIndex - 1]; Ship::Scene* headerData = nullptr; @@ -798,7 +798,7 @@ bool func_800991A0(GlobalContext* globalCtx, Ship::SceneCommand* cmd) } // Scene Command 0x17: Cutscene Data -bool func_8009934C(GlobalContext* globalCtx, Ship::SceneCommand* cmd) +bool func_8009934C(GlobalContext* globalCtx, Ship::SceneCommand* cmd) { Ship::SetCutscenes* cmdCS = (Ship::SetCutscenes*)cmd; @@ -810,7 +810,7 @@ bool func_8009934C(GlobalContext* globalCtx, Ship::SceneCommand* cmd) } // Scene Command 0x19: Misc. Settings (Camera & World Map Area) -bool func_800993C0(GlobalContext* globalCtx, Ship::SceneCommand* cmd) +bool func_800993C0(GlobalContext* globalCtx, Ship::SceneCommand* cmd) { Ship::SetCameraSettings* cmdCam = (Ship::SetCameraSettings*)cmd; diff --git a/soh/src/boot/build.c b/soh/src/boot/build.c index f3f9bdae6..94d142020 100644 --- a/soh/src/boot/build.c +++ b/soh/src/boot/build.c @@ -1,8 +1,4 @@ -const char gBuildVersion[] = "DECKARD ALFA (1.0.0)"; +const char gBuildVersion[] = "ROY ALFA (2.0.0)"; const char gBuildTeam[] = "github.com/harbourmasters"; -#ifdef __TIMESTAMP__ -const char gBuildDate[] = __TIMESTAMP__; -#else const char gBuildDate[] = __DATE__ " " __TIME__; -#endif const char gBuildMakeOption[] = ""; diff --git a/soh/src/buffers/heaps.c b/soh/src/buffers/heaps.c index 4309acd18..b6f16ab11 100644 --- a/soh/src/buffers/heaps.c +++ b/soh/src/buffers/heaps.c @@ -1,7 +1,40 @@ #include "z64.h" +#include +#include -// 0x38000 bytes -u8 gAudioHeap[0x38000]; +#ifndef _MSC_VER +#include +#endif -//u8 gSystemHeap[UNK_SIZE]; -u8 gSystemHeap[1024 * 1024 * 128]; +u8* gAudioHeap; +u8* gSystemHeap; + +void Heaps_Alloc(void) +{ +#ifdef _MSC_VER + gAudioHeap = (u8*)_aligned_malloc(AUDIO_HEAP_SIZE, 0x10); + gSystemHeap = (u8*)_aligned_malloc(SYSTEM_HEAP_SIZE, 0x10); +#elif defined(_POSIX_VERSION) && (_POSIX_VERSION >= 200112L) + if (posix_memalign((void**)&gAudioHeap, 0x10, AUDIO_HEAP_SIZE) != 0) + gAudioHeap = NULL; + if (posix_memalign((void**)&gSystemHeap, 0x10, SYSTEM_HEAP_SIZE) != 0) + gSystemHeap = NULL; +#else + gAudioHeap = (u8*)memalign(0x10, AUDIO_HEAP_SIZE); + gSystemHeap = (u8*)memalign(0x10, SYSTEM_HEAP_SIZE); +#endif + + assert(gAudioHeap != NULL); + assert(gSystemHeap != NULL); +} + +void Heaps_Free(void) +{ +#ifdef _MSC_VER + _aligned_free(gAudioHeap); + _aligned_free(gSystemHeap); +#else + free(gAudioHeap); + free(gSystemHeap); +#endif +} diff --git a/soh/src/code/audio_effects.c b/soh/src/code/audio_effects.c index 4813d1c63..d5aa3644f 100644 --- a/soh/src/code/audio_effects.c +++ b/soh/src/code/audio_effects.c @@ -246,7 +246,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) { retry: case ADSR_STATE_LOOP: - adsr->delay = (s16)_byteswap_ushort(adsr->envelope[adsr->envIndex].delay); + adsr->delay = (s16)BOMSWAP16(adsr->envelope[adsr->envIndex].delay); switch (adsr->delay) { case ADSR_DISABLE: adsr->action.s.state = ADSR_STATE_DISABLED; @@ -255,7 +255,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) { adsr->action.s.state = ADSR_STATE_HANG; break; case ADSR_GOTO: - adsr->envIndex = (s16)_byteswap_ushort(adsr->envelope[adsr->envIndex].arg); + adsr->envIndex = (s16)BOMSWAP16(adsr->envelope[adsr->envIndex].arg); goto retry; case ADSR_RESTART: adsr->action.s.state = ADSR_STATE_INITIAL; @@ -266,7 +266,7 @@ f32 Audio_AdsrUpdate(AdsrState* adsr) { if (adsr->delay == 0) { adsr->delay = 1; } - adsr->target = (s16)_byteswap_ushort(adsr->envelope[adsr->envIndex].arg) / 32767.0f; + adsr->target = (s16)BOMSWAP16(adsr->envelope[adsr->envIndex].arg) / 32767.0f; adsr->target = adsr->target * adsr->target; adsr->velocity = (adsr->target - adsr->current) / adsr->delay; adsr->action.s.state = ADSR_STATE_FADE; diff --git a/soh/src/code/audio_load.c b/soh/src/code/audio_load.c index ec8b7be86..7af9037a6 100644 --- a/soh/src/code/audio_load.c +++ b/soh/src/code/audio_load.c @@ -1058,7 +1058,7 @@ void AudioLoad_InitSwapFontSampleHeaders(SoundFontSample* sample, uintptr_t romA size_t maxSoundFontSize = 0x3AA0; // soundFont 0 is the largest size at 0x3AA0 AdpcmLoop* loop; AdpcmBook* book; - + if (((uintptr_t)sample->loop > maxSoundFontSize) || ((uintptr_t)sample->book > maxSoundFontSize) ) { bswapSoundFontSample(sample); @@ -1093,7 +1093,7 @@ void AudioLoad_InitSwapFont(void) { SoundFontSound* sfxList; SoundFontSound* sfx; Instrument** instList; - Instrument* inst; + Instrument* inst; // Only up to (numFonts - 1) as final font has garbage data to prevent corruption and is never used for (fontId = 0; fontId < (numFonts - 1); fontId++) { @@ -1110,12 +1110,12 @@ void AudioLoad_InitSwapFont(void) { numInstruments = font->numInstruments; // drums - ptrs[0] = (void*)_byteswap_ulong((uintptr_t)ptrs[0]); + ptrs[0] = (void*)BOMSWAP32((uintptr_t)ptrs[0]); if ((ptrs[0] != NULL) && (numDrums != 0)) { drumList = (Drum**)BASE_ROM_OFFSET(ptrs[0]); for (i = 0; i < numDrums; i++) { - drumList[i] = (Drum*)_byteswap_ulong((uintptr_t)drumList[i]); + drumList[i] = (Drum*)BOMSWAP32((uintptr_t)drumList[i]); if (drumList[i] != NULL) { drum = (Drum*)BASE_ROM_OFFSET(drumList[i]); @@ -1128,7 +1128,7 @@ void AudioLoad_InitSwapFont(void) { } // sfxs - ptrs[1] = (void*)_byteswap_ulong((u32)ptrs[1]); + ptrs[1] = (void*)BOMSWAP32((u32)ptrs[1]); if ((ptrs[1] != NULL) && (numSfxs != 0)) { sfxList = (SoundFontSound*)BASE_ROM_OFFSET(ptrs[1]); @@ -1151,7 +1151,7 @@ void AudioLoad_InitSwapFont(void) { instList = (Instrument**)(&ptrs[2]); for (i = 0; i < numInstruments; i++) { - instList[i] = (Instrument*)_byteswap_ulong((uintptr_t)instList[i]); + instList[i] = (Instrument*)BOMSWAP32((uintptr_t)instList[i]); if (instList[i] != NULL) { inst = BASE_ROM_OFFSET(instList[i]); @@ -1159,15 +1159,15 @@ void AudioLoad_InitSwapFont(void) { if (inst->normalRangeLo != 0) { sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->lowNotesSound.sample); - AudioLoad_InitSwapFontSampleHeaders(sample, romAddr); + AudioLoad_InitSwapFontSampleHeaders(sample, romAddr); } sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->normalNotesSound.sample); - AudioLoad_InitSwapFontSampleHeaders(sample, romAddr); - + AudioLoad_InitSwapFontSampleHeaders(sample, romAddr); + if (inst->normalRangeHi != 0x7F) { sample = (SoundFontSample*)BASE_ROM_OFFSET(inst->highNotesSound.sample); - AudioLoad_InitSwapFontSampleHeaders(sample, romAddr); + AudioLoad_InitSwapFontSampleHeaders(sample, romAddr); } } } diff --git a/soh/src/code/audio_seqplayer.c b/soh/src/code/audio_seqplayer.c index 03e8842e3..3dd7b811e 100644 --- a/soh/src/code/audio_seqplayer.c +++ b/soh/src/code/audio_seqplayer.c @@ -1323,14 +1323,14 @@ void AudioSeq_SequenceChannelProcessScript(SequenceChannel* channel) { case 0xB2: offset = (u16)parameters[0]; // OTRTODO: Byteswap added for quick audio - channel->unk_22 = _byteswap_ushort(*(u16*)(seqPlayer->seqData + (uintptr_t)(offset + scriptState->value * 2))); + channel->unk_22 = BOMSWAP16(*(u16*)(seqPlayer->seqData + (uintptr_t)(offset + scriptState->value * 2))); break; case 0xB4: channel->dynTable = (void*)&seqPlayer->seqData[channel->unk_22]; break; case 0xB5: // OTRTODO: Byteswap added for quick audio - channel->unk_22 = _byteswap_ushort(((u16*)(channel->dynTable))[scriptState->value]); + channel->unk_22 = BOMSWAP16(((u16*)(channel->dynTable))[scriptState->value]); break; case 0xB6: scriptState->value = (*channel->dynTable)[0][scriptState->value]; diff --git a/soh/src/code/audio_synthesis.c b/soh/src/code/audio_synthesis.c index e71c6b441..037bd2ec3 100644 --- a/soh/src/code/audio_synthesis.c +++ b/soh/src/code/audio_synthesis.c @@ -1162,7 +1162,7 @@ Acmd* AudioSynth_LoadWaveSamples(Acmd* cmd, NoteSubEu* noteSubEu, NoteSynthesisS if (temp_v0 < nSamplesToLoad) { repeats = ((nSamplesToLoad - temp_v0 + 0x3F) / 0x40); if (repeats != 0) { - aDuplicate(cmd++, repeats, DMEM_UNCOMPRESSED_NOTE, DMEM_UNCOMPRESSED_NOTE + 0x80, 0x80); + aDuplicate(cmd++, repeats, DMEM_UNCOMPRESSED_NOTE, DMEM_UNCOMPRESSED_NOTE + 0x80); } } synthState->samplePosInt = samplePosInt; @@ -1225,6 +1225,6 @@ Acmd* AudioSynth_NoteApplyHeadsetPanEffects(Acmd* cmd, NoteSubEu* noteSubEu, Not aSaveBuffer(cmd++, DMEM_NOTE_PAN_TEMP + bufLen, &synthState->synthesisBuffers->panResampleState[0x8], ALIGN16(panShift)); } - aAddMixer(cmd++, ALIGN64(bufLen), DMEM_NOTE_PAN_TEMP, dest, 0x7FFF); + aAddMixer(cmd++, ALIGN64(bufLen), DMEM_NOTE_PAN_TEMP, dest); return cmd; } diff --git a/soh/src/code/code_800EC960.c b/soh/src/code/code_800EC960.c index 5efa93167..23d1ba375 100644 --- a/soh/src/code/code_800EC960.c +++ b/soh/src/code/code_800EC960.c @@ -824,10 +824,12 @@ NatureAmbienceDataIO sNatureAmbienceDataIO[20] = { }, }; -u32 sOcarinaAllowedBtnMask = 0x800F; -s32 sOcarinaABtnMap = 0x8000; -s32 sOcarinaCUPBtnMap = 8; -s32 sOcarinaCDownBtnMap = 4; +u32 sOcarinaAllowedBtnMask = (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); +s32 sOcarinaABtnMap = BTN_A; +s32 sOcarinaCUPBtnMap = BTN_CUP; +s32 sOcarinaCDownBtnMap = BTN_CDOWN; +s32 sOcarinaCLeftBtnMap = BTN_CLEFT; +s32 sOcarinaCRightBtnMap = BTN_CRIGHT; u8 sOcarinaInpEnabled = 0; s8 D_80130F10 = 0; // "OCA", ocarina active? u8 sCurOcarinaBtnVal = 0xFF; @@ -1245,19 +1247,23 @@ void func_800F56A8(void); void Audio_PlayNatureAmbienceSequence(u8 natureAmbienceId); s32 Audio_SetGanonDistVol(u8 targetVol); -void func_800EC960(u8 custom) { - if (!custom) { - osSyncPrintf("AUDIO : Ocarina Control Assign Normal\n"); +// Function originally not called, so repurposing for DPad input +void func_800EC960(u8 dpad) { + if (dpad) { + sOcarinaAllowedBtnMask = + (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT | BTN_DUP | BTN_DDOWN | BTN_DLEFT | BTN_DRIGHT); + sOcarinaABtnMap = BTN_A; + sOcarinaCUPBtnMap = BTN_CUP | BTN_DUP; + sOcarinaCDownBtnMap = BTN_CDOWN | BTN_DDOWN; + sOcarinaCLeftBtnMap = BTN_CLEFT | BTN_DLEFT; + sOcarinaCRightBtnMap = BTN_CRIGHT | BTN_DRIGHT; + } else { sOcarinaAllowedBtnMask = (BTN_A | BTN_CUP | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); sOcarinaABtnMap = BTN_A; sOcarinaCUPBtnMap = BTN_CUP; sOcarinaCDownBtnMap = BTN_CDOWN; - } else { - osSyncPrintf("AUDIO : Ocarina Control Assign Custom\n"); - sOcarinaAllowedBtnMask = (BTN_A | BTN_B | BTN_CDOWN | BTN_CLEFT | BTN_CRIGHT); - sOcarinaABtnMap = BTN_B; - sOcarinaCUPBtnMap = BTN_CDOWN; - sOcarinaCDownBtnMap = BTN_A; + sOcarinaCLeftBtnMap = BTN_CLEFT; + sOcarinaCRightBtnMap = BTN_CRIGHT; } } @@ -1542,6 +1548,7 @@ void func_800ED200(void) { void func_800ED458(s32 arg0) { u32 phi_v1_2; + bool dpad = CVar_GetS32("gDpadOcarinaText", 0); if (D_80130F3C != 0 && D_80131880 != 0) { D_80131880--; @@ -1561,6 +1568,7 @@ void func_800ED458(s32 arg0) { D_8016BA18 &= phi_v1_2; } + func_800EC960(dpad); if (D_8016BA18 & sOcarinaABtnMap) { osSyncPrintf("Presss NA_KEY_D4 %08x\n", sOcarinaABtnMap); sCurOcarinaBtnVal = 2; @@ -1569,12 +1577,12 @@ void func_800ED458(s32 arg0) { osSyncPrintf("Presss NA_KEY_F4 %08x\n", sOcarinaCDownBtnMap); sCurOcarinaBtnVal = 5; sCurOcarinaBtnIdx = 1; - } else if (D_8016BA18 & 1) { - osSyncPrintf("Presss NA_KEY_A4 %08x\n", 1); + } else if (D_8016BA18 & sOcarinaCRightBtnMap) { + osSyncPrintf("Presss NA_KEY_A4 %08x\n", sOcarinaCRightBtnMap); sCurOcarinaBtnVal = 9; sCurOcarinaBtnIdx = 2; - } else if (D_8016BA18 & 2) { - osSyncPrintf("Presss NA_KEY_B4 %08x\n", 2); + } else if (D_8016BA18 & sOcarinaCLeftBtnMap) { + osSyncPrintf("Presss NA_KEY_B4 %08x\n", sOcarinaCRightBtnMap); sCurOcarinaBtnVal = 0xB; sCurOcarinaBtnIdx = 3; } else if (D_8016BA18 & sOcarinaCUPBtnMap) { @@ -1671,7 +1679,7 @@ void Audio_OcaSetSongPlayback(s8 songIdxPlusOne, s8 playbackState) { void Audio_OcaPlayback(void) { u32 noteTimerStep; - u32 nextNoteTimerStep; + u32 nextNoteTimerStep = 0; if (sPlaybackState != 0) { if (sStaffPlaybackPos == 0) { @@ -4772,7 +4780,7 @@ void Audio_SetCodeReverb(s8 reverb) { } void func_800F6700(s8 arg0) { - s8 sp1F; + s8 sp1F = 0; switch (arg0) { case 0: diff --git a/soh/src/code/game.c b/soh/src/code/game.c index ec8a0e9fa..a411523ec 100644 --- a/soh/src/code/game.c +++ b/soh/src/code/game.c @@ -323,6 +323,110 @@ void GameState_Update(GameState* gameState) { GameState_Draw(gameState, gfxCtx); func_800C49F4(gfxCtx); } + + // ----------------------- + // Cheats hooks + // ----------------------- + + // Inf Money + if (CVar_GetS32("gInfiniteMoney", 0) != 0) { + if (gSaveContext.rupees < CUR_CAPACITY(UPG_WALLET)) { + gSaveContext.rupees = CUR_CAPACITY(UPG_WALLET); + } + } + + // Inf Health + if (CVar_GetS32("gInfiniteHealth", 0) != 0) { + if (gSaveContext.health < gSaveContext.healthCapacity) { + gSaveContext.health = gSaveContext.healthCapacity; + } + } + + // Inf Ammo + if (CVar_GetS32("gInfiniteAmmo", 0) != 0) { + // Deku Sticks + if (AMMO(ITEM_STICK) < CUR_CAPACITY(UPG_STICKS)) { + AMMO(ITEM_STICK) = CUR_CAPACITY(UPG_STICKS); + } + + // Deku Nuts + if (AMMO(ITEM_NUT) < CUR_CAPACITY(UPG_NUTS)) { + AMMO(ITEM_NUT) = CUR_CAPACITY(UPG_NUTS); + } + + // Bombs + if (AMMO(ITEM_BOMB) < CUR_CAPACITY(UPG_BOMB_BAG)) { + AMMO(ITEM_BOMB) = CUR_CAPACITY(UPG_BOMB_BAG); + } + + // Fairy Bow (Ammo) + if (AMMO(ITEM_BOW) < CUR_CAPACITY(UPG_QUIVER)) { + AMMO(ITEM_BOW) = CUR_CAPACITY(UPG_QUIVER); + } + + // Fairy Slingshot (Ammo) + if (AMMO(ITEM_SLINGSHOT) < CUR_CAPACITY(UPG_BULLET_BAG)) { + AMMO(ITEM_SLINGSHOT) = CUR_CAPACITY(UPG_BULLET_BAG); + } + + // Bombchus (max: 50, no upgrades) + if (AMMO(ITEM_BOMBCHU) < 50) { + AMMO(ITEM_BOMBCHU) = 50; + } + } + + // Inf Magic + if (CVar_GetS32("gInfiniteMagic", 0) != 0) { + if (gSaveContext.magicAcquired && gSaveContext.magic != (gSaveContext.doubleMagic + 1) * 0x30) { + gSaveContext.magic = (gSaveContext.doubleMagic + 1) * 0x30; + } + } + + // Inf Nayru's Love Timer + if (CVar_GetS32("gInfiniteNayru", 0) != 0) { + gSaveContext.nayrusLoveTimer = 0x44B; + } + + // Moon Jump On L + if (CVar_GetS32("gMoonJumpOnL", 0) != 0) { + if (gGlobalCtx) { + Player* player = GET_PLAYER(gGlobalCtx); + + if (CHECK_BTN_ANY(gGlobalCtx->state.input[0].cur.button, BTN_L)) { + player->actor.velocity.y = 6.34375f; + } + } + } + + // Permanent infinite sword glitch (ISG) + if (CVar_GetS32("gEzISG", 0) != 0) { + if (gGlobalCtx) { + Player* player = GET_PLAYER(gGlobalCtx); + player->swordState = 1; + } + } + + // Unrestricted Items + if (CVar_GetS32("gNoRestrictItems", 0) != 0) { + if (gGlobalCtx) { + memset(&gGlobalCtx->interfaceCtx.restrictions, 0, sizeof(gGlobalCtx->interfaceCtx.restrictions)); + } + } + + // Freeze Time + if (CVar_GetS32("gFreezeTime", 0) != 0) { + if (CVar_GetS32("gPrevTime", -1) == -1) { + CVar_SetS32("gPrevTime", gSaveContext.dayTime); + } + + int32_t prevTime = CVar_GetS32("gPrevTime", gSaveContext.dayTime); + gSaveContext.dayTime = prevTime; + } else { + CVar_SetS32("gPrevTime", -1); + } + + //since our CVar is same value and properly default to 0 there is not problems doing this in single line. + gSaveContext.language = CVar_GetS32("gLanguages", 0); gameState->frames++; } diff --git a/soh/src/code/graph.c b/soh/src/code/graph.c index 9d2886ef1..4b1887c18 100644 --- a/soh/src/code/graph.c +++ b/soh/src/code/graph.c @@ -5,6 +5,7 @@ #include #include "soh/Enhancements/gameconsole.h" +#include "soh/Enhancements/debugger/debugger.h" #define GFXPOOL_HEAD_MAGIC 0x1234 #define GFXPOOL_TAIL_MAGIC 0x5678 @@ -95,12 +96,14 @@ void Graph_InitTHGA(GraphicsContext* gfxCtx) { pool->tailMagic = GFXPOOL_TAIL_MAGIC; THGA_Ct(&gfxCtx->polyOpa, pool->polyOpaBuffer, sizeof(pool->polyOpaBuffer)); THGA_Ct(&gfxCtx->polyXlu, pool->polyXluBuffer, sizeof(pool->polyXluBuffer)); + THGA_Ct(&gfxCtx->worldOverlay, pool->worldOverlayBuffer, sizeof(pool->worldOverlayBuffer)); THGA_Ct(&gfxCtx->polyKal, pool->polyKalBuffer, sizeof(pool->polyKalBuffer)); THGA_Ct(&gfxCtx->overlay, pool->overlayBuffer, sizeof(pool->overlayBuffer)); THGA_Ct(&gfxCtx->work, pool->workBuffer, sizeof(pool->workBuffer)); gfxCtx->polyOpaBuffer = pool->polyOpaBuffer; gfxCtx->polyXluBuffer = pool->polyXluBuffer; + gfxCtx->worldOverlayBuffer = pool->worldOverlayBuffer; gfxCtx->polyKalBuffer = pool->polyKalBuffer; gfxCtx->overlayBuffer = pool->overlayBuffer; gfxCtx->workBuffer = pool->workBuffer; @@ -280,6 +283,7 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { GameState_ReqPadData(gameState); GameState_Update(gameState); + Debug_Draw(); OPEN_DISPS(gfxCtx, "../graph.c", 987); @@ -294,7 +298,8 @@ void Graph_Update(GraphicsContext* gfxCtx, GameState* gameState) { gSPBranchList(WORK_DISP++, gfxCtx->polyOpaBuffer); gSPBranchList(POLY_OPA_DISP++, gfxCtx->polyXluBuffer); - gSPBranchList(POLY_XLU_DISP++, gfxCtx->polyKalBuffer); + gSPBranchList(POLY_XLU_DISP++, gfxCtx->worldOverlayBuffer); + gSPBranchList(WORLD_OVERLAY_DISP++, gfxCtx->polyKalBuffer); gSPBranchList(POLY_KAL_DISP++, gfxCtx->overlayBuffer); gDPPipeSync(OVERLAY_DISP++); gDPFullSync(OVERLAY_DISP++); @@ -426,6 +431,8 @@ static struct RunFrameContext { extern AudioMgr gAudioMgr; +extern void ProcessSaveStateRequests(void); + static void RunFrame() { u32 size; @@ -468,36 +475,8 @@ static void RunFrame() { uint64_t ticksA, ticksB; ticksA = GetPerfCounter(); - - OTRSetFrameDivisor(R_UPDATE_RATE); - //OTRSetFrameDivisor(0); - - - //AudioMgr_ThreadEntry(&gAudioMgr); - // 528 and 544 relate to 60 fps at 32 kHz 32000/60 = 533.333.. - // in an ideal world, one third of the calls should use num_samples=544 and two thirds num_samples=528 - #define SAMPLES_HIGH 560 - #define SAMPLES_LOW 528 - // PAL values - //#define SAMPLES_HIGH 656 - //#define SAMPLES_LOW 624 - #define AUDIO_FRAMES_PER_UPDATE (R_UPDATE_RATE > 0 ? R_UPDATE_RATE : 1 ) - #define NUM_AUDIO_CHANNELS 2 - int samples_left = AudioPlayer_Buffered(); - u32 num_audio_samples = samples_left < AudioPlayer_GetDesiredBuffered() ? SAMPLES_HIGH : SAMPLES_LOW; - // printf("Audio samples: %d %u\n", samples_left, num_audio_samples); - - // 3 is the maximum authentic frame divisor. - s16 audio_buffer[SAMPLES_HIGH * NUM_AUDIO_CHANNELS * 3]; - for (int i = 0; i < AUDIO_FRAMES_PER_UPDATE; i++) { - AudioMgr_CreateNextAudioBuffer(audio_buffer + i * (num_audio_samples * NUM_AUDIO_CHANNELS), num_audio_samples); - } - //for (uint32_t i = 0; i < 2 * num_audio_samples; i++) { - // audio_buffer[i] = Rand_Next() & 0xFF; - //} - // printf("Audio samples before submitting: %d\n", audio_api->buffered()); - AudioPlayer_Play((u8*)audio_buffer, num_audio_samples * (sizeof(int16_t) * NUM_AUDIO_CHANNELS * AUDIO_FRAMES_PER_UPDATE)); + Graph_StartFrame(); PadMgr_ThreadEntry(&gPadMgr); @@ -510,6 +489,7 @@ static void RunFrame() //uint64_t diff = (ticksB - ticksA) / (freq / 1000); //printf("Frame simulated in %ims\n", diff); runFrameContext.state = 1; + ProcessSaveStateRequests(); return; nextFrame:; } diff --git a/soh/src/code/main.c b/soh/src/code/main.c index eaaa7b388..0680aad3e 100644 --- a/soh/src/code/main.c +++ b/soh/src/code/main.c @@ -63,6 +63,7 @@ void Main(void* arg) { PreNmiBuff_Init(gAppNmiBufferPtr); Fault_Init(); SysCfb_Init(0); + Heaps_Alloc(); sysHeap = gSystemHeap; fb = SysCfb_GetFbPtr(0); gSystemHeapSize = 1024 * 1024 * 4; @@ -131,4 +132,6 @@ void Main(void* arg) { osDestroyThread(&sGraphThread); func_800FBFD8(); osSyncPrintf("mainproc 実行終了\n"); // "End of execution" + + Heaps_Free(); } diff --git a/soh/src/code/padmgr.c b/soh/src/code/padmgr.c index fb4ceb8e6..b467f5ee6 100644 --- a/soh/src/code/padmgr.c +++ b/soh/src/code/padmgr.c @@ -3,7 +3,9 @@ //#include +#ifdef _MSC_VER extern void* __cdecl memset(_Out_writes_bytes_all_(_Size) void* _Dst, _In_ int _Val, _In_ size_t _Size); +#endif s32 D_8012D280 = 1; @@ -269,12 +271,22 @@ void PadMgr_ProcessInputs(PadMgr* padMgr) { input->press.stick_y += (s8)(input->cur.stick_y - input->prev.stick_y); } - controllerCallback.rumble = padMgr->rumbleEnable[0] > 0 ? 1 : 0; + controllerCallback.rumble = CVar_GetS32("gRumbleEnabled", 0) && (padMgr->rumbleEnable[0] > 0); if (HealthMeter_IsCritical()) { - controllerCallback.ledColor = 1; - } else { controllerCallback.ledColor = 0; + } else if (gGlobalCtx) { + switch (CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1) { + case PLAYER_TUNIC_KOKIRI: + controllerCallback.ledColor = 1; + break; + case PLAYER_TUNIC_GORON: + controllerCallback.ledColor = 2; + break; + case PLAYER_TUNIC_ZORA: + controllerCallback.ledColor = 3; + break; + } } OTRControllerCallback(&controllerCallback); @@ -293,6 +305,11 @@ void PadMgr_HandleRetraceMsg(PadMgr* padMgr) { } osRecvMesg(queue, NULL, OS_MESG_BLOCK); osContGetReadData(padMgr->pads); + + for (i = 0; i < __osMaxControllers; i++) { + padMgr->padStatus[i].status = CVar_GetS32("gRumbleEnabled", 0) && Controller_ShouldRumble(i); + } + if (padMgr->preNMIShutdown) { memset(padMgr->pads, 0, sizeof(padMgr->pads)); } diff --git a/soh/src/code/sys_math3d.c b/soh/src/code/sys_math3d.c index d442b7c4a..39ffea881 100644 --- a/soh/src/code/sys_math3d.c +++ b/soh/src/code/sys_math3d.c @@ -1857,7 +1857,7 @@ s32 Math3D_CylTriVsIntersect(Cylinder16* cyl, TriNorm* tri, Vec3f* intersect) { } } - if (minDistSq != 1.e38f) { + if (minDistSq != (f32)1.e38f) { return true; } diff --git a/soh/src/code/sys_matrix.c b/soh/src/code/sys_matrix.c index 9d7c73967..bc90bf669 100644 --- a/soh/src/code/sys_matrix.c +++ b/soh/src/code/sys_matrix.c @@ -1,5 +1,7 @@ #include "global.h" +#include "soh/frame_interpolation.h" + // clang-format off Mtx gMtxClear = { 65536, 0, 1, 0, @@ -25,11 +27,13 @@ void Matrix_Init(GameState* gameState) { } void Matrix_Push(void) { + FrameInterpolation_RecordMatrixPush(); Matrix_MtxFCopy(sCurrentMatrix + 1, sCurrentMatrix); sCurrentMatrix++; } void Matrix_Pop(void) { + FrameInterpolation_RecordMatrixPop(); sCurrentMatrix--; ASSERT(sCurrentMatrix >= sMatrixStack, "Matrix_now >= Matrix_stack", "../sys_matrix.c", 176); } @@ -39,6 +43,7 @@ void Matrix_Get(MtxF* dest) { } void Matrix_Put(MtxF* src) { + FrameInterpolation_RecordMatrixPut(src); Matrix_MtxFCopy(sCurrentMatrix, src); } @@ -47,6 +52,7 @@ MtxF* Matrix_GetCurrent(void) { } void Matrix_Mult(MtxF* mf, u8 mode) { + FrameInterpolation_RecordMatrixMult(mf, mode); MtxF* cmf = Matrix_GetCurrent(); if (mode == MTXMODE_APPLY) { @@ -57,6 +63,7 @@ void Matrix_Mult(MtxF* mf, u8 mode) { } void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) { + FrameInterpolation_RecordMatrixTranslate(x, y, z, mode); MtxF* cmf = sCurrentMatrix; f32 tx; f32 ty; @@ -80,6 +87,7 @@ void Matrix_Translate(f32 x, f32 y, f32 z, u8 mode) { } void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) { + FrameInterpolation_RecordMatrixScale(x, y, z, mode); MtxF* cmf = sCurrentMatrix; if (mode == MTXMODE_APPLY) { @@ -101,6 +109,7 @@ void Matrix_Scale(f32 x, f32 y, f32 z, u8 mode) { } void Matrix_RotateX(f32 x, u8 mode) { + FrameInterpolation_RecordMatrixRotate1Coord(0, x, mode); MtxF* cmf; f32 sin; f32 cos; @@ -165,6 +174,7 @@ void Matrix_RotateX(f32 x, u8 mode) { } void Matrix_RotateY(f32 y, u8 mode) { + FrameInterpolation_RecordMatrixRotate1Coord(1, y, mode); MtxF* cmf; f32 sin; f32 cos; @@ -229,6 +239,7 @@ void Matrix_RotateY(f32 y, u8 mode) { } void Matrix_RotateZ(f32 z, u8 mode) { + FrameInterpolation_RecordMatrixRotate1Coord(2, z, mode); MtxF* cmf; f32 sin; f32 cos; @@ -299,6 +310,7 @@ void Matrix_RotateZ(f32 z, u8 mode) { * Original Name: Matrix_RotateXYZ, changed to reflect rotation order. */ void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode) { + FrameInterpolation_RecordMatrixRotateZYX(x, y, z, mode); MtxF* cmf = sCurrentMatrix; f32 temp1; f32 temp2; @@ -389,6 +401,7 @@ void Matrix_RotateZYX(s16 x, s16 y, s16 z, u8 mode) { * transformed according to whatever the matrix was previously. */ void Matrix_TranslateRotateZYX(Vec3f* translation, Vec3s* rotation) { + FrameInterpolation_RecordMatrixTranslateRotateZYX(translation, rotation); MtxF* cmf = sCurrentMatrix; f32 sin = Math_SinS(rotation->z); f32 cos = Math_CosS(rotation->z); @@ -530,15 +543,20 @@ void Matrix_SetTranslateRotateYXZ(f32 translateX, f32 translateY, f32 translateZ } else { cmf->yx = 0.0f; } + FrameInterpolation_RecordMatrixSetTranslateRotateYXZ(translateX, translateY, translateZ, rot); } Mtx* Matrix_MtxFToMtx(MtxF* src, Mtx* dest) { + FrameInterpolation_RecordMatrixMtxFToMtx(src, dest); guMtxF2L(src, dest); return dest; } Mtx* Matrix_ToMtx(Mtx* dest, char* file, s32 line) { - return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest); + FrameInterpolation_RecordMatrixToMtx(dest, file, line); + guMtxF2L(Matrix_CheckFloats(sCurrentMatrix, file, line), dest); + return dest; + //return Matrix_MtxFToMtx(Matrix_CheckFloats(sCurrentMatrix, file, line), dest); } Mtx* Matrix_NewMtx(GraphicsContext* gfxCtx, char* file, s32 line) { @@ -627,6 +645,7 @@ void Matrix_Transpose(MtxF* mf) { * seen as replacing the R rotation with `mf`, hence the function name. */ void Matrix_ReplaceRotation(MtxF* mf) { + FrameInterpolation_RecordMatrixReplaceRotation(mf); MtxF* cmf = sCurrentMatrix; f32 acc; f32 temp; @@ -779,6 +798,7 @@ void Matrix_MtxFToZYXRotS(MtxF* mf, Vec3s* rotDest, s32 flag) { * NB: `axis` is assumed to be a unit vector. */ void Matrix_RotateAxis(f32 angle, Vec3f* axis, u8 mode) { + FrameInterpolation_RecordMatrixRotateAxis(angle, axis, mode); MtxF* cmf; f32 sin; f32 cos; diff --git a/soh/src/code/z_actor.c b/soh/src/code/z_actor.c index 92702f866..caa16a7ec 100644 --- a/soh/src/code/z_actor.c +++ b/soh/src/code/z_actor.c @@ -6,14 +6,15 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/gameplay_dangeon_keep/gameplay_dangeon_keep.h" #include "objects/object_bdoor/object_bdoor.h" +#include "soh/frame_interpolation.h" -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__GNUC__) #include #include #include #endif -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__GNUC__) #include "textures/place_title_cards/g_pn_49.h" #include "textures/place_title_cards/g_pn_01.h" #include "textures/place_title_cards/g_pn_02.h" @@ -334,6 +335,38 @@ void func_8002BE98(TargetContext* targetCtx, s32 actorCategory, GlobalContext* g void func_8002BF60(TargetContext* targetCtx, Actor* actor, s32 actorCategory, GlobalContext* globalCtx) { NaviColor* naviColor = &sNaviColorList[actorCategory]; + if (actorCategory == ACTORCAT_PLAYER) { + naviColor->inner.r = CVar_GetS32("gNavi_Idle_Inner_Red", naviColor->inner.r); + naviColor->inner.g = CVar_GetS32("gNavi_Idle_Inner_Green", naviColor->inner.g); + naviColor->inner.b = CVar_GetS32("gNavi_Idle_Inner_Blue", naviColor->inner.b); + naviColor->outer.r = CVar_GetS32("gNavi_Idle_Outer_Red", naviColor->outer.r); + naviColor->outer.g = CVar_GetS32("gNavi_Idle_Outer_Green", naviColor->outer.g); + naviColor->outer.b = CVar_GetS32("gNavi_Idle_Outer_Blue", naviColor->outer.b); + } + if (actorCategory == ACTORCAT_NPC) { + naviColor->inner.r = CVar_GetS32("gNavi_NPC_Inner_Red", naviColor->inner.r); + naviColor->inner.g = CVar_GetS32("gNavi_NPC_Inner_Green", naviColor->inner.g); + naviColor->inner.b = CVar_GetS32("gNavi_NPC_Inner_Blue", naviColor->inner.b); + naviColor->outer.r = CVar_GetS32("gNavi_NPC_Outer_Red", naviColor->outer.r); + naviColor->outer.g = CVar_GetS32("gNavi_NPC_Outer_Green", naviColor->outer.g); + naviColor->outer.b = CVar_GetS32("gNavi_NPC_Outer_Blue", naviColor->outer.b); + } + if (actorCategory == ACTORCAT_BOSS || actorCategory == ACTORCAT_ENEMY) { + naviColor->inner.r = CVar_GetS32("gNavi_Enemy_Inner_Red", naviColor->inner.r); + naviColor->inner.g = CVar_GetS32("gNavi_Enemy_Inner_Green", naviColor->inner.g); + naviColor->inner.b = CVar_GetS32("gNavi_Enemy_Inner_Blue", naviColor->inner.b); + naviColor->outer.r = CVar_GetS32("gNavi_Enemy_Outer_Red", naviColor->outer.r); + naviColor->outer.g = CVar_GetS32("gNavi_Enemy_Outer_Green", naviColor->outer.g); + naviColor->outer.b = CVar_GetS32("gNavi_Enemy_Outer_Blue", naviColor->outer.b); + } + if (actorCategory == ACTORCAT_PROP) { + naviColor->inner.r = CVar_GetS32("gNavi_Prop_Inner_Red", naviColor->inner.r); + naviColor->inner.g = CVar_GetS32("gNavi_Prop_Inner_Green", naviColor->inner.g); + naviColor->inner.b = CVar_GetS32("gNavi_Prop_Inner_Blue", naviColor->inner.b); + naviColor->outer.r = CVar_GetS32("gNavi_Prop_Outer_Red", naviColor->outer.r); + naviColor->outer.g = CVar_GetS32("gNavi_Prop_Outer_Green", naviColor->outer.g); + naviColor->outer.b = CVar_GetS32("gNavi_Prop_Outer_Blue", naviColor->outer.b); + } targetCtx->naviRefPos.x = actor->focus.pos.x; targetCtx->naviRefPos.y = actor->focus.pos.y + (actor->targetArrowOffset * actor->scale.y); targetCtx->naviRefPos.z = actor->focus.pos.z; @@ -378,6 +411,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { f32 var2; s32 i; + FrameInterpolation_RecordOpenChild(actor, 0); player = GET_PLAYER(globalCtx); spCE = 0xFF; @@ -454,10 +488,12 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { } } } + FrameInterpolation_RecordCloseChild(); } actor = targetCtx->unk_94; if ((actor != NULL) && !(actor->flags & ACTOR_FLAG_27)) { + FrameInterpolation_RecordOpenChild(actor, 1); NaviColor* naviColor = &sNaviColorList[actor->category]; POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x7); @@ -471,6 +507,7 @@ void func_8002C124(TargetContext* targetCtx, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_actor.c", 2153), G_MTX_MODELVIEW | G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gZTargetArrowDL); + FrameInterpolation_RecordCloseChild(); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 2158); @@ -726,12 +763,14 @@ void func_8002CDE4(GlobalContext* globalCtx, TitleCardContext* titleCtx) { } void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s16 x, s16 y, u8 width, - u8 height) { + u8 height, s16 hasTranslation) { if (ResourceMgr_OTRSigCheck(texture)) texture = ResourceMgr_LoadTexByName(texture); titleCtx->texture = texture; + titleCtx->isBossCard = true; + titleCtx->hasTranslation = hasTranslation; titleCtx->x = x; titleCtx->y = y; titleCtx->width = width; @@ -740,7 +779,7 @@ void TitleCard_InitBossName(GlobalContext* globalCtx, TitleCardContext* titleCtx titleCtx->delayTimer = 0; } -void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, char* texture, s32 x, s32 y, +void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCtx, void* texture, s32 x, s32 y, s32 width, s32 height, s32 delay) { SceneTableEntry* loadedScene = globalCtx->loadedScene; @@ -766,9 +805,9 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt break; case SCENE_JYASINZOU: texture = gSpiritTempleTitleCardENGTex; - break; + break; case SCENE_HAKADAN: - texture = gSpiritTempleTitleCardENGTex; + texture = gShadowTempleTitleCardENGTex; break; case SCENE_HAKADANCH: texture = gBottomOfTheWellTitleCardENGTex; @@ -925,7 +964,7 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt default: titleCtx->texture = NULL; return; - + } char newName[512]; @@ -949,6 +988,8 @@ void TitleCard_InitPlaceName(GlobalContext* globalCtx, TitleCardContext* titleCt titleCtx->texture = ResourceMgr_LoadTexByName(texture); //titleCtx->texture = texture; + titleCtx->isBossCard = false; + titleCtx->hasTranslation = false; titleCtx->x = x; titleCtx->y = y; titleCtx->width = width; @@ -978,6 +1019,8 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { s32 titleY; s32 titleSecondY; s32 textureLanguageOffset; + s32 shiftTopY; + s32 shiftBottomY; if (titleCtx->alpha != 0) { width = titleCtx->width; @@ -988,34 +1031,50 @@ void TitleCard_Draw(GlobalContext* globalCtx, TitleCardContext* titleCtx) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 2824); - textureLanguageOffset = width * height * gSaveContext.language; height = (width * height > 0x1000) ? 0x1000 / width : height; titleSecondY = titleY + (height * 4); - OVERLAY_DISP = func_80093808(OVERLAY_DISP); + textureLanguageOffset = 0x0; + shiftTopY = 0x0; + shiftBottomY = 0x1000; - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, + //if this card is bosses cards, has translation and that is not using English language. + if (titleCtx->isBossCard && titleCtx->hasTranslation && gSaveContext.language != LANGUAGE_ENG) { + textureLanguageOffset = (width * height * gSaveContext.language); + if (gSaveContext.language == LANGUAGE_GER) { + shiftTopY = 0x400; + shiftBottomY = 0x1400; + } else if (gSaveContext.language == LANGUAGE_FRA) { + shiftTopY = 0x800; + shiftBottomY = 0x1800; + } + } + + // WORLD_OVERLAY_DISP Goes over POLY_XLU_DISP but under POLY_KAL_DISP + WORLD_OVERLAY_DISP = func_80093808(WORLD_OVERLAY_DISP); + + gDPSetPrimColor(WORLD_OVERLAY_DISP++, 0, 0, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->intensity, (u8)titleCtx->alpha); - gDPLoadTextureBlock(OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset, G_IM_FMT_IA, + gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + shiftTopY, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - - gSPTextureRectangle(OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4) - 1, + //Removing the -1 there remove the gap between top and bottom textures. + gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleY, ((doubleWidth * 2) + titleX) - 4, titleY + (height * 4), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); height = titleCtx->height - height; // If texture is bigger than 0x1000, display the rest if (height > 0) { - gDPLoadTextureBlock(OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + 0x1000, + gDPLoadTextureBlock(WORLD_OVERLAY_DISP++, (uintptr_t)titleCtx->texture + textureLanguageOffset + shiftBottomY, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - - gSPTextureRectangle(OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4, - titleSecondY + (height * 4) - 1, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + //Removing the -1 there remove the gap between top and bottom textures. + gSPTextureRectangle(WORLD_OVERLAY_DISP++, titleX, titleSecondY, ((doubleWidth * 2) + titleX) - 4, + titleSecondY + (height * 4), G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 2880); @@ -1091,7 +1150,7 @@ void Actor_Init(Actor* actor, GlobalContext* globalCtx) { CollisionCheck_InitInfo(&actor->colChkInfo); actor->floorBgId = BGCHECK_SCENE; ActorShape_Init(&actor->shape, 0.0f, NULL, 0.0f); - //if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) + //if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { //Actor_SetObjectDependency(globalCtx, actor); actor->init(actor, globalCtx); @@ -2327,7 +2386,7 @@ void Actor_UpdateAll(GlobalContext* globalCtx, ActorContext* actorCtx) { actor->sfx = 0; if (actor->init != NULL) { - if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) + if (Object_IsLoaded(&globalCtx->objectCtx, actor->objBankIndex)) { Actor_SetObjectDependency(globalCtx, actor); actor->init(actor, globalCtx); @@ -2436,6 +2495,7 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { Fault_AddClient(&faultClient, Actor_FaultPrint, actor, "Actor_draw"); + FrameInterpolation_RecordOpenChild(actor, 0); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6035); lights = LightContext_NewLights(&globalCtx->lightCtx, globalCtx->state.gfxCtx); @@ -2443,6 +2503,7 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { Lights_BindAll(lights, globalCtx->lightCtx.listHead, (actor->flags & ACTOR_FLAG_22) ? NULL : &actor->world.pos); Lights_Draw(lights, globalCtx->state.gfxCtx); + FrameInterpolation_RecordActorPosRotMatrix(); if (actor->flags & ACTOR_FLAG_12) { Matrix_SetTranslateRotateYXZ( actor->world.pos.x + globalCtx->mainCamera.skyboxOffset.x, @@ -2492,6 +2553,7 @@ void Actor_Draw(GlobalContext* globalCtx, Actor* actor) { } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_actor.c", 6119); + FrameInterpolation_RecordCloseChild(); Fault_RemoveClient(&faultClient); } @@ -2516,10 +2578,16 @@ void func_80030FA8(GraphicsContext* gfxCtx) { gDPLoadTextureBlock(POLY_XLU_DISP++, gLensOfTruthMaskTex, G_IM_FMT_I, G_IM_SIZ_8b, 64, 64, 0, G_TX_MIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_CLAMP, 6, 6, G_TX_NOLOD, G_TX_NOLOD); - gDPSetTileSize(POLY_XLU_DISP++, G_TX_RENDERTILE, 384, 224, 892, 732); - gSPTextureRectangle(POLY_XLU_DISP++, 0, 0, 1280, 960, G_TX_RENDERTILE, 2240, 1600, 576, 597); - gDPPipeSync(POLY_XLU_DISP++); + s32 x = OTRGetRectDimensionFromLeftEdge(0) << 2; + s32 w = OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) << 2; + float ratio = OTRGetAspectRatio(); + + gDPSetTileSize(POLY_XLU_DISP++, G_TX_RENDERTILE, 384, 224, 892, 732); + // TODO: Do correct math to fix it + gSPWideTextureRectangle(POLY_XLU_DISP++, x, 0, x + abs(x), 960, G_TX_RENDERTILE, 0, 0, 0, 0); + gSPWideTextureRectangle(POLY_XLU_DISP++, 0, 0, w, 960, G_TX_RENDERTILE, 2240, 1600, 576, 597); + gDPPipeSync(POLY_XLU_DISP++); CLOSE_DISPS(gfxCtx, "../z_actor.c", 6183); } @@ -2863,7 +2931,7 @@ void Actor_FreeOverlay(ActorOverlay* actorOverlay) { osSyncPrintf(VT_FGCOL(CYAN)); if (actorOverlay->numLoaded == 0) { - + if (actorOverlay->initInfo->reset != NULL) { actorOverlay->initInfo->reset(); } @@ -2989,7 +3057,7 @@ Actor* Actor_Spawn(ActorContext* actorCtx, GlobalContext* globalCtx, s16 actorId if (objBankIndex < 0 && !gMapLoading) objBankIndex = 0; - + if ((objBankIndex < 0) || ((actorInit->category == ACTORCAT_ENEMY) && Flags_GetClear(globalCtx, globalCtx->roomCtx.curRoom.num))) { // "No data bank!! (profilep->bank=%d)" @@ -4212,8 +4280,6 @@ s32 func_80035124(Actor* actor, GlobalContext* globalCtx) { return ret; } -#include "z_cheap_proc.c" - u8 func_800353E8(GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); diff --git a/soh/src/code/z_bgcheck.c b/soh/src/code/z_bgcheck.c index b736d0cf0..811b0bea1 100644 --- a/soh/src/code/z_bgcheck.c +++ b/soh/src/code/z_bgcheck.c @@ -1874,6 +1874,10 @@ s32 BgCheck_CheckWallImpl(CollisionContext* colCtx, u16 xpFlags, Vec3f* posResul s32 bgId2; f32 nx, ny, nz; // unit normal of polygon + if (CVar_GetS32("gNoClip", 0) != 0) { + return false; + } + result = false; *outBgId = BGCHECK_SCENE; *outPoly = NULL; @@ -3996,7 +4000,11 @@ u32 func_80041D94(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { * SurfaceType Get Wall Flags */ s32 func_80041DB8(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { - return D_80119D90[func_80041D94(colCtx, poly, bgId)]; + if (CVar_GetS32("gClimbEverything", 0) != 0) { + return (1 << 3) | D_80119D90[func_80041D94(colCtx, poly, bgId)]; + } else { + return D_80119D90[func_80041D94(colCtx, poly, bgId)]; + } } /** @@ -4023,7 +4031,7 @@ s32 func_80041E4C(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { /** * unused */ -u32 func_80041E80(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { +s32 func_80041E80(CollisionContext* colCtx, CollisionPoly* poly, s32 bgId) { return SurfaceType_GetData(colCtx, poly, bgId, 0) >> 26 & 0xF; } diff --git a/soh/src/code/z_camera.c b/soh/src/code/z_camera.c index 7302f9b21..00f3f70f0 100644 --- a/soh/src/code/z_camera.c +++ b/soh/src/code/z_camera.c @@ -6,6 +6,8 @@ #include "overlays/actors/ovl_En_Horse/z_en_horse.h" +#include "soh/frame_interpolation.h" + s16 Camera_ChangeSettingFlags(Camera* camera, s16 setting, s16 flags); s32 Camera_ChangeModeFlags(Camera* camera, s16 mode, u8 flags); s32 Camera_QRegInit(void); @@ -26,7 +28,7 @@ s32 Camera_CheckWater(Camera* camera); #define FLG_ADJSLOPE (1 << 0) #define FLG_OFFGROUND (1 << 7) -#include "z_camera_data.c" +#include "z_camera_data.inc" /*===============================================================*/ @@ -565,10 +567,10 @@ s16 Camera_XZAngle(Vec3f* to, Vec3f* from) { return DEGF_TO_BINANG(RADF_TO_DEGF(Math_FAtan2F(from->x - to->x, from->z - to->z))); } + f32 D_8015CE50; + f32 D_8015CE54; + CamColChk D_8015CE58; s16 func_80044ADC(Camera* camera, s16 yaw, s16 arg2) { - static f32 D_8015CE50; - static f32 D_8015CE54; - static CamColChk D_8015CE58; Vec3f playerPos; Vec3f rotatedPos; Vec3f floorNorm; @@ -6675,6 +6677,7 @@ s32 Camera_Special9(Camera* camera) { case 1: spec9->doorParams.timer1--; if (spec9->doorParams.timer1 <= 0) { + FrameInterpolation_DontInterpolateCamera(); camera->animState++; if (params->interfaceFlags & 1) { camPosData = Camera_GetCamBGData(camera); @@ -7221,9 +7224,9 @@ s32 Camera_DbgChangeMode(Camera* camera) { return true; } +s16 D_8011DB08 = 0x3F0; +s16 D_8011DB0C = 0x156; void func_80058E8C(Camera* camera) { - static s16 D_8011DB08 = 0x3F0; - static s16 D_8011DB0C = 0x156; s32 pad3; f32 sp60; s32 pad; @@ -7299,8 +7302,8 @@ void func_80058E8C(Camera* camera) { } } +s32 sOOBTimer = 0; Vec3s Camera_Update(Camera* camera) { - static s32 sOOBTimer = 0; Vec3f viewAt; Vec3f viewEye; Vec3f viewUp; @@ -7968,6 +7971,8 @@ s32 Camera_SetCSParams(Camera* camera, CutsceneCameraPoint* atPoints, CutsceneCa camera->speedRatio = 0.0f; } + FrameInterpolation_DontInterpolateCamera(); + return 1; } diff --git a/soh/src/code/z_camera_data.c b/soh/src/code/z_camera_data.inc similarity index 100% rename from soh/src/code/z_camera_data.c rename to soh/src/code/z_camera_data.inc diff --git a/soh/src/code/z_construct.c b/soh/src/code/z_construct.c index 2fd6d43ad..c74d3c14c 100644 --- a/soh/src/code/z_construct.c +++ b/soh/src/code/z_construct.c @@ -56,7 +56,8 @@ void func_801109B0(GlobalContext* globalCtx) { doActionOffset = 0x5700; } - memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), 0x300); + memcpy(interfaceCtx->doActionSegment, ResourceMgr_LoadTexByName(gAttackDoActionENGTex), 0x180); + memcpy(interfaceCtx->doActionSegment + 0x180, ResourceMgr_LoadTexByName(gCheckDoActionENGTex), 0x180); //DmaMgr_SendRequest1(interfaceCtx->doActionSegment, (uintptr_t)_do_action_staticSegmentRomStart + doActionOffset, 0x300, //"../z_construct.c", 174); @@ -462,7 +463,7 @@ void func_80111070(void) { WREG(28) = 0; R_OW_MINIMAP_X = 238; R_OW_MINIMAP_Y = 164; - R_MINIMAP_DISABLED = false; + R_MINIMAP_DISABLED = CVar_GetS32("gMinimalUI", 0); WREG(32) = 122; WREG(33) = 60; WREG(35) = 0; diff --git a/soh/src/code/z_demo.c b/soh/src/code/z_demo.c index d0145fb43..f6bb7d572 100644 --- a/soh/src/code/z_demo.c +++ b/soh/src/code/z_demo.c @@ -2105,7 +2105,7 @@ void Cutscene_HandleConditionalTriggers(GlobalContext* globalCtx) { } void Cutscene_SetSegment(GlobalContext* globalCtx, void* segment) { - if (SEGMENT_NUMBER(segment) != 0) + if (SEGMENT_NUMBER(segment) != 0) { globalCtx->csCtx.segment = SEGMENTED_TO_VIRTUAL(segment); } else { diff --git a/soh/src/code/z_eff_blure.c b/soh/src/code/z_eff_blure.c index e08f8f337..f3a1e6122 100644 --- a/soh/src/code/z_eff_blure.c +++ b/soh/src/code/z_eff_blure.c @@ -1,6 +1,8 @@ #include "global.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/frame_interpolation.h" + void EffectBlure_AddVertex(EffectBlure* this, Vec3f* p1, Vec3f* p2) { EffectBlureElement* elem; s32 numElements; @@ -946,6 +948,7 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { s32 j; s32 phi_t2; + FrameInterpolation_RecordOpenChild(this, 0); OPEN_DISPS(gfxCtx, "../z_eff_blure.c", 1596); gSPMatrix(POLY_XLU_DISP++, &gMtxClear, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); @@ -1059,4 +1062,5 @@ void EffectBlure_Draw(void* thisx, GraphicsContext* gfxCtx) { } CLOSE_DISPS(gfxCtx, "../z_eff_blure.c", 1823); + FrameInterpolation_RecordCloseChild(); } diff --git a/soh/src/code/z_eff_shield_particle.c b/soh/src/code/z_eff_shield_particle.c index fad499286..73134a654 100644 --- a/soh/src/code/z_eff_shield_particle.c +++ b/soh/src/code/z_eff_shield_particle.c @@ -2,6 +2,8 @@ #include "vt.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/frame_interpolation.h" + static Vtx sVertices[5] = { VTX(-32, -32, 0, 0, 1024, 0xFF, 0xFF, 0xFF, 0xFF), VTX(32, 32, 0, 1024, 0, 0xFF, 0xFF, 0xFF, 0xFF), @@ -154,6 +156,7 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { Color_RGBA8 primColor; Color_RGBA8 envColor; + FrameInterpolation_RecordOpenChild(this, 0); OPEN_DISPS(gfxCtx, "../z_eff_shield_particle.c", 272); if (this != NULL) { @@ -213,4 +216,5 @@ void EffectShieldParticle_Draw(void* thisx, GraphicsContext* gfxCtx) { } CLOSE_DISPS(gfxCtx, "../z_eff_shield_particle.c", 359); + FrameInterpolation_RecordCloseChild(); } diff --git a/soh/src/code/z_eff_spark.c b/soh/src/code/z_eff_spark.c index cfe8f628f..b76968371 100644 --- a/soh/src/code/z_eff_spark.c +++ b/soh/src/code/z_eff_spark.c @@ -1,6 +1,8 @@ #include "global.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/frame_interpolation.h" + // original name: "spark" void EffectSpark_Init(void* thisx, void* initParamsx) { EffectSpark* this = (EffectSpark*)thisx; @@ -152,6 +154,7 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { u8 sp1C4; f32 ratio; + FrameInterpolation_RecordOpenChild(this, 0); OPEN_DISPS(gfxCtx, "../z_eff_spark.c", 293); if (this != NULL) { @@ -274,4 +277,5 @@ void EffectSpark_Draw(void* thisx, GraphicsContext* gfxCtx) { end: CLOSE_DISPS(gfxCtx, "../z_eff_spark.c", 498); + FrameInterpolation_RecordCloseChild(); } diff --git a/soh/src/code/z_effect_soft_sprite.c b/soh/src/code/z_effect_soft_sprite.c index aa0b922fe..2548966cc 100644 --- a/soh/src/code/z_effect_soft_sprite.c +++ b/soh/src/code/z_effect_soft_sprite.c @@ -1,6 +1,8 @@ #include "global.h" #include "vt.h" +#include "soh/frame_interpolation.h" + EffectSsInfo sEffectSsInfo = { 0 }; // "EffectSS2Info" void EffectSs_InitInfo(GlobalContext* globalCtx, s32 tableSize) { @@ -233,6 +235,7 @@ void EffectSs_Spawn(GlobalContext* globalCtx, s32 type, s32 priority, void* init sEffectSsInfo.table[index].type = type; sEffectSsInfo.table[index].priority = priority; + sEffectSsInfo.table[index].epoch++; if (initInfo->init(globalCtx, index, &sEffectSsInfo.table[index], initParams) == 0) { osSyncPrintf(VT_FGCOL(GREEN)); @@ -284,7 +287,9 @@ void EffectSs_Draw(GlobalContext* globalCtx, s32 index) { EffectSs* effectSs = &sEffectSsInfo.table[index]; if (effectSs->draw != NULL) { + FrameInterpolation_RecordOpenChild(effectSs, effectSs->epoch); effectSs->draw(globalCtx, index, effectSs); + FrameInterpolation_RecordCloseChild(); } } diff --git a/soh/src/code/z_en_item00.c b/soh/src/code/z_en_item00.c index 2693c4b0f..d0179a5e1 100644 --- a/soh/src/code/z_en_item00.c +++ b/soh/src/code/z_en_item00.c @@ -5,6 +5,9 @@ #define FLAGS 0 +//Used to force variable to be used in different function, feel free to correct me if you have a better way +static s16 DroppedItemRot = 0; + void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx); void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx); @@ -355,11 +358,34 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { switch (this->actor.params) { case ITEM00_RUPEE_GREEN: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_RUPEE_BLUE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } case ITEM00_RUPEE_RED: - Actor_SetScale(&this->actor, 0.015f); - this->scale = 0.015f; - yOffset = 750.0f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.015f); + this->scale = 0.015f; + yOffset = 750.0f; + } break; case ITEM00_SMALL_KEY: this->unk_158 = 0; @@ -374,10 +400,18 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale = 0.02f; break; case ITEM00_HEART: - this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); - yOffset = 430.0f; - Actor_SetScale(&this->actor, 0.02f); - this->scale = 0.02f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); + yOffset = 25.0f; + Actor_SetScale(&this->actor, 0.3f); + this->scale = 0.3f; + shadowScale = 0.5f; + } else { + this->actor.home.rot.z = Rand_CenteredFloat(65535.0f); + yOffset = 430.0f; + Actor_SetScale(&this->actor, 0.02f); + this->scale = 0.02f; + } break; case ITEM00_HEART_CONTAINER: yOffset = 430.0f; @@ -386,42 +420,154 @@ void EnItem00_Init(Actor* thisx, GlobalContext* globalCtx) { this->scale = 0.02f; break; case ITEM00_ARROWS_SINGLE: - yOffset = 400.0f; - Actor_SetScale(&this->actor, 0.02f); - this->scale = 0.02f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + yOffset = 400.0f; + Actor_SetScale(&this->actor, 0.02f); + this->scale = 0.02f; + } + break; case ITEM00_ARROWS_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_ARROWS_MEDIUM: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_ARROWS_LARGE: - Actor_SetScale(&this->actor, 0.035f); - this->scale = 0.035f; - yOffset = 250.0f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.035f); + this->scale = 0.035f; + yOffset = 250.0f; + } + break; case ITEM00_BOMBS_A: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_BOMBS_B: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_NUTS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_STICK: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_MAGIC_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_SEEDS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + break; + } case ITEM00_BOMBS_SPECIAL: - Actor_SetScale(&this->actor, 0.03f); - this->scale = 0.03f; - yOffset = 320.0f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.03f); + this->scale = 0.03f; + yOffset = 320.0f; + } + break; case ITEM00_MAGIC_LARGE: - Actor_SetScale(&this->actor, 0.045 - 1e-10); - this->scale = 0.045 - 1e-10; - yOffset = 320.0f; - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.2f); + this->scale = 0.2f; + yOffset = 50.0f; + shadowScale = 0.5f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.045 - 1e-10); + this->scale = 0.045 - 1e-10; + yOffset = 320.0f; + } + break; case ITEM00_RUPEE_ORANGE: - Actor_SetScale(&this->actor, 0.045 - 1e-10); - this->scale = 0.045 - 1e-10; - yOffset = 750.0f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.45f); + this->scale = 0.45f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.045 - 1e-10); + this->scale = 0.045 - 1e-10; + yOffset = 750.0f; + } break; case ITEM00_RUPEE_PURPLE: - Actor_SetScale(&this->actor, 0.03f); - this->scale = 0.03f; - yOffset = 750.0f; + if (CVar_GetS32("gNewDrops", 0) !=0) { + Actor_SetScale(&this->actor, 0.4f); + this->scale = 0.4f; + yOffset = 50.0f; + shadowScale = 0.3f; + this->actor.world.rot.x = 0x4000; + } else { + Actor_SetScale(&this->actor, 0.03f); + this->scale = 0.03f; + yOffset = 750.0f; + } break; case ITEM00_FLEXIBLE: yOffset = 500.0f; @@ -558,6 +704,19 @@ void EnItem00_Destroy(Actor* thisx, GlobalContext* globalCtx) { } void func_8001DFC8(EnItem00* this, GlobalContext* globalCtx) { + + if (CVar_GetS32("gNewDrops", 0) !=0) { //set the rotation system on selected model only :) + if ((this->actor.params == ITEM_RUPEE_GOLD) || (this->actor.params == ITEM_RUPEE_PURPLE) || + (this->actor.params == ITEM00_ARROWS_SINGLE) || (this->actor.params == ITEM00_ARROWS_SMALL) || + (this->actor.params == ITEM00_ARROWS_MEDIUM) || (this->actor.params == ITEM00_ARROWS_LARGE) || + (this->actor.params == ITEM00_BOMBS_A) || (this->actor.params == ITEM00_BOMBS_B) || + (this->actor.params == ITEM00_NUTS) || (this->actor.params == ITEM00_STICK) || + (this->actor.params == ITEM00_MAGIC_SMALL) || (this->actor.params == ITEM00_SEEDS) || + (this->actor.params == ITEM00_MAGIC_LARGE) || (this->actor.params == ITEM00_HEART) || (this->actor.params == ITEM00_BOMBS_SPECIAL)) { + this->actor.shape.rot.y = DroppedItemRot; + } + } + if ((this->actor.params <= ITEM00_RUPEE_RED) || ((this->actor.params == ITEM00_HEART) && (this->unk_15A < 0)) || (this->actor.params == ITEM00_HEART_PIECE)) { this->actor.shape.rot.y += 960; @@ -731,6 +890,10 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { EnItem00* this = (EnItem00*)thisx; s32 pad; + if (CVar_GetS32("gNewDrops", 0) !=0) { //Update 3D Model rotation on frame update :) + DroppedItemRot += 100; + } + if (this->unk_15A > 0) { this->unk_15A--; } @@ -934,15 +1097,35 @@ void EnItem00_Update(Actor* thisx, GlobalContext* globalCtx) { void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { EnItem00* this = (EnItem00*)thisx; f32 mtxScale; - + if (!(this->unk_156 & this->unk_158)) { switch (this->actor.params) { case ITEM00_RUPEE_GREEN: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_GREEN); + break; + } case ITEM00_RUPEE_BLUE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_BLUE); + break; + } case ITEM00_RUPEE_RED: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_RED); + break; + } case ITEM00_RUPEE_ORANGE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_GOLD); + break; + } case ITEM00_RUPEE_PURPLE: - EnItem00_DrawRupee(this, globalCtx); + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_RUPEE_PURPLE); + } else { + EnItem00_DrawRupee(this, globalCtx); + } break; case ITEM00_HEART_PIECE: EnItem00_DrawHeartPiece(this, globalCtx); @@ -951,34 +1134,85 @@ void EnItem00_Draw(Actor* thisx, GlobalContext* globalCtx) { EnItem00_DrawHeartContainer(this, globalCtx); break; case ITEM00_HEART: - if (this->unk_15A < 0) { - if (this->unk_15A == -1) { - s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); - - if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { - this->actor.objBankIndex = bankIndex; - Actor_SetObjectDependency(globalCtx, &this->actor); - this->unk_15A = -2; - } - } else { - mtxScale = 16.0f; - Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); - GetItem_Draw(globalCtx, GID_HEART); - } - break; + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_HEART); + mtxScale = 16.0f; + Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); + break; + } else { + if (this->unk_15A < 0) { + if (this->unk_15A == -1) { + s8 bankIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_GI_HEART); + + if (Object_IsLoaded(&globalCtx->objectCtx, bankIndex)) { + this->actor.objBankIndex = bankIndex; + Actor_SetObjectDependency(globalCtx, &this->actor); + this->unk_15A = -2; + } + } else { + mtxScale = 16.0f; + Matrix_Scale(mtxScale, mtxScale, mtxScale, MTXMODE_APPLY); + GetItem_Draw(globalCtx, GID_HEART); + } + break; + } } case ITEM00_BOMBS_A: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_BOMB); + break; + } case ITEM00_BOMBS_B: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_BOMB); + break; + } case ITEM00_BOMBS_SPECIAL: case ITEM00_ARROWS_SINGLE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_SMALL); + break; + } case ITEM00_ARROWS_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_SMALL); + break; + } case ITEM00_ARROWS_MEDIUM: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_MEDIUM); + break; + } case ITEM00_ARROWS_LARGE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_ARROWS_LARGE); + break; + } case ITEM00_NUTS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_NUTS); + break; + } case ITEM00_STICK: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_STICK); + break; + } case ITEM00_MAGIC_LARGE: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_MAGIC_LARGE); + break; + } case ITEM00_MAGIC_SMALL: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_MAGIC_SMALL); + break; + } case ITEM00_SEEDS: + if (CVar_GetS32("gNewDrops", 0) !=0) { + GetItem_Draw(globalCtx, GID_SEEDS); + break; + } case ITEM00_SMALL_KEY: EnItem00_DrawCollectible(this, globalCtx); break; diff --git a/soh/src/code/z_fbdemo_circle.c b/soh/src/code/z_fbdemo_circle.c index 630f198d1..5c8f688fa 100644 --- a/soh/src/code/z_fbdemo_circle.c +++ b/soh/src/code/z_fbdemo_circle.c @@ -19,9 +19,9 @@ Gfx __sCircleDList[] = { G_AC_NONE | G_ZS_PIXEL | G_RM_XLU_SURF | G_RM_XLU_SURF2), // 4 gsDPSetCombineMode(G_CC_BLENDPEDECALA, G_CC_BLENDPEDECALA), // 5 gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON), // 6 - gsDPLoadTextureBlock(0xF8000000, G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, // 7 + gsDPLoadTextureBlock(SEG_ADDR(8, 0), G_IM_FMT_I, G_IM_SIZ_8b, 16, 64, 0, G_TX_NOMIRROR | G_TX_WRAP, // 7 G_TX_NOMIRROR | G_TX_CLAMP, 4, 6, G_TX_NOLOD, G_TX_NOLOD), - gsSPDisplayList(0xF9000000), // 8 + gsSPDisplayList(SEG_ADDR(9, 0)), // 8 gsSPVertex(sCircleWipeVtx, 32, 0), // 9 gsSP2Triangles(0, 1, 2, 0, 1, 3, 4, 0), // 10 gsSP2Triangles(3, 5, 6, 0, 5, 7, 8, 0), // 11 @@ -56,8 +56,6 @@ void TransitionCircle_Start(void* thisx) { break; } - this->texture = ResourceMgr_LoadTexByName(this->texture); - if (this->speed == 0) { this->step = 0x14; } else { @@ -147,8 +145,6 @@ void TransitionCircle_Draw(void* thisx, Gfx** gfxP) { modelView = this->modelView[this->frame]; - this->color.rgba = 0xFFFFFFFF; - this->frame ^= 1; gDPPipeSync(gfx++); texScroll = Gfx_BranchTexScroll(&gfx, this->texX, this->texY, 0x10, 0x40); diff --git a/soh/src/code/z_kankyo.c b/soh/src/code/z_kankyo.c index 90194835e..9f7518374 100644 --- a/soh/src/code/z_kankyo.c +++ b/soh/src/code/z_kankyo.c @@ -226,6 +226,9 @@ u16 Environment_GetPixelDepth(s32 x, s32 y) { void Environment_GraphCallback(GraphicsContext* gfxCtx, void* param) { GlobalContext* globalCtx = (GlobalContext*)param; + OTRGetPixelDepthPrepare(D_8015FD7E, D_8015FD80); + Lights_GlowCheckPrepare(globalCtx); + D_8011FB44 = Environment_GetPixelDepth(D_8015FD7E, D_8015FD80); Lights_GlowCheck(globalCtx); } @@ -677,7 +680,9 @@ void Environment_UpdateSkybox(GlobalContext* globalCtx, u8 skyboxId, Environment SkyboxTableEntry entryA = sSkyboxTable[newSkybox1Index]; for (int i = 0; i < 5; i++) - LoadSkyboxTex(globalCtx, skyboxCtx, 0, i, entryA.textures[i], 128, i == 4 ? 128 : 64, 128, 64); + LoadSkyboxTex(skyboxCtx, 0, i, entryA.textures[i], 128, i == 4 ? 128 : 64, 128, 64); + + Skybox_Update(skyboxCtx); envCtx->skybox1Index = newSkybox1Index; @@ -695,7 +700,9 @@ void Environment_UpdateSkybox(GlobalContext* globalCtx, u8 skyboxId, Environment SkyboxTableEntry entryA = sSkyboxTable[newSkybox2Index]; for (int i = 0; i < 5; i++) - LoadSkyboxTex(globalCtx, skyboxCtx, 1, i, entryA.textures[i], 128, i == 4 ? 128 : 64, 128, 64); + LoadSkyboxTex(skyboxCtx, 1, i, entryA.textures[i], 128, i == 4 ? 128 : 64, 128, 64); + + Skybox_Update(skyboxCtx); envCtx->skybox2Index = newSkybox2Index; @@ -712,7 +719,7 @@ void Environment_UpdateSkybox(GlobalContext* globalCtx, u8 skyboxId, Environment if ((newSkybox1Index & 1) ^ ((newSkybox1Index & 4) >> 2)) { SkyboxTableEntry entryA = sSkyboxTable[newSkybox1Index]; - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, entryA.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 0, entryA.palettes[0], 16, 8); //size = gSkyboxFiles[newSkybox1Index].palette.vromEnd - gSkyboxFiles[newSkybox1Index].palette.vromStart; //osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); @@ -721,7 +728,7 @@ void Environment_UpdateSkybox(GlobalContext* globalCtx, u8 skyboxId, Environment //"../z_kankyo.c", 1307); } else { SkyboxTableEntry entryA = sSkyboxTable[newSkybox1Index]; - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, entryA.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 1, entryA.palettes[0], 16, 8); //size = gSkyboxFiles[newSkybox1Index].palette.vromEnd - gSkyboxFiles[newSkybox1Index].palette.vromStart; //osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); @@ -729,25 +736,27 @@ void Environment_UpdateSkybox(GlobalContext* globalCtx, u8 skyboxId, Environment //gSkyboxFiles[newSkybox1Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, //"../z_kankyo.c", 1320); } + + Skybox_Update(skyboxCtx); } if (envCtx->skyboxDmaState == SKYBOX_DMA_FILE2_DONE) { envCtx->skyboxDmaState = SKYBOX_DMA_PAL2_START; - if ((newSkybox2Index & 1) ^ ((newSkybox2Index & 4) >> 2)) + if ((newSkybox2Index & 1) ^ ((newSkybox2Index & 4) >> 2)) { SkyboxTableEntry entryA = sSkyboxTable[newSkybox2Index]; - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, entryA.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 0, entryA.palettes[0], 16, 8); /*size = gSkyboxFiles[newSkybox2Index].palette.vromEnd - gSkyboxFiles[newSkybox2Index].palette.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); DmaMgr_SendRequest2(&envCtx->dmaRequest, (uintptr_t)skyboxCtx->palettes, gSkyboxFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, "../z_kankyo.c", 1342);*/ - } else + } else { SkyboxTableEntry entryA = sSkyboxTable[newSkybox2Index]; - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, entryA.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 1, entryA.palettes[0], 16, 8); /*size = gSkyboxFiles[newSkybox2Index].palette.vromEnd - gSkyboxFiles[newSkybox2Index].palette.vromStart; osCreateMesgQueue(&envCtx->loadQueue, &envCtx->loadMsg, 1); @@ -755,15 +764,17 @@ void Environment_UpdateSkybox(GlobalContext* globalCtx, u8 skyboxId, Environment gSkyboxFiles[newSkybox2Index].palette.vromStart, size, 0, &envCtx->loadQueue, NULL, "../z_kankyo.c", 1355);*/ } + + Skybox_Update(skyboxCtx); } if ((envCtx->skyboxDmaState == SKYBOX_DMA_FILE1_START) || (envCtx->skyboxDmaState == SKYBOX_DMA_FILE2_START)) { - //if (osRecvMesg(&envCtx->loadQueue, 0, OS_MESG_NOBLOCK) == 0) + //if (osRecvMesg(&envCtx->loadQueue, 0, OS_MESG_NOBLOCK) == 0) { envCtx->skyboxDmaState++; } } else if (envCtx->skyboxDmaState >= SKYBOX_DMA_FILE1_DONE) { - //if (osRecvMesg(&envCtx->loadQueue, 0, OS_MESG_NOBLOCK) == 0) + //if (osRecvMesg(&envCtx->loadQueue, 0, OS_MESG_NOBLOCK) == 0) { envCtx->skyboxDmaState = SKYBOX_DMA_INACTIVE; } @@ -2264,6 +2275,29 @@ Color_RGB8 sSandstormEnvColors[] = { { 50, 40, 0 }, }; +Gfx* gFieldSandstormDL_Custom = NULL; + +void Environment_PatchSandstorm(GlobalContext* globalCtx) { + if (gFieldSandstormDL_Custom) return; + + gFieldSandstormDL_Custom = ResourceMgr_PatchGfxByName(gFieldSandstormDL, -3); + + const Gfx gFSPatchDL[2] = { gsSPEndDisplayList() }; + bool patched = false; + Gfx* cmd = gFieldSandstormDL_Custom; + int id = 0; + + while (!patched) { + const uint32_t opcode = cmd->words.w0 >> 24; + if (opcode == G_TEXRECT) { + gFieldSandstormDL_Custom[id] = gFSPatchDL[0]; + patched = true; + } + ++cmd; + id++; + } +} + void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState) { s32 primA1; s32 envA1; @@ -2277,6 +2311,8 @@ void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState) { u16 sp94; u16 sp92; + Environment_PatchSandstorm(globalCtx); + switch (sandstormState) { case 3: if ((globalCtx->sceneNum == SCENE_SPOT13) && (globalCtx->roomCtx.curRoom.num == 0)) { @@ -2383,8 +2419,11 @@ void Environment_DrawSandstorm(GlobalContext* globalCtx, u8 sandstormState) { Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, (u32)sp96 % 0x1000, 0, 0x200, 0x20, 1, (u32)sp94 % 0x1000, 0xFFF - ((u32)sp92 % 0x1000), 0x100, 0x40)); gDPSetTextureLUT(POLY_XLU_DISP++, G_TT_NONE); - gSPDisplayList(POLY_XLU_DISP++, gFieldSandstormDL); + gSPDisplayList(POLY_XLU_DISP++, gFieldSandstormDL_Custom); + gSPWideTextureRectangle(POLY_XLU_DISP++, OTRGetRectDimensionFromLeftEdge(0) << 2, 0, + OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH) << 2, 0x03C0, G_TX_RENDERTILE, 0, 0, 0x008C, + -0x008C); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_kankyo.c", 4068); D_8015FDB0 += (s32)sp98; diff --git a/soh/src/code/z_lights.c b/soh/src/code/z_lights.c index 2c7140c73..bee677276 100644 --- a/soh/src/code/z_lights.c +++ b/soh/src/code/z_lights.c @@ -4,6 +4,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/frame_interpolation.h" + #define LIGHTS_BUFFER_SIZE 32 //#define LIGHTS_BUFFER_SIZE 1024 // Kill me @@ -323,6 +325,44 @@ Lights* Lights_New(GraphicsContext* gfxCtx, u8 ambientR, u8 ambientG, u8 ambient return lights; } +void Lights_GlowCheckPrepare(GlobalContext* globalCtx) { + LightNode* node; + LightPoint* params; + Vec3f pos; + Vec3f multDest; + f32 wDest; + f32 wX; + f32 wY; + + node = globalCtx->lightCtx.listHead; + + while (node != NULL) { + params = &node->info->params.point; + + if (node->info->type == LIGHT_POINT_GLOW) { + f32 x, y; + u32 shrink; + uint32_t height; + + pos.x = params->x; + pos.y = params->y; + pos.z = params->z; + func_8002BE04(globalCtx, &pos, &multDest, &wDest); + wX = multDest.x * wDest; + wY = multDest.y * wDest; + + x = wX * 160 + 160; + y = wY * 120 + 120; + shrink = ShrinkWindow_GetCurrentVal(); + + if ((multDest.z > 1.0f) && y >= shrink && y <= SCREEN_HEIGHT - shrink) { + OTRGetPixelDepthPrepare(x, y); + } + } + node = node->next; + } +} + void Lights_GlowCheck(GlobalContext* globalCtx) { LightNode* node; LightPoint* params; @@ -396,12 +436,14 @@ void Lights_DrawGlow(GlobalContext* globalCtx) { if ((info->type == LIGHT_POINT_GLOW) && (params->drawGlow)) { scale = SQ(params->radius) * 0.0000026f; + FrameInterpolation_RecordOpenChild(node, 0); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, params->color[0], params->color[1], params->color[2], 50); Matrix_Translate(params->x, params->y, params->z, MTXMODE_NEW); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_lights.c", 918), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gGlowCircleDL); + FrameInterpolation_RecordCloseChild(); } node = node->next; diff --git a/soh/src/code/z_map_exp.c b/soh/src/code/z_map_exp.c index 734209770..e97a1a1a5 100644 --- a/soh/src/code/z_map_exp.c +++ b/soh/src/code/z_map_exp.c @@ -664,6 +664,7 @@ void Minimap_Draw(GlobalContext* globalCtx) { if (CHECK_DUNGEON_ITEM(DUNGEON_MAP, mapIndex)) { gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 255, 255, interfaceCtx->minimapAlpha); + gSPInvalidateTexCache(OVERLAY_DISP++, interfaceCtx->mapSegment); gDPLoadTextureBlock_4b(OVERLAY_DISP++, interfaceCtx->mapSegment, G_IM_FMT_I, 96, 85, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -736,21 +737,33 @@ void Minimap_Draw(GlobalContext* globalCtx) { if (((globalCtx->sceneNum != SCENE_SPOT01) && (globalCtx->sceneNum != SCENE_SPOT04) && (globalCtx->sceneNum != SCENE_SPOT08)) || (LINK_AGE_IN_YEARS != YEARS_ADULT)) { + s16 IconSize = 8; + s16 PosX = gMapData->owEntranceIconPosX[sEntranceIconMapIndex]; + s16 PosY = gMapData->owEntranceIconPosY[sEntranceIconMapIndex]; + //gFixDungeonMinimapIcon fix both Y position of visible icon and hide these non needed. + if (CVar_GetS32("gFixDungeonMinimapIcon", 1) != 0){ + //No idea why and how Original value work but this does actually fix them all. + PosY = PosY+1024; + } + s16 TopLeftX = OTRGetRectDimensionFromRightEdge(PosX) << 2; + s16 TopLeftY = PosY << 2; + s16 TopLeftW = OTRGetRectDimensionFromRightEdge(PosX + IconSize) << 2; + s16 TopLeftH = (PosY + IconSize) << 2; if ((gMapData->owEntranceFlag[sEntranceIconMapIndex] == 0xFFFF) || ((gMapData->owEntranceFlag[sEntranceIconMapIndex] != 0xFFFF) && (gSaveContext.infTable[26] & gBitFlags[gMapData->owEntranceFlag[mapIndex]]))) { - + if (gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2 != 0 && CVar_GetS32("gFixDungeonMinimapIcon", 1) != 0){ + gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, + IconSize, IconSize, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gSPWideTextureRectangle(OVERLAY_DISP++, TopLeftX, TopLeftY, TopLeftW, TopLeftH, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } + } else if (CVar_GetS32("gAlwaysShowDungeonMinimapIcon", 0) != 0){ //Ability to show entrance Before beating the dungeon itself gDPLoadTextureBlock(OVERLAY_DISP++, gMapDungeonEntranceIconTex, G_IM_FMT_RGBA, G_IM_SIZ_16b, - 8, 8, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, + IconSize, IconSize, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); - - gSPWideTextureRectangle(OVERLAY_DISP++, - OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex]) << 2, - gMapData->owEntranceIconPosY[sEntranceIconMapIndex] << 2, - OTRGetRectDimensionFromLeftEdge(gMapData->owEntranceIconPosX[sEntranceIconMapIndex] + 8) << 2, - (gMapData->owEntranceIconPosY[sEntranceIconMapIndex] + 8) << 2, - G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - } + gSPWideTextureRectangle(OVERLAY_DISP++, TopLeftX, TopLeftY, TopLeftW, TopLeftH, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + } } if ((globalCtx->sceneNum == SCENE_SPOT08) && (gSaveContext.infTable[26] & gBitFlags[9])) { diff --git a/soh/src/code/z_map_mark.c b/soh/src/code/z_map_mark.c index f5a8a3c39..8d43a33a0 100644 --- a/soh/src/code/z_map_mark.c +++ b/soh/src/code/z_map_mark.c @@ -52,7 +52,7 @@ static MapMarkDataOverlay sMapMarkDataOvl = { gMapMarkDataTable, }; -static MapMarkData** sLoadedMarkDataTable; +MapMarkData** sLoadedMarkDataTable; void MapMark_Init(GlobalContext* globalCtx) { MapMarkDataOverlay* overlay = &sMapMarkDataOvl; diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 4979f047c..ffb0581c7 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -33,47 +33,12 @@ s16 sMessageHasSetSfx = false; u16 sOcarinaSongBitFlags = 0; // ocarina bit flags MessageTableEntry* sNesMessageEntryTablePtr; +MessageTableEntry* sGerMessageEntryTablePtr; +MessageTableEntry* sFraMessageEntryTablePtr; MessageTableEntry* sStaffMessageEntryTablePtr; char* _message_0xFFFC_nes; -//MessageTableEntry sNesMessageEntryTable[] = { -//#define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) \ -// { textId, (_SHIFTL(type, 4, 8) | _SHIFTL(yPos, 0, 8)), _message_##textId##_nes }, -//#define DEFINE_MESSAGE_FFFC -//#include "text/message_data.h" -//#undef DEFINE_MESSAGE_FFFC -//#undef DEFINE_MESSAGE -// { 0xFFFF, 0, NULL }, -//}; -// -//const char* sGerMessageEntryTable[] = { -//#define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) _message_##textId##_ger, -//#include "text/message_data.h" -//#undef DEFINE_MESSAGE -// NULL, -//}; -// -//const char* sFraMessageEntryTable[] = { -//#define DEFINE_MESSAGE(textId, type, yPos, nesMessage, gerMessage, fraMessage) _message_##textId##_fra, -//#include "text/message_data.h" -//#undef DEFINE_MESSAGE -// NULL, -//}; -// -//MessageTableEntry sStaffMessageEntryTable[] = { -//#define DEFINE_MESSAGE(textId, type, yPos, staffMessage) \ -// { textId, (_SHIFTL(type, 4, 8) | _SHIFTL(yPos, 0, 8)), _message_##textId##_staff }, -//#include "text/message_data_staff.h" -//#undef DEFINE_MESSAGE -// { 0xFFFF, 0, NULL }, -//}; - -//MessageTableEntry* sNesMessageEntryTablePtr = sNesMessageEntryTable; -//const char** sGerMessageEntryTablePtr = sGerMessageEntryTable; -//const char** sFraMessageEntryTablePtr = sFraMessageEntryTable; -//MessageTableEntry* sStaffMessageEntryTablePtr = sStaffMessageEntryTable; - s16 sTextboxBackgroundForePrimColors[][3] = { { 255, 255, 255 }, { 50, 20, 0 }, { 255, 60, 0 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, { 255, 255, 255 }, @@ -166,7 +131,7 @@ void Message_UpdateOcarinaGame(GlobalContext* globalCtx) { u8 Message_ShouldAdvance(GlobalContext* globalCtx) { Input* input = &globalCtx->state.input[0]; - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); if (CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP)) { @@ -178,7 +143,7 @@ u8 Message_ShouldAdvance(GlobalContext* globalCtx) { u8 Message_ShouldAdvanceSilent(GlobalContext* globalCtx) { Input* input = &globalCtx->state.input[0]; - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) : CHECK_BTN_ALL(input->press.button, BTN_B); return CHECK_BTN_ALL(input->press.button, BTN_A) || isB_Held || CHECK_BTN_ALL(input->press.button, BTN_CUP); @@ -203,8 +168,9 @@ void Message_HandleChoiceSelection(GlobalContext* globalCtx, u8 numChoices) { static s16 sAnalogStickHeld = false; MessageContext* msgCtx = &globalCtx->msgCtx; Input* input = &globalCtx->state.input[0]; + bool dpad = CVar_GetS32("gDpadOcarinaText", 0); - if (input->rel.stick_y >= 30 && !sAnalogStickHeld) { + if ((input->rel.stick_y >= 30 && !sAnalogStickHeld) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { sAnalogStickHeld = true; msgCtx->choiceIndex--; if (msgCtx->choiceIndex > 128) { @@ -212,7 +178,7 @@ void Message_HandleChoiceSelection(GlobalContext* globalCtx, u8 numChoices) { } else { Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } - } else if (input->rel.stick_y <= -30 && !sAnalogStickHeld) { + } else if ((input->rel.stick_y <= -30 && !sAnalogStickHeld) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { sAnalogStickHeld = true; msgCtx->choiceIndex++; if (msgCtx->choiceIndex > numChoices) { @@ -234,8 +200,6 @@ void Message_DrawTextChar(GlobalContext* globalCtx, void* textureImage, Gfx** p) s16 x = msgCtx->textPosX; s16 y = msgCtx->textPosY; - //gSPInvalidateTexCache(gfx++, 0); - //gSPInvalidateTexCache(gfx++, msgCtx->textboxSegment); gSPInvalidateTexCache(gfx++, textureImage); gDPPipeSync(gfx++); @@ -309,69 +273,46 @@ void Message_FindMessage(GlobalContext* globalCtx, u16 textId) { Font* font; const char* seg; - - if (gSaveContext.language == LANGUAGE_ENG) { - seg = messageTableEntry->segment; + if (gSaveContext.language == LANGUAGE_GER) + messageTableEntry = sGerMessageEntryTablePtr; + else if (gSaveContext.language == LANGUAGE_FRA) + messageTableEntry = sFraMessageEntryTablePtr; - while (messageTableEntry->textId != 0xFFFF) { - font = &globalCtx->msgCtx.font; + // If PAL languages are not present in the OTR file, default to English + if (messageTableEntry == NULL) + messageTableEntry = sNesMessageEntryTablePtr; - if (messageTableEntry->textId == textId) { - foundSeg = messageTableEntry->segment; - font->charTexBuf[0] = messageTableEntry->typePos; - //messageTableEntry++; - nextSeg = messageTableEntry->segment; - font->msgOffset = messageTableEntry->segment; - font->msgLength = messageTableEntry->msgSize; - // "Message found!!!" - osSyncPrintf(" メッセージãŒ,見ã¤ã‹ã£ãŸï¼ï¼ï¼ = %x " - "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", - textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); - return; - } - messageTableEntry++; - } - } else { - //languageSegmentTable = (gSaveContext.language == LANGUAGE_GER) ? sGerMessageEntryTablePtr : sFraMessageEntryTablePtr; // OTRTODO - seg = messageTableEntry->segment; - - while (messageTableEntry->textId != 0xFFFF) { - font = &globalCtx->msgCtx.font; - - if (messageTableEntry->textId == textId) { - foundSeg = *languageSegmentTable; - font->charTexBuf[0] = messageTableEntry->typePos; - languageSegmentTable++; - nextSeg = *languageSegmentTable; - font->msgOffset = foundSeg - seg; - font->msgLength = nextSeg - foundSeg; - // "Message found!!!" - osSyncPrintf(" メッセージãŒ,見ã¤ã‹ã£ãŸï¼ï¼ï¼ = %x " - "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", - textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); - return; - } - messageTableEntry++; - languageSegmentTable++; + seg = messageTableEntry->segment; + + while (messageTableEntry->textId != 0xFFFF) { + font = &globalCtx->msgCtx.font; + + if (messageTableEntry->textId == textId) { + foundSeg = messageTableEntry->segment; + font->charTexBuf[0] = messageTableEntry->typePos; + + nextSeg = messageTableEntry->segment; + font->msgOffset = messageTableEntry->segment; + font->msgLength = messageTableEntry->msgSize; + + // "Message found!!!" + osSyncPrintf(" メッセージãŒ,見ã¤ã‹ã£ãŸï¼ï¼ï¼ = %x " + "(data=%x) (data0=%x) (data1=%x) (data2=%x) (data3=%x)\n", + textId, font->msgOffset, font->msgLength, foundSeg, seg, nextSeg); + return; } + messageTableEntry++; } + // "Message not found!!!" osSyncPrintf(" メッセージãŒ,見ã¤ã‹ã‚‰ãªã‹ã£ãŸï¼ï¼ï¼ = %x\n", textId); font = &globalCtx->msgCtx.font; messageTableEntry = sNesMessageEntryTablePtr; - if (gSaveContext.language == LANGUAGE_ENG) { - foundSeg = messageTableEntry->segment; - font->charTexBuf[0] = messageTableEntry->typePos; - messageTableEntry++; - nextSeg = messageTableEntry->segment; - } else { - //languageSegmentTable = (gSaveContext.language == LANGUAGE_GER) ? sGerMessageEntryTablePtr : sFraMessageEntryTablePtr; // OTRTODO - foundSeg = *languageSegmentTable; - font->charTexBuf[0] = messageTableEntry->typePos; - languageSegmentTable++; - nextSeg = *languageSegmentTable; - } + foundSeg = messageTableEntry->segment; + font->charTexBuf[0] = messageTableEntry->typePos; + messageTableEntry++; + nextSeg = messageTableEntry->segment; font->msgOffset = foundSeg - seg; font->msgLength = nextSeg - foundSeg; } @@ -390,7 +331,6 @@ void Message_FindCreditsMessage(GlobalContext* globalCtx, u16 textId) { if (messageTableEntry->textId == textId) { foundSeg = messageTableEntry->segment; font->charTexBuf[0] = messageTableEntry->typePos; - messageTableEntry++; nextSeg = messageTableEntry->segment; font->msgOffset = messageTableEntry->segment; font->msgLength = messageTableEntry->msgSize; @@ -1060,7 +1000,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { msgCtx->textDelay = msgCtx->msgBufDecoded[++i]; break; case MESSAGE_UNSKIPPABLE: - msgCtx->textUnskippable = CVar_GetS32("gFastText", 0) != 1; + msgCtx->textUnskippable = CVar_GetS32("gSkipText", 0) != 1; break; case MESSAGE_TWO_CHOICE: msgCtx->textboxEndType = TEXTBOX_ENDTYPE_2_CHOICE; @@ -1095,6 +1035,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { *gfxP = gfx; return; case MESSAGE_OCARINA: + msgCtx->textDrawPos = i + 1; if (i + 1 == msgCtx->textDrawPos) { Message_HandleOcarina(globalCtx); *gfxP = gfx; @@ -1143,7 +1084,7 @@ void Message_DrawText(GlobalContext* globalCtx, Gfx** gfxP) { } } if (msgCtx->textDelayTimer == 0) { - msgCtx->textDrawPos = i + 1; + msgCtx->textDrawPos = i + CVar_GetS32("gTextSpeed", 1); msgCtx->textDelayTimer = msgCtx->textDelay; } else { msgCtx->textDelayTimer--; @@ -1638,26 +1579,10 @@ void Message_OpenText(GlobalContext* globalCtx, u16 textId) { //DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)(_staff_message_data_staticSegmentRomStart + 4 + font->msgOffset), //font->msgLength, "../z_message_PAL.c", 1954); } else { - if (gSaveContext.language == LANGUAGE_ENG) - { - Message_FindMessage(globalCtx, textId); - msgCtx->msgLength = font->msgLength; - char* src = (uintptr_t)font->msgOffset; - memcpy(font->msgBuf, src, font->msgLength); - } else if (gSaveContext.language == LANGUAGE_GER) { - // OTRTODO - //Message_FindMessage(globalCtx, textId); - //msgCtx->msgLength = font->msgLength; - //DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)(_ger_message_data_staticSegmentRomStart + font->msgOffset), - //font->msgLength, "../z_message_PAL.c", 1978); - } else - { - // OTRTODO - //Message_FindMessage(globalCtx, textId); - //msgCtx->msgLength = font->msgLength; - //DmaMgr_SendRequest1(font->msgBuf, (uintptr_t)(_fra_message_data_staticSegmentRomStart + font->msgOffset), - //font->msgLength, "../z_message_PAL.c", 1990); - } + Message_FindMessage(globalCtx, textId); + msgCtx->msgLength = font->msgLength; + char* src = (uintptr_t)font->msgOffset; + memcpy(font->msgBuf, src, font->msgLength); } msgCtx->textBoxProperties = font->charTexBuf[0]; @@ -2025,7 +1950,7 @@ void Message_DrawMain(GlobalContext* globalCtx, Gfx** p) { gDPSetCombineLERP(gfx++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0); - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(globalCtx->state.input[0].cur.button, BTN_B) + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(globalCtx->state.input[0].cur.button, BTN_B) : CHECK_BTN_ALL(globalCtx->state.input[0].press.button, BTN_B); switch (msgCtx->msgMode) { @@ -3032,7 +2957,7 @@ void Message_Update(GlobalContext* globalCtx) { Input* input = &globalCtx->state.input[0]; s16 var; s16 focusScreenPosX; - s16 averageY; + s16 averageY = 0; s16 playerFocusScreenPosY; s16 actorFocusScreenPosY; @@ -3066,7 +2991,7 @@ void Message_Update(GlobalContext* globalCtx) { return; } - bool isB_Held = CVar_GetS32("gFastText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped + bool isB_Held = CVar_GetS32("gSkipText", 0) != 0 ? CHECK_BTN_ALL(input->cur.button, BTN_B) && !sTextboxSkipped : CHECK_BTN_ALL(input->press.button, BTN_B); switch (msgCtx->msgMode) { diff --git a/soh/src/code/z_onepointdemo.c b/soh/src/code/z_onepointdemo.c index 96ef33c18..538859764 100644 --- a/soh/src/code/z_onepointdemo.c +++ b/soh/src/code/z_onepointdemo.c @@ -4,9 +4,9 @@ static s16 sDisableAttention = false; static s16 sUnused = -1; -static s32 sPrevFrameCs1100 = -4096; +s32 sPrevFrameCs1100 = -4096; -#include "z_onepointdemo_data.c" +#include "z_onepointdemo_data.inc" void OnePointCutscene_AddVecSphToVec3f(Vec3f* dst, Vec3f* src, VecSph* vecSph) { Vec3f out; diff --git a/soh/src/code/z_onepointdemo_data.c b/soh/src/code/z_onepointdemo_data.inc similarity index 96% rename from soh/src/code/z_onepointdemo_data.c rename to soh/src/code/z_onepointdemo_data.inc index 1d1838b05..2488be71b 100644 --- a/soh/src/code/z_onepointdemo_data.c +++ b/soh/src/code/z_onepointdemo_data.inc @@ -1,6 +1,6 @@ #include "global.h" -static CutsceneCameraPoint D_8012013C[14] = { +CutsceneCameraPoint D_8012013C[14] = { { CS_CMD_CONTINUE, 25, 40, 70.79991f, { -1814, 533, -1297 } }, { CS_CMD_CONTINUE, 20, 40, 70.99991f, { -1805, 434, -1293 } }, { CS_CMD_CONTINUE, 10, 30, 60.0f, { -1794, 323, -1280 } }, @@ -16,7 +16,7 @@ static CutsceneCameraPoint D_8012013C[14] = { { CS_CMD_STOP, 0, 50, 60.0f, { -1974, 12, -1179 } }, { CS_CMD_STOP, 0, 30, 60.0f, { -1974, 12, -1179 } }, }; -static CutsceneCameraPoint D_8012021C[14] = { +CutsceneCameraPoint D_8012021C[14] = { { CS_CMD_CONTINUE, 0, 0, 60.0f, { -1751, 604, -1233 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { -1752, 516, -1233 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { -1751, 417, -1233 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { -1767, 306, -1219 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { -1776, 257, -1205 } }, { CS_CMD_CONTINUE, 0, 0, 60.0f, { -1881, 147, -1149 } }, @@ -54,7 +54,7 @@ static CutsceneCameraPoint D_80120434[10] = { { CS_CMD_STOP, 0, 0, 60.0f, { 0, 62, -119 } }, { CS_CMD_STOP, 0, 0, 60.0f, { 0, 62, -119 } }, }; -static CutsceneCameraPoint D_801204D4[14] = { +CutsceneCameraPoint D_801204D4[14] = { { CS_CMD_CONTINUE, -15, 40, 80.600006f, { -60, 332, 183 } }, { CS_CMD_CONTINUE, -22, 30, 80.600006f, { -60, 332, 183 } }, { CS_CMD_CONTINUE, -20, 38, 80.600006f, { -118, 344, 41 } }, @@ -70,7 +70,7 @@ static CutsceneCameraPoint D_801204D4[14] = { { CS_CMD_STOP, 6, 30, 85.199936f, { 25, 127, -950 } }, { CS_CMD_STOP, 0, 30, 85.199936f, { 25, 127, -950 } }, }; -static CutsceneCameraPoint D_801205B4[14] = { +CutsceneCameraPoint D_801205B4[14] = { { CS_CMD_CONTINUE, 0, 0, 60.0f, { -225, 785, -242 } }, { CS_CMD_CONTINUE, -21, 0, 80.600006f, { -245, 784, -242 } }, { CS_CMD_CONTINUE, -21, 0, 80.600006f, { -288, 485, -379 } }, @@ -118,18 +118,18 @@ static s16 D_801208E0 = 12; static s16 D_801208E4 = 90; static s16 D_801208E8 = 8; -static OnePointCsFull D_801208EC[3] = { +OnePointCsFull D_801208EC[3] = { { 0x0F, 0x08, 0x0101, 1, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x81, 0xFF, 0x0101, 1, 0, 60.0f, 1.0f, { 0.0f, -10.0f, 0.0f }, { 0.0f, 0.0f, 150.0f } }, { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80120964[2] = { +OnePointCsFull D_80120964[2] = { { 0x8F, 0xFF, 0x0101, 1, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x81, 0xFF, 0xA121, 1, 0, 75.0f, 0.6f, { 0.0f, -10.0f, 0.0f }, { 0.0f, 0.0f, 150.0f } }, }; -static OnePointCsFull D_801209B4[4] = { +OnePointCsFull D_801209B4[4] = { { 0x8F, 0x08, 0x0101, 1, 0, 60.0f, 0.9f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x84, 0x01, 0x0100, 29, 0, 45.0f, 0.1f, { 0.0f, -10.0f, 0.0f }, { 0.0f, 0.0f, 150.0f } }, { 0x83, 0xFF, 0x0000, 10, 0, 60.0f, 0.2f, { 0.0f, -10.0f, 0.0f }, { 0.0f, 0.0f, 150.0f } }, @@ -142,7 +142,7 @@ static OnePointCsFull D_80120A54[3] = { { 0x8B, 0xFF, 0x0022, 5000, 0, 75.0f, 0.005f, { 0.0f, 0.0f, -10.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80120ACC[5] = { +OnePointCsFull D_80120ACC[5] = { { 0x8F, 0xFF, 0x0442, 10, 0, 40.0f, 1.0f, { -10.0f, 45.0f, 20.0f }, { 20.0f, 30.0f, 160.0f } }, { 0x95, 0xFF, 0x0000, 1, 0, 40.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, { 0x8F, 0x01, 0x0442, 10, 0, 40.0f, 1.0f, { -10.0f, 45.0f, 20.0f }, { 20.0f, 30.0f, 160.0f } }, @@ -150,7 +150,7 @@ static OnePointCsFull D_80120ACC[5] = { { 0x11, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80120B94[11] = { +OnePointCsFull D_80120B94[11] = { { 0x8F, 0x01, 0x2142, 1, 0, 40.0f, 1.0f, { 20.0f, 40.0f, 20.0f }, { -20.0f, 0.0f, -30.0f } }, { 0x84, 0xFF, 0x0404, 19, 5, 70.0f, 0.01f, { 0.0f, 30.0f, 20.0f }, { 120.0f, 60.0f, 120.0f } }, { 0x84, 0xFF, 0x0404, 20, 0, 60.0f, 0.01f, { 0.0f, 20.0f, 20.0f }, { 120.0f, 60.0f, 120.0f } }, @@ -164,7 +164,7 @@ static OnePointCsFull D_80120B94[11] = { { 0x98, 0xFF, 0x0000, 1, 0, 50.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80120D4C[7] = { +OnePointCsFull D_80120D4C[7] = { { 0x8F, 0x01, 0x2142, 1, 0, 40.0f, 1.0f, { 20.0f, 40.0f, 20.0f }, { -20.0f, 0.0f, -30.0f } }, { 0x84, 0xFF, 0x0404, 19, 5, 70.0f, 0.01f, { 0.0f, 30.0f, 20.0f }, { 120.0f, 60.0f, 120.0f } }, { 0x84, 0xFF, 0x0404, 20, 0, 60.0f, 0.01f, { 0.0f, 20.0f, 20.0f }, { 120.0f, 60.0f, 120.0f } }, @@ -185,7 +185,7 @@ static OnePointCsFull D_80120E64[8] = { { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80120FA4[6] = { +OnePointCsFull D_80120FA4[6] = { { 0x8F, 0x01, 0x2143, 30, 0, 70.0f, 0.4f, { 0.0f, 40.0f, 50.0f }, { 30.0f, 10.0f, -50.0f } }, { 0x95, 0xFF, 0x0000, 1, 0, 50.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, { 0x8F, 0xFF, 0x2222, 10, 0, 42.0f, 1.0f, { 0.0f, 40.0f, 0.0f }, { 0.0f, 85.0f, 45.0f } }, @@ -206,12 +206,12 @@ static OnePointCsFull D_8012110C[3] = { { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80121184[2] = { +OnePointCsFull D_80121184[2] = { { 0x83, 0x01, 0x0101, 40, 0, -1.0f, 0.1f, { 0.0f, 10.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_801211D4[2] = { +OnePointCsFull D_801211D4[2] = { { 0x8F, 0x08, 0x0101, 50, 0, 60.0f, 1.0f, { 0.0f, 10.0f, 0.0f }, { -10.0f, 85.0f, 0.0f } }, { 0x11, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; @@ -229,13 +229,13 @@ static OnePointCsFull D_80121314[1] = { { 0x8F, 0x08, 0x4141, 1000, 0, 75.0f, 0.6f, { 0.0f, 0.0f, 10.0f }, { 0.0f, 0.0f, 100.0f } }, }; -static OnePointCsFull D_8012133C[3] = { +OnePointCsFull D_8012133C[3] = { { 0x8F, 0x01, 0x0141, 40, 0, 75.0f, 1.0f, { 0.0f, 60.0f, 0.0f }, { 0.0f, 0.0f, 100.0f } }, { 0x83, 0xFF, 0x2121, 20, 0, 60.0f, 0.2f, { 0.0f, -10.0f, -10.0f }, { 0.0f, 10.0f, -100.0f } }, { 0x11, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_801213B4[5] = { +OnePointCsFull D_801213B4[5] = { { 0x8F, 0x08, 0xC2C2, 40, 0, 70.0f, 1.0f, { 80.0f, 0.0f, 20.0f }, { 20.0f, 0.0f, 80.0f } }, { 0x8B, 0x01, 0xC2C2, 120, 0, 70.0f, 0.1f, { 80.0f, 0.0f, 20.0f }, { 20.0f, 0.0f, 80.0f } }, { 0x8F, 0x53, 0xC2C2, 30, 0, 50.0f, 1.0f, { 60.0f, 0.0f, 20.0f }, { 60.0f, 0.0f, 60.0f } }, @@ -250,17 +250,17 @@ static OnePointCsFull D_8012147C[4] = { { 0x11, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_8012151C[2] = { +OnePointCsFull D_8012151C[2] = { { 0x0F, 0x01, 0x0101, 29, 0, 60.0f, 1.0f, { -700.0f, 875.0f, -100.0f }, { -550.0f, 920.0f, -150.0f } }, { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_8012156C[2] = { +OnePointCsFull D_8012156C[2] = { { 0x8F, 0x4D, 0x4242, 1, 0, 65.0f, 1.0f, { 60.0f, 30.0f, 0.0f }, { 50.0f, 20.0f, 150.0f } }, { 0x81, 0xFF, 0x4242, -1, 0, 65.0f, 1.0f, { -50.0f, 60.0f, 0.0f }, { -60.0f, 40.0f, 150.0f } }, }; -static OnePointCsFull D_801215BC[1] = { +OnePointCsFull D_801215BC[1] = { { 0x0F, 0xFF, 0x0101, 5, 0, 65.0f, 1.0f, { -1185.0f, 655.0f, 1185.0f }, { -1255.0f, 735.0f, 1255.0f } }, }; @@ -331,7 +331,7 @@ static OnePointCsFull D_80121A44[12] = { { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80121C24[7] = { +OnePointCsFull D_80121C24[7] = { { 0x0F, 0x05, 0x0101, 1, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x03, 0xFF, 0x0101, 89, 0, 50.0f, 0.4f, { 125.0f, 320.0f, -1500.0f }, { 125.0f, 500.0f, -1150.0f } }, { 0x0F, 0x08, 0x0101, 40, 4, 55.0f, 1.0f, { 0.0f, 375.0f, -1440.0f }, { 5.0f, 365.0f, -1315.0f } }, @@ -341,7 +341,7 @@ static OnePointCsFull D_80121C24[7] = { { 0x11, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80121D3C[3] = { +OnePointCsFull D_80121D3C[3] = { { 0x0F, 0xFF, 0x0101, 1, 0, 60.0f, 1.0f, { 1023.0f, 738.0f, -2628.0f }, { 993.0f, 770.0f, -2740.0f } }, { 0x02, 0xFF, 0x0101, 4, 0, 50.0f, 1.0f, { 1255.0f, 350.0f, -1870.0f }, { 1240.0f, 575.0f, -2100.0f } }, { 0x0F, 0xFF, 0x0000, -1, 0, 75.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, @@ -359,14 +359,14 @@ static OnePointCsFull D_80121DB4[9] = { { 0x12, 0xFF, 0x0000, 1, -1, -1.0f, -1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80121F1C[4] = { +OnePointCsFull D_80121F1C[4] = { { 0x0F, 0x08, 0x0101, 10, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x01, 0xFF, 0x2121, 10, 0, 50.0f, 0.5f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 150.0f } }, { 0x01, 0x02, 0x2121, 23, 0, 50.0f, 0.5f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 150.0f } }, { 0x11, 0xFF, 0x0000, 1, -1, -1.0f, -1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80121FBC[4] = { +OnePointCsFull D_80121FBC[4] = { { 0x0F, 0xFF, 0x0101, 5, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x01, 0xFF, 0x0101, 10, 0, 30.0f, 1.0f, { -2130.0f, 2885.0f, -1055.0f }, { -2085.0f, 2875.0f, -1145.0f } }, { 0x0F, 0xFF, 0x0000, 30, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, @@ -379,7 +379,7 @@ static OnePointCsFull D_8012205C[3] = { { 0x01, 0x01, 0x21A1, 10, 0, 60.0f, 1.0f, { 0.0f, -10.0f, 0.0f }, { 0.0f, 10.0f, -200.0f } }, }; -static OnePointCsFull D_801220D4[5] = { +OnePointCsFull D_801220D4[5] = { { 0x0F, 0x01, 0x0101, 5, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x01, 0xFF, 0x4141, 10, 5, 55.0f, 0.75f, { 400.0f, -50.0f, 800.0f }, { 600.0f, -60.0f, 800.0f } }, { 0x01, 0xFF, 0x4141, 15, 10, 40.0f, 0.75f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 10.0f, 200.0f } }, @@ -443,7 +443,7 @@ static OnePointCsFull D_8012269C[3] = { { 0x11, 0xFF, 0x0000, 1, -1, -1.0f, -1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80122714[4] = { +OnePointCsFull D_80122714[4] = { { 0x0F, 0xFF, 0x0101, 20, 0, 45.0f, 1.0f, { -915.0f, -2185.0f, 6335.0f }, { -915.0f, -2290.0f, 6165.0f } }, { 0x02, 0xFF, 0x0101, -1, 0, 80.0f, 0.8f, { -920.0f, -2270.0f, 6140.0f }, { -920.0f, -2280.0f, 6070.0f } }, { 0x02, 0xFF, 0x0101, 20, 0, 80.0f, 0.9f, { -920.0f, -2300.0f, 6140.0f }, { -920.0f, -2300.0f, 6070.0f } }, @@ -512,12 +512,12 @@ static OnePointCsFull D_80122C8C[1] = { { 0x0F, 0xFF, 0x0101, 999, 5, 60.0f, 1.0f, { -70.0f, 140.0f, 25.0f }, { 10.0f, 180.0f, 195.0f } }, }; -static OnePointCsFull D_80122CB4[2] = { +OnePointCsFull D_80122CB4[2] = { { 0x0F, 0xFF, 0x4242, 5, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 1000.0f }, { 0.0f, 0.0f, 1100.0f } }, { 0x02, 0xFF, 0x4242, -1, 0, 60.0f, 1.0f, { 0.0f, 0.0f, -100.0f }, { 0.0f, 0.0f, 0.0f } }, }; -static OnePointCsFull D_80122D04[2] = { +OnePointCsFull D_80122D04[2] = { { 0x0F, 0xFF, 0x4242, 10, 0, 60.0f, 1.0f, { 0.0f, 0.0f, -100.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x02, 0xFF, 0x4242, -1, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 1000.0f }, { 0.0f, 0.0f, 1100.0f } }, }; @@ -534,7 +534,7 @@ static OnePointCsFull D_80122DCC[3] = { { 0x11, 0xFF, 0x0000, 1, -1, -1.0f, -1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80122E44[2][7] = { +OnePointCsFull D_80122E44[2][7] = { { { 0x83, 0xFF, 0x2222, 10, 5, 90.0f, 0.2f, { 50.0f, 100.0f, 140.0f }, { -30.0f, 10.0f, -20.0f } }, { 0x8F, 0xFF, 0x0000, 20, 0, 90.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, @@ -563,25 +563,25 @@ static OnePointCsFull D_80123074[5] = { { 0x92, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_8012313C[3] = { +OnePointCsFull D_8012313C[3] = { { 0x8F, 0xFF, 0xA2A2, 20, 8, 70.0f, 1.0f, { 65.0f, -150.0f, 50.0f }, { 30.0f, 10.0f, 90.0f } }, { 0x81, 0xFF, 0xA2A2, 100, 0, 60.0f, 1.0f, { 70.0f, -160.0f, 50.0f }, { 25.0f, 180.0f, 180.0f } }, { 0x92, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_801231B4[4] = { +OnePointCsFull D_801231B4[4] = { { 0x8F, 0xC5, 0x4343, 1, 0, 50.0f, 1.0f, { 0.0f, 20.0f, 0.0f }, { 0.0f, 5.0f, -1.0f } }, { 0x81, 0xC5, 0x4343, 48, 0, 50.0f, 0.75f, { 0.0f, 80.0f, 0.0f }, { 0.0f, 15.0f, -1.0f } }, { 0x8F, 0xC5, 0x4343, 1, 5, 45.0f, 1.0f, { 0.0f, 0.0f, 30.0f }, { 30.0f, 120.0f, 60.0f } }, { 0x81, 0xC5, 0x4343, -1, 0, -1.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80123254[2] = { +OnePointCsFull D_80123254[2] = { { 0x0F, 0xFF, 0x0101, 1, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x03, 0xC5, 0x0101, 49, 0, 50.0f, 0.05f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, }; -static OnePointCsFull D_801232A4[1] = { +OnePointCsFull D_801232A4[1] = { { 0x0F, 0x45, 0x0101, 9999, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, }; @@ -646,24 +646,24 @@ static OnePointCsFull D_801237CC[5] = { { 0x0F, 0xFF, 0x0000, 100, -45, 75.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, }; -static OnePointCsFull D_80123894[3] = { +OnePointCsFull D_80123894[3] = { { 0x0F, 0xFF, 0x0101, 60, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x0F, 0xFF, 0x4242, 30, 0, 50.0f, 1.0f, { 0.0f, 28.0f, 0.0f }, { 0.0f, 20.0f, 40.0f } }, { 0x0D, 0xFF, 0x0000, 120, 0, 180.0f, 0.4f, { 0.0f, -5.0f, 0.0f }, { 0.0f, 2.0f, 40.0f } }, }; -static OnePointCsFull D_8012390C[2] = { +OnePointCsFull D_8012390C[2] = { { 0x0F, 0xFF, 0x0101, 30, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x0F, 0xFF, 0x4242, 180, 0, 60.0f, 1.0f, { 0.0f, 78.0f, 0.0f }, { 0.0f, 78.0f, 200.0f } }, }; -static OnePointCsFull D_8012395C[3] = { +OnePointCsFull D_8012395C[3] = { { 0x0F, 0xFF, 0x0101, 60, 0, 60.0f, 1.0f, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x0F, 0xFF, 0x4242, 30, 0, 50.0f, 1.0f, { 0.0f, 28.0f, 0.0f }, { 0.0f, 20.0f, -45.0f } }, { 0x0D, 0xFF, 0x0000, 120, 0, 180.0f, 0.4f, { 0.0f, -5.0f, 0.0f }, { 0.0f, 2.0f, 45.0f } }, }; -static OnePointCsFull D_801239D4[3] = { +OnePointCsFull D_801239D4[3] = { { 0x0F, 0xFF, 0x4242, 5, 0, 60.0f, 1.0f, { 0.0f, 20.0f, 0.0f }, { 0.0f, 40.0f, -120.0f } }, { 0x09, 0xFF, 0x4242, 0, 0, 60.0f, 1.0f, { 0.0f, 20.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } }, { 0x12, 0xFF, 0x0000, 1, 0, 60.0f, 1.0f, { -1.0f, -1.0f, -1.0f }, { -1.0f, -1.0f, -1.0f } }, diff --git a/soh/src/code/z_parameter.c b/soh/src/code/z_parameter.c index 3219527a9..edc4348b9 100644 --- a/soh/src/code/z_parameter.c +++ b/soh/src/code/z_parameter.c @@ -919,7 +919,11 @@ void func_80083108(GlobalContext* globalCtx) { if (interfaceCtx->restrictions.tradeItems != 0) { for (i = 1; i < 4; i++) { - if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && + if ((CVar_GetS32("gMMBunnyHood", 0) != 0) + && (gSaveContext.equips.buttonItems[i] >= ITEM_MASK_KEATON) + && (gSaveContext.equips.buttonItems[i] <= ITEM_MASK_TRUTH)) { + gSaveContext.buttonStatus[i] = BTN_ENABLED; + } else if ((gSaveContext.equips.buttonItems[i] >= ITEM_WEIRD_EGG) && (gSaveContext.equips.buttonItems[i] <= ITEM_CLAIM_CHECK)) { if (gSaveContext.buttonStatus[i] == BTN_ENABLED) { sp28 = 1; @@ -3125,6 +3129,14 @@ void Interface_Draw(GlobalContext* globalCtx) { }; static s16 rupeeDigitsFirst[] = { 1, 0, 0 }; static s16 rupeeDigitsCount[] = { 2, 3, 3 }; + + // courtesy of https://github.com/TestRunnerSRL/OoT-Randomizer/blob/Dev/ASM/c/hud_colors.c + static s16 rupeeWalletColors[3][3] = { + { 0xC8, 0xFF, 0x64 }, // Base Wallet (Green) + { 0x82, 0x82, 0xFF }, // Adult's Wallet (Blue) + { 0xFF, 0x64, 0x64 }, // Giant's Wallet (Red) + }; + static s16 spoilingItemEntrances[] = { 0x01AD, 0x0153, 0x0153 }; static f32 D_80125B54[] = { -40.0f, -35.0f }; // unused static s16 D_80125B5C[] = { 91, 91 }; // unused @@ -3143,6 +3155,7 @@ void Interface_Draw(GlobalContext* globalCtx) { s16 svar4; s16 svar5; s16 svar6; + bool fullUi = !CVar_GetS32("gMinimalUI", 0) || !R_MINIMAP_DISABLED || globalCtx->pauseCtx.state != 0; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_parameter.c", 3405); @@ -3158,111 +3171,131 @@ void Interface_Draw(GlobalContext* globalCtx) { if (pauseCtx->debugState == 0) { Interface_InitVertices(globalCtx); func_8008A994(interfaceCtx); - HealthMeter_Draw(globalCtx); + if (fullUi || gSaveContext.health != gSaveContext.healthCapacity) { + HealthMeter_Draw(globalCtx); + } func_80094520(globalCtx->state.gfxCtx); - // Rupee Icon - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 255, 100, interfaceCtx->magicAlpha); - gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255); - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), - 206, 16, 16, 1 << 10, 1 << 10); + if (fullUi) { + // Rupee Icon + s16* rColor; - switch (globalCtx->sceneNum) { - case SCENE_BMORI1: - case SCENE_HIDAN: - case SCENE_MIZUSIN: - case SCENE_JYASINZOU: - case SCENE_HAKADAN: - case SCENE_HAKADANCH: - case SCENE_ICE_DOUKUTO: - case SCENE_GANON: - case SCENE_MEN: - case SCENE_GERUDOWAY: - case SCENE_GANONTIKA: - case SCENE_GANON_SONOGO: - case SCENE_GANONTIKA_SONOGO: - case SCENE_TAKARAYA: - if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) { - // Small Key Icon - gDPPipeSync(OVERLAY_DISP++); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 230, 255, interfaceCtx->magicAlpha); - gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); - OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), 190, 16, 16, - 1 << 10, 1 << 10); + if (CVar_GetS32("gDynamicWalletIcon", 0)) { + rColor = &rupeeWalletColors[CUR_UPG_VALUE(UPG_WALLET)]; + } else { + rColor = &rupeeWalletColors[0]; + } - // Small Key Counter - gDPPipeSync(OVERLAY_DISP++); - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); - gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, - TEXEL0, 0, PRIMITIVE, 0); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, rColor[0], rColor[1], rColor[2], interfaceCtx->magicAlpha); + gDPSetEnvColor(OVERLAY_DISP++, 0, 80, 0, 255); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gRupeeCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), + 206, 16, 16, 1 << 10, 1 << 10); - interfaceCtx->counterDigits[2] = 0; - interfaceCtx->counterDigits[3] = gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]; + switch (globalCtx->sceneNum) { + case SCENE_BMORI1: + case SCENE_HIDAN: + case SCENE_MIZUSIN: + case SCENE_JYASINZOU: + case SCENE_HAKADAN: + case SCENE_HAKADANCH: + case SCENE_ICE_DOUKUTO: + case SCENE_GANON: + case SCENE_MEN: + case SCENE_GERUDOWAY: + case SCENE_GANONTIKA: + case SCENE_GANON_SONOGO: + case SCENE_GANONTIKA_SONOGO: + case SCENE_TAKARAYA: + if (gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex] >= 0) { + // Small Key Icon + gDPPipeSync(OVERLAY_DISP++); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 200, 230, 255, interfaceCtx->magicAlpha); + gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 20, 255); + OVERLAY_DISP = Gfx_TextureIA8(OVERLAY_DISP, gSmallKeyCounterIconTex, 16, 16, OTRGetRectDimensionFromLeftEdge(26), 190, 16, 16, + 1 << 10, 1 << 10); - while (interfaceCtx->counterDigits[3] >= 10) { - interfaceCtx->counterDigits[2]++; - interfaceCtx->counterDigits[3] -= 10; + // Small Key Counter + gDPPipeSync(OVERLAY_DISP++); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); + gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, + TEXEL0, 0, PRIMITIVE, 0); + + interfaceCtx->counterDigits[2] = 0; + interfaceCtx->counterDigits[3] = gSaveContext.inventory.dungeonKeys[gSaveContext.mapIndex]; + + while (interfaceCtx->counterDigits[3] >= 10) { + interfaceCtx->counterDigits[2]++; + interfaceCtx->counterDigits[3] -= 10; + } + + svar3 = OTRGetRectDimensionFromLeftEdge(42); + + if (interfaceCtx->counterDigits[2] != 0) { + OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, + 16, svar3, 190, 8, 16, 1 << 10, 1 << 10); + svar3 += 8; + } + + OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, + ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, + svar3, 190, 8, 16, 1 << 10, 1 << 10); } + break; + default: + break; + } - svar3 = OTRGetRectDimensionFromLeftEdge(42); + // Rupee Counter + gDPPipeSync(OVERLAY_DISP++); - if (interfaceCtx->counterDigits[2] != 0) { - OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, ((u8*)((u8*)digitTextures[interfaceCtx->counterDigits[2]])), 8, - 16, svar3, 190, 8, 16, 1 << 10, 1 << 10); - svar3 += 8; - } + if (gSaveContext.rupees == CUR_CAPACITY(UPG_WALLET)) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, interfaceCtx->magicAlpha); + } else if (gSaveContext.rupees != 0) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->magicAlpha); + } - OVERLAY_DISP = Gfx_TextureI8(OVERLAY_DISP, - ((u8*)digitTextures[interfaceCtx->counterDigits[3]]), 8, 16, - svar3, 190, 8, 16, 1 << 10, 1 << 10); - } - break; - default: - break; + gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, + PRIMITIVE, 0); + + interfaceCtx->counterDigits[0] = interfaceCtx->counterDigits[1] = 0; + interfaceCtx->counterDigits[2] = gSaveContext.rupees; + + if ((interfaceCtx->counterDigits[2] > 9999) || (interfaceCtx->counterDigits[2] < 0)) { + interfaceCtx->counterDigits[2] &= 0xDDD; + } + + while (interfaceCtx->counterDigits[2] >= 100) { + interfaceCtx->counterDigits[0]++; + interfaceCtx->counterDigits[2] -= 100; + } + + while (interfaceCtx->counterDigits[2] >= 10) { + interfaceCtx->counterDigits[1]++; + interfaceCtx->counterDigits[2] -= 10; + } + + svar2 = rupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)]; + svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; + + for (svar1 = 0, svar3 = 42; svar1 < svar5; svar1++, svar2++, svar3 += 8) { + OVERLAY_DISP = + Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16, + OTRGetRectDimensionFromLeftEdge(svar3), 206, 8, 16, 1 << 10, 1 << 10); + } + } + else { + // Make sure item counts have black backgrounds + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 0, 0, 0, interfaceCtx->magicAlpha); + gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 0); } - // Rupee Counter - gDPPipeSync(OVERLAY_DISP++); - - if (gSaveContext.rupees == CUR_CAPACITY(UPG_WALLET)) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 120, 255, 0, interfaceCtx->magicAlpha); - } else if (gSaveContext.rupees != 0) { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->magicAlpha); - } else { - gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 100, 100, 100, interfaceCtx->magicAlpha); + if (fullUi || gSaveContext.unk_13F0 > 0) { + Interface_DrawMagicBar(globalCtx); } - gDPSetCombineLERP(OVERLAY_DISP++, 0, 0, 0, PRIMITIVE, TEXEL0, 0, PRIMITIVE, 0, 0, 0, 0, PRIMITIVE, TEXEL0, 0, - PRIMITIVE, 0); - - interfaceCtx->counterDigits[0] = interfaceCtx->counterDigits[1] = 0; - interfaceCtx->counterDigits[2] = gSaveContext.rupees; - - if ((interfaceCtx->counterDigits[2] > 9999) || (interfaceCtx->counterDigits[2] < 0)) { - interfaceCtx->counterDigits[2] &= 0xDDD; - } - - while (interfaceCtx->counterDigits[2] >= 100) { - interfaceCtx->counterDigits[0]++; - interfaceCtx->counterDigits[2] -= 100; - } - - while (interfaceCtx->counterDigits[2] >= 10) { - interfaceCtx->counterDigits[1]++; - interfaceCtx->counterDigits[2] -= 10; - } - - svar2 = rupeeDigitsFirst[CUR_UPG_VALUE(UPG_WALLET)]; - svar5 = rupeeDigitsCount[CUR_UPG_VALUE(UPG_WALLET)]; - - for (svar1 = 0, svar3 = 42; svar1 < svar5; svar1++, svar2++, svar3 += 8) { - OVERLAY_DISP = - Gfx_TextureI8(OVERLAY_DISP, ((u8*)digitTextures[interfaceCtx->counterDigits[svar2]]), 8, 16, - OTRGetRectDimensionFromLeftEdge(svar3), 206, 8, 16, 1 << 10, 1 << 10); - } - - Interface_DrawMagicBar(globalCtx); Minimap_Draw(globalCtx); if ((R_PAUSE_MENU_MODE != 2) && (R_PAUSE_MENU_MODE != 3)) { @@ -3271,7 +3304,9 @@ void Interface_Draw(GlobalContext* globalCtx) { func_80094520(globalCtx->state.gfxCtx); - Interface_DrawItemButtons(globalCtx); + if (fullUi) { + Interface_DrawItemButtons(globalCtx); + } gDPPipeSync(OVERLAY_DISP++); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, interfaceCtx->bAlpha); @@ -3281,10 +3316,17 @@ void Interface_Draw(GlobalContext* globalCtx) { // B Button Icon & Ammo Count if (gSaveContext.equips.buttonItems[0] != ITEM_NONE) { - Interface_DrawItemIconTexture(globalCtx, gItemIcons[gSaveContext.equips.buttonItems[0]], 0); + if (fullUi) { + Interface_DrawItemIconTexture(globalCtx, gItemIcons[gSaveContext.equips.buttonItems[0]], 0); + } if ((player->stateFlags1 & 0x00800000) || (globalCtx->shootingGalleryStatus > 1) || ((globalCtx->sceneNum == SCENE_BOWLING) && Flags_GetSwitch(globalCtx, 0x38))) { + + if (!fullUi) { + Interface_DrawItemIconTexture(globalCtx, gItemIcons[gSaveContext.equips.buttonItems[0]], 0); + } + gDPPipeSync(OVERLAY_DISP++); gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); @@ -3357,7 +3399,9 @@ void Interface_Draw(GlobalContext* globalCtx) { gDPSetCombineMode(OVERLAY_DISP++, G_CC_MODULATEIA_PRIM, G_CC_MODULATEIA_PRIM); gDPSetPrimColor(OVERLAY_DISP++, 0, 0, R_A_BTN_COLOR(0), R_A_BTN_COLOR(1), R_A_BTN_COLOR(2), interfaceCtx->aAlpha); - Interface_DrawActionButton(globalCtx, rABtnX, R_A_BTN_Y); + if (fullUi) { + Interface_DrawActionButton(globalCtx, rABtnX, R_A_BTN_Y); + } gDPPipeSync(OVERLAY_DISP++); const f32 rAIconX = OTRGetDimensionFromRightEdge(R_A_ICON_X); //func_8008A8B8(globalCtx, R_A_ICON_Y, R_A_ICON_Y + 45, rAIconX, rAIconX + 45); @@ -4078,11 +4122,11 @@ void Interface_Update(GlobalContext* globalCtx) { D_80125A58 = func_8008F2F8(globalCtx); if (D_80125A58 == 1) { - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 2 || CVar_GetS32("gSuperTunic", 0) != 0) { D_80125A58 = 0; } } else if ((func_8008F2F8(globalCtx) >= 2) && (func_8008F2F8(globalCtx) < 5)) { - if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3) { + if (CUR_EQUIP_VALUE(EQUIP_TUNIC) == 3 || CVar_GetS32("gSuperTunic", 0) != 0) { D_80125A58 = 0; } } diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index f0880b3da..632ed41f6 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -5,6 +5,8 @@ #include "soh/Enhancements/gameconsole.h" +#include "soh/frame_interpolation.h" + void* D_8012D1F0 = NULL; //UNK_TYPE D_8012D1F4 = 0; // unused Input* D_8012D1F8 = NULL; @@ -421,7 +423,7 @@ void Gameplay_Update(GlobalContext* globalCtx) { input = globalCtx->state.input; - if ((SREG(1) < 0) || (DREG(0) != 0)) { + if ((SREG(1) < 0) || (DREG(0) != 0)) { SREG(1) = 0; ZeldaArena_Display(); } @@ -1119,6 +1121,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) { gfxP = Graph_GfxPlusOne(sp1CC); gSPDisplayList(OVERLAY_DISP++, gfxP); + gsSPGrayscale(gfxP++, false); if ((globalCtx->transitionMode == 3) || (globalCtx->transitionMode == 11) || (globalCtx->transitionCtx.transitionType >= 56)) { @@ -1136,8 +1139,8 @@ void Gameplay_Draw(GlobalContext* globalCtx) { TransitionFade_Draw(&globalCtx->transitionFade, &gfxP); if (D_801614B0.a > 0) { - D_80161498.primColor.rgba = D_801614B0.rgba; - VisMono_Draw(&D_80161498, &gfxP); + gsDPSetGrayscaleColor(gfxP++, D_801614B0.r, D_801614B0.g, D_801614B0.b, D_801614B0.a); + gsSPGrayscale(gfxP++, true); } gSPEndDisplayList(gfxP++); @@ -1171,7 +1174,7 @@ void Gameplay_Draw(GlobalContext* globalCtx) { //goto Gameplay_Draw_DrawOverlayElements; } - //else + //else { s32 sp80; @@ -1378,7 +1381,9 @@ void Gameplay_Main(GameState* thisx) { LOG_NUM("1", 1, "../z_play.c", 4583); } + FrameInterpolation_StartRecord(); Gameplay_Draw(globalCtx); + FrameInterpolation_StopRecord(); if (1 && HREG(63)) { LOG_NUM("1", 1, "../z_play.c", 4587); @@ -1472,7 +1477,7 @@ void Gameplay_InitEnvironment(GlobalContext* globalCtx, s16 skyboxId) { Environment_Init(globalCtx, &globalCtx->envCtx, 0); } -void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) +void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) { globalCtx->curSpawn = spawn; globalCtx->linkActorEntry = NULL; @@ -1495,26 +1500,6 @@ void Gameplay_InitScene(GlobalContext* globalCtx, s32 spawn) void Gameplay_SpawnScene(GlobalContext* globalCtx, s32 sceneNum, s32 spawn) { OTRGameplay_SpawnScene(globalCtx, sceneNum, spawn); - return; - - SceneTableEntry* scene = &gSceneTable[sceneNum]; - - scene->unk_13 = 0; - globalCtx->loadedScene = scene; - globalCtx->sceneNum = sceneNum; - globalCtx->sceneConfig = scene->config; - - osSyncPrintf("\nSCENE SIZE %fK\n", (scene->sceneFile.vromEnd - scene->sceneFile.vromStart) / 1024.0f); - - globalCtx->sceneSegment = Gameplay_LoadFile(globalCtx, &scene->sceneFile); - scene->unk_13 = 0; - ASSERT(globalCtx->sceneSegment != NULL, "this->sceneSegment != NULL", "../z_play.c", 4960); - - gSegments[2] = VIRTUAL_TO_PHYSICAL(globalCtx->sceneSegment); - - Gameplay_InitScene(globalCtx, spawn); - - osSyncPrintf("ROOM SIZE=%fK\n", func_80096FE8(globalCtx, &globalCtx->roomCtx) / 1024.0f); } void func_800C016C(GlobalContext* globalCtx, Vec3f* src, Vec3f* dest) { diff --git a/soh/src/code/z_player_lib.c b/soh/src/code/z_player_lib.c index e15cc81eb..355d323e0 100644 --- a/soh/src/code/z_player_lib.c +++ b/soh/src/code/z_player_lib.c @@ -631,9 +631,9 @@ s32 func_8008F2F8(GlobalContext* globalCtx) { if (0) {} if ((triggerEntry->flag != 0) && !(gSaveContext.textTriggerFlags & triggerEntry->flag) && - (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON)) || + (((var == 0) && (this->currentTunic != PLAYER_TUNIC_GORON && CVar_GetS32("gSuperTunic", 0) == 0)) || (((var == 1) || (var == 3)) && (this->currentBoots == PLAYER_BOOTS_IRON) && - (this->currentTunic != PLAYER_TUNIC_ZORA)))) { + (this->currentTunic != PLAYER_TUNIC_ZORA && CVar_GetS32("gSuperTunic", 0) == 0)))) { Message_StartTextbox(globalCtx, triggerEntry->textId, NULL); gSaveContext.textTriggerFlags |= triggerEntry->flag; } @@ -654,7 +654,7 @@ u8 sEyeMouthIndexes[][2] = { * from adult Link's object are used here. */ -#if defined(MODDING) || (_MSC_VER) +#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__) //TODO: Formatting void* sEyeTextures[2][8] = { { gLinkAdultEyesOpenTex, gLinkAdultEyesHalfTex, gLinkAdultEyesClosedfTex, gLinkAdultEyesRollLeftTex, @@ -670,7 +670,7 @@ void* sEyeTextures[] = { }; #endif -#if defined(modding) || defined(_MSC_VER) +#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__) void* sMouthTextures[2][4] = { { gLinkAdultMouth1Tex, @@ -726,7 +726,7 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, if (eyeIndex > 7) eyeIndex = 7; -#if defined(MODDING) || (_MSC_VER) +#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__) gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[gSaveContext.linkAge][eyeIndex])); #else gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sEyeTextures[eyeIndex])); @@ -738,13 +738,30 @@ void func_8008F470(GlobalContext* globalCtx, void** skeleton, Vec3s* jointTable, if (mouthIndex > 3) mouthIndex = 3; -#if defined(MODDING) || (_MSC_VER) +#if defined(MODDING) || defined(_MSC_VER) || defined(__GNUC__) gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[gSaveContext.linkAge][mouthIndex])); #else gSPSegment(POLY_OPA_DISP++, 0x09, SEGMENTED_TO_VIRTUAL(sMouthTextures[eyeIndex])); #endif - - color = &sTunicColors[tunic]; + Color_RGB8 sTemp; + color = &sTemp; + if (tunic == PLAYER_TUNIC_KOKIRI) { + color->r = CVar_GetS32("gTunic_Kokiri_Red", sTunicColors[PLAYER_TUNIC_KOKIRI].r); + color->g = CVar_GetS32("gTunic_Kokiri_Green", sTunicColors[PLAYER_TUNIC_KOKIRI].g); + color->b = CVar_GetS32("gTunic_Kokiri_Blue", sTunicColors[PLAYER_TUNIC_KOKIRI].b); + } else if (tunic == PLAYER_TUNIC_GORON) { + color->r = CVar_GetS32("gTunic_Goron_Red", sTunicColors[PLAYER_TUNIC_GORON].r); + color->g = CVar_GetS32("gTunic_Goron_Green", sTunicColors[PLAYER_TUNIC_GORON].g); + color->b = CVar_GetS32("gTunic_Goron_Blue", sTunicColors[PLAYER_TUNIC_GORON].b); + } else if (tunic == PLAYER_TUNIC_ZORA) { + color->r = CVar_GetS32("gTunic_Zora_Red", sTunicColors[PLAYER_TUNIC_ZORA].r); + color->g = CVar_GetS32("gTunic_Zora_Green", sTunicColors[PLAYER_TUNIC_ZORA].g); + color->b = CVar_GetS32("gTunic_Zora_Blue", sTunicColors[PLAYER_TUNIC_ZORA].b); + } else { + color->r = CVar_GetS32("gTunic_Kokiri_Red", sTunicColors[PLAYER_TUNIC_KOKIRI].r); + color->g = CVar_GetS32("gTunic_Kokiri_Green", sTunicColors[PLAYER_TUNIC_KOKIRI].g); + color->b = CVar_GetS32("gTunic_Kokiri_Blue", sTunicColors[PLAYER_TUNIC_KOKIRI].b); + } gDPSetEnvColor(POLY_OPA_DISP++, color->r, color->g, color->b, 0); sDListsLodOffset = lod * 2; @@ -1196,7 +1213,7 @@ void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2 if (BgCheck_AnyLineTest3(&globalCtx->colCtx, &sp8C, &sp80, &sp74, &sp9C, 1, 1, 1, 1, &bgId)) { OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2572); - OVERLAY_DISP = Gfx_CallSetupDL(OVERLAY_DISP, 0x07); + WORLD_OVERLAY_DISP = Gfx_CallSetupDL(WORLD_OVERLAY_DISP, 0x07); SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &sp74, &sp68, &sp64); @@ -1205,10 +1222,10 @@ void Player_DrawHookshotReticle(GlobalContext* globalCtx, Player* this, f32 arg2 Matrix_Translate(sp74.x, sp74.y, sp74.z, MTXMODE_NEW); Matrix_Scale(sp60, sp60, sp60, MTXMODE_APPLY); - gSPMatrix(OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2587), + gSPMatrix(WORLD_OVERLAY_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_player_lib.c", 2587), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); - gSPSegment(OVERLAY_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment); - gSPDisplayList(OVERLAY_DISP++, gLinkAdultHookshotReticleDL); + gSPSegment(WORLD_OVERLAY_DISP++, 0x06, globalCtx->objectCtx.status[this->actor.objBankIndex].segment); + gSPDisplayList(WORLD_OVERLAY_DISP++, gLinkAdultHookshotReticleDL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 2592); } @@ -1590,7 +1607,7 @@ void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime sp12C[0] = sword; sp12C[1] = shield; - Matrix_SetTranslateRotateYXZ(pos->x - (LINK_AGE_IN_YEARS == YEARS_ADULT ? 25 : 0), + Matrix_SetTranslateRotateYXZ(pos->x - ((CVar_GetS32("gPauseLiveLink", 0) && LINK_AGE_IN_YEARS == YEARS_ADULT) ? 25 : 0), pos->y - (CVar_GetS32("gPauseTriforce", 0) ? 16 : 0), pos->z, rot); Matrix_Scale(scale, scale, scale, MTXMODE_APPLY); @@ -1625,6 +1642,8 @@ void func_80091A24(GlobalContext* globalCtx, void* seg04, void* seg06, SkelAnime POLY_XLU_DISP = ohNo; } + POLY_OPA_DISP = Gameplay_SetFog(globalCtx, POLY_OPA_DISP++); + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player_lib.c", 3288); } diff --git a/soh/src/code/z_room.c b/soh/src/code/z_room.c index 93aab731f..5212799a6 100644 --- a/soh/src/code/z_room.c +++ b/soh/src/code/z_room.c @@ -126,7 +126,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) { sp90.y = polygonDlist->pos.y; sp90.z = polygonDlist->pos.z; SkinMatrix_Vec3fMtxFMultXYZW(&globalCtx->viewProjectionMtxF, &sp90, &sp84, &sp80); - if (-(f32)polygonDlist->unk_06 < sp84.z) + if (-(f32)polygonDlist->unk_06 < sp84.z) { temp_f2 = sp84.z - polygonDlist->unk_06; if (temp_f2 < globalCtx->lightCtx.fogFar) { @@ -171,7 +171,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) { Gfx* temp2; polygonDlist = spB4->unk_00; - if (iREG(86) != 0) + if (iREG(86) != 0) { temp = sp78; for (phi_v1 = 0; phi_v1 < polygon2->num; phi_v1++, temp++) { @@ -180,7 +180,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) { } } - if (((iREG(86) == 1) && (iREG(89) >= sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) + if (((iREG(86) == 1) && (iREG(89) >= sp9C)) || ((iREG(86) == 2) && (iREG(89) == sp9C))) { if (flags & 1) { temp2 = polygonDlist->opa; @@ -224,7 +224,7 @@ void func_80095D04(GlobalContext* globalCtx, Room* room, u32 flags) { s32 func_80096238(void* data) { OSTime time; - if (*(u32*)data == JPEG_MARKER) + if (*(u32*)data == JPEG_MARKER) { char* decodedJpeg = ResourceMgr_LoadJPEG(data, 320 * 240 * 2); //char* decodedJpeg = ResourceMgr_LoadJPEG(data, 480 * 240 * 2); @@ -235,8 +235,8 @@ s32 func_80096238(void* data) { osSyncPrintf("ワークãƒãƒƒãƒ•ァアドレス(Zãƒãƒƒãƒ•ァ)%08x\n", gZBuffer); time = osGetTime(); - - //if (!Jpeg_Decode(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) + + //if (!Jpeg_Decode(data, gZBuffer, gGfxSPTaskOutputBuffer, sizeof(gGfxSPTaskOutputBuffer))) if (1) { memcpy(data, decodedJpeg, 320 * 240 * 2); @@ -294,14 +294,17 @@ void func_8009638C(Gfx** displayList, void* source, void* tlut, u16 width, u16 h bg->b.frameW = width * 4; bg->b.frameH = height * 4; guS2DInitBg(bg); - - gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE, + + gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_FILL | G_PM_NPRIMITIVE, G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); gDPSetFillColor(displayListHead++, GPACK_RGBA5551(0, 0, 0, 1) << 16 | GPACK_RGBA5551(0, 0, 0, 1)); gDPFillWideRectangle(displayListHead++, OTRGetRectDimensionFromLeftEdge(0), 0, OTRGetRectDimensionFromRightEdge(SCREEN_WIDTH), SCREEN_HEIGHT); + gDPSetOtherMode(displayListHead++, mode0 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_COPY | G_PM_NPRIMITIVE, + G_AC_THRESHOLD | G_ZS_PIXEL | G_RM_NOOP | G_RM_NOOP2); + gDPLoadMultiTile(displayListHead++, bg->b.imagePtr, 0, G_TX_RENDERTILE, G_IM_FMT_RGBA, G_IM_SIZ_16b, 320, 0, 0, 0, 0 + 31, 0 + 31, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, diff --git a/soh/src/code/z_skelanime.c b/soh/src/code/z_skelanime.c index 2c03390e9..6dbfac7ef 100644 --- a/soh/src/code/z_skelanime.c +++ b/soh/src/code/z_skelanime.c @@ -863,7 +863,7 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader char animPath[2048]; - sprintf(animPath, "misc\\link_animetion\\gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000))); + sprintf(animPath, "misc/link_animetion/gPlayerAnimData_%06X", (((uintptr_t)linkAnimHeader->segment - 0x07000000))); //printf("Streaming %s, seg = %08X\n", animPath, linkAnimHeader->segment); @@ -877,7 +877,7 @@ void AnimationContext_SetLoadFrame(GlobalContext* globalCtx, LinkAnimationHeader { ramPtr[i] = i * 7; }*/ - + //DmaMgr_SendRequest2(&entry->data.load.req, ram, //LINK_ANIMATION_OFFSET(linkAnimHeader->segment, ((sizeof(Vec3s) * limbCount + 2) * frame)), diff --git a/soh/src/code/z_skin_matrix.c b/soh/src/code/z_skin_matrix.c index f7df8091f..d822d6c13 100644 --- a/soh/src/code/z_skin_matrix.c +++ b/soh/src/code/z_skin_matrix.c @@ -1,6 +1,8 @@ #include "global.h" #include "vt.h" +#include "soh/frame_interpolation.h" + // clang-format off MtxF sMtxFClear = { 1.0f, 0.0f, 0.0f, 0.0f, @@ -523,6 +525,7 @@ void SkinMatrix_Vec3sToVec3f(Vec3s* src, Vec3f* dest) { } void SkinMatrix_MtxFToMtx(MtxF* src, Mtx* dest) { + FrameInterpolation_RecordSkinMatrixMtxFToMtx(src, dest); guMtxF2L(src, dest); } diff --git a/soh/src/code/z_view.c b/soh/src/code/z_view.c index 97f1ad26e..e03daee83 100644 --- a/soh/src/code/z_view.c +++ b/soh/src/code/z_view.c @@ -2,6 +2,9 @@ #include "vt.h" #include +#include + +#include "soh/frame_interpolation.h" vu32 D_8012ABF0 = true; @@ -277,6 +280,10 @@ void func_800AAA50(View* view, s32 arg1) { } } +static float sqr(float a) { + return a * a; +} + s32 func_800AAA9C(View* view) { f32 aspect; s32 width; @@ -307,6 +314,85 @@ s32 func_800AAA9C(View* view) { height = view->viewport.bottomY - view->viewport.topY; aspect = (f32)width / (f32)height; + viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); + LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667); + view->viewingPtr = viewing; + + if (view->eye.x == view->lookAt.x && view->eye.y == view->lookAt.y && view->eye.z == view->lookAt.z) { + view->eye.x += 1.0f; + view->eye.y += 1.0f; + view->eye.z += 1.0f; + } + + func_800ABE74(view->eye.x, view->eye.y, view->eye.z); + MtxF viewingF; + guLookAtF(viewingF.mf, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, view->up.x, + view->up.y, view->up.z); + + // Some heuristics to identify instant camera movements and skip interpolation in that case + + static View old_view; + + float dirx = view->eye.x - view->lookAt.x; + float diry = view->eye.y - view->lookAt.y; + float dirz = view->eye.z - view->lookAt.z; + float dir_dist = sqrtf(sqr(dirx) + sqr(diry) + sqr(dirz)); + dirx /= dir_dist; + diry /= dir_dist; + dirz /= dir_dist; + + float odirx = old_view.eye.x - old_view.lookAt.x; + float odiry = old_view.eye.y - old_view.lookAt.y; + float odirz = old_view.eye.z - old_view.lookAt.z; + float odir_dist = sqrtf(sqr(odirx) + sqr(odiry) + sqr(odirz)); + odirx /= odir_dist; + odiry /= odir_dist; + odirz /= odir_dist; + + float eye_dist = sqrtf(sqr(view->eye.x - old_view.eye.x) + sqr(view->eye.y - old_view.eye.y) + sqr(view->eye.z - old_view.eye.z)); + float look_dist = sqrtf(sqr(view->lookAt.x - old_view.lookAt.x) + sqr(view->lookAt.y - old_view.lookAt.y) + sqr(view->lookAt.z - old_view.lookAt.z)); + float up_dist = sqrtf(sqr(view->up.x - old_view.up.x) + sqr(view->up.y - old_view.up.y) + sqr(view->up.z - old_view.up.z)); + float d_dist = sqrtf(sqr(dirx - odirx) + sqr(diry - odiry) + sqr(dirz - odirz)); + + bool dont_interpolate = false; + + if (up_dist < 0.01 && d_dist < 0.01) { + if (eye_dist + look_dist > 300) { + dont_interpolate = true; + } + } else { + if (eye_dist >= 400) { + dont_interpolate = true; + } + if (look_dist >= 100) { + dont_interpolate = true; + } + if (up_dist >= 1.50f) { + dont_interpolate = true; + } + if (d_dist >= 1.414f && look_dist >= 15) { + dont_interpolate = true; + } + if (d_dist >= 1.414f && up_dist >= 0.31f && look_dist >= 1 && eye_dist >= 300) { + dont_interpolate = true; + } + if (d_dist >= 0.5f && up_dist >= 0.31f && look_dist >= 3 && eye_dist >= 170) { + dont_interpolate = true; + } + if (look_dist >= 52 && eye_dist >= 52) { + dont_interpolate = true; + } + if (look_dist >= 30 && eye_dist >= 90) { + dont_interpolate = true; + } + } + + if (dont_interpolate) { + FrameInterpolation_DontInterpolateCamera(); + } + + FrameInterpolation_RecordOpenChild(NULL, FrameInterpolation_GetCameraEpoch()); + if (HREG(80) == 11) { if (HREG(94) != 11) { HREG(94) = 11; @@ -347,22 +433,17 @@ s32 func_800AAA9C(View* view) { gSPPerspNormalize(POLY_KAL_DISP++, view->normal); gSPMatrix(POLY_KAL_DISP++, projection, G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION); - viewing = Graph_Alloc(gfxCtx, sizeof(Mtx)); - LogUtils_CheckNullPointer("viewing", viewing, "../z_view.c", 667); - view->viewingPtr = viewing; - - if (view->eye.x == view->lookAt.x && view->eye.y == view->lookAt.y && view->eye.z == view->lookAt.z) { - view->eye.x += 1.0f; - view->eye.y += 1.0f; - view->eye.z += 1.0f; - } - - func_800ABE74(view->eye.x, view->eye.y, view->eye.z); - guLookAt(viewing, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, view->up.x, - view->up.y, view->up.z); + Matrix_MtxFToMtx(viewingF.mf, viewing); view->viewing = *viewing; + + /*if (eye_dist > 1 || look_dist > 1 || abs(up_dist) > 0.1 || abs(d_dist) > 0.1) + printf("%d %f %f %f, %f %f %f, %f %f %f, %f %f %f %f %d\n", (int)view->fovy, view->eye.x, view->eye.y, view->eye.z, view->lookAt.x, view->lookAt.y, view->lookAt.z, + view->up.x, view->up.y, view->up.z, eye_dist, look_dist, up_dist, d_dist, dont_interpolate);*/ + + old_view = *view; + if (QREG(88) & 2) { s32 i; MtxF mf; @@ -374,10 +455,10 @@ s32 func_800AAA9C(View* view) { } osSyncPrintf("\n"); } - gSPMatrix(POLY_OPA_DISP++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); gSPMatrix(POLY_XLU_DISP++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); gSPMatrix(POLY_KAL_DISP++, viewing, G_MTX_NOPUSH | G_MTX_MUL | G_MTX_PROJECTION); + FrameInterpolation_RecordCloseChild(); CLOSE_DISPS(gfxCtx, "../z_view.c", 711); diff --git a/soh/src/code/z_vismono.c b/soh/src/code/z_vismono.c index 82acc9a17..2af876ad6 100644 --- a/soh/src/code/z_vismono.c +++ b/soh/src/code/z_vismono.c @@ -42,7 +42,7 @@ Gfx* VisMono_DrawTexture(VisMono* this, Gfx* gfx) s32 y; s32 height = 3; //u16* tex = D_0F000000; - u16* tex = 0xFF000000; + u16* tex = SEG_ADDR(0xF, 0); gDPPipeSync(gfx++); gDPSetOtherMode(gfx++, diff --git a/soh/src/code/z_vr_box.c b/soh/src/code/z_vr_box.c index 7925e5cb9..76753e096 100644 --- a/soh/src/code/z_vr_box.c +++ b/soh/src/code/z_vr_box.c @@ -248,7 +248,7 @@ s32 func_800ADBB0(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s3 for (phi_t2_4 = 0, phi_ra = 0; phi_ra < 4; phi_ra++, phi_a2_4 += 0x1F) { for (phi_a0_4 = 0, phi_t1 = 0; phi_t1 < 4; phi_t1++, phi_a0_4 += 0x3F, phi_t2_4 += 4) { - gDPLoadTextureTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[0] + D_8012AC90[arg8], + gDPLoadTextureTile(skyboxCtx->unk_138++, skyboxCtx->textures[0][arg8], G_IM_FMT_CI, G_IM_SIZ_8b, 256, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x3F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); @@ -360,11 +360,11 @@ s32 func_800AE2C0(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s3 phi_a2_4 = 0; for (phi_t2_4 = 0, phi_ra = 0; phi_ra < 4; phi_ra++, phi_a2_4 += 0x1F) { for (phi_a0_4 = 0, phi_t1 = 0; phi_t1 < 4; phi_t1++, phi_a0_4 += 0x1F, phi_t2_4 += 4) { - gDPLoadMultiTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[0] + D_8012ADC0[arg8], 0, + gDPLoadMultiTile(skyboxCtx->unk_138++, skyboxCtx->textures[0][arg8], 0, G_TX_RENDERTILE, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x1F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPLoadMultiTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[1] + D_8012ADC0[arg8], 0x80, 1, + gDPLoadMultiTile(skyboxCtx->unk_138++, skyboxCtx->textures[1][arg8], 0x80, 1, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x1F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); @@ -379,11 +379,11 @@ s32 func_800AE2C0(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s3 phi_a2_4 = 0; for (phi_t2_4 = 0, phi_ra = 0; phi_ra < 2; phi_ra++, phi_a2_4 += 0x1F) { for (phi_a0_4 = 0, phi_t1 = 0; phi_t1 < 4; phi_t1++, phi_a0_4 += 0x1F, phi_t2_4 += 4) { - gDPLoadMultiTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[0] + D_8012ADC0[arg8], 0, + gDPLoadMultiTile(skyboxCtx->unk_138++, skyboxCtx->textures[0][arg8], 0, G_TX_RENDERTILE, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x1F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPLoadMultiTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[1] + D_8012ADC0[arg8], 0x80, 1, + gDPLoadMultiTile(skyboxCtx->unk_138++, skyboxCtx->textures[1][arg8], 0x80, 1, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x1F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); @@ -394,11 +394,11 @@ s32 func_800AE2C0(SkyboxContext* skyboxCtx, Vtx* roomVtx, s32 arg2, s32 arg3, s3 phi_a2_4 -= 0x1F; for (phi_ra = 0; phi_ra < 2; phi_ra++, phi_a2_4 -= 0x1F) { for (phi_a0_4 = 0, phi_t1 = 0; phi_t1 < 4; phi_t1++, phi_a0_4 += 0x1F, phi_t2_4 += 4) { - gDPLoadMultiTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[0] + D_8012ADC0[arg8], 0, + gDPLoadMultiTile(skyboxCtx->unk_138++, skyboxCtx->textures[0][arg8], 0, G_TX_RENDERTILE, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x1F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); - gDPLoadMultiTile(skyboxCtx->unk_138++, (uintptr_t)skyboxCtx->staticSegments[1] + D_8012ADC0[arg8], 0x80, 1, + gDPLoadMultiTile(skyboxCtx->unk_138++, skyboxCtx->textures[1][arg8], 0x80, 1, G_IM_FMT_CI, G_IM_SIZ_8b, 128, 0, phi_a0_4, phi_a2_4, phi_a0_4 + 0x1F, phi_a2_4 + 0x1F, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOLOD); @@ -444,25 +444,20 @@ void func_800AF178(SkyboxContext* skyboxCtx, s32 arg1) { } } -void LoadSkyboxTex(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height, int offsetW, int offsetH) +void LoadSkyboxTex(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height, int offsetW, int offsetH) { - if (globalCtx != NULL && globalCtx->state.gfxCtx != NULL && globalCtx->state.gfxCtx != 0xABABABAB) - gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, ((uintptr_t)skyboxCtx->staticSegments[segmentIndex] + (imageIndex * (offsetW * offsetH)))); - - memcpy((uintptr_t)skyboxCtx->staticSegments[segmentIndex] + (imageIndex * (offsetW * offsetH)), ResourceMgr_LoadTexByName(tex), width * height); + skyboxCtx->textures[segmentIndex][imageIndex] = tex; } -void LoadSkyboxTexAtOffset(SkyboxContext* skyboxCtx, int segmentIndex, char* tex, int width, int height, int offset) +void LoadSkyboxTexAtOffset(SkyboxContext* skyboxCtx, int segmentIndex, int imageIndex, char* tex, int width, int height, int offset) { - memcpy((uintptr_t)skyboxCtx->staticSegments[segmentIndex] + offset, ResourceMgr_LoadTexByName(tex), width * height); + skyboxCtx->textures[segmentIndex][imageIndex] = tex; } -void LoadSkyboxPalette(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, int paletteIndex, char* palTex, int width, +void LoadSkyboxPalette(SkyboxContext* skyboxCtx, int paletteIndex, char* palTex, int width, int height) { - if (globalCtx != NULL && globalCtx->state.gfxCtx != NULL && globalCtx->state.gfxCtx != 0xABABABAB) - gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyOpa.p++, (uintptr_t)skyboxCtx->palettes + (paletteIndex * (width * height * 2))); - - memcpy((uintptr_t)skyboxCtx->palettes + (paletteIndex * (width * height * 2)), ResourceMgr_LoadTexByName(palTex), width * height * 2); + skyboxCtx->palettes[paletteIndex] = palTex; + skyboxCtx->palette_size = width * height; } static const char* sSBVRFine0Tex[] = @@ -634,377 +629,316 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox } - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, (128 * 64 * 4) + (128 * 128), "../z_vr_box.c", 1054); - SkyboxTableEntry entryA = sSkyboxTable[sp41]; for (int i = 0; i < 5; i++) - LoadSkyboxTex(globalCtx, skyboxCtx, 0, i, entryA.textures[i], 128, i == 4 ? 128 : 64, 128, 64); + LoadSkyboxTex(skyboxCtx, 0, i, entryA.textures[i], 128, i == 4 ? 128 : 64, 128, 64); SkyboxTableEntry entryB = sSkyboxTable[sp40]; - skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, (128 * 64 * 4) + (128 * 128), "../z_vr_box.c", 1060); - for (int i = 0; i < 5; i++) - LoadSkyboxTex(globalCtx, skyboxCtx, 1, i, entryB.textures[i], 128, i == 4 ? 128 : 64, 128, 64); + LoadSkyboxTex(skyboxCtx, 1, i, entryB.textures[i], 128, i == 4 ? 128 : 64, 128, 64); if ((sp41 & 1) ^ ((sp41 & 4) >> 2)) { - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 256 * 2, "../z_vr_box.c", 1072); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, entryA.palettes[0], 16, 8); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, entryB.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 0, entryA.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 1, entryB.palettes[0], 16, 8); } else { - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 256 * 2, "../z_vr_box.c", 1085); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, entryB.palettes[0], 16, 8); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, entryA.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 0, entryB.palettes[0], 16, 8); + LoadSkyboxPalette(skyboxCtx, 1, entryA.palettes[0], 16, 8); } break; case SKYBOX_BAZAAR: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); + LoadSkyboxTex(skyboxCtx, 0, 0, gBazaarBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gBazaar2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gBazaarBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gBazaar2BgTex, 256, 256, 256, 256); - - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gBazaarBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gBazaarBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gBazaarBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gBazaarBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_HOUSE_LINK: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gLinksHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gLinksHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gLinksHouse3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gLinksHouse4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gLinksHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gLinksHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gLinksHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gLinksHouse4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gLinksHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gLinksHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gLinksHouseBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gLinksHouseBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gLinksHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gLinksHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gLinksHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gLinksHouseBg4Tlut, 16, 16); break; case SKYBOX_OVERCAST_SUNSET: - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0xC000, "../z_vr_box.c", 1226); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gSunsetOvercastSkybox1Tex, 128, 64, 0x0); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gSunsetOvercastSkybox2Tex, 128, 64, 0x2000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gSunsetOvercastSkybox3Tex, 128, 64, 0x4000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gSunsetOvercastSkybox4Tex, 128, 64, 0x6000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gSunsetOvercastSkybox5Tex, 128, 128, 0x8000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 0, gSunsetOvercastSkybox1Tex, 128, 64, 0x0); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 1, gSunsetOvercastSkybox2Tex, 128, 64, 0x2000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 2, gSunsetOvercastSkybox3Tex, 128, 64, 0x4000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 3, gSunsetOvercastSkybox4Tex, 128, 64, 0x6000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 4, gSunsetOvercastSkybox5Tex, 128, 128, 0x8000); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x100, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gSunsetOvercastSkyboxTlut, 16, 8); + LoadSkyboxPalette(skyboxCtx, 0, gSunsetOvercastSkyboxTlut, 16, 8); break; case SKYBOX_MARKET_ADULT: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gMarketRuinsBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gMarketRuins2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gMarketRuins3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gMarketRuins4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gMarketRuinsBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gMarketRuins2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gMarketRuins3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gMarketRuins4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gMarketRuinsBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gMarketRuinsBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gMarketRuinsBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gMarketRuinsBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gMarketRuinsBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gMarketRuinsBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gMarketRuinsBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gMarketRuinsBg4Tlut, 16, 16); break; case SKYBOX_CUTSCENE_MAP: - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000, "../z_vr_box.c", 1226); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gHoly0Skybox1Tex, 128, 64, 0x0); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gHoly0Skybox2Tex, 128, 64, 0x2000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gHoly0Skybox3Tex, 128, 64, 0x4000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gHoly0Skybox4Tex, 128, 64, 0x6000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gHoly0Skybox5Tex, 128, 128, 0x8000); - LoadSkyboxTexAtOffset(skyboxCtx, 0, gHoly0Skybox6Tex, 128, 128, 0xC000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 0, gHoly0Skybox1Tex, 128, 64, 0x0); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 1, gHoly0Skybox2Tex, 128, 64, 0x2000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 2, gHoly0Skybox3Tex, 128, 64, 0x4000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 3, gHoly0Skybox4Tex, 128, 64, 0x6000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 4, gHoly0Skybox5Tex, 128, 128, 0x8000); + LoadSkyboxTexAtOffset(skyboxCtx, 0, 5, gHoly0Skybox6Tex, 128, 128, 0xC000); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x100 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gHoly0SkyboxTlut, 16, 8); + LoadSkyboxPalette(skyboxCtx, 0, gHoly0SkyboxTlut, 16, 8); - skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, 0x10000, "../z_vr_box.c", 1226); - LoadSkyboxTexAtOffset(skyboxCtx, 1, gHoly1Skybox1Tex, 128, 64, 0x0); - LoadSkyboxTexAtOffset(skyboxCtx, 1, gHoly1Skybox2Tex, 128, 64, 0x2000); - LoadSkyboxTexAtOffset(skyboxCtx, 1, gHoly1Skybox3Tex, 128, 64, 0x4000); - LoadSkyboxTexAtOffset(skyboxCtx, 1, gHoly1Skybox4Tex, 128, 64, 0x6000); - LoadSkyboxTexAtOffset(skyboxCtx, 1, gHoly1Skybox5Tex, 128, 128, 0x8000); - LoadSkyboxTexAtOffset(skyboxCtx, 1, gHoly1Skybox6Tex, 128, 128, 0xC000); + LoadSkyboxTexAtOffset(skyboxCtx, 1, 0, gHoly1Skybox1Tex, 128, 64, 0x0); + LoadSkyboxTexAtOffset(skyboxCtx, 1, 1, gHoly1Skybox2Tex, 128, 64, 0x2000); + LoadSkyboxTexAtOffset(skyboxCtx, 1, 2, gHoly1Skybox3Tex, 128, 64, 0x4000); + LoadSkyboxTexAtOffset(skyboxCtx, 1, 3, gHoly1Skybox4Tex, 128, 64, 0x6000); + LoadSkyboxTexAtOffset(skyboxCtx, 1, 4, gHoly1Skybox5Tex, 128, 128, 0x8000); + LoadSkyboxTexAtOffset(skyboxCtx, 1, 5, gHoly1Skybox6Tex, 128, 128, 0xC000); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gHoly1SkyboxTlut, 16, 8); + LoadSkyboxPalette(skyboxCtx, 1, gHoly1SkyboxTlut, 16, 8); break; case SKYBOX_MARKET_CHILD_DAY: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gMarketDayBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gMarketDay2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gMarketDay3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gMarketDay4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gMarketDayBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gMarketDay2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gMarketDay3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gMarketDay4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gMarketDayBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gMarketDayBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gMarketDayBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gMarketDayBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gMarketDayBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gMarketDayBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gMarketDayBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gMarketDayBg4Tlut, 16, 16); break; case SKYBOX_MARKET_CHILD_NIGHT: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gMarketNightBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gMarketNight2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gMarketNight3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gMarketNight4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gMarketNightBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gMarketNight2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gMarketNight3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gMarketNight4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gMarketNightBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gMarketNightBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gMarketNightBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gMarketNightBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gMarketNightBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gMarketNightBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gMarketNightBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gMarketNightBg4Tlut, 16, 16); break; case SKYBOX_HAPPY_MASK_SHOP: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gMaskShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gMaskShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gMaskShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gMaskShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gMaskShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gMaskShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gMaskShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gMaskShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_HOUSE_KNOW_IT_ALL_BROTHERS: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gKnowItAllBrosHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gKnowItAllBrosHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gKnowItAllBrosHouse3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gKnowItAllBrosHouse4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gKnowItAllBrosHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gKnowItAllBrosHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gKnowItAllBrosHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gKnowItAllBrosHouse4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gKnowItAllBrosHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gKnowItAllBrosHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gKnowItAllBrosHouseBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gKnowItAllBrosHouseBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gKnowItAllBrosHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gKnowItAllBrosHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gKnowItAllBrosHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gKnowItAllBrosHouseBg4Tlut, 16, 16); break; case SKYBOX_HOUSE_OF_TWINS: skyboxCtx->unk_140 = 2; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 3, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gHouseOfTwinsBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gHouseOfTwins2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gHouseOfTwins3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gHouseOfTwinsBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gHouseOfTwins2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gHouseOfTwins3BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 3, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gHouseOfTwinsBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gHouseOfTwinsBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gHouseOfTwinsBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gHouseOfTwinsBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gHouseOfTwinsBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gHouseOfTwinsBg3Tlut, 16, 16); break; case SKYBOX_STABLES: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gStableBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gStable2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gStable3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gStable4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gStableBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gStable2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gStable3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gStable4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gStableBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gStableBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gStableBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gStableBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gStableBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gStableBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gStableBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gStableBg4Tlut, 16, 16); break; case SKYBOX_HOUSE_KAKARIKO: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gCarpentersHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gCarpentersHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gCarpentersHouse3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gCarpentersHouse4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gCarpentersHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gCarpentersHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gCarpentersHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gCarpentersHouse4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gCarpentersHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gCarpentersHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gCarpentersHouseBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gCarpentersHouseBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gCarpentersHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gCarpentersHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gCarpentersHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gCarpentersHouseBg4Tlut, 16, 16); break; case SKYBOX_KOKIRI_SHOP: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gKokiriShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gKokiriShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gKokiriShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gKokiriShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gKokiriShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gKokiriShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gKokiriShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gKokiriShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_GORON_SHOP: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gGoronShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gGoronShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gGoronShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gGoronShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gGoronShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gGoronShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gGoronShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gGoronShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_ZORA_SHOP: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gZoraShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gZoraShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gZoraShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gZoraShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gZoraShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gZoraShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gZoraShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gZoraShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_POTION_SHOP_KAKARIKO: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gKakPotionShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gKakPotionShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gKakPotionShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gKakPotionShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gKakPotionShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gKakPotionShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gKakPotionShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gKakPotionShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_POTION_SHOP_MARKET: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gMarketPotionShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gMarketPotionShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gMarketPotionShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gMarketPotionShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gMarketPotionShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gMarketPotionShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gMarketPotionShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gMarketPotionShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_BOMBCHU_SHOP: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 2, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gBombchuShopBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gBombchuShop2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gBombchuShopBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gBombchuShop2BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 2, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gBombchuShopBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gBombchuShopBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gBombchuShopBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gBombchuShopBg2Tlut, 16, 16); skyboxCtx->rot.y = 0.8f; break; case SKYBOX_HOUSE_RICHARD: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gRichardsHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gRichardsHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gRichardsHouse3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gRichardsHouse4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gRichardsHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gRichardsHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gRichardsHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gRichardsHouse4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gRichardsHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gRichardsHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gRichardsHouseBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gRichardsHouseBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gRichardsHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gRichardsHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gRichardsHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gRichardsHouseBg4Tlut, 16, 16); break; case SKYBOX_HOUSE_IMPA: skyboxCtx->unk_140 = 1; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 4, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gCowHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gCowHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gCowHouse3BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 3, gCowHouse4BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gCowHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gCowHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gCowHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 3, gCowHouse4BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 4, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gCowHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gCowHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gCowHouseBg3Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 3, gCowHouseBg4Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gCowHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gCowHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gCowHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 3, gCowHouseBg4Tlut, 16, 16); break; case SKYBOX_TENT: skyboxCtx->unk_140 = 2; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 3, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gCarpentersTentBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gCarpentersTent2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gCarpentersTent3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gCarpentersTentBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gCarpentersTent2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gCarpentersTent3BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 3, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gCarpentersTentBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gCarpentersTentBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gCarpentersTentBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gCarpentersTentBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gCarpentersTentBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gCarpentersTentBg3Tlut, 16, 16); break; case SKYBOX_HOUSE_MIDO: skyboxCtx->unk_140 = 2; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 3, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gMidosHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gMidosHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gMidosHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gMidosHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gMidosHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gMidosHouse3BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 3, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gMidosHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gMidosHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gMidosHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gMidosHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gMidosHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gMidosHouseBg3Tlut, 16, 16); break; case SKYBOX_HOUSE_SARIA: skyboxCtx->unk_140 = 2; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 3, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gSariasHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gSariasHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gSariasHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gSariasHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gSariasHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gSariasHouse3BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 3, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gSariasHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gSariasHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gSariasHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gSariasHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gSariasHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gSariasHouseBg3Tlut, 16, 16); break; case SKYBOX_HOUSE_ALLEY: skyboxCtx->unk_140 = 2; - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 3, "../z_vr_box.c", 1226); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 0, gBackAlleyHouseBgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 1, gBackAlleyHouse2BgTex, 256, 256, 256, 256); - LoadSkyboxTex(globalCtx, skyboxCtx, 0, 2, gBackAlleyHouse3BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 0, gBackAlleyHouseBgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 1, gBackAlleyHouse2BgTex, 256, 256, 256, 256); + LoadSkyboxTex(skyboxCtx, 0, 2, gBackAlleyHouse3BgTex, 256, 256, 256, 256); - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x200 * 3, "../z_vr_box.c", 1231); - LoadSkyboxPalette(globalCtx, skyboxCtx, 0, gBackAlleyHouseBgTlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 1, gBackAlleyHouseBg2Tlut, 16, 16); - LoadSkyboxPalette(globalCtx, skyboxCtx, 2, gBackAlleyHouseBg3Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 0, gBackAlleyHouseBgTlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 1, gBackAlleyHouseBg2Tlut, 16, 16); + LoadSkyboxPalette(skyboxCtx, 2, gBackAlleyHouseBg3Tlut, 16, 16); break; default: - skyboxCtx->staticSegments[0] = GameState_Alloc(&globalCtx->state, 0x10000 * 8, "../z_vr_box.c", 1226); - //skyboxCtx->staticSegments[1] = GameState_Alloc(&globalCtx->state, 0x10000 * 8, "../z_vr_box.c", 1226); - skyboxCtx->staticSegments[1] = malloc(0x10000 * 8); // OTRTODO - skyboxCtx->palettes = GameState_Alloc(&globalCtx->state, 0x1000, "../z_vr_box.c", 1226); break; } } @@ -1012,6 +946,7 @@ void Skybox_Setup(GlobalContext* globalCtx, SkyboxContext* skyboxCtx, s16 skybox void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) { GlobalContext* globalCtx = (GlobalContext*)state; + skyboxCtx->skyboxId = skyboxId; skyboxCtx->unk_140 = 0; skyboxCtx->rot.x = skyboxCtx->rot.y = skyboxCtx->rot.z = 0.0f; @@ -1051,3 +986,20 @@ void Skybox_Init(GameState* state, SkyboxContext* skyboxCtx, s16 skyboxId) { osSyncPrintf(VT_RST); } } + +void Skybox_Update(SkyboxContext* skyboxCtx) { + if (skyboxCtx->skyboxId != SKYBOX_NONE) { + osSyncPrintf(VT_FGCOL(GREEN)); + + if (skyboxCtx->unk_140 != 0) { + func_800AEFC8(skyboxCtx, skyboxCtx->skyboxId); + } else { + if (skyboxCtx->skyboxId == SKYBOX_CUTSCENE_MAP) { + func_800AF178(skyboxCtx, 6); + } else { + func_800AF178(skyboxCtx, 5); + } + } + osSyncPrintf(VT_RST); + } +} diff --git a/soh/src/code/z_vr_box_draw.c b/soh/src/code/z_vr_box_draw.c index a5c0610f7..13eb93bd0 100644 --- a/soh/src/code/z_vr_box_draw.c +++ b/soh/src/code/z_vr_box_draw.c @@ -1,5 +1,7 @@ #include "global.h" +#include "soh/frame_interpolation.h" + Mtx* sSkyboxDrawMatrix; Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { @@ -13,26 +15,15 @@ Mtx* SkyboxDraw_UpdateMatrix(SkyboxContext* skyboxCtx, f32 x, f32 y, f32 z) { void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyboxId, s16 blend, f32 x, f32 y, f32 z) { OPEN_DISPS(gfxCtx, "../z_vr_box_draw.c", 52); + FrameInterpolation_RecordOpenChild(NULL, FrameInterpolation_GetCameraEpoch()); func_800945A0(gfxCtx); //gsSPShaderTest(POLY_OPA_DISP++); - gSPInvalidateTexCache(POLY_OPA_DISP++, 0); - - // OTRTODO: Not working... - /*for (int i = 0; i < 8; i++) - { - if (skyboxCtx->staticSegments[0] != NULL) - gSPInvalidateTexCache(POLY_OPA_DISP++, (uintptr_t)skyboxCtx->staticSegments[0] + (0x10000 * i)); - - if (skyboxCtx->staticSegments[1] != NULL) - gSPInvalidateTexCache(POLY_OPA_DISP++, (uintptr_t)skyboxCtx->staticSegments[1] + (0x10000 * i)); - }*/ - - gSPSegment(POLY_OPA_DISP++, 0x7, skyboxCtx->staticSegments[0]); + /*gSPSegment(POLY_OPA_DISP++, 0x7, skyboxCtx->staticSegments[0]); gSPSegment(POLY_OPA_DISP++, 0x8, skyboxCtx->staticSegments[1]); - gSPSegment(POLY_OPA_DISP++, 0x9, skyboxCtx->palettes); + gSPSegment(POLY_OPA_DISP++, 0x9, skyboxCtx->palettes);*/ gDPSetPrimColor(POLY_OPA_DISP++, 0x00, 0x00, 0, 0, 0, blend); gSPTexture(POLY_OPA_DISP++, 0x8000, 0x8000, 0, G_TX_RENDERTILE, G_ON); @@ -50,7 +41,12 @@ void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyb gDPSetColorDither(POLY_OPA_DISP++, G_CD_MAGICSQ); gDPSetTextureFilter(POLY_OPA_DISP++, G_TF_BILERP); - gDPLoadTLUT_pal256(POLY_OPA_DISP++, skyboxCtx->palettes[0]); + if (skyboxCtx->palette_size == 256) { + gDPLoadTLUT_pal256(POLY_OPA_DISP++, skyboxCtx->palettes[0]); + } else { + gDPLoadTLUT_pal128(POLY_OPA_DISP++, 0, skyboxCtx->palettes[0]); + gDPLoadTLUT_pal128(POLY_OPA_DISP++, 1, skyboxCtx->palettes[1]); + } gDPSetTextureLUT(POLY_OPA_DISP++, G_TT_RGBA16); gDPSetTextureConvert(POLY_OPA_DISP++, G_TC_FILT); @@ -92,7 +88,7 @@ void SkyboxDraw_Draw(SkyboxContext* skyboxCtx, GraphicsContext* gfxCtx, s16 skyb gDPPipeSync(POLY_OPA_DISP++); //gsSPShaderTest2(POLY_OPA_DISP++); - + FrameInterpolation_RecordCloseChild(); CLOSE_DISPS(gfxCtx, "../z_vr_box_draw.c", 125); } diff --git a/soh/src/libultra/gu/guLookAt.c b/soh/src/libultra/gu/guLookAt.c index 58946f4dc..f94204bc4 100644 --- a/soh/src/libultra/gu/guLookAt.c +++ b/soh/src/libultra/gu/guLookAt.c @@ -62,5 +62,6 @@ void guLookAt(Mtx* m, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp); - guMtxF2L((MtxF*)mf, m); + //guMtxF2L((MtxF*)mf, m); + Matrix_MtxFToMtx((MtxF*)mf, m); } diff --git a/soh/src/libultra/gu/guPerspectiveF.c b/soh/src/libultra/gu/guPerspectiveF.c index 731cec3e9..dd020f589 100644 --- a/soh/src/libultra/gu/guPerspectiveF.c +++ b/soh/src/libultra/gu/guPerspectiveF.c @@ -37,6 +37,6 @@ void guPerspective(Mtx* m, u16* perspNorm, f32 fovy, f32 aspect, f32 near, f32 f f32 mf[4][4]; guPerspectiveF(mf, perspNorm, fovy, aspect, near, far, scale); - guMtxF2L((MtxF*)mf, m); - + //guMtxF2L((MtxF*)mf, m); + Matrix_MtxFToMtx((MtxF*)mf, m); } diff --git a/soh/src/libultra/gu/ortho.c b/soh/src/libultra/gu/ortho.c index 517ba1dcc..77d43ce21 100644 --- a/soh/src/libultra/gu/ortho.c +++ b/soh/src/libultra/gu/ortho.c @@ -1,5 +1,7 @@ #include "global.h" +#include "soh/frame_interpolation.h" + void guOrthoF(f32 mf[4][4], f32 left, f32 right, f32 bottom, f32 top, f32 near, f32 far, f32 scale) { s32 i, j; @@ -25,5 +27,8 @@ void guOrtho(Mtx* mtx, f32 left, f32 right, f32 bottom, f32 top, f32 near, f32 f guOrthoF(mf, left, right, bottom, top, near, far, scale); - guMtxF2L((MtxF*)mf, mtx); + //guMtxF2L((MtxF*)mf, mtx); + FrameInterpolation_RecordOpenChild("ortho", 0); + Matrix_MtxFToMtx((MtxF*)mf, mtx); + FrameInterpolation_RecordCloseChild(); } diff --git a/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c b/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c index 260fa21ea..9ca8599b9 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c +++ b/soh/src/overlays/actors/ovl_Bg_Ddan_Kd/z_bg_ddan_kd.c @@ -121,8 +121,8 @@ void BgDdanKd_CheckForExplosions(BgDdanKd* this, GlobalContext* globalCtx) { } } -static Vec3f velocity = { 0.0f, 5.0f, 0.0f }; -static Vec3f accel = { 0.0f, -0.45f, 0.0f }; +Vec3f sBgDdanKdVelocity = { 0.0f, 5.0f, 0.0f }; +Vec3f sBgDdanKdAccel = { 0.0f, -0.45f, 0.0f }; void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { Vec3f pos1; @@ -158,11 +158,11 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { func_80033480(globalCtx, &pos1, 20.0f, 1, effectStrength * 135.0f, 60, 1); func_80033480(globalCtx, &pos2, 20.0f, 1, effectStrength * 135.0f, 60, 1); - velocity.x = Rand_CenteredFloat(3.0f); - velocity.z = Rand_CenteredFloat(3.0f); + sBgDdanKdVelocity.x = Rand_CenteredFloat(3.0f); + sBgDdanKdVelocity.z = Rand_CenteredFloat(3.0f); - func_8003555C(globalCtx, &pos1, &velocity, &accel); - func_8003555C(globalCtx, &pos2, &velocity, &accel); + func_8003555C(globalCtx, &pos1, &sBgDdanKdVelocity, &sBgDdanKdAccel); + func_8003555C(globalCtx, &pos2, &sBgDdanKdVelocity, &sBgDdanKdAccel); pos1 = this->dyna.actor.world.pos; pos1.z += 560.0f + Rand_ZeroOne() * 5.0f; @@ -170,7 +170,7 @@ void BgDdanKd_LowerStairs(BgDdanKd* this, GlobalContext* globalCtx) { pos1.y = Rand_ZeroOne() * 3.0f + (this->dyna.actor.floorHeight + 20.0f); func_80033480(globalCtx, &pos1, 20.0f, 1, effectStrength * 135.0f, 60, 1); - func_8003555C(globalCtx, &pos1, &velocity, &accel); + func_8003555C(globalCtx, &pos1, &sBgDdanKdVelocity, &sBgDdanKdAccel); } Camera_AddQuake(&globalCtx->mainCamera, 0, effectStrength * 0.6f, 3); Audio_PlaySoundGeneral(NA_SE_EV_PILLAR_SINK - SFX_FLAG, &this->dyna.actor.projectedPos, 4, &D_801333E0, @@ -192,11 +192,11 @@ void BgDdanKd_Draw(Actor* thisx, GlobalContext* globalCtx) { } void BgDdanKd_Reset(void) { - velocity.x = 0.0f; - velocity.y = 5.0f; - velocity.z = 0.0f; + sBgDdanKdVelocity.x = 0.0f; + sBgDdanKdVelocity.y = 5.0f; + sBgDdanKdVelocity.z = 0.0f; - accel.x = 0.0f; - accel.y = -0.45f; - accel.z = 0.0f; + sBgDdanKdAccel.x = 0.0f; + sBgDdanKdAccel.y = -0.45f; + sBgDdanKdAccel.z = 0.0f; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c index a089aa013..dbeb5eb7c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c +++ b/soh/src/overlays/actors/ovl_Bg_Dodoago/z_bg_dodoago.c @@ -74,13 +74,13 @@ static ColliderCylinderInit sColCylinderInitLeftRight = { { 50, 60, 280, { 0, 0, 0 } }, }; -static s16 sFirstExplosiveFlag = false; +s16 sBgDodoagoFirstExplosiveFlag = false; -static u8 sDisableBombCatcher; +u8 sBgDodoagoDisableBombCatcher; -static u8 sUnused[90]; // unknown length +//static u8 sUnused[90]; // unknown length -static s32 sTimer; +s32 sBgDodoagoTimer; void BgDodoago_SetupAction(BgDodoago* this, BgDodoagoActionFunc actionFunc) { this->actionFunc = actionFunc; @@ -135,7 +135,7 @@ void BgDodoago_Init(Actor* thisx, GlobalContext* globalCtx) { Collider_SetCylinder(globalCtx, &this->colliderRight, &this->dyna.actor, &sColCylinderInitLeftRight); BgDodoago_SetupAction(this, BgDodoago_WaitExplosives); - sDisableBombCatcher = false; + sBgDodoagoDisableBombCatcher = false; } void BgDodoago_Destroy(Actor* thisx, GlobalContext* globalCtx) { @@ -170,16 +170,16 @@ void BgDodoago_WaitExplosives(BgDodoago* this, GlobalContext* globalCtx) { } else { OnePointCutscene_Init(globalCtx, 3065, 20, &this->dyna.actor, MAIN_CAM); Audio_PlaySoundGeneral(NA_SE_SY_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - sTimer += 30; + sBgDodoagoTimer += 30; return; } // the flag is never set back to false, so this only runs once - if (!sFirstExplosiveFlag) { + if (!sBgDodoagoFirstExplosiveFlag) { // this disables the bomb catcher (see BgDodoago_Update) for a few seconds this->dyna.actor.parent = explosive; - sFirstExplosiveFlag = true; - sTimer = 50; + sBgDodoagoFirstExplosiveFlag = true; + sBgDodoagoTimer = 50; } } else if (Flags_GetEventChkInf(0xB0)) { Collider_UpdateCylinder(&this->dyna.actor, &this->colliderMain); @@ -219,11 +219,11 @@ void BgDodoago_OpenJaw(BgDodoago* this, GlobalContext* globalCtx) { } if (globalCtx->roomCtx.unk_74[BGDODOAGO_EYE_LEFT] != 255 || globalCtx->roomCtx.unk_74[BGDODOAGO_EYE_RIGHT] != 255) { - sTimer--; + sBgDodoagoTimer--; return; } - if (sTimer == 108) { + if (sBgDodoagoTimer == 108) { for (i = ARRAY_COUNT(dustOffsets) - 1; i >= 0; i--) { pos.x = dustOffsets[i].x + this->dyna.actor.world.pos.x; pos.y = dustOffsets[i].y + this->dyna.actor.world.pos.y; @@ -290,16 +290,16 @@ void BgDodoago_Update(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.parent = &bomb->actor; bomb->timer = 50; bomb->actor.speedXZ = 0.0f; - sTimer = 0; + sBgDodoagoTimer = 0; } } } else { - sTimer++; + sBgDodoagoTimer++; Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F); - if (!sDisableBombCatcher && sTimer > 140) { + if (!sBgDodoagoDisableBombCatcher && sBgDodoagoTimer > 140) { if (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) { // this prevents clearing the actor's parent pointer, effectively disabling the bomb catcher - sDisableBombCatcher++; + sBgDodoagoDisableBombCatcher++; } else { this->dyna.actor.parent = NULL; } @@ -322,7 +322,7 @@ void BgDodoago_Draw(Actor* thisx, GlobalContext* globalCtx) { } void BgDodoago_Reset(void) { - sFirstExplosiveFlag = false; - sDisableBombCatcher = 0; - sTimer = 0; + sBgDodoagoFirstExplosiveFlag = false; + sBgDodoagoDisableBombCatcher = 0; + sBgDodoagoTimer = 0; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c b/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c index d1e940619..9616204cd 100644 --- a/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c +++ b/soh/src/overlays/actors/ovl_Bg_Ganon_Otyuka/z_bg_ganon_otyuka.c @@ -8,6 +8,8 @@ #include "overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h" #include "vt.h" +#include "soh/frame_interpolation.h" + #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5) typedef enum { @@ -283,6 +285,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { platform = (BgGanonOtyuka*)actor; if (platform->dyna.actor.projectedPos.z > spBC) { + FrameInterpolation_RecordOpenChild(platform, 0); if (camera->eye.y > platform->dyna.actor.world.pos.y) { phi_s2 = sPlatformTopDL; } else { @@ -309,7 +312,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { } for (i = 0; i < ARRAY_COUNT(sSides); i++) { - if (platform->visibleSides & sSides[i]) { + if ((platform->visibleSides & sSides[i]) || 1) { // || 1 for frame interpolation Matrix_Push(); Matrix_Translate(sSideCenters[i].x, 0.0f, sSideCenters[i].z, MTXMODE_APPLY); Matrix_RotateY(sSideAngles[i], MTXMODE_APPLY); @@ -320,6 +323,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Pop(); } } + FrameInterpolation_RecordCloseChild(); } } @@ -333,6 +337,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { platform = (BgGanonOtyuka*)actor; if ((platform->dyna.actor.projectedPos.z > -30.0f) && (platform->flashState != FLASH_NONE)) { + FrameInterpolation_RecordOpenChild(platform, 0); gSPSegment(POLY_XLU_DISP++, 0x08, Gfx_TwoTexScroll(globalCtx->state.gfxCtx, 0, platform->flashTimer * 4, 0, 32, 64, 1, platform->flashTimer * 4, 0, 32, 64)); @@ -344,7 +349,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Translate(platform->dyna.actor.world.pos.x, 0.0f, platform->dyna.actor.world.pos.z, MTXMODE_NEW); for (i = 0; i < ARRAY_COUNT(sSides); i++) { - if (platform->unwalledSides & sSides[i]) { + if ((platform->unwalledSides & sSides[i]) || 1) { // || 1 for frame interpolation Matrix_Push(); Matrix_Translate(sSideCenters[i].x, 0.0f, sSideCenters[i].z, MTXMODE_APPLY); Matrix_RotateY(sSideAngles[i], MTXMODE_APPLY); @@ -356,6 +361,7 @@ void BgGanonOtyuka_Draw(Actor* thisx, GlobalContext* globalCtx) { Matrix_Pop(); } } + FrameInterpolation_RecordCloseChild(); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c index 7e3cd9155..2a4a4420f 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Gate/z_bg_haka_gate.c @@ -47,7 +47,7 @@ void BgHakaGate_SkullOfTruth(BgHakaGate* this, GlobalContext* globalCtx); void BgHakaGate_FalseSkull(BgHakaGate* this, GlobalContext* globalCtx); static s16 sSkullOfTruthRotY = 0x100; -static u8 sPuzzleState = 1; +static u8 sBgPoEventPuzzleState = 1; static f32 sStatueDistToPlayer = 0; static s16 sStatueRotY; @@ -82,7 +82,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) { if (sSkullOfTruthRotY != 0x100) { this->actionFunc = BgHakaGate_FalseSkull; } else if (ABS(thisx->shape.rot.y) < 0x4000) { - if ((Rand_ZeroOne() * 3.0f) < sPuzzleState) { + if ((Rand_ZeroOne() * 3.0f) < sBgPoEventPuzzleState) { this->vIsSkullOfTruth = true; sSkullOfTruthRotY = thisx->shape.rot.y + 0x8000; if (Flags_GetSwitch(globalCtx, this->switchFlag)) { @@ -91,7 +91,7 @@ void BgHakaGate_Init(Actor* thisx, GlobalContext* globalCtx) { this->actionFunc = BgHakaGate_SkullOfTruth; } } else { - sPuzzleState++; + sBgPoEventPuzzleState++; this->actionFunc = BgHakaGate_FalseSkull; } } else { @@ -141,7 +141,7 @@ void BgHakaGate_Destroy(Actor* thisx, GlobalContext* globalCtx) { DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); if (this->dyna.actor.params == BGHAKAGATE_STATUE) { sSkullOfTruthRotY = 0x100; - sPuzzleState = 1; + sBgPoEventPuzzleState = 1; } } @@ -178,7 +178,7 @@ void BgHakaGate_StatueIdle(BgHakaGate* this, GlobalContext* globalCtx) { } } } else { - if (sPuzzleState == SKULL_OF_TRUTH_FOUND) { + if (sBgPoEventPuzzleState == SKULL_OF_TRUTH_FOUND) { this->actionFunc = BgHakaGate_StatueInactive; } else { this->vTimer = 0; @@ -192,7 +192,12 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { s16 turnAngle; this->vTurnRateDeg10++; - this->vTurnRateDeg10 = CLAMP_MAX(this->vTurnRateDeg10, 5); + if (CVar_GetS32("gFasterBlockPush", 0) != 0) { + this->vTurnRateDeg10 = 10; + CLAMP_MAX(this->vTurnRateDeg10, 5); + } else { + this->vTurnRateDeg10 = CLAMP_MAX(this->vTurnRateDeg10, 5); + } turnFinished = Math_StepToS(&this->vTurnAngleDeg10, 600, this->vTurnRateDeg10); turnAngle = this->vTurnAngleDeg10 * this->vTurnDirection; this->dyna.actor.shape.rot.y = (this->vRotYDeg10 + turnAngle) * 0.1f * (0x10000 / 360.0f); @@ -212,7 +217,7 @@ void BgHakaGate_StatueTurn(BgHakaGate* this, GlobalContext* globalCtx) { this->vRotYDeg10 = (this->vRotYDeg10 + turnAngle) % 3600; this->vTurnRateDeg10 = 0; this->vTurnAngleDeg10 = 0; - this->vTimer = 5; + this->vTimer = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 2 : 5; this->actionFunc = BgHakaGate_StatueIdle; this->dyna.unk_150 = 0.0f; } @@ -238,7 +243,7 @@ void BgHakaGate_FloorClosed(BgHakaGate* this, GlobalContext* globalCtx) { sStatueDistToPlayer = 0.0f; if (ABS(yawDiff) < 0x80) { Flags_SetSwitch(globalCtx, this->switchFlag); - sPuzzleState = SKULL_OF_TRUTH_FOUND; + sBgPoEventPuzzleState = SKULL_OF_TRUTH_FOUND; this->actionFunc = BgHakaGate_DoNothing; } else { func_80078884(NA_SE_SY_ERROR); diff --git a/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c b/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c index 83cd8dfd6..877916b67 100644 --- a/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c +++ b/soh/src/overlays/actors/ovl_Bg_Haka_Trap/z_bg_haka_trap.c @@ -28,7 +28,7 @@ void func_80880AE8(BgHakaTrap* this, GlobalContext* globalCtx); void func_80880C0C(BgHakaTrap* this, GlobalContext* globalCtx); void func_80880D68(BgHakaTrap* this); -static UNK_TYPE D_80880F30 = 0; +UNK_TYPE D_80880F30 = 0; const ActorInit Bg_Haka_Trap_InitVars = { ACTOR_BG_HAKA_TRAP, @@ -107,7 +107,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static UNK_TYPE D_80881014 = 0; +UNK_TYPE D_80881014 = 0; void BgHakaTrap_Init(Actor* thisx, GlobalContext* globalCtx) { BgHakaTrap* this = (BgHakaTrap*)thisx; s32 pad; diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c index 4522a9486..a962dbc2e 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rock/z_bg_hidan_rock.c @@ -120,7 +120,7 @@ void func_8088B24C(BgHidanRock* this) { this->actionFunc = func_8088B990; } -static f32 D_8088BFC0 = 0.0f; +f32 D_8088BFC0 = 0.0f; void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) { f32 sp2C; s32 temp_v1; @@ -137,7 +137,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) { } } - this->dyna.actor.speedXZ += 0.05f; + this->dyna.actor.speedXZ += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 0.5f : 0.05f; this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); if (D_8088BFC0 > 0.0f) { @@ -156,7 +156,7 @@ void func_8088B268(BgHidanRock* this, GlobalContext* globalCtx) { this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; D_8088BFC0 = 0.0f; this->dyna.actor.speedXZ = 0.0f; - this->timer = 5; + this->timer = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 2 : 5; } func_8002F974(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c b/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c index 73044e8b1..c2599e185 100644 --- a/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c +++ b/soh/src/overlays/actors/ovl_Bg_Hidan_Rsekizou/z_bg_hidan_rsekizou.c @@ -240,7 +240,8 @@ void BgHidanRsekizou_Draw(Actor* thisx, GlobalContext* globalCtx) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x14); - if ((s16)((Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) - this->dyna.actor.shape.rot.y) - 0x2E6C) >= 0) { + // Strange original code. Add || 1 for frame interpolation to get correct. + if ((s16)((Camera_GetCamDirYaw(GET_ACTIVE_CAM(globalCtx)) - this->dyna.actor.shape.rot.y) - 0x2E6C) >= 0 || 1) { for (i = 3; i >= 0; i--) { POLY_XLU_DISP = BgHidanRsekizou_DrawFireball(globalCtx, this, i, &mf, 0, POLY_XLU_DISP); } diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c b/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c index 1d50e6c49..dc1a3b758 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_1flift/z_bg_jya_1flift.c @@ -23,7 +23,7 @@ void BgJya1flift_SetupDoNothing(BgJya1flift* this); void BgJya1flift_ResetMoveDelay(BgJya1flift* this); void BgJya1flift_DelayMove(BgJya1flift* this, GlobalContext* globalCtx); -static u8 sIsSpawned = false; +static u8 sKankyoIsSpawned = false; const ActorInit Bg_Jya_1flift_InitVars = { ACTOR_BG_JYA_1FLIFT, @@ -94,9 +94,9 @@ void BgJya1flift_InitCollision(Actor* thisx, GlobalContext* globalCtx) { void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJya1flift* this = (BgJya1flift*)thisx; // "1 F lift" - osSyncPrintf("(1Fリフト)(flag %d)(room %d)\n", sIsSpawned, globalCtx->roomCtx.curRoom.num); + osSyncPrintf("(1Fリフト)(flag %d)(room %d)\n", sKankyoIsSpawned, globalCtx->roomCtx.curRoom.num); this->hasInitialized = false; - if (sIsSpawned) { + if (sKankyoIsSpawned) { Actor_Kill(thisx); return; } @@ -109,7 +109,7 @@ void BgJya1flift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJya1flift_SetupWaitForSwitch(this); } thisx->room = -1; - sIsSpawned = true; + sKankyoIsSpawned = true; this->hasInitialized = true; } @@ -117,7 +117,7 @@ void BgJya1flift_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgJya1flift* this = (BgJya1flift*)thisx; if (this->hasInitialized) { - sIsSpawned = false; + sKankyoIsSpawned = false; Collider_DestroyCylinder(globalCtx, &this->collider); DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c b/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c index 934329337..e872a4cdf 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Bigmirror/z_bg_jya_bigmirror.c @@ -14,7 +14,7 @@ void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Update(Actor* thisx, GlobalContext* globalCtx); void BgJyaBigmirror_Draw(Actor* thisx, GlobalContext* globalCtx); -static u8 sIsSpawned = false; +static u8 sKankyoIsSpawned = false; const ActorInit Bg_Jya_Bigmirror_InitVars = { ACTOR_BG_JYA_BIGMIRROR, @@ -176,7 +176,7 @@ void BgJyaBigmirror_HandleMirRay(Actor* thisx, GlobalContext* globalCtx) { void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaBigmirror* this = (BgJyaBigmirror*)thisx; - if (sIsSpawned) { + if (sKankyoIsSpawned) { Actor_Kill(&this->actor); return; } @@ -185,7 +185,7 @@ void BgJyaBigmirror_Init(Actor* thisx, GlobalContext* globalCtx) { this->cobraInfo[0].rotY = sCobraSpawnData[0].initRotY; this->cobraInfo[1].rotY = sCobraSpawnData[1].initRotY; this->actor.room = -1; - sIsSpawned = true; + sKankyoIsSpawned = true; this->spawned = true; this->mirRayObjIndex = -1; @@ -197,7 +197,7 @@ void BgJyaBigmirror_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgJyaBigmirror* this = (BgJyaBigmirror*)thisx; if (this->spawned) { - sIsSpawned = false; + sKankyoIsSpawned = false; } } diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c index 3f659ad57..064537f2d 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Cobra/z_bg_jya_cobra.c @@ -444,7 +444,7 @@ void func_80896950(BgJyaCobra* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 > 0.001f) { this->unk_168++; - if (this->unk_168 >= 15) { + if (this->unk_168 >= CVar_GetS32("gFasterBlockPush", 0) != 0 ? 5 : 15) { func_808969F8(this, globalCtx); } } else { @@ -484,9 +484,11 @@ void func_808969F8(BgJyaCobra* this, GlobalContext* globalCtx) { void func_80896ABC(BgJyaCobra* this, GlobalContext* globalCtx) { s16 temp_v0; Player* player = GET_PLAYER(globalCtx); + if (CVar_GetS32("gFasterBlockPush", 0) != 0) + this->unk_16E = 150.0f; temp_v0 = (s16)((this->unk_16C * 0x2000) + this->dyna.actor.home.rot.y) - this->dyna.actor.world.rot.y; - if (ABS(temp_v0) < 7424) { + if (ABS(temp_v0) < CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3712 : 7424) { Math_StepToS(&this->unk_16E, 106, 4); } else { Math_StepToS(&this->unk_16E, 21, 10); diff --git a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c index f57c64b84..57c7ac413 100644 --- a/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c +++ b/soh/src/overlays/actors/ovl_Bg_Jya_Lift/z_bg_jya_lift.c @@ -20,7 +20,7 @@ void BgJyaLift_DelayMove(BgJyaLift* this, GlobalContext* globalCtx); void BgJyaLift_SetupMove(BgJyaLift* this); void BgJyaLift_Move(BgJyaLift* this, GlobalContext* globalCtx); -static s16 sIsSpawned = false; +static s16 sKankyoIsSpawned = false; const ActorInit Bg_Jya_Lift_InitVars = { ACTOR_BG_JYA_LIFT, @@ -55,7 +55,7 @@ void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaLift* this = (BgJyaLift*)thisx; this->isSpawned = false; - if (sIsSpawned) { + if (sKankyoIsSpawned) { Actor_Kill(thisx); return; } @@ -70,7 +70,7 @@ void BgJyaLift_Init(Actor* thisx, GlobalContext* globalCtx) { BgJyaLift_SetInitPosY(this); } thisx->room = -1; - sIsSpawned = true; + sKankyoIsSpawned = true; this->isSpawned = true; } @@ -81,7 +81,7 @@ void BgJyaLift_Destroy(Actor* thisx, GlobalContext* globalCtx) { // "Goddess Lift DT" osSyncPrintf("女神リフト DT\n"); - sIsSpawned = false; + sKankyoIsSpawned = false; DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); } } diff --git a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c index 70360c423..a8871b50c 100644 --- a/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c +++ b/soh/src/overlays/actors/ovl_Bg_Menkuri_Eye/z_bg_menkuri_eye.c @@ -28,7 +28,7 @@ const ActorInit Bg_Menkuri_Eye_InitVars = { (ActorResetFunc)BgMenkuriEye_Reset, }; -static s32 D_8089C1A0; +s32 D_8089C1A0; static ColliderJntSphElementInit sJntSphElementsInit[1] = { { diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c b/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c index edda63bbb..269b5e411 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Elevator/z_bg_mori_elevator.c @@ -17,7 +17,7 @@ void func_808A2008(BgMoriElevator* this, GlobalContext* globalCtx); void BgMoriElevator_MoveIntoGround(BgMoriElevator* this, GlobalContext* globalCtx); void BgMoriElevator_MoveAboveGround(BgMoriElevator* this, GlobalContext* globalCtx); -static s16 sIsSpawned = false; +static s16 sKankyoIsSpawned = false; const ActorInit Bg_Mori_Elevator_InitVars = { ACTOR_BG_MORI_ELEVATOR, @@ -87,18 +87,18 @@ void BgMoriElevator_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; CollisionHeader* colHeader = NULL; - this->unk_172 = sIsSpawned; + this->unk_172 = sKankyoIsSpawned; this->moriTexObjIndex = Object_GetIndex(&globalCtx->objectCtx, OBJECT_MORI_TEX); if (this->moriTexObjIndex < 0) { Actor_Kill(thisx); // "Forest Temple obj elevator Bank Danger!" osSyncPrintf("Error : 森ã®ç¥žæ®¿ obj elevator ãƒãƒ³ã‚¯å±é™ºï¼(%s %d)\n", "../z_bg_mori_elevator.c", 277); } else { - switch (sIsSpawned) { + switch (sKankyoIsSpawned) { case false: // "Forest Temple elevator CT" osSyncPrintf("森ã®ç¥žæ®¿ elevator CT\n"); - sIsSpawned = true; + sKankyoIsSpawned = true; this->dyna.actor.room = -1; Actor_ProcessInitChain(&this->dyna.actor, sInitChain); DynaPolyActor_Init(&this->dyna, DPM_PLAYER); @@ -120,7 +120,7 @@ void BgMoriElevator_Destroy(Actor* thisx, GlobalContext* globalCtx) { // "Forest Temple elevator DT" osSyncPrintf("森ã®ç¥žæ®¿ elevator DT\n"); DynaPoly_DeleteBgActor(globalCtx, &globalCtx->colCtx.dyna, this->dyna.bgId); - sIsSpawned = false; + sKankyoIsSpawned = false; } } diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c index 8dfbff765..7508b6a24 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Hineri/z_bg_mori_hineri.c @@ -28,7 +28,7 @@ void BgMoriHineri_SpawnBossKeyChest(BgMoriHineri* this, GlobalContext* globalCtx void BgMoriHineri_DoNothing(BgMoriHineri* this, GlobalContext* globalCtx); void func_808A3D58(BgMoriHineri* this, GlobalContext* globalCtx); -static s16 sNextCamIdx = SUBCAM_NONE; +s16 sBgMoriHineriNextCamIdx = SUBCAM_NONE; const ActorInit Bg_Mori_Hineri_InitVars = { ACTOR_BG_MORI_HINERI, @@ -194,28 +194,28 @@ void func_808A3D58(BgMoriHineri* this, GlobalContext* globalCtx) { OnePointCutscene_EndCutscene(globalCtx, mainCamChildIdx); } OnePointCutscene_Init(globalCtx, 3260, 40, &this->dyna.actor, MAIN_CAM); - sNextCamIdx = OnePointCutscene_Init(globalCtx, 3261, 40, &this->dyna.actor, MAIN_CAM); + sBgMoriHineriNextCamIdx = OnePointCutscene_Init(globalCtx, 3261, 40, &this->dyna.actor, MAIN_CAM); } } void func_808A3E54(BgMoriHineri* this, GlobalContext* globalCtx) { s8 objBankIndex; - if (globalCtx->activeCamera == sNextCamIdx) { - if (sNextCamIdx != MAIN_CAM) { + if (globalCtx->activeCamera == sBgMoriHineriNextCamIdx) { + if (sBgMoriHineriNextCamIdx != MAIN_CAM) { objBankIndex = this->dyna.actor.objBankIndex; this->dyna.actor.objBankIndex = this->moriHineriObjIdx; this->moriHineriObjIdx = objBankIndex; this->dyna.actor.params ^= 1; - sNextCamIdx = MAIN_CAM; + sBgMoriHineriNextCamIdx = MAIN_CAM; func_80078884(NA_SE_SY_TRE_BOX_APPEAR); } else { this->dyna.actor.draw = NULL; this->actionFunc = func_808A3D58; - sNextCamIdx = SUBCAM_NONE; + sBgMoriHineriNextCamIdx = SUBCAM_NONE; } } - if ((sNextCamIdx >= SUBCAM_FIRST) && + if ((sBgMoriHineriNextCamIdx >= SUBCAM_FIRST) && ((GET_ACTIVE_CAM(globalCtx)->eye.z - this->dyna.actor.world.pos.z) < 1100.0f)) { func_8002F948(&this->dyna.actor, NA_SE_EV_FLOOR_ROLLING - SFX_FLAG); } @@ -283,5 +283,5 @@ void BgMoriHineri_DrawHallAndRoom(Actor* thisx, GlobalContext* globalCtx) { } void BgMoriHineri_Reset() { - sNextCamIdx = SUBCAM_NONE; + sBgMoriHineriNextCamIdx = SUBCAM_NONE; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c b/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c index 3c605926f..962c4d1aa 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Idomizu/z_bg_mori_idomizu.c @@ -19,7 +19,7 @@ void BgMoriIdomizu_WaitForMoriTex(BgMoriIdomizu* this, GlobalContext* globalCtx) void BgMoriIdomizu_SetupMain(BgMoriIdomizu* this); void BgMoriIdomizu_Main(BgMoriIdomizu* this, GlobalContext* globalCtx); -static s16 sIsSpawned = false; +static s16 sKankyoIsSpawned = false; const ActorInit Bg_Mori_Idomizu_InitVars = { ACTOR_BG_MORI_IDOMIZU, @@ -50,7 +50,7 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; BgMoriIdomizu* this = (BgMoriIdomizu*)thisx; - if (sIsSpawned) { + if (sKankyoIsSpawned) { Actor_Kill(&this->actor); return; } @@ -76,7 +76,7 @@ void BgMoriIdomizu_Init(Actor* thisx, GlobalContext* globalCtx) { return; } BgMoriIdomizu_SetupWaitForMoriTex(this); - sIsSpawned = true; + sKankyoIsSpawned = true; this->isLoaded = true; this->actor.room = -1; // "Forest Temple well water" @@ -88,7 +88,7 @@ void BgMoriIdomizu_Destroy(Actor* thisx, GlobalContext* globalCtx) { BgMoriIdomizu* this = (BgMoriIdomizu*)thisx; if (this->isLoaded) { - sIsSpawned = false; + sKankyoIsSpawned = false; } } diff --git a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c index 4ad89d7b3..68bf02fb7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c +++ b/soh/src/overlays/actors/ovl_Bg_Mori_Kaitenkabe/z_bg_mori_kaitenkabe.c @@ -94,7 +94,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { if (this->dyna.unk_150 > 0.001f) { this->timer++; - if ((this->timer > 28) && !Player_InCsMode(globalCtx)) { + if ((this->timer > CVar_GetS32("gFasterBlockPush", 0) != 0 ? 14 : 28) && !Player_InCsMode(globalCtx)) { BgMoriKaitenkabe_SetupRotate(this); func_8002DF54(globalCtx, &this->dyna.actor, 8); Math_Vec3f_Copy(&this->lockedPlayerPos, &player->actor.world.pos); @@ -118,7 +118,7 @@ void BgMoriKaitenkabe_Wait(BgMoriKaitenkabe* this, GlobalContext* globalCtx) { void BgMoriKaitenkabe_SetupRotate(BgMoriKaitenkabe* this) { this->actionFunc = BgMoriKaitenkabe_Rotate; - this->rotSpeed = 0.0f; + this->rotSpeed = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 0.5f : 0.0f; this->rotYdeg = 0.0f; } diff --git a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c index 1a1cc6c60..c2ed8a29b 100644 --- a/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c +++ b/soh/src/overlays/actors/ovl_Bg_Po_Event/z_bg_po_event.c @@ -80,11 +80,11 @@ static ColliderTrisInit sTrisInit = { sTrisElementsInit, }; -static u8 sBlocksAtRest = 0; +u8 sBgPoEventBlocksAtRest = 0; static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -static u8 sPuzzleState; +u8 sBgPoEventPuzzleState; void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { static s16 paintingPosX[] = { -1302, -866, 1421, 985 }; @@ -142,10 +142,10 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, GlobalContext* globalCtx) { } this->timer = 0; if (this->type == 4) { - sPuzzleState = 0; + sBgPoEventPuzzleState = 0; this->actionFunc = BgPoEvent_AmyWait; } else { - sPuzzleState = (s32)(Rand_ZeroOne() * 3.0f) % 3; + sBgPoEventPuzzleState = (s32)(Rand_ZeroOne() * 3.0f) % 3; this->actionFunc = BgPoEvent_PaintingEmpty; } } @@ -236,7 +236,7 @@ void BgPoEvent_Destroy(Actor* thisx, GlobalContext* globalCtx) { void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.actor.world.pos.y = 833.0f; - if (sPuzzleState == 0x3F) { + if (sBgPoEventPuzzleState == 0x3F) { if (this->type == 1) { OnePointCutscene_Init(globalCtx, 3150, 65, NULL, MAIN_CAM); } @@ -244,14 +244,14 @@ void BgPoEvent_BlockWait(BgPoEvent* this, GlobalContext* globalCtx) { this->actionFunc = BgPoEvent_BlockShake; } else if (this->dyna.actor.xzDistToPlayer > 50.0f) { if (this->type != 1) { - sPuzzleState |= (1 << this->index); + sBgPoEventPuzzleState |= (1 << this->index); } else { - sPuzzleState |= 0x10; + sBgPoEventPuzzleState |= 0x10; } } else if (this->type != 1) { - sPuzzleState &= ~(1 << this->index); + sBgPoEventPuzzleState &= ~(1 << this->index); } else { - sPuzzleState &= ~0x10; + sBgPoEventPuzzleState &= ~0x10; } } @@ -265,7 +265,7 @@ void BgPoEvent_BlockShake(BgPoEvent* this, GlobalContext* globalCtx) { } if (this->timer == 0) { this->dyna.actor.world.pos.x = this->dyna.actor.home.pos.x; - sPuzzleState = 0; + sBgPoEventPuzzleState = 0; this->timer = 60; this->actionFunc = BgPoEvent_BlockFall; } @@ -299,9 +299,9 @@ void BgPoEvent_CheckBlock(BgPoEvent* this) { } } if ((phi_v1 == phi_a1) && ((phi_t0 - phi_a3) == 60)) { - sPuzzleState |= (1 << this->index); + sBgPoEventPuzzleState |= (1 << this->index); } else { - sPuzzleState &= ~(1 << this->index); + sBgPoEventPuzzleState &= ~(1 << this->index); } } @@ -312,7 +312,7 @@ void BgPoEvent_BlockFall(BgPoEvent* this, GlobalContext* globalCtx) { if (Math_StepToF(&this->dyna.actor.world.pos.y, 433.0f, this->dyna.actor.velocity.y)) { this->dyna.actor.flags &= ~ACTOR_FLAG_5; this->dyna.actor.velocity.y = 0.0f; - sBlocksAtRest++; + sBgPoEventBlocksAtRest++; if (this->type != 1) { BgPoEvent_CheckBlock(this); } else { @@ -334,7 +334,7 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); Actor* amy; - if (sPuzzleState == 0xF) { + if (sBgPoEventPuzzleState == 0xF) { this->actionFunc = BgPoEvent_BlockSolved; if ((this->type == 0) && (this->index == 0)) { amy = @@ -348,23 +348,23 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { gSaveContext.timer1State = 0xA; } } else { - if ((gSaveContext.timer1Value == 0) && (sBlocksAtRest == 5)) { + if ((gSaveContext.timer1Value == 0) && (sBgPoEventBlocksAtRest == 5)) { player->stateFlags2 &= ~0x10; - sPuzzleState = 0x10; - sBlocksAtRest = 0; + sBgPoEventPuzzleState = 0x10; + sBgPoEventBlocksAtRest = 0; } - if ((sPuzzleState == 0x40) || ((sPuzzleState == 0x10) && !Player_InCsMode(globalCtx))) { + if ((sBgPoEventPuzzleState == 0x40) || ((sBgPoEventPuzzleState == 0x10) && !Player_InCsMode(globalCtx))) { this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z; this->actionFunc = BgPoEvent_BlockReset; - if (sPuzzleState == 0x10) { - sPuzzleState = 0x40; + if (sBgPoEventPuzzleState == 0x10) { + sBgPoEventPuzzleState = 0x40; Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EV_BLOCK_RISING); func_8002DF54(globalCtx, &player->actor, 8); } } else if (this->dyna.unk_150 != 0.0f) { if (this->direction == 0) { if (func_800435D8(globalCtx, &this->dyna, 0x1E, 0x32, -0x14) != 0) { - sBlocksAtRest--; + sBgPoEventBlocksAtRest--; this->direction = (this->dyna.unk_150 >= 0.0f) ? 1.0f : -1.0f; this->actionFunc = BgPoEvent_BlockPush; } else { @@ -382,16 +382,16 @@ void BgPoEvent_BlockIdle(BgPoEvent* this, GlobalContext* globalCtx) { } } -static f32 blockPushDist = 0.0f; +f32 sBgPoEventblockPushDist = 0.0f; void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) { f32 displacement; s32 blockStop; Player* player = GET_PLAYER(globalCtx); - this->dyna.actor.speedXZ += 0.1f; + this->dyna.actor.speedXZ += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 0.5f : 0.1f; this->dyna.actor.speedXZ = CLAMP_MAX(this->dyna.actor.speedXZ, 2.0f); - blockStop = Math_StepToF(&blockPushDist, 20.0f, this->dyna.actor.speedXZ); - displacement = this->direction * blockPushDist; + blockStop = Math_StepToF(&sBgPoEventblockPushDist, 20.0f, this->dyna.actor.speedXZ); + displacement = this->direction * sBgPoEventblockPushDist; this->dyna.actor.world.pos.x = (Math_SinS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.x; this->dyna.actor.world.pos.z = (Math_CosS(this->dyna.unk_158) * displacement) + this->dyna.actor.home.pos.z; if (blockStop) { @@ -402,10 +402,10 @@ void BgPoEvent_BlockPush(BgPoEvent* this, GlobalContext* globalCtx) { this->dyna.unk_150 = 0.0f; this->dyna.actor.home.pos.x = this->dyna.actor.world.pos.x; this->dyna.actor.home.pos.z = this->dyna.actor.world.pos.z; - blockPushDist = 0.0f; + sBgPoEventblockPushDist = 0.0f; this->dyna.actor.speedXZ = 0.0f; - this->direction = 5; - sBlocksAtRest++; + this->direction = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3 : 5; + sBgPoEventBlocksAtRest++; this->actionFunc = BgPoEvent_BlockIdle; if (this->type == 1) { return; @@ -428,7 +428,7 @@ void BgPoEvent_BlockReset(BgPoEvent* this, GlobalContext* globalCtx) { this->index = (this->index + 1) % 4; this->actionFunc = BgPoEvent_BlockFall; - sPuzzleState = 0; + sBgPoEventPuzzleState = 0; if (this->type == 1) { this->timer += 10; this->timer = CLAMP_MAX(this->timer, 120); @@ -443,14 +443,14 @@ void BgPoEvent_BlockSolved(BgPoEvent* this, GlobalContext* globalCtx) { player->stateFlags2 &= ~0x10; } if (Math_StepToF(&this->dyna.actor.world.pos.y, 369.0f, 2.0f)) { - sPuzzleState = 0x20; + sBgPoEventPuzzleState = 0x20; Actor_Kill(&this->dyna.actor); } } void BgPoEvent_AmyWait(BgPoEvent* this, GlobalContext* globalCtx) { if (this->collider.base.acFlags & AC_HIT) { - sPuzzleState |= 0x20; + sBgPoEventPuzzleState |= 0x20; this->timer = 5; Actor_SetColorFilter(&this->dyna.actor, 0x4000, 0xFF, 0, 5); Audio_PlayActorSound2(&this->dyna.actor, NA_SE_EN_PO_LAUGH2); @@ -461,12 +461,12 @@ void BgPoEvent_AmyWait(BgPoEvent* this, GlobalContext* globalCtx) { void BgPoEvent_AmyPuzzle(BgPoEvent* this, GlobalContext* globalCtx) { Vec3f pos; - if (sPuzzleState == 0xF) { + if (sBgPoEventPuzzleState == 0xF) { pos.x = this->dyna.actor.world.pos.x - 5.0f; pos.y = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.y; pos.z = Rand_CenteredFloat(120.0f) + this->dyna.actor.world.pos.z; EffectSsDeadDb_Spawn(globalCtx, &pos, &sZeroVec, &sZeroVec, 170, 0, 200, 255, 100, 170, 0, 255, 0, 1, 9, true); - } else if (sPuzzleState == 0x20) { + } else if (sBgPoEventPuzzleState == 0x20) { Actor_Kill(&this->dyna.actor); } else { DECR(this->timer); @@ -476,14 +476,14 @@ void BgPoEvent_AmyPuzzle(BgPoEvent* this, GlobalContext* globalCtx) { s32 BgPoEvent_NextPainting(BgPoEvent* this) { if ((this->dyna.actor.parent != NULL) && (this->dyna.actor.child != NULL)) { if (Rand_ZeroOne() < 0.5f) { - sPuzzleState = ((BgPoEvent*)this->dyna.actor.parent)->index; + sBgPoEventPuzzleState = ((BgPoEvent*)this->dyna.actor.parent)->index; } else { - sPuzzleState = ((BgPoEvent*)this->dyna.actor.child)->index; + sBgPoEventPuzzleState = ((BgPoEvent*)this->dyna.actor.child)->index; } } else if (this->dyna.actor.parent != NULL) { - sPuzzleState = ((BgPoEvent*)this->dyna.actor.parent)->index; + sBgPoEventPuzzleState = ((BgPoEvent*)this->dyna.actor.parent)->index; } else if (this->dyna.actor.child != NULL) { - sPuzzleState = ((BgPoEvent*)this->dyna.actor.child)->index; + sBgPoEventPuzzleState = ((BgPoEvent*)this->dyna.actor.child)->index; } else { return false; } @@ -491,7 +491,7 @@ s32 BgPoEvent_NextPainting(BgPoEvent* this) { } void BgPoEvent_PaintingEmpty(BgPoEvent* this, GlobalContext* globalCtx) { - if (sPuzzleState == this->index) { + if (sBgPoEventPuzzleState == this->index) { this->timer = 255; this->actionFunc = BgPoEvent_PaintingAppear; } @@ -636,7 +636,7 @@ void BgPoEvent_Draw(Actor* thisx, GlobalContext* globalCtx) { } void BgPoEvent_Reset(void) { - sBlocksAtRest = 0; - sPuzzleState = 0; - blockPushDist = 0.0f; + sBgPoEventBlocksAtRest = 0; + sBgPoEventPuzzleState = 0; + sBgPoEventblockPushDist = 0.0f; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c index 33e94d172..58d0f62d8 100644 --- a/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Relay_Objects/z_bg_relay_objects.c @@ -45,7 +45,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP), }; -static u32 D_808A9508 = 0; +u32 D_808A9508 = 0; void BgRelayObjects_Init(Actor* thisx, GlobalContext* globalCtx) { BgRelayObjects* this = (BgRelayObjects*)thisx; s32 pad; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c index fbc707ade..0951da7d7 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot06_Objects/z_bg_spot06_objects.c @@ -166,6 +166,10 @@ void BgSpot06Objects_Init(Actor* thisx, GlobalContext* globalCtx) { } } else { this->lakeHyliaWaterLevel = 0.0f; + WaterBox* water_boxes = globalCtx->colCtx.colHeader->waterBoxes; + water_boxes[LHWB_GERUDO_VALLEY_RIVER_LOWER].ySurface = WATER_LEVEL_RIVER_RAISED; + water_boxes[LHWB_MAIN_1].ySurface = WATER_LEVEL_RAISED; + water_boxes[LHWB_MAIN_2].ySurface = WATER_LEVEL_RAISED; this->actionFunc = BgSpot06Objects_DoNothing; } break; diff --git a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c index 240235917..684336e17 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot15_Rrbox/z_bg_spot15_rrbox.c @@ -260,7 +260,7 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { s32 approxFResult; Actor* actor = &this->dyna.actor; - this->unk_174 += 0.5f; + this->unk_174 += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 1.0f : 0.5f; this->unk_174 = CLAMP_MAX(this->unk_174, 2.0f); @@ -294,7 +294,7 @@ void func_808B4194(BgSpot15Rrbox* this, GlobalContext* globalCtx) { this->dyna.unk_150 = 0.0f; this->unk_178 = 0.0f; this->unk_174 = 0.0f; - this->unk_168 = 10; + this->unk_168 = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3 : 10; func_808B4084(this, globalCtx); } Audio_PlayActorSound2(actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); diff --git a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c index 2e9297e4c..caa727c69 100644 --- a/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c +++ b/soh/src/overlays/actors/ovl_Bg_Spot18_Basket/z_bg_spot18_basket.c @@ -84,7 +84,7 @@ void func_808B7710(Actor* thisx, GlobalContext* globalCtx) { this->dyna.actor.colChkInfo.mass = MASS_IMMOVABLE; } -static s16 D_808B85D0 = 0; +s16 D_808B85D0 = 0; void func_808B7770(BgSpot18Basket* this, GlobalContext* globalCtx, f32 arg2) { Vec3f acceleration; Vec3f velocity; diff --git a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c index 3b130b229..fa4d06b05 100644 --- a/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c +++ b/soh/src/overlays/actors/ovl_Boss_Dodongo/z_boss_dodongo.c @@ -418,7 +418,7 @@ void BossDodongo_IntroCutscene(BossDodongo* this, GlobalContext* globalCtx) { if (this->unk_198 == 0x5A) { if (!(gSaveContext.eventChkInf[7] & 2)) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gKingDodongoTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); + SEGMENTED_TO_VIRTUAL(gKingDodongoTitleCardTex), 160, 180, 128, 40, true); } Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_FIRE_BOSS); } diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c index 6553b3c11..5b468c7d3 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.c @@ -12,6 +12,8 @@ #include "overlays/actors/ovl_Door_Warp1/z_door_warp1.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/frame_interpolation.h" + #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) typedef enum { @@ -78,6 +80,7 @@ void BossFd_SpawnEmber(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, V effect->scale = scale / 1000.0f; effect->alpha = 255; effect->timer1 = (s16)Rand_ZeroFloat(10.0f); + effect->epoch++; break; } } @@ -95,6 +98,7 @@ void BossFd_SpawnDebris(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, effect->scale = scale / 1000.0f; effect->vFdFxRotX = Rand_ZeroFloat(100.0f); effect->vFdFxRotY = Rand_ZeroFloat(100.0f); + effect->epoch++; break; } } @@ -111,6 +115,7 @@ void BossFd_SpawnDust(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, Ve effect->accel = *acceleration; effect->timer2 = 0; effect->scale = scale / 400.0f; + effect->epoch++; break; } } @@ -136,6 +141,7 @@ void BossFd_SpawnFireBreath(BossFdEffect* effect, Vec3f* position, Vec3f* veloci effect->timer2 = 0; effect->scale = scale / 400.0f; effect->kbAngle = kbAngle; + effect->epoch++; break; } } @@ -493,7 +499,7 @@ void BossFd_Fly(BossFd* this, GlobalContext* globalCtx) { } if ((this->timers[3] == 130) && !(gSaveContext.eventChkInf[7] & 8)) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gVolvagiaBossTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); + SEGMENTED_TO_VIRTUAL(gVolvagiaBossTitleCardTex), 160, 180, 128, 40, true); } if (this->timers[3] <= 100) { this->camData.eyeVel.x = this->camData.eyeVel.y = this->camData.eyeVel.z = 2.0f; @@ -1522,6 +1528,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { for (i = 0; i < 180; i++, effect++) { if (effect->type == BFD_FX_EMBER) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaEmberMaterialDL); @@ -1536,6 +1543,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_fd.c", 4046), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaEmberModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -1543,6 +1551,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { flag = false; for (i = 0; i < 180; i++, effect++) { if (effect->type == BFD_FX_DEBRIS) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D18(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, gVolvagiaDebrisMaterialDL); @@ -1557,6 +1566,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_fd.c", 4068), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gVolvagiaDebrisModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -1564,6 +1574,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { flag = false; for (i = 0; i < 180; i++, effect++) { if (effect->type == BFD_FX_DUST) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustMaterialDL); @@ -1580,6 +1591,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[effect->timer2])); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -1587,6 +1599,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { flag = false; for (i = 0; i < 180; i++, effect++) { if (effect->type == BFD_FX_FIRE_BREATH) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustMaterialDL); @@ -1603,6 +1616,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(dustTex[effect->timer2])); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaDustModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -1610,6 +1624,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { flag = false; for (i = 0; i < 180; i++, effect++) { if (effect->type == BFD_FX_SKULL_PIECE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaSkullPieceMaterialDL); @@ -1624,6 +1639,7 @@ void BossFd_DrawEffects(BossFdEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_fd.c", 4192), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gVolvagiaSkullPieceModelDL); + FrameInterpolation_RecordCloseChild(); } } diff --git a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h index ea24fd346..d9580fc28 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h +++ b/soh/src/overlays/actors/ovl_Boss_Fd/z_boss_fd.h @@ -49,6 +49,7 @@ typedef struct { /* 0x30 */ f32 scale; /* 0x34 */ f32 bFdFxFloat1; /* 0x38 */ f32 bFdFxFloat2; + u32 epoch; } BossFdEffect; // size = 0x3C #define BOSSFD_EFFECT_COUNT 180 diff --git a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c index 20db1fb55..779584e32 100644 --- a/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c +++ b/soh/src/overlays/actors/ovl_Boss_Fd2/z_boss_fd2.c @@ -87,6 +87,7 @@ void BossFd2_SpawnDebris(GlobalContext* globalCtx, BossFdEffect* effect, Vec3f* effect->scale = scale / 1000.0f; effect->vFdFxRotX = Rand_ZeroFloat(100.0f); effect->vFdFxRotY = Rand_ZeroFloat(100.0f); + effect->epoch++; break; } } @@ -112,6 +113,7 @@ void BossFd2_SpawnFireBreath(GlobalContext* globalCtx, BossFdEffect* effect, Vec effect->timer2 = 0; effect->scale = scale / 400.0f; effect->kbAngle = kbAngle; + effect->epoch++; break; } } @@ -130,6 +132,7 @@ void BossFd2_SpawnEmber(GlobalContext* globalCtx, BossFdEffect* effect, Vec3f* p effect->scale = scale / 1000.0f; effect->alpha = 255; effect->timer1 = (s16)Rand_ZeroFloat(10.0f); + effect->epoch++; break; } } @@ -148,6 +151,7 @@ void BossFd2_SpawnSkullPiece(GlobalContext* globalCtx, BossFdEffect* effect, Vec effect->scale = scale / 1000.0f; effect->vFdFxRotX = Rand_ZeroFloat(100.0f); effect->vFdFxRotY = Rand_ZeroFloat(100.0f); + effect->epoch++; break; } } @@ -164,6 +168,7 @@ void BossFd2_SpawnDust(BossFdEffect* effect, Vec3f* position, Vec3f* velocity, V effect->accel = *acceleration; effect->timer2 = 0; effect->scale = scale / 400.0f; + effect->epoch++; break; } } diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c index c5c19f864..21199d420 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.c @@ -9,6 +9,8 @@ #include "assets/objects/object_ganon_anime2/object_ganon_anime2.h" #include "assets/scenes/dungeons/ganon_boss/ganon_boss_scene.h" +#include "soh/frame_interpolation.h" + #include #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -105,35 +107,17 @@ static ColliderCylinderInit sLightBallCylinderInit = { static u8 D_808E4C58[] = { 0, 12, 10, 12, 14, 16, 12, 14, 16, 12, 14, 16, 12, 14, 16, 10, 16, 14 }; static Vec3f sZeroVec = { 0.0f, 0.0f, 0.0f }; -static EnGanonMant* sCape; +EnGanonMant* sBossGanonCape; -static s32 sSeed1; -static s32 sSeed2; -static s32 sSeed3; +s32 sBossGanonSeed1; +s32 sBossGanonSeed3; +s32 sBossGanonSeed2; -static BossGanon* sGanondorf; +BossGanon* sBossGanonGanondorf; -static EnZl3* sZelda; +EnZl3* sBossGanonZelda; -typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 timer; - /* 0x04 */ Vec3f pos; - /* 0x10 */ Vec3f velocity; - /* 0x1C */ Vec3f accel; - /* 0x28 */ Color_RGB8 color; - /* 0x2C */ s16 alpha; - /* 0x2E */ s16 unk_2E; - /* 0x30 */ s16 unk_30; - /* 0x34 */ f32 scale; - /* 0x38 */ f32 unk_38; // scale target mostly, but used for other things - /* 0x3C */ f32 unk_3C; // mostly z rot - /* 0x40 */ f32 unk_40; - /* 0x44 */ f32 unk_44; // mostly x rot - /* 0x48 */ f32 unk_48; // mostly y rot -} GanondorfEffect; // size = 0x4C - -GanondorfEffect sEffectBuf[200]; +GanondorfEffect sBossGanonEffectBuf[200]; void BossGanonEff_SpawnWindowShard(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velocity, f32 scale) { static Color_RGB8 shardColors[] = { { 255, 175, 85 }, { 155, 205, 155 }, { 155, 125, 55 } }; @@ -156,6 +140,7 @@ void BossGanonEff_SpawnWindowShard(GlobalContext* globalCtx, Vec3f* pos, Vec3f* eff->color.g = color->g; eff->color.b = color->b; eff->timer = (s16)Rand_ZeroFloat(20.0f); + eff->epoch++; break; } } @@ -176,6 +161,7 @@ void BossGanonEff_SpawnSparkle(GlobalContext* globalCtx, Vec3f* pos, Vec3f* velo eff->unk_2E = (s16)Rand_ZeroFloat(100.0f) + 0xC8; eff->unk_30 = arg6; eff->timer = (s16)Rand_ZeroFloat(10.0f); + eff->epoch++; break; } } @@ -200,6 +186,7 @@ void BossGanonEff_SpawnLightRay(GlobalContext* globalCtx, Vec3f* pos, Vec3f* vel eff->timer = (s16)Rand_ZeroFloat(10.0f); eff->unk_48 = Math_Atan2F(eff->velocity.z, eff->velocity.x); eff->unk_44 = -Math_Atan2F(sqrtf(SQXZ(eff->velocity)), eff->velocity.y); + eff->epoch++; break; } } @@ -219,6 +206,7 @@ void BossGanonEff_SpawnShock(GlobalContext* globalCtx, f32 scale, s16 shockType) eff->scale = scale / 1000.0f; eff->unk_2E = shockType; eff->timer = 0; + eff->epoch++; break; } } @@ -238,6 +226,7 @@ void BossGanonEff_SpawnLightning(GlobalContext* globalCtx, f32 scale, f32 arg2, eff->unk_48 = arg2; eff->unk_3C = arg3; eff->timer = 0; + eff->epoch++; break; } } @@ -258,6 +247,7 @@ void BossGanonEff_SpawnDustDark(GlobalContext* globalCtx, Vec3f* pos, f32 scale, eff->unk_38 = arg3; eff->unk_30 = (s16)Rand_ZeroFloat(100.0f); eff->unk_2E = eff->timer = eff->alpha = 0; + eff->epoch++; break; } } @@ -275,6 +265,7 @@ void BossGanonEff_SpawnDustLight(GlobalContext* globalCtx, Vec3f* pos, f32 scale effArr[bufIndex].unk_38 = arg3; effArr[bufIndex].unk_30 = Rand_ZeroFloat(100.0f); effArr[bufIndex].unk_2E = effArr[bufIndex].timer = effArr[bufIndex].alpha = 0; + effArr[bufIndex].epoch++; } void BossGanonEff_SpawnShockwave(GlobalContext* globalCtx, Vec3f* pos, f32 scale, f32 arg3) { @@ -293,6 +284,7 @@ void BossGanonEff_SpawnShockwave(GlobalContext* globalCtx, Vec3f* pos, f32 scale eff->unk_38 = arg3; eff->unk_30 = (s16)Rand_ZeroFloat(100.0f); eff->unk_2E = eff->timer = 0; + eff->epoch++; break; } } @@ -313,6 +305,7 @@ void BossGanonEff_SpawnBlackDot(GlobalContext* globalCtx, Vec3f* pos, f32 scale) eff->timer = 0; eff->alpha = 0; eff->unk_2E = 0; + eff->epoch++; break; } } @@ -348,13 +341,13 @@ void BossGanon_Init(Actor* thisx, GlobalContext* globalCtx2) { if (thisx->params < 0x64) { Flags_SetSwitch(globalCtx, 0x14); - globalCtx->specialEffects = sEffectBuf; + globalCtx->specialEffects = sBossGanonEffectBuf; - for (i = 0; i < ARRAY_COUNT(sEffectBuf); i++) { - sEffectBuf[i].type = GDF_EFF_NONE; + for (i = 0; i < ARRAY_COUNT(sBossGanonEffectBuf); i++) { + sBossGanonEffectBuf[i].type = GDF_EFF_NONE; } - sGanondorf = this; + sBossGanonGanondorf = this; thisx->colChkInfo.health = 40; Actor_ProcessInitChain(thisx, sInitChain); ActorShape_Init(&thisx->shape, 0, NULL, 0); @@ -381,7 +374,7 @@ void BossGanon_Init(Actor* thisx, GlobalContext* globalCtx2) { BossGanon_SetupTowerCutscene(this, globalCtx); } - sCape = (EnGanonMant*)Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_EN_GANON_MANT, 0.0f, + sBossGanonCape = (EnGanonMant*)Actor_SpawnAsChild(&globalCtx->actorCtx, thisx, globalCtx, ACTOR_EN_GANON_MANT, 0.0f, 0.0f, 0.0f, 0, 0, 0, 1); Actor_ChangeCategory(globalCtx, &globalCtx->actorCtx, thisx, ACTORCAT_BOSS); } else { @@ -538,10 +531,10 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { gSegments[6] = VIRTUAL_TO_PHYSICAL(globalCtx->objectCtx.status[this->animBankIndex].segment); - sCape->backPush = -2.0f; - sCape->backSwayMagnitude = 0.25f; - sCape->sideSwayMagnitude = -1.0f; - sCape->minDist = 0.0f; + sBossGanonCape->backPush = -2.0f; + sBossGanonCape->backSwayMagnitude = 0.25f; + sBossGanonCape->sideSwayMagnitude = -1.0f; + sBossGanonCape->minDist = 0.0f; this->csTimer++; @@ -584,13 +577,13 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { this->useOpenHand = true; BossGanon_SetIntroCsCamera(this, 0); this->csState = 1; - sZelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 0.0f, + sBossGanonZelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 0.0f, 220.0f, -150.0f, 0, 0, 0, 0x2000); } Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_GANON_ORGAN, 0.0f, 0.0f, 0.0f, 0, 0, 0, 1); - sCape->minY = 57.0f; + sBossGanonCape->minY = 57.0f; // fallthrough case 1: this->envLightMode = 3; @@ -736,7 +729,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { this->csState = 9; this->csTimer = 0; func_8002DF54(globalCtx, &this->actor, 8); - sZelda->unk_3C8 = 0; + sBossGanonZelda->unk_3C8 = 0; this->triforceType = GDF_TRIFORCE_ZELDA; this->fwork[GDF_TRIFORCE_SCALE] = 10.0f; this->fwork[GDF_TRIFORCE_PRIM_A] = 0.0f; @@ -755,7 +748,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { Math_ApproachF(&this->fwork[GDF_TRIFORCE_ENV_G], 200.0f, 1.0f, 3.0f); if (this->csTimer == 30) { - sZelda->unk_3C8 = 1; + sBossGanonZelda->unk_3C8 = 1; } if (this->csTimer >= 32) { @@ -847,7 +840,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { this->csTimer = 0; BossGanon_SetIntroCsCamera(this, 11); this->unk_198 = 2; - sZelda->unk_3C8 = 2; + sBossGanonZelda->unk_3C8 = 2; this->timers[2] = 110; this->envLightMode = 3; } @@ -883,7 +876,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { if (this->csTimer > 10) { if (this->csTimer == 62) { - sCape->attachRightArmTimer = 20.0f; + sBossGanonCape->attachRightArmTimer = 20.0f; } if (this->csTimer == 57) { @@ -1076,7 +1069,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { Animation_MorphToPlayOnce(&this->skelAnime, &gDorfGetUp3Anim, 0.0f); SkelAnime_Update(&this->skelAnime); this->actor.shape.yOffset = 0.0f; - sCape->attachShouldersTimer = 18.0f; + sBossGanonCape->attachShouldersTimer = 18.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); this->unk_198 = 0; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_GANONDORF_BOSS); @@ -1088,7 +1081,7 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { if (!(gSaveContext.eventChkInf[7] & 0x100)) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gDorfTitleCardTex), 160, 180, 128, 40); + SEGMENTED_TO_VIRTUAL(gDorfTitleCardTex), 160, 180, 128, 40, false); } gSaveContext.eventChkInf[7] |= 0x100; @@ -1101,9 +1094,9 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { Math_ApproachF(&this->actor.world.pos.y, 228.0f, 0.05f, 2.0f); Math_ApproachF(&this->actor.world.pos.z, -230.0f, 0.05f, 4.0f); - sCape->backPush = -3.0f; - sCape->backSwayMagnitude = 0.25f; - sCape->sideSwayMagnitude = -3.0f; + sBossGanonCape->backPush = -3.0f; + sBossGanonCape->backSwayMagnitude = 0.25f; + sBossGanonCape->sideSwayMagnitude = -3.0f; sin = Math_SinS(this->csTimer * 1500); this->actor.velocity.y = this->fwork[GDF_FWORK_0] * sin * 0.04f; @@ -1136,10 +1129,10 @@ void BossGanon_IntroCutscene(BossGanon* this, GlobalContext* globalCtx) { BossGanon_SetupWait(this, globalCtx); } - if (sZelda != NULL) { - sZelda->actor.world.pos.x = 0.0f; - sZelda->actor.world.pos.y = 350.0f; - sZelda->actor.world.pos.z = 0.0f; + if (sBossGanonZelda != NULL) { + sBossGanonZelda->actor.world.pos.x = 0.0f; + sBossGanonZelda->actor.world.pos.y = 350.0f; + sBossGanonZelda->actor.world.pos.z = 0.0f; } } @@ -1529,7 +1522,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->fwork[1] = Animation_GetLastFrame(&object_ganon_anime2_Anim_00EA00); this->csState = 101; this->skelAnime.playSpeed = 0.0f; - sZelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 0.0f, + sBossGanonZelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 0.0f, 6000.0f, 0.0f, 0, 0, 0, 0x2000); player->actor.world.pos.x = -472.0f; @@ -1551,12 +1544,12 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->csCamAt.z = -100.0f; - sCape->backPush = -2.0f; - sCape->backSwayMagnitude = 0.25f; - sCape->sideSwayMagnitude = -1.0f; - sCape->minDist = 0.0f; - sCape->minY = 4104.0f; - sCape->tearTimer = 20; + sBossGanonCape->backPush = -2.0f; + sBossGanonCape->backSwayMagnitude = 0.25f; + sBossGanonCape->sideSwayMagnitude = -1.0f; + sBossGanonCape->minDist = 0.0f; + sBossGanonCape->minY = 4104.0f; + sBossGanonCape->tearTimer = 20; this->whiteFillAlpha = 255.0f; globalCtx->envCtx.unk_D8 = 1.0f; @@ -1620,27 +1613,27 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) if (this->csTimer == 90) { this->csState = 103; this->csTimer = 0; - sZelda->actor.world.pos.x = -472.0f; - sZelda->actor.world.pos.y = 4352.0f; - sZelda->actor.world.pos.z = -200.0f; - sZelda->unk_3C8 = 3; + sBossGanonZelda->actor.world.pos.x = -472.0f; + sBossGanonZelda->actor.world.pos.y = 4352.0f; + sBossGanonZelda->actor.world.pos.z = -200.0f; + sBossGanonZelda->unk_3C8 = 3; } break; case 103: - Audio_PlayActorSound2(&sZelda->actor, NA_SE_EV_DOWN_TO_GROUND - SFX_FLAG); - Math_ApproachF(&sZelda->actor.world.pos.y, 4102.0f, 0.05f, 1.5f); + Audio_PlayActorSound2(&sBossGanonZelda->actor, NA_SE_EV_DOWN_TO_GROUND - SFX_FLAG); + Math_ApproachF(&sBossGanonZelda->actor.world.pos.y, 4102.0f, 0.05f, 1.5f); this->csCamEye.x = -242.0f; this->csCamEye.y = 4122.0f; this->csCamEye.z = -190.0f; - this->csCamAt.x = sZelda->actor.world.pos.x; - this->csCamAt.y = sZelda->actor.world.pos.y + 40.0f + 5.0f; - this->csCamAt.z = sZelda->actor.world.pos.z; + this->csCamAt.x = sBossGanonZelda->actor.world.pos.x; + this->csCamAt.y = sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f; + this->csCamAt.z = sBossGanonZelda->actor.world.pos.z; if (this->csTimer == 200) { - sZelda->actor.world.pos.y = 4102.0f; + sBossGanonZelda->actor.world.pos.y = 4102.0f; this->csState = 104; this->csTimer = 0; } else { @@ -1652,20 +1645,20 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->csCamEye.y = 4147.0f; this->csCamEye.z = -200.0f; - this->csCamAt.x = sZelda->actor.world.pos.x; - this->csCamAt.y = sZelda->actor.world.pos.y + 40.0f + 5.0f; - this->csCamAt.z = sZelda->actor.world.pos.z; + this->csCamAt.x = sBossGanonZelda->actor.world.pos.x; + this->csCamAt.y = sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f; + this->csCamAt.z = sBossGanonZelda->actor.world.pos.z; if (this->csTimer >= 10) { Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f); } if (this->csTimer == 10) { - sZelda->unk_3C8 = 8; + sBossGanonZelda->unk_3C8 = 8; } if (this->csTimer == 50) { - sZelda->unk_3C8 = 4; + sBossGanonZelda->unk_3C8 = 4; } if (this->csTimer == 100) { @@ -1679,9 +1672,9 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->csCamEye.y = 4154.0f; this->csCamEye.z = -182.0f; - this->csCamAt.x = sZelda->actor.world.pos.x - 5.0f; - this->csCamAt.y = sZelda->actor.world.pos.y + 40.0f + 5.0f; - this->csCamAt.z = sZelda->actor.world.pos.z - 25.0f; + this->csCamAt.x = sBossGanonZelda->actor.world.pos.x - 5.0f; + this->csCamAt.y = sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f; + this->csCamAt.z = sBossGanonZelda->actor.world.pos.z - 25.0f; if (this->csTimer == 10) { Message_StartTextbox(globalCtx, 0x70D0, NULL); @@ -1698,7 +1691,7 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); if (this->csTimer == 20) { - sZelda->unk_3C8 = 5; + sBossGanonZelda->unk_3C8 = 5; func_8002DF54(globalCtx, &this->actor, 0x39); } @@ -1747,15 +1740,15 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->csCamEye.y = 4154.0f; this->csCamEye.z = -182.0f; - this->csCamAt.x = sZelda->actor.world.pos.x - 5.0f; - this->csCamAt.y = sZelda->actor.world.pos.y + 40.0f + 5.0f; - this->csCamAt.z = sZelda->actor.world.pos.z - 25.0f; + this->csCamAt.x = sBossGanonZelda->actor.world.pos.x - 5.0f; + this->csCamAt.y = sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f; + this->csCamAt.z = sBossGanonZelda->actor.world.pos.z - 25.0f; this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.3f; func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); if (this->csTimer == 70) { - sZelda->unk_3C8 = 6; + sBossGanonZelda->unk_3C8 = 6; } if (this->csTimer == 90) { @@ -1778,12 +1771,12 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->csCamEye.y = 4154.0f; this->csCamEye.z = -242.0f; - this->csCamAt.x = (sZelda->actor.world.pos.x - 5.0f) - 30.0f; - this->csCamAt.y = (sZelda->actor.world.pos.y + 40.0f + 5.0f) - 20.0f; - this->csCamAt.z = (sZelda->actor.world.pos.z - 25.0f) + 80.0f; + this->csCamAt.x = (sBossGanonZelda->actor.world.pos.x - 5.0f) - 30.0f; + this->csCamAt.y = (sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f) - 20.0f; + this->csCamAt.z = (sBossGanonZelda->actor.world.pos.z - 25.0f) + 80.0f; if ((this->csTimer > 50) && (Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_NONE)) { - sZelda->unk_3C8 = 7; + sBossGanonZelda->unk_3C8 = 7; this->csState = 108; this->csTimer = 0; } @@ -1793,9 +1786,9 @@ void BossGanon_DeathAndTowerCutscene(BossGanon* this, GlobalContext* globalCtx) this->unk_70C = Math_SinS(this->csTimer * 0x6300) * 0.8f; func_80078884(NA_SE_EV_EARTHQUAKE - SFX_FLAG); - this->csCamAt.x = (sZelda->actor.world.pos.x - 5.0f) - 30.0f; - this->csCamAt.y = (sZelda->actor.world.pos.y + 40.0f + 5.0f) - 20.0f; - this->csCamAt.z = (sZelda->actor.world.pos.z - 25.0f) + 80.0f; + this->csCamAt.x = (sBossGanonZelda->actor.world.pos.x - 5.0f) - 30.0f; + this->csCamAt.y = (sBossGanonZelda->actor.world.pos.y + 40.0f + 5.0f) - 20.0f; + this->csCamAt.z = (sBossGanonZelda->actor.world.pos.z - 25.0f) + 80.0f; if (this->csTimer > 50) { mainCam = Gameplay_GetCamera(globalCtx, MAIN_CAM); @@ -1905,7 +1898,7 @@ void BossGanon_PoundFloor(BossGanon* this, GlobalContext* globalCtx) { break; case 1: - sCape->gravity = -1.0f; + sBossGanonCape->gravity = -1.0f; this->envLightMode = 1; Math_ApproachF(&this->actor.velocity.y, -50.0f, 1.0f, 10.0f); this->actor.world.pos.y += this->actor.velocity.y; @@ -1952,7 +1945,7 @@ void BossGanon_PoundFloor(BossGanon* this, GlobalContext* globalCtx) { this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gDorfGetUp3Anim); Animation_MorphToPlayOnce(&this->skelAnime, &gDorfGetUp3Anim, 0.0f); SkelAnime_Update(&this->skelAnime); - sCape->attachShouldersTimer = 18.0f; + sBossGanonCape->attachShouldersTimer = 18.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); this->unk_1C2 = 4; } @@ -2136,7 +2129,7 @@ void BossGanon_ChargeBigMagic(BossGanon* this, GlobalContext* globalCtx) { } if (this->timers[0] == 1) { - sCape->attachLeftArmTimer = 15.0f; + sBossGanonCape->attachLeftArmTimer = 15.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); } @@ -2174,7 +2167,7 @@ void BossGanon_ChargeBigMagic(BossGanon* this, GlobalContext* globalCtx) { } if (Animation_OnFrame(&this->skelAnime, 3.0f)) { - sCape->attachShouldersTimer = 26.0f; + sBossGanonCape->attachShouldersTimer = 26.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); } @@ -2202,7 +2195,7 @@ void BossGanon_SetupWait(BossGanon* this, GlobalContext* globalCtx) { this->fwork[GDF_FWORK_0] = 0.0f; this->timers[0] = (s16)Rand_ZeroFloat(64.0f) + 30; this->unk_1C2 = 0; - sCape->minY = 2.0f; + sBossGanonCape->minY = 2.0f; } void BossGanon_Wait(BossGanon* this, GlobalContext* globalCtx) { @@ -2213,10 +2206,10 @@ void BossGanon_Wait(BossGanon* this, GlobalContext* globalCtx) { this->legSwayEnabled = true; - sCape->backPush = -3.0f; - sCape->backSwayMagnitude = 0.25f; - sCape->sideSwayMagnitude = -3.0f; - sCape->minDist = 20.0f; + sBossGanonCape->backPush = -3.0f; + sBossGanonCape->backSwayMagnitude = 0.25f; + sBossGanonCape->sideSwayMagnitude = -3.0f; + sBossGanonCape->minDist = 20.0f; SkelAnime_Update(&this->skelAnime); @@ -2271,10 +2264,10 @@ void BossGanon_SetupChargeLightBall(BossGanon* this, GlobalContext* globalCtx) { void BossGanon_ChargeLightBall(BossGanon* this, GlobalContext* globalCtx) { SkelAnime_Update(&this->skelAnime); - sCape->backPush = -3.0f; - sCape->backSwayMagnitude = 1.25f; - sCape->sideSwayMagnitude = -2.0f; - sCape->minDist = 10.0f; + sBossGanonCape->backPush = -3.0f; + sBossGanonCape->backSwayMagnitude = 1.25f; + sBossGanonCape->sideSwayMagnitude = -2.0f; + sBossGanonCape->minDist = 10.0f; if (this->timers[0] < 17) { this->envLightMode = 1; @@ -2355,7 +2348,7 @@ void BossGanon_PlayTennis(BossGanon* this, GlobalContext* globalCtx) { rand = Rand_ZeroOne() * 1.99f; this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(volleyAnims[rand]); Animation_MorphToPlayOnce(&this->skelAnime, volleyAnims[rand], 0.0f); - sCape->attachRightArmTimer = capeRightArmDurations[rand]; + sBossGanonCape->attachRightArmTimer = capeRightArmDurations[rand]; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); this->startVolley = false; } @@ -2383,7 +2376,7 @@ void BossGanon_SetupBlock(BossGanon* this, GlobalContext* globalCtx) { } this->unk_1C2 = 0; - sCape->attachLeftArmTimer = this->timers[0] = 10; + sBossGanonCape->attachLeftArmTimer = this->timers[0] = 10; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); this->handLightBallScale = 0.0f; } @@ -2391,10 +2384,10 @@ void BossGanon_SetupBlock(BossGanon* this, GlobalContext* globalCtx) { void BossGanon_Block(BossGanon* this, GlobalContext* globalCtx) { this->collider.base.colType = 9; SkelAnime_Update(&this->skelAnime); - sCape->backPush = -9.0f; - sCape->backSwayMagnitude = 0.25f; - sCape->sideSwayMagnitude = -2.0f; - sCape->minDist = 13.0f; + sBossGanonCape->backPush = -9.0f; + sBossGanonCape->backSwayMagnitude = 0.25f; + sBossGanonCape->sideSwayMagnitude = -2.0f; + sBossGanonCape->minDist = 13.0f; if (this->unk_1C2 == 0) { if (this->timers[0] == 0) { @@ -2402,11 +2395,11 @@ void BossGanon_Block(BossGanon* this, GlobalContext* globalCtx) { Animation_MorphToPlayOnce(&this->skelAnime, &gDorfBlockReleaseAnim, 0.0f); this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gDorfBlockReleaseAnim); SkelAnime_Update(&this->skelAnime); - sCape->attachShouldersTimer = 15.0f; + sBossGanonCape->attachShouldersTimer = 15.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); } } else { - sCape->sideSwayMagnitude = -13.0f; + sBossGanonCape->sideSwayMagnitude = -13.0f; if (Animation_OnFrame(&this->skelAnime, this->fwork[GDF_FWORK_1])) { BossGanon_SetupWait(this, globalCtx); @@ -2429,7 +2422,7 @@ void BossGanon_SetupHitByLightBall(BossGanon* this, GlobalContext* globalCtx) { this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gDorfBigMagicHitAnim); Animation_MorphToPlayOnce(&this->skelAnime, &gDorfBigMagicHitAnim, 0); this->timers[0] = 70; - sCape->attachRightArmTimer = sCape->attachLeftArmTimer = 0; + sBossGanonCape->attachRightArmTimer = sBossGanonCape->attachLeftArmTimer = 0; for (i = 1; i < 15; i++) { this->unk_4E4[i] = D_808E4C58[i]; @@ -2466,7 +2459,7 @@ void BossGanon_HitByLightBall(BossGanon* this, GlobalContext* globalCtx) { Animation_MorphToPlayOnce(&this->skelAnime, &gDorfGetUp3Anim, 0.0f); this->unk_1C2 = 2; SkelAnime_Update(&this->skelAnime); - sCape->attachShouldersTimer = 18.0f; + sBossGanonCape->attachShouldersTimer = 18.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_RESTORE); this->timers[2] = 130; @@ -2500,7 +2493,7 @@ void BossGanon_SetupVulnerable(BossGanon* this, GlobalContext* globalCtx) { BossGanon_SetAnimationObject(this, globalCtx, OBJECT_GANON_ANIME1); this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gDorfLightArrowHitAnim); Animation_MorphToPlayOnce(&this->skelAnime, &gDorfLightArrowHitAnim, 0.0f); - sCape->attachRightArmTimer = sCape->attachLeftArmTimer = 0; + sBossGanonCape->attachRightArmTimer = sBossGanonCape->attachLeftArmTimer = 0; this->actionFunc = BossGanon_Vulnerable; this->actor.velocity.x = 0.0f; @@ -2508,10 +2501,10 @@ void BossGanon_SetupVulnerable(BossGanon* this, GlobalContext* globalCtx) { this->actor.velocity.z = 0.0f; this->unk_1C2 = 0; - sCape->backPush = -4.0f; - sCape->backSwayMagnitude = 0.75f; - sCape->sideSwayMagnitude = -3.0f; - sCape->minDist = 20.0f; + sBossGanonCape->backPush = -4.0f; + sBossGanonCape->backSwayMagnitude = 0.75f; + sBossGanonCape->sideSwayMagnitude = -3.0f; + sBossGanonCape->minDist = 20.0f; for (i = 0; i < 10; i++) { Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BOSS_GANON, this->unk_1FC.x, @@ -2571,7 +2564,7 @@ void BossGanon_Vulnerable(BossGanon* this, GlobalContext* globalCtx) { break; case 2: - sCape->minDist = 0.0f; + sBossGanonCape->minDist = 0.0f; this->actor.velocity.y = this->actor.velocity.y - 0.5f; if (this->actor.world.pos.y < 40.0f) { @@ -2625,7 +2618,7 @@ void BossGanon_Vulnerable(BossGanon* this, GlobalContext* globalCtx) { this->unk_1C2 = 6; this->fwork[GDF_FWORK_1] = Animation_GetLastFrame(&gDorfGetUp2Anim); Animation_MorphToPlayOnce(&this->skelAnime, &gDorfGetUp2Anim, 0.0f); - sCape->minDist = 20.0f; + sBossGanonCape->minDist = 20.0f; this->unk_19F = 1; } break; @@ -2646,7 +2639,7 @@ void BossGanon_Vulnerable(BossGanon* this, GlobalContext* globalCtx) { Animation_MorphToPlayOnce(&this->skelAnime, &gDorfGetUp3Anim, 0.0f); this->unk_1C2 = 8; SkelAnime_Update(&this->skelAnime); - sCape->attachShouldersTimer = 18.0f; + sBossGanonCape->attachShouldersTimer = 18.0f; Audio_PlayActorSound2(&this->actor, NA_SE_EV_GANON_MANTLE); Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_RESTORE); break; @@ -2743,10 +2736,10 @@ void BossGanon_UpdateDamage(BossGanon* this, GlobalContext* globalCtx) { this->actor.colChkInfo.health -= damage; } - for (i = 0; i < ARRAY_COUNT(sCape->strands); i++) { + for (i = 0; i < ARRAY_COUNT(sBossGanonCape->strands); i++) { for (j = 1; j < 12; j++) { - sCape->strands[i].velocities[j].x = Rand_CenteredFloat(15.0f); - sCape->strands[i].velocities[j].z = Rand_CenteredFloat(15.0f); + sBossGanonCape->strands[i].velocities[j].x = Rand_CenteredFloat(15.0f); + sBossGanonCape->strands[i].velocities[j].z = Rand_CenteredFloat(15.0f); } } @@ -2762,16 +2755,16 @@ void BossGanon_UpdateDamage(BossGanon* this, GlobalContext* globalCtx) { Audio_PlayActorSound2(&this->actor, NA_SE_EN_GANON_CUTBODY); BossGanon_SetupDamaged(this, globalCtx); this->unk_1A6 = 15; - sCape->tearTimer = 1; + sBossGanonCape->tearTimer = 1; } } } else if (acHitInfo->toucher.dmgFlags & 0x1F8A4) { Audio_PlayActorSound2(&this->actor, 0); - for (i = 0; i < ARRAY_COUNT(sCape->strands); i++) { + for (i = 0; i < ARRAY_COUNT(sBossGanonCape->strands); i++) { for (j = 1; j < 12; j++) { - sCape->strands[i].velocities[j].x = Rand_CenteredFloat(15.0f); - sCape->strands[i].velocities[j].z = Rand_CenteredFloat(15.0f); + sBossGanonCape->strands[i].velocities[j].x = Rand_CenteredFloat(15.0f); + sBossGanonCape->strands[i].velocities[j].z = Rand_CenteredFloat(15.0f); } } } @@ -2841,7 +2834,7 @@ void BossGanon_Update(Actor* thisx, GlobalContext* globalCtx2) { } this->collider.base.colType = 3; - sCape->gravity = -3.0f; + sBossGanonCape->gravity = -3.0f; this->shockGlow = false; this->actor.flags &= ~ACTOR_FLAG_0; this->unk_1A2++; @@ -3334,20 +3327,20 @@ void BossGanon_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList } void BossGanon_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { - sSeed1 = seedInit0; - sSeed2 = seedInit1; - sSeed3 = seedInit2; + sBossGanonSeed1 = seedInit0; + sBossGanonSeed2 = seedInit1; + sBossGanonSeed3 = seedInit2; } f32 BossGanon_RandZeroOne(void) { // Wichmann-Hill algorithm f32 randFloat; - sSeed1 = (sSeed1 * 171) % 30269; - sSeed2 = (sSeed2 * 172) % 30307; - sSeed3 = (sSeed3 * 170) % 30323; + sBossGanonSeed1 = (sBossGanonSeed1 * 171) % 30269; + sBossGanonSeed2 = (sBossGanonSeed2 * 172) % 30307; + sBossGanonSeed3 = (sBossGanonSeed3 * 170) % 30323; - randFloat = (sSeed1 / 30269.0f) + (sSeed2 / 30307.0f) + (sSeed3 / 30323.0f); + randFloat = (sBossGanonSeed1 / 30269.0f) + (sBossGanonSeed2 / 30307.0f) + (sBossGanonSeed3 / 30323.0f); while (randFloat >= 1.0f) { randFloat -= 1.0f; @@ -3559,7 +3552,7 @@ void BossGanon_DrawTriforce(BossGanon* this, GlobalContext* globalCtx) { this->triforcePos.y += 3.0f; this->triforcePos.z += -2.0f; } else if (this->triforceType == GDF_TRIFORCE_ZELDA) { - this->triforcePos = sZelda->unk_31C; + this->triforcePos = sBossGanonZelda->unk_31C; this->triforcePos.y += 1.8f; this->triforcePos.z += 4.0f; @@ -3734,9 +3727,9 @@ void BossGanon_GenShadowTexture(u8* tex, BossGanon* this, GlobalContext* globalC for (i = 0; i < 12; i++) { for (j = 0; j < 12; j++) { - sp7C.x = sCape->strands[i].joints[j].x - this->actor.world.pos.x; - sp7C.y = sCape->strands[i].joints[j].y - this->actor.world.pos.y + 76.0f + 100.0f + 30.0f; - sp7C.z = sCape->strands[i].joints[j].z - this->actor.world.pos.z; + sp7C.x = sBossGanonCape->strands[i].joints[j].x - this->actor.world.pos.x; + sp7C.y = sBossGanonCape->strands[i].joints[j].y - this->actor.world.pos.y + 76.0f + 100.0f + 30.0f; + sp7C.z = sBossGanonCape->strands[i].joints[j].z - this->actor.world.pos.z; Matrix_MultVec3f(&sp7C, &sp70); @@ -3746,7 +3739,7 @@ void BossGanon_GenShadowTexture(u8* tex, BossGanon* this, GlobalContext* globalC baseX = (s32)(sp70.x + 32.0f); baseY = (s16)sp70.y * 0x40; - if (!sCape->strands[i].torn[j]) { + if (!sBossGanonCape->strands[i].torn[j]) { for (y = -1, addY = -0x40; y <= 1; y++, addY += 0x40) { for (x = -3; x <= 3; x++) { index = baseX + x + baseY + addY; @@ -3827,13 +3820,13 @@ void BossGanon_Draw(Actor* thisx, GlobalContext* globalCtx) { BossGanon_DrawEffects(globalCtx); - sCape->actor.world.pos = this->actor.world.pos; + sBossGanonCape->actor.world.pos = this->actor.world.pos; - sCape->rightForearmPos = this->unk_214; - sCape->leftForearmPos = this->unk_220; + sBossGanonCape->rightForearmPos = this->unk_214; + sBossGanonCape->leftForearmPos = this->unk_220; - sCape->rightShoulderPos = this->unk_22C; - sCape->leftShoulderPos = this->unk_238; + sBossGanonCape->rightShoulderPos = this->unk_22C; + sBossGanonCape->leftShoulderPos = this->unk_238; BossGanon_DrawShock(this, globalCtx); BossGanon_DrawHandLightBall(this, globalCtx); @@ -4628,7 +4621,7 @@ void BossGanon_UpdateEffects(GlobalContext* globalCtx) { spA0.x = 0.0f; spA0.y = 0.0f; - for (i = 0; i < ARRAY_COUNT(sEffectBuf); i++, eff++) { + for (i = 0; i < ARRAY_COUNT(sBossGanonEffectBuf); i++, eff++) { if (eff->type != GDF_EFF_NONE) { eff->pos.x += eff->velocity.x; eff->pos.y += eff->velocity.y; @@ -4662,9 +4655,9 @@ void BossGanon_UpdateEffects(GlobalContext* globalCtx) { eff->alpha = 255; } } else if (eff->type == GDF_EFF_BLACK_DOT) { - xDiff = sGanondorf->unk_278.x - eff->pos.x; - yDiff = sGanondorf->unk_278.y - eff->pos.y; - zDiff = sGanondorf->unk_278.z - eff->pos.z; + xDiff = sBossGanonGanondorf->unk_278.x - eff->pos.x; + yDiff = sBossGanonGanondorf->unk_278.y - eff->pos.y; + zDiff = sBossGanonGanondorf->unk_278.z - eff->pos.z; yRot = Math_FAtan2F(xDiff, zDiff); @@ -4704,9 +4697,9 @@ void BossGanon_UpdateEffects(GlobalContext* globalCtx) { if (eff->unk_2E == GDF_SHOCK_DORF_YELLOW) { bodyPart = (s16)Rand_ZeroFloat(13.9f) + 1; - eff->pos.x = sGanondorf->unk_2EC[bodyPart].x + Rand_CenteredFloat(20.0f); - eff->pos.y = sGanondorf->unk_2EC[bodyPart].y + Rand_CenteredFloat(20.0f); - eff->pos.z = sGanondorf->unk_2EC[bodyPart].z + Rand_CenteredFloat(20.0f); + eff->pos.x = sBossGanonGanondorf->unk_2EC[bodyPart].x + Rand_CenteredFloat(20.0f); + eff->pos.y = sBossGanonGanondorf->unk_2EC[bodyPart].y + Rand_CenteredFloat(20.0f); + eff->pos.z = sBossGanonGanondorf->unk_2EC[bodyPart].z + Rand_CenteredFloat(20.0f); } else { bodyPart = (s16)Rand_ZeroFloat(17.9f); @@ -4799,7 +4792,7 @@ void BossGanon_UpdateEffects(GlobalContext* globalCtx) { if (((eff->scale * 150.0f) < distToPlayer) && (distToPlayer < (eff->scale * 300.0f))) { eff->timer = 150; - func_8002F6D4(globalCtx, &sGanondorf->actor, 7.0f, sGanondorf->actor.yawTowardsPlayer, 0.0f, + func_8002F6D4(globalCtx, &sBossGanonGanondorf->actor, 7.0f, sBossGanonGanondorf->actor.yawTowardsPlayer, 0.0f, 0x20); } } @@ -4838,6 +4831,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 200; i++, eff++) { if (eff->type == GDF_EFF_WINDOW_SHARD) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_OPA_DISP++); if (flag == 0) { gSPDisplayList(POLY_OPA_DISP++, gDorfWindowShardMaterialDL); @@ -4855,6 +4849,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 10898), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gDorfWindowShardModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4863,6 +4858,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_SPARKLE) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); if (flag == 0) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); @@ -4877,6 +4873,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 10932), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfSquareDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4885,6 +4882,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_LIGHT_RAY) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); if (flag == 0) { gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 0, 0); @@ -4901,6 +4899,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 10971), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfSquareDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4909,6 +4908,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_SHOCK) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); if (flag == 0) { gDPPipeSync(POLY_XLU_DISP++); if (eff->unk_2E == GDF_SHOCK_PLAYER_PURPLE) { @@ -4927,6 +4927,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 11023), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfShockDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4934,13 +4935,14 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_LIGHTNING) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, sLightningPrimColors[(eff->timer * 3) + 0], sLightningPrimColors[(eff->timer * 3) + 1], sLightningPrimColors[(eff->timer * 3) + 2], 255); gDPSetEnvColor(POLY_XLU_DISP++, sLightningEnvColors[(eff->timer * 3) + 0], sLightningEnvColors[(eff->timer * 3) + 1], sLightningEnvColors[(eff->timer * 3) + 2], 0); - Matrix_Translate(sGanondorf->unk_260.x, sGanondorf->unk_260.y, sGanondorf->unk_260.z, MTXMODE_NEW); + Matrix_Translate(sBossGanonGanondorf->unk_260.x, sBossGanonGanondorf->unk_260.y, sBossGanonGanondorf->unk_260.z, MTXMODE_NEW); Matrix_RotateY(eff->unk_48, MTXMODE_APPLY); Matrix_RotateZ(eff->unk_3C, MTXMODE_APPLY); Matrix_Scale(eff->scale, eff->scale, eff->scale, MTXMODE_APPLY); @@ -4949,6 +4951,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPSegment(POLY_XLU_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sLightningTextures[eff->timer])); gSPDisplayList(POLY_XLU_DISP++, gDorfLightningDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4956,6 +4959,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_IMPACT_DUST_DARK) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 0, 0, 0, eff->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 100, 70, 0, 128); @@ -4967,6 +4971,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 11121), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfImpactDarkDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4974,6 +4979,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_IMPACT_DUST_LIGHT) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, eff->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 200, 100, 0, 128); @@ -4985,6 +4991,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 11165), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfImpactLightDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4992,6 +4999,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_SHOCKWAVE) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, eff->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 150, 255, 0, 128); @@ -5004,6 +5012,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 11209), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfShockwaveDL); + FrameInterpolation_RecordCloseChild(); } } @@ -5011,6 +5020,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { for (i = 0; i < 150; i++, eff++) { if (eff->type == GDF_EFF_BLACK_DOT) { + FrameInterpolation_RecordOpenChild(eff, eff->epoch); gDPPipeSync(POLY_XLU_DISP++); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 150, 170, 0, eff->alpha); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 255, 128); @@ -5023,6 +5033,7 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_ganon.c", 11250), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gDorfDotDL); + FrameInterpolation_RecordCloseChild(); } } @@ -5032,16 +5043,11 @@ void BossGanon_DrawEffects(GlobalContext* globalCtx) { #include "overlays/ovl_Boss_Ganon/ovl_Boss_Ganon.h" void BossGanon_Reset(void) { - -static EnGanonMant* sCape; - - sSeed1 = 0; - sSeed2 = 0; - sSeed3 = 0; - sGanondorf = NULL; - sZelda = NULL; - sCape = NULL; - - - memset(sEffectBuf, 0, sizeof(sEffectBuf)); + sBossGanonSeed1 = 0; + sBossGanonSeed2 = 0; + sBossGanonSeed3 = 0; + sBossGanonGanondorf = NULL; + sBossGanonZelda = NULL; + sBossGanonCape = NULL; + memset(sBossGanonEffectBuf, 0, sizeof(sBossGanonEffectBuf)); } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h index a3e3e503e..7a797ad74 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h +++ b/soh/src/overlays/actors/ovl_Boss_Ganon/z_boss_ganon.h @@ -53,6 +53,25 @@ typedef enum { /* 2 */ GDF_TRIFORCE_DORF } GanondorfTriforceType; +typedef struct { + /* 0x00 */ u8 type; + /* 0x01 */ u8 timer; + /* 0x04 */ Vec3f pos; + /* 0x10 */ Vec3f velocity; + /* 0x1C */ Vec3f accel; + /* 0x28 */ Color_RGB8 color; + /* 0x2C */ s16 alpha; + /* 0x2E */ s16 unk_2E; + /* 0x30 */ s16 unk_30; + /* 0x34 */ f32 scale; + /* 0x38 */ f32 unk_38; // scale target mostly, but used for other things + /* 0x3C */ f32 unk_3C; // mostly z rot + /* 0x40 */ f32 unk_40; + /* 0x44 */ f32 unk_44; // mostly x rot + /* 0x48 */ f32 unk_48; // mostly y rot + u32 epoch; +} GanondorfEffect; // size = 0x4C + typedef struct BossGanon { /* 0x0000 */ Actor actor; /* 0x014C */ s32 animBankIndex; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c index 74da86927..b946054b8 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.c @@ -49,21 +49,40 @@ const ActorInit Boss_Ganon2_InitVars = { #include "z_boss_ganon2_data.c" +Vec3f D_8090EB20; + +EnZl3* sBossGanon2Zelda; + +Actor* D_8090EB30; + +BossGanon2Effect sBossGanon2Particles[100]; + +s32 sBossGanon2Seed1; +s32 sBossGanon2Seed2; +s32 sBossGanon2Seed3; + +Vec3f D_809105D8[4]; + +Vec3f D_80910608[4]; + +s8 D_80910638; + + void BossGanon2_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { - sSeed1 = seedInit0; - sSeed2 = seedInit1; - sSeed3 = seedInit2; + sBossGanon2Seed1 = seedInit0; + sBossGanon2Seed2 = seedInit1; + sBossGanon2Seed3 = seedInit2; } f32 BossGanon2_RandZeroOne(void) { // Wichmann-Hill algorithm f32 randFloat; - sSeed1 = (sSeed1 * 171) % 30269; - sSeed2 = (sSeed2 * 172) % 30307; - sSeed3 = (sSeed3 * 170) % 30323; + sBossGanon2Seed1 = (sBossGanon2Seed1 * 171) % 30269; + sBossGanon2Seed2 = (sBossGanon2Seed2 * 172) % 30307; + sBossGanon2Seed3 = (sBossGanon2Seed3 * 170) % 30323; - randFloat = (sSeed1 / 30269.0f) + (sSeed2 / 30307.0f) + (sSeed3 / 30323.0f); + randFloat = (sBossGanon2Seed1 / 30269.0f) + (sBossGanon2Seed2 / 30307.0f) + (sBossGanon2Seed3 / 30323.0f); while (randFloat >= 1.0f) { randFloat -= 1.0f; } @@ -114,7 +133,7 @@ void func_808FD27C(GlobalContext* globalCtx, Vec3f* position, Vec3f* velocity, f BossGanon2Effect* effect = globalCtx->specialEffects; s16 i; - for (i = 0; i < ARRAY_COUNT(sParticles); i++, effect++) { + for (i = 0; i < ARRAY_COUNT(sBossGanon2Particles); i++, effect++) { if (effect->type == 0) { effect->type = 2; effect->position = *position; @@ -136,10 +155,10 @@ void BossGanon2_Init(Actor* thisx, GlobalContext* globalCtx) { s32 pad; s16 i; - globalCtx->specialEffects = sParticles; + globalCtx->specialEffects = sBossGanon2Particles; - for (i = 0; i < ARRAY_COUNT(sParticles); i++) { - sParticles[i].type = 0; + for (i = 0; i < ARRAY_COUNT(sBossGanon2Particles); i++) { + sBossGanon2Particles[i].type = 0; } this->actor.colChkInfo.mass = MASS_IMMOVABLE; @@ -204,13 +223,13 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { Gameplay_ChangeCameraStatus(globalCtx, MAIN_CAM, CAM_STAT_WAIT); Gameplay_ChangeCameraStatus(globalCtx, this->unk_39E, CAM_STAT_ACTIVE); this->unk_39C = 1; - sZelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 970.0f, + sBossGanon2Zelda = (EnZl3*)Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ZL3, 970.0f, 1086.0f, -200.0f, 0, 0, 0, 1); - sZelda->unk_3C8 = 0; - sZelda->actor.world.pos.x = 970.0f; - sZelda->actor.world.pos.y = 1086.0f; - sZelda->actor.world.pos.z = -214.0f; - sZelda->actor.shape.rot.y = -0x7000; + sBossGanon2Zelda->unk_3C8 = 0; + sBossGanon2Zelda->actor.world.pos.x = 970.0f; + sBossGanon2Zelda->actor.world.pos.y = 1086.0f; + sBossGanon2Zelda->actor.world.pos.z = -214.0f; + sBossGanon2Zelda->actor.shape.rot.y = -0x7000; this->unk_3BC.x = 0.0f; this->unk_3BC.y = 1.0f; this->unk_3BC.z = 0.0f; @@ -258,20 +277,20 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { player->actor.world.pos.x = 970.0f; player->actor.world.pos.y = 1086.0f; player->actor.world.pos.z = -166.0f; - sZelda->actor.world.pos.x = 974.0f; - sZelda->actor.world.pos.y = 1086.0f; - sZelda->actor.world.pos.z = -186.0f; + sBossGanon2Zelda->actor.world.pos.x = 974.0f; + sBossGanon2Zelda->actor.world.pos.y = 1086.0f; + sBossGanon2Zelda->actor.world.pos.z = -186.0f; player->actor.shape.rot.y = -0x5000; - sZelda->actor.shape.rot.y = -0x5000; + sBossGanon2Zelda->actor.shape.rot.y = -0x5000; if (this->unk_398 == 60) { Message_StartTextbox(globalCtx, 0x70D4, NULL); } if (this->unk_398 == 40) { - sZelda->unk_3C8 = 1; + sBossGanon2Zelda->unk_3C8 = 1; func_8002DF54(globalCtx, &this->actor, 0x4E); } if (this->unk_398 == 85) { - sZelda->unk_3C8 = 2; + sBossGanon2Zelda->unk_3C8 = 2; func_8002DF54(globalCtx, &this->actor, 0x4F); } this->unk_3A4.x = 930.0f; @@ -300,14 +319,14 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_STOP); } if (this->unk_398 == 20) { - sZelda->unk_3C8 = 3; + sBossGanon2Zelda->unk_3C8 = 3; func_8002DF54(globalCtx, &this->actor, 0x50); } if (this->unk_398 == 55) { this->unk_39C = 4; this->unk_398 = 0; this->unk_410.x = 0.0f; - sZelda->unk_3C8 = 4; + sBossGanon2Zelda->unk_3C8 = 4; func_8002DF54(globalCtx, &this->actor, 0x50); } break; @@ -347,11 +366,11 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { player->actor.world.pos.x = 490.0f; player->actor.world.pos.y = 1086.0f; player->actor.world.pos.z = -166.0f; - sZelda->actor.world.pos.x = 724.0f; - sZelda->actor.world.pos.y = 1086.0f; - sZelda->actor.world.pos.z = -186.0f; + sBossGanon2Zelda->actor.world.pos.x = 724.0f; + sBossGanon2Zelda->actor.world.pos.y = 1086.0f; + sBossGanon2Zelda->actor.world.pos.z = -186.0f; player->actor.shape.rot.y = -0x4000; - sZelda->actor.shape.rot.y = -0x5000; + sBossGanon2Zelda->actor.shape.rot.y = -0x5000; this->unk_3A4.x = 410.0f; this->unk_3A4.y = 1096.0f; this->unk_3A4.z = -110.0f; @@ -370,7 +389,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { this->unk_339 = 4; } if (this->unk_398 == 30) { - sZelda->unk_3C8 = 5; + sBossGanon2Zelda->unk_3C8 = 5; func_8002DF54(globalCtx, &this->actor, 0x51); } if (this->unk_398 == 50) { @@ -384,11 +403,11 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { player->actor.world.pos.x = 490.0f; player->actor.world.pos.y = 1086.0f; player->actor.world.pos.z = -166.0f; - sZelda->actor.world.pos.x = 724.0f; - sZelda->actor.world.pos.y = 1086.0f; - sZelda->actor.world.pos.z = -186.0f; + sBossGanon2Zelda->actor.world.pos.x = 724.0f; + sBossGanon2Zelda->actor.world.pos.y = 1086.0f; + sBossGanon2Zelda->actor.world.pos.z = -186.0f; player->actor.shape.rot.y = -0x4000; - sZelda->actor.shape.rot.y = -0x5000; + sBossGanon2Zelda->actor.shape.rot.y = -0x5000; this->unk_3A4.x = 450.0f; this->unk_3A4.y = 1121.0f; this->unk_3A4.z = -158.0f; @@ -457,9 +476,9 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { player->actor.world.pos.y = 1086.0f; player->actor.world.pos.z = -266.0f; player->actor.shape.rot.y = -0x4000; - sZelda->actor.world.pos.x = 724.0f; - sZelda->actor.world.pos.y = 1086.0f; - sZelda->actor.world.pos.z = -186.0f; + sBossGanon2Zelda->actor.world.pos.x = 724.0f; + sBossGanon2Zelda->actor.world.pos.y = 1086.0f; + sBossGanon2Zelda->actor.world.pos.z = -186.0f; this->unk_3A4.x = this->actor.world.pos.x + -10.0f; this->unk_3A4.y = this->actor.world.pos.y + 80.0f; this->unk_3A4.z = this->actor.world.pos.z + 50.0f; @@ -671,7 +690,8 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { if (this->unk_398 == 80) { BossGanon2_SetObjectSegment(this, globalCtx, OBJECT_GANON2, false); TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(object_ganon2_Tex_021A90), 160, 180, 128, 40); + SEGMENTED_TO_VIRTUAL(object_ganon2_Tex_021A90), 160, 180, 128, 40, true); + //It has translation but they are all the same. they all say "GANON" only } this->unk_3A4.x = ((this->actor.world.pos.x + 500.0f) - 350.0f) + 100.0f; this->unk_3A4.y = this->actor.world.pos.y; @@ -769,9 +789,9 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { BossGanon2Effect* effect = globalCtx->specialEffects; effect->unk_2E = 1; - effect->position.x = sZelda->actor.world.pos.x + 50.0f + 10.0f; - effect->position.y = sZelda->actor.world.pos.y + 350.0f; - effect->position.z = sZelda->actor.world.pos.z - 25.0f; + effect->position.x = sBossGanon2Zelda->actor.world.pos.x + 50.0f + 10.0f; + effect->position.y = sBossGanon2Zelda->actor.world.pos.y + 350.0f; + effect->position.z = sBossGanon2Zelda->actor.world.pos.z - 25.0f; effect->velocity.x = 0.0f; effect->velocity.z = 0.0f; effect->velocity.y = -30.0f; @@ -781,15 +801,15 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { break; } case 26: - this->unk_3A4.x = sZelda->actor.world.pos.x + 100.0f + 30.0f; - this->unk_3A4.y = sZelda->actor.world.pos.y + 10.0f; - this->unk_3A4.z = sZelda->actor.world.pos.z + 5.0f; - this->unk_3B0.x = sZelda->actor.world.pos.x; - this->unk_3B0.y = sZelda->actor.world.pos.y + 30.0f; - this->unk_3B0.z = sZelda->actor.world.pos.z - 20.0f; + this->unk_3A4.x = sBossGanon2Zelda->actor.world.pos.x + 100.0f + 30.0f; + this->unk_3A4.y = sBossGanon2Zelda->actor.world.pos.y + 10.0f; + this->unk_3A4.z = sBossGanon2Zelda->actor.world.pos.z + 5.0f; + this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; + this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f; + this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z - 20.0f; this->unk_3BC.z = -0.5f; if (this->unk_398 == 13) { - sZelda->unk_3C8 = 6; + sBossGanon2Zelda->unk_3C8 = 6; } if (this->unk_398 == 50) { this->unk_39C = 27; @@ -878,7 +898,7 @@ void func_808FD5F4(BossGanon2* this, GlobalContext* globalCtx) { func_808FFDB0(this, globalCtx); this->unk_1A2[1] = 50; this->actor.flags |= ACTOR_FLAG_0; - sZelda->unk_3C8 = 7; + sBossGanon2Zelda->unk_3C8 = 7; } break; } @@ -1322,12 +1342,12 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { break; case 2: this->unk_1A2[0] = 300; - this->unk_3A4.x = sZelda->actor.world.pos.x - 100.0f; - this->unk_3A4.y = sZelda->actor.world.pos.y + 30.0f; - this->unk_3A4.z = (sZelda->actor.world.pos.z + 30.0f) - 60.0f; - this->unk_3B0.x = sZelda->actor.world.pos.x; - this->unk_3B0.y = sZelda->actor.world.pos.y + 30.0f; - this->unk_3B0.z = sZelda->actor.world.pos.z - 10.0f; + this->unk_3A4.x = sBossGanon2Zelda->actor.world.pos.x - 100.0f; + this->unk_3A4.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f; + this->unk_3A4.z = (sBossGanon2Zelda->actor.world.pos.z + 30.0f) - 60.0f; + this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; + this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 30.0f; + this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z - 10.0f; Math_ApproachZeroF(&this->unk_324, 1.0f, 5.0f); Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 1.0f / 51); if (this->unk_1A2[1] == 80) { @@ -1355,8 +1375,8 @@ void func_80900890(BossGanon2* this, GlobalContext* globalCtx) { func_8002DF54(globalCtx, &this->actor, 0x60); this->unk_398 = 0; case 11: - player->actor.world.pos.x = sZelda->actor.world.pos.x + 50.0f + 10.0f; - player->actor.world.pos.z = sZelda->actor.world.pos.z - 25.0f; + player->actor.world.pos.x = sBossGanon2Zelda->actor.world.pos.x + 50.0f + 10.0f; + player->actor.world.pos.z = sBossGanon2Zelda->actor.world.pos.z - 25.0f; player->actor.shape.rot.y = -0x8000; this->unk_3A4.x = (player->actor.world.pos.x + 100.0f) - 80.0f; this->unk_3A4.y = (player->actor.world.pos.y + 60.0f) - 40.0f; @@ -1481,7 +1501,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { func_8002DF54(globalCtx, &this->actor, 8); this->unk_39C = 1; this->unk_398 = 0; - sZelda->unk_3C8 = 9; + sBossGanon2Zelda->unk_3C8 = 9; this->unk_31C = 0; this->unk_1A2[2] = 0; this->unk_336 = 0; @@ -1521,9 +1541,9 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { player->actor.shape.rot.y = -0x4000; player->actor.world.pos.x = 200.0f; player->actor.world.pos.z = 30.0f; - sZelda->actor.world.pos.x = 340.0f; - sZelda->actor.world.pos.z = -250.0f; - sZelda->actor.world.rot.y = sZelda->actor.shape.rot.y = -0x2000; + sBossGanon2Zelda->actor.world.pos.x = 340.0f; + sBossGanon2Zelda->actor.world.pos.z = -250.0f; + sBossGanon2Zelda->actor.world.rot.y = sBossGanon2Zelda->actor.shape.rot.y = -0x2000; this->unk_3A4.x = 250; this->unk_3A4.y = 1150.0f; this->unk_3A4.z = 0.0f; @@ -1542,9 +1562,9 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { this->unk_3A4.x = 250; this->unk_3A4.y = 1150.0f; this->unk_3A4.z = 0.0f; - Math_ApproachF(&this->unk_3B0.x, sZelda->actor.world.pos.x, 0.2f, 20.0f); - Math_ApproachF(&this->unk_3B0.y, sZelda->actor.world.pos.y + 50.0f, 0.2f, 10.0f); - Math_ApproachF(&this->unk_3B0.z, sZelda->actor.world.pos.z, 0.2f, 20.0f); + Math_ApproachF(&this->unk_3B0.x, sBossGanon2Zelda->actor.world.pos.x, 0.2f, 20.0f); + Math_ApproachF(&this->unk_3B0.y, sBossGanon2Zelda->actor.world.pos.y + 50.0f, 0.2f, 10.0f); + Math_ApproachF(&this->unk_3B0.z, sBossGanon2Zelda->actor.world.pos.z, 0.2f, 20.0f); if (this->unk_398 == 50) { this->unk_39C = 3; this->unk_398 = 0; @@ -1556,9 +1576,9 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { this->unk_3A4.x = 330.0f; this->unk_3A4.y = 1120.0f; this->unk_3A4.z = -150.0f; - this->unk_3B0.x = sZelda->actor.world.pos.x; - this->unk_3B0.y = sZelda->actor.world.pos.y + 40.0f; - this->unk_3B0.z = sZelda->actor.world.pos.z; + this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; + this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 40.0f; + this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z; if (this->unk_398 == 10) { Message_StartTextbox(globalCtx, 0x70D8, NULL); } @@ -1571,7 +1591,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { if (this->unk_398 > 10) { Math_ApproachZeroF(&this->unk_37C, 1.0f, 10.0f); if (this->unk_398 == 30) { - sZelda->unk_3C8 = 10; + sBossGanon2Zelda->unk_3C8 = 10; } this->unk_339 = 23; Math_ApproachZeroF(&globalCtx->envCtx.unk_D8, 1.0f, 0.05f); @@ -1742,7 +1762,7 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { if (this->unk_398 == 40) { this->unk_39C = 9; this->unk_398 = 0; - sZelda->unk_3C8 = 11; + sBossGanon2Zelda->unk_3C8 = 11; Message_StartTextbox(globalCtx, 0x70D9, NULL); this->unk_336 = 0; globalCtx->envCtx.unk_D8 = 0.0f; @@ -1753,9 +1773,9 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { this->unk_3A4.x = 330.0f; this->unk_3A4.y = 1120.0f; this->unk_3A4.z = -150.0f; - this->unk_3B0.x = sZelda->actor.world.pos.x; - this->unk_3B0.y = sZelda->actor.world.pos.y + 40.0f; - this->unk_3B0.z = sZelda->actor.world.pos.z; + this->unk_3B0.x = sBossGanon2Zelda->actor.world.pos.x; + this->unk_3B0.y = sBossGanon2Zelda->actor.world.pos.y + 40.0f; + this->unk_3B0.z = sBossGanon2Zelda->actor.world.pos.z; if (this->unk_398 > 60) { this->unk_39C = 10; this->unk_398 = 0; @@ -1770,26 +1790,26 @@ void func_8090120C(BossGanon2* this, GlobalContext* globalCtx) { if ((this->unk_398 >= 40) && (this->unk_398 <= 110)) { Math_ApproachF(&globalCtx->envCtx.unk_D8, 1.0f, 1.0f, 0.02f); Math_ApproachF(&this->unk_384, 10.0f, 0.1f, 0.2f); - Audio_PlayActorSound2(&sZelda->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG); + Audio_PlayActorSound2(&sBossGanon2Zelda->actor, NA_SE_EV_GOD_LIGHTBALL_2 - SFX_FLAG); } else { Math_ApproachZeroF(&this->unk_384, 1.0f, 0.2f); } if (this->unk_398 > 130) { - Math_ApproachF(&this->unk_3B0.y, (sZelda->actor.world.pos.y + 40.0f + 10.0f) - 20.0f, 0.1f, + Math_ApproachF(&this->unk_3B0.y, (sBossGanon2Zelda->actor.world.pos.y + 40.0f + 10.0f) - 20.0f, 0.1f, this->unk_410.x); } else { - Math_ApproachF(&this->unk_3B0.y, sZelda->actor.world.pos.y + 40.0f + 10.0f, 0.05f, + Math_ApproachF(&this->unk_3B0.y, sBossGanon2Zelda->actor.world.pos.y + 40.0f + 10.0f, 0.05f, this->unk_410.x * 0.25f); } Math_ApproachF(&this->unk_410.x, 1.0f, 1.0f, 0.01f); if (this->unk_398 == 10) { - sZelda->unk_3C8 = 12; + sBossGanon2Zelda->unk_3C8 = 12; } if (this->unk_398 == 110) { - sZelda->unk_3C8 = 13; + sBossGanon2Zelda->unk_3C8 = 13; } if (this->unk_398 == 140) { - Audio_PlayActorSound2(&sZelda->actor, NA_SE_EV_HUMAN_BOUND); + Audio_PlayActorSound2(&sBossGanon2Zelda->actor, NA_SE_EV_HUMAN_BOUND); } if (this->unk_398 < 160) { break; @@ -1844,7 +1864,7 @@ void func_80902348(BossGanon2* this, GlobalContext* globalCtx) { } func_8002F6D4(globalCtx, &this->actor, 15.0f, this->actor.yawTowardsPlayer + phi_v0_2, 2.0f, 0); - sZelda->unk_3C8 = 8; + sBossGanon2Zelda->unk_3C8 = 8; this->unk_316 = 10; break; } @@ -1863,7 +1883,7 @@ void func_80902348(BossGanon2* this, GlobalContext* globalCtx) { player->isBurning = true; func_8002F6D4(globalCtx, &this->actor, 10.0f, Math_Atan2S(temp_f12, temp_f2), 0.0f, 0x10); - sZelda->unk_3C8 = 8; + sBossGanon2Zelda->unk_3C8 = 8; } } } @@ -2167,7 +2187,7 @@ void BossGanon2_Update(Actor* thisx, GlobalContext* globalCtx) { if (D_80906D78 != 0) { D_80906D78 = 0; - for (i2 = 0; i2 < ARRAY_COUNT(sParticles); i2++) { + for (i2 = 0; i2 < ARRAY_COUNT(sBossGanon2Particles); i2++) { angle = Rand_ZeroFloat(2 * M_PI); sp44 = Rand_ZeroFloat(40.0f) + 10.0f; sp58 = this->actor.world.pos; @@ -2640,7 +2660,7 @@ void func_80904FC8(BossGanon2* this, GlobalContext* globalCtx) { gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, 200); gDPSetEnvColor(POLY_XLU_DISP++, 255, 200, 0, 0); gSPDisplayList(POLY_XLU_DISP++, ovl_Boss_Ganon2_DL_00B308); - Matrix_Translate(sZelda->actor.world.pos.x, sZelda->actor.world.pos.y + 80.0f, sZelda->actor.world.pos.z, + Matrix_Translate(sBossGanon2Zelda->actor.world.pos.x, sBossGanon2Zelda->actor.world.pos.y + 80.0f, sBossGanon2Zelda->actor.world.pos.z, MTXMODE_NEW); Matrix_ReplaceRotation(&globalCtx->billboardMtxF); Matrix_Scale(this->unk_384, this->unk_384, this->unk_384, MTXMODE_APPLY); @@ -2727,8 +2747,8 @@ void func_80905674(BossGanon2* this, GlobalContext* globalCtx) { this->unk_19C * -8, 32, 32)); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 170, (s16)this->unk_37C); gDPSetEnvColor(POLY_XLU_DISP++, 255, 200, 0, 128); - Matrix_Translate(sZelda->actor.world.pos.x + 100.0f, sZelda->actor.world.pos.y + 35.0f + 7.0f, - sZelda->actor.world.pos.z - 100.0f, MTXMODE_NEW); + Matrix_Translate(sBossGanon2Zelda->actor.world.pos.x + 100.0f, sBossGanon2Zelda->actor.world.pos.y + 35.0f + 7.0f, + sBossGanon2Zelda->actor.world.pos.z - 100.0f, MTXMODE_NEW); Matrix_RotateY(-M_PI / 4.0f, MTXMODE_APPLY); Matrix_Scale(0.040000003f, 0.040000003f, this->unk_380, MTXMODE_APPLY); Matrix_RotateX(M_PI / 2.0f, MTXMODE_APPLY); @@ -2825,7 +2845,7 @@ void func_80905DA8(BossGanon2* this, GlobalContext* globalCtx) { Vec3f sp78; s16 i; - for (i = 0; i < ARRAY_COUNT(sParticles); i++, effect++) { + for (i = 0; i < ARRAY_COUNT(sBossGanon2Particles); i++, effect++) { if (effect->type != 0) { effect->position.x += effect->velocity.x; effect->position.y += effect->velocity.y; @@ -2933,7 +2953,7 @@ void func_809060E8(GlobalContext* globalCtx) { effect = effects; - for (i = 0; i < ARRAY_COUNT(sParticles); i++, effect++) { + for (i = 0; i < ARRAY_COUNT(sBossGanon2Particles); i++, effect++) { if (effect->type == 2) { if (!usingObjectGEff) { BossGanon2_SetObjectSegment(NULL, globalCtx, OBJECT_GEFF, true); @@ -3079,12 +3099,12 @@ void BossGanon2_Reset(void) { D_8090EB20.y = 0; D_8090EB20.z = 0; D_80910638 = 0; - sZelda = NULL; + sBossGanon2Zelda = NULL; D_8090EB30 = NULL; - sSeed1 = 0; - sSeed2 = 0; - sSeed3 = 0; + sBossGanon2Seed1 = 0; + sBossGanon2Seed2 = 0; + sBossGanon2Seed3 = 0; memset(D_809105D8, 0, sizeof(D_809105D8)); memset(D_80910608, 0, sizeof(D_80910608)); - memset(sParticles, 0, sizeof(sParticles)); + memset(sBossGanon2Particles, 0, sizeof(sBossGanon2Particles)); } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h index 3d2625231..6271f5c14 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2.h @@ -4,6 +4,20 @@ #include "ultra64.h" #include "global.h" + +typedef struct { + /* 0x00 */ u8 type; + /* 0x01 */ u8 unk_01; + /* 0x04 */ Vec3f position; + /* 0x10 */ Vec3f velocity; + /* 0x1C */ Vec3f accel; + /* 0x28 */ char unk_28[0x6]; + /* 0x2E */ s16 unk_2E; + /* 0x30 */ char unk_30[0x4]; + /* 0x34 */ f32 scale; + /* 0x38 */ Vec3f unk_38; +} BossGanon2Effect; // size = 0x44 + struct BossGanon2; typedef void (*BossGanon2ActionFunc)(struct BossGanon2*, GlobalContext*); diff --git a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.c b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.c index 47201ed0d..e19b36bd6 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganon2/z_boss_ganon2_data.c @@ -2,19 +2,6 @@ #include "overlays/actors/ovl_En_Zl3/z_en_zl3.h" #include "objects/object_ganon2/object_ganon2.h" -typedef struct { - /* 0x00 */ u8 type; - /* 0x01 */ u8 unk_01; - /* 0x04 */ Vec3f position; - /* 0x10 */ Vec3f velocity; - /* 0x1C */ Vec3f accel; - /* 0x28 */ char unk_28[0x6]; - /* 0x2E */ s16 unk_2E; - /* 0x30 */ char unk_30[0x4]; - /* 0x34 */ f32 scale; - /* 0x38 */ Vec3f unk_38; -} BossGanon2Effect; // size = 0x44 - static Vec3f D_80906D60 = { 0.0f, 0.0f, 0.0f }; static Vec3f D_80906D6C = { 0.0f, 0.0f, 500.0f }; @@ -326,31 +313,7 @@ static s16 D_809071CC[] = { 1, -1, 1, 1, 3, 4, 1, 6, 7, 2, 9, 10, 2, 12, 13 }; static u8 D_809071EC[] = { 3, 2, 2, 1, 3, 3, 1, 3, 3, 1, 0, 3, 1, 0, 3 }; -// padding -static u32 D_809071FC[2] = { 0 }; - #include "overlays/ovl_Boss_Ganon2/ovl_Boss_Ganon2.h" -static Vec3f D_8090EB20; - -static EnZl3* sZelda; - -static Actor* D_8090EB30; - -// unused -static UNK_TYPE D_8090EB34; - -static BossGanon2Effect sParticles[100]; - -static s32 sSeed1; -static s32 sSeed2; -static s32 sSeed3; - -// unused -static UNK_TYPE D_809105DC; - -static Vec3f D_809105D8[4]; - -static Vec3f D_80910608[4]; - -static s8 D_80910638; +// padding +//static u32 D_809071FC[2] = { 0 }; diff --git a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c index 6f0c3dc30..227e0d6f0 100644 --- a/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c +++ b/soh/src/overlays/actors/ovl_Boss_Ganondrof/z_boss_ganondrof.c @@ -210,7 +210,7 @@ static Vec3f sAudioVec = { 0.0f, 0.0f, 50.0f }; // OTRTODO: This code appears to cause the game to gradually crash... // Might be an OoB write. For now it's disabled. -void BossGanondrof_ClearPixels8x8(s16* texture, u8* mask, s16 index) +void BossGanondrof_ClearPixels8x8(s16* texture, u8* mask, s16 index) { //texture = ResourceMgr_LoadTexByName(texture); if (mask[index]) { @@ -248,18 +248,18 @@ void BossGanondrof_ClearPixels32x16(s16* texture, u8* mask, s16 index) { } } -void BossGanondrof_ClearPixels16x32(s16* texture, u8* mask, s16 index) { +void BossGanondrof_ClearPixels16x32(s16* texture, u8* mask, s16 index) { //texture = ResourceMgr_LoadTexByName(texture); if (mask[index]) { s16 i = ((index & 0xF) * 2) + ((index & 0xF0) * 2); - + ResourceMgr_WriteTexS16ByName(texture, i + 1, 0); ResourceMgr_WriteTexS16ByName(texture, i, 0); //texture[i + 1] = 0; //texture[i] = 0; } - + } void BossGanondrof_ClearPixels(u8* mask, s16 index) { @@ -1274,7 +1274,7 @@ void BossGanondrof_CollisionCheck(BossGanondrof* this, GlobalContext* globalCtx) this->actor.colChkInfo.health -= dmg; } - if ((s8)this->actor.colChkInfo.health <= 0 || 1) { + if ((s8)this->actor.colChkInfo.health <= 0) { BossGanondrof_SetupDeath(this, globalCtx); Enemy_StartFinishingBlow(globalCtx, &this->actor); return; diff --git a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c index ad8e4537d..d84cf4a74 100644 --- a/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c +++ b/soh/src/overlays/actors/ovl_Boss_Goma/z_boss_goma.c @@ -926,7 +926,7 @@ void BossGoma_Encounter(BossGoma* this, GlobalContext* globalCtx) { if (!(gSaveContext.eventChkInf[7] & 1)) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gGohmaTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); + SEGMENTED_TO_VIRTUAL(gGohmaTitleCardTex), 160, 180, 128, 40, true); } Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); diff --git a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c index 7bcfd7c50..ae436ca2d 100644 --- a/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c +++ b/soh/src/overlays/actors/ovl_Boss_Mo/z_boss_mo.c @@ -10,6 +10,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "vt.h" +#include "soh/frame_interpolation.h" + #include #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) @@ -34,6 +36,7 @@ typedef struct { /* 0x30 */ f32 scale; /* 0x30 */ f32 fwork[2]; /* 0x3C */ Vec3f* targetPos; + u32 epoch; } BossMoEffect; // size = 0x40 #define MO_FX_MAX_SIZE 0 @@ -144,25 +147,25 @@ static f32 sFlatWidth[41] = { #include "z_boss_mo_colchk.c" static BossMoEffect sEffects[300]; -static s32 sSeed1; -static s32 sSeed2; -static s32 sSeed3; +static s32 sBossGanonSeed1; +static s32 sBossGanonSeed2; +static s32 sBossGanonSeed3; void BossMo_InitRand(s32 seedInit0, s32 seedInit1, s32 seedInit2) { - sSeed1 = seedInit0; - sSeed2 = seedInit1; - sSeed3 = seedInit2; + sBossGanonSeed1 = seedInit0; + sBossGanonSeed2 = seedInit1; + sBossGanonSeed3 = seedInit2; } f32 BossMo_RandZeroOne(void) { // Wichmann-Hill algorithm f32 randFloat; - sSeed1 = (sSeed1 * 171) % 30269; - sSeed2 = (sSeed2 * 172) % 30307; - sSeed3 = (sSeed3 * 170) % 30323; + sBossGanonSeed1 = (sBossGanonSeed1 * 171) % 30269; + sBossGanonSeed2 = (sBossGanonSeed2 * 172) % 30307; + sBossGanonSeed3 = (sBossGanonSeed3 * 170) % 30323; - randFloat = (sSeed1 / 30269.0f) + (sSeed2 / 30307.0f) + (sSeed3 / 30323.0f); + randFloat = (sBossGanonSeed1 / 30269.0f) + (sBossGanonSeed2 / 30307.0f) + (sBossGanonSeed3 / 30323.0f); while (randFloat >= 1.0f) { randFloat -= 1.0f; } @@ -211,6 +214,7 @@ void BossMo_SpawnRipple(BossMoEffect* effect, Vec3f* pos, f32 scale, f32 maxScal effect->rippleMode = 1; effect->fwork[MO_FX_SPREAD_RATE] = (effect->fwork[MO_FX_MAX_SIZE] - effect->scale) * 0.1f; } + effect->epoch++; break; } } @@ -232,6 +236,7 @@ void BossMo_SpawnDroplet(s16 type, BossMoEffect* effect, Vec3f* pos, Vec3f* vel, effect->scale = scale; effect->fwork[MO_FX_SPREAD_RATE] = 1.0f; effect->stopTimer = 0; + effect->epoch++; break; } } @@ -250,6 +255,7 @@ void BossMo_SpawnStillDroplet(BossMoEffect* effect, Vec3f* pos, f32 scale) { effect->accel = zeroVec; effect->scale = scale; effect->fwork[MO_FX_SPREAD_RATE] = 1.0f; + effect->epoch++; break; } } @@ -274,6 +280,7 @@ void BossMo_SpawnBubble(BossMoEffect* effect, Vec3f* pos, Vec3f* vel, Vec3f* acc effect->alpha = 0; } effect->timer = 0; + effect->epoch++; break; } } @@ -1423,7 +1430,7 @@ void BossMo_IntroCs(BossMo* this, GlobalContext* globalCtx) { } if (this->timers[2] == 130) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gMorphaTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); + SEGMENTED_TO_VIRTUAL(gMorphaTitleCardTex), 160, 180, 128, 40, true); gSaveContext.eventChkInf[7] |= 0x10; } break; @@ -2909,6 +2916,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->type == MO_FX_BIG_RIPPLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { func_80094BC4(gfxCtx); @@ -2925,6 +2933,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffWaterRippleDL); + FrameInterpolation_RecordCloseChild(); } } @@ -2932,6 +2941,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->type == MO_FX_SMALL_RIPPLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { func_80093D84(globalCtx->state.gfxCtx); @@ -2948,6 +2958,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gEffShockwaveDL); + FrameInterpolation_RecordCloseChild(); } } @@ -2956,6 +2967,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (((effect->type == MO_FX_DROPLET) || (effect->type == MO_FX_SPLASH)) || (effect->type == MO_FX_SPLASH_TRAIL)) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0); @@ -2977,6 +2989,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMorphaDropletModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -2984,6 +2997,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->type == MO_FX_WET_SPOT) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { func_80094044(gfxCtx); @@ -3003,6 +3017,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gMorphaWetSpotModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -3010,6 +3025,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 0; i < ARRAY_COUNT(sEffects); i++, effect++) { if (effect->type == MO_FX_BUBBLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { func_80093D18(globalCtx->state.gfxCtx); @@ -3027,6 +3043,7 @@ void BossMo_DrawEffects(BossMoEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gMorphaBubbleDL); + FrameInterpolation_RecordCloseChild(); } } @@ -3588,7 +3605,7 @@ void BossMo_Reset(void) { sMorphaTent1 = NULL; sMorphaTent2 = NULL; memset(sEffects, 0, sizeof(sEffects)); - sSeed1 = 0; - sSeed2 = 0; - sSeed3 = 0; + sBossGanonSeed1 = 0; + sBossGanonSeed2 = 0; + sBossGanonSeed3 = 0; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c index 6fae3778b..eeae20698 100644 --- a/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c +++ b/soh/src/overlays/actors/ovl_Boss_Sst/z_boss_sst.c @@ -598,7 +598,7 @@ void BossSst_HeadIntro(BossSst* this, GlobalContext* globalCtx) { } else if (revealStateTimer == 85) { if (!(gSaveContext.eventChkInf[7] & 0x80)) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gBongoTitleCardTex), 160, 180, 128, 40); + SEGMENTED_TO_VIRTUAL(gBongoTitleCardTex), 160, 180, 128, 40, true); } Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); Animation_MorphToPlayOnce(&this->skelAnime, &gBongoHeadEyeCloseAnim, -5.0f); @@ -3245,4 +3245,4 @@ void BossSst_Reset(void) { sCutsceneCamera= 0; sBodyStatic = false; -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c index 38e4996db..3c8fa9d91 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.c @@ -7,34 +7,6 @@ #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) -typedef enum { - /* 0 */ TWEFF_NONE, - /* 1 */ TWEFF_DOT, - /* 2 */ TWEFF_2, - /* 3 */ TWEFF_3, - /* 4 */ TWEFF_RING, - /* 5 */ TWEFF_PLYR_FRZ, - /* 6 */ TWEFF_FLAME, - /* 7 */ TWEFF_MERGEFLAME, - /* 8 */ TWEFF_SHLD_BLST, - /* 9 */ TWEFF_SHLD_DEFL, - /* 10 */ TWEFF_SHLD_HIT -} TwEffType; - -typedef enum { - /* 0 */ EFF_ARGS, - /* 1 */ EFF_UNKS1, - /* 2 */ EFF_WORK_MAX -} EffectWork; - -typedef enum { - /* 0 */ EFF_SCALE, - /* 1 */ EFF_DIST, - /* 2 */ EFF_ROLL, - /* 3 */ EFF_YAW, - /* 4 */ EFF_FWORK_MAX -} EffectFWork; - typedef enum { /* 0x00 */ TW_KOTAKE, /* 0x01 */ TW_KOUME, @@ -47,19 +19,6 @@ typedef enum { /* 0x69 */ TW_DEATHBALL_KOUME } TwinrovaType; -typedef struct { - /* 0x0000 */ u8 type; - /* 0x0001 */ u8 frame; - /* 0x0004 */ Vec3f pos; - /* 0x0010 */ Vec3f curSpeed; - /* 0x001C */ Vec3f accel; - /* 0x0028 */ Color_RGB8 color; - /* 0x002C */ s16 alpha; - /* 0x002E */ s16 work[EFF_WORK_MAX]; - /* 0x0034 */ f32 workf[EFF_FWORK_MAX]; - /* 0x0044 */ Actor* target; -} BossTwEffect; - void BossTw_Init(Actor* thisx, GlobalContext* globalCtx); void BossTw_Destroy(Actor* thisx, GlobalContext* globalCtx); void BossTw_Update(Actor* thisx, GlobalContext* globalCtx); @@ -200,7 +159,7 @@ static Vec3f sTwinrovaPillarPos[] = { { 0.0f, 380.0f, -580.0f }, }; -static u8 sTwInitalized = false; +u8 sTwInitalized = false; static InitChainEntry sInitChain[] = { ICHAIN_U8(targetMode, 5, ICHAIN_CONTINUE), @@ -233,7 +192,7 @@ static u8 D_8094C878; static s16 D_8094C87A; static s16 D_8094C87C; static u8 D_8094C87E; -static BossTwEffect sTwEffects[150]; +BossTwEffect sTwEffects[150]; void BossTw_AddDotEffect(GlobalContext* globalCtx, Vec3f* initalPos, Vec3f* initalSpeed, Vec3f* accel, f32 scale, s16 args, s16 countLimit) { @@ -2220,7 +2179,7 @@ void BossTw_TwinrovaIntroCS(BossTw* this, GlobalContext* globalCtx) { globalCtx->envCtx.unk_BE = 1; globalCtx->envCtx.unk_BD = 1; globalCtx->envCtx.unk_D8 = 0.0f; - TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gTwinrovaTitleCardTex), 160, 180, 128, 40); // OTRTODO + TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, SEGMENTED_TO_VIRTUAL(gTwinrovaTitleCardTex), 160, 180, 128, 40, true); gSaveContext.eventChkInf[7] |= 0x20; Audio_QueueSeqCmd(SEQ_PLAYER_BGM_MAIN << 24 | NA_BGM_BOSS); } @@ -5469,4 +5428,4 @@ void BossTw_TwinrovaLaugh(BossTw* this, GlobalContext* globalCtx) { void BossTw_Reset(void) { sTwInitalized = false; memset(sTwEffects, 0, sizeof(sTwEffects)); -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h index 575997c26..51b664726 100644 --- a/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h +++ b/soh/src/overlays/actors/ovl_Boss_Tw/z_boss_tw.h @@ -4,9 +4,46 @@ #include "ultra64.h" #include "global.h" -struct BossTw; +typedef enum { + /* 0 */ TWEFF_NONE, + /* 1 */ TWEFF_DOT, + /* 2 */ TWEFF_2, + /* 3 */ TWEFF_3, + /* 4 */ TWEFF_RING, + /* 5 */ TWEFF_PLYR_FRZ, + /* 6 */ TWEFF_FLAME, + /* 7 */ TWEFF_MERGEFLAME, + /* 8 */ TWEFF_SHLD_BLST, + /* 9 */ TWEFF_SHLD_DEFL, + /* 10 */ TWEFF_SHLD_HIT +} TwEffType; -typedef void (*BossTwActionFunc)(struct BossTw* this, GlobalContext* globalCtx); +typedef enum { + /* 0 */ EFF_ARGS, + /* 1 */ EFF_UNKS1, + /* 2 */ EFF_WORK_MAX +} EffectWork; + +typedef enum { + /* 0 */ EFF_SCALE, + /* 1 */ EFF_DIST, + /* 2 */ EFF_ROLL, + /* 3 */ EFF_YAW, + /* 4 */ EFF_FWORK_MAX +} EffectFWork; + +typedef struct { + /* 0x0000 */ u8 type; + /* 0x0001 */ u8 frame; + /* 0x0004 */ Vec3f pos; + /* 0x0010 */ Vec3f curSpeed; + /* 0x001C */ Vec3f accel; + /* 0x0028 */ Color_RGB8 color; + /* 0x002C */ s16 alpha; + /* 0x002E */ s16 work[EFF_WORK_MAX]; + /* 0x0034 */ f32 workf[EFF_FWORK_MAX]; + /* 0x0044 */ Actor* target; +} BossTwEffect; typedef enum { /* 0 */ CS_TIMER_1, @@ -55,6 +92,10 @@ typedef enum { /* 26 */ FWORK_MAX } TwFwork; +struct BossTw; + +typedef void (*BossTwActionFunc)(struct BossTw*, GlobalContext* globalCtx); + typedef struct BossTw { /* 0x0000 */ Actor actor; /* 0x014C */ BossTwActionFunc actionFunc; diff --git a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c index 071baa106..3d6865e24 100644 --- a/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c +++ b/soh/src/overlays/actors/ovl_Boss_Va/z_boss_va.c @@ -12,6 +12,8 @@ #include "overlays/actors/ovl_En_Boom/z_en_boom.h" #include "objects/gameplay_keep/gameplay_keep.h" +#include "soh/frame_interpolation.h" + #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_2 | ACTOR_FLAG_4 | ACTOR_FLAG_5) #define GET_BODY(this) ((BossVa*)(this)->actor.parent) @@ -40,6 +42,7 @@ typedef struct BossVaEffect { /* 0x44 */ f32 scaleMod; /* 0x48 */ Vec3f offset; /* 0x54 */ struct BossVa* parent; + u32 epoch; } BossVaEffect; // size = 0x58 typedef enum { @@ -979,7 +982,7 @@ void BossVa_BodyIntro(BossVa* this, GlobalContext* globalCtx) { if (!(gSaveContext.eventChkInf[7] & 0x40)) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gBarinadeTitleCardTex), 0xA0, 0xB4, 0x80, 0x28); + SEGMENTED_TO_VIRTUAL(gBarinadeTitleCardTex), 160, 180, 128, 40, true); } if (Rand_ZeroOne() < 0.1f) { @@ -3519,6 +3522,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { for (i = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_LARGE_SPARK) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 130, 130, 30, 0); @@ -3534,12 +3538,14 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_va.c", 4976), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_015710); + FrameInterpolation_RecordCloseChild(); } } effect = effectHead; for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_SPARK_BALL) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_011738); @@ -3560,12 +3566,14 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gDPSetEnvColor(POLY_XLU_DISP++, effect->envColor[0], effect->envColor[1], effect->envColor[2], effect->envColor[3]); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_011768); + FrameInterpolation_RecordCloseChild(); } } effect = effectHead; for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_BLOOD) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_009430); @@ -3590,6 +3598,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_va.c", 5052), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_009468); + FrameInterpolation_RecordCloseChild(); } } @@ -3598,6 +3607,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { if (effect->type == VA_TUMOR) { BossVa* parent = effect->parent; + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D18(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 0, effect->envColor[3]); @@ -3614,12 +3624,14 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gBarinadeDL_012948); } + FrameInterpolation_RecordCloseChild(); } } effect = effectHead; for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_GORE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D18(globalCtx->state.gfxCtx); gSPDisplayList(POLY_OPA_DISP++, gBarinadeDL_012BA0); @@ -3645,12 +3657,14 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_va.c", 5124), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gBarinadeDL_012C50); + FrameInterpolation_RecordCloseChild(); } } effect = effectHead; for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_ZAP_CHARGE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_0135B0); @@ -3668,12 +3682,14 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_va.c", 5152), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_013638); + FrameInterpolation_RecordCloseChild(); } } effect = effectHead; for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_BLAST_SPARK) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093C14(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 130, 130, 30, 0); @@ -3690,12 +3706,14 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_va.c", 5180), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_015710); + FrameInterpolation_RecordCloseChild(); } } effect = effectHead; for (i = 0, flag = 0; i < ARRAY_COUNT(sVaEffects); i++, effect++) { if (effect->type == VA_SMALL_SPARK) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!flag) { func_80093D84(globalCtx->state.gfxCtx); gDPSetEnvColor(POLY_XLU_DISP++, 255, 255, 100, 0); @@ -3712,6 +3730,7 @@ void BossVa_DrawEffects(BossVaEffect* effect, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(gfxCtx, "../z_boss_va.c", 5208), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gBarinadeDL_008F70); + FrameInterpolation_RecordCloseChild(); } } @@ -3734,6 +3753,7 @@ void BossVa_SpawnSpark(GlobalContext* globalCtx, BossVaEffect* effect, BossVa* t effect->timer = (s16)(Rand_ZeroOne() * 10.0f) + 111; effect->velocity = effect->accel = sZeroVec; effect->mode = mode; + effect->epoch++; switch (mode) { case SPARK_UNUSED: @@ -4028,4 +4048,4 @@ void BossVa_Reset(void) { sZapperRot.z = 0; sPhase2Timer = 0; sPhase4HP = 0; -} \ No newline at end of file +} diff --git a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c index 4f75a03cd..acff25c75 100644 --- a/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c +++ b/soh/src/overlays/actors/ovl_Demo_6K/z_demo_6k.c @@ -307,7 +307,7 @@ void func_8096712C(Demo6K* this, GlobalContext* globalCtx) { } } -static Vec3f velocity = { 0.0f, 0.0f, 0.0f }; +Vec3f sDemo6kVelocity = { 0.0f, 0.0f, 0.0f }; void func_80967244(Demo6K* this, GlobalContext* globalCtx) { static Vec3f accel = { 0.0f, 0.0f, 0.0f }; static Color_RGBA8 primColor = { 255, 255, 255, 0 }; @@ -324,9 +324,9 @@ void func_80967244(Demo6K* this, GlobalContext* globalCtx) { rand1 = Rand_ZeroFloat(0xFFFF); rand2 = Rand_ZeroFloat(0xFFFF); - velocity.x = Math_SinS(rand2) * Math_CosS(rand1) * 20.0f; - velocity.z = Math_CosS(rand2) * Math_CosS(rand1) * 20.0f; - velocity.y = Math_SinS(rand1) * 20.0f; + sDemo6kVelocity.x = Math_SinS(rand2) * Math_CosS(rand1) * 20.0f; + sDemo6kVelocity.z = Math_CosS(rand2) * Math_CosS(rand1) * 20.0f; + sDemo6kVelocity.y = Math_SinS(rand1) * 20.0f; accel.y = 0.0f; @@ -342,7 +342,7 @@ void func_80967244(Demo6K* this, GlobalContext* globalCtx) { scale = 18000; } - EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &velocity, &accel, &primColor, &envColor, scale, 20); + EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &sDemo6kVelocity, &accel, &primColor, &envColor, scale, 20); } void func_80967410(Demo6K* this, GlobalContext* globalCtx) { @@ -820,7 +820,7 @@ void func_809691BC(Demo6K* this, GlobalContext* globalCtx, s32 params) { } void Demo6K_Reset(void) { - velocity.x = 0.0f; - velocity.y = 0.0f; - velocity.z = 0.0f; + sDemo6kVelocity.x = 0.0f; + sDemo6kVelocity.y = 0.0f; + sDemo6kVelocity.z = 0.0f; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c index a94fa36af..53044464c 100644 --- a/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c +++ b/soh/src/overlays/actors/ovl_Demo_Kekkai/z_demo_kekkai.c @@ -132,7 +132,7 @@ void DemoKekkai_Destroy(Actor* thisx, GlobalContext* globalCtx) { Collider_DestroyCylinder(globalCtx, &this->collider2); } -static Vec3f vel = { 0.0f, 0.0f, 0.0f }; +Vec3f demoKekkaiVel = { 0.0f, 0.0f, 0.0f }; void DemoKekkai_SpawnParticles(DemoKekkai* this, GlobalContext* globalCtx) { static Vec3f accel = { 0.0f, 0.0f, 0.0f }; static Color_RGBA8 lightYellow = { 255, 255, 170, 0 }; @@ -144,15 +144,15 @@ void DemoKekkai_SpawnParticles(DemoKekkai* this, GlobalContext* globalCtx) { s16 roll = Rand_ZeroFloat(65535.0f); s16 yaw = Rand_ZeroFloat(65535.0f); - vel.x = Math_SinS(yaw) * Math_CosS(roll) * Rand_ZeroFloat(8.0f); - vel.z = Math_CosS(yaw) * Math_CosS(roll) * Rand_ZeroFloat(8.0f); - vel.y = Math_SinS(roll) * Rand_ZeroFloat(3.0f); + demoKekkaiVel.x = Math_SinS(yaw) * Math_CosS(roll) * Rand_ZeroFloat(8.0f); + demoKekkaiVel.z = Math_CosS(yaw) * Math_CosS(roll) * Rand_ZeroFloat(8.0f); + demoKekkaiVel.y = Math_SinS(roll) * Rand_ZeroFloat(3.0f); - pos.x = (vel.x * 7.0f) + this->actor.world.pos.x; - pos.y = (vel.y * 20.0f) + this->actor.world.pos.y + 120.0f; - pos.z = (vel.z * 7.0f) + this->actor.world.pos.z; + pos.x = (demoKekkaiVel.x * 7.0f) + this->actor.world.pos.x; + pos.y = (demoKekkaiVel.y * 20.0f) + this->actor.world.pos.y + 120.0f; + pos.z = (demoKekkaiVel.z * 7.0f) + this->actor.world.pos.z; - EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &vel, &accel, &lightYellow, &darkRed, 3000, + EffectSsKiraKira_SpawnFocused(globalCtx, &pos, &demoKekkaiVel, &accel, &lightYellow, &darkRed, 3000, (s32)Rand_ZeroFloat(40.0f) + 45); } } @@ -338,7 +338,7 @@ void DemoKekkai_DrawTowerBarrier(Actor* thisx, GlobalContext* globalCtx) { } void DemoKekkai_Reset(void) { - vel.x = 0.0f; - vel.y = 0.0f; - vel.z = 0.0f; + demoKekkaiVel.x = 0.0f; + demoKekkaiVel.y = 0.0f; + demoKekkaiVel.z = 0.0f; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c index 46f3d1857..ee503dd43 100644 --- a/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c +++ b/soh/src/overlays/actors/ovl_Door_Warp1/z_door_warp1.c @@ -53,7 +53,7 @@ static InitChainEntry sInitChain[] = { ICHAIN_F32(uncullZoneDownward, 4000, ICHAIN_STOP), }; -static s16 sWarpTimerTarget; +s16 sWarpTimerTarget; void DoorWarp1_SetupAction(DoorWarp1* this, DoorWarp1ActionFunc actionFunc) { this->actionFunc = actionFunc; diff --git a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c index 2e8858a94..5e0a780fd 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg/z_elf_msg.c @@ -138,6 +138,10 @@ void ElfMsg_CallNaviCylinder(ElfMsg* this, GlobalContext* globalCtx) { Player* player = GET_PLAYER(globalCtx); EnElf* navi = (EnElf*)player->naviActor; + // This fixes a crash when using a grotto exit when you never properly entered + if (navi == NULL) + return; + if (ElfMsg_WithinXZDistance(&player->actor.world.pos, &this->actor.world.pos, this->actor.scale.x * 100.0f) && (this->actor.world.pos.y <= player->actor.world.pos.y) && ((player->actor.world.pos.y - this->actor.world.pos.y) < (100.0f * this->actor.scale.y))) { @@ -164,9 +168,13 @@ void ElfMsg_Update(Actor* thisx, GlobalContext* globalCtx) { } } +#ifdef ZELDA_DEBUG #include "overlays/ovl_Elf_Msg/ovl_Elf_Msg.h" +#endif -void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx) { +void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx) +{ +#ifdef ZELDA_DEBUG OPEN_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg.c", 436); if (R_NAVI_MSG_REGION_ALPHA == 0) { @@ -191,4 +199,5 @@ void ElfMsg_Draw(Actor* thisx, GlobalContext* globalCtx) { } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg.c", 457); + #endif } diff --git a/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c b/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c index f23f49e10..73b6785c8 100644 --- a/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c +++ b/soh/src/overlays/actors/ovl_Elf_Msg2/z_elf_msg2.c @@ -148,9 +148,12 @@ void ElfMsg2_Update(Actor* thisx, GlobalContext* globalCtx) { } } +#if ZELDA_DEBUG #include "overlays/ovl_Elf_Msg2/ovl_Elf_Msg2.h" +#endif void ElfMsg2_Draw(Actor* thisx, GlobalContext* globalCtx) { +#if ZELDA_DEBUG OPEN_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg2.c", 355); if (R_NAVI_MSG_REGION_ALPHA == 0) { @@ -165,4 +168,5 @@ void ElfMsg2_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPDisplayList(POLY_XLU_DISP++, sCubeDL); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_elf_msg2.c", 367); + #endif } diff --git a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c index 14e9ff15c..6eaa2f777 100644 --- a/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c +++ b/soh/src/overlays/actors/ovl_En_Bw/z_en_bw.c @@ -122,7 +122,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -static s32 sSlugGroup = 0; +s32 sSlugGroup = 0; void EnBw_SetupAction(EnBw* this, EnBwActionFunc actionFunc) { this->actionFunc = actionFunc; diff --git a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c index e68eaabb1..274505978 100644 --- a/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c +++ b/soh/src/overlays/actors/ovl_En_Clear_Tag/z_en_clear_tag.c @@ -35,7 +35,7 @@ const ActorInit En_Clear_Tag_InitVars = { (ActorResetFunc)EnClearTag_Reset, }; -static u8 sIsEffectsInitialized = false; +u8 sClearTagIsEffectsInitialized = false; static Vec3f sZeroVector = { 0.0f, 0.0f, 0.0f }; @@ -79,10 +79,10 @@ static ColliderCylinderInit sLaserCylinderInit = { { 15, 30, 10, { 0, 0, 0 } }, }; -static UNK_TYPE4 D_809D5C98 = 0; // unused -static UNK_TYPE4 D_809D5C9C = 0; // unused +//static UNK_TYPE4 D_809D5C98 = 0; // unused +//static UNK_TYPE4 D_809D5C9C = 0; // unused -static EnClearTagEffect sClearTagEffects[CLEAR_TAG_EFFECT_MAX_COUNT]; +EnClearTagEffect sClearTagEffects[CLEAR_TAG_EFFECT_MAX_COUNT]; #include "overlays/ovl_En_Clear_Tag/ovl_En_Clear_Tag.h" @@ -273,8 +273,8 @@ void EnClearTag_Init(Actor* thisx, GlobalContext* globalCtx) { } // Initialize all effects to available if effects have not been initialized. - if (!sIsEffectsInitialized) { - sIsEffectsInitialized = true; + if (!sClearTagIsEffectsInitialized) { + sClearTagIsEffectsInitialized = true; globalCtx->specialEffects = &sClearTagEffects[0]; for (i = 0; i < CLEAR_TAG_EFFECT_MAX_COUNT; i++) { sClearTagEffects[i].type = CLEAR_TAG_EFFECT_AVAILABLE; @@ -1027,5 +1027,5 @@ void EnClearTag_DrawEffects(GlobalContext* globalCtx) { void EnClearTag_Reset(void) { memset(sClearTagEffects, 0, sizeof(sClearTagEffects)); - sIsEffectsInitialized = false; + sClearTagIsEffectsInitialized = false; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c index 91c059bee..54b93277c 100644 --- a/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c +++ b/soh/src/overlays/actors/ovl_En_Ex_Item/z_en_ex_item.c @@ -496,7 +496,7 @@ void EnExItem_DrawMagic(EnExItem* this, GlobalContext* globalCtx, s16 magicIndex } void EnExItem_DrawKey(EnExItem* this, GlobalContext* globalCtx, s32 index) { - static s32 keySegments[] = { 0x0403F140 }; + static void* keySegments[] = { gDropKeySmallTex }; OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_ex_item.c", 880); diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c index 38c86eda3..c84a22fb8 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.c @@ -84,18 +84,7 @@ sEnFrPointers.flags = 12 - Deactivate frogs, frogs will jump back into the water */ -typedef struct { - u8 flags; - EnFr* frogs[5]; -} EnFrPointers; - -typedef struct { - f32 xzDist; - f32 yaw; - f32 yDist; -} LogSpotToFromWater; - -static EnFrPointers sEnFrPointers = { +EnFrPointers sEnFrPointers = { 0x00, { NULL, @@ -106,6 +95,7 @@ static EnFrPointers sEnFrPointers = { }, }; + // Flags for gSaveContext.eventChkInf[13] static u16 sSongIndex[] = { 0x0002, 0x0004, 0x0010, 0x0008, 0x0020, 0x0040, 0x0001, 0x0000, diff --git a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h index ba2ef5014..154aefc17 100644 --- a/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h +++ b/soh/src/overlays/actors/ovl_En_Fr/z_en_fr.h @@ -28,6 +28,12 @@ typedef enum { /* 07 */ FROG_NO_SONG } FrogSongType; +typedef struct { + f32 xzDist; + f32 yaw; + f32 yDist; +} LogSpotToFromWater; + typedef struct EnFr { /* 0x0000 */ Actor actor; /* 0x014C */ SkelAnime skelAnime; // Frog Skeleton @@ -69,4 +75,9 @@ typedef struct EnFr { /* 0x03B8 */ Vec3f posButterflyLight; // Used in Lights_PointNoGlowSetInfo() } EnFr; // size = 0x03C4 +typedef struct { + u8 flags; + EnFr* frogs[5]; +} EnFrPointers; + #endif diff --git a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c index 85049b7f1..a9997c383 100644 --- a/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c +++ b/soh/src/overlays/actors/ovl_En_Goma/z_en_goma.c @@ -96,7 +96,7 @@ static ColliderCylinderInit D_80A4B7CC = { { 15, 30, 10, { 0, 0, 0 } }, }; -static u8 sSpawnNum = 0; +u8 sSpawnNum = 0; static Vec3f sDeadEffectVel = { 0.0f, 0.0f, 0.0f }; static InitChainEntry sInitChain[] = { diff --git a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c index 649c1b747..bd529ea55 100644 --- a/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c +++ b/soh/src/overlays/actors/ovl_En_Insect/z_en_insect.c @@ -32,9 +32,9 @@ void func_80A7D26C(EnInsect* this, GlobalContext* globalCtx); void func_80A7D39C(EnInsect* this); void func_80A7D460(EnInsect* this, GlobalContext* globalCtx); -static f32 D_80A7DEB0 = 0.0f; -static s16 D_80A7DEB4 = 0; -static s16 D_80A7DEB8 = 0; +f32 D_80A7DEB0 = 0.0f; +s16 D_80A7DEB4 = 0; +s16 D_80A7DEB8 = 0; const ActorInit En_Insect_InitVars = { ACTOR_EN_INSECT, diff --git a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c index 4ce8fae20..11573dba0 100644 --- a/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c +++ b/soh/src/overlays/actors/ovl_En_Ishi/z_en_ishi.c @@ -29,8 +29,8 @@ void EnIshi_SpawnFragmentsLarge(EnIshi* this, GlobalContext* globalCtx); void EnIshi_SpawnDustSmall(EnIshi* this, GlobalContext* globalCtx); void EnIshi_SpawnDustLarge(EnIshi* this, GlobalContext* globalCtx); -static s16 sRotSpeedX = 0; -static s16 sRotSpeedY = 0; +s16 sRockRotSpeedX = 0; +s16 sRockRotSpeedY = 0; const ActorInit En_Ishi_InitVars = { ACTOR_EN_ISHI, @@ -405,11 +405,11 @@ void EnIshi_SetupFly(EnIshi* this) { this->actor.velocity.x = Math_SinS(this->actor.world.rot.y) * this->actor.speedXZ; this->actor.velocity.z = Math_CosS(this->actor.world.rot.y) * this->actor.speedXZ; if ((this->actor.params & 1) == ROCK_SMALL) { - sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; - sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; + sRockRotSpeedX = (Rand_ZeroOne() - 0.5f) * 16000.0f; + sRockRotSpeedY = (Rand_ZeroOne() - 0.5f) * 2400.0f; } else { - sRotSpeedX = (Rand_ZeroOne() - 0.5f) * 8000.0f; - sRotSpeedY = (Rand_ZeroOne() - 0.5f) * 1600.0f; + sRockRotSpeedX = (Rand_ZeroOne() - 0.5f) * 8000.0f; + sRockRotSpeedY = (Rand_ZeroOne() - 0.5f) * 1600.0f; } this->actor.colChkInfo.mass = 240; this->actionFunc = EnIshi_Fly; @@ -455,8 +455,8 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { EffectSsGRipple_Spawn(globalCtx, &contactPos, 500, 1300, 8); } this->actor.minVelocityY = -6.0f; - sRotSpeedX >>= 2; - sRotSpeedY >>= 2; + sRockRotSpeedX >>= 2; + sRockRotSpeedY >>= 2; SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 40, NA_SE_EV_DIVE_INTO_WATER_L); this->actor.bgCheckFlags &= ~0x40; } @@ -464,8 +464,8 @@ void EnIshi_Fly(EnIshi* this, GlobalContext* globalCtx) { EnIshi_Fall(this); func_80A7ED94(&this->actor.velocity, D_80A7FA28[type]); func_8002D7EC(&this->actor); - this->actor.shape.rot.x += sRotSpeedX; - this->actor.shape.rot.y += sRotSpeedY; + this->actor.shape.rot.x += sRockRotSpeedX; + this->actor.shape.rot.y += sRockRotSpeedY; Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 7.5f, 35.0f, 0.0f, 0xC5); Collider_UpdateCylinder(&this->actor, &this->collider); CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base); @@ -502,6 +502,6 @@ void EnIshi_Draw(Actor* thisx, GlobalContext* globalCtx) { } void EnIshi_Reset(void) { - sRotSpeedX = 0; - sRotSpeedY = 0; + sRockRotSpeedX = 0; + sRockRotSpeedY = 0; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c index 1b89b7b8d..620463b04 100644 --- a/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c +++ b/soh/src/overlays/actors/ovl_En_Kusa/z_en_kusa.c @@ -300,7 +300,7 @@ void EnKusa_Main(EnKusa* this, GlobalContext* globalCtx) { if (Actor_HasParent(&this->actor, globalCtx)) { EnKusa_SetupLiftedUp(this); SoundSource_PlaySfxAtFixedWorldPos(globalCtx, &this->actor.world.pos, 20, NA_SE_PL_PULL_UP_PLANT); - } else if (this->collider.base.acFlags & AC_HIT) { + } else if (this->collider.base.acFlags & AC_HIT && gGlobalCtx->csCtx.state == 0) { this->collider.base.acFlags &= ~AC_HIT; EnKusa_SpawnFragments(this, globalCtx); EnKusa_DropCollectible(this, globalCtx); diff --git a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c index 1161ba5e3..502f2c056 100644 --- a/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c +++ b/soh/src/overlays/actors/ovl_En_Kz/z_en_kz.c @@ -287,7 +287,7 @@ s32 EnKz_FollowPath(EnKz* this, GlobalContext* globalCtx) { pathDiffZ = pointPos->z - this->actor.world.pos.z; Math_SmoothStepToS(&this->actor.world.rot.y, (Math_FAtan2F(pathDiffX, pathDiffZ) * (0x8000 / M_PI)), 0xA, 0x3E8, 1); - if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f) { + if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f * CVar_GetS32("gMweepSpeed", 1)) { this->waypoint++; if (this->waypoint >= path->count) { this->waypoint = 0; @@ -378,7 +378,7 @@ void EnKz_SetupMweep(EnKz* this, GlobalContext* globalCtx) { initPos.z += 260.0f; Gameplay_CameraSetAtEye(globalCtx, this->cutsceneCamera, &pos, &initPos); func_8002DF54(globalCtx, &this->actor, 8); - this->actor.speedXZ = 0.1f; + this->actor.speedXZ = 0.1f * CVar_GetS32("gMweepSpeed", 1); this->actionFunc = EnKz_Mweep; } diff --git a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c index c6e23b8b9..5cf7abc25 100644 --- a/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c +++ b/soh/src/overlays/actors/ovl_En_Niw/z_en_niw.c @@ -35,7 +35,7 @@ void EnNiw_FeatherSpawn(EnNiw* this, Vec3f* pos, Vec3f* vel, Vec3f* accel, f32 s void EnNiw_FeatherUpdate(EnNiw* this, GlobalContext* globalCtx); void EnNiw_FeatherDraw(EnNiw* this, GlobalContext* globalCtx); -static s16 D_80AB85E0 = 0; +s16 D_80AB85E0 = 0; const ActorInit En_Niw_InitVars = { ACTOR_EN_NIW, @@ -70,9 +70,9 @@ static s16 sKakarikoFlagList[] = { 0x0200, 0x0400, 0x0800, 0x1000, 0x2000, 0x4000, 0x8000, }; -static u8 sLowerRiverSpawned = false; +u8 sLowerRiverSpawned = false; -static u8 sUpperRiverSpawned = false; +u8 sUpperRiverSpawned = false; static ColliderCylinderInit sCylinderInit1 = { { diff --git a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c index 04975d910..4d5fefec6 100644 --- a/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c +++ b/soh/src/overlays/actors/ovl_En_Ossan/z_en_ossan.c @@ -948,7 +948,9 @@ s32 EnOssan_FacingShopkeeperDialogResult(EnOssan* this, GlobalContext* globalCtx } void EnOssan_State_FacingShopkeeper(EnOssan* this, GlobalContext* globalCtx, Player* player) { + Input* input = &globalCtx->state.input[0]; u8 nextIndex; + bool dpad = CVar_GetS32("gDpadShop", 0); if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_CHOICE) && !EnOssan_TestEndInteraction(this, globalCtx, &globalCtx->state.input[0])) { @@ -957,7 +959,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, GlobalContext* globalCtx, Pla return; } // Stick Left - if (this->stickAccumX < 0) { + if ((this->stickAccumX < 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { nextIndex = EnOssan_SetCursorIndexFromNeutral(this, 4); if (nextIndex != CURSOR_INVALID) { this->cursorIndex = nextIndex; @@ -966,7 +968,7 @@ void EnOssan_State_FacingShopkeeper(EnOssan* this, GlobalContext* globalCtx, Pla this->stickLeftPrompt.isEnabled = false; func_80078884(NA_SE_SY_CURSOR); } - } else if (this->stickAccumX > 0) { + } else if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { nextIndex = EnOssan_SetCursorIndexFromNeutral(this, 0); if (nextIndex != CURSOR_INVALID) { this->cursorIndex = nextIndex; @@ -1023,11 +1025,13 @@ void EnOssan_State_LookToRightShelf(EnOssan* this, GlobalContext* globalCtx, Pla } } -void EnOssan_CursorUpDown(EnOssan* this) { +void EnOssan_CursorUpDown(EnOssan* this, GlobalContext* globalCtx) { + Input* input = &globalCtx->state.input[0]; u8 curTemp = this->cursorIndex; u8 curScanTemp; + bool dpad = CVar_GetS32("gDpadShop", 0); - if (this->stickAccumY < 0) { + if ((this->stickAccumY < 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { curTemp &= 0xFE; if (this->shelfSlots[curTemp] != NULL) { this->cursorIndex = curTemp; @@ -1066,7 +1070,7 @@ void EnOssan_CursorUpDown(EnOssan* this) { } } } - } else if (this->stickAccumY > 0) { + } else if ((this->stickAccumY > 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { curTemp |= 1; if (this->shelfSlots[curTemp] != NULL) { this->cursorIndex = curTemp; @@ -1172,11 +1176,13 @@ s32 EnOssan_HasPlayerSelectedItem(GlobalContext* globalCtx, EnOssan* this, Input } void EnOssan_State_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx, Player* player) { + Input* input = &globalCtx->state.input[0]; s32 a; s32 b; u8 prevIndex = this->cursorIndex; s32 c; s32 d; + bool dpad = CVar_GetS32("gDpadShop", 0); if (!EnOssan_ReturnItemToShelf(this)) { osSyncPrintf("%s[%d]:" VT_FGCOL(GREEN) "ズーム中ï¼ï¼" VT_RST "\n", "../z_en_oB1.c", 2152); @@ -1193,7 +1199,7 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx, Play if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && !EnOssan_HasPlayerSelectedItem(globalCtx, this, &globalCtx->state.input[0])) { if (this->moveHorizontal) { - if (this->stickAccumX > 0) { + if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { a = EnOssan_CursorRight(this, this->cursorIndex, 4); if (a != CURSOR_INVALID) { this->cursorIndex = a; @@ -1201,14 +1207,14 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx, Play EnOssan_SetLookToShopkeeperFromShelf(globalCtx, this); return; } - } else if (this->stickAccumX < 0) { + } else if ((this->stickAccumX < 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { b = EnOssan_CursorLeft(this, this->cursorIndex, 8); if (b != CURSOR_INVALID) { this->cursorIndex = b; } } } else { - if (this->stickAccumX > 0 && this->stickAccumX > 500) { + if ((this->stickAccumX > 0 && this->stickAccumX > 500) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { c = EnOssan_CursorRight(this, this->cursorIndex, 4); if (c != CURSOR_INVALID) { this->cursorIndex = c; @@ -1216,14 +1222,14 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx, Play EnOssan_SetLookToShopkeeperFromShelf(globalCtx, this); return; } - } else if (this->stickAccumX < 0 && this->stickAccumX < -500) { + } else if ((this->stickAccumX < 0 && this->stickAccumX < -500) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { d = EnOssan_CursorLeft(this, this->cursorIndex, 8); if (d != CURSOR_INVALID) { this->cursorIndex = d; } } } - EnOssan_CursorUpDown(this); + EnOssan_CursorUpDown(this, globalCtx); if (this->cursorIndex != prevIndex) { Message_ContinueTextbox(globalCtx, this->shelfSlots[this->cursorIndex]->actor.textId); func_80078884(NA_SE_SY_CURSOR); @@ -1232,9 +1238,11 @@ void EnOssan_State_BrowseLeftShelf(EnOssan* this, GlobalContext* globalCtx, Play } void EnOssan_State_BrowseRightShelf(EnOssan* this, GlobalContext* globalCtx, Player* player) { + Input* input = &globalCtx->state.input[0]; s32 pad[2]; u8 prevIndex; u8 nextIndex; + bool dpad = CVar_GetS32("gDpadShop", 0); prevIndex = this->cursorIndex; if (!EnOssan_ReturnItemToShelf(this)) { @@ -1252,7 +1260,7 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, GlobalContext* globalCtx, Pla if ((Message_GetState(&globalCtx->msgCtx) == TEXT_STATE_EVENT) && !EnOssan_HasPlayerSelectedItem(globalCtx, this, &globalCtx->state.input[0])) { if (this->moveHorizontal) { - if (this->stickAccumX < 0) { + if ((this->stickAccumX < 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { nextIndex = EnOssan_CursorRight(this, this->cursorIndex, 0); if (nextIndex != CURSOR_INVALID) { this->cursorIndex = nextIndex; @@ -1260,14 +1268,14 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, GlobalContext* globalCtx, Pla EnOssan_SetLookToShopkeeperFromShelf(globalCtx, this); return; } - } else if (this->stickAccumX > 0) { + } else if ((this->stickAccumX > 0) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { nextIndex = EnOssan_CursorLeft(this, this->cursorIndex, 4); if (nextIndex != CURSOR_INVALID) { this->cursorIndex = nextIndex; } } } else { - if (this->stickAccumX < 0 && this->stickAccumX < -500) { + if ((this->stickAccumX < 0 && this->stickAccumX < -500) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { nextIndex = EnOssan_CursorRight(this, this->cursorIndex, 0); if (nextIndex != CURSOR_INVALID) { this->cursorIndex = nextIndex; @@ -1275,14 +1283,14 @@ void EnOssan_State_BrowseRightShelf(EnOssan* this, GlobalContext* globalCtx, Pla EnOssan_SetLookToShopkeeperFromShelf(globalCtx, this); return; } - } else if (this->stickAccumX > 0 && this->stickAccumX > 500) { + } else if ((this->stickAccumX > 0 && this->stickAccumX > 500) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { nextIndex = EnOssan_CursorLeft(this, this->cursorIndex, 4); if (nextIndex != CURSOR_INVALID) { this->cursorIndex = nextIndex; } } } - EnOssan_CursorUpDown(this); + EnOssan_CursorUpDown(this, globalCtx); if (this->cursorIndex != prevIndex) { Message_ContinueTextbox(globalCtx, this->shelfSlots[this->cursorIndex]->actor.textId); func_80078884(NA_SE_SY_CURSOR); diff --git a/soh/src/overlays/actors/ovl_En_Part/z_en_part.c b/soh/src/overlays/actors/ovl_En_Part/z_en_part.c index ec4079887..bdf29aa52 100644 --- a/soh/src/overlays/actors/ovl_En_Part/z_en_part.c +++ b/soh/src/overlays/actors/ovl_En_Part/z_en_part.c @@ -298,13 +298,13 @@ void EnPart_Draw(Actor* thisx, GlobalContext* globalCtx) { gSPSegment(POLY_OPA_DISP++, 0x09, func_80ACEAC0(globalCtx->state.gfxCtx, 225, 205, 115, 25, 20, 0)); gSPSegment(POLY_OPA_DISP++, 0x0A, func_80ACEAC0(globalCtx->state.gfxCtx, 225, 205, 115, 25, 20, 0)); } else if ((thisx->params == 9) && (this->displayList == ResourceMgr_LoadGfxByName(object_tite_DL_002FF0))) { - gSPSegment(POLY_OPA_DISP++, 0x08, ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(object_tite_Tex_001300))); - gSPSegment(POLY_OPA_DISP++, 0x09, ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(object_tite_Tex_001700))); - gSPSegment(POLY_OPA_DISP++, 0x0A, ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(object_tite_Tex_001900))); + gSPSegment(POLY_OPA_DISP++, 0x08, object_tite_Tex_001300); + gSPSegment(POLY_OPA_DISP++, 0x09, object_tite_Tex_001700); + gSPSegment(POLY_OPA_DISP++, 0x0A, object_tite_Tex_001900); } else if ((thisx->params == 10) && (this->displayList == ResourceMgr_LoadGfxByName(object_tite_DL_002FF0))) { - gSPSegment(POLY_OPA_DISP++, 0x08, ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(object_tite_Tex_001B00))); - gSPSegment(POLY_OPA_DISP++, 0x09, ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(object_tite_Tex_001F00))); - gSPSegment(POLY_OPA_DISP++, 0x0A, ResourceMgr_LoadTexByName(SEGMENTED_TO_VIRTUAL(object_tite_Tex_002100))); + gSPSegment(POLY_OPA_DISP++, 0x08, object_tite_Tex_001B00); + gSPSegment(POLY_OPA_DISP++, 0x09, object_tite_Tex_001F00); + gSPSegment(POLY_OPA_DISP++, 0x0A, object_tite_Tex_002100); } if (this->displayList != NULL) { diff --git a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c index 93f48417e..63b386238 100644 --- a/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c +++ b/soh/src/overlays/actors/ovl_En_Po_Field/z_en_po_field.c @@ -126,7 +126,7 @@ static DamageTable sDamageTable = { /* Unknown 2 */ DMG_ENTRY(0, 0x0), }; -static s32 sNumSpawned = 0; +s32 sEnPoFieldNumSpawned = 0; static Vec3f sFieldMiddle = { -1000.0f, 0.0f, 6500.0f }; @@ -145,22 +145,22 @@ static EnPoFieldInfo sPoFieldInfo[2] = { static Vec3f D_80AD714C = { 0.0f, 1400.0f, 0.0f }; -static Vec3s sSpawnPositions[10]; -static u8 sSpawnSwitchFlags[10]; +Vec3s sEnPoFieldSpawnPositions[10]; +u8 sEnPoFieldSpawnSwitchFlags[10]; static MtxF sLimb7Mtx; void EnPoField_Init(Actor* thisx, GlobalContext* globalCtx) { EnPoField* this = (EnPoField*)thisx; s32 pad; - if (sNumSpawned != 10) { - sSpawnPositions[sNumSpawned].x = this->actor.world.pos.x; - sSpawnPositions[sNumSpawned].y = this->actor.world.pos.y; - sSpawnPositions[sNumSpawned].z = this->actor.world.pos.z; - sSpawnSwitchFlags[sNumSpawned] = this->actor.params & 0xFF; - sNumSpawned++; + if (sEnPoFieldNumSpawned != 10) { + sEnPoFieldSpawnPositions[sEnPoFieldNumSpawned].x = this->actor.world.pos.x; + sEnPoFieldSpawnPositions[sEnPoFieldNumSpawned].y = this->actor.world.pos.y; + sEnPoFieldSpawnPositions[sEnPoFieldNumSpawned].z = this->actor.world.pos.z; + sEnPoFieldSpawnSwitchFlags[sEnPoFieldNumSpawned] = this->actor.params & 0xFF; + sEnPoFieldNumSpawned++; } - if (sNumSpawned >= 2) { + if (sEnPoFieldNumSpawned >= 2) { this->actor.params = 0xFF; Actor_Kill(&this->actor); return; @@ -407,10 +407,10 @@ void EnPoField_WaitForSpawn(EnPoField* this, GlobalContext* globalCtx) { this->actionTimer--; } if (this->actionTimer == 0) { - for (i = 0; i < sNumSpawned; i++) { - if (fabsf(sSpawnPositions[i].x - player->actor.world.pos.x) < 150.0f && - fabsf(sSpawnPositions[i].z - player->actor.world.pos.z) < 150.0f) { - if (Flags_GetSwitch(globalCtx, sSpawnSwitchFlags[i])) { + for (i = 0; i < sEnPoFieldNumSpawned; i++) { + if (fabsf(sEnPoFieldSpawnPositions[i].x - player->actor.world.pos.x) < 150.0f && + fabsf(sEnPoFieldSpawnPositions[i].z - player->actor.world.pos.z) < 150.0f) { + if (Flags_GetSwitch(globalCtx, sEnPoFieldSpawnSwitchFlags[i])) { if (player->stateFlags1 & 0x800000) { // Player riding Epona return; } else { @@ -711,7 +711,7 @@ void EnPoField_SoulInteract(EnPoField* this, GlobalContext* globalCtx) { } else { this->actor.textId = 0x508F; Item_Give(globalCtx, ITEM_BIG_POE); - Flags_SetSwitch(globalCtx, sSpawnSwitchFlags[this->spawnFlagIndex]); + Flags_SetSwitch(globalCtx, sEnPoFieldSpawnSwitchFlags[this->spawnFlagIndex]); } } else { Audio_PlayActorSound2(&this->actor, NA_SE_EN_PO_LAUGH); @@ -1009,8 +1009,8 @@ void EnPoField_DrawSoul(Actor* thisx, GlobalContext* globalCtx) { } void EnPoField_Reset(void) { - sNumSpawned = 0; + sEnPoFieldNumSpawned = 0; - memset(sSpawnPositions, 0, sizeof(sSpawnPositions)); - memset(sSpawnSwitchFlags, 0, sizeof(sSpawnSwitchFlags)); + memset(sEnPoFieldSpawnPositions, 0, sizeof(sEnPoFieldSpawnPositions)); + memset(sEnPoFieldSpawnSwitchFlags, 0, sizeof(sEnPoFieldSpawnSwitchFlags)); } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c index 71cd47144..c1d169dfe 100644 --- a/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c +++ b/soh/src/overlays/actors/ovl_En_Takara_Man/z_en_takara_man.c @@ -35,7 +35,7 @@ const ActorInit En_Takara_Man_InitVars = { (ActorResetFunc)EnTakaraMan_Reset, }; -static u8 sTakaraIsInitialized = false; +u8 sTakaraIsInitialized = false; void EnTakaraMan_Reset(Actor* thisx, GlobalContext* globalCtx) { sTakaraIsInitialized = false; diff --git a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c index c64f9acb7..92497bf3e 100644 --- a/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c +++ b/soh/src/overlays/actors/ovl_En_Xc/z_en_xc.c @@ -447,7 +447,7 @@ void func_80B3D118(GlobalContext* globalCtx) { static Vec3f D_80B42DA0; -static s32 D_80B41D90 = 0; +s32 D_80B41D90 = 0; void EnXc_SetColossusWindSFX(GlobalContext* globalCtx) { if (gSaveContext.sceneSetupIndex == 4) { static Vec3f sPos = { 0.0f, 0.0f, 0.0f }; @@ -484,17 +484,17 @@ void EnXc_SetColossusWindSFX(GlobalContext* globalCtx) { } } -static s32 sFlameSpawned = false; +s32 sEnXcFlameSpawned = false; void EnXc_SpawnFlame(EnXc* this, GlobalContext* globalCtx) { - if (!sFlameSpawned) { + if (!sEnXcFlameSpawned) { CsCmdActorAction* npcAction = EnXc_GetCsCmd(globalCtx, 0); f32 xPos = npcAction->startPos.x; f32 yPos = npcAction->startPos.y; f32 zPos = npcAction->startPos.z; this->flameActor = Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_EN_LIGHT, xPos, yPos, zPos, 0, 0, 0, 5); - sFlameSpawned = true; + sEnXcFlameSpawned = true; } } @@ -519,7 +519,7 @@ void EnXc_DestroyFlame(EnXc* this) { Actor_Kill(&this->actor); } -static s32 D_80B41DA8 = 1; +s32 D_80B41DA8 = 1; void EnXc_InitFlame(EnXc* this, GlobalContext* globalCtx) { s32 pad; s16 sceneNum = globalCtx->sceneNum; @@ -1402,7 +1402,7 @@ void func_80B3F534(GlobalContext* globalCtx) { } } -static s32 D_80B41DAC = 1; +s32 D_80B41DAC = 1; void func_80B3F59C(EnXc* this, GlobalContext* globalCtx) { CsCmdActorAction* npcAction = EnXc_GetCsCmd(globalCtx, 0); @@ -2430,7 +2430,7 @@ const ActorInit En_Xc_InitVars = { void EnXc_Reset(void) { D_80B41D90 = 0; - sFlameSpawned = false; + sEnXcFlameSpawned = false; D_80B41DA8 = 1; D_80B41DAC = 1; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c index c5ed809db..a6b0f5809 100644 --- a/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c +++ b/soh/src/overlays/actors/ovl_En_Zf/z_en_zf.c @@ -97,8 +97,8 @@ static Vec3f sPlatformPositions[] = { }; // These seem to relate to the tagging in/out the minibosses do -static s16 D_80B4A1B0 = 0; -static s16 D_80B4A1B4 = 1; +s16 D_80B4A1B0 = 0; +s16 D_80B4A1B4 = 1; const ActorInit En_Zf_InitVars = { ACTOR_EN_ZF, diff --git a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c index 8ad3a2cef..6ea271bf4 100644 --- a/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c +++ b/soh/src/overlays/actors/ovl_En_Zl3/z_en_zl3.c @@ -45,7 +45,7 @@ static void* sEyeTextures[] = { gZelda2EyeOpenTex, gZelda2EyeHalfTex, gZelda2Eye static void* sMouthTextures[] = { gZelda2MouthSeriousTex, gZelda2MouthHappyTex, gZelda2MouthOpenTex }; -static s32 D_80B5A468 = 0; +s32 D_80B5A468 = 0; static Vec3f D_80B5A46C = { 0.0f, 0.0f, 0.0f }; @@ -55,7 +55,7 @@ static f32 D_80B5A484 = 0.0f; static Vec3f D_80B5A488 = { 0.0f, 0.0f, 0.0f }; -static s32 D_80B5A494 = -1; +s32 D_80B5A494 = -1; static Vec3f D_80B5A498 = { 148.0f, 260.0f, -87.0f }; @@ -63,7 +63,7 @@ static Vec3f D_80B5A4A4 = { -12.0f, 260.0f, -147.0f }; static Vec3f D_80B5A4B0 = { 42.0f, 260.0f, 13.0f }; -static u32 D_80B5A4BC = 0; +u32 D_80B5A4BC = 0; void func_80B533B0(Actor* thisx, GlobalContext* globalCtx) { EnZl3* this = (EnZl3*)thisx; diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c index b55777484..ac50f226a 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.c @@ -7,6 +7,8 @@ #include "z_en_zo.h" #include "objects/object_zo/object_zo.h" +#include "soh/frame_interpolation.h" + #define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3) typedef enum { @@ -41,6 +43,7 @@ void EnZo_Ripple(EnZo* this, Vec3f* pos, f32 scale, f32 targetScale, u8 alpha) { effect->scale = scale; effect->targetScale = targetScale; effect->color.a = alpha; + effect->epoch++; break; } effect++; @@ -65,6 +68,7 @@ void EnZo_Bubble(EnZo* this, Vec3f* pos) { effect->vec = *pos; effect->vel = vel; effect->scale = ((Rand_ZeroOne() - 0.5f) * 0.02f) + 0.12f; + effect->epoch++; break; } } @@ -87,6 +91,7 @@ void EnZo_Splash(EnZo* this, Vec3f* pos, Vec3f* vel, f32 scale) { effect->vel = *vel; effect->color.a = (Rand_ZeroOne() * 100.0f) + 100.0f; effect->scale = scale; + effect->epoch++; break; } effect++; @@ -180,6 +185,7 @@ void EnZo_DrawRipples(EnZo* this, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(this->effects); i++) { if (effect->type == ENZO_EFFECT_RIPPLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!setup) { if (1) {} gDPPipeSync(POLY_XLU_DISP++); @@ -194,6 +200,7 @@ void EnZo_DrawRipples(EnZo* this, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_zo_eff.c", 242), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gZoraRipplesModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -210,6 +217,7 @@ void EnZo_DrawBubbles(EnZo* this, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(this->effects); i++) { if (effect->type == ENZO_EFFECT_BUBBLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!setup) { if (1) {} gSPDisplayList(POLY_XLU_DISP++, gZoraBubblesMaterialDL); @@ -227,6 +235,7 @@ void EnZo_DrawBubbles(EnZo* this, GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_en_zo_eff.c", 281), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gZoraBubblesModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -244,6 +253,7 @@ void EnZo_DrawSplashes(EnZo* this, GlobalContext* globalCtx) { func_80093D84(globalCtx->state.gfxCtx); for (i = 0; i < ARRAY_COUNT(this->effects); i++) { if (effect->type == ENZO_EFFECT_SPLASH) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (!setup) { if (1) {} gSPDisplayList(POLY_XLU_DISP++, gZoraSplashesMaterialDL); @@ -260,6 +270,7 @@ void EnZo_DrawSplashes(EnZo* this, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gZoraSplashesModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } diff --git a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h index ba6eebb30..8911ce399 100644 --- a/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h +++ b/soh/src/overlays/actors/ovl_En_Zo/z_en_zo.h @@ -15,6 +15,7 @@ typedef struct { /* 0x14 */ Vec3f pos; /* 0x20 */ Vec3f vel; /* 0x2C */ Vec3f vec; // Usage specific + u32 epoch; } EnZoEffect; // size = 0x38 typedef void (*EnZoActionFunc)(struct EnZo*, GlobalContext*); diff --git a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c index ce1029165..82f37b801 100644 --- a/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c +++ b/soh/src/overlays/actors/ovl_En_fHG/z_en_fhg.c @@ -332,7 +332,7 @@ void EnfHG_Intro(EnfHG* this, GlobalContext* globalCtx) { Math_ApproachF(&this->cameraSpeedMod, 1.0f, 1.0f, 0.05f); if (this->timers[0] == 75) { TitleCard_InitBossName(globalCtx, &globalCtx->actorCtx.titleCtx, - SEGMENTED_TO_VIRTUAL(gPhantomGanonTitleCardTex), 160, 180, 128, 40); + SEGMENTED_TO_VIRTUAL(gPhantomGanonTitleCardTex), 160, 180, 128, 40, true); } if (this->timers[0] == 0) { this->cutsceneState = INTRO_RETREAT; diff --git a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c index f76ac084d..0c903bb80 100644 --- a/soh/src/overlays/actors/ovl_End_Title/z_end_title.c +++ b/soh/src/overlays/actors/ovl_End_Title/z_end_title.c @@ -84,6 +84,8 @@ void EndTitle_DrawFull(Actor* thisx, GlobalContext* globalCtx) { } OVERLAY_DISP = func_80093F34(OVERLAY_DISP); + if (D_801614B0.a > 0) + gsSPGrayscale(OVERLAY_DISP++, false); gDPSetTextureLUT(OVERLAY_DISP++, G_TT_NONE); gDPSetEnvColor(OVERLAY_DISP++, 255, 120, 30, 0); gDPSetRenderMode(OVERLAY_DISP++, G_RM_PASS, G_RM_XLU_SURF2); @@ -108,7 +110,8 @@ void EndTitle_DrawFull(Actor* thisx, GlobalContext* globalCtx) { G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 0, 0, 0, 0); gSPTextureRectangle(OVERLAY_DISP++, 104 << 2, 177 << 2, 216 << 2, 192 << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); - + if (D_801614B0.a > 0) + gsSPGrayscale(OVERLAY_DISP++, true); CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_end_title.c", 515); } diff --git a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c index a103c4826..0798145db 100644 --- a/soh/src/overlays/actors/ovl_Fishing/z_fishing.c +++ b/soh/src/overlays/actors/ovl_Fishing/z_fishing.c @@ -10,6 +10,8 @@ #include "objects/object_fish/object_fish.h" #include "vt.h" +#include "soh/frame_interpolation.h" + #define FLAGS ACTOR_FLAG_4 #define WATER_SURFACE_Y(globalCtx) globalCtx->colCtx.colHeader->waterBoxes->ySurface @@ -56,6 +58,7 @@ typedef struct { /* 0x34 */ f32 unk_34; /* 0x38 */ f32 unk_38; /* 0x3C */ f32 unk_3C; + u32 epoch; } FishingEffect; // size = 0x40 #define POND_PROP_COUNT 140 @@ -490,6 +493,8 @@ void Fishing_SpawnRipple(Vec3f* projectedPos, FishingEffect* effect, Vec3f* pos, effect->unk_2C = 1; effect->unk_38 = (effect->unk_34 - effect->unk_30) * 0.1f; } + + effect->epoch++; break; } @@ -514,6 +519,7 @@ void Fishing_SpawnDustSplash(Vec3f* projectedPos, FishingEffect* effect, Vec3f* effect->accel = accel; effect->alpha = 100 + (s16)Rand_ZeroFloat(100.0f); effect->unk_30 = scale; + effect->epoch++; break; } @@ -539,6 +545,7 @@ void Fishing_SpawnWaterDust(Vec3f* projectedPos, FishingEffect* effect, Vec3f* p effect->timer = (s16)Rand_ZeroFloat(100.0f); effect->unk_30 = scale; effect->unk_34 = 2.0f * scale; + effect->epoch++; break; } @@ -563,6 +570,7 @@ void Fishing_SpawnBubble(Vec3f* projectedPos, FishingEffect* effect, Vec3f* pos, effect->timer = (s16)Rand_ZeroFloat(100.0f); effect->unk_30 = scale; effect->unk_2C = arg4; + effect->epoch++; break; } @@ -591,6 +599,7 @@ void Fishing_SpawnRainDrop(FishingEffect* effect, Vec3f* pos, Vec3f* rot) { Matrix_RotateY(rot->y, MTXMODE_NEW); Matrix_RotateX(rot->x, MTXMODE_APPLY); Matrix_MultVec3f(&velSrc, &effect->vel); + effect->epoch++; break; } @@ -1182,6 +1191,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { for (i = 0; i < 100; i++) { if (effect->type == FS_EFF_RIPPLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { gSPDisplayList(POLY_XLU_DISP++, gFishingRippleMaterialDL); gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0); @@ -1197,6 +1207,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingRippleModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -1205,6 +1216,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 0; i < 100; i++) { if (effect->type == FS_EFF_DUST_SPLASH) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { gSPDisplayList(POLY_XLU_DISP++, gFishingDustSplashMaterialDL); gDPSetEnvColor(POLY_XLU_DISP++, 200, 200, 200, 0); @@ -1221,6 +1233,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingDustSplashModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -1229,6 +1242,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 0; i < 100; i++) { if (effect->type == FS_EFF_WATER_DUST) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { gSPDisplayList(POLY_OPA_DISP++, gFishingWaterDustMaterialDL); gDPSetEnvColor(POLY_OPA_DISP++, 40, 90, 80, 128); @@ -1249,6 +1263,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gFishingWaterDustModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -1257,6 +1272,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 0; i < 100; i++) { if (effect->type == FS_EFF_BUBBLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { gSPDisplayList(POLY_XLU_DISP++, gFishingBubbleMaterialDL); gDPSetEnvColor(POLY_XLU_DISP++, 150, 150, 150, 0); @@ -1272,6 +1288,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingBubbleModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -1280,6 +1297,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 30; i < EFFECT_COUNT; i++) { if (effect->type == FS_EFF_RAIN_DROP) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { POLY_XLU_DISP = Gfx_CallSetupDL(POLY_XLU_DISP, 0x14); gDPSetCombineMode(POLY_XLU_DISP++, G_CC_PRIMITIVE, G_CC_PRIMITIVE); @@ -1297,6 +1315,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingRainDropModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -1307,6 +1326,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 30; i < EFFECT_COUNT; i++) { if (effect->type == FS_EFF_RAIN_RIPPLE) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { gSPDisplayList(POLY_XLU_DISP++, gFishingRippleMaterialDL); gDPSetEnvColor(POLY_XLU_DISP++, 155, 155, 155, 0); @@ -1321,6 +1341,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingRippleModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } @@ -1329,6 +1350,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { flag = 0; for (i = 30; i < EFFECT_COUNT; i++) { if (effect->type == FS_EFF_RAIN_SPLASH) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); if (flag == 0) { gSPDisplayList(POLY_XLU_DISP++, gFishingRainSplashMaterialDL); gDPSetPrimColor(POLY_XLU_DISP++, 0, 0, 255, 255, 255, KREG(19) + 80); @@ -1350,12 +1372,14 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingRainSplashModelDL); + FrameInterpolation_RecordCloseChild(); } effect++; } effect = firstEffect; if (effect->type == FS_EFF_OWNER_HAT) { + FrameInterpolation_RecordOpenChild(effect, effect->epoch); Matrix_Translate(effect->pos.x, effect->pos.y, effect->pos.z, MTXMODE_NEW); Matrix_RotateY((sEffOwnerHatRot.y * M_PI) / 32768, MTXMODE_APPLY); Matrix_RotateX((sEffOwnerHatRot.x * M_PI) / 32768, MTXMODE_APPLY); @@ -1367,6 +1391,7 @@ void Fishing_DrawEffects(FishingEffect* effect, GlobalContext* globalCtx) { G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gFishingOwnerHatDL); + FrameInterpolation_RecordCloseChild(); } Matrix_Pop(); @@ -4398,6 +4423,7 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { } if (prop->shouldDraw) { + FrameInterpolation_RecordOpenChild(prop, 0); Matrix_Translate(prop->pos.x, prop->pos.y, prop->pos.z, MTXMODE_NEW); Matrix_Scale(prop->scale, prop->scale, prop->scale, MTXMODE_APPLY); Matrix_RotateY(prop->rotY, MTXMODE_APPLY); @@ -4407,6 +4433,7 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fishing.c", 7726), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingReedModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4423,12 +4450,14 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { } if (prop->shouldDraw) { + FrameInterpolation_RecordOpenChild(prop, 0); Matrix_Translate(prop->pos.x, prop->pos.y, prop->pos.z, MTXMODE_NEW); Matrix_Scale(prop->scale, prop->scale, prop->scale, MTXMODE_APPLY); gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fishing.c", 7748), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gFishingWoodPostModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4445,6 +4474,7 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { } if (prop->shouldDraw) { + FrameInterpolation_RecordOpenChild(prop, 0); Matrix_Translate(prop->pos.x, prop->pos.y, prop->pos.z, MTXMODE_NEW); Matrix_Scale(prop->scale, 1.0f, prop->scale, MTXMODE_APPLY); Matrix_RotateY(prop->lilyPadAngle * (M_PI / 32768), MTXMODE_APPLY); @@ -4454,6 +4484,7 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fishing.c", 7774), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_XLU_DISP++, gFishingLilyPadModelDL); + FrameInterpolation_RecordCloseChild(); } } @@ -4470,6 +4501,7 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { } if (prop->shouldDraw) { + FrameInterpolation_RecordOpenChild(prop, 0); Matrix_Translate(prop->pos.x, prop->pos.y, prop->pos.z, MTXMODE_NEW); Matrix_Scale(prop->scale, prop->scale, prop->scale, MTXMODE_APPLY); Matrix_RotateY(prop->rotY, MTXMODE_APPLY); @@ -4477,6 +4509,7 @@ void Fishing_DrawPondProps(GlobalContext* globalCtx) { gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_fishing.c", 7798), G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW); gSPDisplayList(POLY_OPA_DISP++, gFishingRockModelDL); + FrameInterpolation_RecordCloseChild(); } } diff --git a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c index 76e285881..70e4f4d7f 100644 --- a/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c +++ b/soh/src/overlays/actors/ovl_Obj_Oshihiki/z_obj_oshihiki.c @@ -558,7 +558,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { f32 pushDistSigned; s32 stopFlag; - this->pushSpeed += 0.5f; + this->pushSpeed += CVar_GetS32("gFasterBlockPush", 0) != 0 ? 1.0f : 0.5f; this->stateFlags |= PUSHBLOCK_PUSH; this->pushSpeed = CLAMP_MAX(this->pushSpeed, 2.0f); stopFlag = Math_StepToF(&this->pushDist, 20.0f, this->pushSpeed); @@ -586,7 +586,7 @@ void ObjOshihiki_Push(ObjOshihiki* this, GlobalContext* globalCtx) { this->dyna.unk_150 = 0.0f; this->pushDist = 0.0f; this->pushSpeed = 0.0f; - this->timer = 10; + this->timer = CVar_GetS32("gFasterBlockPush", 0) != 0 ? 3 : 10; if (this->floorBgIds[this->highestFloor] == BGCHECK_SCENE) { ObjOshihiki_SetupOnScene(this, globalCtx); } else { diff --git a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c index 237f1e926..d4282b91b 100644 --- a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c +++ b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.c @@ -9,6 +9,8 @@ #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_spot02_objects/object_spot02_objects.h" +#include "soh/frame_interpolation.h" + #define FLAGS (ACTOR_FLAG_4 | ACTOR_FLAG_5 | ACTOR_FLAG_25) void ObjectKankyo_Init(Actor* thisx, GlobalContext* globalCtx); @@ -57,8 +59,8 @@ const ActorInit Object_Kankyo_InitVars = { (ActorResetFunc)ObjectKankyo_Reset, }; -static u8 sIsSpawned = false; -static s16 sTrailingFairies = 0; +u8 sKankyoIsSpawned = false; +s16 sTrailingFairies = 0; void ObjectKankyo_SetupAction(ObjectKankyo* this, ObjectKankyoActionFunc action) { this->actionFunc = action; @@ -76,18 +78,18 @@ void ObjectKankyo_Init(Actor* thisx, GlobalContext* globalCtx) { this->actor.room = -1; switch (this->actor.params) { case 0: - if (!sIsSpawned) { + if (!sKankyoIsSpawned) { ObjectKankyo_SetupAction(this, ObjectKankyo_Fairies); - sIsSpawned = true; + sKankyoIsSpawned = true; } else { Actor_Kill(&this->actor); } break; case 3: - if (!sIsSpawned) { + if (!sKankyoIsSpawned) { ObjectKankyo_SetupAction(this, ObjectKankyo_Snow); - sIsSpawned = true; + sKankyoIsSpawned = true; } else { Actor_Kill(&this->actor); } @@ -260,6 +262,7 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, GlobalContext* globalCtx) { this->effects[i].dirPhase.z = Rand_ZeroOne() * 360.0f; this->effects[i].state++; this->effects[i].timer = 0; + this->effects[i].epoch++; break; case 1: // blinking fairies / inactive fairy trails @@ -417,26 +420,32 @@ void ObjectKankyo_Fairies(ObjectKankyo* this, GlobalContext* globalCtx) { if (this->effects[i].base.x + this->effects[i].pos.x - baseX > maxDist) { this->effects[i].base.x = baseX - maxDist; this->effects[i].pos.x = 0.0f; + this->effects[i].epoch++; } if (this->effects[i].base.x + this->effects[i].pos.x - baseX < -maxDist) { this->effects[i].base.x = baseX + maxDist; this->effects[i].pos.x = 0.0f; + this->effects[i].epoch++; } if (this->effects[i].base.y + this->effects[i].pos.y - baseY > 50.0f) { this->effects[i].base.y = baseY - 50.0f; this->effects[i].pos.y = 0.0f; + this->effects[i].epoch++; } if (this->effects[i].base.y + this->effects[i].pos.y - baseY < -50.0f) { this->effects[i].base.y = baseY + 50.0f; this->effects[i].pos.y = 0.0f; + this->effects[i].epoch++; } if (this->effects[i].base.z + this->effects[i].pos.z - baseZ > maxDist) { this->effects[i].base.z = baseZ - maxDist; this->effects[i].pos.z = 0.0f; + this->effects[i].epoch++; } if (this->effects[i].base.z + this->effects[i].pos.z - baseZ < -maxDist) { this->effects[i].base.z = baseZ + maxDist; this->effects[i].pos.z = 0.0f; + this->effects[i].epoch++; } } } @@ -496,6 +505,7 @@ void ObjectKankyo_DrawFairies(ObjectKankyo* this2, GlobalContext* globalCtx2) { gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteTextureLoadDL); for (i = 0; i < globalCtx->envCtx.unk_EE[3]; i++) { + FrameInterpolation_RecordOpenChild(&this->effects[i], this->effects[i].epoch); Matrix_Translate(this->effects[i].base.x + this->effects[i].pos.x, this->effects[i].base.y + this->effects[i].pos.y, this->effects[i].base.z + this->effects[i].pos.z, MTXMODE_NEW); @@ -561,6 +571,7 @@ void ObjectKankyo_DrawFairies(ObjectKankyo* this2, GlobalContext* globalCtx2) { Matrix_RotateZ(DEG_TO_RAD(globalCtx->state.frames * 20.0f), MTXMODE_APPLY); gSPMatrix(POLY_XLU_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 913), G_MTX_LOAD); gSPDisplayList(POLY_XLU_DISP++, gKokiriDustMoteDL); + FrameInterpolation_RecordCloseChild(); } CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_object_kankyo.c", 922); } @@ -939,6 +950,6 @@ void ObjectKankyo_DrawBeams(ObjectKankyo* this2, GlobalContext* globalCtx2) { } void ObjectKankyo_Reset(void) { - sIsSpawned = false; + sKankyoIsSpawned = false; sTrailingFairies = 0; } \ No newline at end of file diff --git a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h index 9b9a69975..fc45e156e 100644 --- a/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h +++ b/soh/src/overlays/actors/ovl_Object_Kankyo/z_object_kankyo.h @@ -24,6 +24,7 @@ typedef struct ObjectKankyoEffect { /* 0x4A */ u16 flightRadius; /* 0x4C */ f32 amplitude; /* 0x50 */ u16 timer; + u32 epoch; } ObjectKankyoEffect; // size = 0x54 typedef struct ObjectKankyo { diff --git a/soh/src/overlays/actors/ovl_player_actor/z_player.c b/soh/src/overlays/actors/ovl_player_actor/z_player.c index d02788a8e..49ad4e6e4 100644 --- a/soh/src/overlays/actors/ovl_player_actor/z_player.c +++ b/soh/src/overlays/actors/ovl_player_actor/z_player.c @@ -19,6 +19,7 @@ #include "overlays/effects/ovl_Effect_Ss_Fhg_Flash/z_eff_ss_fhg_flash.h" #include "objects/gameplay_keep/gameplay_keep.h" #include "objects/object_link_child/object_link_child.h" +#include "textures/icon_item_24_static/icon_item_24_static.h" typedef struct { /* 0x00 */ u8 itemId; @@ -1875,10 +1876,20 @@ void func_80833DF8(Player* this, GlobalContext* globalCtx) { s32 i; if (this->currentMask != PLAYER_MASK_NONE) { - maskActionParam = this->currentMask - 1 + PLAYER_AP_MASK_KEATON; - if (!func_80833C98(C_BTN_ITEM(0), maskActionParam) && !func_80833C98(C_BTN_ITEM(1), maskActionParam) && - !func_80833C98(C_BTN_ITEM(2), maskActionParam)) { - this->currentMask = PLAYER_MASK_NONE; + if (CVar_GetS32("gMMBunnyHood", 0) != 0) { + s32 maskItem = this->currentMask - PLAYER_MASK_KEATON + ITEM_MASK_KEATON; + + if (gSaveContext.equips.buttonItems[0] != maskItem && gSaveContext.equips.buttonItems[1] != maskItem && + gSaveContext.equips.buttonItems[2] != maskItem && gSaveContext.equips.buttonItems[3] != maskItem) { + this->currentMask = PLAYER_MASK_NONE; + func_808328EC(this, NA_SE_PL_CHANGE_ARMS); + } + } else { + maskActionParam = this->currentMask - 1 + PLAYER_AP_MASK_KEATON; + if (!func_80833C98(C_BTN_ITEM(0), maskActionParam) && !func_80833C98(C_BTN_ITEM(1), maskActionParam) && + !func_80833C98(C_BTN_ITEM(2), maskActionParam)) { + this->currentMask = PLAYER_MASK_NONE; + } } } @@ -2321,9 +2332,7 @@ s32 func_8083501C(Player* this, GlobalContext* globalCtx) { if ((!Player_HoldsHookshot(this) || func_80834FBC(this)) && !func_80834758(globalCtx, this) && !func_80834F2C(this, globalCtx)) { return 0; - } - else - { + } else if (this->rideActor != NULL) { this->unk_6AD = 2; // OTRTODO: THIS IS A BAD IDEA BUT IT FIXES THE HORSE FIRST PERSON? } @@ -3842,12 +3851,12 @@ s32 func_808382DC(Player* this, GlobalContext* globalCtx) { s32 sp48 = func_80838144(D_808535E4); if (((this->actor.wallPoly != NULL) && - SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) || + SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.wallPoly, this->actor.wallBgId)) || ((sp48 >= 0) && SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId) && (this->unk_A79 >= D_808544F4[sp48])) || ((sp48 >= 0) && - ((this->currentTunic != PLAYER_TUNIC_GORON) || (this->unk_A79 >= D_808544F4[sp48])))) { + ((this->currentTunic != PLAYER_TUNIC_GORON && CVar_GetS32("gSuperTunic", 0) == 0) || (this->unk_A79 >= D_808544F4[sp48])))) { this->unk_A79 = 0; this->actor.colChkInfo.damage = 4; func_80837C0C(globalCtx, this, 0, 4.0f, 5.0f, this->actor.shape.rot.y, 20); @@ -4632,7 +4641,7 @@ s32 func_8083A6AC(Player* this, GlobalContext* globalCtx) { if (BgCheck_EntityLineTest1(&globalCtx->colCtx, &this->actor.world.pos, &sp74, &sp68, &sp84, true, false, false, true, &sp80) && - (ABS(sp84->normal.y) < 600)) { + ((ABS(sp84->normal.y) < 600) || (CVar_GetS32("gClimbEverything", 0) != 0))) { f32 nx = COLPOLY_GET_NORMAL(sp84->normal.x); f32 ny = COLPOLY_GET_NORMAL(sp84->normal.y); f32 nz = COLPOLY_GET_NORMAL(sp84->normal.z); @@ -4795,7 +4804,7 @@ s32 func_8083ADD4(GlobalContext* globalCtx, Player* this) { void func_8083AE40(Player* this, s16 objectId) { s32 pad; - u32 size; + size_t size; if (objectId != OBJECT_INVALID) { this->giObjectLoading = true; @@ -4806,7 +4815,7 @@ void func_8083AE40(Player* this, s16 objectId) { LOG_HEX("size", size, "../z_player.c", 9090); ASSERT(size <= 1024 * 8, "size <= 1024 * 8", "../z_player.c", 9091); - DmaMgr_SendRequest2(&this->giObjectDmaRequest, (u32)this->giObjectSegment, gObjectTable[objectId].vromStart, + DmaMgr_SendRequest2(&this->giObjectDmaRequest, (uintptr_t)this->giObjectSegment, gObjectTable[objectId].vromStart, size, 0, &this->giObjectLoadQueue, NULL, "../z_player.c", 9099); } } @@ -5944,7 +5953,11 @@ void func_8083DFE0(Player* this, f32* arg1, s16* arg2) { s16 yawDiff = this->currentYaw - *arg2; if (this->swordState == 0) { - this->linearVelocity = CLAMP(this->linearVelocity, -(R_RUN_SPEED_LIMIT / 100.0f), (R_RUN_SPEED_LIMIT / 100.0f)); + float maxSpeed = R_RUN_SPEED_LIMIT / 100.0f; + if (CVar_GetS32("gMMBunnyHood", 0) != 0 && this->currentMask == PLAYER_MASK_BUNNY) { + maxSpeed *= 1.5f; + } + this->linearVelocity = CLAMP(this->linearVelocity, -maxSpeed, maxSpeed); } if (ABS(yawDiff) > 0x6000) { @@ -7525,6 +7538,9 @@ void func_80842180(Player* this, GlobalContext* globalCtx) { func_80837268(this, &sp2C, &sp2A, 0.018f, globalCtx); if (!func_8083C484(this, &sp2C, &sp2A)) { + if (CVar_GetS32("gMMBunnyHood", 0) != 0 && this->currentMask == PLAYER_MASK_BUNNY) { + sp2C *= 1.5f; + } func_8083DF68(this, sp2C, sp2A); func_8083DDC8(this, globalCtx); @@ -8152,7 +8168,7 @@ static struct_80832924 D_808545F0[] = { }; void func_80843CEC(Player* this, GlobalContext* globalCtx) { - if (this->currentTunic != PLAYER_TUNIC_GORON) { + if (this->currentTunic != PLAYER_TUNIC_GORON && CVar_GetS32("gSuperTunic", 0) == 0) { if ((globalCtx->roomCtx.curRoom.unk_02 == 3) || (D_808535E4 == 9) || ((func_80838144(D_808535E4) >= 0) && !SurfaceType_IsWallDamage(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId))) { @@ -9436,7 +9452,7 @@ void Player_Init(Actor* thisx, GlobalContext* globalCtx2) { if ((sp50 == 0) || (sp50 < -1)) { titleFileSize = scene->titleFile.vromEnd - scene->titleFile.vromStart; - if ((titleFileSize != 0) && gSaveContext.showTitleCard) { + if (gSaveContext.showTitleCard) { if ((gSaveContext.sceneSetupIndex < 4) && (gEntranceTable[((void)0, gSaveContext.entranceIndex) + ((void)0, gSaveContext.sceneSetupIndex)].field & 0x4000) && @@ -9888,7 +9904,7 @@ void func_80847BA0(GlobalContext* globalCtx, Player* this) { if ((this->actor.bgCheckFlags & 0x200) && (D_80853608 < 0x3000)) { CollisionPoly* wallPoly = this->actor.wallPoly; - if (ABS(wallPoly->normal.y) < 600) { + if ((ABS(wallPoly->normal.y) < 600) || (CVar_GetS32("gClimbEverything", 0) != 0)) { f32 sp8C = COLPOLY_GET_NORMAL(wallPoly->normal.x); f32 sp88 = COLPOLY_GET_NORMAL(wallPoly->normal.y); f32 sp84 = COLPOLY_GET_NORMAL(wallPoly->normal.z); @@ -10188,7 +10204,7 @@ void func_80848C74(GlobalContext* globalCtx, Player* this) { s32 sp58; s32 sp54; - if (this->currentTunic == PLAYER_TUNIC_GORON) { + if (this->currentTunic == PLAYER_TUNIC_GORON || CVar_GetS32("gSuperTunic", 0) != 0) { sp54 = 20; } else { @@ -10250,7 +10266,7 @@ void func_80848C74(GlobalContext* globalCtx, Player* this) { } } -void func_80848EF8(Player* this) { +void func_80848EF8(Player* this, GlobalContext* globalCtx) { if (CHECK_QUEST_ITEM(QUEST_STONE_OF_AGONY)) { f32 temp = 200000.0f - (this->unk_6A4 * 5.0f); @@ -10259,8 +10275,45 @@ void func_80848EF8(Player* this) { } this->unk_6A0 += temp; + + /*Prevent it on horse, while jumping and on title screen. + If you fly around no stone of agony for you! */ + if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) { + int rectLeft = OTRGetRectDimensionFromLeftEdge(26); //Left X Pos + int rectTop = 60; //Top Y Pos + int rectWidth = 24; //Texture Width + int rectHeight = 24; //Texture Heigh + int DefaultIconA= 50; //Default icon alphe (55 on 255) + + OPEN_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 2824); + gDPPipeSync(OVERLAY_DISP++); + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + gDPSetCombineLERP(OVERLAY_DISP++, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0, PRIMITIVE, ENVIRONMENT, TEXEL0, ENVIRONMENT, TEXEL0, 0, PRIMITIVE, 0); + if (this->unk_6A0 > 4000000.0f) { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, 255); + } else { + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + } + if (temp == 0 || temp <= 0.1f) { + /*Fail check, it is used to draw off the icon when + link is standing out range but do not refresh unk_6A0. + Also used to make a default value in my case.*/ + gDPSetPrimColor(OVERLAY_DISP++, 0, 0, 255, 255, 255, DefaultIconA); + } + gDPSetEnvColor(OVERLAY_DISP++, 0, 0, 0, 255); + gDPSetOtherMode(OVERLAY_DISP++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_POINT | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); + gDPLoadTextureBlock(OVERLAY_DISP++, gStoneOfAgonyIconTex, G_IM_FMT_RGBA, G_IM_SIZ_32b, 24, 24, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); + gDPSetOtherMode(OVERLAY_DISP++, G_AD_DISABLE | G_CD_DISABLE | G_CK_NONE | G_TC_FILT | G_TF_BILERP | G_TT_IA16 | G_TL_TILE | G_TD_CLAMP | G_TP_NONE | G_CYC_1CYCLE | G_PM_NPRIMITIVE, G_AC_NONE | G_ZS_PRIM | G_RM_XLU_SURF | G_RM_XLU_SURF2); + gSPWideTextureRectangle(OVERLAY_DISP++, rectLeft << 2, rectTop << 2, (rectLeft + rectWidth) << 2, (rectTop + rectHeight) << 2, G_TX_RENDERTILE, 0, 0, 1 << 10, 1 << 10); + CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_player.c", 3500); + } + if (this->unk_6A0 > 4000000.0f) { this->unk_6A0 = 0.0f; + if (CVar_GetS32("gVisualAgony", 0) !=0 && !this->stateFlags1) { + //This audio is placed here and not in previous CVar check to prevent ears ra.. :) + Audio_PlaySoundGeneral(NA_SE_SY_MESSAGE_WOMAN, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E0); + } func_8083264C(this, 120, 20, 10, 0); } } @@ -10532,7 +10585,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { else { this->fallStartHeight = this->actor.world.pos.y; } - func_80848EF8(this); + func_80848EF8(this, globalCtx); } } @@ -10698,7 +10751,7 @@ void Player_UpdateCommon(Player* this, GlobalContext* globalCtx, Input* input) { static Vec3f D_80854838 = { 0.0f, 0.0f, -30.0f }; void Player_Update(Actor* thisx, GlobalContext* globalCtx) { - static Vec3f sDogSpawnPos; + static Vec3f sDogSpawnPos; Player* this = (Player*)thisx; s32 dogParams; s32 pad; @@ -14806,4 +14859,4 @@ void func_80853148(GlobalContext* globalCtx, Actor* actor) { this->naviActor->flags |= ACTOR_FLAG_8; func_80835EA4(globalCtx, 0xB); } -} \ No newline at end of file +} diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c index ca5154567..570eedd1f 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_choose.c @@ -45,11 +45,8 @@ void FileChoose_SetView(FileChooseContext* this, f32 eyeX, f32 eyeY, f32 eyeZ) { func_800AAA50(&this->view, 0x7F); } -Gfx* FileChoose_QuadTextureIA8(Gfx* gfx, void* texture, s16 width, s16 height, s16 point) +Gfx* FileChoose_QuadTextureIA8(Gfx* gfx, void* texture, s16 width, s16 height, s16 point) { - if (ResourceMgr_OTRSigCheck(texture)) - texture = ResourceMgr_LoadTexByName(texture); - gDPLoadTextureBlock(gfx++, texture, G_IM_FMT_IA, G_IM_SIZ_8b, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMASK, G_TX_NOMASK, G_TX_NOLOD, G_TX_NOLOD); @@ -179,6 +176,7 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; SramContext* sramCtx = &this->sramCtx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (CHECK_BTN_ALL(input->press.button, BTN_START) || CHECK_BTN_ALL(input->press.button, BTN_A)) { if (this->buttonIndex <= FS_BTN_MAIN_FILE_3) { @@ -237,10 +235,10 @@ void FileChoose_UpdateMainMenu(GameState* thisx) { } } } else { - if (ABS(this->stickRelY) > 30) { + if ((ABS(this->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY > 30) { + if ((this->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; if (this->buttonIndex < FS_BTN_MAIN_FILE_1) { this->buttonIndex = FS_BTN_MAIN_OPTIONS; @@ -1318,6 +1316,7 @@ void FileChoose_FadeInFileInfo(GameState* thisx) { void FileChoose_ConfirmFile(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (CHECK_BTN_ALL(input->press.button, BTN_START) || (CHECK_BTN_ALL(input->press.button, BTN_A))) { if (this->confirmButtonIndex == FS_BTN_CONFIRM_YES) { @@ -1332,7 +1331,7 @@ void FileChoose_ConfirmFile(GameState* thisx) { } else if (CHECK_BTN_ALL(input->press.button, BTN_B)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CLOSE, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->selectMode++; - } else if (ABS(this->stickRelY) >= 30) { + } else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->confirmButtonIndex ^= 1; } @@ -1498,17 +1497,17 @@ void FileChoose_LoadGame(GameState* thisx) { gSaveContext.naviTimer = 0; // SWORDLESS LINK IS BACK BABY - if (CVar_GetS32("gSwordlessLink", 0) != 0) + if (CVar_GetS32("gSwordlessLink", 0) != 0) { if ((gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KOKIRI) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_MASTER) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_BGS) && (gSaveContext.equips.buttonItems[0] != ITEM_SWORD_KNIFE)) { - + gSaveContext.equips.buttonItems[0] = ITEM_NONE; - swordEquipMask = _byteswap_ushort(gEquipMasks[EQUIP_SWORD]) & gSaveContext.equips.equipment; + swordEquipMask = BOMSWAP16(gEquipMasks[EQUIP_SWORD]) & gSaveContext.equips.equipment; gSaveContext.equips.equipment &= gEquipNegMasks[EQUIP_SWORD]; - gSaveContext.inventory.equipment ^= (gBitFlags[swordEquipMask - 1] << _byteswap_ushort(gEquipShifts[EQUIP_SWORD])); + gSaveContext.inventory.equipment ^= (gBitFlags[swordEquipMask - 1] << BOMSWAP16(gEquipShifts[EQUIP_SWORD])); } } } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c index 5d13c408d..1f44abe95 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_copy_erase.c @@ -62,6 +62,7 @@ void FileChoose_SelectCopySource(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; SramContext* sramCtx = &this->sramCtx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (((this->buttonIndex == FS_BTN_COPY_QUIT) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -82,10 +83,10 @@ void FileChoose_SelectCopySource(GameState* thisx) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - if (ABS(this->stickRelY) >= 30) { + if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY >= 30) { + if ((this->stickRelY >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; if (this->buttonIndex < FS_BTN_COPY_FILE_1) { @@ -174,6 +175,7 @@ void FileChoose_SelectCopyDest(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; SramContext* sramCtx = &this->sramCtx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (((this->buttonIndex == FS_BTN_COPY_QUIT) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -194,10 +196,10 @@ void FileChoose_SelectCopyDest(GameState* thisx) { } } else { - if (ABS(this->stickRelY) >= 30) { + if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY >= 30) { + if ((this->stickRelY >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; if ((this->buttonIndex == this->selectedFileIndex)) { @@ -360,6 +362,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { SramContext* sramCtx = &this->sramCtx; Input* input = &this->state.input[0]; u16 dayTime; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (((this->buttonIndex != FS_BTN_CONFIRM_YES) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -377,7 +380,7 @@ void FileChoose_CopyConfirm(GameState* thisx) { this->configMode = CM_COPY_ANIM_1; func_800AA000(300.0f, 0xB4, 0x14, 0x64); Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } else if (ABS(this->stickRelY) >= 30) { + } else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->buttonIndex ^= 1; } @@ -680,6 +683,7 @@ void FileChoose_EraseSelect(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; SramContext* sramCtx = &this->sramCtx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (((this->buttonIndex == FS_BTN_COPY_QUIT) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -700,10 +704,10 @@ void FileChoose_EraseSelect(GameState* thisx) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_ERROR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - if (ABS(this->stickRelY) >= 30) { + if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - if (this->stickRelY >= 30) { + if ((this->stickRelY >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { this->buttonIndex--; if (this->buttonIndex < FS_BTN_ERASE_FILE_1) { this->buttonIndex = FS_BTN_ERASE_QUIT; @@ -817,6 +821,7 @@ void FileChoose_SetupEraseConfirm2(GameState* thisx) { void FileChoose_EraseConfirm(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (((this->buttonIndex != FS_BTN_CONFIRM_YES) && CHECK_BTN_ANY(input->press.button, BTN_A | BTN_START)) || CHECK_BTN_ALL(input->press.button, BTN_B)) { @@ -833,7 +838,7 @@ void FileChoose_EraseConfirm(GameState* thisx) { this->nextTitleLabel = FS_TITLE_ERASE_COMPLETE; func_800AA000(200.0f, 0xFF, 0x14, 0x96); sEraseDelayTimer = 15; - } else if (ABS(this->stickRelY) >= 30) { + } else if ((ABS(this->stickRelY) >= 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->buttonIndex ^= 1; } diff --git a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c index 73aa5e6d1..501986d2b 100644 --- a/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c +++ b/soh/src/overlays/gamestates/ovl_file_choose/z_file_nameset_PAL.c @@ -509,12 +509,14 @@ void FileChoose_StartNameEntry(GameState* thisx) { */ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; + Input* input = &this->state.input[0]; s16 prevKbdX; + bool dpad = CVar_GetS32("gDpadPauseName", 0); this->kbdButton = 99; if (this->kbdY != 5) { - if (this->stickRelX < -30) { + if ((this->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->charIndex--; this->kbdX--; @@ -522,7 +524,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->kbdX = 12; this->charIndex = (this->kbdY * 13) + this->kbdX; } - } else if (this->stickRelX > 30) { + } else if ((this->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->charIndex++; this->kbdX++; @@ -532,13 +534,13 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } } } else { - if (this->stickRelX < -30) { + if ((this->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdX--; if (this->kbdX < 3) { this->kbdX = 4; } - } else if (this->stickRelX > 30) { + } else if ((this->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdX++; if (this->kbdX > 4) { @@ -547,7 +549,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { } } - if (this->stickRelY > 30) { + if ((this->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdY--; @@ -578,7 +580,7 @@ void FileChoose_UpdateKeyboardCursor(GameState* thisx) { this->charIndex += this->kbdX; } } - } else if (this->stickRelY < -30) { + } else if ((this->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); this->kbdY++; @@ -655,6 +657,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { FileChooseContext* this = (FileChooseContext*)thisx; SramContext* sramCtx = &this->sramCtx; Input* input = &this->state.input[0]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (CHECK_BTN_ALL(input->press.button, BTN_B)) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_DECIDE_L, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -675,7 +678,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { return; } - if (this->stickRelX < -30) { + if ((this->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (sSelectedSetting == FS_SETTING_AUDIO) { @@ -688,7 +691,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { } else { gSaveContext.zTargetSetting ^= 1; } - } else if (this->stickRelX > 30) { + } else if ((this->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); if (sSelectedSetting == FS_SETTING_AUDIO) { @@ -702,7 +705,7 @@ void FileChoose_UpdateOptionsMenu(GameState* thisx) { } } - if ((this->stickRelY < -30) || (this->stickRelY > 30)) { + if ((ABS(this->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { Audio_PlaySoundGeneral(NA_SE_SY_FSEL_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); sSelectedSetting ^= 1; } else if (CHECK_BTN_ALL(input->press.button, BTN_A)) { diff --git a/soh/src/overlays/gamestates/ovl_select/z_select.c b/soh/src/overlays/gamestates/ovl_select/z_select.c index 98aaa4a63..c4a467d63 100644 --- a/soh/src/overlays/gamestates/ovl_select/z_select.c +++ b/soh/src/overlays/gamestates/ovl_select/z_select.c @@ -624,10 +624,10 @@ void Select_Init(GameState* thisx) { this->pageDownIndex = dREG(82); } R_UPDATE_RATE = 1; - #ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__GNUC__) this->staticSegment = GameState_Alloc(&this->state, size, "../z_select.c", 1114); DmaMgr_SendRequest1(this->staticSegment, _z_select_staticSegmentRomStart, size, "../z_select.c", 1115); - #endif +#endif gSaveContext.cutsceneIndex = 0x8000; gSaveContext.linkAge = 1; } diff --git a/soh/src/overlays/gamestates/ovl_title/z_title.c b/soh/src/overlays/gamestates/ovl_title/z_title.c index e45cdf27b..18996f15e 100644 --- a/soh/src/overlays/gamestates/ovl_title/z_title.c +++ b/soh/src/overlays/gamestates/ovl_title/z_title.c @@ -10,6 +10,9 @@ #include "alloca.h" #include "textures/nintendo_rogo_static/nintendo_rogo_static.h" #include +#include "GameVersions.h" + +const char* GetGameVersionString(); char* quote; @@ -18,6 +21,8 @@ void Title_PrintBuildInfo(Gfx** gfxp) { //GfxPrint* printer; GfxPrint printer; + const char* gameVersionStr = GetGameVersionString(); + g = *gfxp; g = func_8009411C(g); //printer = alloca(sizeof(GfxPrint)); @@ -29,9 +34,12 @@ void Title_PrintBuildInfo(Gfx** gfxp) { #ifdef _MSC_VER GfxPrint_Printf(&printer, "MSVC SHIP"); #else - GfxPrint_Printf(printer, "GCC SHIP"); + GfxPrint_Printf(&printer, "GCC SHIP"); #endif + GfxPrint_SetPos(&printer, 5, 4); + GfxPrint_Printf(&printer, "Game Version: %s", gameVersionStr); + GfxPrint_SetColor(&printer, 255, 255, 255, 255); GfxPrint_SetPos(&printer, 2, 22); GfxPrint_Printf(&printer, quote); @@ -66,6 +74,36 @@ char* SetQuote() { return quotes[randomQuote]; } +const char* GetGameVersionString() { + uint32_t gameVersion = ResourceMgr_GetGameVersion(); + switch (gameVersion) { + case OOT_NTSC_10: + return "N64 NTSC 1.0"; + case OOT_NTSC_11: + return "N64 NTSC 1.1"; + case OOT_NTSC_12: + return "N64 NTSC 1.2"; + case OOT_PAL_10: + return "N64 PAL 1.0"; + case OOT_PAL_11: + return "N64 PAL 1.1"; + case OOT_PAL_GC: + return "GC PAL"; + case OOT_PAL_MQ: + return "GC PAL MQ"; + case OOT_PAL_GC_DBG1: + return "GC PAL DEBUG"; + case OOT_PAL_GC_DBG2: + return "GC PAL DEBUG MQ"; + case OOT_IQUE_CN: + return "IQUE CN"; + case OOT_IQUE_TW: + return "IQUE TW"; + default: + return "UNKNOWN"; + } +} + // Note: In other rom versions this function also updates unk_1D4, coverAlpha, addAlpha, visibleDuration to calculate // the fade-in/fade-out + the duration of the n64 logo animation void Title_Calc(TitleContext* this) { @@ -161,7 +199,7 @@ void Title_Draw(TitleContext* this) { gDPSetPrimColor(POLY_OPA_DISP++, 0, 0, 170, 255, 255, 255); gDPSetEnvColor(POLY_OPA_DISP++, 0, 0, 255, 128); - gDPLoadMultiBlock(POLY_OPA_DISP++, ResourceMgr_LoadTexByName(nintendo_rogo_static_Tex_001800), 0x100, 1, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, + gDPLoadMultiBlock(POLY_OPA_DISP++, nintendo_rogo_static_Tex_001800, 0x100, 1, G_IM_FMT_I, G_IM_SIZ_8b, 32, 32, 0, G_TX_NOMIRROR | G_TX_WRAP, G_TX_NOMIRROR | G_TX_WRAP, 5, 5, 2, 11); for (idx = 0, y = 94; idx < 16; idx++, y += 2) @@ -233,6 +271,8 @@ void Title_Init(GameState* thisx) { //ResourceMgr_CacheDirectory("nintendo_rogo_static*"); + // Disable vismono + D_801614B0.a = 0; R_UPDATE_RATE = 1; Matrix_Init(&this->state); View_Init(&this->view, this->state.gfxCtx); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c index 46be1154f..80ffe8d4a 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_collect.c @@ -74,6 +74,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx s16 pad2; s16 phi_s0_2; s16 sp208[3]; + bool dpad = CVar_GetS32("gDpadPauseName", 0); OPEN_DISPS(gfxCtx, "../z_kaleido_collect.c", 248); @@ -83,96 +84,92 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx if (pauseCtx->cursorSpecialPos == 0) { pauseCtx->nameColorSet = 0; + sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; + phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST]; - if ((pauseCtx->state != 6) || ((pauseCtx->stickRelX == 0) && (pauseCtx->stickRelY == 0))) { - sp216 = pauseCtx->cursorSlot[PAUSE_QUEST]; - } else { - phi_s3 = pauseCtx->cursorPoint[PAUSE_QUEST]; - - if (pauseCtx->stickRelX < -30) { - phi_s0 = D_8082A1AC[phi_s3][2]; - if (phi_s0 == -3) { - KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_LEFT); - pauseCtx->unk_1E4 = 0; - } else { - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][2]; - } - } - } else if (pauseCtx->stickRelX > 30) { - phi_s0 = D_8082A1AC[phi_s3][3]; - if (phi_s0 == -2) { - KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_RIGHT); - pauseCtx->unk_1E4 = 0; - } else { - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][3]; - } - } - } - - if (pauseCtx->stickRelY < -30) { - phi_s0 = D_8082A1AC[phi_s3][1]; - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][1]; - } - } else if (pauseCtx->stickRelY > 30) { - phi_s0 = D_8082A1AC[phi_s3][0]; - while (phi_s0 >= 0) { - if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { - break; - } - phi_s0 = D_8082A1AC[phi_s0][0]; - } - } - - if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { + phi_s0 = D_8082A1AC[phi_s3][2]; + if (phi_s0 == -3) { + KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_LEFT); pauseCtx->unk_1E4 = 0; - Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); - } - - if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) { - if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { - if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { - phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66; - osSyncPrintf("000 ccc=%d\n", phi_s0_2); - } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) { - phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x54; - osSyncPrintf("111 ccc=%d\n", phi_s0_2); - } else { - phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A; - osSyncPrintf("222 ccc=%d (%d, %d, %d)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], - 0x12, 0x6C); + } else { + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; } + phi_s0 = D_8082A1AC[phi_s0][2]; + } + } + } else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { + phi_s0 = D_8082A1AC[phi_s3][3]; + if (phi_s0 == -2) { + KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_RIGHT); + pauseCtx->unk_1E4 = 0; + } else { + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; + } + phi_s0 = D_8082A1AC[phi_s0][3]; + } + } + } + + if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { + phi_s0 = D_8082A1AC[phi_s3][1]; + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; + } + phi_s0 = D_8082A1AC[phi_s0][1]; + } + } else if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { + phi_s0 = D_8082A1AC[phi_s3][0]; + while (phi_s0 >= 0) { + if ((s16)KaleidoScope_UpdateQuestStatusPoint(pauseCtx, phi_s0) != 0) { + break; + } + phi_s0 = D_8082A1AC[phi_s0][0]; + } + } + + if (phi_s3 != pauseCtx->cursorPoint[PAUSE_QUEST]) { + pauseCtx->unk_1E4 = 0; + Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); + } + + if (pauseCtx->cursorPoint[PAUSE_QUEST] != 0x18) { + if (CHECK_QUEST_ITEM(pauseCtx->cursorPoint[PAUSE_QUEST])) { + if (pauseCtx->cursorPoint[PAUSE_QUEST] < 6) { + phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x66; + osSyncPrintf("000 ccc=%d\n", phi_s0_2); + } else if (pauseCtx->cursorPoint[PAUSE_QUEST] < 0x12) { + phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x54; + osSyncPrintf("111 ccc=%d\n", phi_s0_2); } else { - phi_s0_2 = PAUSE_ITEM_NONE; - osSyncPrintf("999 ccc=%d (%d, %d)\n", PAUSE_ITEM_NONE, pauseCtx->cursorPoint[PAUSE_QUEST], - 0x18); + phi_s0_2 = pauseCtx->cursorPoint[PAUSE_QUEST] + 0x5A; + osSyncPrintf("222 ccc=%d (%d, %d, %d)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], + 0x12, 0x6C); } } else { - if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) { - phi_s0_2 = 0x72; - } else { - phi_s0_2 = PAUSE_ITEM_NONE; - } - osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], 0x72, - gSaveContext.inventory.questItems & 0xF0000000); + phi_s0_2 = PAUSE_ITEM_NONE; + osSyncPrintf("999 ccc=%d (%d, %d)\n", PAUSE_ITEM_NONE, pauseCtx->cursorPoint[PAUSE_QUEST], + 0x18); } - - sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; - pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2; - pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + } else { + if ((gSaveContext.inventory.questItems & 0xF0000000) != 0) { + phi_s0_2 = 0x72; + } else { + phi_s0_2 = PAUSE_ITEM_NONE; + } + osSyncPrintf("888 ccc=%d (%d, %d, %x)\n", phi_s0_2, pauseCtx->cursorPoint[PAUSE_QUEST], 0x72, + gSaveContext.inventory.questItems & 0xF0000000); } + sp216 = pauseCtx->cursorPoint[PAUSE_QUEST]; + pauseCtx->cursorItem[pauseCtx->pageIndex] = phi_s0_2; + pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; + KaleidoScope_SetCursorVtx(pauseCtx, sp216 * 4, pauseCtx->questVtx); if ((pauseCtx->state == 6) && (pauseCtx->unk_1E4 == 0) && (pauseCtx->cursorSpecialPos == 0)) { @@ -215,7 +212,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->cursorPoint[PAUSE_QUEST] = 0x15; pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -232,7 +229,7 @@ void KaleidoScope_DrawQuestStatus(GlobalContext* globalCtx, GraphicsContext* gfx pauseCtx->cursorSlot[pauseCtx->pageIndex] = sp216; } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->cursorPoint[PAUSE_QUEST] = 0; pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c index 3c236637b..27575c3b6 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_equipment.c @@ -64,7 +64,7 @@ void KaleidoScope_DrawEquipmentImage(GlobalContext* globalCtx, void* source, u32 gDPLoadSync(POLY_KAL_DISP++); gDPLoadTile(POLY_KAL_DISP++, G_TX_LOADTILE, 0, 0, (width - 1) << 2, (textureHeight - 1) << 2); - + gDPSetTextureImageFB(POLY_KAL_DISP++, G_IM_FMT_RGBA, G_IM_SIZ_16b, width, fbTest); gSP1Quadrangle(POLY_KAL_DISP++, 0, 2, 3, 1, 0); @@ -119,7 +119,7 @@ void KaleidoScope_DrawPlayerWork(GlobalContext* globalCtx) { func_8009214C(globalCtx, pauseCtx->playerSegment, &pauseCtx->playerSkelAnime, &pos, &rot, scale, CUR_EQUIP_VALUE(EQUIP_SWORD), CUR_EQUIP_VALUE(EQUIP_TUNIC) - 1, CUR_EQUIP_VALUE(EQUIP_SHIELD), CUR_EQUIP_VALUE(EQUIP_BOOTS) - 1); - gsSPResetFB(globalCtx->state.gfxCtx->polyOpa.p++, fbTest); + gsSPResetFB(globalCtx->state.gfxCtx->polyOpa.p++); } void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { @@ -140,6 +140,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { s16 cursorX; s16 cursorY; volatile s16 oldCursorPoint; + bool dpad = CVar_GetS32("gDpadPauseName", 0); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_equipment.c", 219); @@ -174,7 +175,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 0; while (cursorMoveResult == 0) { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { if (pauseCtx->cursorX[PAUSE_EQUIP] != 0) { pauseCtx->cursorX[PAUSE_EQUIP] -= 1; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 1; @@ -216,7 +217,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 3; } } - } else if (pauseCtx->stickRelX > 30) { + } else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { if (pauseCtx->cursorX[PAUSE_EQUIP] < 3) { pauseCtx->cursorX[PAUSE_EQUIP] += 1; pauseCtx->cursorPoint[PAUSE_EQUIP] += 1; @@ -264,7 +265,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { cursorMoveResult = 0; while (cursorMoveResult == 0) { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { if (pauseCtx->cursorY[PAUSE_EQUIP] != 0) { pauseCtx->cursorY[PAUSE_EQUIP] -= 1; pauseCtx->cursorPoint[PAUSE_EQUIP] -= 4; @@ -286,7 +287,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { pauseCtx->cursorPoint[PAUSE_EQUIP] = cursorPoint; cursorMoveResult = 3; } - } else if (pauseCtx->stickRelY < -30) { + } else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { if (pauseCtx->cursorY[PAUSE_EQUIP] < 3) { pauseCtx->cursorY[PAUSE_EQUIP] += 1; pauseCtx->cursorPoint[PAUSE_EQUIP] += 4; @@ -309,7 +310,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -356,7 +357,7 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); @@ -574,7 +575,14 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { } else if ((i == 0) && (k == 2) && (gBitFlags[bit + 1] & gSaveContext.inventory.equipment)) { KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gBrokenGiantsKnifeIconTex, 32, 32, point); } else if (gBitFlags[bit] & gSaveContext.inventory.equipment) { - KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[ITEM_SWORD_KOKIRI + temp], 32, 32, point); + int itemId = ITEM_SWORD_KOKIRI + temp; + bool not_acquired = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge); + if (not_acquired) { + gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); + gsSPGrayscale(POLY_KAL_DISP++, true); + } + KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, point); + gsSPGrayscale(POLY_KAL_DISP++, false); } } } @@ -594,7 +602,6 @@ void KaleidoScope_DrawEquipment(GlobalContext* globalCtx) { gSPInvalidateTexCache(POLY_KAL_DISP++, pauseCtx->iconItemSegment); //gSPInvalidateTexCache(POLY_KAL_DISP++, pauseCtx->iconItem24Segment); gSPInvalidateTexCache(POLY_KAL_DISP++, pauseCtx->nameSegment); - gSPInvalidateTexCache(POLY_KAL_DISP++, globalCtx->interfaceCtx.mapSegment); //gSPSegment(POLY_KAL_DISP++, 0x07, pauseCtx->playerSegment); gSPSegment(POLY_KAL_DISP++, 0x08, pauseCtx->iconItemSegment); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c index bb42ff711..52c04908f 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_item.c @@ -96,6 +96,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { s16 cursorY; s16 oldCursorPoint; s16 moveCursorResult; + bool dpad = CVar_GetS32("gDpadPauseName", 0); OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_item.c", 234); @@ -120,7 +121,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { pauseCtx->stickRelX = 40; } - if (ABS(pauseCtx->stickRelX) > 30) { + if ((ABS(pauseCtx->stickRelX) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DLEFT | BTN_DRIGHT))) { cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorX = pauseCtx->cursorX[PAUSE_ITEM]; cursorY = pauseCtx->cursorY[PAUSE_ITEM]; @@ -132,7 +133,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (gSaveContext.inventory.items[pauseCtx->cursorPoint[PAUSE_ITEM]]) {} while (moveCursorResult == 0) { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { if (pauseCtx->cursorX[PAUSE_ITEM] != 0) { pauseCtx->cursorX[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 1; @@ -164,7 +165,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { moveCursorResult = 2; } } - } else if (pauseCtx->stickRelX > 30) { + } else if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { if (pauseCtx->cursorX[PAUSE_ITEM] < 5) { pauseCtx->cursorX[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 1; @@ -208,7 +209,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { cursorItem, pauseCtx->cursorSpecialPos); } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -242,7 +243,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { } } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; @@ -280,13 +281,13 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { if (pauseCtx->cursorSpecialPos == 0) { if (cursorItem != PAUSE_ITEM_NONE) { - if (ABS(pauseCtx->stickRelY) > 30) { + if ((ABS(pauseCtx->stickRelY) > 30) || (dpad && CHECK_BTN_ANY(input->press.button, BTN_DDOWN | BTN_DUP))) { moveCursorResult = 0; cursorPoint = pauseCtx->cursorPoint[PAUSE_ITEM]; cursorY = pauseCtx->cursorY[PAUSE_ITEM]; while (moveCursorResult == 0) { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { if (pauseCtx->cursorY[PAUSE_ITEM] != 0) { pauseCtx->cursorY[PAUSE_ITEM] -= 1; pauseCtx->cursorPoint[PAUSE_ITEM] -= 6; @@ -300,7 +301,7 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { moveCursorResult = 2; } - } else if (pauseCtx->stickRelY < -30) { + } else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { if (pauseCtx->cursorY[PAUSE_ITEM] < 3) { pauseCtx->cursorY[PAUSE_ITEM] += 1; pauseCtx->cursorPoint[PAUSE_ITEM] += 6; @@ -466,8 +467,15 @@ void KaleidoScope_DrawItemSelect(GlobalContext* globalCtx) { } gSPVertex(POLY_KAL_DISP++, &pauseCtx->itemVtx[j + 0], 4, 0); - KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[gSaveContext.inventory.items[i]], 32, + int itemId = gSaveContext.inventory.items[i]; + bool not_acquired = (gItemAgeReqs[itemId] != 9) && (gItemAgeReqs[itemId] != gSaveContext.linkAge); + if (not_acquired) { + gsDPSetGrayscaleColor(POLY_KAL_DISP++, 109, 109, 109, 255); + gsSPGrayscale(POLY_KAL_DISP++, true); + } + KaleidoScope_DrawQuadTextureRGBA32(globalCtx->state.gfxCtx, gItemIcons[itemId], 32, 32, 0); + gsSPGrayscale(POLY_KAL_DISP++, false); } } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c index af5c2b424..f0b59fa4b 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_map_PAL.c @@ -17,6 +17,14 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC gPauseDekuTitleENGTex, gPauseDodongoTitleENGTex, gPauseJabuTitleENGTex, gPauseForestTitleENGTex, gPauseFireTitleENGTex, gPauseWaterTitleENGTex, gPauseSpiritTitleENGTex, gPauseShadowTitleENGTex, gPauseBotWTitleENGTex, gPauseIceCavernTitleENGTex, + + gPauseDekuTitleGERTex, gPauseDodongoTitleGERTex, gPauseJabuTitleGERTex, gPauseForestTitleGERTex, + gPauseFireTitleGERTex, gPauseWaterTitleGERTex, gPauseSpiritTitleGERTex, gPauseShadowTitleGERTex, + gPauseBotWTitleGERTex, gPauseIceCavernTitleGERTex, + + gPauseDekuTitleFRATex, gPauseDodongoTitleFRATex, gPauseJabuTitleFRATex, gPauseForestTitleFRATex, + gPauseFireTitleFRATex, gPauseWaterTitleFRATex, gPauseSpiritTitleFRATex, gPauseShadowTitleFRATex, + gPauseBotWTitleFRATex, gPauseIceCavernTitleFRATex, }; static void* floorIconTexs[] = { gDungeonMapBlankFloorButtonTex, gDungeonMap8FButtonTex, gDungeonMap7FButtonTex, gDungeonMap6FButtonTex, @@ -36,6 +44,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC static u16 mapBgPulseStage = 0; InterfaceContext* interfaceCtx = &globalCtx->interfaceCtx; PauseContext* pauseCtx = &globalCtx->pauseCtx; + Input* input = &globalCtx->state.input[0]; s16 i; s16 j; s16 oldCursorPoint; @@ -43,6 +52,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC s16 stepG; s16 stepB; u16 rgba16; + bool dpad = CVar_GetS32("gDpadPauseName", 0); OPEN_DISPS(gfxCtx, "../z_kaleido_map_PAL.c", 123); @@ -51,7 +61,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC oldCursorPoint = pauseCtx->cursorPoint[PAUSE_MAP]; if (pauseCtx->cursorSpecialPos == 0) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { if (pauseCtx->cursorX[PAUSE_MAP] != 0) { KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_RIGHT); } else { @@ -67,7 +77,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } - } else if (pauseCtx->stickRelX < -30) { + } else if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { if (pauseCtx->cursorX[PAUSE_MAP] == 0) { KaleidoScope_MoveCursorToSpecialPos(globalCtx, PAUSE_CURSOR_PAGE_LEFT); } else { @@ -82,7 +92,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } if (pauseCtx->cursorPoint[PAUSE_MAP] < 3) { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { if (pauseCtx->cursorPoint[PAUSE_MAP] != 0) { for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 1; i >= 0; i--) { if (CHECK_DUNGEON_ITEM(i, gSaveContext.mapIndex)) { @@ -92,7 +102,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } else { - if (pauseCtx->stickRelY < -30) { + if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { if (pauseCtx->cursorPoint[PAUSE_MAP] != 2) { for (i = pauseCtx->cursorPoint[PAUSE_MAP] + 1; i < 3; i++) { if (CHECK_DUNGEON_ITEM(i, gSaveContext.mapIndex)) { @@ -104,7 +114,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } else { - if (pauseCtx->stickRelY > 30) { + if ((pauseCtx->stickRelY > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DUP))) { if (pauseCtx->cursorPoint[PAUSE_MAP] >= 4) { for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 - 1; i >= 0; i--) { if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) || @@ -115,7 +125,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } - } else if (pauseCtx->stickRelY < -30) { + } else if ((pauseCtx->stickRelY < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DDOWN))) { if (pauseCtx->cursorPoint[PAUSE_MAP] != 10) { for (i = pauseCtx->cursorPoint[PAUSE_MAP] - 3 + 1; i < 11; i++) { if ((gSaveContext.sceneFlags[gSaveContext.mapIndex].floors & gBitFlags[i]) || @@ -138,7 +148,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC } } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorSlot[PAUSE_MAP] = pauseCtx->cursorPoint[PAUSE_MAP] = pauseCtx->dungeonMapSlot; @@ -148,7 +158,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->nameDisplayTimer = 0; pauseCtx->cursorSpecialPos = 0; pauseCtx->cursorX[PAUSE_MAP] = 1; @@ -214,7 +224,7 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC gSPVertex(POLY_KAL_DISP++, &pauseCtx->mapPageVtx[68], 16, 0); - gDPLoadTextureBlock(POLY_KAL_DISP++, dungeonTitleTexs[gSaveContext.mapIndex], G_IM_FMT_IA, G_IM_SIZ_8b, 96, 16, 0, + gDPLoadTextureBlock(POLY_KAL_DISP++, dungeonTitleTexs[gSaveContext.mapIndex+(10*gSaveContext.language)], G_IM_FMT_IA, G_IM_SIZ_8b, 96, 16, 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); @@ -330,6 +340,10 @@ void KaleidoScope_DrawDungeonMap(GlobalContext* globalCtx, GraphicsContext* gfxC gSPVertex(POLY_KAL_DISP++, &pauseCtx->mapPageVtx[60], 8, 0); + // The dungeon map textures are recreated each frame, so always invalidate them + gSPInvalidateTexCache(POLY_KAL_DISP++, interfaceCtx->mapSegment); + gSPInvalidateTexCache(POLY_KAL_DISP++, interfaceCtx->mapSegment + 0x800); + gDPLoadTextureBlock_4b(POLY_KAL_DISP++, interfaceCtx->mapSegment, G_IM_FMT_CI, 48, 85, 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); @@ -396,6 +410,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx }; static u16 D_8082A6D4 = 0; PauseContext* pauseCtx = &globalCtx->pauseCtx; + Input* input = &globalCtx->state.input[0]; s16 i; s16 j; s16 t; @@ -404,6 +419,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx s16 stepR; s16 stepG; s16 stepB; + bool dpad = CVar_GetS32("gDpadPauseName", 0); OPEN_DISPS(gfxCtx, "../z_kaleido_map_PAL.c", 556); @@ -412,7 +428,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx oldCursorPoint = pauseCtx->cursorPoint[PAUSE_WORLD_MAP]; if (pauseCtx->cursorSpecialPos == 0) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { D_8082A6D4 = 0; do { @@ -423,7 +439,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx break; } } while (pauseCtx->worldMapPoints[pauseCtx->cursorPoint[PAUSE_WORLD_MAP]] == 0); - } else if (pauseCtx->stickRelX < -30) { + } else if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { D_8082A6D4 = 0; do { @@ -444,7 +460,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx } else { pauseCtx->cursorItem[PAUSE_MAP] = gSaveContext.worldMapArea + 0x18; if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 0; pauseCtx->cursorSpecialPos = 0; @@ -459,7 +475,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx D_8082A6D4 = 0; } } else { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->cursorPoint[PAUSE_WORLD_MAP] = 11; pauseCtx->cursorSpecialPos = 0; @@ -663,7 +679,7 @@ void KaleidoScope_DrawWorldMap(GlobalContext* globalCtx, GraphicsContext* gfxCtx gDPLoadTextureBlock(POLY_KAL_DISP++, gWorldMapDotTex, G_IM_FMT_IA, G_IM_SIZ_8b, 8, 8, 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); - for (j = i = 0; i < 12; i++, t++, j += 4) { + for (j = t = i = 0; i < 12; i++, t++, j += 4) { if (pauseCtx->worldMapPoints[i] != 0) { gDPPipeSync(POLY_KAL_DISP++); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c index c16404fb2..bfb4897d8 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_prompt.c @@ -7,12 +7,13 @@ void KaleidoScope_UpdatePrompt(GlobalContext* globalCtx) { Input* input = &globalCtx->state.input[0]; s8 relStickX = input->rel.stick_x; s16 step; + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (((pauseCtx->state == 7) && (pauseCtx->unk_1EC == 1)) || (pauseCtx->state == 0xE) || (pauseCtx->state == 0x10)) { - if ((pauseCtx->promptChoice == 0) && (relStickX >= 30)) { + if ((pauseCtx->promptChoice == 0) && ((relStickX >= 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT)))) { Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); pauseCtx->promptChoice = 4; - } else if ((pauseCtx->promptChoice != 0) && (relStickX <= -30)) { + } else if ((pauseCtx->promptChoice != 0) && ((relStickX <= -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT)))) { Audio_PlaySoundGeneral(NA_SE_SY_CURSOR, &D_801333D4, 4, &D_801333E0, &D_801333E0, &D_801333E8); pauseCtx->promptChoice = 0; } diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c index a5c160700..4dbb1b20f 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_kaleido_scope_PAL.c @@ -14,6 +14,8 @@ #include "vt.h" #include "SohHooks.h" +#include "soh/frame_interpolation.h" + static void* sEquipmentFRATexs[] = { gPauseEquipment00FRATex, gPauseEquipment01Tex, gPauseEquipment02Tex, gPauseEquipment03Tex, gPauseEquipment04Tex, gPauseEquipment10FRATex, gPauseEquipment11Tex, gPauseEquipment12Tex, gPauseEquipment13Tex, gPauseEquipment14Tex, @@ -789,40 +791,10 @@ static PreRender sPlayerPreRender; static void* sPreRenderCvg; extern int fbTest; -// OTRTODO: This function is no longer used. We could probably remove it. -void KaleidoScope_SetupPlayerPreRender(GlobalContext* globalCtx) { - Gfx* gfx; - Gfx* gfxRef; - void* fbuf; - static Gfx testBuffer[2048]; - - //return; - - fbuf = globalCtx->state.gfxCtx->curFrameBuffer; - - OPEN_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_scope_PAL.c", 496); - - gfx = &testBuffer[0]; - - PreRender_SetValues(&sPlayerPreRender, 64, 112, fbuf, NULL); - func_800C1F20(&sPlayerPreRender, &gfx); - func_800C20B4(&sPlayerPreRender, &gfx); - - gSPEndDisplayList(gfx++); - gSPDisplayList(POLY_KAL_DISP++, &testBuffer[0]); - - SREG(33) |= 1; - - CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_kaleido_scope_PAL.c", 509); -} -//OTRTODO - Player on pause -#if 1 void KaleidoScope_ProcessPlayerPreRender(void) { - //Sleep_Msec(50); PreRender_Calc(&sPlayerPreRender); PreRender_Destroy(&sPlayerPreRender); } -#endif Gfx* KaleidoScope_QuadTextureIA4(Gfx* gfx, void* texture, s16 width, s16 height, u16 point) { gDPLoadTextureBlock_4b(gfx++, texture, G_IM_FMT_IA, width, height, 0, G_TX_NOMIRROR | G_TX_WRAP, @@ -966,8 +938,9 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { return; } + bool dpad = CVar_GetS32("gDpadPauseName", 0); if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) { - if (pauseCtx->stickRelX < -30) { + if ((pauseCtx->stickRelX < -30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DLEFT))) { pauseCtx->pageSwitchTimer++; if ((pauseCtx->pageSwitchTimer >= 10) || (pauseCtx->pageSwitchTimer == 0)) { KaleidoScope_SwitchPage(pauseCtx, 0); @@ -976,7 +949,7 @@ void KaleidoScope_HandlePageToggles(PauseContext* pauseCtx, Input* input) { pauseCtx->pageSwitchTimer = -1; } } else if (pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) { - if (pauseCtx->stickRelX > 30) { + if ((pauseCtx->stickRelX > 30) || (dpad && CHECK_BTN_ALL(input->press.button, BTN_DRIGHT))) { pauseCtx->pageSwitchTimer++; if ((pauseCtx->pageSwitchTimer >= 10) || (pauseCtx->pageSwitchTimer == 0)) { KaleidoScope_SwitchPage(pauseCtx, 2); @@ -1076,6 +1049,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) { s16 stepG; s16 stepB; + FrameInterpolation_RecordOpenChild(NULL, pauseCtx->state + pauseCtx->pageIndex * 100); OPEN_DISPS(gfxCtx, "../z_kaleido_scope_PAL.c", 1100); if ((pauseCtx->state < 8) || (pauseCtx->state > 0x11)) { @@ -1447,6 +1421,7 @@ void KaleidoScope_DrawPages(GlobalContext* globalCtx, GraphicsContext* gfxCtx) { } CLOSE_DISPS(gfxCtx, "../z_kaleido_scope_PAL.c", 1577); + FrameInterpolation_RecordCloseChild(); } void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { @@ -1643,14 +1618,24 @@ void KaleidoScope_DrawInfoPanel(GlobalContext* globalCtx) { if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_LEFT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); + } else { + if (CVar_GetS32("gUniformLR", 0) != 0) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); + } } gSPDisplayList(POLY_KAL_DISP++, gLButtonIconDL); - gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 220); + if (CVar_GetS32("gUniformLR", 0) == 0) { //Restore the misplace gDPSetPrimColor + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); + } if ((pauseCtx->cursorSpecialPos == PAUSE_CURSOR_PAGE_RIGHT) && (pauseCtx->unk_1E4 == 0)) { gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, D_808321A0, D_808321A2, D_808321A4, D_808321A6); + } else { + if (CVar_GetS32("gUniformLR", 0) != 0) { + gDPSetPrimColor(POLY_KAL_DISP++, 0, 0, 180, 210, 255, 255); + } } gSPDisplayList(POLY_KAL_DISP++, gRButtonIconDL); @@ -3110,14 +3095,6 @@ void KaleidoScope_Update(GlobalContext* globalCtx) gSegments[8] = VIRTUAL_TO_PHYSICAL(pauseCtx->iconItemSegment); - for (i = 0; i < ARRAY_COUNTU(gItemAgeReqs); i++) { - if ((gItemAgeReqs[i] != 9) && (gItemAgeReqs[i] != ((void)0, gSaveContext.linkAge))) - { - gSPInvalidateTexCache(globalCtx->state.gfxCtx->polyKal.p++, ResourceMgr_LoadTexByName(gItemIcons[i])); - KaleidoScope_GrayOutTextureRGBA32(SEGMENTED_TO_VIRTUAL(gItemIcons[i]), 0x400); - } - } - pauseCtx->iconItem24Segment = (void*)(((uintptr_t)pauseCtx->iconItemSegment + size0 + 0xF) & ~0xF); #if 1 @@ -3206,15 +3183,9 @@ void KaleidoScope_Update(GlobalContext* globalCtx) if (gSaveContext.language == LANGUAGE_ENG) { memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(mapNameTextures[36 + gSaveContext.worldMapArea]), 0xA00); } else if (gSaveContext.language == LANGUAGE_GER) { - DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400, - (uintptr_t)_map_name_staticSegmentRomStart + - (((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x16C00, - 0xA00, "../z_kaleido_scope_PAL.c", 3780); + memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(mapNameTextures[58 + gSaveContext.worldMapArea]), 0xA00); } else { - DmaMgr_SendRequest1(pauseCtx->nameSegment + 0x400, - (uintptr_t)_map_name_staticSegmentRomStart + - (((void)0, gSaveContext.worldMapArea) * 0xA00) + 0x24800, - 0xA00, "../z_kaleido_scope_PAL.c", 3784); + memcpy(pauseCtx->nameSegment + 0x400, ResourceMgr_LoadTexByName(mapNameTextures[80 + gSaveContext.worldMapArea]), 0xA00); } } // OTRTODO - player on pause @@ -4023,10 +3994,7 @@ void KaleidoScope_Update(GlobalContext* globalCtx) R_UPDATE_RATE = 3; R_PAUSE_MENU_MODE = 0; - ResourceMgr_DirtyDirectory("textures/icon_item_24_static*"); - ResourceMgr_DirtyDirectory("textures/icon_item_static*"); CVar_SetS32("gPauseTriforce", 0); - //ResourceMgr_InvalidateCache(); func_800981B8(&globalCtx->objectCtx); func_800418D0(&globalCtx->colCtx, globalCtx); diff --git a/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.c b/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.c index df96fc876..64275108b 100644 --- a/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.c +++ b/soh/src/overlays/misc/ovl_kaleido_scope/z_lmap_mark_data.c @@ -15,6 +15,522 @@ static const Vtx sMarkChestVtx[] = { }; PauseMapMarksData gPauseMapMarkDataTable[] = { + // Deku Tree map 3F + { + { PAUSE_MAP_MARK_CHEST, + 23, //unk + sMarkChestVtx, + 4, //unk + 2, //Number of icons to show. + { //ID, X, Y + { 2, 40.0f, -33.0f }, + { 6, 49.0f, -42.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Deku Tree map 2F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 1, 48.0f, -63.0f }, + { 5, 52.0f, -68.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Deku Tree map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 3, 84.0f, -39.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Deku Tree map B1 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 4, 77.0f, -26.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Deku Tree map B2 + { + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 55.0f, 0.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Dodongo's Cavern map 2F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 3, + { + { 10, 25.0f, -41.0f }, + { 4, 53.0f, -47.0f }, + { 6, 58.0f, -59.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Dodongo's Cavern map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 5, 13.0f, -60.0f }, + { 8, 20.0f, -49.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 23.0f, -25.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Jabu-Jabu's Belly map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 3, + { + { 1, 67.0f, -13.0f }, + { 2, 28.0f, -13.0f }, + { 4, 38.0f, 0.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 65.0f, -37.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Jabu-Jabu's Belly map B1 + { + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Forest Temple map 2F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 4, + { + { 0, 49.0f, -3.0f }, + { 2, 12.0f, -26.0f }, + { 5, 74.0f, -13.0f }, + { 7, 82.0f, -22.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Forest Temple map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 4, + { + { 0, 49.0f, -3.0f }, + { 2, 12.0f, -26.0f }, + { 5, 74.0f, -13.0f }, + { 7, 82.0f, -22.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Forest Temple map B1 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 9, 31.0f, -29.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Forest Temple map B2 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 11, 40.0f, -41.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 50.0f, -11.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Fire Temple map 5F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 5, 22.0f, -41.0f }, + { 13, 74.0f, -29.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Fire Temple map 4F + { + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Fire Temple map 3F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 3, + { + { 3, 76.0f, -48.0f }, + { 6, 72.0f, -50.0f }, + { 7, 44.0f, -17.0f }, + { 8, 63.0f, -12.0f }, + { 9, 30.0f, -34.0f }, + { 10, 61.0f, -31.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Fire Temple map 2F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 11, 78.0f, -34.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Fire Temple map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 5, + { + { 0, 48.0f, -17.0f }, + { 1, 35.0f, -45.0f }, + { 2, 67.0f, -58.0f }, + { 4, 74.0f, -15.0f }, + { 12, 47.0f, -27.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 26.0f, -34.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Water Temple map 3F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 3, + { + { 2, 88.0f, -60.0f }, + { 7, 23.0f, -2.0f }, + { 9, 84.0f, -45.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 62.0f, -23.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Water Temple map 2F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 0, 86.0f, -60.0f }, + { 8, 76.0f, -72.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Water Temple map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 4, + { + { 1, 88.0f, -60.0f }, + { 3, 42.0f, -21.0f }, + { 5, 47.0f, -15.0f }, + { 10, 33.0f, -31.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Water Temple map B1 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 6, 77.0f, -66.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Spirit Temple map 4F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 10, 59.0f, -9.0f }, + { 18, 32.0f, -20.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Spirit Temple map 3F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 5, + { + { 1, 20.0f, -43.0f }, + { 5, 83.0f, -26.0f }, + { 15, 57.0f, -14.0f }, + { 20, 81.0f, -55.0f }, + { 21, 87.0f, -55.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 47.0f, 0.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Spirit Temple map 2F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 6, + { + { 2, 41.0f, -16.0f }, + { 3, 47.0f, -17.0f }, + { 6, 27.0f, -16.0f }, + { 12, 29.0f, -20.0f }, + { 13, 70.0f, -22.0f }, + { 14, 70.0f, -25.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Spirit Temple map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 4, + { + { 0, 38.0f, -17.0f }, + { 4, 55.0f, -14.0f }, + { 8, 15.0f, -14.0f }, + { 7, 78.0f, -3.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Shadow Temple map B1 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 1, 41.0f, -17.0f }, + { 7, 27.0f, -24.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Shadow Temple map B2 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 2, 81.0f, -20.0f }, + { 3, 74.0f, -37.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Shadow Temple map B3 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 2, + { + { 12, 96.0f, -51.0f }, + { 22, 96.0f, -55.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Shadow Temple map B4 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 10, + { + { 4, 43.0f, -66.0f }, + { 5, 37.0f, -66.0f }, + { 6, 33.0f, -72.0f }, + { 8, 85.0f, -18.0f }, + { 9, 61.0f, -42.0f }, + { 10, 15.0f, -4.0f }, + { 11, 25.0f, -4.0f }, + { 13, 19.0f, -29.0f }, + { 21, 92.0f, -29.0f }, + { 20, 87.0f, -20.0f }, + } }, + { PAUSE_MAP_MARK_BOSS, + 23, + sMarkBossVtx, + 4, + 1, + { + { -1, 31.0f, -45.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Bottom of the Well map B1 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 9, + { + { 1, 51.0f, -24.0f }, + { 3, 84.0f, -38.0f }, + { 4, 31.0f, -2.0f }, + { 5, 67.0f, -27.0f }, + { 8, 46.0f, -27.0f }, + { 10, 82.0f, -12.0f }, + { 12, 80.0f, -16.0f }, + { 14, 62.0f, -24.0f }, + { 20, 89.0f, -38.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Bottom of the Well map B2 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 3, + { + { 2, 54.0f, -27.0f }, + { 9, 28.0f, -17.0f }, + { 16, 56.0f, -38.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Bottom of the Well map B3 + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 1, + { + { 7, 71.0f, -33.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, + // Ice Cavern map 1F + { + { PAUSE_MAP_MARK_CHEST, + 23, + sMarkChestVtx, + 4, + 3, + { + { 0, 66.0f, -2.0f }, + { 1, 77.0f, -46.0f }, + { 2, 27.0f, -45.0f }, + } }, + { PAUSE_MAP_MARK_NONE, 0, NULL, 0, 0, { 0 } }, + }, +}; +PauseMapMarksData gPauseMapMarkDataTableMasterQuest[] = { // Deku Tree map 0 { { PAUSE_MAP_MARK_CHEST,