├── .gitattributes ├── .gitignore ├── .gitmodules ├── READ ME.txt.rtf ├── README.txt ├── appveyor.yml ├── dnsapi.dll └── source-code ├── LICENSE ├── PD-Loader.sln ├── README.md ├── data ├── Download .NET Framework Runtime.url ├── Download QuickSFV.url ├── Download Visual C++ Runtime.url ├── README - PD Loader.url ├── patches │ └── custom_freeplay_text_example.p ├── plugins │ ├── DivaSound_template.bin │ ├── Novidia Shaders │ │ └── e6d9187b.vcdiff │ ├── ShaderPatch.ini │ ├── ShaderPatchConfig_template.bin │ ├── bassasio.dll │ ├── components_template.bin │ ├── config_template.bin │ ├── keyconfig_template.bin │ └── playerdata_template.bin ├── ram │ └── databank_template_v2 │ │ ├── PvList0_SBZV_7.10_64103_1636921101.dat │ │ ├── PvList1_SBZV_7.10_26572_1636921101.dat │ │ ├── PvList2_SBZV_7.10_38035_1636921101.dat │ │ ├── PvList3_SBZV_7.10_48722_1636921101.dat │ │ └── PvList4_SBZV_7.10_5341_1636921101.dat ├── verify_base_game.sfv └── verify_mount_data.sfv ├── dependencies ├── GPUModel │ └── GPUModel.h ├── PluginConfigApi │ └── PluginConfigApi.h ├── WineVer │ └── WineVer.h ├── detours │ ├── include │ │ ├── detours.h │ │ ├── detver.h │ │ └── syelog.h │ └── lib │ │ ├── detours.lib │ │ └── syelog.lib ├── freeglut │ ├── include │ │ └── GL │ │ │ ├── freeglut.h │ │ │ ├── freeglut_ext.h │ │ │ ├── freeglut_std.h │ │ │ ├── freeglut_ucall.h │ │ │ └── glut.h │ └── lib │ │ ├── freeglut.exp │ │ ├── freeglut.lib │ │ ├── freeglutd.exp │ │ └── freeglutd.lib ├── simpleini │ ├── .gitignore │ ├── .travis.yml │ ├── ConvertUTF.c │ ├── ConvertUTF.h │ ├── LICENCE.txt │ ├── Makefile │ ├── README.md │ ├── SimpleIni.h │ ├── other │ │ ├── package.cmd │ │ └── simpleini.doxy │ ├── tests │ │ ├── .gitignore │ │ ├── Makefile │ │ ├── example.ini │ │ ├── old │ │ │ ├── test.cmd │ │ │ ├── test1-expected.ini │ │ │ ├── test1-input.ini │ │ │ ├── test1.cpp │ │ │ ├── testsi-EUCJP.ini │ │ │ ├── testsi-SJIS.ini │ │ │ ├── testsi-UTF8.ini │ │ │ └── testsi.cpp │ │ ├── packages.config │ │ ├── pch.cpp │ │ ├── pch.h │ │ ├── tests.ini │ │ ├── tests.vcxproj │ │ ├── ts-bugfix.cpp │ │ ├── ts-roundtrip.cpp │ │ ├── ts-snippets.cpp │ │ ├── ts-utf8.cpp │ │ └── ts-wchar.cpp │ └── vcproj │ │ ├── SimpleIni.sln │ │ ├── SimpleIni.vcxproj │ │ └── SimpleIni.vcxproj.filters └── xdelta3 │ ├── LICENSE │ ├── Makefile.am │ ├── README.md │ ├── badcopy.c │ ├── configure.ac │ ├── cpp-btree │ ├── CMakeLists.txt │ ├── COPYING │ ├── README │ ├── btree.h │ ├── btree_bench.cc │ ├── btree_container.h │ ├── btree_map.h │ ├── btree_set.h │ ├── btree_test.cc │ ├── btree_test.h │ ├── btree_test_flags.cc │ ├── safe_btree.h │ ├── safe_btree_map.h │ ├── safe_btree_set.h │ └── safe_btree_test.cc │ ├── draft-korn-vcdiff.txt │ ├── examples │ ├── Makefile │ ├── README.md │ ├── compare_test.c │ ├── encode_decode_test.c │ ├── iOS │ │ └── xdelta3-ios-test │ │ │ ├── xdelta3-ios-test.xcodeproj │ │ │ └── project.pbxproj │ │ │ └── xdelta3-ios-test │ │ │ ├── Xd3iOSAppDelegate.h │ │ │ ├── Xd3iOSAppDelegate.m │ │ │ ├── Xd3iOSViewController.h │ │ │ ├── Xd3iOSViewController.m │ │ │ ├── en.lproj │ │ │ ├── InfoPlist.strings │ │ │ ├── MainStoryboard_iPad.storyboard │ │ │ └── MainStoryboard_iPhone.storyboard │ │ │ ├── file_v1.bin │ │ │ ├── file_v1_to_v2.bin │ │ │ ├── file_v2.bin │ │ │ ├── main.m │ │ │ └── xdelta3-ios-test-Info.plist │ ├── small_page_test.c │ ├── speed_test.c │ └── test.h │ ├── generate_build_files.sh │ ├── go │ └── src │ │ ├── regtest.go │ │ └── xdelta │ │ ├── rstream.go │ │ ├── run.go │ │ ├── test.go │ │ └── tgroup.go │ ├── linkxd3lib.c │ ├── m4 │ ├── ax_check_aligned_access_required.m4 │ ├── ax_pkg_swig.m4 │ ├── ax_python_devel.m4 │ └── ax_swig_python.m4 │ ├── plot.sh │ ├── rcs_junk.cc │ ├── run_release.sh │ ├── testing │ ├── Makefile │ ├── checksum_test.cc │ ├── checksum_test_c.c │ ├── cmp.h │ ├── delta.h │ ├── file.h │ ├── modify.h │ ├── random.h │ ├── regtest.cc │ ├── regtest_c.c │ ├── run_release.sh │ ├── segment.h │ ├── sizes.h │ ├── test.h │ ├── xdelta3-regtest.py │ └── xdelta3-test.py │ ├── xdelta3-blkcache.h │ ├── xdelta3-cfgs.h │ ├── xdelta3-decode.h │ ├── xdelta3-djw.h │ ├── xdelta3-fgk.h │ ├── xdelta3-hash.h │ ├── xdelta3-internal.h │ ├── xdelta3-list.h │ ├── xdelta3-lzma.h │ ├── xdelta3-main.h │ ├── xdelta3-merge.h │ ├── xdelta3-second.h │ ├── xdelta3-test.h │ ├── xdelta3.1 │ ├── xdelta3.c │ ├── xdelta3.h │ ├── xdelta3.i │ ├── xdelta3.vcxproj │ ├── xdelta3.wxi │ └── xdelta3.wxs └── source ├── PD-Loader ├── ModuleList.h ├── PD-Loader.vcxproj ├── PD-Loader.vcxproj.filters ├── dllmain.cpp ├── exception.hpp ├── framework.h └── x64.def ├── fakedll ├── ModuleList.h ├── dllmain.cpp ├── exception.hpp ├── fakedll.vcxproj ├── fakedll.vcxproj.filters ├── framework.h └── x64.def └── plugins ├── DSCRemote ├── DSCRemote.vcxproj ├── DSCRemote.vcxproj.filters ├── PluginConfigApi.h ├── dllmain.cpp └── framework.h ├── DivaMovie ├── DivaMovie.vcxproj ├── DivaMovie.vcxproj.filters ├── PluginConfigApi.h ├── dllmain.cpp └── framework.h ├── DivaSound ├── DivaSound.vcxproj ├── DivaSound.vcxproj.filters ├── bassasio │ ├── bassasio.h │ └── bassasio.lib ├── miniaudio │ └── miniaudio.h └── src │ ├── dllmain.cpp │ └── framework.h ├── DivaWig ├── DivaWig.vcxproj ├── DivaWig.vcxproj.filters ├── PluginConfigApi.h ├── dllmain.cpp └── framework.h ├── Launcher ├── ConfigOption.h ├── FeelsThinkMan.gif ├── Help.png ├── IniReader.h ├── Launcher.filters ├── Launcher.vcxproj ├── PluginConfig.h ├── PokeSnarf4xd.png ├── PokeWhat4xvc2.png ├── SkinnedMessageBox.h ├── SkinnedMessageBox.resx ├── TabPadding.cpp ├── TabPadding.h ├── composition.h ├── dllmain.cpp ├── framework.h ├── notabug.png ├── pdloader2bge.png ├── pdloader2ico.ico ├── ui.h └── ui.resx ├── Novidia ├── Novidia.vcxproj ├── Novidia.vcxproj.filters └── src │ ├── crc │ ├── crc.h │ ├── crc_32.c │ └── sniptype.h │ ├── dllmain.cpp │ ├── framework.h │ └── glStuff.h ├── Patches ├── PatchApplier.h ├── PatchApplier600.h ├── PatchApplier710.h ├── Patches.vcxproj ├── Patches.vcxproj.filters ├── databank.cpp ├── databank.h ├── dllmain.cpp ├── framework.h ├── storage.h └── urlutil.h ├── Render ├── Render.vcxproj ├── Render.vcxproj.filters ├── dllmain.cpp └── framework.h ├── ShaderPatch ├── ShaderPatch.vcxproj ├── ShaderPatch.vcxproj.filters └── src │ ├── dllmain.cpp │ └── framework.h └── TLAC ├── Components ├── CameraController.cpp ├── CameraController.h ├── ComponentsManager.cpp ├── ComponentsManager.h ├── CustomPlayerData.h ├── DebugComponent.cpp ├── DebugComponent.h ├── EmulatorComponent.cpp ├── EmulatorComponent.h ├── FastLoader.cpp ├── FastLoader.h ├── FrameRateManager.cpp ├── FrameRateManager.h ├── GameState.h ├── GameTargets │ ├── HoldState.h │ ├── TargetHitStates.h │ ├── TargetInspector.cpp │ ├── TargetInspector.h │ ├── TargetState.h │ └── TargetTypes.h ├── Input │ ├── InputBufferType.h │ ├── InputEmulator.cpp │ ├── InputEmulator.h │ ├── InputState.cpp │ ├── InputState.h │ ├── JvsButtons.h │ ├── TouchPanelEmulator.cpp │ ├── TouchPanelEmulator.h │ ├── TouchPanelState.h │ ├── TouchSliderEmulator.cpp │ ├── TouchSliderEmulator.h │ ├── TouchSliderState.cpp │ └── TouchSliderState.h ├── Pause.cpp ├── Pause.h ├── PlayerData.h ├── PlayerDataManager.cpp ├── PlayerDataManager.h ├── ScaleComponent.cpp ├── ScaleComponent.h ├── ScoreSaver.cpp └── ScoreSaver.h ├── Constants.h ├── FileSystem ├── ConfigFile.cpp ├── ConfigFile.h ├── TextFile.cpp └── TextFile.h ├── Input ├── Bindings │ ├── Binding.cpp │ ├── Binding.h │ ├── DVLBinding.cpp │ ├── DVLBinding.h │ ├── Ds4Binding.cpp │ ├── Ds4Binding.h │ ├── GuBinding.cpp │ ├── GuBinding.h │ ├── IInputBinding.h │ ├── KeyboardBinding.cpp │ ├── KeyboardBinding.h │ ├── MouseBinding.cpp │ ├── MouseBinding.h │ ├── XinputBinding.cpp │ └── XinputBinding.h ├── DirectInput │ ├── Controller.cpp │ ├── Controller.h │ ├── DirectInput.cpp │ ├── DirectInput.h │ ├── DirectInputDevice.cpp │ ├── DirectInputDevice.h │ ├── DirectInputMouse.cpp │ ├── DirectInputMouse.h │ ├── Ds4 │ │ ├── Ds4Button.h │ │ ├── Ds4State.cpp │ │ ├── Ds4State.h │ │ ├── DualShock4.cpp │ │ └── DualShock4.h │ └── GenericUsb │ │ ├── GenericUsbInput.cpp │ │ ├── GenericUsbInput.h │ │ ├── GuButton.h │ │ ├── GuState.cpp │ │ └── GuState.h ├── Divaller │ ├── Divaller.cpp │ ├── Divaller.h │ ├── DivallerButton.h │ └── DivallerState.h ├── IInputDevice.h ├── KeyConfig │ ├── Config.cpp │ ├── Config.h │ ├── KeyString.cpp │ ├── KeyString.h │ ├── KeyStringHash.cpp │ └── KeyStringHash.h ├── Keyboard │ ├── Keyboard.cpp │ ├── Keyboard.h │ ├── KeyboardState.cpp │ └── KeyboardState.h ├── Mouse │ ├── Mouse.cpp │ ├── Mouse.h │ └── MouseState.h └── Xinput │ ├── Xinput.cpp │ ├── Xinput.h │ ├── XinputState.cpp │ └── XinputState.h ├── TLAC.vcxproj ├── TLAC.vcxproj.filters ├── Utilities ├── Drawing.cpp ├── Drawing.h ├── EnumBitwiseOperations.h ├── Math.cpp ├── Math.h ├── Operations.cpp ├── Operations.h ├── Stopwatch.cpp ├── Stopwatch.h ├── Vec2.cpp ├── Vec2.h ├── Vec3.cpp └── Vec3.h ├── Utils.cpp ├── Utils.h ├── dllmain.cpp ├── framework.cpp ├── framework.h └── pluginconfig.h /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * binary 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "source-code/dependencies/MemoryModule"] 2 | path = source-code/dependencies/MemoryModule 3 | url = https://github.com/fancycode/MemoryModule 4 | -------------------------------------------------------------------------------- /README.txt: -------------------------------------------------------------------------------- 1 | This is the source code! It can NOT be used to play PDAFT! 2 | If you just wanted to play the game, you downloaded the wrong thing. 3 | Do not click the download button next to the git URL, that's for the source code. 4 | 5 | For information on getting and installing the latest release, 6 | please read the wiki at https://github.com/nastys/PD-Loader/wiki 7 | If you've already read it, pay more attention and you'll find the right link. 8 | 9 | You should also read the wiki if you have any issues, before asking questions. -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | version: '{build}' 2 | image: Visual Studio 2019 3 | configuration: 4 | - Release 5 | platform: x64 6 | build: 7 | project: source-code/PD-Loader.sln 8 | verbosity: minimal 9 | after_build: 10 | - cmd: >- 11 | md %TMP%\full\ 12 | 13 | md %TMP%\full\patches\ 14 | 15 | md %TMP%\full\plugins\ 16 | 17 | md "%TMP%\full\plugins\Novidia Shaders" 18 | 19 | md %TMP%\full\ram\ 20 | 21 | md %TMP%\full\ram\databank_template_v2\ 22 | 23 | 24 | 25 | copy %APPVEYOR_BUILD_FOLDER%\source-code\x64\%CONFIGURATION%\dnsapi.dll %TMP%\full\ 26 | 27 | copy %APPVEYOR_BUILD_FOLDER%\source-code\x64\%CONFIGURATION%\*.dva %TMP%\full\plugins\ 28 | 29 | copy "%APPVEYOR_BUILD_FOLDER%\source-code\data\README - PD Loader.url" %TMP%\full\ 30 | 31 | copy %APPVEYOR_BUILD_FOLDER%\source-code\data\verify_base_game.sfv %TMP%\full\ 32 | 33 | copy %APPVEYOR_BUILD_FOLDER%\source-code\data\verify_mount_data.sfv %TMP%\full\ 34 | 35 | copy %APPVEYOR_BUILD_FOLDER%\source-code\data\plugins\*.* %TMP%\full\plugins\ 36 | 37 | copy "%APPVEYOR_BUILD_FOLDER%\source-code\data\plugins\Novidia Shaders\*.*" "%TMP%\full\plugins\Novidia Shaders\" 38 | 39 | copy %APPVEYOR_BUILD_FOLDER%\source-code\data\ram\databank_template_v2\*.dat %TMP%\full\ram\databank_template_v2\ 40 | 41 | copy %APPVEYOR_BUILD_FOLDER%\source-code\data\patches\custom_freeplay_text_example.p %TMP%\full\patches\ 42 | 43 | 44 | 45 | cd %TMP%\full\ 46 | 47 | 7z a %APPVEYOR_BUILD_FOLDER%\PD-Loader-%CONFIGURATION%-AppVeyor.zip * 48 | 49 | artifacts: 50 | - path: PD-Loader-*.zip 51 | -------------------------------------------------------------------------------- /dnsapi.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/dnsapi.dll -------------------------------------------------------------------------------- /source-code/data/Download .NET Framework Runtime.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://dotnet.microsoft.com/download/dotnet-framework/net48 3 | -------------------------------------------------------------------------------- /source-code/data/Download QuickSFV.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://www.quicksfv.org/qsfv236x64.exe 3 | -------------------------------------------------------------------------------- /source-code/data/Download Visual C++ Runtime.url: -------------------------------------------------------------------------------- 1 | [InternetShortcut] 2 | URL=https://aka.ms/vs/16/release/vc_redist.x64.exe 3 | -------------------------------------------------------------------------------- /source-code/data/README - PD Loader.url: -------------------------------------------------------------------------------- 1 | [{000214A0-0000-0000-C000-000000000046}] 2 | Prop3=19,11 3 | [InternetShortcut] 4 | IDList= 5 | URL=https://github.com/PDModdingCommunity/PD-Loader/wiki 6 | HotKey=0 7 | -------------------------------------------------------------------------------- /source-code/data/patches/custom_freeplay_text_example.p: -------------------------------------------------------------------------------- 1 | # Enable FREE PLAY 2 | // Just in case it's disabled... 3 | @1403BABEA:75 // ...enable it. 4 | 5 | # Custom FREE PLAY text 6 | 1409F61F0:!Miku\0 7 | 8 | # Custom text colour 9 | 1401964A2:00 FF FF 7F 10 | 11 | // Syntax: 12 | // "#" console comment 13 | // "//" hidden comment 14 | // "@" omit patch console output 15 | // ":" address:bytes (hex) 16 | // " " byte byte 17 | // ":!" address:!string (escape characters require PD Loader 2.1+) 18 | // "IGNORE" skip patch file (deprecated) 19 | -------------------------------------------------------------------------------- /source-code/data/plugins/DivaSound_template.bin: -------------------------------------------------------------------------------- 1 | ######################################### 2 | # /!\ WARNING: DO NOT EDIT WITH NOTEPAD!# 3 | ######################################### 4 | 5 | [General] 6 | # You can choose 2 channel or 4 channel mode. 7 | # 4 channels uses front channels for speakers and rear channels as headphones. 8 | # 2 channels only has headphones output (with in-game volume bypassed). 9 | Channels=2 10 | 11 | # 16 or 24 bit integer and 32 bit float output are supported. 12 | # If you don't know what this means, you should leave it at 16. 13 | # On some versions of Windows floating point samples may increase latency. 14 | Bit_Depth=16 15 | 16 | # This can be WASAPI, DirectSound, WASAPI_Exclusive, or ASIO. 17 | # Only use DirectSound if WASAPI doesn't work for some reason. 18 | # WASAPI_Exclusive may not work with some hardware, but can have lower latency. 19 | # ASIO requires special driver support. 20 | # ASIO doesn't use the buffer settings. Use ASIO config instead. 21 | # For full descriptions of the backends see https://github.com/somewhatlurker/DivaSound/wiki/Backends. 22 | Backend=WASAPI 23 | 24 | # If the game crashes when loading, try setting this to 0. 25 | Alternate_Init=1 26 | 27 | [Buffer] 28 | # Sets the requested buffer size in milliseconds. 29 | # Try increasing this if audio stutters or desyncs. 30 | # WASAPI will usually provide a larger buffer than specified. 31 | # You can check the actual buffer size by enabling debug_component. 32 | Buffer_Size=10 33 | 34 | # Sets how many periods to use. 35 | # Fewer periods = lower latency, but it may cause issues. 36 | # You probably shouldn't set this below 2, and increasing it probably isn't necessary. 37 | Periods=2 38 | 39 | [ASIO] 40 | # Sets the device ID. 41 | # 0=first device(...), -1=first available device 42 | Device=-1 43 | 44 | # When set to 1 the ASIO driver config will open alongside the game. 45 | # Use this to adjust output settings, then disable it. 46 | Show_Config=0 47 | -------------------------------------------------------------------------------- /source-code/data/plugins/Novidia Shaders/e6d9187b.vcdiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/data/plugins/Novidia Shaders/e6d9187b.vcdiff -------------------------------------------------------------------------------- /source-code/data/plugins/ShaderPatchConfig_template.bin: -------------------------------------------------------------------------------- 1 | [Config] 2 | # Patches to remove glitching with modern GPUs. 3 | # Appropriate patches will automatically be selected based on your GPU. 4 | Compat=1 5 | 6 | # Lyb's toon shader improvements (24 sept 2019) 7 | # Toon_Improve: Adjusts toon shader lighting 8 | Toon_Improve=0 9 | # Specular Multiplier 10 | Toon_Improve_Val1=0.9 11 | # Specular Offset 12 | Toon_Improve_Val2=-0.5 13 | 14 | # Lyb's toon shader improvements (24 sept 2019) 15 | # Toon_Eyes_Improve: Adjusts toon shader eyes 16 | Toon_Eyes_Improve=0 17 | 18 | # Lyb's toon shader improvements (24 sept 2019) 19 | # Toon_Hair_Improve: Adjusts toon shader hair 20 | Toon_Hair_Improve=0 21 | # Diffuse Brightness 22 | Toon_Hair_Improve_Val1=1.25 23 | 24 | # Lyb's toon shader improvements (24 sept 2019) 25 | # Fixes by korenkonder (11 jan 2025) 26 | # Toon_Lines_Improve: Adjusts toon shader outlines 27 | Toon_Lines_Improve=0 28 | # Skin Shadow Strength 29 | Toon_Lines_Improve_Val1=0.05 30 | # Skin Outline Strength 31 | Toon_Lines_Improve_Val2=0.9 32 | # Outline Strength Multiplier 33 | Toon_Lines_Improve_Val3=0.7 34 | # Outline Strength Offset 35 | Toon_Lines_Improve_Val4=0.25 36 | 37 | # Debug patches: 38 | # Nametags 39 | # Adds comments with the shader file name to the shader text. Useful for debugging issues. 40 | # You only need to enable one of these. 41 | # `nametags2` is a bit faster, but the tags are placed at the end of the file and you may not like that. 42 | Nametags1=0 43 | Nametags2=0 -------------------------------------------------------------------------------- /source-code/data/plugins/bassasio.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/data/plugins/bassasio.dll -------------------------------------------------------------------------------- /source-code/data/plugins/components_template.bin: -------------------------------------------------------------------------------- 1 | ######################################### 2 | # /!\ WARNING: DO NOT EDIT WITH NOTEPAD!# 3 | ######################################### 4 | 5 | # components.ini 6 | # defines which components will be enabled 7 | [components] 8 | 9 | # emulates game input through mouse and keyboard. 10 | # controls can be set inside the keyconfig.ini file. 11 | input_emulator = true 12 | touch_slider_emulator = true 13 | touch_panel_emulator = true 14 | 15 | # freezes the PV select timer at 39 seconds. 16 | sys_timer = true 17 | 18 | # loads user defined const values from the playerdata.ini config 19 | # and writes them to the game's PlayerData struct. 20 | # required for modules selection 21 | player_data_manager = true 22 | 23 | # adjusts 2D and 3D animations to retain their original speed at different frame rates. 24 | frame_rate_manager = false 25 | 26 | # skip unnecessary DATA_INITIALIZE loading time, speed up SYSTEM_STARTUP and skip the startup WARNING message. 27 | # further improvements can be achieved by shortening the duration of the pv_999 script file as it's test loaded during the SYSTEM_STARTUP. 28 | fast_loader = true 29 | 30 | # allows for a user controllable camera which can be toggled using F3, 31 | # can be controlled using W/A/S/D to move, SPACE/CTRL to ascend/descend, Q/E to rotate, R/F to zoom in/out 32 | # and holding SHIFT/ALT to speed up or slow down these controls. 33 | camera_controller = false 34 | 35 | # scales the framebuffer so that it will fit the current screen or window 36 | # required to set resolutions in config.ini 37 | scale_component = true 38 | 39 | # lets the user change the current game state using the F4 - F8 keys, enable the dw_gui / DATA_TESTs 40 | # and speed up 2D animations / menu navigation by holding SHIFT + TAB. 41 | # enabling this component is not recommended for most users. 42 | debug_component = false 43 | 44 | # allows the usage of hold transfer 45 | target_inspector = true 46 | 47 | # saves high scores to plugins/scores.ini 48 | score_saver = true 49 | 50 | # adds a pause menu 51 | pause = true 52 | -------------------------------------------------------------------------------- /source-code/data/plugins/playerdata_template.bin: -------------------------------------------------------------------------------- 1 | [playerdata] 2 | ######################################### 3 | # /!\ WARNING: DO NOT EDIT WITH NOTEPAD!# 4 | ######################################### 5 | 6 | # playerdata.ini 7 | # defines constant values to be loaded into the PlayerData struct 8 | # this file has to be encoded using utf-8 9 | player_name =NO-NAME 10 | level_name =忘れないでね私の声を 11 | level =1 12 | vocaloid_point=0 13 | 14 | # IDs defined in rom/gm_plate_tbl.farc/gm_plate_id.bin 15 | level_plate_id =0 16 | level_plate_effect=1 17 | # IDs same as gam_skin%3d 18 | skin_equip =0 19 | # Allows for song specific skin settings which can be set in the file skins.ini 20 | use_pv_skin_equip =true 21 | # IDs defined in rom/gm_btn_se_tbl.farc/gm_btn_se_id.bin 22 | btn_se_equip =-1 23 | # Allows for song specific sound effect settings which can be set in the file sfx.ini 24 | use_pv_sfx_equip =true 25 | # IDs defined in rom/gm_slide_se_tbl.farc/gm_slide_se_id.bin 26 | slide_se_equip =-1 27 | # IDs defined in rom/gm_chainslide_se_tbl.farc/gm_chainslide_se_id.bin 28 | chainslide_se_equip =-1 29 | slidertouch_se_equip=-1 30 | # "Shared Set" or "Original" setting, works similarly to PSP series module selection (Updates when changed in-game) 31 | module_equip_cmn0=0 32 | module_equip_cmn1=0 33 | module_equip_cmn2=0 34 | module_equip_cmn3=0 35 | module_equip_cmn4=0 36 | module_equip_cmn5=0 37 | # Allows Song Specific module selections (values update when changed in-game in the file modules.ini) (May lag on song select and menu) 38 | use_pv_module_equip=true 39 | # Enable button/slider sounds & volume settings 40 | act_toggle =true 41 | act_vol =100 42 | act_slide_vol=100 43 | # Show clear borders on Progress Bar for: 44 | # Great 45 | border_great =true 46 | # Excellent 47 | border_excellent =true 48 | # Rival 49 | border_rival=true 50 | 51 | # Allows module selection (WARNING: It may cause lag in the main menu and other places) (May be necessary for use_pv_equip settings!) 52 | use_card =true 53 | 54 | # Allows module selection without card and attempts to disable module refresh when sliding in PV select to reduce CPU and IO load. 55 | module_card_workaround =false 56 | 57 | # Allows use of game mode modifiers (hi-speed, hidden, and sudden) 58 | gamemode_options =true 59 | 60 | 61 | 62 | mylist_A= 63 | mylist_B= 64 | mylist_C= 65 | -------------------------------------------------------------------------------- /source-code/data/ram/databank_template_v2/PvList4_SBZV_7.10_5341_1636921101.dat: -------------------------------------------------------------------------------- 1 | %2A%2A%2A -------------------------------------------------------------------------------- /source-code/dependencies/WineVer/WineVer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Simple header for detecting version of Wine 3 | */ 4 | 5 | namespace WineVer 6 | { 7 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 8 | #include 9 | #include 10 | #include 11 | #pragma comment(lib, "advapi32") 12 | 13 | std::string getWineVer() 14 | { 15 | HMODULE hntdll = LoadLibraryW(L"ntdll.dll"); 16 | 17 | if (hntdll == NULL) 18 | return ""; 19 | 20 | char*(WINAPI * wine_get_version)() = (char*(WINAPI*)())GetProcAddress(hntdll, "wine_get_version"); 21 | if (wine_get_version) 22 | { 23 | //puts("Wine detected."); 24 | //printf("Running on Wine... %s\n", wine_get_version()); 25 | return std::string(wine_get_version()); 26 | } 27 | return ""; 28 | } 29 | } -------------------------------------------------------------------------------- /source-code/dependencies/detours/include/detver.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Common version parameters. 4 | // 5 | // Microsoft Research Detours Package, Version 4.0.1 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | // 9 | 10 | #define _USING_V110_SDK71_ 1 11 | #include "winver.h" 12 | #if 0 13 | #include 14 | #include 15 | #else 16 | #ifndef DETOURS_STRINGIFY 17 | #define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x) 18 | #define DETOURS_STRINGIFY_(x) #x 19 | #endif 20 | 21 | #define VER_FILEFLAGSMASK 0x3fL 22 | #define VER_FILEFLAGS 0x0L 23 | #define VER_FILEOS 0x00040004L 24 | #define VER_FILETYPE 0x00000002L 25 | #define VER_FILESUBTYPE 0x00000000L 26 | #endif 27 | #define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS) 28 | -------------------------------------------------------------------------------- /source-code/dependencies/detours/lib/detours.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/detours/lib/detours.lib -------------------------------------------------------------------------------- /source-code/dependencies/detours/lib/syelog.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/detours/lib/syelog.lib -------------------------------------------------------------------------------- /source-code/dependencies/freeglut/include/GL/freeglut.h: -------------------------------------------------------------------------------- 1 | #ifndef __FREEGLUT_H__ 2 | #define __FREEGLUT_H__ 3 | 4 | /* 5 | * freeglut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | #include "freeglut_ext.h" 19 | 20 | /*** END OF FILE ***/ 21 | 22 | #endif /* __FREEGLUT_H__ */ 23 | -------------------------------------------------------------------------------- /source-code/dependencies/freeglut/include/GL/glut.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLUT_H__ 2 | #define __GLUT_H__ 3 | 4 | /* 5 | * glut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | 19 | /*** END OF FILE ***/ 20 | 21 | #endif /* __GLUT_H__ */ 22 | -------------------------------------------------------------------------------- /source-code/dependencies/freeglut/lib/freeglut.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/freeglut/lib/freeglut.exp -------------------------------------------------------------------------------- /source-code/dependencies/freeglut/lib/freeglut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/freeglut/lib/freeglut.lib -------------------------------------------------------------------------------- /source-code/dependencies/freeglut/lib/freeglutd.exp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/freeglut/lib/freeglutd.exp -------------------------------------------------------------------------------- /source-code/dependencies/freeglut/lib/freeglutd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/freeglut/lib/freeglutd.lib -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - linux 5 | - osx 6 | 7 | compiler: 8 | - gcc 9 | - clang 10 | 11 | script: 12 | - make all 13 | - make test 14 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/LICENCE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2006-2013 Brodie Thiesfield 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/Makefile: -------------------------------------------------------------------------------- 1 | help: 2 | @echo This makefile is just for the test program \(use \"make clean all test\"\) 3 | @echo Just include the SimpleIni.h header file to use it. 4 | 5 | install: 6 | @echo No install required. Just include the SimpleIni.h header file to use it. 7 | 8 | TOPTARGETS := all clean test 9 | 10 | SUBDIRS := tests 11 | 12 | $(TOPTARGETS): $(SUBDIRS) 13 | $(SUBDIRS): 14 | $(MAKE) -C $@ $(MAKECMDGOALS) 15 | 16 | .PHONY: $(TOPTARGETS) $(SUBDIRS) 17 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/other/package.cmd: -------------------------------------------------------------------------------- 1 | set VERSION=4.15 2 | 3 | set SEVENZIP="C:\Program Files\7-Zip\7z.exe" 4 | 5 | FOR /F "tokens=*" %%G IN ('DIR /AD /B /S Debug*') DO ( 6 | DEL /S /Q "%%G" 7 | RD "%%G" 8 | ) 9 | FOR /F "tokens=*" %%G IN ('DIR /AD /B /S Release*') DO ( 10 | DEL /S /Q "%%G" 11 | RD "%%G" 12 | ) 13 | DEL /Q "SimpleIni.ncb" 14 | ATTRIB -H "SimpleIni.suo" 15 | DEL /Q "SimpleIni.suo" 16 | DEL /Q "SimpleIni.opt" 17 | DEL /Q testsi-out*.ini 18 | DEL /Q test1-blah.ini 19 | DEL /Q test1-output.ini 20 | START "Generate documentation" /WAIT "C:\Program Files (x86)\doxygen\bin\doxygen.exe" SimpleIni.doxy 21 | cd .. 22 | del simpleini-%VERSION%.zip 23 | %SEVENZIP% a -tzip -r- -x!simpleini\.svn simpleini-%VERSION%.zip simpleini\* 24 | del simpleini-doc.zip 25 | %SEVENZIP% a -tzip -r simpleini-doc.zip simpleini-doc\* 26 | cd simpleini 27 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/.gitignore: -------------------------------------------------------------------------------- 1 | example2.ini 2 | 3 | tests 4 | *.o 5 | 6 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/Makefile: -------------------------------------------------------------------------------- 1 | CC=g++ 2 | CFLAGS=-Wall -std=c++11 3 | CPPFLAGS=-Wall -std=c++11 4 | LDFLAGS=-lpthread -lgtest -lgtest_main -lpthread -L/usr/lib 5 | 6 | OBJS=ts-roundtrip.o ts-snippets.o ts-utf8.o ts-bugfix.o 7 | 8 | BIN=./tests 9 | 10 | all: $(OBJS) 11 | $(CC) -o $(BIN) $(OBJS) $(LDFLAGS) 12 | 13 | clean: 14 | rm -f core $(OBJS) $(BIN) 15 | 16 | test: $(BIN) 17 | $(BIN) 18 | 19 | $(OBJS): ../SimpleIni.h 20 | 21 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/example.ini: -------------------------------------------------------------------------------- 1 | [section] 2 | key = value 3 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/old/test.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | Debug\testsi.exe -u -m -l test1-input.ini > test1-blah.ini 4 | fc test1-expected.ini test1-output.ini 5 | if errorlevel 1 goto error 6 | 7 | "Debug Unicode\testsi.exe" -u -m -l test1-input.ini > test1-blah.ini 8 | fc test1-expected.ini test1-output.ini 9 | if errorlevel 1 goto error 10 | 11 | Release\testsi.exe -u -m -l test1-input.ini > test1-blah.ini 12 | fc test1-expected.ini test1-output.ini 13 | if errorlevel 1 goto error 14 | 15 | "Release Unicode\testsi.exe" -u -m -l test1-input.ini > test1-blah.ini 16 | fc test1-expected.ini test1-output.ini 17 | if errorlevel 1 goto error 18 | 19 | exit /b 0 20 | 21 | :error 22 | echo Failed during test run. Output file doesn't match expected file. 23 | pause 24 | exit /b 1 25 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/old/test1-expected.ini: -------------------------------------------------------------------------------- 1 | ; testsi-UTF8-std.ini : standard UTF-8 test file for SimpleIni automated testing 2 | ; 3 | ; The number after a section or key is the order that it is defined in this file 4 | ; to make it easier to see if it has been written out correctly. This file should 5 | ; be loaded with Unicode / MultiKey / MultiLine turned on. 6 | 7 | 8 | 9 | ; This comment should be joined on to the one below it about the key 10 | ; with no section. 11 | 12 | ; Key with no section 13 | lonely-key = nosection 14 | another = nosection either 15 | 16 | ; This key has no value 17 | empty = 18 | 19 | 20 | ; This should be joined with the comment below about japanese. 21 | ; Another line which will be un-indented. 22 | 23 | ; This is a section of keys showing the word Japanese in different syllabies. 24 | [ordered-1] 25 | a-1 = blah 26 | 27 | ; this is in kanji 28 | japanese-2 = 日本語 29 | 30 | ; this is in hiragana 31 | japanese-3 = にほんご 32 | 33 | ; this is in katakana 34 | japanese-4 = ニホンゴ 35 | 36 | ; this is in romaji 37 | japanese-5 = nihongo 38 | 39 | ; kanji as the key 40 | 日本語-6 = japanese 41 | 42 | 43 | [multi-2] 44 | 45 | ; value a 46 | test = a 47 | 48 | ; value b 49 | test = b 50 | 51 | ; value c 52 | test = c 53 | 54 | ; value d 55 | test = d 56 | 57 | 58 | [multiline-3] 59 | 60 | ; This is obviously a multi-line entry 61 | multiline-1 = << 2 | 3 | 4 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/pch.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // pch.cpp 3 | // Include the standard header and generate the precompiled header. 4 | // 5 | 6 | #include "pch.h" 7 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/pch.h: -------------------------------------------------------------------------------- 1 | // 2 | // pch.h 3 | // Header for standard system include files. 4 | // 5 | 6 | #pragma once 7 | 8 | #include "gtest/gtest.h" 9 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/tests.ini: -------------------------------------------------------------------------------- 1 | [section1] 2 | key1=value1 3 | 4 | [section2] 5 | test2=テスト2 6 | テスト=test 7 | テスト2=テスト二 8 | 9 | [検査] 10 | key2=value2 11 | test2=テスト2 12 | テスト=test 13 | テスト2=テスト二 14 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/ts-utf8.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "../SimpleIni.h" 3 | 4 | class TestUTF8 : public ::testing::Test { 5 | protected: 6 | void SetUp() override; 7 | protected: 8 | CSimpleIniA ini; 9 | }; 10 | 11 | void TestUTF8::SetUp() { 12 | ini.SetUnicode(); 13 | SI_Error err = ini.LoadFile("tests.ini"); 14 | ASSERT_EQ(err, SI_OK); 15 | } 16 | 17 | TEST_F(TestUTF8, TestSectionAKeyAValA) { 18 | const char* result = ini.GetValue("section1", "key1"); 19 | ASSERT_STREQ(result, "value1"); 20 | } 21 | 22 | TEST_F(TestUTF8, TestSectionAKeyAValU) { 23 | const char tesuto2[] = u8"テスト2"; 24 | const char* result = ini.GetValue("section2", "test2"); 25 | ASSERT_STREQ(result, tesuto2); 26 | } 27 | 28 | TEST_F(TestUTF8, TestSectionAKeyUValA) { 29 | const char tesuto[] = u8"テスト"; 30 | const char* result = ini.GetValue("section2", tesuto); 31 | ASSERT_STREQ(result, "test"); 32 | } 33 | 34 | TEST_F(TestUTF8, TestSectionAKeyUValU) { 35 | const char tesuto2[] = u8"テスト2"; 36 | const char tesutoni[] = u8"テスト二"; 37 | const char* result = ini.GetValue("section2", tesuto2); 38 | ASSERT_STREQ(result, tesutoni); 39 | } 40 | 41 | TEST_F(TestUTF8, TestSectionUKeyAValA) { 42 | const char kensa[] = u8"検査"; 43 | const char* result = ini.GetValue(kensa, "key2"); 44 | ASSERT_STREQ(result, "value2"); 45 | } 46 | 47 | TEST_F(TestUTF8, TestSectionUKeyAValU) { 48 | const char kensa[] = u8"検査"; 49 | const char tesuto2[] = u8"テスト2"; 50 | const char* result = ini.GetValue(kensa, "test2"); 51 | ASSERT_STREQ(result, tesuto2); 52 | } 53 | 54 | TEST_F(TestUTF8, TestSectionUKeyUValA) { 55 | const char kensa[] = u8"検査"; 56 | const char tesuto[] = u8"テスト"; 57 | const char* result = ini.GetValue(kensa, tesuto); 58 | ASSERT_STREQ(result, "test"); 59 | } 60 | 61 | TEST_F(TestUTF8, TestSectionUKeyUValU) { 62 | const char kensa[] = u8"検査"; 63 | const char tesuto2[] = u8"テスト2"; 64 | const char tesutoni[] = u8"テスト二"; 65 | const char* result = ini.GetValue(kensa, tesuto2); 66 | ASSERT_STREQ(result, tesutoni); 67 | } 68 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/tests/ts-wchar.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "../SimpleIni.h" 3 | 4 | class TestWide : public ::testing::Test { 5 | protected: 6 | void TestWide::SetUp() override; 7 | protected: 8 | CSimpleIniW ini; 9 | }; 10 | 11 | void TestWide::SetUp() { 12 | ini.SetUnicode(); 13 | SI_Error err = ini.LoadFile(L"tests.ini"); 14 | ASSERT_EQ(err, SI_OK); 15 | } 16 | 17 | TEST_F(TestWide, TestSectionAKeyAValA) { 18 | const wchar_t* result = ini.GetValue(L"section1", L"key1"); 19 | ASSERT_STREQ(result, L"value1"); 20 | } 21 | 22 | TEST_F(TestWide, TestSectionAKeyAValU) { 23 | const wchar_t tesuto2[] = L"テスト2"; 24 | const wchar_t* result = ini.GetValue(L"section2", L"test2"); 25 | ASSERT_STREQ(result, tesuto2); 26 | } 27 | 28 | TEST_F(TestWide, TestSectionAKeyUValA) { 29 | const wchar_t tesuto[] = L"テスト"; 30 | const wchar_t* result = ini.GetValue(L"section2", tesuto); 31 | ASSERT_STREQ(result, L"test"); 32 | } 33 | 34 | TEST_F(TestWide, TestSectionAKeyUValU) { 35 | const wchar_t tesuto2[] = L"テスト2"; 36 | const wchar_t tesutoni[] = L"テスト二"; 37 | const wchar_t* result = ini.GetValue(L"section2", tesuto2); 38 | ASSERT_STREQ(result, tesutoni); 39 | } 40 | 41 | TEST_F(TestWide, TestSectionUKeyAValA) { 42 | const wchar_t kensa[] = L"検査"; 43 | const wchar_t* result = ini.GetValue(kensa, L"key2"); 44 | ASSERT_STREQ(result, L"value2"); 45 | } 46 | 47 | TEST_F(TestWide, TestSectionUKeyAValU) { 48 | const wchar_t kensa[] = L"検査"; 49 | const wchar_t tesuto2[] = L"テスト2"; 50 | const wchar_t* result = ini.GetValue(kensa, L"test2"); 51 | ASSERT_STREQ(result, tesuto2); 52 | } 53 | 54 | TEST_F(TestWide, TestSectionUKeyUValA) { 55 | const wchar_t kensa[] = L"検査"; 56 | const wchar_t tesuto[] = L"テスト"; 57 | const wchar_t* result = ini.GetValue(kensa, tesuto); 58 | ASSERT_STREQ(result, L"test"); 59 | } 60 | 61 | TEST_F(TestWide, TestSectionUKeyUValU) { 62 | const wchar_t kensa[] = L"検査"; 63 | const wchar_t tesuto2[] = L"テスト2"; 64 | const wchar_t tesutoni[] = L"テスト二"; 65 | const wchar_t* result = ini.GetValue(kensa, tesuto2); 66 | ASSERT_STREQ(result, tesutoni); 67 | } 68 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/vcproj/SimpleIni.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30204.135 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Library Files", "Library Files", "{C1F8A145-78E7-42C6-95D5-23C746C2BC56}" 7 | ProjectSection(SolutionItems) = preProject 8 | ..\ConvertUTF.c = ..\ConvertUTF.c 9 | ..\ConvertUTF.h = ..\ConvertUTF.h 10 | ..\SimpleIni.h = ..\SimpleIni.h 11 | EndProjectSection 12 | EndProject 13 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Information Files", "Information Files", "{E40DD170-6D17-49D2-9BB2-8546658F0A37}" 14 | ProjectSection(SolutionItems) = preProject 15 | ..\LICENCE.txt = ..\LICENCE.txt 16 | ..\README.md = ..\README.md 17 | EndProjectSection 18 | EndProject 19 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Other Files", "Other Files", "{560B512C-6D1C-4E65-83C1-049110E5DEF6}" 20 | ProjectSection(SolutionItems) = preProject 21 | ..\other\.travis.yml = ..\other\.travis.yml 22 | ..\other\Makefile = ..\other\Makefile 23 | ..\other\package.cmd = ..\other\package.cmd 24 | ..\other\simpleini.doxy = ..\other\simpleini.doxy 25 | EndProjectSection 26 | EndProject 27 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tests", "..\tests\tests.vcxproj", "{8F30A5DC-B942-4C9A-BA75-91C906FF85FA}" 28 | EndProject 29 | Global 30 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 31 | Debug|x64 = Debug|x64 32 | Debug|x86 = Debug|x86 33 | Release|x64 = Release|x64 34 | Release|x86 = Release|x86 35 | EndGlobalSection 36 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 37 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Debug|x64.ActiveCfg = Debug|x64 38 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Debug|x64.Build.0 = Debug|x64 39 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Debug|x86.ActiveCfg = Debug|Win32 40 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Debug|x86.Build.0 = Debug|Win32 41 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Release|x64.ActiveCfg = Release|x64 42 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Release|x64.Build.0 = Release|x64 43 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Release|x86.ActiveCfg = Release|Win32 44 | {8F30A5DC-B942-4C9A-BA75-91C906FF85FA}.Release|x86.Build.0 = Release|Win32 45 | EndGlobalSection 46 | GlobalSection(SolutionProperties) = preSolution 47 | HideSolutionNode = FALSE 48 | EndGlobalSection 49 | GlobalSection(ExtensibilityGlobals) = postSolution 50 | SolutionGuid = {ABD2CECE-EA8B-455B-8AE7-00E499634EC2} 51 | EndGlobalSection 52 | EndGlobal 53 | -------------------------------------------------------------------------------- /source-code/dependencies/simpleini/vcproj/SimpleIni.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {353054bc-f2a3-46d2-a9cb-df767fe52289} 6 | 7 | 8 | 9 | 10 | Tests 11 | 12 | 13 | Tests 14 | 15 | 16 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/README.md: -------------------------------------------------------------------------------- 1 | Xdelta 3.x readme.txt 2 | Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 3 | 2009, 2010, 2011, 2012, 2013, 2014, 2015 4 | 5 | 6 | 7 | Thanks for downloading Xdelta! 8 | 9 | This directory contains the Xdelta3 command-line interface (CLI) and source 10 | distribution for VCDIFF differential compression, a.k.a. delta 11 | compression. The latest information and downloads are available here: 12 | 13 | http://xdelta.org/ 14 | http://github.com/jmacd/xdelta/ 15 | 16 | Xdelta can be configured to use XZ Utils for secondary compression: 17 | 18 | http://tukaani.org/xz/ 19 | 20 | The command-line syntax is detailed here: 21 | 22 | https://github.com/jmacd/xdelta/blob/wiki/CommandLineSyntax.md 23 | 24 | Run 'xdelta3 -h' for brief help. Run 'xdelta3 test' for built-in tests. 25 | 26 | Sample commands (like gzip, -e means encode, -d means decode) 27 | 28 | xdelta3 -9 -S lzma -e -f -s OLD_FILE NEW_FILE DELTA_FILE 29 | xdelta3 -d -s OLD_FILE DELTA_FILE DECODED_FILE 30 | 31 | File bug reports and browse open support issues here: 32 | 33 | https://github.com/jmacd/xdelta/issues 34 | 35 | The source distribution contains the C/C++/Python APIs, Unix, Microsoft VC++ 36 | and Cygwin builds. Xdelta3 is covered under the terms of the APL, see 37 | LICENSE. 38 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/configure.ac: -------------------------------------------------------------------------------- 1 | AC_INIT([Xdelta3], [3.1.1], [josh.macdonald@gmail.com], 2 | [xdelta3], [http://xdelta.org/]) 3 | AC_PREREQ([2.68]) 4 | AC_CONFIG_MACRO_DIR([m4]) 5 | LT_INIT 6 | AM_INIT_AUTOMAKE([1.15 no-define foreign tar-ustar subdir-objects]) 7 | AC_CONFIG_MACRO_DIRS([m4]) 8 | 9 | AX_CHECK_ALIGNED_ACCESS_REQUIRED 10 | AC_PROG_CC 11 | AC_PROG_CXX 12 | 13 | AC_CHECK_SIZEOF(size_t) 14 | AC_CHECK_SIZEOF(unsigned int) 15 | AC_CHECK_SIZEOF(unsigned long) 16 | AC_CHECK_SIZEOF(unsigned long long) 17 | 18 | AC_ARG_WITH( 19 | [liblzma], 20 | [AC_HELP_STRING( 21 | [--with-liblzma], 22 | [build with liblzma support @<:@default=autodetect@:>@])], 23 | [USE_LIBLZMA=$withval], 24 | [USE_LIBLZMA=auto]) 25 | 26 | if test "x$USE_LIBLZMA" != xno ; then 27 | AC_CHECK_HEADERS([lzma.h],,[ 28 | if test "x$with_liblzma" = xyes ; then 29 | AC_MSG_FAILURE([liblzma includes were not found]) 30 | fi]) 31 | AC_CHECK_LIB([lzma], [lzma_easy_buffer_encode],,[ 32 | if test "x$with_liblzma" = xyes ; then 33 | AC_MSG_FAILURE([liblzma library were not found]) 34 | fi]) 35 | fi 36 | 37 | #AM_PATH_PYTHON(,, [:]) 38 | #AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != :]) 39 | #AX_PYTHON_DEVEL() 40 | #AX_PKG_SWIG(2.0.0,,) 41 | #AX_SWIG_PYTHON 42 | 43 | dnl --enable-debug-symbols : build with debug symbols? 44 | AC_ARG_ENABLE(debug-symbols, 45 | AS_HELP_STRING(--enable-debug-symbols,[Build with debug symbols (default is NO)]),,enableval=no) 46 | AM_CONDITIONAL([DEBUG_SYMBOLS], [test ${enableval} = "yes"]) 47 | 48 | 49 | AC_CONFIG_HEADERS([config.h]) 50 | AC_CONFIG_FILES([Makefile]) 51 | AC_OUTPUT 52 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/cpp-btree/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright 2013 Google Inc. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | cmake_minimum_required(VERSION 2.6) 16 | 17 | project(cppbtree CXX) 18 | 19 | option(build_tests "Build B-tree tests" OFF) 20 | add_definitions(-std=c++11) 21 | set(CMAKE_CXX_FLAGS "-g -O2") 22 | 23 | # CMake doesn't have a way to pure template library, 24 | # add_library(cppbtree btree.h btree_map.h btree_set.h 25 | # safe_btree.h safe_btree_map.h safe_btree_set.h) 26 | # set_target_properties(cppbtree PROPERTIES LINKER_LANGUAGE CXX) 27 | 28 | if(build_tests) 29 | enable_testing() 30 | include_directories($ENV{GTEST_ROOT}/include) 31 | link_directories($ENV{GTEST_ROOT}) 32 | include_directories($ENV{GFLAGS_ROOT}/include) 33 | link_directories($ENV{GFLAGS_ROOT}/lib) 34 | add_executable(btree_test btree_test.cc btree_test_flags.cc) 35 | add_executable(safe_btree_test safe_btree_test.cc btree_test_flags.cc) 36 | add_executable(btree_bench btree_bench.cc btree_test_flags.cc) 37 | target_link_libraries(btree_test gtest_main gtest gflags) 38 | target_link_libraries(safe_btree_test gtest_main gtest gflags) 39 | target_link_libraries(btree_bench gflags gtest) 40 | endif() 41 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/cpp-btree/README: -------------------------------------------------------------------------------- 1 | This library is a C++ template library and, as such, there is no 2 | library to build and install. Copy the .h files and use them! 3 | 4 | See http://code.google.com/p/cpp-btree/wiki/UsageInstructions for 5 | details. 6 | 7 | ---- 8 | 9 | To build and run the provided tests, however, you will need to install 10 | CMake, the Google C++ Test framework, and the Google flags package. 11 | 12 | Download and install CMake from http://www.cmake.org 13 | 14 | Download and build the GoogleTest framework from 15 | http://code.google.com/p/googletest 16 | 17 | Download and install gflags from https://code.google.com/p/gflags 18 | 19 | Set GTEST_ROOT to the directory where GTEST was built. 20 | Set GFLAGS_ROOT to the directory prefix where GFLAGS is installed. 21 | 22 | export GTEST_ROOT=/path/for/gtest-x.y 23 | export GFLAGS_ROOT=/opt 24 | 25 | cmake . -Dbuild_tests=ON 26 | 27 | For example, to build on a Unix system with the clang++ compiler, 28 | 29 | export GTEST_ROOT=$(HOME)/src/googletest 30 | export GFLAGS_ROOT=/opt 31 | cmake . -G "Unix Makefiles" -Dbuild_tests=ON -DCMAKE_CXX_COMPILER=clang++ 32 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/cpp-btree/btree_test_flags.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2013 Google Inc. All Rights Reserved. 2 | // 3 | // Licensed under the Apache License, Version 2.0 (the "License"); 4 | // you may not use this file except in compliance with the License. 5 | // You may obtain a copy of the License at 6 | // 7 | // http://www.apache.org/licenses/LICENSE-2.0 8 | // 9 | // Unless required by applicable law or agreed to in writing, software 10 | // distributed under the License is distributed on an "AS IS" BASIS, 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | // See the License for the specific language governing permissions and 13 | // limitations under the License. 14 | 15 | #include "gflags/gflags.h" 16 | 17 | DEFINE_int32(test_values, 10000, 18 | "The number of values to use for tests."); 19 | DEFINE_int32(benchmark_values, 1000000, 20 | "The number of values to use for benchmarks."); 21 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -g -Wall -I.. -DXD3_DEBUG=1 -DNDEBUG=0 -DSIZEOF_SIZE_T=8 -DSIZEOF_UNSIGNED_LONG_LONG=8 2 | #CFLAGS = -O3 -Wall -I.. -DXD3_DEBUG=0 -fno-builtin -DNDEBUG=1 3 | # -pg 4 | 5 | SOURCES = small_page_test.c encode_decode_test.c speed_test.c 6 | 7 | DEPS = ../*.h ../*.c *.h 8 | 9 | TARGETS = small_page_test encode_decode_test speed_test32 speed_test64 compare_test checksum_test 10 | 11 | all: $(TARGETS) 12 | 13 | small_page_test: small_page_test.c $(DEPS) 14 | $(CC) $(CFLAGS) small_page_test.c -o small_page_test -DXD3_USE_LARGEFILE64=0 -DSECONDARY_DJW=1 15 | 16 | encode_decode_test: encode_decode_test.c $(DEPS) 17 | $(CC) $(CFLAGS) encode_decode_test.c -o encode_decode_test 18 | 19 | speed_test32: speed_test.c $(DEPS) 20 | $(CC) $(CFLAGS) -DXD3_USE_LARGEFILE64=0 speed_test.c -o speed_test32 21 | 22 | speed_test64: speed_test.c $(DEPS) 23 | $(CC) $(CFLAGS) -DXD3_USE_LARGEFILE64=1 speed_test.c -o speed_test64 24 | 25 | compare_test: compare_test.c 26 | $(CC) $(CFLAGS) compare_test.c -o compare_test 27 | 28 | checksum_test: checksum_test.cc 29 | $(CXX) $(CFLAGS) checksum_test.cc -o checksum_test 30 | 31 | clean: 32 | rm -r -f *.exe *.stackdump $(TARGETS) *.dSYM *~ 33 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/README.md: -------------------------------------------------------------------------------- 1 | Files in this directory demonstrate how to use the Xdelta3 API. Copyrights 2 | are held by the respective authors. 3 | 4 | small_page_test.c -- how to use xdelta3 in an environment such as the kernel 5 | for small pages with little memory 6 | 7 | encode_decode_test.c -- how to use xdelta3 to process (encode/decode) data in 8 | multiple windows with the non-blocking API 9 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSAppDelegate.h: -------------------------------------------------------------------------------- 1 | /* xdelta3 - delta compression tools and library -*- Mode: objc *-* 2 | Copyright 2016 Joshua MacDonald 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface Xd3iOSAppDelegate : UIResponder 20 | 21 | @property (strong, nonatomic) UIWindow *window; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSAppDelegate.m: -------------------------------------------------------------------------------- 1 | /* xdelta3 - delta compression tools and library -*- Mode: objc *-* 2 | Copyright 2016 Joshua MacDonald 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import "Xd3iOSAppDelegate.h" 18 | 19 | @implementation Xd3iOSAppDelegate 20 | 21 | @synthesize window = _window; 22 | 23 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 24 | { 25 | // Override point for customization after application launch. 26 | return YES; 27 | } 28 | 29 | - (void)applicationWillResignActive:(UIApplication *)application 30 | { 31 | /* 32 | Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 34 | */ 35 | } 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application 38 | { 39 | /* 40 | Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 41 | If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | */ 43 | } 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application 46 | { 47 | /* 48 | Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 49 | */ 50 | } 51 | 52 | - (void)applicationDidBecomeActive:(UIApplication *)application 53 | { 54 | /* 55 | Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 56 | */ 57 | } 58 | 59 | - (void)applicationWillTerminate:(UIApplication *)application 60 | { 61 | /* 62 | Called when the application is about to terminate. 63 | Save data if appropriate. 64 | See also applicationDidEnterBackground:. 65 | */ 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/Xd3iOSViewController.h: -------------------------------------------------------------------------------- 1 | /* xdelta3 - delta compression tools and library -*- Mode: objc *-* 2 | Copyright 2016 Joshua MacDonald 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #import 18 | 19 | @interface Xd3iOSViewController : UIViewController { 20 | NSString *inputSeed; 21 | } 22 | - (IBAction)startTest:(id)sender; 23 | @property (weak, nonatomic) IBOutlet UITextField *theSeed; 24 | @property (weak, nonatomic) IBOutlet UITextView *theView; 25 | @property (atomic, retain) NSMutableString *theOutput; 26 | @property (nonatomic) BOOL inTest; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/en.lproj/MainStoryboard_iPhone.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/file_v1_to_v2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/file_v1_to_v2.bin -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/main.m: -------------------------------------------------------------------------------- 1 | /* xdelta3 - delta compression tools and library -*- Mode: objc *-* 2 | Copyright 2016 Joshua MacDonald 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | #import 17 | 18 | #import "Xd3iOSAppDelegate.h" 19 | 20 | int main(int argc, char *argv[]) 21 | { 22 | @autoreleasepool { 23 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([Xd3iOSAppDelegate class])); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/iOS/xdelta3-ios-test/xdelta3-ios-test/xdelta3-ios-test-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIconFiles 12 | 13 | CFBundleIdentifier 14 | Joshua-MacDonald.${PRODUCT_NAME:rfc1034identifier} 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | ${PRODUCT_NAME} 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | 1.0 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | 1.0 27 | LSRequiresIPhoneOS 28 | 29 | UIMainStoryboardFile 30 | MainStoryboard_iPhone 31 | UIMainStoryboardFile~ipad 32 | MainStoryboard_iPad 33 | UIRequiredDeviceCapabilities 34 | 35 | armv7 36 | 37 | UISupportedInterfaceOrientations 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationLandscapeLeft 41 | UIInterfaceOrientationLandscapeRight 42 | UIInterfaceOrientationPortraitUpsideDown 43 | 44 | UISupportedInterfaceOrientations~ipad 45 | 46 | UIInterfaceOrientationPortrait 47 | UIInterfaceOrientationPortraitUpsideDown 48 | UIInterfaceOrientationLandscapeLeft 49 | UIInterfaceOrientationLandscapeRight 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/speed_test.c: -------------------------------------------------------------------------------- 1 | /* xdelta3 - delta compression tools and library 2 | Copyright 2016 Joshua MacDonald 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #include "test.h" 18 | 19 | usize_t bench_speed(const uint8_t *from_buf, const size_t from_len, 20 | const uint8_t *to_buf, const size_t to_len, 21 | uint8_t *delta_buf, const size_t delta_alloc, 22 | int flags) { 23 | usize_t delta_size; 24 | int ret = xd3_encode_memory(to_buf, to_len, from_buf, from_len, 25 | delta_buf, &delta_size, delta_alloc, flags); 26 | if (ret != 0) { 27 | fprintf(stderr, "encode failure: %d: %s\n", ret, xd3_strerror(ret)); 28 | abort(); 29 | } 30 | return delta_size; 31 | } 32 | 33 | int main(int argc, char **argv) { 34 | int repeat, level; 35 | char *from, *to; 36 | uint8_t *from_buf = NULL, *to_buf = NULL, *delta_buf = NULL; 37 | size_t from_len = 0, to_len, delta_alloc, delta_size = 0; 38 | long start, finish; 39 | int i, ret; 40 | int flags; 41 | 42 | if (argc != 5) { 43 | fprintf(stderr, "usage: speed_test LEVEL COUNT FROM TO\n"); 44 | return 1; 45 | } 46 | 47 | level = atoi(argv[1]); 48 | repeat = atoi(argv[2]); 49 | from = argv[3]; 50 | to = argv[4]; 51 | flags = (level << XD3_COMPLEVEL_SHIFT) & XD3_COMPLEVEL_MASK; 52 | 53 | if ((strcmp(from, "null") != 0 && 54 | (ret = read_whole_file(from, &from_buf, &from_len))) || 55 | (ret = read_whole_file(to, &to_buf, &to_len))) { 56 | fprintf(stderr, "read_whole_file error\n"); 57 | goto exit; 58 | } 59 | 60 | delta_alloc = to_len * 11 / 10; 61 | delta_buf = main_malloc(delta_alloc); 62 | 63 | start = get_millisecs_now(); 64 | 65 | for (i = 0; i < repeat; ++i) { 66 | delta_size = bench_speed(from_buf, from_len, 67 | to_buf, to_len, delta_buf, delta_alloc, flags); 68 | } 69 | 70 | finish = get_millisecs_now(); 71 | 72 | fprintf(stderr, 73 | "STAT: encode %3.2f ms from %s to %s repeat %d %zdbit delta %zd\n", 74 | (double)(finish - start) / repeat, from, to, repeat, sizeof (xoff_t) * 8, delta_size); 75 | 76 | ret = 0; 77 | 78 | if (0) { 79 | exit: 80 | ret = 1; 81 | } 82 | 83 | main_free(to_buf); 84 | main_free(from_buf); 85 | main_free(delta_buf); 86 | return ret; 87 | } 88 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/examples/test.h: -------------------------------------------------------------------------------- 1 | /* xdelta3 - delta compression tools and library 2 | Copyright 2016 Joshua MacDonald 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | 17 | #define NOT_MAIN 1 18 | 19 | #include "xdelta3.h" 20 | #include "xdelta3.c" 21 | 22 | static int read_whole_file(const char *name, 23 | uint8_t **buf_ptr, 24 | size_t *buf_len) { 25 | main_file file; 26 | int ret; 27 | xoff_t len; 28 | usize_t nread; 29 | main_file_init(&file); 30 | file.filename = name; 31 | ret = main_file_open(&file, name, XO_READ); 32 | if (ret != 0) { 33 | fprintf(stderr, "open failed\n"); 34 | goto exit; 35 | } 36 | ret = main_file_stat(&file, &len); 37 | if (ret != 0) { 38 | fprintf(stderr, "stat failed\n"); 39 | goto exit; 40 | } 41 | 42 | (*buf_len) = (size_t)len; 43 | (*buf_ptr) = (uint8_t*) main_malloc(*buf_len); 44 | ret = main_file_read(&file, *buf_ptr, *buf_len, &nread, 45 | "read failed"); 46 | if (ret == 0 && *buf_len == nread) { 47 | ret = 0; 48 | } else { 49 | fprintf(stderr, "invalid read\n"); 50 | ret = XD3_INTERNAL; 51 | } 52 | exit: 53 | main_file_cleanup(&file); 54 | return ret; 55 | } 56 | 57 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/generate_build_files.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | aclocal && 4 | autoreconf --install && 5 | libtoolize && 6 | autoconf && 7 | automake --add-missing && 8 | automake 9 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/go/src/xdelta/rstream.go: -------------------------------------------------------------------------------- 1 | package xdelta 2 | 3 | 4 | import ( 5 | "io" 6 | "math/rand" 7 | ) 8 | 9 | const ( 10 | blocksize = 1<<17 11 | ) 12 | 13 | func (t *TestGroup) WriteRstreams(desc string, seed, offset, len int64, 14 | src, tgt io.WriteCloser) { 15 | t.Go("src-write:"+desc, func (g *Goroutine) { 16 | writeOne(g, seed, 0, len, tgt, false) 17 | }) 18 | t.Go("tgt-write:"+desc, func (g *Goroutine) { 19 | writeOne(g, seed, offset, len, src, true) 20 | }) 21 | } 22 | 23 | func writeOne(g *Goroutine, seed, offset, len int64, stream io.WriteCloser, readall bool) { 24 | if !readall { 25 | // Allow the source-read to fail or block until the process terminates. 26 | // This behavior is reserved for the decoder, which is not required to 27 | // read the entire source. 28 | g.OK() 29 | } 30 | if offset != 0 { 31 | // Fill with other random data until the offset 32 | if err := writeRand(g, rand.New(rand.NewSource(^seed)), offset, stream); err != nil { 33 | g.Panic(err) 34 | } 35 | } 36 | if err := writeRand(g, rand.New(rand.NewSource(seed)), 37 | len - offset, stream); err != nil { 38 | g.Panic(err) 39 | } 40 | if err := stream.Close(); err != nil { 41 | g.Panic(err) 42 | } 43 | g.OK() 44 | } 45 | 46 | func writeRand(g *Goroutine, r *rand.Rand, len int64, s io.Writer) error { 47 | blk := make([]byte, blocksize) 48 | for len > 0 { 49 | fillRand(r, blk) 50 | c := blocksize 51 | if len < blocksize { 52 | c = int(len) 53 | } 54 | if _, err := s.Write(blk[0:c]); err != nil { 55 | return err 56 | } 57 | len -= int64(c) 58 | } 59 | return nil 60 | } 61 | 62 | func fillRand(r *rand.Rand, blk []byte) { 63 | for p := 0; p < len(blk); { 64 | v := r.Int63() 65 | for i := 7; i != 0 && p < len(blk); i-- { 66 | blk[p] = byte(v) 67 | p++ 68 | v >>= 8 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/go/src/xdelta/run.go: -------------------------------------------------------------------------------- 1 | package xdelta 2 | 3 | import ( 4 | "fmt" 5 | "io" 6 | "io/ioutil" 7 | "os" 8 | "os/exec" 9 | ) 10 | 11 | type Program struct { 12 | Path string 13 | } 14 | 15 | type Run struct { 16 | Cmd exec.Cmd 17 | Srcfile string 18 | Stdin io.WriteCloser 19 | Srcin io.WriteCloser 20 | Stdout io.ReadCloser 21 | Stderr io.ReadCloser 22 | } 23 | 24 | type Runner struct { 25 | Testdir string 26 | } 27 | 28 | func (r *Run) Wait() error { 29 | return r.Cmd.Wait() 30 | } 31 | 32 | func NewRunner() (*Runner, error) { 33 | if dir, err := ioutil.TempDir(tmpDir, "xrt"); err != nil { 34 | return nil, err 35 | } else { 36 | return &Runner{dir}, nil 37 | } 38 | } 39 | 40 | func (r *Runner) newTestGroup(name string) (*TestGroup) { 41 | tg := &TestGroup{Runner: r} 42 | tg.WaitGroup.Add(1) 43 | g0 := &Goroutine{tg, name, false} 44 | tg.running = append(tg.running, g0) 45 | tg.main = g0 46 | return tg 47 | } 48 | 49 | func (r *Runner) Cleanup() { 50 | os.RemoveAll(r.Testdir) 51 | } 52 | 53 | func (r *Runner) RunTest(name string, f func (t *TestGroup)) { 54 | t := r.newTestGroup(name) 55 | c := make(chan interface{}) 56 | go func() { 57 | defer func() { 58 | rec := recover() 59 | c <- rec 60 | }() 61 | fmt.Println("Testing", name, "...") 62 | f(t) 63 | c <- nil 64 | }() 65 | rec := <- c 66 | if t.errors == nil && rec == nil { 67 | fmt.Println("Success:", name) 68 | } else { 69 | fmt.Println("FAILED:", name, t.errors, rec) 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/go/src/xdelta/tgroup.go: -------------------------------------------------------------------------------- 1 | package xdelta 2 | 3 | import ( 4 | "fmt" 5 | "runtime" 6 | "sync" 7 | ) 8 | 9 | type TestGroup struct { 10 | *Runner 11 | main *Goroutine 12 | sync.Mutex 13 | sync.WaitGroup 14 | running []*Goroutine 15 | errors []error 16 | nonerrors []error // For tolerated / expected conditions 17 | } 18 | 19 | type Goroutine struct { 20 | *TestGroup 21 | name string 22 | done bool 23 | } 24 | 25 | func (g *Goroutine) String() string { 26 | return fmt.Sprint("[", g.name, "]") 27 | } 28 | 29 | func (g *Goroutine) finish(err error) { 30 | wait := false 31 | tg := g.TestGroup 32 | sbuf := make([]byte, 4096) 33 | sbuf = sbuf[0:runtime.Stack(sbuf, false)] 34 | if err != nil { 35 | err = fmt.Errorf("%v:%v:%v", g.name, err, string(sbuf)) 36 | } 37 | tg.Lock() 38 | if g.done { 39 | if err != nil { 40 | tg.nonerrors = append(tg.nonerrors, err) 41 | } 42 | } else { 43 | wait = true 44 | g.done = true 45 | if err != nil { 46 | tg.errors = append(tg.errors, err) 47 | } 48 | } 49 | tg.Unlock() 50 | if wait { 51 | tg.WaitGroup.Done() 52 | } 53 | } 54 | 55 | func (g *Goroutine) OK() { 56 | g.finish(nil) 57 | } 58 | 59 | func (g *Goroutine) Panic(err error) { 60 | g.finish(err) 61 | if g != g.TestGroup.main { 62 | runtime.Goexit() 63 | } 64 | } 65 | 66 | func (t *TestGroup) Main() *Goroutine { return t.main } 67 | 68 | func (t *TestGroup) Panic(err error) { t.Main().Panic(err) } 69 | 70 | func (t *TestGroup) Go(name string, f func(*Goroutine)) *Goroutine { 71 | g := &Goroutine{t, name, false} 72 | t.Lock() 73 | t.WaitGroup.Add(1) 74 | t.running = append(t.running, g) 75 | t.Unlock() 76 | go f(g) 77 | return g 78 | } 79 | 80 | func (t *TestGroup) Wait(procs... *Run) { 81 | t.Main().OK() 82 | t.WaitGroup.Wait() 83 | for _, p := range procs { 84 | if err := p.Wait(); err != nil { 85 | t.errors = append(t.errors, err) 86 | } 87 | } 88 | for _, err := range t.errors { 89 | fmt.Println(":ERROR:", err) 90 | } 91 | for _, err := range t.nonerrors { 92 | fmt.Println("(ERROR)", err) 93 | } 94 | if len(t.errors) != 0 { 95 | t.Fail("Test failed with", len(t.errors), "errors") 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/linkxd3lib.c: -------------------------------------------------------------------------------- 1 | #include "xdelta3.h" 2 | 3 | extern int VVV; 4 | 5 | int VVV; 6 | 7 | void use(int r) 8 | { 9 | VVV = r; 10 | } 11 | 12 | int main() { 13 | xd3_config config; 14 | xd3_stream stream; 15 | xd3_source source; 16 | 17 | xd3_init_config (& config, 0); 18 | use (xd3_config_stream (&stream, &config)); 19 | use (xd3_close_stream (&stream)); 20 | xd3_abort_stream (&stream); 21 | xd3_free_stream (&stream); 22 | 23 | xd3_avail_input (& stream, NULL, 0); 24 | xd3_consume_output (& stream); 25 | 26 | use (xd3_set_source (& stream, & source)); 27 | xd3_set_flags (& stream, 0); 28 | 29 | use (xd3_decode_stream (& stream, NULL, 0, NULL, NULL, 0)); 30 | use (xd3_decode_input (&stream)); 31 | use (xd3_get_appheader (& stream, NULL, NULL)); 32 | 33 | #if XD3_ENCODER 34 | use (xd3_encode_input (&stream)); 35 | use (xd3_encode_stream (& stream, NULL, 0, NULL, NULL, 0)); 36 | use (xd3_set_appheader (& stream)); 37 | use (xd3_encoder_used_source (& stream)); 38 | use (xd3_encoder_srcbase (& stream)); 39 | use (xd3_encoder_srclen (& stream)); 40 | #endif 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/plot.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | G=/usr/bin/gnuplot 4 | 5 | D=./output_dir 6 | 7 | I=$1 8 | O=$D/$2 9 | 10 | $G > $O < 23 | #include 24 | #include 25 | 26 | #define CHECK_EQ(x,y) CHECK_OP(x,y,==) 27 | #define CHECK_NE(x,y) CHECK_OP(x,y,!=) 28 | #define CHECK_LT(x,y) CHECK_OP(x,y,<) 29 | #define CHECK_GT(x,y) CHECK_OP(x,y,>) 30 | #define CHECK_LE(x,y) CHECK_OP(x,y,<=) 31 | #define CHECK_GE(x,y) CHECK_OP(x,y,>=) 32 | 33 | #define CHECK_OP(x,y,OP) \ 34 | do { \ 35 | __typeof__(x) _x(x); \ 36 | __typeof__(x) _y(y); \ 37 | if (!(_x OP _y)) { \ 38 | cerr << __FILE__ << ":" << __LINE__ << " Check failed: " << #x " " #OP " " #y << endl; \ 39 | cerr << __FILE__ << ":" << __LINE__ << " {0} " << _x << endl; \ 40 | cerr << __FILE__ << ":" << __LINE__ << " {1} " << _y << endl; \ 41 | abort(); \ 42 | } } while (false) 43 | #undef CHECK 44 | #define CHECK(x) \ 45 | do {if (!(x)) { \ 46 | cerr << __FILE__ << ":" << __LINE__ << " Check failed: " << #x << endl; \ 47 | abort(); \ 48 | } } while (false) 49 | 50 | #define DCHECK(x) 51 | 52 | using std::string; 53 | 54 | #include 55 | using std::vector; 56 | 57 | inline string CommandToString(const vector &v) { 58 | string s(v[0]); 59 | for (size_t i = 1; i < v.size() && v[i] != NULL; i++) { 60 | s.append(" "); 61 | s.append(v[i]); 62 | } 63 | return s; 64 | } 65 | 66 | #include 67 | using std::cerr; 68 | using std::endl; 69 | using std::ostream; 70 | 71 | #include 72 | using std::map; 73 | using std::pair; 74 | 75 | #include 76 | using std::list; 77 | 78 | template 79 | pair make_pair(const T& t, const U& u) { 80 | return pair(t, u); 81 | } 82 | 83 | using std::min; 84 | using std::max; 85 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/xdelta3.i: -------------------------------------------------------------------------------- 1 | %module xdelta3 2 | %import cstring.i 3 | %import argcargv.i 4 | %{ 5 | #include "xdelta3.h" 6 | 7 | int xd3_main_cmdline (int ARGC, char **ARGV); 8 | %} 9 | 10 | %cstring_input_binary(const char *input, unsigned int input_size); 11 | %cstring_input_binary(const char *source, unsigned int source_size); 12 | 13 | %define %max_output_withsize(TYPEMAP, SIZE, MAXSIZE) 14 | %typemap(in) MAXSIZE (unsigned int alloc_size) { 15 | $1 = alloc_size = PyInt_AsLong(obj2); 16 | } 17 | %typemap(in,numinputs=0) (TYPEMAP, SIZE) { 18 | } 19 | %typemap(check) (TYPEMAP, SIZE) { 20 | // alloc_size input is #7th position in xd3_xxcode_memory() 21 | $1 = malloc(alloc_size7); 22 | $2 = &alloc_size7; 23 | } 24 | %typemap(argout,fragment="t_output_helper") (TYPEMAP, SIZE) { 25 | if (result == 0) { 26 | PyObject *o; 27 | // alloc_size7 now carries actual size 28 | o = PyString_FromStringAndSize($1,alloc_size7); 29 | $result = t_output_helper($result,o); 30 | } else { 31 | $result = t_output_helper($result,Py_None); 32 | } 33 | free($1); 34 | } 35 | %typemap(default) int flags { 36 | $1 = 0; 37 | } 38 | %enddef 39 | 40 | %max_output_withsize(char *output_buf, unsigned int *output_size, unsigned int max_output); 41 | 42 | int xd3_encode_memory (const uint8_t *input, 43 | usize_t input_size, 44 | const uint8_t *source, 45 | usize_t source_size, 46 | uint8_t *output_buffer, 47 | usize_t *output_size, 48 | usize_t avail_output, 49 | int flags); 50 | 51 | int xd3_decode_memory (const uint8_t *input, 52 | usize_t input_size, 53 | const uint8_t *source, 54 | usize_t source_size, 55 | uint8_t *output_buf, 56 | usize_t *output_size, 57 | usize_t avail_output, 58 | int flags); 59 | 60 | int xd3_main_cmdline (int ARGC, char **ARGV); 61 | 62 | /* Is this the right way? */ 63 | enum { 64 | /*XD3_JUST_HDR,*/ 65 | /*XD3_SKIP_WINDOW,*/ 66 | /*XD3_SKIP_EMIT,*/ 67 | /*XD3_FLUSH,*/ 68 | XD3_SEC_DJW, 69 | XD3_SEC_FGK, 70 | /*XD3_SEC_TYPE,*/ 71 | XD3_SEC_NODATA, 72 | XD3_SEC_NOINST, 73 | XD3_SEC_NOADDR, 74 | /*XD3_SEC_OTHER,*/ 75 | XD3_ADLER32, 76 | XD3_ADLER32_NOVER, 77 | XD3_NOCOMPRESS, 78 | XD3_BEGREEDY, 79 | XD3_COMPLEVEL_SHIFT, 80 | XD3_COMPLEVEL_MASK, 81 | XD3_COMPLEVEL_1, 82 | XD3_COMPLEVEL_3, 83 | XD3_COMPLEVEL_6, 84 | XD3_COMPLEVEL_9, 85 | }; 86 | -------------------------------------------------------------------------------- /source-code/dependencies/xdelta3/xdelta3.wxi: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /source-code/source/PD-Loader/PD-Loader.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Source Files 36 | 37 | 38 | -------------------------------------------------------------------------------- /source-code/source/fakedll/fakedll.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | Header Files 23 | 24 | 25 | Source Files 26 | 27 | 28 | 29 | 30 | Source Files 31 | 32 | 33 | 34 | 35 | Source Files 36 | 37 | 38 | -------------------------------------------------------------------------------- /source-code/source/fakedll/x64.def: -------------------------------------------------------------------------------- 1 | LIBRARY "dnsapi" 2 | EXPORTS 3 | DnsFree = _DnsFree 4 | DnsQuery_A = _DnsQuery_A 5 | DnsQueryEx = _DnsQueryEx 6 | DnsCancelQuery = _DnsCancelQuery 7 | DnsDhcpRegisterTerm = _DnsDhcpRegisterTerm 8 | DnsNotifyResolver = _DnsNotifyResolver 9 | DnsDhcpRegisterHostAddrs = _DnsDhcpRegisterHostAddrs 10 | DnsQueryConfigDword = _DnsQueryConfigDword 11 | DnsDhcpRemoveRegistrations = _DnsDhcpRemoveRegistrations 12 | DnsDhcpRegisterInit = _DnsDhcpRegisterInit 13 | DnsDhcpRegisterAddrs = _DnsDhcpRegisterAddrs 14 | DllCanUnloadNow = _DllCanUnloadNow PRIVATE 15 | DllGetClassObject = _DllGetClassObject PRIVATE 16 | DllRegisterServer = _DllRegisterServer PRIVATE 17 | DllUnregisterServer = _DllUnregisterServer PRIVATE -------------------------------------------------------------------------------- /source-code/source/plugins/DSCRemote/DSCRemote.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source-code/source/plugins/DSCRemote/framework.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | std::wstring ExePath() { 5 | WCHAR buffer[MAX_PATH]; 6 | GetModuleFileNameW(NULL, buffer, MAX_PATH); 7 | return std::wstring(buffer); 8 | } 9 | 10 | std::wstring DirPath() { 11 | std::wstring exepath = ExePath(); 12 | std::wstring::size_type pos = exepath.find_last_of(L"\\/"); 13 | return exepath.substr(0, pos); 14 | } 15 | 16 | std::wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\DSCRemote.ini"; 17 | LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str(); 18 | -------------------------------------------------------------------------------- /source-code/source/plugins/DivaMovie/DivaMovie.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source-code/source/plugins/DivaMovie/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | std::wstring ExePath() { 11 | WCHAR buffer[MAX_PATH]; 12 | GetModuleFileNameW(NULL, buffer, MAX_PATH); 13 | return std::wstring(buffer); 14 | } 15 | 16 | std::wstring DirPath() { 17 | std::wstring exepath = ExePath(); 18 | std::wstring::size_type pos = exepath.find_last_of(L"\\/"); 19 | return exepath.substr(0, pos); 20 | } 21 | 22 | std::wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\DivaMovie.ini"; 23 | LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str(); 24 | 25 | std::wstring MASTER_CONFIG_FILE_STRING = DirPath() + L"\\plugins\\config.ini"; 26 | LPCWSTR MASTER_CONFIG_FILE = MASTER_CONFIG_FILE_STRING.c_str(); 27 | 28 | #define PRINT(value, ...) if (debug) printf(value, __VA_ARGS__); 29 | 30 | #define PROC_ADDRESS(libraryName, procName) \ 31 | GetProcAddress(LoadLibrary(TEXT(libraryName)), procName) 32 | 33 | #define SAFE_RELEASE(object) if (object) { object->Release(); object = NULL; } 34 | 35 | #define VTABLE_HOOK(returnType, className, functionName, ...) \ 36 | typedef returnType functionName(className* This, __VA_ARGS__); \ 37 | functionName* original##functionName; \ 38 | returnType implOf##functionName(className* This, __VA_ARGS__) 39 | 40 | #define INSTALL_VTABLE_HOOK(object, functionName, functionIndex) \ 41 | { \ 42 | void** addr = &(*(void***)object)[functionIndex]; \ 43 | if (*addr != implOf##functionName) \ 44 | { \ 45 | PRINT("[DivaMovie] Installing %s hook...\n", #functionName); \ 46 | original##functionName = (functionName*)*addr; \ 47 | DWORD oldProtect; \ 48 | VirtualProtect(addr, sizeof(void*), PAGE_EXECUTE_READWRITE, &oldProtect); \ 49 | *addr = implOf##functionName; \ 50 | VirtualProtect(addr, sizeof(void*), oldProtect, NULL); \ 51 | } \ 52 | } 53 | 54 | #define HOOK(returnType, function, location, ...) \ 55 | typedef returnType function(__VA_ARGS__); \ 56 | function* original##function = (function*)location; \ 57 | returnType implOf##function(__VA_ARGS__) 58 | 59 | #define INSTALL_HOOK(functionName) \ 60 | { \ 61 | PRINT("[DivaMovie] Installing %s hook...\n", #functionName); \ 62 | DetourTransactionBegin(); \ 63 | DetourUpdateThread(GetCurrentThread()); \ 64 | DetourAttach((void**)&original##functionName, implOf##functionName); \ 65 | DetourTransactionCommit(); \ 66 | } 67 | 68 | #define ASSERT(function) \ 69 | if (FAILED(result = (function))) \ 70 | { \ 71 | PRINT("[DivaMovie] %s failed (error code: 0x%08x)\n", #function, (unsigned int)result); \ 72 | goto end; \ 73 | } /*\ 74 | else \ 75 | { \ 76 | PRINT("[DivaMovie] %s succeeded\n", #function); \ 77 | }*/ 78 | -------------------------------------------------------------------------------- /source-code/source/plugins/DivaSound/DivaSound.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/DivaSound/bassasio/bassasio.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/DivaSound/bassasio/bassasio.lib -------------------------------------------------------------------------------- /source-code/source/plugins/DivaWig/DivaWig.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /source-code/source/plugins/DivaWig/framework.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | std::wstring ExePath() { 5 | WCHAR buffer[MAX_PATH]; 6 | GetModuleFileNameW(NULL, buffer, MAX_PATH); 7 | return std::wstring(buffer); 8 | } 9 | 10 | std::wstring DirPath() { 11 | std::wstring exepath = ExePath(); 12 | std::wstring::size_type pos = exepath.find_last_of(L"\\/"); 13 | return exepath.substr(0, pos); 14 | } 15 | 16 | std::wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\DivaWig.ini"; 17 | LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str(); 18 | -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/FeelsThinkMan.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/FeelsThinkMan.gif -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/Help.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/Help.png -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/IniReader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // kinda rushed and hacky wrapper around simpleini for use by ConfigOption 4 | // (has a similar API to windows GetPrivateProfile/SetPrivateProfile stuff) 5 | 6 | #include 7 | CSimpleIniW ini_reader; 8 | std::wstring loaded_ini_file; 9 | 10 | bool LoadIni(const wchar_t* filename, bool use_utf8=false) 11 | { 12 | if (ini_reader.IsUnicode() == use_utf8 && loaded_ini_file == filename) 13 | { 14 | return true; 15 | } 16 | 17 | ini_reader.Reset(); 18 | ini_reader.SetUnicode(use_utf8); 19 | 20 | if (ini_reader.LoadFile(filename) != 0) 21 | { 22 | // if the path doesn't exist, this isn't an error so we can still save filename and return true 23 | // (writing config will create the file) 24 | DWORD dwAttrib = GetFileAttributesW(filename); 25 | if (dwAttrib == INVALID_FILE_ATTRIBUTES) 26 | { 27 | loaded_ini_file = filename; 28 | return true; 29 | } 30 | 31 | loaded_ini_file = L""; 32 | return false; 33 | } 34 | else 35 | { 36 | loaded_ini_file = filename; 37 | return true; 38 | } 39 | } 40 | 41 | const wchar_t* GetIniString(const wchar_t* section, const wchar_t* key, const wchar_t* default, const wchar_t* filename, bool use_utf8) 42 | { 43 | if (!LoadIni(filename, use_utf8)) 44 | { 45 | return default; 46 | } 47 | 48 | return ini_reader.GetValue(section, key, default); 49 | } 50 | 51 | int GetIniInt(const wchar_t* section, const wchar_t* key, int default, const wchar_t* filename) 52 | { 53 | if (!LoadIni(filename)) 54 | { 55 | return default; 56 | } 57 | 58 | return ini_reader.GetLongValue(section, key, default); 59 | } 60 | 61 | bool GetIniBool(const wchar_t* section, const wchar_t* key, bool default, const wchar_t* filename) 62 | { 63 | if (!LoadIni(filename)) 64 | { 65 | return default; 66 | } 67 | 68 | return ini_reader.GetBoolValue(section, key, default); 69 | } 70 | 71 | void SetIniString(const wchar_t* section, const wchar_t* key, const wchar_t* value, const wchar_t* filename, bool use_utf8) 72 | { 73 | if (!LoadIni(filename, use_utf8)) 74 | { 75 | return; 76 | } 77 | 78 | ini_reader.SetValue(section, key, value); 79 | ini_reader.SaveFile(filename); 80 | } 81 | 82 | void SetIniInt(const wchar_t* section, const wchar_t* key, int value, const wchar_t* filename) 83 | { 84 | if (!LoadIni(filename)) 85 | { 86 | return; 87 | } 88 | 89 | ini_reader.SetLongValue(section, key, value); 90 | ini_reader.SaveFile(filename); 91 | } 92 | 93 | void SetIniBool(const wchar_t* section, const wchar_t* key, bool value, const wchar_t* filename, bool use_string) 94 | { 95 | if (!LoadIni(filename)) 96 | { 97 | return; 98 | } 99 | 100 | if (use_string) 101 | ini_reader.SetValue(section, key, value ? L"true" : L"false"); 102 | else 103 | ini_reader.SetValue(section, key, value ? L"1" : L"0"); 104 | 105 | ini_reader.SaveFile(filename); 106 | } -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/Launcher.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 6 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 7 | 8 | 9 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 10 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 11 | 12 | 13 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 14 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | Header Files 28 | 29 | 30 | -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/PokeSnarf4xd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/PokeSnarf4xd.png -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/PokeWhat4xvc2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/PokeWhat4xvc2.png -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/TabPadding.cpp: -------------------------------------------------------------------------------- 1 | #include "TabPadding.h" 2 | //#include 3 | 4 | // ported from https://stackoverflow.com/a/7785745 5 | // original code by user LarsTech https://stackoverflow.com/users/719186/larstech 6 | 7 | TabPadding::TabPadding(TabControl^ tc) 8 | { 9 | tabControl = tc; 10 | tabControl->Selected += gcnew TabControlEventHandler(this, &TabPadding::tabControl_Selected); 11 | AssignHandle(tc->Handle); 12 | } 13 | 14 | void TabPadding::tabControl_Selected(Object^ sender, TabControlEventArgs^ e) 15 | { 16 | tabControl->Invalidate(); 17 | } 18 | 19 | void TabPadding::WndProc(Message %m) { 20 | NativeWindow::WndProc(m); 21 | 22 | if (m.Msg == 15) { //WM_PAINT 23 | Graphics^ g = Graphics::FromHwnd(m.HWnd); 24 | 25 | //Replace the outside white borders: 26 | if (tabControl->Parent) { 27 | g->SetClip(System::Drawing::Rectangle(0, 0, tabControl->Width - 2, tabControl->Height - 1), Drawing2D::CombineMode::Exclude); 28 | g->FillRectangle(gcnew SolidBrush(tabControl->Parent->BackColor), 29 | System::Drawing::Rectangle(0, tabControl->ItemSize.Height + 2, tabControl->Width, tabControl->Height - (tabControl->ItemSize.Height + 2))); 30 | } 31 | 32 | 33 | //Replace the inside white borders: 34 | if (tabControl->SelectedTab) { 35 | g->ResetClip(); 36 | System::Drawing::Rectangle r = tabControl->SelectedTab->Bounds; 37 | g->SetClip(r, Drawing2D::CombineMode::Exclude); 38 | g->FillRectangle(gcnew SolidBrush(tabControl->SelectedTab->BackColor), 39 | System::Drawing::Rectangle(r.Left - 3, r.Top - 1, r.Width + 4, r.Height + 3)); 40 | } 41 | 42 | delete g; 43 | } 44 | } -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/TabPadding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | using namespace System::Windows::Forms; 3 | using namespace System::Drawing; 4 | 5 | // ported from https://stackoverflow.com/a/7785745 6 | // original code by user LarsTech https://stackoverflow.com/users/719186/larstech 7 | 8 | ref class TabPadding : public NativeWindow 9 | { 10 | public: 11 | TabPadding(TabControl^ tc); 12 | 13 | private: 14 | TabControl^ tabControl; 15 | void tabControl_Selected(Object^ sender, TabControlEventArgs^ e); 16 | 17 | protected: 18 | virtual void WndProc(Message %m) override; 19 | }; -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "ui.h" 2 | #include "framework.h" 3 | #include 4 | #pragma comment(lib, "detours.lib") 5 | 6 | using namespace System; 7 | using namespace System::Windows::Forms; 8 | 9 | [STAThread] 10 | int showUI() { 11 | SetProcessDPIAware(); 12 | Application::EnableVisualStyles(); 13 | Application::SetCompatibleTextRenderingDefault(false); 14 | Application::Run(gcnew Launcher::ui()); 15 | return 0; 16 | } 17 | 18 | int hookedMain(int argc, const char** argv, const char** envp) 19 | { 20 | for (int i = 0; i < argc; ++i) 21 | { 22 | arg = argv[i]; 23 | if (arg == "--launch" || nSkipLauncher) 24 | return divaMain(argc, argv, envp); 25 | } 26 | return showUI(); 27 | } 28 | 29 | BOOL APIENTRY DllMain(HMODULE hModule, 30 | DWORD ul_reason_for_call, 31 | LPVOID lpReserved 32 | ) 33 | { 34 | if (ul_reason_for_call == DLL_PROCESS_ATTACH) 35 | { 36 | DisableThreadLibraryCalls(hModule); 37 | DetourTransactionBegin(); 38 | DetourUpdateThread(GetCurrentThread()); 39 | DetourAttach(&(PVOID&)divaMain, hookedMain); 40 | DetourTransactionCommit(); 41 | } 42 | return TRUE; 43 | } -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/notabug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/notabug.png -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/pdloader2bge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/pdloader2bge.png -------------------------------------------------------------------------------- /source-code/source/plugins/Launcher/pdloader2ico.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PDModdingCommunity/PD-Loader/ef43d226865a3a5d7d785cca4d3ed2f7f51eec05/source-code/source/plugins/Launcher/pdloader2ico.ico -------------------------------------------------------------------------------- /source-code/source/plugins/Novidia/Novidia.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | -------------------------------------------------------------------------------- /source-code/source/plugins/Novidia/src/crc/crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** CRC.H - header file for SNIPPETS CRC and checksum functions 3 | */ 4 | 5 | #ifndef CRC__H 6 | #define CRC__H 7 | 8 | #include /* For size_t */ 9 | #include "sniptype.h" /* For BYTE, WORD, DWORD */ 10 | 11 | /* 12 | ** File: ARCCRC16.C 13 | */ 14 | 15 | void init_crc_table(void); 16 | WORD crc_calc(WORD crc, char *buf, unsigned nbytes); 17 | void do_file(char *fn); 18 | 19 | /* 20 | ** File: CRC-16.C 21 | */ 22 | 23 | WORD crc16(char *data_p, WORD length); 24 | 25 | /* 26 | ** File: CRC-16F.C 27 | */ 28 | 29 | WORD updcrc(WORD icrc, BYTE *icp, size_t icnt); 30 | 31 | /* 32 | ** File: CRC_32.C 33 | */ 34 | 35 | #define UPDC32(octet,crc) (crc_32_tab[((crc)\ 36 | ^ ((BYTE)octet)) & 0xff] ^ ((crc) >> 8)) 37 | 38 | DWORD updateCRC32(unsigned char ch, DWORD crc); 39 | Boolean_T crc32file(char *name, DWORD *crc, long *charcnt); 40 | DWORD crc32buf(char *buf, size_t len); 41 | 42 | /* 43 | ** File: CHECKSUM.C 44 | */ 45 | 46 | unsigned checksum(void *buffer, size_t len, unsigned int seed); 47 | 48 | /* 49 | ** File: CHECKEXE.C 50 | */ 51 | 52 | void checkexe(char *fname); 53 | 54 | 55 | 56 | #endif /* CRC__H */ -------------------------------------------------------------------------------- /source-code/source/plugins/Novidia/src/crc/sniptype.h: -------------------------------------------------------------------------------- 1 | /* 2 | ** SNIPTYPE.H - Include file for SNIPPETS data types and commonly used macros 3 | */ 4 | 5 | #ifndef SNIPTYPE__H 6 | #define SNIPTYPE__H 7 | 8 | #include /* For free() */ 9 | #include /* For NULL & strlen() */ 10 | 11 | typedef enum {Error_ = -1, Success_, False_ = 0, True_} Boolean_T; 12 | 13 | #if defined(__unix__) 14 | typedef unsigned char BYTE; 15 | typedef unsigned long DWORD; 16 | typedef unsigned short WORD; 17 | #if !defined(FAR) 18 | #define FAR 19 | #endif 20 | #if !defined(NEAR) 21 | #define NEAR 22 | #endif 23 | #if !defined(HUGE) 24 | #define HUGE 25 | #endif 26 | #if !defined(PASCAL) 27 | #define PASCAL 28 | #endif 29 | #if !defined(CDECL) 30 | #define CDECL 31 | #endif 32 | #if !defined(INTERRUPT) 33 | #define INTERRUPT 34 | #endif 35 | #elif !defined(WIN32) && !defined(_WIN32) && !defined(__NT__) \ 36 | && !defined(_WINDOWS) 37 | #if !defined(OS2) 38 | typedef unsigned char BYTE; 39 | typedef unsigned long DWORD; 40 | #endif 41 | typedef unsigned short WORD; 42 | #else 43 | #define WIN32_LEAN_AND_MEAN 44 | #define NOGDI 45 | #define NOSERVICE 46 | #undef INC_OLE1 47 | #undef INC_OLE2 48 | #include 49 | #define HUGE 50 | #endif 51 | 52 | typedef union { 53 | signed char c; 54 | BYTE b; 55 | } VAR8_; 56 | 57 | typedef union { 58 | VAR8_ v8[2]; 59 | signed short s; 60 | WORD w; 61 | } VAR16_; 62 | 63 | typedef union { 64 | VAR16_ v16[2]; 65 | signed long l; 66 | DWORD dw; 67 | float f; 68 | void *p; 69 | } VAR32_; 70 | 71 | typedef union { 72 | VAR32_ v32[2]; 73 | double d; 74 | } VAR64_; 75 | 76 | #define NUL '\0' 77 | #define LAST_CHAR(s) (((char *)s)[strlen(s) - 1]) 78 | #define TOBOOL(x) (!(!(x))) 79 | #define FREE(p) (free(p),(p)=NULL) 80 | 81 | #endif /* SNIPTYPE__H */ -------------------------------------------------------------------------------- /source-code/source/plugins/Patches/PatchApplier.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // PatchApplier provides the stuff for implementing patches for the specific game version 4 | class PatchApplier { 5 | public: 6 | virtual void ApplyPatches() {}; 7 | }; -------------------------------------------------------------------------------- /source-code/source/plugins/Patches/Patches.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | Source Files 23 | 24 | 25 | 26 | 27 | Header Files 28 | 29 | 30 | Header Files 31 | 32 | 33 | Header Files 34 | 35 | 36 | Header Files 37 | 38 | 39 | Header Files 40 | 41 | 42 | Header Files 43 | 44 | 45 | Header Files 46 | 47 | 48 | -------------------------------------------------------------------------------- /source-code/source/plugins/Patches/databank.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #include "databank.h" 5 | 6 | namespace Databank 7 | { 8 | struct PvEntry 9 | { 10 | int unk1 = 1; 11 | std::string advStart, advEnd, start, end; 12 | }; 13 | 14 | class PvList 15 | { 16 | protected: 17 | std::map, PvEntry> entries; 18 | 19 | public: 20 | bool readFromStr(std::string& str); 21 | bool readFromFile(const std::string& filename); 22 | void addEntry(int id, int extra, PvEntry& entry); 23 | void generateMissingEntries(); 24 | std::string finalize(); 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/Patches/storage.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace Storage 5 | { 6 | struct FileRecord 7 | { 8 | union 9 | { 10 | void* pData; // used if allocSize is >= 16 11 | char inlineData[16]; // used if allocSize is < 16; [8-15] not normally cleared when expanded 12 | }; 13 | uint64_t dataLength = 0; 14 | uint64_t allocSize = 15; 15 | }; 16 | 17 | //void(__fastcall* divaAddStringContainer)(void*, void**) = (void(__fastcall*)(void* container, void** src))0x01400C0A40; 18 | 19 | void customAddStringContainer(void* container, const char* str) 20 | { 21 | uint64_t addr = (uint64_t)container; 22 | 23 | while (*(uint64_t*)addr != 0) 24 | { 25 | addr += sizeof(FileRecord); 26 | } 27 | 28 | FileRecord* record = (FileRecord*)addr; 29 | size_t length = strlen(str) + 1; 30 | 31 | if (length > 0 && length < 16) 32 | { 33 | memcpy_s(record->inlineData, length, str, length); 34 | record->dataLength = length; 35 | record->allocSize = 0; 36 | } 37 | else if (length >= 16) 38 | { 39 | char* alloc = (char*)malloc(length); 40 | memcpy_s(alloc, length, str, length); 41 | record->pData = alloc; 42 | record->dataLength = length; 43 | record->allocSize = length; 44 | } 45 | } 46 | }; -------------------------------------------------------------------------------- /source-code/source/plugins/Patches/urlutil.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | std::string urlDecode(const std::string& encoded) 7 | { 8 | std::string decoded; 9 | char ch; 10 | for (size_t i = 0; i < encoded.length(); i++) 11 | { 12 | if (encoded[i] == '%') 13 | { 14 | if (i + 2 < encoded.length()) 15 | { 16 | std::string hex = encoded.substr(i + 1, 2); 17 | ch = static_cast(std::strtol(hex.c_str(), nullptr, 16)); 18 | decoded.push_back(ch); 19 | i += 2; 20 | } 21 | else 22 | { 23 | decoded.push_back('%'); 24 | } 25 | } 26 | else if (encoded[i] == '+') 27 | { 28 | decoded.push_back(' '); 29 | } 30 | else 31 | { 32 | decoded.push_back(encoded[i]); 33 | } 34 | } 35 | return decoded; 36 | } 37 | 38 | std::string urlEncode(const std::string& str) 39 | { 40 | std::ostringstream escaped; 41 | escaped.fill('0'); 42 | escaped << std::hex; 43 | 44 | for (unsigned char c : str) 45 | { 46 | if (std::isalnum(c) || c == '-' || c == '_' || c == '.' || c == '~') 47 | { 48 | escaped << c; 49 | } 50 | else 51 | { 52 | escaped << '%' << std::setw(2) << std::uppercase << static_cast(c); 53 | } 54 | } 55 | return escaped.str(); 56 | } 57 | -------------------------------------------------------------------------------- /source-code/source/plugins/Render/Render.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Header Files 20 | 21 | 22 | 23 | 24 | Source Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/Render/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers 4 | // Windows Header Files 5 | #include 6 | #include 7 | 8 | static int(__cdecl* divaCreateWindow_710)(const char* title, void(__cdecl* exitfunc)(int)) = (int(__cdecl*)(const char* title, void(__cdecl * exitfunc)(int)))0x140194D00; 9 | void(__fastcall* divaInitRender_710)(int ssaa, int hd_res, int ss_alpha_mask, __int8 npr) = (void(__fastcall *)(int ssaa, int hd_res, int ss_alpha_mask, __int8 npr))0x0000000140502A10; 10 | //__int64 (__fastcall* divaParseParameters_710)(int a1, __int64* a2) = (__int64(__fastcall*)(int a1, __int64* a2))0x140193630; 11 | __int64(__fastcall* divaEngineUpdate_710)(__int64 a1) = (__int64(__fastcall*)(__int64 a1))0x140194CD0; 12 | 13 | uint8_t* fullScreenFlag_710 = (uint8_t*)0x140EDA5D1; 14 | //DWORD* resolutionType_710 = (DWORD*)0x140EDA5D4; 15 | 16 | 17 | static int(__cdecl* divaCreateWindow_600)(const char* title, void(__cdecl* exitfunc)(int)) = (int(__cdecl*)(const char* title, void(__cdecl * exitfunc)(int)))0x14018CD00; 18 | __int64(__fastcall* divaParseParameters_600)(int a1, __int64* a2) = (__int64(__fastcall*)(int a1, __int64* a2))0x14018B660; 19 | __int64(__fastcall* divaEngineUpdate_600)(__int64 a1) = (__int64(__fastcall*)(__int64 a1))0x14018CCD0; 20 | 21 | uint8_t* fullScreenFlag_600 = (uint8_t*)0x140E8DE41; 22 | DWORD* resolutionType_600 = (DWORD*)0x140E8DE44; 23 | 24 | using namespace std; 25 | 26 | wstring DirPath() { 27 | WCHAR buffer[MAX_PATH]; 28 | GetModuleFileNameW(NULL, buffer, MAX_PATH); 29 | wstring::size_type pos = wstring(buffer).find_last_of(L"\\/"); 30 | return wstring(buffer).substr(0, pos); 31 | } 32 | 33 | wstring CONFIG_FILE_STRING = DirPath() + L"\\plugins\\config.ini"; 34 | LPCWSTR CONFIG_FILE = CONFIG_FILE_STRING.c_str(); 35 | 36 | int nDisplay = GetPrivateProfileIntW(L"resolution", L"display", 0, CONFIG_FILE); 37 | int nWidth = GetPrivateProfileIntW(L"resolution", L"width", 1280, CONFIG_FILE); 38 | int nHeight = GetPrivateProfileIntW(L"resolution", L"height", 720, CONFIG_FILE); 39 | 40 | int nIntRes = GetPrivateProfileIntW(L"resolution", L"r.enable", FALSE, CONFIG_FILE); 41 | int nIntResWidth = GetPrivateProfileIntW(L"resolution", L"r.width", 1280, CONFIG_FILE); 42 | int nIntResHeight = GetPrivateProfileIntW(L"resolution", L"r.height", 720, CONFIG_FILE); 43 | 44 | int nBitDepth = GetPrivateProfileIntW(L"resolution", L"bitdepth", 32, CONFIG_FILE); 45 | int nRefreshRate = GetPrivateProfileIntW(L"resolution", L"refreshrate", 60, CONFIG_FILE); 46 | 47 | int nFpsLimit = GetPrivateProfileIntW(L"graphics", L"fps.limit", 60, CONFIG_FILE); 48 | int nUseLightLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.lightmode", TRUE, CONFIG_FILE); 49 | int nVerboseLimiter = GetPrivateProfileIntW(L"graphics", L"fps.limit.verbose", FALSE, CONFIG_FILE); 50 | 51 | // used to trick Optimus into switching to the NVIDIA GPU 52 | HMODULE nvcudaModule = LoadLibraryW(L"nvcuda.dll"); 53 | // cuInit actually returns a CUresult, but we don't really care about it 54 | void(WINAPI * cuInit)(unsigned int flags) = (void(WINAPI*)(unsigned int flags))GetProcAddress(nvcudaModule, "cuInit"); 55 | -------------------------------------------------------------------------------- /source-code/source/plugins/ShaderPatch/ShaderPatch.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/CameraController.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include "../Constants.h" 4 | #include "../Input/Bindings/Binding.h" 5 | #include "../Utilities/Math.h" 6 | 7 | namespace TLAC::Components 8 | { 9 | struct Camera 10 | { 11 | Utilities::Vec3 Position; 12 | Utilities::Vec3 Focus; 13 | float Rotation; 14 | float HorizontalFov; 15 | float VerticalFov; 16 | }; 17 | 18 | class CameraController : public EmulatorComponent 19 | { 20 | public: 21 | Input::Binding* ToggleBinding; 22 | 23 | Input::Binding* ForwardBinding; 24 | Input::Binding* BackwardBinding; 25 | Input::Binding* LeftBinding; 26 | Input::Binding* RightBinding; 27 | 28 | Input::Binding* UpBinding; 29 | Input::Binding* DownBinding; 30 | Input::Binding* FastBinding; 31 | Input::Binding* SlowBinding; 32 | 33 | Input::Binding* ClockwiseBinding; 34 | Input::Binding* CounterClockwiseBinding; 35 | 36 | Input::Binding* ZoomInBinding; 37 | Input::Binding* ZoomOutBinding; 38 | 39 | CameraController(); 40 | ~CameraController(); 41 | 42 | virtual const char* GetDisplayName() override; 43 | 44 | virtual void Initialize(ComponentsManager*) override; 45 | virtual void Update() override; 46 | virtual void UpdateInput() override; 47 | 48 | void SetControls(bool value); 49 | 50 | bool GetIsEnabled(); 51 | 52 | private: 53 | const float fastSpeed = 0.1f; 54 | const float slowSpeed = 0.0005f; 55 | const float normalSpeed = 0.005f; 56 | 57 | const float defaultRotation = 0.0f; 58 | const float defaultFov = 70.0f; 59 | const float sensitivity = 0.25f; 60 | 61 | ComponentsManager* componentsManager; 62 | float verticalRotation; 63 | float horizontalRotation; 64 | 65 | bool isEnabled; 66 | Camera* camera; 67 | 68 | uint8_t originalSetterBytes[4]; 69 | void* cameraSetterAddresses[4] = 70 | { 71 | (void*)CAMERA_POS_SETTER_ADDRESS, 72 | (void*)CAMERA_INTR_SETTER_ADDRESS, 73 | (void*)CAMERA_ROT_SETTER_ADDRESS, 74 | (void*)CAMERA_PERS_SETTER_ADDRESS, 75 | }; 76 | 77 | void SetMouseWindowCenter(); 78 | void SetIsEnabled(bool value); 79 | }; 80 | } 81 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/ComponentsManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include "../Utilities/Stopwatch.h" 4 | #include 5 | #include 6 | 7 | namespace TLAC::Components 8 | { 9 | const std::string COMPONENTS_CONFIG_FILE_NAME = "components.ini"; 10 | 11 | // Incomplete type 12 | struct DwGuiDisplay 13 | { 14 | void* vftable; 15 | void* active; 16 | void* cap; 17 | void* on; 18 | void* move; 19 | void* widget; 20 | }; 21 | 22 | class ComponentsManager 23 | { 24 | public: 25 | ComponentsManager(); 26 | ~ComponentsManager(); 27 | void Initialize(); 28 | void Update(); 29 | void UpdateInput(); 30 | void UpdatePostInput(); 31 | void UpdateDraw2D(); 32 | void OnFocusGain(); 33 | void OnFocusLost(); 34 | void Dispose(); 35 | 36 | inline bool GetIsInputEmulatorUsed() { return isInputEmulatorUsed; }; 37 | inline void SetIsInputEmulatorUsed(bool value) { isInputEmulatorUsed = value; }; 38 | 39 | inline bool GetUpdateGameInput() { return updateGameInput; }; 40 | inline void SetUpdateGameInput(bool value) { updateGameInput = value; } 41 | 42 | inline bool IsDwGuiActive() { return dwGuiDisplay->active != nullptr; }; 43 | inline bool IsDwGuiHovered() { return dwGuiDisplay->on != nullptr; }; 44 | 45 | private: 46 | DwGuiDisplay* dwGuiDisplay; 47 | 48 | bool isInputEmulatorUsed = false; 49 | bool updateGameInput = true; 50 | 51 | float elpasedTime; 52 | Utilities::Stopwatch updateStopwatch; 53 | std::vector components; 54 | 55 | void ParseAddComponents(); 56 | }; 57 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/CustomPlayerData.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace TLAC::Components 6 | { 7 | struct CustomPlayerData 8 | { 9 | std::string *PlayerName; 10 | std::string* LevelName; 11 | int VocaloidPoints; 12 | int LevelNum; 13 | int LevelPlateId; 14 | int LevelPlateEffect; 15 | int SkinEquip; 16 | int BtnSeEquip; 17 | int SlideSeEquip; 18 | int ChainslideSeEquip; 19 | int SlidertouchSeEquip; 20 | int ModuleEquip0; 21 | int ModuleEquip1; 22 | int ModuleEquip2; 23 | int ModuleEquip3; 24 | int ModuleEquip4; 25 | int ModuleEquip5; 26 | int ModuleEquipCmn0; 27 | int ModuleEquipCmn1; 28 | int ModuleEquipCmn2; 29 | int ModuleEquipCmn3; 30 | int ModuleEquipCmn4; 31 | int ModuleEquipCmn5; 32 | int ActionVol; 33 | int ActionSlideVol; 34 | int UsePVEquip; 35 | int UsePVSFXEquip; 36 | int UsePVSkinEquip; 37 | bool ShowGreatClearBorder; 38 | bool ShowExcellentClearBorder; 39 | bool ShowRivalClearBorder; 40 | bool UseCard; 41 | bool GameModifierOptions; 42 | bool ActionSE; 43 | std::vector Mylist[3]; 44 | }; 45 | } 46 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/DebugComponent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include "GameState.h" 4 | #include "../Input/Keyboard/Keyboard.h" 5 | 6 | namespace TLAC::Components 7 | { 8 | class DebugComponent : public EmulatorComponent 9 | { 10 | public: 11 | DebugComponent(); 12 | ~DebugComponent(); 13 | 14 | virtual const char* GetDisplayName() override; 15 | 16 | virtual void Initialize(ComponentsManager*) override; 17 | virtual void Update() override; 18 | virtual void UpdateInput() override; 19 | 20 | private: 21 | const float aetSpeedUpFactor = 4.0f; 22 | 23 | bool dataTestMain = false; 24 | bool printDataTestMain = false; 25 | int selectionIndex = SUB_DATA_TEST_MISC; 26 | 27 | const struct { BYTE KeyCode; GameState State; } gameStateKeyMappings[5] = 28 | { 29 | { VK_F4, GS_ADVERTISE }, 30 | { VK_F5, GS_GAME }, 31 | { VK_F6, GS_DATA_TEST }, 32 | { VK_F7, GS_TEST_MODE }, 33 | { VK_F8, GS_APP_ERROR }, 34 | }; 35 | 36 | void InjectPatches(); 37 | void SetConsoleForeground(); 38 | void PrintDataTestMain(); 39 | void InternalChangeGameState(GameState state); 40 | void UpdateDataTestMain(); 41 | void InjectCode(void* address, const std::initializer_list &data); 42 | }; 43 | } 44 | 45 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/EmulatorComponent.cpp: -------------------------------------------------------------------------------- 1 | #include "EmulatorComponent.h" 2 | #include "../Constants.h" 3 | 4 | namespace TLAC::Components 5 | { 6 | EmulatorComponent::EmulatorComponent() 7 | { 8 | } 9 | 10 | EmulatorComponent::~EmulatorComponent() 11 | { 12 | } 13 | 14 | void EmulatorComponent::SetElapsedTime(float value) 15 | { 16 | elapsedTime = value; 17 | } 18 | 19 | float EmulatorComponent::GetElapsedTime() 20 | { 21 | return elapsedTime == 0.0f ? (1000.0f / 60.0f) : elapsedTime; 22 | } 23 | 24 | float EmulatorComponent::GetFrameRate() 25 | { 26 | return 1000.0f / GetElapsedTime(); 27 | } 28 | 29 | float EmulatorComponent::GetGameFrameRate() 30 | { 31 | return *(float*)FRAME_RATE_ADDRESS; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/EmulatorComponent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | class ComponentsManager; 6 | 7 | class EmulatorComponent 8 | { 9 | public: 10 | EmulatorComponent(); 11 | ~EmulatorComponent(); 12 | 13 | virtual const char* GetDisplayName() = 0; 14 | 15 | virtual void Initialize(ComponentsManager*) = 0; 16 | virtual void Update() = 0; 17 | 18 | virtual void UpdateInput() {}; 19 | virtual void UpdatePostInput() {}; 20 | virtual void UpdateDraw2D() {}; 21 | virtual void OnFocusGain() {}; 22 | virtual void OnFocusLost() {}; 23 | 24 | void SetElapsedTime(float value); 25 | float GetElapsedTime(); 26 | float GetFrameRate(); 27 | float GetGameFrameRate(); 28 | 29 | private: 30 | float elapsedTime; 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/FastLoader.cpp: -------------------------------------------------------------------------------- 1 | #include "FastLoader.h" 2 | #include "../FileSystem/ConfigFile.h" 3 | #include "../Constants.h" 4 | #include 5 | #include "../framework.h" 6 | 7 | namespace TLAC::Components 8 | { 9 | FastLoader::FastLoader() 10 | { 11 | } 12 | 13 | FastLoader::~FastLoader() 14 | { 15 | } 16 | 17 | const char* FastLoader::GetDisplayName() 18 | { 19 | return "fast_loader"; 20 | } 21 | 22 | void FastLoader::Initialize(ComponentsManager*) 23 | { 24 | TLAC::FileSystem::ConfigFile componentsConfig(TLAC::framework::GetModuleDirectory(), COMPONENTS_CONFIG_FILE_NAME); 25 | bool success = componentsConfig.OpenRead(); 26 | if (success) 27 | { 28 | int speed = componentsConfig.GetIntegerValue("fast_loader_speed"); 29 | if (speed >= 2 && speed <= 1024) updatesPerFrame = speed; 30 | } 31 | printf("[Fast Loader] Speed: %d\n", updatesPerFrame); 32 | } 33 | 34 | void FastLoader::Update() 35 | { 36 | if (dataInitialized) 37 | return; 38 | 39 | previousGameState = currentGameState; 40 | currentGameState = *(GameState*)CURRENT_GAME_STATE_ADDRESS; 41 | 42 | if (currentGameState == GS_STARTUP) 43 | { 44 | typedef void UpdateTask(); 45 | UpdateTask* updateTask = (UpdateTask*)UPDATE_TASKS_ADDRESS; 46 | 47 | // speed up TaskSystemStartup 48 | for (int i = 0; i < updatesPerFrame; i++) 49 | updateTask(); 50 | 51 | constexpr int DATA_INITIALIZED = 3; 52 | 53 | // skip TaskDataInit 54 | *(int*)(DATA_INIT_STATE_ADDRESS) = DATA_INITIALIZED; 55 | 56 | // skip TaskWarning 57 | *(int*)(SYSTEM_WARNING_ELAPSED_ADDRESS) = 3939; 58 | } 59 | else if (previousGameState == GS_STARTUP) 60 | { 61 | dataInitialized = true; 62 | printf("[TLAC] FastLoader::Update(): Data Initialized\n"); 63 | } 64 | } 65 | 66 | void FastLoader::UpdateInput() 67 | { 68 | return; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/FastLoader.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include "GameState.h" 4 | #include 5 | 6 | namespace TLAC::Components 7 | { 8 | class FastLoader : public EmulatorComponent 9 | { 10 | public: 11 | FastLoader(); 12 | ~FastLoader(); 13 | 14 | virtual const char* GetDisplayName() override; 15 | 16 | virtual void Initialize(ComponentsManager*) override; 17 | virtual void Update() override; 18 | virtual void UpdateInput() override; 19 | 20 | private: 21 | const std::string COMPONENTS_CONFIG_FILE_NAME = "components.ini"; 22 | int updatesPerFrame = 39; 23 | 24 | GameState currentGameState; 25 | GameState previousGameState; 26 | bool dataInitialized = false; 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/FrameRateManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include 4 | 5 | namespace TLAC::Components 6 | { 7 | class FrameRateManager : public EmulatorComponent 8 | { 9 | public: 10 | FrameRateManager(); 11 | ~FrameRateManager(); 12 | 13 | virtual const char* GetDisplayName() override; 14 | 15 | virtual void Initialize(ComponentsManager*) override; 16 | virtual void Update() override; 17 | virtual void UpdateDraw2D() override; 18 | 19 | static float fspeed_error; // compensation value for use in this frame 20 | static float fspeed_error_next; // save a compensation value to be used in the next frame 21 | 22 | static float fspeedhook_lastresult; // used by the ageage hair patch to be lazy and avoid setting up for a proper call 23 | 24 | private: 25 | float *pvFrameRate; 26 | float *frameSpeed; 27 | float *aetFrameDuration; 28 | float defaultAetFrameDuration; 29 | float motionSpeedMultiplier = 5.0; 30 | void InjectCode(void* address, const std::vector data); 31 | }; 32 | } 33 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TLAC::Components 5 | { 6 | enum GameState : uint32_t 7 | { 8 | GS_STARTUP, 9 | GS_ADVERTISE, 10 | GS_GAME, 11 | GS_DATA_TEST, 12 | GS_TEST_MODE, 13 | GS_APP_ERROR, 14 | GS_MAX, 15 | }; 16 | 17 | enum SubGameState : uint32_t 18 | { 19 | SUB_DATA_INITIALIZE, 20 | SUB_SYSTEM_STARTUP, 21 | SUB_SYSTEM_STARTUP_ERROR, 22 | SUB_WARNING, 23 | SUB_LOGO, 24 | SUB_RATING, 25 | SUB_DEMO, 26 | SUB_TITLE, 27 | SUB_RANKING, 28 | SUB_SCORE_RANKING, 29 | SUB_CM, 30 | SUB_PHOTO_MODE_DEMO, 31 | SUB_SELECTOR, 32 | SUB_GAME_MAIN, 33 | SUB_GAME_SEL, 34 | SUB_STAGE_RESULT, 35 | SUB_SCREEN_SHOT_SEL, 36 | SUB_SCREEN_SHOT_RESULT, 37 | SUB_GAME_OVER, 38 | SUB_DATA_TEST_MAIN, 39 | SUB_DATA_TEST_MISC, 40 | SUB_DATA_TEST_OBJ, 41 | SUB_DATA_TEST_STG, 42 | SUB_DATA_TEST_MOT, 43 | SUB_DATA_TEST_COLLISION, 44 | SUB_DATA_TEST_SPR, 45 | SUB_DATA_TEST_AET, 46 | SUB_DATA_TEST_AUTH_3D, 47 | SUB_DATA_TEST_CHR, 48 | SUB_DATA_TEST_ITEM, 49 | SUB_DATA_TEST_PERF, 50 | SUB_DATA_TEST_PVSCRIPT, 51 | SUB_DATA_TEST_PRINT, 52 | SUB_DATA_TEST_CARD, 53 | SUB_DATA_TEST_OPD, 54 | SUB_DATA_TEST_SLIDER, 55 | SUB_DATA_TEST_GLITTER, 56 | SUB_DATA_TEST_GRAPHICS, 57 | SUB_DATA_TEST_COLLECTION_CARD, 58 | SUB_TEST_MODE_MAIN, 59 | SUB_APP_ERROR, 60 | SUB_MAX, 61 | }; 62 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameTargets/HoldState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | enum HoldState 6 | { 7 | HOLD_NONE, 8 | HOLD_SANKAKU = 64, 9 | HOLD_MARU = 128, 10 | HOLD_BATSU = 256, 11 | HOLD_SHIKAKU = 512, 12 | }; 13 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameTargets/TargetHitStates.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | enum TargetHitStates : int32_t 6 | { 7 | COOL, 8 | FINE, 9 | SAFE, 10 | SAD, 11 | COOL_WRONG, // unsure 12 | FINE_WRONG, // unsure 13 | SAFE_WRONG, // unsure 14 | SAD_WRONG, // unsure 15 | WORST, 16 | NONE = 21, 17 | }; 18 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameTargets/TargetInspector.cpp: -------------------------------------------------------------------------------- 1 | #include "TargetInspector.h" 2 | 3 | namespace TLAC::Components 4 | { 5 | bool TargetInspector::repressTbl[maxTargetSlots]; 6 | bool TargetInspector::ShouldVibrate; 7 | 8 | TargetInspector::TargetInspector() 9 | { 10 | } 11 | 12 | TargetInspector::~TargetInspector() 13 | { 14 | } 15 | 16 | void TargetInspector::Initialize(ComponentsManager*) 17 | { 18 | tgtStates = (TargetState*)TGT_STATES_BASE_ADDRESS; 19 | } 20 | 21 | void TargetInspector::Update() 22 | { 23 | UpdateRepressTbl(); 24 | UpdateShouldVibrate(); 25 | } 26 | 27 | const char* TargetInspector::GetDisplayName() 28 | { 29 | return "target_inspector"; 30 | } 31 | 32 | void TargetInspector::UpdateRepressTbl() 33 | { 34 | for (int i = 0; i < maxTargetSlots; ++i) 35 | { 36 | repressTbl[i] = IsWithinRange(tgtStates[i].tgtRemainingTime) 37 | && HasNotBeenHit(tgtStates[i].tgtHitState) 38 | && !IsSlide(tgtStates[i].tgtType); 39 | } 40 | } 41 | 42 | void TargetInspector::UpdateShouldVibrate() 43 | { 44 | for (int i = 0; i < maxTargetSlots; ++i) 45 | { 46 | if (IsWithinRange(tgtStates[i].tgtRemainingTime) 47 | && (tgtStates[i].tgtType == SLIDE_LONG_L || tgtStates[i].tgtType == SLIDE_LONG_R) 48 | && tgtStates[i].tgtHitState == NONE) 49 | { 50 | //printf("%d\n", tgtStates[i].tgtHitState); 51 | ShouldVibrate = true; 52 | return; 53 | } 54 | } 55 | ShouldVibrate = false; 56 | } 57 | 58 | bool TargetInspector::IsWithinRange(float time) 59 | { 60 | return time < timingThreshold && time > -timingThreshold && time != 0; 61 | } 62 | 63 | bool TargetInspector::HasNotBeenHit(int hitState) 64 | { 65 | return hitState == NONE; 66 | } 67 | 68 | bool TargetInspector::IsSlide(int type) 69 | { 70 | return (type >= SLIDE_L && type <= SLIDE_LONG_R) || type >= SLIDE_L_CH; 71 | } 72 | 73 | bool TargetInspector::IsAnyRepress() 74 | { 75 | for (int i = 0; i < maxTargetSlots; ++i) 76 | { 77 | if (repressTbl[i]) 78 | return true; 79 | } 80 | return false; 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameTargets/TargetInspector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EmulatorComponent.h" 3 | #include "../Input/InputEmulator.h" 4 | #include "../../Constants.h" 5 | #include "TargetHitStates.h" 6 | #include "TargetState.h" 7 | 8 | namespace TLAC::Components 9 | { 10 | const int maxTargetSlots = 64; 11 | 12 | class TargetInspector : public EmulatorComponent 13 | { 14 | public: 15 | TargetInspector(); 16 | ~TargetInspector(); 17 | 18 | static bool repressTbl[maxTargetSlots]; 19 | 20 | virtual void Initialize(ComponentsManager*) override; 21 | virtual void Update() override; 22 | virtual const char* GetDisplayName() override; 23 | 24 | static bool IsAnyRepress(); 25 | 26 | static bool ShouldVibrate; 27 | 28 | private: 29 | //const uint64_t offset = 0x4A8; 30 | const float timingThreshold = 0.13f; // PS4 estimate 31 | 32 | TargetState* tgtStates; 33 | 34 | bool IsSlide(int); 35 | bool IsWithinRange(float); 36 | bool HasNotBeenHit(int); 37 | void UpdateRepressTbl(); 38 | void UpdateShouldVibrate(); 39 | }; 40 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameTargets/TargetState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | struct TargetState 6 | { 7 | // seems to be some kind of linked list.. 8 | // not sure if these are for all active targets or just used in some functions 9 | TargetState* prev; 10 | TargetState* next; 11 | byte padding10[0x4]; 12 | TargetTypes tgtType; 13 | float tgtRemainingTime; 14 | byte padding1C[0x434]; 15 | byte ToBeRemoved; // FromList 16 | byte padding451[0xB]; 17 | TargetHitStates tgtHitState; 18 | byte padding460[0x48]; 19 | }; 20 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/GameTargets/TargetTypes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | enum TargetTypes : int32_t 6 | { 7 | SANKAKU, 8 | MARU, 9 | BATSU, 10 | SHIKAKU, 11 | SANKAKU_H, 12 | MARU_H, 13 | BATSU_H, 14 | SHIKAKU_H, 15 | SLIDE_L = 12, 16 | SLIDE_R, 17 | SLIDE_LONG_L = 15, 18 | SLIDE_LONG_R, 19 | SANKAKU_CH = 18, 20 | MARU_CH, 21 | BATSU_CH, 22 | SHIKAKU_CH, 23 | SLIDE_L_CH = 23, 24 | SLIDE_R_CH, 25 | }; 26 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/InputBufferType.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | enum InputBufferType 6 | { 7 | InputBufferType_Tapped, 8 | InputBufferType_Released, 9 | InputBufferType_Down, 10 | InputBufferType_DoubleTapped, 11 | InputBufferType_IntervalTapped, 12 | InputBufferType_Max, 13 | }; 14 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/InputEmulator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include "InputState.h" 5 | #include "../EmulatorComponent.h" 6 | #include "../../Input/Bindings/Binding.h" 7 | #include "../GameTargets/TargetTypes.h" 8 | #include "../GameTargets/TargetHitStates.h" 9 | #include "../GameTargets/HoldState.h" 10 | #include "../GameTargets/TargetInspector.h" 11 | 12 | namespace TLAC::Components 13 | { 14 | struct KeyBit 15 | { 16 | uint32_t Bit; 17 | uint8_t KeyCode; 18 | }; 19 | 20 | class InputEmulator : public EmulatorComponent 21 | { 22 | public: 23 | Input::Binding* TestBinding; 24 | Input::Binding* ServiceBinding; 25 | Input::Binding* Sw1Binding; 26 | Input::Binding* Sw2Binding; 27 | 28 | Input::Binding* StartBinding; 29 | Input::Binding* SankakuBinding; 30 | Input::Binding* ShikakuBinding; 31 | Input::Binding* BatsuBinding; 32 | Input::Binding* MaruBinding; 33 | 34 | Input::Binding* LeftBinding; 35 | Input::Binding* RightBinding; 36 | 37 | Input::Binding* MenuLBinding; 38 | Input::Binding* MenuRBinding; 39 | Input::Binding* MenuCircleBinding; 40 | 41 | Input::Binding* CoinBinding; 42 | Input::Binding* ToonBinding; 43 | Input::Binding* WireframeBinding; 44 | 45 | InputEmulator(); 46 | ~InputEmulator(); 47 | 48 | virtual const char* GetDisplayName() override; 49 | 50 | virtual void Initialize(ComponentsManager*) override; 51 | virtual void Update() override; 52 | virtual void UpdateInput() override; 53 | 54 | virtual void OnFocusLost() override; 55 | 56 | private: 57 | ComponentsManager* componentsManager; 58 | 59 | bool mouseScrollPvSelection = false; 60 | const uint32_t scrollUpBit = 99; 61 | const uint32_t scrollDownBit = 100; 62 | 63 | KeyBit keyBits[20] = 64 | { 65 | { 5, VK_LEFT }, 66 | { 6, VK_RIGHT }, 67 | 68 | { 29, VK_SPACE }, 69 | { 39, 'A' }, 70 | { 43, 'E' }, 71 | { 42, 'D' }, 72 | { 55, 'Q' }, 73 | { 57, 'S' }, // unsure 74 | { 61, 'W' }, 75 | { 63, 'Y' }, 76 | { 84, 'L' }, // unsure 77 | 78 | { 80, VK_RETURN }, 79 | { 81, VK_SHIFT }, 80 | { 82, VK_CONTROL }, 81 | { 83, VK_MENU }, 82 | 83 | { 91, VK_UP }, 84 | { 93, VK_DOWN }, 85 | 86 | { 96, MK_LBUTTON }, 87 | { 97, VK_MBUTTON }, 88 | { 98, MK_RBUTTON }, 89 | }; 90 | 91 | InputState* inputState; 92 | JvsButtons lastDownState; 93 | JvsButtons heldButtons; 94 | 95 | int holdTbl[4]; 96 | HoldState holdState; 97 | 98 | void UpdateJvsInput(); 99 | void UpdateDwGuiInput(); 100 | void UpdateMousePvScroll(); 101 | void UpdateHoldState(); 102 | InputState* GetInputStatePtr(void* address); 103 | JvsButtons GetJvsButtonsState(bool(*buttonTestFunc)(void*)); 104 | JvsButtons GetButtonFromHold(); 105 | char GetKeyState(); 106 | HoldState GetHoldState(); 107 | int GetMaxHoldState(); 108 | bool IsHold(); 109 | 110 | void UpdateInputBit(uint32_t bit, uint8_t keycode); 111 | void UpdateSliderLR(); 112 | void SetMetaButtons(); 113 | 114 | void addCoin(); 115 | void toggleNpr1(); 116 | void toggleWireframe(); 117 | }; 118 | } 119 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/InputState.cpp: -------------------------------------------------------------------------------- 1 | #include "InputState.h" 2 | #include 3 | #include 4 | 5 | namespace TLAC::Components 6 | { 7 | void InputState::ClearState() 8 | { 9 | memset(this, 0, sizeof(InputState)); 10 | } 11 | 12 | void InputState::HideCursor() 13 | { 14 | MouseX = INT32_MIN; 15 | MouseY = INT32_MIN; 16 | MouseDeltaX = 0; 17 | MouseDeltaY = 0; 18 | } 19 | 20 | void InputState::SetBit(uint32_t bit, bool value, InputBufferType inputType) 21 | { 22 | uint8_t* data = GetInputBuffer(inputType); 23 | 24 | if (data == nullptr || bit < 0 || bit >= MAX_BUTTON_BIT) 25 | return; 26 | 27 | int byteIndex = (bit / 8); 28 | int bitIndex = (bit % 8); 29 | 30 | BYTE mask = (1 << bitIndex); 31 | 32 | data[byteIndex] = value ? (data[byteIndex] | mask) : (data[byteIndex] & ~mask); 33 | } 34 | 35 | uint8_t* InputState::GetInputBuffer(InputBufferType inputType) 36 | { 37 | switch (inputType) 38 | { 39 | case InputBufferType_Tapped: 40 | return (uint8_t*)&Tapped; 41 | 42 | case InputBufferType_Released: 43 | return (uint8_t*)&Released; 44 | 45 | case InputBufferType_Down: 46 | return (uint8_t*)&Down; 47 | 48 | case InputBufferType_DoubleTapped: 49 | return (uint8_t*)&DoubleTapped; 50 | 51 | case InputBufferType_IntervalTapped: 52 | return (uint8_t*)&IntervalTapped; 53 | 54 | default: 55 | return nullptr; 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/InputState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "JvsButtons.h" 3 | #include "InputBufferType.h" 4 | 5 | namespace TLAC::Components 6 | { 7 | const int MAX_BUTTON_BIT = 0x6F; 8 | 9 | // The button state is larger than the size of a register 10 | // but only the first 32 bits are used during normal gameplay 11 | // so this will provide the convenience of still being able to access them through a bit field 12 | union ButtonState 13 | { 14 | JvsButtons Buttons; 15 | uint32_t State[4]; 16 | }; 17 | 18 | // total sizeof() == 0x20E0 19 | struct InputState 20 | { 21 | ButtonState Tapped; 22 | ButtonState Released; 23 | 24 | ButtonState Down; 25 | uint32_t Padding_20[4]; 26 | 27 | ButtonState DoubleTapped; 28 | uint32_t Padding_30[4]; 29 | 30 | ButtonState IntervalTapped; 31 | uint32_t Padding_38[12]; 32 | 33 | int32_t MouseX; 34 | int32_t MouseY; 35 | int32_t MouseDeltaX; 36 | int32_t MouseDeltaY; 37 | 38 | uint32_t Padding_AC[8]; 39 | uint8_t Padding_D0[3]; 40 | char Key; 41 | 42 | void ClearState(); 43 | void HideCursor(); 44 | void SetBit(uint32_t bit, bool value, InputBufferType inputType); 45 | uint8_t* GetInputBuffer(InputBufferType inputType); 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/JvsButtons.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TLAC::Components 5 | { 6 | enum JvsButtons : uint32_t 7 | { 8 | JVS_NONE = 0 << 0x00, // 0x0 9 | 10 | JVS_TEST = 1 << 0x00, // 0x1 11 | JVS_SERVICE = 1 << 0x01, // 0x2 12 | 13 | JVS_START = 1 << 0x02, // 0x4 14 | JVS_TRIANGLE = 1 << 0x07, // 0x80 15 | JVS_SQUARE = 1 << 0x08, // 0x100 16 | JVS_CROSS = 1 << 0x09, // 0x200 17 | JVS_CIRCLE = 1 << 0x0A, // 0x400 18 | JVS_L = 1 << 0x0B, // 0x800 19 | JVS_R = 1 << 0x0C, // 0x1000 20 | 21 | JVS_SW1 = 1 << 0x12, // 0x40000 22 | JVS_SW2 = 1 << 0x13, // 0x80000 23 | }; 24 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/TouchPanelEmulator.cpp: -------------------------------------------------------------------------------- 1 | #include "TouchPanelEmulator.h" 2 | #include 3 | #include 4 | #include 5 | #include "../ComponentsManager.h" 6 | #include "../../Constants.h" 7 | #include "../../framework.h" 8 | #include "../../Input/Mouse/Mouse.h" 9 | #include "../../Input/Keyboard/Keyboard.h" 10 | 11 | using namespace TLAC::Input; 12 | 13 | namespace TLAC::Components 14 | { 15 | TouchPanelEmulator::TouchPanelEmulator() 16 | { 17 | } 18 | 19 | TouchPanelEmulator::~TouchPanelEmulator() 20 | { 21 | } 22 | 23 | const char* TouchPanelEmulator::GetDisplayName() 24 | { 25 | return "touch_panel_emulator"; 26 | } 27 | 28 | void TouchPanelEmulator::Initialize(ComponentsManager* manager) 29 | { 30 | componentsManager = manager; 31 | state = GetTouchStatePtr((void*)TASK_TOUCH_ADDRESS); 32 | // Make touches on actual touchscreens more responsive 33 | const DWORD_PTR dwHwndTabletProperty = 34 | TABLET_DISABLE_PRESSANDHOLD | // disables press and hold (right-click) gesture 35 | TABLET_DISABLE_PENTAPFEEDBACK | // disables UI feedback on pen up (waves) 36 | TABLET_DISABLE_PENBARRELFEEDBACK | // disables UI feedback on pen button down (circle) 37 | TABLET_DISABLE_FLICKS; // disables pen flicks (back, forward, drag down, drag up) 38 | SetProp(TLAC::framework::DivaWindowHandle, MICROSOFT_TABLETPENSERVICE_PROPERTY, reinterpret_cast(dwHwndTabletProperty)); 39 | } 40 | 41 | void TouchPanelEmulator::Update() 42 | { 43 | state->ConnectionState = 1; 44 | } 45 | 46 | void TouchPanelEmulator::UpdateInput() 47 | { 48 | if (!componentsManager->GetUpdateGameInput() || componentsManager->IsDwGuiActive() || componentsManager->IsDwGuiHovered()) 49 | return; 50 | 51 | // TODO: rescale TouchReaction aet position 52 | auto keyboard = Keyboard::GetInstance(); 53 | auto pos = Mouse::GetInstance()->GetRelativePosition(); 54 | 55 | state->XPosition = (float)pos.x; 56 | state->YPosition = (float)pos.y; 57 | 58 | bool down = keyboard->IsDown(VK_LBUTTON); 59 | bool released = keyboard->IsReleased(VK_LBUTTON); 60 | 61 | state->ContactType = (down ? 0x2 : released ? 0x1 : 0x0); 62 | state->Pressure = (float)(state->ContactType != 0); 63 | } 64 | 65 | TouchPanelState* TouchPanelEmulator::GetTouchStatePtr(void *address) 66 | { 67 | return (TouchPanelState*)address; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/TouchPanelEmulator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EmulatorComponent.h" 3 | #include "TouchPanelState.h" 4 | 5 | namespace TLAC::Components 6 | { 7 | class TouchPanelEmulator : public EmulatorComponent 8 | { 9 | public: 10 | TouchPanelEmulator(); 11 | ~TouchPanelEmulator(); 12 | 13 | virtual const char* GetDisplayName() override; 14 | 15 | virtual void Initialize(ComponentsManager*) override; 16 | virtual void Update() override; 17 | virtual void UpdateInput() override; 18 | 19 | private: 20 | ComponentsManager* componentsManager; 21 | 22 | TouchPanelState* state; 23 | TouchPanelState* GetTouchStatePtr(void *address); 24 | }; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/TouchPanelState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Components 4 | { 5 | struct TouchPanelState 6 | { 7 | int Padding00[0x1E]; 8 | int ConnectionState; 9 | int Padding01[0x06]; 10 | float XPosition; 11 | float YPosition; 12 | float Pressure; 13 | int ContactType; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/TouchSliderEmulator.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../EmulatorComponent.h" 3 | #include "TouchSliderState.h" 4 | #include "../../Input/Bindings/Binding.h" 5 | 6 | namespace TLAC::Components 7 | { 8 | constexpr int SLIDER_INPUTS = 4; 9 | constexpr int CONTACT_POINTS = 2; 10 | 11 | struct ContactPoint 12 | { 13 | float Position; 14 | bool InContact; 15 | }; 16 | 17 | class TouchSliderEmulator : public EmulatorComponent 18 | { 19 | public: 20 | static TouchSliderEmulator* LatestInstance; 21 | 22 | Input::Binding* LeftSideSlideLeft; 23 | Input::Binding* LeftSideSlideRight; 24 | 25 | Input::Binding* RightSideSlideLeft; 26 | Input::Binding* RightSideSlideRight; 27 | 28 | bool usePs4OfficialSlider; 29 | 30 | bool enableInMenus; 31 | 32 | TouchSliderEmulator(); 33 | ~TouchSliderEmulator(); 34 | 35 | virtual const char* GetDisplayName() override; 36 | 37 | virtual void Initialize(ComponentsManager*) override; 38 | virtual void Update() override; 39 | virtual void UpdateInput() override; 40 | 41 | virtual void OnFocusLost() override; 42 | 43 | bool isSliderTouched() 44 | { 45 | for (int i = 0; i < 32; i++) 46 | if (sliderState->SensorTouched[i].IsTouched) return true; 47 | 48 | return false; 49 | } 50 | 51 | private: 52 | ComponentsManager* componentsManager; 53 | float sliderSpeed = 750.0f; 54 | float sliderIncrement; 55 | 56 | TouchSliderState *sliderState; 57 | ContactPoint ContactPoints[CONTACT_POINTS]; 58 | 59 | void EmulateSliderInput(Input::Binding *leftBinding, Input::Binding *rightBinding, ContactPoint &contactPoint, float start, float end); 60 | void ApplyContactPoint(ContactPoint &contactPoint, int section); 61 | void ApplyBitfieldState(uint32_t state); 62 | }; 63 | 64 | inline bool touchSliderEmulatorIsEnabled = false; 65 | } 66 | 67 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/TouchSliderState.cpp: -------------------------------------------------------------------------------- 1 | #include "TouchSliderState.h" 2 | 3 | namespace TLAC::Components 4 | { 5 | void TouchSliderState::SetSensor(int index, int value, SliderSensorSetMode mode) 6 | { 7 | if (index < 0 || index >= SLIDER_SENSORS) 8 | return; 9 | 10 | if (mode == SENSOR_SET_MODE_RAW) 11 | { 12 | if (SerialState == nullptr) 13 | return; 14 | 15 | uint32_t* ph = SerialState->sliderSerialResponse.sensors[index].pressureHistory; 16 | ph[3] = ph[2]; 17 | ph[2] = ph[1]; 18 | ph[1] = ph[0]; 19 | ph[0] = value; 20 | 21 | SerialState->sliderSerialResponse.scanMode = 1; 22 | SerialState->sliderSerialResponse.scanCount = 1; 23 | SerialState->sliderResponseCnt = 1; 24 | } 25 | else 26 | { 27 | SensorPressureLevels[index] = value; 28 | SensorTouched[index].IsTouched = value > 0; 29 | } 30 | } 31 | 32 | void TouchSliderState::ResetSensors(SliderSensorSetMode mode) 33 | { 34 | for (int i = 0; i < SLIDER_SENSORS; i++) 35 | SetSensor(i, NO_PRESSURE, mode); 36 | } 37 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/Input/TouchSliderState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | #define SLIDER_OK 3 5 | #define SLIDER_SECTIONS 4 6 | #define SLIDER_SENSORS 32 7 | 8 | #define NO_PRESSURE 0 9 | #define FULL_PRESSURE 180 10 | 11 | 12 | namespace TLAC::Components 13 | { 14 | struct TouchSliderSerialState 15 | { 16 | uint8_t padding[0x1960]; 17 | 18 | int sliderResponseCnt; 19 | struct 20 | { 21 | int scanMode; 22 | int scanCount; 23 | struct 24 | { 25 | uint32_t pressureHistory[4]; // first: current, second: last sample, ... 26 | } sensors[SLIDER_SENSORS]; 27 | } sliderSerialResponse; 28 | 29 | struct 30 | { 31 | int scanMode; 32 | int scanCount; 33 | struct 34 | { 35 | uint32_t pressureHistory[4]; // first: current, second: last sample, ... 36 | } sensors[SLIDER_SENSORS]; 37 | } sliderSerialResponseCopy; // the other one is copied here by the game, feel free to ignore it 38 | }; 39 | 40 | struct TouchSliderState 41 | { 42 | uint8_t Padding0000[104]; 43 | 44 | TouchSliderSerialState* SerialState; 45 | 46 | int32_t State; 47 | 48 | uint8_t Padding0074[20 + 12]; 49 | 50 | int32_t SensorPressureLevels[SLIDER_SENSORS]; 51 | 52 | uint8_t Padding0108[52 - 12]; 53 | 54 | float SectionPositions[SLIDER_SECTIONS]; 55 | int SectionConnections[SLIDER_SECTIONS]; 56 | uint8_t Padding015C[4]; 57 | bool SectionTouched[SLIDER_SECTIONS]; 58 | 59 | uint8_t Padding013C[3128 - 52 - 40]; 60 | 61 | struct 62 | { 63 | uint8_t Padding00[2]; 64 | bool IsTouched; 65 | uint8_t Padding[45]; 66 | } SensorTouched[SLIDER_SENSORS]; 67 | 68 | 69 | // two different places to be set depending on operation mode now 70 | // stick/button based emulation directly controls sections and raw slider emulation controls fake serial inputs 71 | enum SliderSensorSetMode 72 | { 73 | SENSOR_SET_MODE_SECTIONS, 74 | SENSOR_SET_MODE_RAW 75 | }; 76 | 77 | void SetSensor(int index, int value, SliderSensorSetMode mode); 78 | void ResetSensors(SliderSensorSetMode mode); 79 | }; 80 | } 81 | 82 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/PlayerDataManager.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include "PlayerData.h" 4 | #include "CustomPlayerData.h" 5 | #include 6 | 7 | namespace TLAC::Components 8 | { 9 | class PlayerDataManager : public EmulatorComponent 10 | { 11 | public: 12 | PlayerDataManager(); 13 | ~PlayerDataManager(); 14 | 15 | virtual const char* GetDisplayName() override; 16 | 17 | virtual void Initialize(ComponentsManager*) override; 18 | virtual void Update() override; 19 | 20 | private: 21 | PlayerData* playerData; 22 | CustomPlayerData* customPlayerData; 23 | int lastPvId = -1; 24 | bool initPvId = true; 25 | bool pvModuleLoaded = true; 26 | bool moduleCardWorkaround = true; 27 | int lastModState = 0; 28 | void ApplyPatch(); 29 | void LoadConfig(); 30 | void ApplyCustomData(); 31 | }; 32 | } 33 | 34 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Components/ScaleComponent.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "EmulatorComponent.h" 3 | #include "GameState.h" 4 | 5 | namespace TLAC::Components 6 | { 7 | class ScaleComponent : public EmulatorComponent 8 | { 9 | public: 10 | ScaleComponent(); 11 | ~ScaleComponent(); 12 | 13 | virtual const char* GetDisplayName() override; 14 | 15 | virtual void Initialize(ComponentsManager*) override; 16 | virtual void Update() override; 17 | virtual void UpdateInput() override; 18 | 19 | const int updatesPerFrame = 39; 20 | 21 | float* uiAspectRatio; 22 | float* uiWidth; 23 | float* uiHeight; 24 | 25 | int* fb1Width; 26 | int* fb1Height; 27 | int* fb2Width; 28 | int* fb2Height; 29 | 30 | double* fbAspectRatio; 31 | 32 | private: 33 | 34 | }; 35 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/FileSystem/ConfigFile.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "ConfigFile.h" 3 | #include "../Utilities/Operations.h" 4 | 5 | namespace TLAC::FileSystem 6 | { 7 | ConfigFile::ConfigFile(const std::string &path) : TextFile(path) 8 | { 9 | return; 10 | } 11 | 12 | ConfigFile::ConfigFile(const std::string &directory, const std::string &file) : TextFile(directory, file) 13 | { 14 | return; 15 | } 16 | 17 | bool ConfigFile::TryGetValue(const std::string &key, std::string **value) 18 | { 19 | auto pair = ConfigMap.find(key); 20 | bool found = pair != ConfigMap.end(); 21 | 22 | *value = found ? new std::string(pair->second) : nullptr; 23 | return found; 24 | } 25 | 26 | int ConfigFile::GetIntegerValue(const std::string& key, int defaultval) 27 | { 28 | auto pair = ConfigMap.find(key); 29 | bool found = pair != ConfigMap.end(); 30 | 31 | return found ? atoi(pair->second.c_str()) : defaultval; 32 | } 33 | 34 | bool ConfigFile::GetBooleanValue(const std::string& key) 35 | { 36 | auto pair = ConfigMap.find(key); 37 | bool found = pair != ConfigMap.end(); 38 | 39 | return found ? pair->second == "true" : false; 40 | } 41 | 42 | float ConfigFile::GetFloatValue(const std::string & key) 43 | { 44 | auto pair = ConfigMap.find(key); 45 | bool found = pair != ConfigMap.end(); 46 | 47 | return found ? (float)atof(pair->second.c_str()) : 0.0f; 48 | } 49 | 50 | std::string ConfigFile::GetStringValue(const std::string& key) 51 | { 52 | auto pair = ConfigMap.find(key); 53 | bool found = pair != ConfigMap.end(); 54 | 55 | return found ? pair->second : ""; 56 | } 57 | 58 | void ConfigFile::Parse(std::ifstream &fileStream) 59 | { 60 | std::string line; 61 | 62 | // check for BOM 63 | std::getline(fileStream, line); 64 | if (line.size() >= 3 && line.rfind("\xEF\xBB\xBF", 0) == 0) 65 | fileStream.seekg(3); 66 | else 67 | fileStream.seekg(0); 68 | 69 | while (std::getline(fileStream, line)) 70 | { 71 | if (IsComment(line)) 72 | continue; 73 | 74 | auto splitline = Utilities::Split(line, "="); 75 | if (splitline.size() < 2) 76 | continue; 77 | 78 | for (auto &line : splitline) 79 | Utilities::Trim(line); 80 | 81 | ConfigMap.insert(std::make_pair(splitline[0], splitline[1])); 82 | } 83 | } 84 | 85 | bool ConfigFile::IsComment(const std::string &line) 86 | { 87 | return line.size() <= 0 || line[0] == '#' || line[0] == '[' || (line.size() >= 2 && line.rfind("//", 0) == 0); 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/FileSystem/ConfigFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "TextFile.h" 4 | #include 5 | 6 | namespace TLAC::FileSystem 7 | { 8 | class ConfigFile : public TextFile 9 | { 10 | public: 11 | ConfigFile(const std::string &path); 12 | ConfigFile(const std::string &directory, const std::string &file); 13 | 14 | std::unordered_map ConfigMap; 15 | 16 | bool TryGetValue(const std::string &key, std::string **value); 17 | int GetIntegerValue(const std::string& key, int defaultval = 0); 18 | bool GetBooleanValue(const std::string& key); 19 | float GetFloatValue(const std::string& key); 20 | std::string GetStringValue(const std::string& key); 21 | 22 | protected: 23 | virtual void Parse(std::ifstream &fileStream) override; 24 | 25 | private: 26 | bool IsComment(const std::string &line); 27 | }; 28 | } 29 | 30 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/FileSystem/TextFile.cpp: -------------------------------------------------------------------------------- 1 | #include "TextFile.h" 2 | #include 3 | 4 | namespace fs = std::filesystem; 5 | 6 | namespace TLAC::FileSystem 7 | { 8 | TextFile::TextFile(const std::string &path) 9 | { 10 | FileName = path; 11 | } 12 | 13 | TextFile::TextFile(const std::string &directory, const std::string &file) 14 | { 15 | auto fullPath = directory + "/" + file; 16 | FileName = fullPath; 17 | } 18 | 19 | TextFile::~TextFile() 20 | { 21 | } 22 | 23 | bool TextFile::OpenRead() 24 | { 25 | fs::path configPath = fs::u8path(FileName); 26 | 27 | if (!fs::exists(configPath)) 28 | return false; 29 | 30 | std::ifstream fileStream(configPath.wstring().c_str()); 31 | 32 | if (!fileStream.is_open()) 33 | return false; 34 | 35 | Parse(fileStream); 36 | 37 | fileStream.close(); 38 | 39 | return true; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/FileSystem/TextFile.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | namespace TLAC::FileSystem 7 | { 8 | class TextFile 9 | { 10 | public: 11 | std::string FileName; 12 | 13 | TextFile(const std::string &path); 14 | TextFile(const std::string &directory, const std::string &file); 15 | ~TextFile(); 16 | 17 | bool OpenRead(); 18 | 19 | protected: 20 | virtual void Parse(std::ifstream &fileStream) = 0; 21 | }; 22 | } 23 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/Binding.cpp: -------------------------------------------------------------------------------- 1 | #include "Binding.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | Binding::Binding() 6 | { 7 | } 8 | 9 | Binding::~Binding() 10 | { 11 | for (auto& binding : InputBindings) 12 | delete binding; 13 | } 14 | 15 | void Binding::AddBinding(IInputBinding* inputBinding) 16 | { 17 | InputBindings.push_back(inputBinding); 18 | } 19 | 20 | bool Binding::AnyDown() 21 | { 22 | for (const auto& binding : InputBindings) 23 | { 24 | if (binding->IsDown()) 25 | return true; 26 | } 27 | 28 | return false; 29 | } 30 | 31 | bool Binding::AnyTapped() 32 | { 33 | for (const auto& binding : InputBindings) 34 | { 35 | if (binding->IsTapped()) 36 | return true; 37 | } 38 | 39 | return false; 40 | } 41 | 42 | bool Binding::AnyReleased() 43 | { 44 | for (const auto& binding : InputBindings) 45 | { 46 | if (binding->IsReleased()) 47 | return true; 48 | } 49 | 50 | return false; 51 | } 52 | 53 | int Binding::GetDownCount() 54 | { 55 | int count = 0; 56 | 57 | for (const auto& binding : InputBindings) 58 | { 59 | if (binding->IsDown()) 60 | count++; 61 | } 62 | 63 | return count; 64 | } 65 | 66 | int Binding::GetTappedCount() 67 | { 68 | int count = 0; 69 | 70 | for (const auto& binding : InputBindings) 71 | { 72 | if (binding->IsTapped()) 73 | count++; 74 | } 75 | 76 | return count; 77 | } 78 | 79 | int Binding::GetReleasedCount() 80 | { 81 | int count = 0; 82 | 83 | for (const auto& binding : InputBindings) 84 | { 85 | if (binding->IsReleased()) 86 | count++; 87 | } 88 | 89 | return count; 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/Binding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "IInputBinding.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | class Binding 8 | { 9 | public: 10 | std::vector InputBindings; 11 | 12 | Binding(); 13 | ~Binding(); 14 | 15 | void AddBinding(IInputBinding* inputBinding); 16 | 17 | bool AnyDown(); 18 | bool AnyTapped(); 19 | bool AnyReleased(); 20 | 21 | int GetDownCount(); 22 | int GetTappedCount(); 23 | int GetReleasedCount(); 24 | }; 25 | } 26 | 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/DVLBinding.cpp: -------------------------------------------------------------------------------- 1 | #include "DVLBinding.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | #define DivallerInstanceCheckDefault(checkFunc) (Divaller::InstanceInitialized() ? Divaller::GetInstance()->checkFunc : false) 6 | 7 | DivallerBinding::DivallerBinding(DivallerButton button) : Button(button) 8 | { 9 | } 10 | 11 | DivallerBinding::~DivallerBinding() 12 | { 13 | } 14 | 15 | bool DivallerBinding::IsDown() 16 | { 17 | return DivallerInstanceCheckDefault(IsDown(Button)); 18 | } 19 | 20 | bool DivallerBinding::IsTapped() 21 | { 22 | return DivallerInstanceCheckDefault(IsTapped(Button)); 23 | } 24 | 25 | bool DivallerBinding::IsReleased() 26 | { 27 | return DivallerInstanceCheckDefault(IsReleased(Button)); 28 | } 29 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/DVLBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInputBinding.h" 3 | #include "../Divaller/Divaller.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | class DivallerBinding : public IInputBinding 8 | { 9 | public: 10 | DivallerButton Button; 11 | 12 | DivallerBinding(DivallerButton button); 13 | ~DivallerBinding(); 14 | 15 | bool IsDown() override; 16 | bool IsTapped() override; 17 | bool IsReleased() override; 18 | }; 19 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/Ds4Binding.cpp: -------------------------------------------------------------------------------- 1 | #include "Ds4Binding.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | #define Ds4InstanceCheckDefault(checkFunc) (DualShock4::InstanceInitialized() ? DualShock4::GetInstance()->checkFunc : false) 6 | 7 | Ds4Binding::Ds4Binding(Ds4Button button) : Button(button) 8 | { 9 | } 10 | 11 | Ds4Binding::~Ds4Binding() 12 | { 13 | } 14 | 15 | bool Ds4Binding::IsDown() 16 | { 17 | return Ds4InstanceCheckDefault(IsDown(Button)); 18 | } 19 | 20 | bool Ds4Binding::IsTapped() 21 | { 22 | return Ds4InstanceCheckDefault(IsTapped(Button)); 23 | } 24 | 25 | bool Ds4Binding::IsReleased() 26 | { 27 | return Ds4InstanceCheckDefault(IsReleased(Button)); 28 | } 29 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/Ds4Binding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInputBinding.h" 3 | #include "../DirectInput/Ds4/DualShock4.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | class Ds4Binding : public IInputBinding 8 | { 9 | public: 10 | Ds4Button Button; 11 | 12 | Ds4Binding(Ds4Button button); 13 | ~Ds4Binding(); 14 | 15 | bool IsDown() override; 16 | bool IsTapped() override; 17 | bool IsReleased() override; 18 | }; 19 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/GuBinding.cpp: -------------------------------------------------------------------------------- 1 | #include "GuBinding.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | #define GuInstanceCheckDefault(checkFunc) (GenericUsbInput::InstanceInitialized() ? GenericUsbInput::GetInstance()->checkFunc : false) 6 | 7 | GuBinding::GuBinding(GuButton button) : Button(button) 8 | { 9 | } 10 | 11 | GuBinding::~GuBinding() 12 | { 13 | } 14 | 15 | bool GuBinding::IsDown() 16 | { 17 | return GuInstanceCheckDefault(IsDown(Button)); 18 | } 19 | 20 | bool GuBinding::IsTapped() 21 | { 22 | return GuInstanceCheckDefault(IsTapped(Button)); 23 | } 24 | 25 | bool GuBinding::IsReleased() 26 | { 27 | return GuInstanceCheckDefault(IsReleased(Button)); 28 | } 29 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/GuBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInputBinding.h" 3 | #include "../DirectInput/GenericUsb/GenericUsbInput.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | class GuBinding : public IInputBinding 8 | { 9 | public: 10 | GuButton Button; 11 | 12 | GuBinding(GuButton button); 13 | ~GuBinding(); 14 | 15 | bool IsDown() override; 16 | bool IsTapped() override; 17 | bool IsReleased() override; 18 | }; 19 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/IInputBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Input 4 | { 5 | class IInputBinding 6 | { 7 | public: 8 | virtual bool IsDown() = 0; 9 | virtual bool IsTapped() = 0; 10 | virtual bool IsReleased() = 0; 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/KeyboardBinding.cpp: -------------------------------------------------------------------------------- 1 | #include "KeyboardBinding.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | KeyboardBinding::KeyboardBinding(BYTE keycode) : Keycode(keycode) 6 | { 7 | } 8 | 9 | KeyboardBinding::~KeyboardBinding() 10 | { 11 | } 12 | 13 | bool KeyboardBinding::IsDown() 14 | { 15 | return Keyboard::GetInstance()->IsDown(Keycode); 16 | } 17 | 18 | bool KeyboardBinding::IsTapped() 19 | { 20 | return Keyboard::GetInstance()->IsTapped(Keycode); 21 | } 22 | 23 | bool KeyboardBinding::IsReleased() 24 | { 25 | return Keyboard::GetInstance()->IsReleased(Keycode); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/KeyboardBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInputBinding.h" 3 | #include "../Keyboard/Keyboard.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | class KeyboardBinding : public IInputBinding 8 | { 9 | public: 10 | BYTE Keycode; 11 | 12 | KeyboardBinding(BYTE keycode); 13 | ~KeyboardBinding(); 14 | 15 | bool IsDown() override; 16 | bool IsTapped() override; 17 | bool IsReleased() override; 18 | }; 19 | } 20 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/MouseBinding.cpp: -------------------------------------------------------------------------------- 1 | #include "MouseBinding.h" 2 | #include "../Keyboard/Keyboard.h" 3 | 4 | namespace TLAC::Input 5 | { 6 | MouseBinding::MouseBinding(MouseAction action) : Action(action) 7 | { 8 | } 9 | 10 | MouseBinding::~MouseBinding() 11 | { 12 | } 13 | 14 | bool MouseBinding::IsDown() 15 | { 16 | switch (Action) 17 | { 18 | case MouseAction_LeftButton: 19 | return Keyboard::GetInstance()->IsDown(MK_LBUTTON); 20 | case MouseAction_RightButton: 21 | return Keyboard::GetInstance()->IsDown(MK_RBUTTON); 22 | case MouseAction_MiddleButton: 23 | return Keyboard::GetInstance()->IsDown(MK_MBUTTON); 24 | case MouseAction_ScrollUp: 25 | return Mouse::GetInstance()->GetIsScrolledUp(); 26 | case MouseAction_ScrollDown: 27 | return Mouse::GetInstance()->GetIsScrolledDown(); 28 | default: 29 | return false; 30 | } 31 | } 32 | 33 | bool MouseBinding::IsTapped() 34 | { 35 | switch (Action) 36 | { 37 | case MouseAction_LeftButton: 38 | return Keyboard::GetInstance()->IsTapped(MK_LBUTTON); 39 | case MouseAction_RightButton: 40 | return Keyboard::GetInstance()->IsTapped(MK_RBUTTON); 41 | case MouseAction_MiddleButton: 42 | return Keyboard::GetInstance()->IsTapped(MK_MBUTTON); 43 | case MouseAction_ScrollUp: 44 | return Mouse::GetInstance()->GetIsScrolledUp(); 45 | case MouseAction_ScrollDown: 46 | return Mouse::GetInstance()->GetIsScrolledDown(); 47 | default: 48 | return false; 49 | } 50 | } 51 | 52 | bool MouseBinding::IsReleased() 53 | { 54 | switch (Action) 55 | { 56 | case MouseAction_LeftButton: 57 | return Keyboard::GetInstance()->IsReleased(MK_LBUTTON); 58 | case MouseAction_RightButton: 59 | return Keyboard::GetInstance()->IsReleased(MK_RBUTTON); 60 | case MouseAction_MiddleButton: 61 | return Keyboard::GetInstance()->IsReleased(MK_MBUTTON); 62 | case MouseAction_ScrollUp: 63 | return Mouse::GetInstance()->GetWasScrolledUp(); 64 | case MouseAction_ScrollDown: 65 | return Mouse::GetInstance()->GetWasScrolledDown(); 66 | default: 67 | return false; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/MouseBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInputBinding.h" 3 | #include "../Mouse/Mouse.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | enum MouseAction 8 | { 9 | MouseAction_LeftButton, 10 | MouseAction_RightButton, 11 | MouseAction_MiddleButton, 12 | MouseAction_ScrollUp, 13 | MouseAction_ScrollDown, 14 | }; 15 | 16 | class MouseBinding : public IInputBinding 17 | { 18 | public: 19 | MouseAction Action; 20 | 21 | MouseBinding(MouseAction action); 22 | ~MouseBinding(); 23 | 24 | bool IsDown() override; 25 | bool IsTapped() override; 26 | bool IsReleased() override; 27 | }; 28 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/XinputBinding.cpp: -------------------------------------------------------------------------------- 1 | #include "XinputBinding.h" 2 | #include "..\Xinput\Xinput.h" 3 | 4 | namespace TLAC::Input 5 | { 6 | XinputBinding::XinputBinding(BYTE keycode) : Keycode(keycode) 7 | { 8 | } 9 | 10 | XinputBinding::~XinputBinding() 11 | { 12 | } 13 | 14 | bool XinputBinding::IsDown() 15 | { 16 | return Xinput::GetInstance()->IsDown(Keycode); 17 | } 18 | 19 | bool XinputBinding::IsTapped() 20 | { 21 | return Xinput::GetInstance()->IsTapped(Keycode); 22 | } 23 | 24 | bool XinputBinding::IsReleased() 25 | { 26 | return Xinput::GetInstance()->IsReleased(Keycode); 27 | } 28 | 29 | bool XinputBinding::IsDoubleTapped() 30 | { 31 | return Xinput::GetInstance()->IsDoubleTapped(Keycode); 32 | } 33 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Bindings/XinputBinding.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "IInputBinding.h" 3 | #include 4 | #include 5 | 6 | namespace TLAC::Input 7 | { 8 | class XinputBinding : public IInputBinding 9 | { 10 | public: 11 | BYTE Keycode; 12 | 13 | XinputBinding(BYTE keycode); 14 | ~XinputBinding(); 15 | 16 | bool IsDown() override; 17 | bool IsTapped() override; 18 | bool IsReleased() override; 19 | bool IsDoubleTapped(); 20 | }; 21 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/Controller.cpp: -------------------------------------------------------------------------------- 1 | #include "Controller.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | Controller::Controller() 6 | { 7 | } 8 | 9 | Controller::~Controller() 10 | { 11 | 12 | } 13 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/Controller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DirectInputDevice.h" 3 | 4 | namespace TLAC::Input 5 | { 6 | class Controller : public DirectInputDevice 7 | { 8 | protected: 9 | Controller(); 10 | ~Controller(); 11 | }; 12 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/DirectInput.cpp: -------------------------------------------------------------------------------- 1 | #include "DirectInput.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | IDirectInput8 *IDirectInputInstance = nullptr; 6 | 7 | HRESULT InitializeDirectInput(HMODULE module) 8 | { 9 | HRESULT result = DirectInput8Create(module, DIRECTINPUT_VERSION, IID_IDirectInput8, (VOID**)&IDirectInputInstance, nullptr); 10 | return result; 11 | } 12 | 13 | bool DirectInputInitialized() 14 | { 15 | return IDirectInputInstance != nullptr; 16 | } 17 | 18 | void DisposeDirectInput() 19 | { 20 | if (IDirectInputInstance == nullptr) 21 | return; 22 | 23 | IDirectInputInstance->Release(); 24 | IDirectInputInstance = nullptr; 25 | } 26 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/DirectInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define DIRECTINPUT_VERSION 0x0800 3 | #include 4 | 5 | namespace TLAC::Input 6 | { 7 | extern IDirectInput8 *IDirectInputInstance; 8 | 9 | HRESULT InitializeDirectInput(HMODULE module); 10 | bool DirectInputInitialized(); 11 | void DisposeDirectInput(); 12 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/DirectInputDevice.cpp: -------------------------------------------------------------------------------- 1 | #include "DirectInputDevice.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | HRESULT DirectInputDevice::DI_CreateDevice(const GUID &guid) 6 | { 7 | if (!DirectInputInitialized()) 8 | return DIERR_NOTINITIALIZED; 9 | 10 | HRESULT result = IDirectInputInstance->CreateDevice(guid, &directInputdevice, NULL); 11 | return result; 12 | } 13 | 14 | HRESULT DirectInputDevice::DI_SetDataFormat(LPCDIDATAFORMAT dataFormat) 15 | { 16 | HRESULT result = directInputdevice->SetDataFormat(dataFormat); 17 | return result; 18 | } 19 | 20 | HRESULT DirectInputDevice::DI_SetCooperativeLevel(HWND windowHandle, DWORD flags) 21 | { 22 | HRESULT result = directInputdevice->SetCooperativeLevel(windowHandle, flags); 23 | return result; 24 | } 25 | 26 | HRESULT DirectInputDevice::DI_Acquire() 27 | { 28 | HRESULT result = directInputdevice->Acquire(); 29 | return result; 30 | } 31 | 32 | HRESULT DirectInputDevice::DI_Unacquire() 33 | { 34 | HRESULT result = directInputdevice->Unacquire(); 35 | return result; 36 | } 37 | 38 | HRESULT DirectInputDevice::DI_Release() 39 | { 40 | HRESULT result = directInputdevice->Release(); 41 | return result; 42 | } 43 | 44 | HRESULT DirectInputDevice::DI_Poll() 45 | { 46 | HRESULT result = directInputdevice->Poll(); 47 | return result; 48 | } 49 | 50 | HRESULT DirectInputDevice::DI_GetDeviceState(DWORD size, LPVOID data) 51 | { 52 | HRESULT result = directInputdevice->GetDeviceState(size, data); 53 | return result; 54 | } 55 | 56 | HRESULT DirectInputDevice::DI_SetRange(LONG min, LONG max) 57 | { 58 | DIPROPRANGE propData; 59 | propData.lMin = min; 60 | propData.lMax = max; 61 | 62 | propData.diph.dwSize = sizeof(DIPROPRANGE); 63 | propData.diph.dwHeaderSize = sizeof(DIPROPHEADER); 64 | propData.diph.dwHow = DIPH_DEVICE; 65 | propData.diph.dwObj = 0; 66 | 67 | HRESULT result = directInputdevice->SetProperty(DIPROP_RANGE, &propData.diph); 68 | return result; 69 | } 70 | 71 | HRESULT DirectInputDevice::DI_SetRawMode(BOOL raw) 72 | { 73 | // extra unacquire/acquire logic so this can be called on an active device 74 | BOOL wasAcquired = DI_Unacquire() == DI_OK; 75 | 76 | DIPROPDWORD propData; 77 | propData.dwData = raw ? DIPROPCALIBRATIONMODE_RAW : DIPROPCALIBRATIONMODE_COOKED; 78 | 79 | propData.diph.dwSize = sizeof(DIPROPDWORD); 80 | propData.diph.dwHeaderSize = sizeof(DIPROPHEADER); 81 | propData.diph.dwHow = DIPH_DEVICE; 82 | propData.diph.dwObj = 0; 83 | 84 | HRESULT result = NULL; 85 | 86 | if (FAILED(result = directInputdevice->SetProperty(DIPROP_CALIBRATIONMODE, &propData.diph))) 87 | return result; 88 | 89 | if (wasAcquired) 90 | result = DI_Acquire(); 91 | 92 | return result; 93 | } 94 | 95 | void DirectInputDevice::DI_Dispose() 96 | { 97 | if (directInputdevice == nullptr) 98 | return; 99 | 100 | HRESULT result = NULL; 101 | 102 | result = DI_Unacquire(); 103 | result = DI_Release(); 104 | } 105 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/DirectInputDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DirectInput.h" 3 | 4 | namespace TLAC::Input 5 | { 6 | class DirectInputDevice 7 | { 8 | protected: 9 | IDirectInputDevice8 *directInputdevice; 10 | 11 | HRESULT DI_CreateDevice(const GUID& guid); 12 | HRESULT DI_SetDataFormat(LPCDIDATAFORMAT dataFormat); 13 | HRESULT DI_SetCooperativeLevel(HWND windowHandle, DWORD flags); 14 | HRESULT DI_Acquire(); 15 | HRESULT DI_Unacquire(); 16 | HRESULT DI_Release(); 17 | HRESULT DI_Poll(); 18 | HRESULT DI_GetDeviceState(DWORD size, LPVOID data); 19 | HRESULT DI_SetRange(LONG min, LONG max); 20 | HRESULT DI_SetRawMode(BOOL raw); 21 | 22 | void DI_Dispose(); 23 | }; 24 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/DirectInputMouse.cpp: -------------------------------------------------------------------------------- 1 | #include "DirectInputMouse.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | DirectInputMouse::DirectInputMouse() 6 | { 7 | HRESULT result = NULL; 8 | 9 | result = DI_CreateDevice(GUID_SysMouse); 10 | 11 | if (FAILED(result)) 12 | return; 13 | 14 | result = DI_SetDataFormat(&c_dfDIMouse); 15 | result = DI_Acquire(); 16 | } 17 | 18 | DirectInputMouse::~DirectInputMouse() 19 | { 20 | DI_Dispose(); 21 | } 22 | 23 | bool DirectInputMouse::Poll() 24 | { 25 | if (!DirectInputInitialized()) 26 | return FALSE; 27 | 28 | HRESULT result = NULL; 29 | 30 | result = DI_Poll(); 31 | result = DI_GetDeviceState(sizeof(mouseState), &mouseState); 32 | 33 | return !FAILED(result); 34 | } 35 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/DirectInputMouse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "DirectInputDevice.h" 3 | 4 | namespace TLAC::Input 5 | { 6 | class DirectInputMouse : public DirectInputDevice 7 | { 8 | public: 9 | DirectInputMouse(); 10 | ~DirectInputMouse(); 11 | 12 | bool Poll(); 13 | 14 | inline long GetXPosition() { return mouseState.lX; }; 15 | inline long GetYPosition() { return mouseState.lY; }; 16 | inline long GetMouseWheel() { return mouseState.lZ; }; 17 | 18 | private: 19 | DIMOUSESTATE mouseState; 20 | }; 21 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/Ds4/Ds4Button.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Input 4 | { 5 | enum Direction 6 | { 7 | DIR_UP, 8 | DIR_RIGHT, 9 | DIR_DOWN, 10 | DIR_LEFT 11 | }; 12 | 13 | enum Ds4Button : int 14 | { 15 | DS4_SQUARE = 0, 16 | DS4_CROSS = 1, 17 | DS4_CIRCLE = 2, 18 | DS4_TRIANGLE = 3, 19 | 20 | DS4_L1 = 4, 21 | DS4_R1 = 5, 22 | 23 | DS4_L_TRIGGER = 6, 24 | DS4_R_TRIGGER = 7, 25 | 26 | DS4_SHARE = 8, 27 | DS4_OPTIONS = 9, 28 | 29 | DS4_L3 = 10, 30 | DS4_R3 = 11, 31 | 32 | DS4_PS = 12, 33 | DS4_TOUCH = 13, 34 | 35 | DS4_DPAD_UP, 36 | DS4_DPAD_RIGHT, 37 | DS4_DPAD_DOWN, 38 | DS4_DPAD_LEFT, 39 | 40 | DS4_L_STICK_UP, 41 | DS4_L_STICK_RIGHT, 42 | DS4_L_STICK_DOWN, 43 | DS4_L_STICK_LEFT, 44 | 45 | DS4_R_STICK_UP, 46 | DS4_R_STICK_RIGHT, 47 | DS4_R_STICK_DOWN, 48 | DS4_R_STICK_LEFT, 49 | 50 | DS4_BUTTON_MAX, 51 | }; 52 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/Ds4/Ds4State.cpp: -------------------------------------------------------------------------------- 1 | #include "Ds4State.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | Joystick::Joystick() : XAxis(0.0f), YAxis(0.0f) 6 | { 7 | return; 8 | }; 9 | 10 | Joystick::Joystick(float xAxis, float yAxis) : XAxis(xAxis), YAxis(yAxis) 11 | { 12 | return; 13 | }; 14 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/Ds4/Ds4State.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../DirectInput.h" 3 | #include "Ds4Button.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | struct Joystick 8 | { 9 | FLOAT XAxis, YAxis; 10 | 11 | Joystick(); 12 | Joystick(float xAxis, float yAxis); 13 | }; 14 | 15 | struct Dpad 16 | { 17 | BOOL IsDown; 18 | FLOAT Angle; 19 | Joystick Stick; 20 | }; 21 | 22 | struct Trigger 23 | { 24 | FLOAT Axis; 25 | }; 26 | 27 | struct Ds4State 28 | { 29 | DIJOYSTATE2 DI_JoyState; 30 | 31 | BYTE Buttons[DS4_BUTTON_MAX]; 32 | 33 | Dpad Dpad; 34 | Joystick LeftStick; 35 | Joystick RightStick; 36 | Trigger LeftTrigger; 37 | Trigger RightTrigger; 38 | }; 39 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/GenericUsb/GenericUsbInput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../Controller.h" 3 | #include "../../IInputDevice.h" 4 | #include "../../../Input/KeyConfig/Config.h" 5 | #include "GuState.h" 6 | #include 7 | 8 | namespace TLAC::Input 9 | { 10 | class GenericUsbInput : public Controller, public IInputDevice 11 | { 12 | public: 13 | GenericUsbInput(); 14 | ~GenericUsbInput(); 15 | 16 | static bool TryInitializeInstance(); 17 | 18 | bool Initialize(); 19 | bool PollInput() override; 20 | 21 | bool IsDown(GuButton button); 22 | bool IsUp(GuButton button); 23 | bool IsTapped(GuButton button); 24 | bool IsReleased(GuButton button); 25 | bool WasDown(GuButton button); 26 | bool WasUp(GuButton button); 27 | 28 | inline GuJoystick GetLeftStick() { return currentState.LeftStick; }; 29 | inline GuJoystick GetRightStick() { return currentState.RightStick; }; 30 | inline GuJoystick GetDpad() { return currentState.Dpad.Stick; }; 31 | 32 | static inline bool InstanceInitialized() { return instance != nullptr; }; 33 | static inline GenericUsbInput* GetInstance() { return instance; }; 34 | static inline void DeleteInstance() { delete instance; instance = nullptr; }; 35 | 36 | private: 37 | static GenericUsbInput* instance; 38 | 39 | GuState lastState; 40 | GuState currentState; 41 | 42 | std::unordered_map customKeyMapping; 43 | 44 | std::vector buttonNames = { "GU_BUTTON1", 45 | "GU_BUTTON2", 46 | "GU_BUTTON3", 47 | "GU_BUTTON4", 48 | "GU_BUTTON5", 49 | "GU_BUTTON6", 50 | "GU_BUTTON7", 51 | "GU_BUTTON8", 52 | "GU_BUTTON9", 53 | "GU_BUTTON10", 54 | "GU_BUTTON11", 55 | "GU_BUTTON12", 56 | "GU_BUTTON13", 57 | "GU_DPAD_UP", 58 | "GU_DPAD_RIGHT", 59 | "GU_DPAD_DOWN", 60 | "GU_DPAD_LEFT", 61 | "GU_L_STICK_UP", 62 | "GU_L_STICK_RIGHT", 63 | "GU_L_STICK_DOWN", 64 | "GU_L_STICK_LEFT", 65 | "GU_R_STICK_UP", 66 | "GU_R_STICK_RIGHT", 67 | "GU_R_STICK_DOWN", 68 | "GU_R_STICK_LEFT", 69 | "GU_BUTTON_MAX" 70 | }; 71 | 72 | const float triggerThreshold = 0.5f; 73 | const float joystickThreshold = 0.5f; 74 | const float dpadThreshold = 0.5f; 75 | 76 | inline float NormalizeTrigger(long value) { return (float)value / USHRT_MAX; }; 77 | inline float NormalizeStick(long value) { return (float)value / USHRT_MAX * 2.0f - 1.0f; }; 78 | inline GuJoystick NormalizeStick(long x, long y) { return GuJoystick(NormalizeStick(x), NormalizeStick(y)); }; 79 | 80 | void UpdateInternalGuState(GuState &state); 81 | 82 | bool MatchesDirection(GuJoystick joystick, GuDirection directionEnum, float threshold); 83 | bool GetButtonState(GuState &state, GuButton button); 84 | }; 85 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/GenericUsb/GuButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Input 4 | { 5 | enum GuDirection 6 | { 7 | GU_DIR_UP, 8 | GU_DIR_RIGHT, 9 | GU_DIR_DOWN, 10 | GU_DIR_LEFT 11 | }; 12 | 13 | enum GuButton : int 14 | { 15 | GU_BUTTON1 = 0, 16 | GU_BUTTON2 = 1, 17 | GU_BUTTON3 = 2, 18 | GU_BUTTON4 = 3, 19 | 20 | GU_BUTTON5 = 4, 21 | GU_BUTTON6 = 5, 22 | 23 | GU_BUTTON7 = 6, 24 | GU_BUTTON8 = 7, 25 | 26 | GU_BUTTON9 = 8, 27 | GU_BUTTON10 = 9, 28 | 29 | GU_BUTTON11 = 10, 30 | GU_BUTTON12 = 11, 31 | 32 | GU_BUTTON13 = 12, 33 | 34 | 35 | GU_DPAD_UP = 14, 36 | GU_DPAD_RIGHT = 15, 37 | GU_DPAD_DOWN = 16, 38 | GU_DPAD_LEFT = 17, 39 | 40 | GU_L_STICK_UP = 18, 41 | GU_L_STICK_RIGHT = 19, 42 | GU_L_STICK_DOWN = 20, 43 | GU_L_STICK_LEFT = 21, 44 | 45 | GU_R_STICK_UP = 22, 46 | GU_R_STICK_RIGHT = 23, 47 | GU_R_STICK_DOWN = 24, 48 | GU_R_STICK_LEFT = 25, 49 | 50 | GU_BUTTON_MAX = 26, 51 | }; 52 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/GenericUsb/GuState.cpp: -------------------------------------------------------------------------------- 1 | #include "GuState.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | GuJoystick::GuJoystick() : XAxis(0.0f), YAxis(0.0f) 6 | { 7 | return; 8 | }; 9 | 10 | GuJoystick::GuJoystick(float xAxis, float yAxis) : XAxis(xAxis), YAxis(yAxis) 11 | { 12 | return; 13 | }; 14 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/DirectInput/GenericUsb/GuState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../DirectInput.h" 3 | #include "GuButton.h" 4 | 5 | namespace TLAC::Input 6 | { 7 | struct GuJoystick 8 | { 9 | FLOAT XAxis, YAxis; 10 | 11 | GuJoystick(); 12 | GuJoystick(float xAxis, float yAxis); 13 | }; 14 | 15 | struct GuDpad 16 | { 17 | BOOL IsDown; 18 | FLOAT Angle; 19 | GuJoystick Stick; 20 | }; 21 | 22 | struct GuTrigger 23 | { 24 | FLOAT Axis; 25 | }; 26 | 27 | struct GuState 28 | { 29 | DIJOYSTATE2 DI_JoyState; 30 | 31 | BYTE Buttons[GU_BUTTON_MAX]; 32 | 33 | GuDpad Dpad; 34 | GuJoystick LeftStick; 35 | GuJoystick RightStick; 36 | GuTrigger LeftTrigger; 37 | GuTrigger RightTrigger; 38 | }; 39 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Divaller/Divaller.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../IInputDevice.h" 3 | #include "DivallerState.h" 4 | #include "DivallerButton.h" 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | namespace TLAC::Input 11 | { 12 | 13 | class Divaller : public IInputDevice 14 | { 15 | public: 16 | Divaller(); 17 | ~Divaller(); 18 | 19 | static bool TryInitializeInstance(); 20 | 21 | bool Initialize(); 22 | bool PollInput() override; 23 | bool SetLED(); 24 | bool IsDown(DivallerButton button); 25 | bool IsUp(DivallerButton button); 26 | bool IsTapped(DivallerButton button); 27 | bool IsReleased(DivallerButton button); 28 | 29 | bool WasDown(DivallerButton button); 30 | bool WasUp(DivallerButton button); 31 | uint32_t GetSlider(); 32 | static inline bool InstanceInitialized() { return instance != nullptr; }; 33 | static inline Divaller *GetInstance() { return instance; }; 34 | static inline void DeleteInstance() 35 | { 36 | delete instance; 37 | instance = nullptr; 38 | }; 39 | 40 | private: 41 | static Divaller *instance; 42 | DivallerState lastState; 43 | DivallerState currentState; 44 | WINUSB_INTERFACE_HANDLE hInterfaceHandle; 45 | HANDLE hDeviceHandle; 46 | UCHAR outputBuffer[100]; 47 | int *buttonLed = reinterpret_cast(0x14119b950); 48 | uint64_t *partionLed = reinterpret_cast(*(uint64_t *)0x140eda330 + 0xc9); 49 | uint64_t *sliderLedInit = reinterpret_cast((uint64_t *)0x14cc5dea8); 50 | UCHAR *sliderLedData = nullptr; 51 | }; 52 | } 53 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Divaller/DivallerButton.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Input 4 | { 5 | enum DivallerButton : int 6 | { 7 | DVL_SQUARE = 0, 8 | DVL_CROSS = 1, 9 | DVL_CIRCLE = 2, 10 | DVL_TRIANGLE = 3, 11 | 12 | DVL_FN = 4, 13 | 14 | DVL_L1 = 5, 15 | DVL_L2 = 6, 16 | DVL_L3 = 7, 17 | 18 | DVL_R1 = 8, 19 | DVL_R2 = 9, 20 | DVL_R3 = 10, 21 | 22 | DVL_UP = 11, 23 | DVL_LEFT = 12, 24 | DVL_DOWN = 13, 25 | DVL_RIGHT = 14, 26 | 27 | DVL_PAD = 11, 28 | DVL_SHARE = 12, 29 | DVL_HOME = 13, 30 | DVL_OPTION = 14 31 | }; 32 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Divaller/DivallerState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../../framework.h" 3 | namespace TLAC::Input 4 | { 5 | 6 | struct DivallerState 7 | { 8 | uint8_t state[24]; 9 | }; 10 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/IInputDevice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Input 4 | { 5 | class IInputDevice 6 | { 7 | public: 8 | virtual bool PollInput() = 0; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/KeyConfig/Config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "KeyString.h" 5 | #include "KeyStringHash.h" 6 | #include "../Bindings/Binding.h" 7 | #include "../DirectInput/Ds4/Ds4Button.h" 8 | #include "../DirectInput/GenericUsb/GuButton.h" 9 | 10 | namespace TLAC::Input::KeyConfig 11 | { 12 | typedef std::unordered_map KeycodeMap; 13 | typedef std::unordered_map Ds4ButtonMap; 14 | typedef std::unordered_map GuButtonMap; 15 | 16 | class Config 17 | { 18 | public: 19 | static KeycodeMap Keymap; 20 | static Ds4ButtonMap Ds4Map; 21 | static KeycodeMap XinputMap; 22 | static GuButtonMap GuMap; 23 | 24 | static void BindConfigKeys(std::unordered_map &configMap, const char *configKeyName, Binding &bindObj, std::vector defaultKeys); 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/KeyConfig/KeyString.cpp: -------------------------------------------------------------------------------- 1 | #include "KeyString.h" 2 | 3 | namespace TLAC::Input::KeyConfig 4 | { 5 | KeyString::KeyString(const char* str) : value(str) 6 | { 7 | } 8 | 9 | bool KeyString::operator==(const KeyString& rsv) const 10 | { 11 | return !_strcmpi(value.c_str(), rsv.value.c_str()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/KeyConfig/KeyString.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TLAC::Input::KeyConfig 5 | { 6 | struct KeyString 7 | { 8 | std::string value; 9 | 10 | KeyString(const char* str); 11 | bool operator==(const KeyString& rsv) const; 12 | }; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/KeyConfig/KeyStringHash.cpp: -------------------------------------------------------------------------------- 1 | #include "KeyStringHash.h" 2 | #include 3 | 4 | namespace TLAC::Input::KeyConfig 5 | { 6 | size_t KeyStringHash::operator()(const KeyString& key) const 7 | { 8 | std::string ret = key.value; 9 | std::transform(ret.begin(), ret.end(), ret.begin(), 10 | [](unsigned char c) { return std::tolower(c, std::locale()); }); 11 | return std::hash()(ret); 12 | } 13 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/KeyConfig/KeyStringHash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "KeyString.h" 3 | 4 | namespace TLAC::Input::KeyConfig 5 | { 6 | struct KeyStringHash 7 | { 8 | size_t operator()(const KeyString& key) const; 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Keyboard/Keyboard.cpp: -------------------------------------------------------------------------------- 1 | #include "Keyboard.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | Keyboard* Keyboard::instance; 6 | 7 | Keyboard::Keyboard() 8 | { 9 | } 10 | 11 | Keyboard* Keyboard::GetInstance() 12 | { 13 | if (instance == nullptr) 14 | instance = new Keyboard(); 15 | 16 | return instance; 17 | } 18 | 19 | bool Keyboard::PollInput() 20 | { 21 | lastState = currentState; 22 | 23 | float elapsed = keyIntervalWatch.Restart(); 24 | 25 | for (BYTE i = 0; i < KEYBOARD_KEYS; i++) 26 | { 27 | // DOWN 28 | bool isDown = GetAsyncKeyState(i) < 0; 29 | currentState.KeyStates[i] = isDown; 30 | 31 | // DOUBLE TAPPED 32 | bool isTapped = IsTapped(i); 33 | keyDoubleTapStates[i] = isTapped ? keyDoubleTapWatches[i].Restart() <= DOUBLE_TAP_THRESHOLD : false; 34 | 35 | // INTERVAL TAPPED 36 | keyIntervalTapStates[i] = isTapped; 37 | 38 | if (isTapped) 39 | { 40 | keyIntervalTapTimes[i] = 0; 41 | keyIntervalInitials[i] = true; 42 | } 43 | else if (isDown) 44 | { 45 | float threshold = keyIntervalInitials[i] ? INTERVAL_TAP_DELAY_THRESHOLD : INTERVAL_TAP_THRESHOLD; 46 | 47 | bool intervalTapped = (keyIntervalTapTimes[i] += elapsed) > threshold; 48 | keyIntervalTapStates[i] = intervalTapped; 49 | 50 | if (intervalTapped) 51 | { 52 | keyIntervalTapTimes[i] = 0; 53 | keyIntervalInitials[i] = false; 54 | } 55 | } 56 | } 57 | 58 | return true; 59 | } 60 | 61 | bool Keyboard::IsDown(BYTE keycode) 62 | { 63 | return currentState.IsDown(keycode); 64 | } 65 | 66 | bool Keyboard::IsUp(BYTE keycode) 67 | { 68 | return !IsDown(keycode); 69 | } 70 | 71 | bool Keyboard::IsTapped(BYTE keycode) 72 | { 73 | return IsDown(keycode) && WasUp(keycode); 74 | } 75 | 76 | bool Keyboard::IsDoubleTapped(BYTE keycode) 77 | { 78 | return keyDoubleTapStates[keycode]; 79 | } 80 | 81 | bool Keyboard::IsReleased(BYTE keycode) 82 | { 83 | return IsUp(keycode) && WasDown(keycode); 84 | } 85 | 86 | inline bool Keyboard::WasDown(BYTE keycode) 87 | { 88 | return lastState.IsDown(keycode); 89 | } 90 | 91 | inline bool Keyboard::WasUp(BYTE keycode) 92 | { 93 | return !WasDown(keycode); 94 | } 95 | 96 | bool Keyboard::IsIntervalTapped(BYTE keycode) 97 | { 98 | return keyIntervalTapStates[keycode]; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Keyboard/Keyboard.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../IInputDevice.h" 3 | #include "KeyboardState.h" 4 | #include "../../Utilities/Stopwatch.h" 5 | 6 | using Stopwatch = TLAC::Utilities::Stopwatch; 7 | 8 | namespace TLAC::Input 9 | { 10 | constexpr float DOUBLE_TAP_THRESHOLD = 200.0f; 11 | constexpr float INTERVAL_TAP_DELAY_THRESHOLD = 500.0f; 12 | constexpr float INTERVAL_TAP_THRESHOLD = 75.0f; 13 | 14 | class Keyboard : public IInputDevice 15 | { 16 | public: 17 | static Keyboard* GetInstance(); 18 | 19 | bool PollInput() override; 20 | bool IsDown(BYTE keycode); 21 | bool IsUp(BYTE keycode); 22 | bool IsTapped(BYTE keycode); 23 | bool IsDoubleTapped(BYTE keycode); 24 | bool IsReleased(BYTE keycode); 25 | bool IsIntervalTapped(BYTE keycode); 26 | 27 | bool WasDown(BYTE keycode); 28 | bool WasUp(BYTE keycode); 29 | 30 | private: 31 | Keyboard(); 32 | KeyboardState lastState; 33 | KeyboardState currentState; 34 | 35 | Stopwatch keyIntervalWatch; 36 | 37 | BYTE keyDoubleTapStates[KEYBOARD_KEYS]; 38 | Stopwatch keyDoubleTapWatches[KEYBOARD_KEYS]; 39 | 40 | BOOL keyIntervalInitials[KEYBOARD_KEYS]; 41 | BYTE keyIntervalTapStates[KEYBOARD_KEYS]; 42 | FLOAT keyIntervalTapTimes[KEYBOARD_KEYS]; 43 | 44 | static Keyboard* instance; 45 | }; 46 | } 47 | 48 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Keyboard/KeyboardState.cpp: -------------------------------------------------------------------------------- 1 | #include "KeyboardState.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | bool KeyboardState::IsDown(BYTE keycode) 6 | { 7 | return KeyStates[keycode]; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Keyboard/KeyboardState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TLAC::Input 5 | { 6 | const int KEYBOARD_KEYS = 0xFF; 7 | 8 | struct KeyboardState 9 | { 10 | BYTE KeyStates[KEYBOARD_KEYS]; 11 | 12 | bool IsDown(BYTE keycode); 13 | }; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Mouse/Mouse.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../IInputDevice.h" 3 | #include "../DirectInput/DirectInputMouse.h" 4 | #include "MouseState.h" 5 | 6 | namespace TLAC::Input 7 | { 8 | class Mouse : public IInputDevice 9 | { 10 | public: 11 | ~Mouse(); 12 | 13 | static Mouse* GetInstance(); 14 | 15 | bool PollInput() override; 16 | 17 | POINT GetPosition(); 18 | POINT GetRelativePosition(); 19 | POINT GetDeltaPosition(); 20 | 21 | long GetMouseWheel(); 22 | long GetDeltaMouseWheel(); 23 | 24 | bool HasMoved(); 25 | bool GetIsScrolledUp(); 26 | bool GetIsScrolledDown(); 27 | bool GetWasScrolledUp(); 28 | bool GetWasScrolledDown(); 29 | 30 | void SetPosition(int x, int y); 31 | 32 | private: 33 | Mouse(); 34 | MouseState lastState; 35 | MouseState currentState; 36 | DirectInputMouse* directInputMouse = nullptr; 37 | 38 | int* gameWidth; 39 | int* gameHeight; 40 | int* fbWidth; 41 | int* fbHeight; 42 | 43 | float xoffset; 44 | float scale; 45 | 46 | static Mouse* instance; 47 | }; 48 | } 49 | 50 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Mouse/MouseState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TLAC::Input 5 | { 6 | struct MouseState 7 | { 8 | POINT Position; 9 | POINT RelativePosition; 10 | long MouseWheel; 11 | bool ScrolledUp; 12 | bool ScrolledDown; 13 | }; 14 | } 15 | 16 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Xinput/Xinput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "../IInputDevice.h" 3 | #include 4 | #include "../../Utilities/Stopwatch.h" 5 | #include "XinputState.h" 6 | 7 | using Stopwatch = TLAC::Utilities::Stopwatch; 8 | 9 | namespace TLAC::Input 10 | { 11 | class Xinput : public IInputDevice 12 | { 13 | const float DOUBLE_TAP_THRESHOLD = 200.0f; 14 | const float INTERVAL_TAP_DELAY_THRESHOLD = 500.0f; 15 | const float INTERVAL_TAP_THRESHOLD = 75.0f; 16 | 17 | public: 18 | static Xinput* GetInstance(); 19 | 20 | bool PollInput() override; 21 | bool IsDown(BYTE keycode); 22 | bool IsUp(BYTE keycode); 23 | bool IsTapped(BYTE keycode); 24 | bool IsReleased(BYTE keycode); 25 | bool IsDoubleTapped(BYTE keycode); 26 | bool IsIntervalTapped(BYTE keycode); 27 | 28 | bool WasDown(BYTE keycode); 29 | bool WasUp(BYTE keycode); 30 | 31 | private: 32 | Xinput(); 33 | XinputState lastState; 34 | XinputState currentState; 35 | 36 | XINPUT_STATE state; 37 | 38 | BYTE KeyDoubleTapStates[0xFF]; 39 | Utilities::Stopwatch KeyDoubleTapWatches[0xFF]; 40 | 41 | Stopwatch keyIntervalWatch; 42 | 43 | BOOL keyIntervalInitials[0xFF]; 44 | BYTE keyIntervalTapStates[0xFF]; 45 | FLOAT keyIntervalTapTimes[0xFF]; 46 | 47 | static Xinput* instance; 48 | 49 | void SetTapStates(BYTE keycode, float elapsed); 50 | 51 | int xinput_num, rumble_left, rumble_right; 52 | bool rumble; 53 | }; 54 | } 55 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Xinput/XinputState.cpp: -------------------------------------------------------------------------------- 1 | #include "XinputState.h" 2 | 3 | namespace TLAC::Input 4 | { 5 | bool XinputState::IsDown(BYTE keycode) 6 | { 7 | return KeyStates[keycode]; 8 | } 9 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Input/Xinput/XinputState.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace TLAC::Input 5 | { 6 | struct XinputState 7 | { 8 | bool KeyStates[0x8F]; 9 | 10 | bool IsDown(BYTE keycode); 11 | }; 12 | } 13 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/EnumBitwiseOperations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Utilities 4 | { 5 | template inline T operator~ (T a) { return (T)~(int)a; } 6 | template inline T operator| (T a, T b) { return (T)((int)a | (int)b); } 7 | template inline T operator& (T a, T b) { return (T)((int)a & (int)b); } 8 | template inline T operator^ (T a, T b) { return (T)((int)a ^ (int)b); } 9 | template inline T& operator|= (T& a, T b) { return (T&)((int&)a |= (int)b); } 10 | template inline T& operator&= (T& a, T b) { return (T&)((int&)a &= (int)b); } 11 | template inline T& operator^= (T& a, T b) { return (T&)((int&)a ^= (int)b); } 12 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Math.cpp: -------------------------------------------------------------------------------- 1 | #define _USE_MATH_DEFINES 2 | #include "Math.h" 3 | 4 | namespace TLAC::Utilities 5 | { 6 | float ToDegrees(float radians) 7 | { 8 | return radians * (180.0f / M_PI); 9 | } 10 | 11 | float ToRadians(float degrees) 12 | { 13 | return (degrees * M_PI) / 180.0f; 14 | } 15 | 16 | Vec2 GetDirection(float degrees) 17 | { 18 | float radians = ToRadians(degrees); 19 | return Vec2(cos(radians), sin(radians)); 20 | } 21 | 22 | Vec2 PointFromAngle(float degrees, float distance) 23 | { 24 | float radians = ToRadians(degrees + 90.0f); 25 | return Vec2(-1 * std::cos(radians) * distance, -1 * std::sin(radians) * distance); 26 | } 27 | 28 | float AngleFromPoints(Vec2 p0, Vec2 p1) 29 | { 30 | return (float)(std::atan2(p1.Y - p0.Y, p1.X - p0.X) * 180.0 / M_PI) + 90.0f; 31 | } 32 | 33 | float ConvertRange(float originalStart, float originalEnd, float newStart, float newEnd, float value) 34 | { 35 | return newStart + ((value - originalStart) * (newEnd - newStart) / (originalEnd - originalStart)); 36 | } 37 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Math.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "Vec2.h" 4 | #include "Vec3.h" 5 | 6 | namespace TLAC::Utilities 7 | { 8 | float ToDegrees(float radians); 9 | float ToRadians(float degrees); 10 | 11 | Vec2 GetDirection(float degrees); 12 | Vec2 PointFromAngle(float degrees, float distance); 13 | float AngleFromPoints(Vec2 p0, Vec2 p1); 14 | float ConvertRange(float originalStart, float originalEnd, float newStart, float newEnd, float value); 15 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Operations.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Operations.h" 3 | 4 | namespace TLAC::Utilities 5 | { 6 | std::vector Split(const std::string& str, const std::string& delim) 7 | { 8 | std::vector tokens; 9 | size_t prev = 0, pos = 0; 10 | do 11 | { 12 | pos = str.find(delim, prev); 13 | if (pos == std::string::npos) 14 | pos = str.length(); 15 | 16 | std::string token = str.substr(prev, pos - prev); 17 | 18 | if (!token.empty()) 19 | tokens.push_back(token); 20 | 21 | prev = pos + delim.length(); 22 | } while (pos < str.length() && prev < str.length()); 23 | 24 | return tokens; 25 | } 26 | 27 | void LeftTrim(std::string &s) 28 | { 29 | s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) 30 | { 31 | return !std::isspace(ch); 32 | })); 33 | } 34 | 35 | void RightTrim(std::string &s) 36 | { 37 | s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) 38 | { 39 | return !std::isspace(ch); 40 | }).base(), s.end()); 41 | } 42 | 43 | void Trim(std::string &s) 44 | { 45 | s = trim(s); 46 | } 47 | 48 | std::string trim(const std::string& str, const std::string& whitespace) 49 | { 50 | const size_t strBegin = str.find_first_not_of(whitespace); 51 | 52 | if (strBegin == std::string::npos) 53 | return ""; 54 | 55 | const size_t strEnd = str.find_last_not_of(whitespace); 56 | const size_t strRange = strEnd - strBegin + 1; 57 | 58 | return str.substr(strBegin, strRange); 59 | } 60 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Operations.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace TLAC::Utilities 8 | { 9 | std::vector Split(const std::string& str, const std::string& delim); 10 | 11 | void LeftTrim(std::string &s); 12 | void RightTrim(std::string &s); 13 | void Trim(std::string &s); 14 | 15 | std::string trim(const std::string& str, const std::string& whitespace = " \t"); 16 | } 17 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Stopwatch.cpp: -------------------------------------------------------------------------------- 1 | #include "Stopwatch.h" 2 | 3 | namespace TLAC::Utilities 4 | { 5 | Stopwatch::Stopwatch() 6 | { 7 | } 8 | 9 | Stopwatch::~Stopwatch() 10 | { 11 | } 12 | 13 | void Stopwatch::Start() 14 | { 15 | start = high_resolution_clock::now(); 16 | } 17 | 18 | float Stopwatch::Stop() 19 | { 20 | end = high_resolution_clock::now(); 21 | return GetElapsed(); 22 | } 23 | 24 | float Stopwatch::Restart() 25 | { 26 | float elapsed = Stop(); 27 | Start(); 28 | 29 | return elapsed; 30 | } 31 | 32 | float Stopwatch::GetElapsed() 33 | { 34 | return (float)(chrono::duration_cast(end - start).count() / TIME_FACTOR); 35 | } 36 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Stopwatch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace chrono = std::chrono; 5 | 6 | typedef chrono::time_point steady_clock; 7 | typedef chrono::high_resolution_clock high_resolution_clock; 8 | 9 | namespace TLAC::Utilities 10 | { 11 | class Stopwatch 12 | { 13 | const float TIME_FACTOR = 1000.0f; 14 | 15 | public: 16 | Stopwatch(); 17 | ~Stopwatch(); 18 | 19 | void Start(); 20 | float Stop(); 21 | float Restart(); 22 | 23 | float GetElapsed(); 24 | 25 | private: 26 | steady_clock start; 27 | steady_clock end; 28 | }; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Vec2.cpp: -------------------------------------------------------------------------------- 1 | #include "Vec2.h" 2 | 3 | namespace TLAC::Utilities 4 | { 5 | Vec2::Vec2() 6 | { 7 | }; 8 | 9 | Vec2::Vec2(float x, float y) : X(x), Y(y) 10 | { 11 | }; 12 | 13 | Vec2 Vec2::operator+(Vec2 value) 14 | { 15 | return Vec2(X + value.X, Y + value.Y); 16 | } 17 | 18 | void Vec2::operator+=(const Vec2 &value) 19 | { 20 | X += value.X; 21 | Y += value.Y; 22 | } 23 | 24 | Vec2 Vec2::operator-(Vec2 value) 25 | { 26 | return Vec2(X - value.X, Y - value.Y); 27 | } 28 | 29 | void Vec2::operator-=(const Vec2 &value) 30 | { 31 | X -= value.X; 32 | Y -= value.Y; 33 | } 34 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Vec2.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | namespace TLAC::Utilities 4 | { 5 | struct Vec2 6 | { 7 | float X, Y; 8 | 9 | Vec2(); 10 | Vec2(float x, float y); 11 | 12 | Vec2 operator+(Vec2 value); 13 | void operator+=(const Vec2 &value); 14 | 15 | Vec2 operator-(Vec2 value); 16 | void operator-=(const Vec2 &value); 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Vec3.cpp: -------------------------------------------------------------------------------- 1 | #include "Vec3.h" 2 | 3 | namespace TLAC::Utilities 4 | { 5 | Vec3::Vec3() 6 | { 7 | }; 8 | 9 | Vec3::Vec3(float x, float y, float z) : X(x), Y(y), Z(z) 10 | { 11 | }; 12 | 13 | Vec3 Vec3::operator+(Vec2 value) 14 | { 15 | return Vec3(X + value.X, Y, Z + value.Y); 16 | } 17 | 18 | void Vec3::operator+=(const Vec2 &value) 19 | { 20 | X += value.X; 21 | Z += value.Y; 22 | } 23 | 24 | Vec3 Vec3::operator-(Vec2 value) 25 | { 26 | return Vec3(X - value.X, Y, Z - value.Y); 27 | } 28 | 29 | void Vec3::operator-=(const Vec2 &value) 30 | { 31 | X -= value.X; 32 | Z -= value.Y; 33 | } 34 | 35 | Vec3 Vec3::operator+(Vec3 value) 36 | { 37 | return Vec3(X + value.X, Y + value.Y, Z + value.Z); 38 | } 39 | 40 | void Vec3::operator+=(const Vec3 &value) 41 | { 42 | X += value.X; 43 | Y += value.Y; 44 | Z += value.Z; 45 | } 46 | 47 | Vec3 Vec3::operator-(Vec3 value) 48 | { 49 | return Vec3(X - value.X, Y - value.Y, Z - value.Z); 50 | } 51 | 52 | void Vec3::operator-=(const Vec3 &value) 53 | { 54 | X -= value.X; 55 | Y -= value.Y; 56 | Z -= value.Z; 57 | } 58 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utilities/Vec3.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "Vec2.h" 3 | 4 | namespace TLAC::Utilities 5 | { 6 | struct Vec3 7 | { 8 | float X, Y, Z; 9 | 10 | Vec3(); 11 | Vec3(float x, float y, float z); 12 | 13 | // Vec2 14 | Vec3 operator+(Vec2 value); 15 | void operator+=(const Vec2 &value); 16 | 17 | Vec3 operator-(Vec2 value); 18 | void operator-=(const Vec2 &value); 19 | 20 | // Vec3 21 | Vec3 operator+(Vec3 value); 22 | void operator+=(const Vec3 &value); 23 | 24 | Vec3 operator-(Vec3 value); 25 | void operator-=(const Vec3 &value); 26 | }; 27 | } -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utils.cpp: -------------------------------------------------------------------------------- 1 | #include "Utils.h" 2 | #include 3 | 4 | void InjectCode(void* address, const std::vector data) 5 | { 6 | const size_t byteCount = data.size() * sizeof(uint8_t); 7 | 8 | DWORD oldProtect; 9 | VirtualProtect(address, byteCount, PAGE_EXECUTE_READWRITE, &oldProtect); 10 | memcpy(address, data.data(), byteCount); 11 | VirtualProtect(address, byteCount, oldProtect, nullptr); 12 | } 13 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/Utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | void InjectCode(void* address, const std::vector data); 5 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/framework.cpp: -------------------------------------------------------------------------------- 1 | #include "framework.h" 2 | #include 3 | 4 | namespace TLAC 5 | { 6 | typedef std::filesystem::path fspath; 7 | 8 | std::string *framework::moduleDirectory; 9 | 10 | HWND framework::DivaWindowHandle; 11 | HMODULE framework::Module; 12 | 13 | bool framework::inputDisable = false; 14 | 15 | std::string framework::GetModuleDirectory() 16 | { 17 | if (moduleDirectory == nullptr) 18 | { 19 | WCHAR modulePathBuffer[MAX_PATH]; 20 | GetModuleFileNameW(framework::Module, modulePathBuffer, MAX_PATH); 21 | 22 | fspath configPath = fspath(modulePathBuffer).parent_path(); 23 | moduleDirectory = new std::string(configPath.u8string()); 24 | } 25 | 26 | return *moduleDirectory; 27 | } 28 | 29 | RECT framework::GetWindowBounds() 30 | { 31 | RECT windowRect; 32 | GetWindowRect(DivaWindowHandle, &windowRect); 33 | 34 | return windowRect; 35 | } 36 | 37 | extern "C" __declspec(dllexport) void ChangeDivaWindowHandle(HWND hwnd) { 38 | framework::DivaWindowHandle = hwnd; 39 | return; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace TLAC 6 | { 7 | class framework 8 | { 9 | private: 10 | static std::string *moduleDirectory; 11 | 12 | public: 13 | static bool inputDisable; 14 | 15 | static HWND DivaWindowHandle; 16 | static HMODULE Module; 17 | 18 | static std::string GetModuleDirectory(); 19 | static RECT GetWindowBounds(); 20 | }; 21 | } 22 | -------------------------------------------------------------------------------- /source-code/source/plugins/TLAC/pluginconfig.h: -------------------------------------------------------------------------------- 1 | #include "PluginConfigApi.h" 2 | 3 | using namespace PluginConfig; 4 | 5 | extern "C" __declspec(dllexport) LPCWSTR GetPluginName(void) 6 | { 7 | return L"TLAC"; 8 | } 9 | 10 | extern "C" __declspec(dllexport) LPCWSTR GetPluginDescription(void) 11 | { 12 | return L"Provides keyboard/mouse/controller input, player data management, bug fixes for running on more PCs, etc.\nThis plugin is required."; 13 | } --------------------------------------------------------------------------------