├── .gitignore ├── .vscode ├── c_cpp_properties.json └── settings.json ├── 3gx.ld ├── 3gxtool.exe ├── 3gxtool64.exe ├── Build.bat ├── Credits.md ├── Includes ├── Folders │ ├── Battle.hpp │ ├── Computer.hpp │ ├── FestivalPlaza.hpp │ ├── Miscellaneous.hpp │ ├── Movement.hpp │ ├── PlayerSearchSystem.hpp │ └── Trainer.hpp ├── Helpers │ ├── Decryption.hpp │ ├── Helpers.hpp │ └── Lookup.hpp ├── csvc.h ├── stdafx.hpp └── types.h ├── LICENSE ├── Library ├── .vscode │ ├── c_cpp_properties.json │ └── settings.json ├── Includes │ ├── CTRPluginFramework.hpp │ ├── CTRPluginFramework │ │ ├── Graphics.hpp │ │ ├── Graphics │ │ │ ├── Color.hpp │ │ │ ├── CustomIcon.hpp │ │ │ ├── OSD.hpp │ │ │ └── Render.hpp │ │ ├── Menu.hpp │ │ ├── Menu │ │ │ ├── Keyboard.hpp │ │ │ ├── MenuEntry.hpp │ │ │ ├── MenuEntryHotkeys.hpp │ │ │ ├── MenuFolder.hpp │ │ │ ├── MessageBox.hpp │ │ │ └── PluginMenu.hpp │ │ ├── System.hpp │ │ ├── System │ │ │ ├── Clock.hpp │ │ │ ├── Controller.hpp │ │ │ ├── Directory.hpp │ │ │ ├── File.hpp │ │ │ ├── FwkSettings.hpp │ │ │ ├── Hook.hpp │ │ │ ├── Lock.hpp │ │ │ ├── Mutex.hpp │ │ │ ├── Process.hpp │ │ │ ├── Rect.hpp │ │ │ ├── Sleep.hpp │ │ │ ├── System.hpp │ │ │ ├── Task.hpp │ │ │ ├── Thread.hpp │ │ │ ├── Time.hpp │ │ │ ├── Touch.hpp │ │ │ └── Vector.hpp │ │ ├── Utils.hpp │ │ └── Utils │ │ │ ├── LineReader.hpp │ │ │ ├── LineWriter.hpp │ │ │ ├── StringExtensions.hpp │ │ │ └── Utils.hpp │ ├── CTRPluginFrameworkImpl │ │ ├── ActionReplay │ │ │ ├── ARCode.hpp │ │ │ ├── ARCodeEditor.hpp │ │ │ ├── ARHandler.hpp │ │ │ └── MenuEntryActionReplay.hpp │ │ ├── Disassembler │ │ │ └── arm_disasm.h │ │ ├── Graphics.hpp │ │ ├── Graphics │ │ │ ├── BMPImage.hpp │ │ │ ├── Button.hpp │ │ │ ├── ComboBox.hpp │ │ │ ├── Drawable.hpp │ │ │ ├── FloatingButton.hpp │ │ │ ├── Font.hpp │ │ │ ├── Icon.hpp │ │ │ ├── Line.hpp │ │ │ ├── MessageBoxImpl.hpp │ │ │ ├── NumericTextBox.hpp │ │ │ ├── OSDImpl.hpp │ │ │ ├── PrivColor.hpp │ │ │ ├── Renderer.hpp │ │ │ ├── TextBox.hpp │ │ │ ├── TouchKey.hpp │ │ │ ├── TouchKeyString.hpp │ │ │ ├── UIContainer.hpp │ │ │ └── Window.hpp │ │ ├── Menu.hpp │ │ ├── Menu │ │ │ ├── Converter.hpp │ │ │ ├── GatewayRAMDumper.hpp │ │ │ ├── GuideReader.hpp │ │ │ ├── HexEditor.hpp │ │ │ ├── HotkeysModifier.hpp │ │ │ ├── KeyboardImpl.hpp │ │ │ ├── Menu.hpp │ │ │ ├── MenuEntryImpl.hpp │ │ │ ├── MenuEntryTools.hpp │ │ │ ├── MenuFolderImpl.hpp │ │ │ ├── MenuItem.hpp │ │ │ ├── PluginMenuActionReplay.hpp │ │ │ ├── PluginMenuExecuteLoop.hpp │ │ │ ├── PluginMenuHome.hpp │ │ │ ├── PluginMenuImpl.hpp │ │ │ ├── PluginMenuSearch.hpp │ │ │ ├── PluginMenuTools.hpp │ │ │ ├── SearchMenu.hpp │ │ │ ├── SubMenu.hpp │ │ │ └── WatchPointManager.hpp │ │ ├── Preferences.hpp │ │ ├── Search │ │ │ ├── Search.hpp │ │ │ ├── Search32.hpp │ │ │ └── SearchBase.hpp │ │ ├── System.hpp │ │ ├── System │ │ │ ├── EventManager.hpp │ │ │ ├── Events.hpp │ │ │ ├── FSPath.hpp │ │ │ ├── Heap.hpp │ │ │ ├── HookManager.hpp │ │ │ ├── IAllocator.hpp │ │ │ ├── Kernel.hpp │ │ │ ├── MMU.hpp │ │ │ ├── ProcessImpl.hpp │ │ │ ├── Scheduler.hpp │ │ │ ├── Screen.hpp │ │ │ ├── Screenshot.hpp │ │ │ ├── Services │ │ │ │ └── Gsp.hpp │ │ │ ├── Storage.hpp │ │ │ └── SystemImpl.hpp │ │ └── main.hpp │ ├── Framework │ │ ├── Bit.hpp │ │ ├── CRO.hpp │ │ ├── Checks.hpp │ │ ├── Hotkeys.hpp │ │ ├── KeyboardPlus.hpp │ │ ├── Language.hpp │ │ ├── ProcessPlus.hpp │ │ └── Wrappers.hpp │ ├── Headers.h │ ├── Headers.hpp │ ├── Unicode.h │ ├── csvc.h │ ├── ctrulibExtension.h │ ├── font6x10Linux.h │ ├── plgldr.h │ └── types.h ├── Makefile ├── Sources │ ├── 3gx_crt0.s │ ├── CTRPluginFramework │ │ ├── Graphics │ │ │ ├── Color.cpp │ │ │ ├── CustomIcon.cpp │ │ │ ├── OSD.cpp │ │ │ └── Render.cpp │ │ ├── Menu │ │ │ ├── Keyboard.cpp │ │ │ ├── MenuEntry.cpp │ │ │ ├── MenuEntryHotkeys.cpp │ │ │ ├── MenuFolder.cpp │ │ │ ├── MessageBox.cpp │ │ │ └── PluginMenu.cpp │ │ ├── System │ │ │ ├── Clock.cpp │ │ │ ├── Controller.cpp │ │ │ ├── Directory.cpp │ │ │ ├── File.cpp │ │ │ ├── FwkSettings.cpp │ │ │ ├── Hook.cpp │ │ │ ├── Process.cpp │ │ │ ├── Sleep.cpp │ │ │ ├── System.cpp │ │ │ ├── Task.cpp │ │ │ ├── ThreadEx.cpp │ │ │ ├── Time.cpp │ │ │ └── Touch.cpp │ │ └── Utils │ │ │ ├── LineReader.cpp │ │ │ ├── LineWriter.cpp │ │ │ ├── StringExtensions.cpp │ │ │ └── Utils.cpp │ ├── CTRPluginFrameworkImpl │ │ ├── ActionReplay │ │ │ ├── ARCode.cpp │ │ │ ├── ARCodeEditor.cpp │ │ │ ├── ARCodeLoader.cpp │ │ │ ├── ARCodeWrite.cpp │ │ │ ├── ARHandler.cpp │ │ │ └── MenuEntryActionReplay.cpp │ │ ├── Disassembler │ │ │ └── arm_disasm.cpp │ │ ├── Graphics │ │ │ ├── BMPImage.cpp │ │ │ ├── Button.cpp │ │ │ ├── ComboBox.cpp │ │ │ ├── FloatinButton.cpp │ │ │ ├── FontImpl.cpp │ │ │ ├── Icons │ │ │ │ ├── About15.c │ │ │ │ ├── AddFavorite25.c │ │ │ │ ├── AddFavoriteFilled25.c │ │ │ │ ├── CapsLockOn15.c │ │ │ │ ├── CapsLockOnFilled15.c │ │ │ │ ├── CentreofGravity15.c │ │ │ │ ├── CheckedCheckbox.c │ │ │ │ ├── ClearSymbol15.c │ │ │ │ ├── ClearSymbolFilled15.c │ │ │ │ ├── Clipboard25.c │ │ │ │ ├── ClipboardFilled25.c │ │ │ │ ├── CloseWindow20.c │ │ │ │ ├── CloseWindowFilled20.c │ │ │ │ ├── Controller15.c │ │ │ │ ├── Cut25.c │ │ │ │ ├── CutFilled25.c │ │ │ │ ├── DefaultKeyboardCustomIcon.c │ │ │ │ ├── Duplicate25.c │ │ │ │ ├── DuplicateFilled25.c │ │ │ │ ├── Edit25.c │ │ │ │ ├── EditFilled25.c │ │ │ │ ├── EnterKey15.c │ │ │ │ ├── EnterKeyFilled15.c │ │ │ │ ├── File15.c │ │ │ │ ├── FolderFilled.c │ │ │ │ ├── GameController15.c │ │ │ │ ├── GameController25.c │ │ │ │ ├── GameControllerFilled25.c │ │ │ │ ├── Grid15.c │ │ │ │ ├── HandCursor15.c │ │ │ │ ├── Happy15.c │ │ │ │ ├── HappyFilled15.c │ │ │ │ ├── Icon.cpp │ │ │ │ ├── Info25.c │ │ │ │ ├── InfoFilled25.c │ │ │ │ ├── Keyboard25.c │ │ │ │ ├── KeyboardFilled25.c │ │ │ │ ├── Maintenance15.c │ │ │ │ ├── More15.c │ │ │ │ ├── Plus25.c │ │ │ │ ├── PlusFilled25.c │ │ │ │ ├── RAM15.c │ │ │ │ ├── Restart15.c │ │ │ │ ├── Rocket40.c │ │ │ │ ├── Save25.c │ │ │ │ ├── Search15.c │ │ │ │ ├── Settings15.c │ │ │ │ ├── Shutdown15.c │ │ │ │ ├── Star15.c │ │ │ │ ├── Trash25.c │ │ │ │ ├── TrashFilled25.c │ │ │ │ ├── UnCheckedCheckbox.c │ │ │ │ ├── Unsplash15.c │ │ │ │ └── UserManualFilled15.c │ │ │ ├── MessageBoxImpl.cpp │ │ │ ├── NumericTextBox.cpp │ │ │ ├── OSDImpl.cpp │ │ │ ├── PrivColor.cpp │ │ │ ├── Renderer.cpp │ │ │ ├── TextBox.cpp │ │ │ ├── TouchKey.cpp │ │ │ ├── TouchKeyString.cpp │ │ │ ├── UIContainer.cpp │ │ │ └── Window.cpp │ │ ├── Menu │ │ │ ├── Converter.cpp │ │ │ ├── GatewayRAMDumper.cpp │ │ │ ├── GuideReader.cpp │ │ │ ├── HexEditor.cpp │ │ │ ├── HotkeysModifier.cpp │ │ │ ├── KeyboardImpl.cpp │ │ │ ├── Menu.cpp │ │ │ ├── MenuEntryImpl.cpp │ │ │ ├── MenuEntryTools.cpp │ │ │ ├── MenuFolderImpl.cpp │ │ │ ├── MenuItem.cpp │ │ │ ├── PluginMenuActionReplay.cpp │ │ │ ├── PluginMenuExecuteLoop.cpp │ │ │ ├── PluginMenuHome.cpp │ │ │ ├── PluginMenuImpl.cpp │ │ │ ├── PluginMenuSearch.cpp │ │ │ ├── PluginMenuTools.cpp │ │ │ ├── SearchMenu.cpp │ │ │ ├── SubMenu.cpp │ │ │ └── WatchPointManager.cpp │ │ ├── Preferences.cpp │ │ ├── Search │ │ │ ├── Search.cpp │ │ │ ├── Search32.cpp │ │ │ └── SearchBase.cpp │ │ └── System │ │ │ ├── EventManager.cpp │ │ │ ├── FSPath.cpp │ │ │ ├── Heap.cpp │ │ │ ├── HookManager.cpp │ │ │ ├── Kernel.cpp │ │ │ ├── MMU.cpp │ │ │ ├── ProcessImpl.cpp │ │ │ ├── Scheduler.cpp │ │ │ ├── Screen.cpp │ │ │ ├── Screenshot.cpp │ │ │ ├── Services │ │ │ └── Gsp.cpp │ │ │ └── SystemImpl.cpp │ ├── Framework │ │ ├── Bit.cpp │ │ ├── CRO.cpp │ │ ├── Checks.cpp │ │ ├── Hotkeys.cpp │ │ ├── KeyboardPlus.cpp │ │ ├── Language.cpp │ │ └── ProcessPlus.cpp │ ├── LoadCROHooked.s │ ├── Utilities │ │ ├── AddFavorite25.c │ │ ├── AddFavorite25.png │ │ ├── AddFavoriteFilled25.c │ │ ├── AddFavoriteFilled25.png │ │ ├── FolderFilled.c │ │ ├── FolderFilled.png │ │ ├── libpng16.dll │ │ ├── png2c.exe │ │ ├── pngtoraw.py │ │ ├── ucrtbased.dll │ │ └── vcruntime140d.dll │ ├── csvc.s │ ├── ctrulibExtension │ │ ├── allocator │ │ │ ├── addrmap.h │ │ │ ├── linear.cpp │ │ │ ├── mem_pool.cpp │ │ │ ├── mem_pool.h │ │ │ ├── newlibHeap.c │ │ │ └── vram.cpp │ │ ├── aptExtension.c │ │ ├── fontExtension.c │ │ ├── hidExtension.c │ │ ├── system │ │ │ ├── allocateHeaps.cpp │ │ │ ├── appExit.c │ │ │ ├── ctru_exit.c │ │ │ ├── initSystem.c │ │ │ ├── readtp.s │ │ │ ├── stack_adjust.s │ │ │ └── syscalls.c │ │ └── thread.c │ ├── plgldr.c │ └── pluginInit.cpp └── lib │ └── libctrpf.a ├── Makefile ├── Multi-PokemonFramework.plgInfo ├── Multi-PokemonFramework.png ├── README.md ├── Sources ├── Folders │ ├── Battle.cpp │ ├── Computer.cpp │ ├── FestivalPlaza.cpp │ ├── Miscellaneous.cpp │ ├── Movement.cpp │ ├── PlayerSearchSystem.cpp │ └── Trainer.cpp ├── Helpers │ ├── Decrpytion.cpp │ ├── Helpers.cpp │ └── Lookup.cpp ├── Main.cpp └── Menu.hpp └── boot.firm /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.d 3 | *.lst 4 | .vs/ 5 | Build/ 6 | .DS_Store 7 | *.3gx 8 | *.elf 9 | *.lnk 10 | *.lst 11 | *.zip 12 | desktop.ini 13 | luma/ -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "devkitpro" : "/opt/devkitpro", 4 | "devkitarm" : "C:/devkitPro/devkitARM", 5 | "ctrulib" : "C:/devkitPro/libctru" 6 | }, 7 | 8 | "configurations": [{ 9 | "name": "Library - Win", 10 | "includePath": [ 11 | "${default}", 12 | "${workspaceFolder}/**", 13 | "C:/devkitPro/devkitARM/arm-none-eabi/include/**", 14 | "C:/devkitPro/devkitARM/lib/**", 15 | "C:/devkitPro/msys2/usr/include", 16 | "C:/devkitPro/libctru/include", 17 | "C:/devkitPro/portlibs/3ds/bin" 18 | ], 19 | 20 | "defines": [ 21 | "ARM11", 22 | "_3DS" 23 | ], 24 | 25 | "browse": { 26 | "path": [ 27 | "${workspaceFolder}/Library/Includes/**", 28 | "C:/devkitPro/libctru/include/**" 29 | ], 30 | 31 | "limitSymbolsToIncludedHeaders": true, 32 | "databaseFilename": "" 33 | }, 34 | 35 | "windowsSdkVersion": "10.0.18362.0", 36 | "compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-g++.exe", 37 | "cStandard": "c11", 38 | "cppStandard": "c++17", 39 | "intelliSenseMode": "gcc-arm" 40 | }], 41 | 42 | "version": 4 43 | } -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/.git": true, 4 | "**/.svn": true, 5 | "**/.hg": true, 6 | "**/CVS": true, 7 | "**/.DS_Store": true, 8 | "**/lib" : true, 9 | "**/debug" : true, 10 | "**/release" : true, 11 | "**/*.elf" : true, 12 | "**/*.3gx" : true, 13 | "**/*.tar.bz2" : true, 14 | "**/*.zip" : true 15 | }, 16 | 17 | "files.associations": { 18 | "array": "cpp", 19 | "atomic": "cpp", 20 | "bit": "cpp", 21 | "*.tcc": "cpp", 22 | "cctype": "cpp", 23 | "chrono": "cpp", 24 | "clocale": "cpp", 25 | "cmath": "cpp", 26 | "compare": "cpp", 27 | "concepts": "cpp", 28 | "cstdarg": "cpp", 29 | "cstddef": "cpp", 30 | "cstdint": "cpp", 31 | "cstdio": "cpp", 32 | "cstdlib": "cpp", 33 | "cstring": "cpp", 34 | "ctime": "cpp", 35 | "cwchar": "cpp", 36 | "cwctype": "cpp", 37 | "deque": "cpp", 38 | "list": "cpp", 39 | "map": "cpp", 40 | "string": "cpp", 41 | "unordered_map": "cpp", 42 | "vector": "cpp", 43 | "exception": "cpp", 44 | "algorithm": "cpp", 45 | "functional": "cpp", 46 | "iterator": "cpp", 47 | "memory": "cpp", 48 | "memory_resource": "cpp", 49 | "numeric": "cpp", 50 | "random": "cpp", 51 | "ratio": "cpp", 52 | "string_view": "cpp", 53 | "system_error": "cpp", 54 | "tuple": "cpp", 55 | "type_traits": "cpp", 56 | "utility": "cpp", 57 | "initializer_list": "cpp", 58 | "iosfwd": "cpp", 59 | "istream": "cpp", 60 | "limits": "cpp", 61 | "new": "cpp", 62 | "numbers": "cpp", 63 | "ostream": "cpp", 64 | "semaphore": "cpp", 65 | "sstream": "cpp", 66 | "stdexcept": "cpp", 67 | "stop_token": "cpp", 68 | "streambuf": "cpp", 69 | "thread": "cpp", 70 | "typeinfo": "cpp", 71 | "headers.hpp": "c", 72 | "ctrpluginframeworkimpl.hpp": "c", 73 | "graphics.hpp": "c", 74 | "gsp.hpp": "c", 75 | "renderer.hpp": "c", 76 | "line.hpp": "c", 77 | "clock.hpp": "c", 78 | "stringextensions.hpp": "c", 79 | "reent.h": "c", 80 | "mutex.hpp": "c", 81 | "iomanip": "cpp", 82 | "iostream": "cpp" 83 | } 84 | } -------------------------------------------------------------------------------- /3gxtool.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/semaj14/Multi-PokemonFramework/978fb34b36dce55b187ab67736198bb040a937cc/3gxtool.exe -------------------------------------------------------------------------------- /3gxtool64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/semaj14/Multi-PokemonFramework/978fb34b36dce55b187ab67736198bb040a937cc/3gxtool64.exe -------------------------------------------------------------------------------- /Build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cls 3 | make clean 4 | make -j 8 5 | 6 | mkdir luma\plugins\00040000001B5000 7 | echo. > "luma\plugins\00040000001B5000\Ultra Sun" 8 | copy "Multi-PokemonFramework.3gx" "luma\plugins\00040000001B5000" 9 | 10 | mkdir luma\plugins\00040000001B5100 11 | echo. > "luma\plugins\00040000001B5100\Ultra Moon" 12 | copy "Multi-PokemonFramework.3gx" "luma\plugins\00040000001B5100" 13 | 14 | mkdir luma\plugins\000400000011C400 15 | echo. > "luma\plugins\000400000011C400\Omega Ruby" 16 | copy "Multi-PokemonFramework.3gx" "luma\plugins\000400000011C400" 17 | 18 | mkdir luma\plugins\000400000011C500 19 | echo. > "luma\plugins\000400000011C500\Alpha Sapphire" 20 | copy "Multi-PokemonFramework.3gx" "luma\plugins\000400000011C500 21 | 22 | mkdir luma\plugins\0004000000055D00 23 | echo. > "luma\plugins\0004000000055D00\X" 24 | copy "Multi-PokemonFramework.3gx" "luma\plugins\0004000000055D00 25 | 26 | mkdir luma\plugins\0004000000055E00 27 | echo. > "luma\plugins\0004000000055E00\Y" 28 | copy "Multi-PokemonFramework.3gx" "luma\plugins\0004000000055E00 29 | 30 | mkdir luma\plugins\0004000000175E00 31 | echo. > "luma\plugins\0004000000175E00\Moon" 32 | copy "Multi-PokemonFramework.3gx" "luma\plugins\0004000000175E00 33 | 34 | mkdir luma\plugins\0004000000164800 35 | echo. > "luma\plugins\0004000000164800\Sun" 36 | copy "Multi-PokemonFramework.3gx" "luma\plugins\0004000000164800 37 | 38 | pause -------------------------------------------------------------------------------- /Credits.md: -------------------------------------------------------------------------------- 1 | ## Credits 2 | Thanks to [The Pixellizer Group](https://gitlab.com/thepixellizeross) for the CTRPluginFramework library that has allowed me to develop plugins with, and huge thanks to the following people who have contributed to the plugin: 3 | - [AnalogMan151](https://github.com/AnalogMan151) 4 | - [Hartie95](https://github.com/Hartie95) 5 | - [nyok0](https://github.com/nyok0) 6 | - [ymyn](https://gbatemp.net/members/ymyn.264104/) 7 | - [H4x0rSpooky](https://www.youtube.com/channel/UC-SFdCwwq3H1wJNKCsKMGPw) 8 | - Mura Chan 9 | - [FunkyGamer26](https://www.youtube.com/channel/UCu_YHU4ZHWORABbD-aosqPg) 10 | - [RedShyGuy](https://github.com/RedShyGuy/) 11 | - Tenzo 12 | - [PKHeX](https://github.com/kwsch/PKHeX) -------------------------------------------------------------------------------- /Includes/Folders/Battle.hpp: -------------------------------------------------------------------------------- 1 | #ifndef BATTLE_HPP 2 | #define BATTLE_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace Battle { 9 | namespace Universal { 10 | void SlotKB(MenuEntry *entry); 11 | void Condition(MenuEntry *entry); 12 | void StatisticsKB(MenuEntry *entry); 13 | void Statistics(MenuEntry *entry); 14 | void InvincibilityKB(MenuEntry *entry); 15 | void Invincibility(MenuEntry *entry); 16 | void Item(MenuEntry *entry); 17 | void Attacks(MenuEntry *entry); 18 | void PokeView(MenuEntry *entry); 19 | void AccessBag(MenuEntry *entry); 20 | void AlwaysShiny(MenuEntry *entry); 21 | void ExpMultiplierKB(MenuEntry *entry); 22 | void ExpMultiplier(MenuEntry *entry); 23 | void RevertDefault(MenuEntry *entry); 24 | void Shiny100(MenuEntry *entry); 25 | void DisableShinyLock(MenuEntry *entry); 26 | } 27 | 28 | namespace Gen6 { 29 | void Bypass1MegaRestrict(MenuEntry *entry); 30 | void NoEncounters(MenuEntry *entry); 31 | void Spawner(MenuEntry *entry); 32 | void RematchLegendary(MenuEntry *entry); 33 | void GuaranteedCatch(MenuEntry *entry); 34 | void CatchTrainersPokemon(MenuEntry *entry); 35 | } 36 | 37 | namespace Gen7 { 38 | void AlwaysCriticalHit(MenuEntry *entry); 39 | void Bypass1MegaRestrict(MenuEntry *entry); 40 | void InfiniteZMoves(MenuEntry *entry); 41 | void ZMovesWithoutCrystal(MenuEntry *entry); 42 | void UltraBurst(MenuEntry *entry); 43 | void NoEncounters(MenuEntry *entry); 44 | void Spawner(MenuEntry *entry); 45 | void RematchLegendary(MenuEntry *entry); 46 | void RefightTrainer(MenuEntry *entry); 47 | void RejectTrainerBattle(MenuEntry *entry); 48 | void GuaranteedCatch(MenuEntry *entry); 49 | void CanCatchTrial(MenuEntry *entry); 50 | void CatchTrainersPokemon(MenuEntry *entry); 51 | } 52 | 53 | void ApplyMusic(MenuEntry *entry); 54 | void MusicKB(MenuEntry *entry); 55 | } 56 | 57 | #endif -------------------------------------------------------------------------------- /Includes/Folders/Computer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COMPUTER_HPP 2 | #define COMPUTER_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace Computer { 9 | void PCBackup(MenuEntry *entry); 10 | 11 | namespace Editor { 12 | bool Setup(void); 13 | void Initialize(MenuEntry *entry); 14 | bool IsValid(u32 pointer, PK6 *pkmn); 15 | bool IsValid(u32 pointer, PK6 *pkmn, MenuEntry *entry); 16 | void Shinify(MenuEntry *entry); 17 | void Species(MenuEntry *entry); 18 | void IsNicknamed(MenuEntry *entry); 19 | void Nickname(MenuEntry *entry); 20 | void Gender(MenuEntry *entry); 21 | void Level(MenuEntry *entry); 22 | void Nature(MenuEntry *entry); 23 | void Form(MenuEntry *entry); 24 | void HeldItem(MenuEntry *entry); 25 | void Ability(MenuEntry *entry); 26 | void Friendship(MenuEntry *entry); 27 | void Language(MenuEntry *entry); 28 | void IsEgg(MenuEntry *entry); 29 | void Pokerus(MenuEntry *entry); 30 | void Country(MenuEntry *entry); 31 | void Region(MenuEntry *entry); 32 | void ConsoleRegion(MenuEntry *entry); 33 | void OriginGame(MenuEntry *entry); 34 | void MetLocation(MenuEntry *entry); 35 | void Ball(MenuEntry *entry); 36 | void MetLevel(MenuEntry *entry); 37 | void MetDate(MenuEntry *entry); 38 | void IsFatefulEncounter(MenuEntry *entry); 39 | void EggMetLoc(MenuEntry *entry); 40 | void EggMetDate(MenuEntry *entry); 41 | void IVs(MenuEntry *entry); 42 | void EVs(MenuEntry *entry); 43 | void Contest(MenuEntry *entry); 44 | void CurrentMoves(MenuEntry *entry); 45 | void PPUps(MenuEntry *entry); 46 | void RelearnMoves(MenuEntry *entry); 47 | void SID(MenuEntry *entry); 48 | void TID(MenuEntry *entry); 49 | void OTName(MenuEntry *entry); 50 | void LatestHandler(MenuEntry *entry); 51 | void Ribbons(MenuEntry *entry); 52 | } 53 | 54 | void Cloning(MenuEntry *entry); 55 | void CopyPokemonInTrade(MenuEntry *entry); 56 | void KeepOriginalPokemonKB(MenuEntry *entry); 57 | void KeepOriginalPokemon(MenuEntry *entry); 58 | void UnlockEveryBox(MenuEntry *entry); 59 | 60 | namespace Gen6 { 61 | void PCAnywhere(MenuEntry *entry); 62 | } 63 | 64 | namespace Gen7 { 65 | void PCAnywhere(MenuEntry *entry); 66 | } 67 | } 68 | 69 | #endif -------------------------------------------------------------------------------- /Includes/Folders/FestivalPlaza.hpp: -------------------------------------------------------------------------------- 1 | #ifndef FESTIVALPLAZA_HPP 2 | #define FESTIVALPLAZA_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace Plaza { 9 | namespace GlobalTradeStation { 10 | void ConfigurationKB(MenuEntry *entry); 11 | void Configuration(MenuEntry *entry); 12 | void BypassLimit(MenuEntry *entry); 13 | } 14 | 15 | void CurrentRank(MenuEntry *entry); 16 | void FCCollected(MenuEntry *entry); 17 | 18 | namespace Profile { 19 | void CurrentFC(MenuEntry *entry); 20 | void GuestsInteracted(MenuEntry *entry); 21 | void FacilitiesHosted(MenuEntry *entry); 22 | void MissionsParticipated(MenuEntry *entry); 23 | } 24 | 25 | void ImageCrashCounter(MenuEntry *entry); 26 | void AvoidSoftban(MenuEntry *entry); 27 | } 28 | 29 | #endif -------------------------------------------------------------------------------- /Includes/Folders/Miscellaneous.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MISCELLANEOUS_HPP 2 | #define MISCELLANEOUS_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace Misc { 9 | void Weather(MenuEntry *entry); 10 | void WeatherKB(MenuEntry *entry); 11 | 12 | void IsRenamable(MenuEntry *entry); 13 | void LearnAnyTeachables(MenuEntry *entry); 14 | void GetDayCareEgg(MenuEntry *entry); 15 | void FastDialogs(MenuEntry *entry); 16 | 17 | namespace Gen6 { 18 | void InstantEggHatch(MenuEntry *entry); 19 | void ViewValuesInSummary(MenuEntry *entry); 20 | void NoOutlines(MenuEntry *entry); 21 | } 22 | 23 | namespace Gen7 { 24 | void InstantEggHatch(MenuEntry *entry); 25 | void ViewValuesInSummary(MenuEntry *entry); 26 | void NoOutlines(MenuEntry *entry); 27 | } 28 | 29 | void BypassTextRestricts(MenuEntry *entry); 30 | void CustomKeyboardConfig(MenuEntry *entry); 31 | void CustomKeys(MenuEntry *entry); 32 | void PatchColorCrash(MenuEntry *entry); 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /Includes/Folders/Movement.hpp: -------------------------------------------------------------------------------- 1 | #ifndef MOVEMENT_HPP 2 | #define MOVEMENT_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace Movement { 9 | namespace Gen6 { 10 | namespace ORAS { 11 | void ModelSwapKB(MenuEntry *entry); 12 | } 13 | 14 | void UnlockLocations(MenuEntry *entry); 15 | void CanUseFlyAnywhere(MenuEntry *entry); 16 | void TeleportationKB(MenuEntry *entry); 17 | void Teleportation(MenuEntry *entry); 18 | void SpeedUp(MenuEntry *entry); 19 | void BypassWalls(MenuEntry *entry); 20 | void ActionMusicKB(MenuEntry *entry); 21 | void ActionMusic(MenuEntry *entry); 22 | void NoActionReset(MenuEntry *entry); 23 | } 24 | 25 | namespace Gen7 { 26 | void GetAllMounts(MenuEntry *entry); 27 | void CameraZoomOut(MenuEntry *entry); 28 | void RemovePlayerShadow(MenuEntry *entry); 29 | void SpeedUp(MenuEntry *entry); 30 | void BypassWalls(MenuEntry *entry); 31 | void TimeOfDay(MenuEntry *entry); 32 | } 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /Includes/Folders/PlayerSearchSystem.hpp: -------------------------------------------------------------------------------- 1 | #ifndef PLAYERSEARCHSYSTEM_HPP 2 | #define PLAYERSEARCHSYSTEM_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace PSS { 9 | namespace GlobalTradeStation { 10 | void ConfigurationKB(MenuEntry *entry); 11 | void Configuration(MenuEntry *entry); 12 | void BypassLimit(MenuEntry *entry); 13 | } 14 | 15 | namespace Profile { 16 | void Icons(MenuEntry *entry); 17 | void Nices(MenuEntry *entry); 18 | void Wishes(MenuEntry *entry); 19 | void Message(MenuEntry *entry); 20 | void History(MenuEntry *entry); 21 | void Location(MenuEntry *entry); 22 | void Links(MenuEntry *entry); 23 | void MiniSurvey(MenuEntry *entry); 24 | void Greets(MenuEntry *entry); 25 | } 26 | 27 | void GuageKB(MenuEntry *entry); 28 | void Guage(MenuEntry *entry); 29 | void UnlockEveryPower(MenuEntry *entry); 30 | void ShoutOut(MenuEntry *entry); 31 | void ClearUsersKB(MenuEntry *entry); 32 | void ClearUsers(MenuEntry *entry); 33 | void BypassHackedIcons(MenuEntry *entry); 34 | } 35 | 36 | #endif -------------------------------------------------------------------------------- /Includes/Folders/Trainer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef TRAINER_HPP 2 | #define TRAINER_HPP 3 | 4 | #include 5 | 6 | using namespace CTRPluginFramework; 7 | 8 | namespace Trainer { 9 | namespace Info { 10 | void IDs(MenuEntry *entry); 11 | void Name(MenuEntry *entry); 12 | void CopyToName(MenuEntry *entry); 13 | void PlayTimeKB(MenuEntry *entry); 14 | void PlayTime(MenuEntry *entry); 15 | void LanguageKB(MenuEntry *entry); 16 | void Language(MenuEntry *entry); 17 | } 18 | 19 | void MoneyKB(MenuEntry *entry); 20 | void Money(MenuEntry *entry); 21 | void BattlePointsKB(MenuEntry *entry); 22 | void BattlePoints(MenuEntry *entry); 23 | 24 | namespace Pouch { 25 | void ItemsKB(MenuEntry *entry); 26 | void Items(MenuEntry *entry); 27 | void MedicinesKB(MenuEntry *entry); 28 | void Medicines(MenuEntry *entry); 29 | void BerriesKB(MenuEntry *entry); 30 | void Berries(MenuEntry *entry); 31 | void Unlockable(MenuEntry *entry); 32 | } 33 | 34 | namespace Gen6 { 35 | void ModelSwapKB(MenuEntry *entry); 36 | void ModelSwap(MenuEntry *entry); 37 | void PokeMilesKB(MenuEntry *entry); 38 | void PokeMiles(MenuEntry *entry); 39 | void Badges(MenuEntry *entry); 40 | } 41 | 42 | namespace Gen7 { 43 | void ZCrystals(MenuEntry *entry); 44 | } 45 | 46 | void Pokedex(MenuEntry *entry); 47 | } 48 | 49 | #endif -------------------------------------------------------------------------------- /Includes/Helpers/Helpers.hpp: -------------------------------------------------------------------------------- 1 | #ifndef HELPERS_HPP 2 | #define HELPERS_HPP 3 | 4 | #include 5 | #include "stdafx.hpp" 6 | #include "../Library/Includes/Framework/Wrappers.hpp" 7 | 8 | namespace CTRPluginFramework { 9 | extern u8 data8; extern u16 data16; extern u32 data32; 10 | 11 | namespace Message { 12 | void Completed(void); 13 | void Interrupted(void); 14 | void Warning(void); 15 | } 16 | 17 | extern string bin; 18 | extern string path; 19 | 20 | bool IsCompatible(void); 21 | 22 | extern Lang currLang; 23 | string language(string english, string french, string italian); 24 | 25 | void Settings(MenuEntry *entry); 26 | 27 | namespace Helpers { 28 | struct ColoredText { 29 | string name; 30 | int val; 31 | }; 32 | 33 | extern ColoredText textColors[7]; 34 | extern bool TextColorizer(u32 address); 35 | 36 | namespace Battle { 37 | extern vector offset; 38 | } 39 | 40 | void MenuCallback(void); 41 | } 42 | 43 | bool IsInBattle(void); 44 | } 45 | 46 | #include "Decryption.hpp" 47 | #include "Lookup.hpp" 48 | 49 | #endif -------------------------------------------------------------------------------- /Includes/stdafx.hpp: -------------------------------------------------------------------------------- 1 | #ifndef STDAFX_HPP 2 | #define STDAFX_HPP 3 | 4 | #define _USE_MATH_DEFINES 5 | 6 | #include 7 | #include <3ds.h> 8 | #include "csvc.h" 9 | #include "types.h" 10 | 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | using namespace std; 27 | 28 | namespace CTRPluginFramework { 29 | using CallbackPointer = void (*)(void); 30 | using OnEventCallback = void(*)(Keyboard &, KeyboardEvent &Event); 31 | using String = string; 32 | using StringVector = vector; 33 | using uVector32 = vector; 34 | using uVector16 = vector; 35 | using uVector8 = vector; 36 | using sVector32 = vector; 37 | using sVector16 = vector; 38 | using sVector8 = vector; 39 | } 40 | 41 | #endif -------------------------------------------------------------------------------- /Includes/types.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef TYPES_H 3 | #define TYPES_H 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #define U64_MAX UINT64_MAX 10 | #ifndef SSIZE_MAX 11 | #ifdef SIZE_MAX 12 | #define SSIZE_MAX ((SIZE_MAX) >> 1) 13 | #endif 14 | #endif 15 | 16 | typedef uint8_t u8; 17 | typedef uint16_t u16; 18 | typedef uint32_t u32; 19 | typedef uint64_t u64; 20 | 21 | typedef int8_t s8; 22 | typedef int16_t s16; 23 | typedef int32_t s32; 24 | typedef int64_t s64; 25 | 26 | typedef volatile u8 vu8; 27 | typedef volatile u16 vu16; 28 | typedef volatile u32 vu32; 29 | typedef volatile u64 vu64; 30 | 31 | typedef volatile s8 vs8; 32 | typedef volatile s16 vs16; 33 | typedef volatile s32 vs32; 34 | typedef volatile s64 vs64; 35 | 36 | typedef u32 Handle; 37 | typedef s32 Result; 38 | 39 | // Thread Entrypoint function 40 | typedef void (*ThreadFunc)(void*); 41 | typedef void (*voidfn)(void); 42 | 43 | // Fix intellisense errors 44 | #ifdef _MSC_VER 45 | #define ALIGN(m) 46 | #define PACKED 47 | #define USED 48 | #define UNUSED 49 | #define DEPRECATED 50 | #define NAKED 51 | #define NORETURN 52 | 53 | #else 54 | #define ALIGN(m) __attribute__((aligned(m))) 55 | #define PACKED __attribute__((packed)) 56 | #define USED __attribute__((used)) 57 | #define UNUSED __attribute__((unused)) 58 | 59 | #ifndef LIBCTRU_NO_DEPRECATION 60 | #define DEPRECATED __attribute__ ((deprecated)) 61 | 62 | #else 63 | #define DEPRECATED 64 | 65 | #endif 66 | 67 | #define NAKED __attribute__((naked)) 68 | #define NORETURN __attribute__((noreturn)) 69 | 70 | #endif 71 | 72 | #define CUR_THREAD_HANDLE 0xFFFF8000 73 | #define CUR_PROCESS_HANDLE 0xFFFF8001 74 | 75 | #endif -------------------------------------------------------------------------------- /Library/.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "devkitpro" : "/opt/devkitpro", 4 | "devkitarm" : "C:/devkitPro/devkitARM", 5 | "ctrulib" : "C:/devkitPro/libctru" 6 | }, 7 | 8 | "configurations": [{ 9 | "name": "Library - Win", 10 | "includePath": [ 11 | "${default}", 12 | "${workspaceFolder}/**", 13 | "C:/devkitPro/devkitARM/arm-none-eabi/include/**", 14 | "C:/devkitPro/devkitARM/lib/**", 15 | "C:/devkitPro/msys2/usr/include", 16 | "C:/devkitPro/libctru/include", 17 | "C:/devkitPro/portlibs/3ds/bin" 18 | ], 19 | 20 | "defines": [ 21 | "ARM11", 22 | "_3DS" 23 | ], 24 | 25 | "browse": { 26 | "path": [ 27 | "${workspaceFolder}/Library/Includes/**", 28 | "C:/devkitPro/libctru/include/**" 29 | ], 30 | 31 | "limitSymbolsToIncludedHeaders": true, 32 | "databaseFilename": "" 33 | }, 34 | 35 | "windowsSdkVersion": "10.0.18362.0", 36 | "compilerPath": "C:/devkitPro/devkitARM/bin/arm-none-eabi-g++.exe", 37 | "cStandard": "c11", 38 | "cppStandard": "c++17", 39 | "intelliSenseMode": "gcc-arm" 40 | }], 41 | 42 | "version": 4 43 | } -------------------------------------------------------------------------------- /Library/.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/.git": true, 4 | "**/.svn": true, 5 | "**/.hg": true, 6 | "**/CVS": true, 7 | "**/.DS_Store": true, 8 | "**/lib" : true, 9 | "**/debug" : true, 10 | "**/release" : true, 11 | "**/*.elf" : true, 12 | "**/*.3gx" : true, 13 | "**/*.tar.bz2" : true, 14 | "**/*.zip" : true 15 | }, 16 | 17 | "files.associations": { 18 | "array": "cpp", 19 | "atomic": "cpp", 20 | "bit": "cpp", 21 | "*.tcc": "cpp", 22 | "cctype": "cpp", 23 | "chrono": "cpp", 24 | "clocale": "cpp", 25 | "cmath": "cpp", 26 | "compare": "cpp", 27 | "concepts": "cpp", 28 | "cstdarg": "cpp", 29 | "cstddef": "cpp", 30 | "cstdint": "cpp", 31 | "cstdio": "cpp", 32 | "cstdlib": "cpp", 33 | "cstring": "cpp", 34 | "ctime": "cpp", 35 | "cwchar": "cpp", 36 | "cwctype": "cpp", 37 | "deque": "cpp", 38 | "list": "cpp", 39 | "map": "cpp", 40 | "string": "cpp", 41 | "unordered_map": "cpp", 42 | "vector": "cpp", 43 | "exception": "cpp", 44 | "algorithm": "cpp", 45 | "functional": "cpp", 46 | "iterator": "cpp", 47 | "memory": "cpp", 48 | "memory_resource": "cpp", 49 | "numeric": "cpp", 50 | "random": "cpp", 51 | "ratio": "cpp", 52 | "string_view": "cpp", 53 | "system_error": "cpp", 54 | "tuple": "cpp", 55 | "type_traits": "cpp", 56 | "utility": "cpp", 57 | "initializer_list": "cpp", 58 | "iosfwd": "cpp", 59 | "istream": "cpp", 60 | "limits": "cpp", 61 | "new": "cpp", 62 | "numbers": "cpp", 63 | "ostream": "cpp", 64 | "semaphore": "cpp", 65 | "sstream": "cpp", 66 | "stdexcept": "cpp", 67 | "stop_token": "cpp", 68 | "streambuf": "cpp", 69 | "thread": "cpp", 70 | "typeinfo": "cpp" 71 | } 72 | } -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_HPP 2 | #define CTRPLUGINFRAMEWORK_HPP 3 | 4 | #include "CTRPluginFramework/Graphics.hpp" 5 | #include "CTRPluginFramework/Menu.hpp" 6 | #include "CTRPluginFramework/System.hpp" 7 | #include "CTRPluginFramework/Utils.hpp" 8 | 9 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Graphics.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_GRAPHICS_HPP 2 | #define CTRPLUGINFRAMEWORK_GRAPHICS_HPP 3 | 4 | #include "CTRPluginFramework/Graphics/Color.hpp" 5 | #include "CTRPluginFramework/Graphics/OSD.hpp" 6 | #include "CTRPluginFramework/Graphics/Render.hpp" 7 | 8 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Graphics/CustomIcon.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_CUSTOMICON_HPP 2 | #define CTRPLUGINFRAMEWORK_CUSTOMICON_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class CustomIcon { 8 | public: 9 | struct Pixel { 10 | u8 a; 11 | u8 b; 12 | u8 g; 13 | u8 r; 14 | }; 15 | 16 | Pixel *pixArray; 17 | int sizeX; 18 | int sizeY; 19 | bool isEnabled; 20 | 21 | CustomIcon(Pixel *pixArray, int sizeX, int sizeY, bool isEnabled); 22 | CustomIcon(); 23 | }; 24 | } 25 | 26 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Graphics/Render.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_RENDER_HPP 2 | #define CTRPLUGINFRAMEWORK_RENDER_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class Render { 8 | private: 9 | 10 | public: 11 | enum FontDrawMode { 12 | BOLD = (1 << 0), 13 | ITALIC = (1 << 1), 14 | UNDERLINE = (1 << 2), 15 | STRIKETHROUGH = (1 << 3), 16 | LINEDOTTED = (1 << 4) 17 | }; 18 | 19 | /** 20 | * \brief Gets the amount of pixels the text takes using the sysfont. 21 | * \param text Input text to calculate its width 22 | * \return Value of pixels the text takes. 23 | */ 24 | static float GetTextWidth(const string &text); 25 | }; 26 | } 27 | 28 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Menu.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_MENU_HPP 2 | #define CTRPLUGINFRAMEWORK_MENU_HPP 3 | 4 | #include "CTRPluginFramework/Menu/Keyboard.hpp" 5 | #include "CTRPluginFramework/Menu/MenuEntry.hpp" 6 | #include "CTRPluginFramework/Menu/MenuEntryHotkeys.hpp" 7 | #include "CTRPluginFramework/Menu/MenuFolder.hpp" 8 | #include "CTRPluginFramework/Menu/MessageBox.hpp" 9 | #include "CTRPluginFramework/Menu/PluginMenu.hpp" 10 | 11 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Menu/MessageBox.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_MESSAGEBOX_HPP 2 | #define CTRPLUGINFRAMEWORK_MESSAGEBOX_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | enum class DialogType { 8 | DialogOk, 9 | DialogOkCancel, 10 | DialogYesNo 11 | }; 12 | 13 | enum class ClearScreen { 14 | None = 0, 15 | Top = 1 << 1, 16 | Bottom = 1 << 2, 17 | Both = Top | Bottom 18 | }; 19 | 20 | class MessageBoxImpl; 21 | class MessageBox { 22 | public: 23 | MessageBox(const string &title, const string &message, DialogType dialogType = DialogType::DialogOk, ClearScreen clear = ClearScreen::None); 24 | MessageBox(const string &message, DialogType dialogType = DialogType::DialogOk, ClearScreen clear = ClearScreen::None); 25 | ~MessageBox(void); 26 | 27 | MessageBox &SetClear(ClearScreen screen); 28 | bool operator()(void) const; 29 | 30 | private: 31 | unique_ptr _messageBox; 32 | }; 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SYSTEM_HPP 2 | #define CTRPLUGINFRAMEWORK_SYSTEM_HPP 3 | 4 | #include "CTRPluginFramework/System/Clock.hpp" 5 | #include "CTRPluginFramework/System/Controller.hpp" 6 | #include "CTRPluginFramework/System/Directory.hpp" 7 | #include "CTRPluginFramework/System/File.hpp" 8 | #include "CTRPluginFramework/System/FwkSettings.hpp" 9 | #include "CTRPluginFramework/System/Hook.hpp" 10 | #include "CTRPluginFramework/System/Lock.hpp" 11 | #include "CTRPluginFramework/System/Mutex.hpp" 12 | #include "CTRPluginFramework/System/Process.hpp" 13 | #include "CTRPluginFramework/System/Task.hpp" 14 | #include "CTRPluginFramework/System/Thread.hpp" 15 | #include "CTRPluginFramework/System/Time.hpp" 16 | #include "CTRPluginFramework/System/Touch.hpp" 17 | #include "CTRPluginFramework/System/Sleep.hpp" 18 | #include "CTRPluginFramework/System/System.hpp" 19 | 20 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Clock.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMREWORK_CLOCK_HPP 2 | #define CTRPLUGINFRAMREWORK_CLOCK_HPP 3 | 4 | #include "CTRPluginFramework/System/Time.hpp" 5 | 6 | namespace CTRPluginFramework { 7 | class Clock { 8 | public: 9 | Clock(void); 10 | Clock(Time time); 11 | Time GetElapsedTime(void) const; 12 | bool HasTimePassed(Time time) const; 13 | Time Restart(void); 14 | 15 | private: 16 | Time _startTime; 17 | }; 18 | } 19 | 20 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Lock.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SYSTEM_LOCK_HPP 2 | #define CTRPLUGINFRAMEWORK_SYSTEM_LOCK_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class Mutex; 8 | class Lock { 9 | public: 10 | inline explicit Lock(LightLock &llock) : 11 | _type{LIGHTLOCK}, _llock{&llock} { 12 | LightLock_Lock(_llock); 13 | } 14 | 15 | inline explicit Lock(RecursiveLock &rlock) : 16 | _type{RECLOCK}, _rlock{&rlock} { 17 | RecursiveLock_Lock(_rlock); 18 | } 19 | 20 | inline explicit Lock(Mutex &mutex) : 21 | _type{MUTEX}, _mutex{&mutex} { 22 | mutex.Lock(); 23 | } 24 | 25 | inline ~Lock(void) { 26 | if (_type == LIGHTLOCK) 27 | LightLock_Unlock(_llock); 28 | 29 | else if (_type == RECLOCK) 30 | RecursiveLock_Unlock(_rlock); 31 | 32 | else if (_type == MUTEX) 33 | _mutex->Unlock(); 34 | } 35 | 36 | private: 37 | static const constexpr u32 LIGHTLOCK = 1; 38 | static const constexpr u32 RECLOCK = 2; 39 | static const constexpr u32 MUTEX = 3; 40 | const u32 _type; 41 | 42 | union { 43 | LightLock *_llock; 44 | RecursiveLock *_rlock; 45 | Mutex *_mutex; 46 | }; 47 | }; 48 | } 49 | 50 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Mutex.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SYSTEM_MUTEX_HPP 2 | #define CTRPLUGINFRAMEWORK_SYSTEM_MUTEX_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class Mutex { 8 | public: 9 | inline Mutex(void) { 10 | RecursiveLock_Init(&_lock); 11 | } 12 | 13 | inline ~Mutex(void) { 14 | // I suppose that we can "force" unlock the mutex 15 | if (_lock.counter > 0) { 16 | _lock.counter = 1; 17 | RecursiveLock_Unlock(&_lock); 18 | } 19 | } 20 | 21 | inline void Lock(void) { 22 | RecursiveLock_Lock(&_lock); 23 | } 24 | 25 | // Return true on failure 26 | inline bool TryLock(void) { 27 | return RecursiveLock_TryLock(&_lock) != 0; 28 | } 29 | 30 | inline void Unlock(void) { 31 | RecursiveLock_Unlock(&_lock); 32 | } 33 | 34 | private: 35 | RecursiveLock _lock; 36 | }; 37 | } 38 | 39 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Sleep.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SLEEP_HPP 2 | #define CTRPLUGINFRAMEWORK_SLEEP_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class Time; 8 | void Sleep(Time sleepTime); 9 | } 10 | 11 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/System.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SYSTEM_SYSTEM_HPP 2 | #define CTRPLUGINFRAMEWORK_SYSTEM_SYSTEM_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | enum class LanguageId { 8 | Japanese = 0, 9 | English, 10 | French, 11 | German, 12 | Italian, 13 | Spanish, 14 | ChineseSimplified, 15 | Korean, 16 | Dutch, 17 | Portugese, 18 | Russian, 19 | ChineseTraditional 20 | }; 21 | 22 | class System { 23 | public: 24 | /** 25 | * \brief Check if the current console is a New3DS 26 | * \return true if the current console is a New3DS,\n false otherwise 27 | */ 28 | static bool IsNew3DS(void); 29 | 30 | /** 31 | * @brief Check if plugin is running on Citra emulator 32 | * \return true if the plugin is running on Citra emulator 33 | */ 34 | static bool IsCitra(void); 35 | 36 | /** 37 | * 38 | * \brief Get the system's language (user defined) 39 | * \return The language of the system 40 | */ 41 | static LanguageId GetSystemLanguage(void); 42 | 43 | /** 44 | * \brief Get if the 3DS is connected to Internet 45 | * \return True if connected, false if not connected 46 | */ 47 | static bool IsConnectedToInternet(void); 48 | 49 | /** 50 | * \brief Check if the cfw is Luma3DS or not. A version number can be passed and if it's the case the function will return whether the version of the cfw is the same or higher (true) or inferior (false) 51 | * \param major An optional version 52 | * \param minor An optional version 53 | * \param revision An optional version 54 | * \return If the cfw is Luma3DS or not 55 | */ 56 | static bool CfwIsLuma3DS(u8 major = 0, u8 minor = 0, u8 revision = 0); 57 | 58 | /** 59 | * \brief A callback that will be called in std::abort if set 60 | */ 61 | static void (*OnAbort)(void); 62 | 63 | /** 64 | * \brief Causes a system hardware reboot. Does not return. 65 | */ 66 | static void Reboot(void) NORETURN; 67 | }; 68 | } 69 | 70 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Task.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SYSTEM_TASK_HPP 2 | #define CTRPLUGINFRAMEWORK_SYSTEM_TASK_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | using TaskFunc = s32 (*)(void*); 8 | 9 | struct TaskContext { 10 | atomic flags{0}; 11 | s32 affinity{-1}; 12 | s32 result{0}; 13 | void *arg{nullptr}; 14 | TaskFunc func{nullptr}; 15 | LightEvent event{}; 16 | }; 17 | 18 | using TaskContextPtr = shared_ptr; 19 | 20 | struct Task { 21 | enum Status { 22 | Idle = 0, 23 | Scheduled = 1, 24 | Processing = 2, 25 | Finished = 4 26 | }; 27 | 28 | enum Affinity { 29 | AppCore = 1 << 0, 30 | NewAppCore = 1 << 2, 31 | NewSysCore = 1 << 3, 32 | AppCores = AppCore | NewAppCore, 33 | SysCores = NewSysCore, 34 | AllCores = AppCores | SysCores 35 | }; 36 | 37 | TaskContextPtr context; 38 | 39 | explicit Task(TaskFunc func, void *arg = nullptr, s32 affinity = -1); 40 | Task(const Task &task); 41 | Task(Task &&task) noexcept; 42 | ~Task(void) = default; 43 | 44 | Task &operator = (const Task &right); 45 | Task &operator = (Task &&right) noexcept; 46 | 47 | /** 48 | * \brief Schedule a Task and starts it 49 | * \return 0 on operation success, -1 if the task is already running (check Status) 50 | */ 51 | int Start(void) const; 52 | int Start(void *arg) const; 53 | 54 | /** 55 | * \brief Wait for the Task to be completed 56 | * \return The result of the Task (returned by TaskFunc) 57 | */ 58 | s32 Wait(void) const; 59 | 60 | /** 61 | * \brief Get the current status of the Task 62 | * \return Task status (see enum) 63 | */ 64 | u32 Status(void) const; 65 | }; 66 | } 67 | 68 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Thread.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_SYSTEM_THREAD_HPP 2 | #define CTRPLUGINFRAMEWORK_SYSTEM_THREAD_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class ThreadEx { 8 | public: 9 | enum { 10 | IDLE, 11 | RUNNING, 12 | FINISHED 13 | }; 14 | 15 | ThreadEx(ThreadFunc entrypoint,u32 stackSize, u32 priority, int affinity); 16 | ~ThreadEx(void); 17 | 18 | Result Start(void *arg); 19 | Result Join(bool releaseResources); 20 | Handle GetHandle(void); 21 | u32 GetStatus(void); 22 | 23 | u8 priority{0x3F}; 24 | s8 affinity{-1}; 25 | 26 | static void Yield(void); 27 | 28 | private: 29 | u8 _state{IDLE}; 30 | Thread_tag *_thread{nullptr}; 31 | }; 32 | } 33 | 34 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Touch.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_TOUCH_HPP 2 | #define CTRPLUGINFRAMEWORK_TOUCH_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class Touch { 8 | public: 9 | static bool IsDown(void); 10 | static UIntVector GetPosition(void); 11 | }; 12 | } 13 | 14 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/System/Vector.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_VECTOR_HPP 2 | #define CTRPLUGINFRAMEWORK_VECTOR_HPP 3 | 4 | #include "types.h" 5 | 6 | namespace CTRPluginFramework { 7 | template 8 | class Vector { 9 | public: 10 | Vector(); 11 | Vector(T x, T y); 12 | template 13 | explicit Vector(const Vector &vector); 14 | 15 | T x; 16 | T y; 17 | }; 18 | 19 | template 20 | Vector::Vector() : 21 | x(0), 22 | y(0) 23 | {} 24 | 25 | template 26 | Vector::Vector(T x, T y) : 27 | x(x), 28 | y(y) 29 | {} 30 | 31 | template 32 | template 33 | Vector::Vector(const Vector &vector) : 34 | x(static_cast(vector.x)), 35 | y(static_cast(vector.y)) 36 | {} 37 | 38 | template 39 | Vector operator - (const Vector &vector) { 40 | return (Vector(-vector.x, -vector.y)); 41 | } 42 | 43 | template 44 | Vector operator - (const Vector &left, const Vector &right) { 45 | return (Vector(left.x - right.x, left.y - right.y)); 46 | } 47 | 48 | template 49 | Vector &operator -= (const Vector &left, const Vector &right) { 50 | left.x -= right.x; 51 | left.y -= right.y; 52 | return (left); 53 | } 54 | 55 | template 56 | Vector operator + (const Vector &left, const Vector &right) { 57 | return (Vector(left.x + right.x, left.y + right.y)); 58 | } 59 | 60 | template 61 | Vector &operator += (const Vector &left, const Vector &right) { 62 | left.x += right.x; 63 | left.y += right.y; 64 | return (left); 65 | } 66 | 67 | template 68 | Vector operator * (const Vector &left, T right) { 69 | return (Vector(left.x * right, left.y * right)); 70 | } 71 | 72 | template 73 | Vector operator * (const T left, const Vector &right) { 74 | return (Vector(right.x * left, right.y * left)); 75 | } 76 | 77 | template 78 | Vector &operator *= (Vector &left, const T right) { 79 | left.x *= right; 80 | left.y *= right; 81 | return (left); 82 | } 83 | 84 | template 85 | Vector operator / (const Vector &left, const T right) { 86 | return (Vector(left.x / right, left.y / right)); 87 | } 88 | 89 | template 90 | Vector &operator /= (Vector &left, const T right) { 91 | left.x /= right; 92 | left.y /= right; 93 | return (left); 94 | } 95 | 96 | template 97 | bool operator <= (const Vector &left, const Vector &right) { 98 | return (left.x <= right.x && left.y <= right.y); 99 | } 100 | 101 | template 102 | bool operator >= (const Vector &left, const Vector &right) { 103 | return (left.x >= right.x && left.y >= right.y); 104 | } 105 | 106 | typedef Vector UIntVector; 107 | typedef Vector IntVector; 108 | typedef Vector FloatVector; 109 | typedef Vector shortVector; 110 | } 111 | 112 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Utils.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_UTILS_HPP 2 | #define CTRPLUGINFRAMEWORK_UTILS_HPP 3 | 4 | #include "CTRPluginFramework/Utils/LineReader.hpp" 5 | #include "CTRPluginFramework/Utils/LineWriter.hpp" 6 | #include "CTRPluginFramework/Utils/Utils.hpp" 7 | #include "CTRPluginFramework/Utils/StringExtensions.hpp" 8 | 9 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Utils/LineReader.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_UTILS_LINEREADER_HPP 2 | #define CTRPLUGINFRAMEWORK_UTILS_LINEREADER_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class File; 8 | class LineReader { 9 | public: 10 | LineReader(File &file); 11 | ~LineReader(void); 12 | 13 | bool operator()(string &line); 14 | 15 | private: 16 | File &_file; 17 | u32 _offsetInBuffer; 18 | u32 _dataInBuffer; 19 | char *_buffer; 20 | }; 21 | 22 | class StringLineReader { 23 | public: 24 | StringLineReader(const string &str); 25 | bool operator()(string &line); 26 | 27 | private: 28 | const string &_strin; 29 | u32 _offset; 30 | }; 31 | } 32 | 33 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Utils/LineWriter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_LINEWRITER_HPP 2 | #define CTRPLUGINFRAMEWORK_LINEWRITER_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class File; 8 | class LineWriter { 9 | public: 10 | LineWriter(File &output); 11 | LineWriter(const LineWriter &right) = delete; 12 | LineWriter(LineWriter &&right) = delete; 13 | ~LineWriter(void); 14 | 15 | LineWriter &operator << (const string &input); 16 | LineWriter &operator = (const LineWriter &right) = delete; 17 | LineWriter &operator = (LineWriter &&right) = delete; 18 | 19 | static const string &endl(void); 20 | void Flush(void); 21 | void Close(void); 22 | 23 | private: 24 | File &_output; 25 | u32 _offsetInBuffer; 26 | u8 *_buffer; 27 | }; 28 | } 29 | 30 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFramework/Utils/StringExtensions.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_UTILS_STRINGEXTENSIONS_HPP 2 | #define CTRPLUGINFRAMEWORK_UTILS_STRINGEXTENSIONS_HPP 3 | 4 | #include 5 | #include "CTRPluginFramework/Graphics/Color.hpp" 6 | 7 | using namespace std; 8 | 9 | namespace CTRPluginFramework { 10 | // Return a string with the charcter that reset the color (0x18) 11 | string ResetColor(void); 12 | 13 | // Allows to use the flags from Render::FontDrawMode to draw text in different modes. 14 | string ToggleDrawMode(u32 flags); 15 | 16 | // Makes the text draw function skip to the specified X pixel. 17 | string SkipToPixel(u16 px); 18 | 19 | // Aligns the string to the center of the specified borders. (Default values = top window size) 20 | string CenterAlign(const string &str, u16 leftBorder = 35, u16 rightBorder = 370); 21 | 22 | // Aligns the string to the right of the specified borders. (Default values = top window size) 23 | string RightAlign(const string &str, u16 leftBorder = 35, u16 rightBorder = 370); 24 | 25 | // Adds a visual horizontal separator that takes an entire line. 26 | string HorizontalSeparator(); 27 | 28 | string operator << (const string &left, const char *right); 29 | string operator << (const string &left, const string &right); 30 | 31 | template ::value && !is_same::value>::type* = nullptr> 32 | string operator << (const string &left, T right) { 33 | return (left + to_string(right)); 34 | } 35 | } 36 | 37 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/ActionReplay/ARCode.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_ACTIONREPLAY_ARCODE_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_ACTIONREPLAY_ARCODE_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | namespace ActionReplayPriv { 8 | u32 Str2U32(const string &str, bool &error); 9 | } 10 | 11 | class File; 12 | class MenuItem; 13 | class MenuFolderImpl; 14 | class LineWriter; 15 | 16 | class ARCode { 17 | public: 18 | bool HasError; 19 | u8 Type; 20 | u32 Left; 21 | u32 Right; 22 | vector Data; 23 | string Text; 24 | 25 | ARCode(const ARCode &code); 26 | ARCode(u8 type, u32 left, u32 right); 27 | ARCode(const string &line, bool &error); 28 | string ToString(void) const; 29 | 30 | bool IsCodeWithData(void) const; 31 | bool Update(const string &line); 32 | bool Update(void); 33 | }; 34 | 35 | using ARCodeVector = vector; 36 | using HookVector = vector; 37 | 38 | struct ARCodeContext { 39 | ARCodeContext(); 40 | bool hasError; 41 | u32 storage[2]; 42 | ARCodeVector codes; 43 | HookVector *hooks; 44 | bool Update(void); 45 | void Clear(void); 46 | }; 47 | 48 | extern const vector g_codeTypes; 49 | 50 | void ActionReplay_OpenCheatsFile(File &output, bool create); 51 | 52 | /** 53 | * \brief Check if the code type is supported by this handler 54 | * \param left Left code value 55 | * \return True if the code type is valid 56 | */ 57 | bool ActionReplay_CheckCodeTypeValidity(u32 left); 58 | 59 | /** 60 | * \brief Check if the line has a valid code pattern (hex) 00000000 00000000 61 | * \param line The line to check 62 | * \return True if the line has correct hex values 63 | */ 64 | bool ActionReplay_IsHexCode(const string &line); 65 | 66 | /** 67 | * \brief Check if the line passed is a valid code 68 | * \param line The string to check 69 | * \return True if the line is a valid code 70 | */ 71 | bool ActionReplay_IsValidCode(const string &line); 72 | 73 | void ActionReplay_ProcessString(string &str, bool canNewLine = true); 74 | void ActionReplay_LoadCodes(MenuFolderImpl *dst); 75 | bool ActionReplay_WriteToFile(LineWriter &file, MenuItem *item); 76 | } 77 | 78 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/ActionReplay/ARCodeEditor.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_ACTIONREPLAY_ARCODEEDITOR 2 | #define CTRPLUGINFRAMEWORKIMPL_ACTIONREPLAY_ARCODEEDITOR 3 | 4 | #include "types.h" 5 | #include "CTRPluginFramework/System/Clock.hpp" 6 | #include "CTRPluginFrameworkImpl/ActionReplay/ARCode.hpp" 7 | #include "CTRPluginFrameworkImpl/Menu/Converter.hpp" 8 | #include "CTRPluginFrameworkImpl/Menu/KeyboardImpl.hpp" 9 | #include "CTRPluginFrameworkImpl/Menu/SubMenu.hpp" 10 | 11 | namespace CTRPluginFramework { 12 | class ARCodeEditor { 13 | using EventList = vector; 14 | 15 | public: 16 | struct CodeLine { 17 | enum { 18 | Empty = 1, 19 | Error = 1 << 2, 20 | Modified = 1 << 3, 21 | PatchData = 1 << 4, 22 | PatternData = 1 << 5, 23 | Asm = 1 << 6 24 | }; 25 | 26 | explicit CodeLine(ARCode &code); 27 | CodeLine(const CodeLine &right); 28 | CodeLine(CodeLine &&right); 29 | 30 | ARCode &base; 31 | ARCode *parent; 32 | u16 flags; 33 | u16 index; 34 | string display; 35 | string comment; 36 | 37 | CodeLine &operator = (CodeLine &&right); 38 | void Edit(u32 index, u32 value); 39 | void Update(void); 40 | }; 41 | 42 | ARCodeEditor(void); 43 | ~ARCodeEditor(void) {} 44 | 45 | // Return true if the user decided to close it 46 | bool operator()(EventList &eventList); 47 | static void Edit(ARCodeContext &ctx); 48 | 49 | private: 50 | void _ProcessEvent(Event &event); 51 | void _RenderTop(void); 52 | void _RenderBottom(void); 53 | void _Update(void); 54 | void _ReloadCodeLines(void); 55 | bool _exit; 56 | int _line; 57 | int _index; 58 | u16 _cursorPosX; 59 | u16 _cursorPosY; 60 | Clock _inputClock; 61 | ARCode *_clipboard; 62 | ARCodeContext *_context; 63 | Converter _converter; 64 | SubMenu _submenu; 65 | KeyboardImpl _keyboard; 66 | vector _codes; 67 | }; 68 | } 69 | 70 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/ActionReplay/ARHandler.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_ACTIONREPLAY_ARHANDLER_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_ACTIONREPLAY_ARHANDLER_HPP 3 | 4 | #include "types.h" 5 | #include "CTRPluginFrameworkImpl/ActionReplay/ARCode.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class ARHandler { 9 | public: 10 | struct Register { 11 | public: 12 | Register() { 13 | Clear(); 14 | } 15 | 16 | void Clear(void) { 17 | isVFP = false; 18 | value = 0; 19 | } 20 | 21 | bool isVFP; 22 | 23 | union { 24 | u32 value; 25 | float vfp; 26 | }; 27 | }; 28 | 29 | static u32 Offset[2]; 30 | static Register Data[2]; 31 | static u32 Storage[2]; 32 | static u32 ActiveOffset; 33 | static u32 ActiveData; 34 | static u32 ActiveStorage; 35 | static bool ExitCodeImmediately; 36 | static void Execute(ARCodeContext &ctx); 37 | 38 | private: 39 | static bool _Execute(const ARCodeVector &codes); 40 | }; 41 | } 42 | 43 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/ActionReplay/MenuEntryActionReplay.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_MENUENTRYACTIONREPLAY_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_MENUENTRYACTIONREPLAY_HPP 3 | 4 | #include "CTRPluginFrameworkImpl/ActionReplay/ARCode.hpp" 5 | #include "CTRPluginFrameworkImpl/Menu/MenuEntryImpl.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class MenuEntryActionReplay : public MenuEntryImpl { 9 | friend class Menu; 10 | 11 | public: 12 | MenuEntryActionReplay(const std::string &name, const std::string ¬e = ""); 13 | ~MenuEntryActionReplay(); 14 | MenuEntryActionReplay *Update(void); 15 | ARCodeContext context; 16 | }; 17 | } 18 | 19 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_GRAPHICSIMPL_HPP 2 | #define CTRPLUGINFRAMEWORK_GRAPHICSIMPL_HPP 3 | 4 | #include "CTRPluginFramework/System/Rect.hpp" 5 | #include "CTRPluginFramework/System/Vector.hpp" 6 | #include "CTRPluginFrameworkImpl/Graphics/BMPImage.hpp" 7 | #include "CTRPluginFrameworkImpl/Graphics/Button.hpp" 8 | #include "CTRPluginFrameworkImpl/Graphics/ComboBox.hpp" 9 | #include "CTRPluginFrameworkImpl/Graphics/Icon.hpp" 10 | #include "CTRPluginFrameworkImpl/Graphics/Line.hpp" 11 | #include "CTRPluginFrameworkImpl/Graphics/NumericTextBox.hpp" 12 | #include "CTRPluginFrameworkImpl/Graphics/OSDImpl.hpp" 13 | #include "CTRPluginFrameworkImpl/Graphics/PrivColor.hpp" 14 | #include "CTRPluginFrameworkImpl/Graphics/Renderer.hpp" 15 | #include "CTRPluginFrameworkImpl/Graphics/TextBox.hpp" 16 | #include "CTRPluginFrameworkImpl/Graphics/Window.hpp" 17 | #include "CTRPluginFrameworkImpl/System/Screen.hpp" 18 | 19 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/Button.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_BUTTON_H 2 | #define CTRPLUGINFRAMEWORK_BUTTON_H 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 6 | #include "CTRPluginFrameworkImpl/Graphics/Renderer.hpp" 7 | 8 | namespace CTRPluginFramework { 9 | class Button : public Drawable { 10 | using IconCallbackState = int (*)(int, int, bool); 11 | using IconCallback = int (*)(int, int); 12 | 13 | public: 14 | enum { 15 | Normal = 0, 16 | Toggle = 1 << 1, 17 | Icon = 1 << 3, 18 | Sysfont = 1 << 4, 19 | Rounded = 1 << 5 20 | }; 21 | 22 | Button(u32 type, const string &content, const IntRect &bounds, IconCallback icon); 23 | Button(u32 type, const string &content, const IntRect &bounds, IconCallbackState icon = nullptr); 24 | Button(u32 type, const IntRect &bounds, IconCallback icon); 25 | Button(u32 type, const IntRect &bounds, IconCallbackState icon = nullptr); 26 | ~Button(); 27 | 28 | bool operator()(void) override; 29 | void Draw(void) override; 30 | void Update(const bool isTouchDown, const IntVector &touchPos) override; 31 | void Enable(bool isEnabled); 32 | void Enable(void); 33 | void Disable(void); 34 | void Lock(void); 35 | void Unlock(void); 36 | void Execute(void); 37 | void SetState(bool state); 38 | bool GetState(void) const; 39 | 40 | private: 41 | u16 _posX; 42 | u16 _posY; 43 | u16 _limit; 44 | void *_icon{nullptr}; 45 | string _content; 46 | IntRect _bounds; 47 | Clock _clock; 48 | 49 | union { 50 | u32 _bitfield{0}; 51 | 52 | struct { 53 | bool _isIconBtn : 1; 54 | bool _isToggleBtn : 1; 55 | bool _useSysfont : 1; 56 | bool _isRounded : 1; 57 | 58 | bool _isEnabled : 1; 59 | bool _isLocked : 1; 60 | bool _state : 1; 61 | bool _isPressed : 1; 62 | bool _wasPressed : 1; 63 | bool _execute : 1; 64 | }; 65 | }; 66 | }; 67 | } 68 | 69 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/ComboBox.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_COMBOBOX_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_COMBOBOX_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class ComboBox : public Drawable { 9 | public: 10 | ComboBox(int posX, int posY, int width, int height); 11 | void Add(const string &item); 12 | void Clear(void); 13 | void Draw(void) override; 14 | void Update(const bool isTouchDown, const IntVector &touchPos) override; 15 | bool operator()(void) override; 16 | 17 | bool IsEnabled; 18 | bool IsVisible; 19 | int SelectedItem; 20 | 21 | private: 22 | bool _execute; 23 | bool _isTouched; 24 | IntRect _rectPos; 25 | vector _items; 26 | }; 27 | } 28 | 29 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/Drawable.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_DRAWABLE_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_DRAWABLE_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | class Drawable { 8 | public: 9 | virtual ~Drawable() {} 10 | virtual void Draw(void) = 0; 11 | virtual bool operator()(void) { return (false); } 12 | virtual void Update(const bool isTouchDown, const IntVector &touchPos) = 0; 13 | }; 14 | } 15 | 16 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/FloatingButton.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_FLOATINGBUTTON_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_FLOATINGBUTTON_HPP 3 | 4 | #include 5 | #include "Drawable.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class FloatingButton : Drawable { 9 | using IconCallback = int(*)(int, int); 10 | 11 | public: 12 | FloatingButton(const IntRect &pos, const IconCallback icon); 13 | ~FloatingButton(void) override; 14 | void Draw(void) override; 15 | bool operator()(void) override; 16 | void Update(const bool isTouchDown, const IntVector &touchPos) override; 17 | 18 | private: 19 | IconCallback _icon; 20 | IntRect _box; 21 | IntVector _lastTouch; 22 | bool _pressed; 23 | bool _enabled; 24 | bool _moving; 25 | }; 26 | } 27 | 28 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/Font.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_FONT_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_FONT_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | struct Glyph { 8 | float xOffset; 9 | float xAdvance; 10 | u8 *glyph; 11 | float Width(void) const; 12 | }; 13 | 14 | class Font { 15 | public: 16 | static Glyph *GetGlyph(u8 *&c); 17 | static Glyph *GetGlyph(char c); 18 | 19 | private: 20 | friend void Initialize(void); 21 | static void Initialize(void); 22 | 23 | // Cache a new glyph 24 | static Glyph *CacheGlyph(u32 glyphIndex); 25 | static Mutex _mutex; 26 | }; 27 | } 28 | 29 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/Line.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_LINE_HPP 2 | #define CTRPLUGINFRAMEWORK_LINE_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | template 8 | class Line { 9 | public: 10 | Line(T startX, T startY, T endX, T endY); 11 | Line(Vector startPoint, Vector endPoint); 12 | ~Line() {} 13 | 14 | Vector start; 15 | Vector end; 16 | }; 17 | 18 | typedef Line IntLine; 19 | typedef Line UIntLine; 20 | 21 | template 22 | Line::Line(T startX, T startY, T endX, T endY): 23 | start(startX, startY), 24 | end(endX, endY) 25 | {} 26 | 27 | template 28 | Line::Line(Vector startPoint, Vector endPoint) : 29 | start(startPoint), 30 | end(endPoint) 31 | {} 32 | } 33 | 34 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/MessageBoxImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_MESSAGEBOXIMPL_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_MESSAGEBOXIMPL_HPP 3 | 4 | #include 5 | #include "TextBox.hpp" 6 | #include "CTRPluginFrameworkImpl/System/Events.hpp" 7 | 8 | namespace CTRPluginFramework { 9 | class MessageBoxImpl { 10 | public: 11 | MessageBoxImpl(const string &title, const string &message, DialogType dtype, ClearScreen clear); 12 | MessageBoxImpl(const string &message, DialogType dtype, ClearScreen clear); 13 | ~MessageBoxImpl() {}; 14 | bool operator()(void); 15 | 16 | private: 17 | friend MessageBox; 18 | void _ProcessEvent(Event &event); 19 | void _Draw(void); 20 | 21 | string _title; 22 | string _message; 23 | DialogType _dialogType; 24 | ClearScreen _clearScreen; 25 | TextBox _textbox; 26 | bool _exit; 27 | int _cursor; 28 | u32 _exitKey; 29 | IntRect _box; 30 | }; 31 | } 32 | 33 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/NumericTextBox.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_NUMERICTEXTBOX_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_NUMERICTEXTBOX_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class NumericTextBox : public Drawable { 9 | public: 10 | enum class Type { 11 | Bits8, 12 | Bits16, 13 | Bits32, 14 | Float, 15 | }; 16 | 17 | NumericTextBox(int posX, int posY, int width, int height); 18 | void SetValue(u8 val); 19 | void SetValue(u16 val); 20 | void SetValue(u32 val); 21 | void SetValue(float val); 22 | 23 | void UseHexadecimal(bool useHex); 24 | 25 | void Clear(void); 26 | void Draw(void) override; 27 | void Update(const bool isTouchDown, const IntVector &touchPos) override; 28 | bool operator()(void) override; 29 | 30 | bool IsEnabled; 31 | bool IsVisible; 32 | Type ValueType; 33 | 34 | union { 35 | u8 Bits8; 36 | u16 Bits16; 37 | u32 Bits32; 38 | float Float; 39 | }; 40 | 41 | private: 42 | bool _execute; 43 | bool _isTouched; 44 | bool _isHexadecimal; 45 | IntRect _rectPos; 46 | string _text; 47 | 48 | void _UpdateVal(void); 49 | }; 50 | } 51 | 52 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/OSDImpl.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_OSDIMPL_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_OSDIMPL_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/FloatingButton.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | using OSDReturn = int(*)(u32, int, void*, void*, int, int, int); 9 | 10 | class OSDImpl { 11 | struct OSDMessage { 12 | string text; 13 | int width; 14 | bool drawn; 15 | Color foreground; 16 | Color background; 17 | Clock time; 18 | OSDMessage(const string &str, const Color &fg, const Color &bg); 19 | }; 20 | 21 | using OSDIter = vector::iterator; 22 | 23 | struct DrawNotifArgs { 24 | OSDIter begin; 25 | OSDIter end; 26 | int posY; 27 | }; 28 | 29 | public: 30 | static void Update(void); 31 | static bool Draw(void); 32 | static s32 DrawNotif_TaskFunc(void *arg); 33 | 34 | static void Lock(void); 35 | static bool TryLock(void); 36 | static void Unlock(void); 37 | 38 | static bool DrawSaveIcon; 39 | static bool MessColors; 40 | static u32 WaitingForScreenshot; 41 | static u32 FramesToPlay; 42 | static bool NeedToPauseFrame; 43 | static bool WritesToPrevFB; 44 | 45 | static Hook OSDHook; 46 | static RecursiveLock ReClock; 47 | static FloatingButton FloatingBtn; 48 | static Screen TopScreen; 49 | static Screen BottomScreen; 50 | static vector Notifications; 51 | static vector Callbacks; 52 | static vector CallbacksTrashBin; 53 | static void *previousFBAddr[2][2][2]; 54 | 55 | static bool IsFramePaused; 56 | static LightEvent OnNewFrameEvent; 57 | static LightEvent OnFramePaused; 58 | static LightEvent OnFrameResume; 59 | static Task DrawNotifTask1; 60 | static Task DrawNotifTask2; 61 | 62 | static u32 MainCallback(u32 isBottom, int arg2, void *leftFb, void *rightFb, int stride, int format, int arg7); 63 | static u32 MainCallback2(u32 r0, u32 *params, u32 isBottom, u32 arg); 64 | static Result OnTopScreenFrame(); 65 | static Result OnBottomScreenFrame(); 66 | static void CallbackCommon(u32 isBottom, void *leftFb, void *rightFb, int stride, int format, int swap); 67 | static void UpdateScreens(void); 68 | 69 | static int PauseFrame(void); 70 | static void WaitFramePaused(void); 71 | static void ResumeFrame(const u32 nbFrames = 0); 72 | 73 | private: 74 | friend class PluginMenu; 75 | friend class OSD; 76 | friend void KeepThreadMain(void *arg); 77 | static void _Initialize(void); 78 | }; 79 | } 80 | 81 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/PrivColor.hpp: -------------------------------------------------------------------------------- 1 | #ifndef COLOR_HPP 2 | #define COLOR_HPP 3 | 4 | #include 5 | 6 | namespace CTRPluginFramework { 7 | using FCPointer = Color (*)(u8*); 8 | using F8Pointer = u8 *(*)(u8 *, const Color&); 9 | 10 | class PrivColor { 11 | public: 12 | static thread_local FCPointer FromFramebuffer; 13 | static thread_local F8Pointer ToFramebuffer; 14 | 15 | static thread_local bool _useClamp; 16 | static thread_local IntRect _clampArea; 17 | 18 | static void UseClamp(bool willUse); 19 | static void UseClamp(bool willUse, const IntRect &rect); 20 | 21 | static GSPGPU_FramebufferFormat GetFormat(void); 22 | static void SetFormat(GSPGPU_FramebufferFormat format); 23 | 24 | private: 25 | friend class ScreenImpl; 26 | 27 | static Color _ReadRGBA8(u8 *src); 28 | static Color _ReadBGR8(u8 *src); 29 | static Color _ReadRGB565(u8 *src); 30 | static Color _ReadRGB5A1(u8 *src); 31 | static Color _ReadRGBA4(u8 *src); 32 | 33 | static u8 *_WriteRGBA8(u8 *dst, const Color &color); 34 | static u8 *_WriteBGR8(u8 *dst, const Color &color); 35 | static u8 *_WriteRGB565(u8 *dst, const Color &color); 36 | static u8 *_WriteRGB5A1(u8 *dst, const Color &color); 37 | static u8 *_WriteRGBA4(u8 *dst, const Color &color); 38 | 39 | static u8 *_WriteRGBA8Clamp(u8 *dst, const Color &color); 40 | static u8 *_WriteBGR8Clamp(u8 *dst, const Color &color); 41 | static u8 *_WriteRGB565Clamp(u8 *dst, const Color &color); 42 | static u8 *_WriteRGB5A1Clamp(u8 *dst, const Color &color); 43 | static u8 *_WriteRGBA4Clamp(u8 *dst, const Color &color); 44 | 45 | static thread_local GSPGPU_FramebufferFormat _format; 46 | }; 47 | } 48 | 49 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/TextBox.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORK_TEXTBOX_HPP 2 | #define CTRPLUGINFRAMEWORK_TEXTBOX_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics.hpp" 6 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 7 | #include "CTRPluginFrameworkImpl/System.hpp" 8 | 9 | namespace CTRPluginFramework { 10 | class TextBox : public Drawable { 11 | public: 12 | TextBox(); 13 | TextBox(const string &title, const string &text, const IntRect &box); 14 | ~TextBox() {} 15 | 16 | void Open(void) const; 17 | void Close(void) const; 18 | bool IsOpen(void) const; 19 | bool ProcessEvent(Event &event); 20 | void Update(const string &title, string &text); 21 | void Draw(void) override; 22 | void DrawConst(void) const; 23 | void Update(const bool isTouchDown, const IntVector &pos) override; 24 | 25 | private: 26 | friend class MessageBoxImpl; 27 | void _GetTextInfos(void); 28 | u8 *_GetWordWidth(u8 *str, float& width); 29 | 30 | vector _newline; 31 | string _title; 32 | const string *_text; 33 | IntRect _box; 34 | IntRect _border; 35 | mutable bool _isOpen; 36 | bool _displayScrollbar; 37 | bool _drawBox; 38 | bool _fastscroll; 39 | 40 | u32 _currentLine; 41 | u32 _maxLines; 42 | u32 _scrollbarSize; 43 | u32 _scrollCursorSize; 44 | u32 _maxScrollCursorPosY; 45 | float _scrollPadding; 46 | float _scrollPosition; 47 | Clock _inputClock; 48 | }; 49 | } 50 | 51 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/TouchKey.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_KEY_KEYBOARD_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_KEY_KEYBOARD_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics.hpp" 6 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 7 | 8 | namespace CTRPluginFramework { 9 | struct KeyContent { 10 | KeyContent(const string &str) : 11 | text{str}, width{Renderer::GetTextSize(str.c_str())} { 12 | u8 *s = reinterpret_cast(const_cast(str.c_str())); 13 | 14 | do { 15 | Glyph *glyph = Font::GetGlyph(s); 16 | 17 | if (glyph == nullptr) 18 | break; 19 | 20 | glyphs.push_back(glyph); 21 | 22 | } 23 | 24 | while (*s); 25 | } 26 | 27 | vector glyphs; 28 | string text; 29 | float width; 30 | }; 31 | 32 | class TouchKey : public Drawable { 33 | public: 34 | using IconCallback = int (*)(int, int, bool); 35 | 36 | TouchKey(TouchKey &&tk); 37 | TouchKey(int character, IntRect ui, bool enabled = true); 38 | TouchKey(const string &str, IntRect ui, int value = 0x12345678, bool enabled = true); 39 | TouchKey(int value, IconCallback, IntRect ui, bool enabled = true); 40 | ~TouchKey(); 41 | 42 | void Clear(void); 43 | void Enable(bool enable = true); 44 | bool IsEnabled(void); 45 | void DrawCharacter(const Color &color); 46 | void Draw(void) override; 47 | void Update(const bool touchIsDown, const IntVector &touchPos) override; 48 | int operator()(string &str); 49 | 50 | private: 51 | int _character{0}; 52 | Glyph *_glyph{nullptr}; 53 | KeyContent *_content{nullptr}; 54 | IconCallback _icon{nullptr}; 55 | IntRect _uiProperties; 56 | 57 | u16 _posX{0}; 58 | u16 _posY{0}; 59 | 60 | bool _isPressed{false}; 61 | bool _wasPressed{false}; 62 | bool _execute{false}; 63 | bool _enabled{true}; 64 | }; 65 | } 66 | 67 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/TouchKeyString.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_TOUCHKEYSTRING_KEYBOARD_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_TOUCHKEYSTRING_KEYBOARD_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics.hpp" 6 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 7 | 8 | namespace CTRPluginFramework { 9 | class TouchKeyString { 10 | public: 11 | TouchKeyString(const string &content, IntRect ui, bool enabled = true); 12 | TouchKeyString(const CustomIcon &icon, IntRect ui, bool isEnabled); 13 | ~TouchKeyString() {} 14 | 15 | void Enable(bool enable = true); 16 | void ForcePressed(bool force); 17 | bool CanUse(void); 18 | void Draw(void); 19 | void Update(const bool touchIsDown, const IntVector &touchPos); 20 | void Scroll(float amount); 21 | void GetPosition(u16 &posX, float& posY); 22 | void SetPosition(u16 posX, float posY); 23 | int operator()(void); 24 | 25 | private: 26 | string _content; 27 | CustomIcon _icon; 28 | IntRect _uiProperties; 29 | 30 | bool _isPressed; 31 | bool _wasPressed; 32 | bool _isForcePressed; 33 | bool _isIcon; 34 | bool _execute; 35 | bool _enabled; 36 | u16 _posX; 37 | float _contentLength; 38 | float _posY; 39 | 40 | TouchKeyString(IntRect ui, bool isEnabled); 41 | }; 42 | } 43 | 44 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/UIContainer.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_UICONTAINER_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_UICONTAINER_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/Drawable.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class UIContainer { 9 | public: 10 | UIContainer(void); 11 | ~UIContainer(void); 12 | 13 | void operator += (Drawable *uiControl); 14 | void Draw(void); 15 | void Update(const bool isTouchDown, const IntVector &touchPos); 16 | void ExecuteAll(void); 17 | 18 | private: 19 | vector _uiControls; 20 | }; 21 | } 22 | 23 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Graphics/Window.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_WINDOW_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_WINDOW_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/Button.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class BMPImage; 9 | class Window { 10 | public: 11 | Window(u32 posX, u32 posY, u32 width, u32 height, bool closeBtn, BMPImage *image); 12 | ~Window(void); 13 | 14 | void Draw(void) const; 15 | void Draw(const string &title) const; 16 | void DrawButton(void) const; 17 | void Update(const bool isTouched, const IntVector &touchPos) const; 18 | bool MustClose(void) const; 19 | void Close(void) const; 20 | const IntRect &GetRect(void) const; 21 | 22 | static Window TopWindow; 23 | static Window BottomWindow; 24 | 25 | static void UpdateBackgrounds(void); 26 | 27 | private: 28 | IntRect _rect; 29 | IntRect _border; 30 | Button *_closeBtn; 31 | BMPImage *_image; 32 | }; 33 | } 34 | 35 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Menu.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_MENU_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_MENU_HPP 3 | 4 | #include "CTRPluginFrameworkImpl/Menu/HexEditor.hpp" 5 | #include "CTRPluginFrameworkImpl/Menu/Menu.hpp" 6 | #include "CTRPluginFrameworkImpl/Menu/MenuEntryImpl.hpp" 7 | #include "CTRPluginFrameworkImpl/Menu/MenuFolderImpl.hpp" 8 | #include "CTRPluginFrameworkImpl/Menu/MenuItem.hpp" 9 | #include "CTRPluginFrameworkImpl/Menu/PluginMenuImpl.hpp" 10 | 11 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Menu/Converter.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_CONVERTER_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_CONVERTER_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/NumericTextBox.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class Converter { 9 | public: 10 | Converter(void); 11 | ~Converter(void); 12 | void operator()(u32 val = 0); 13 | static Converter *Instance(void); 14 | 15 | private: 16 | NumericTextBox _decimalTB; 17 | NumericTextBox _hexadecimalTB; 18 | NumericTextBox _floatTB; 19 | NumericTextBox _hexfloatTB; 20 | 21 | void _Draw(void); 22 | }; 23 | } 24 | 25 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Menu/GatewayRAMDumper.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_GATEWAYRAMDUMPER_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_GATEWAYRAMDUMPER_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Search/Search.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class GatewayRAMDumper { 9 | public: 10 | GatewayRAMDumper(void); 11 | ~GatewayRAMDumper(void) {} 12 | bool operator()(void); 13 | bool _SelectRegion(); 14 | 15 | private: 16 | void _OpenFile(void); 17 | void _WriteHeader(void); 18 | void _DrawProgress(void); 19 | 20 | string _fileName; 21 | File _file; 22 | u32 _currentAddress; 23 | u32 _endAddress; 24 | u32 _regionIndex; 25 | u32 _achievedSize; 26 | u32 _totalSize; 27 | vector _regions; 28 | }; 29 | } 30 | 31 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Menu/GuideReader.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_GUIDEREADER_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_GUIDEREADER_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics.hpp" 6 | #include "CTRPluginFrameworkImpl/Menu/Menu.hpp" 7 | #include "CTRPluginFrameworkImpl/Menu/MenuEntryImpl.hpp" 8 | #include "CTRPluginFrameworkImpl/Menu/MenuFolderImpl.hpp" 9 | #include "CTRPluginFrameworkImpl/Menu/MenuItem.hpp" 10 | #include "CTRPluginFrameworkImpl/System/Events.hpp" 11 | 12 | namespace CTRPluginFramework { 13 | class GuideReader { 14 | using EventList = vector; 15 | 16 | public: 17 | GuideReader(void); 18 | ~GuideReader(void){}; 19 | 20 | bool Draw(void); 21 | void Open(void); 22 | void Close(void); 23 | bool IsOpen(void); 24 | 25 | // Return true if the Close Button is pressed, else false 26 | bool operator()(EventList &eventList, Time &delta); 27 | 28 | private: 29 | bool _ProcessEvent(Event &event); 30 | void _LoadBMP(void); 31 | 32 | bool _isOpen; 33 | Menu _menu; 34 | TextBox _guideTB; 35 | string _text; 36 | MenuEntryImpl *_last; 37 | Directory _currentDirectory; 38 | vector _bmpList; 39 | int _currentBMP; 40 | BMPImage *_image; 41 | }; 42 | } 43 | 44 | #endif -------------------------------------------------------------------------------- /Library/Includes/CTRPluginFrameworkImpl/Menu/HotkeysModifier.hpp: -------------------------------------------------------------------------------- 1 | #ifndef CTRPLUGINFRAMEWORKIMPL_PLUGINMENUHOTKEYS_HPP 2 | #define CTRPLUGINFRAMEWORKIMPL_PLUGINMENUHOTKEYS_HPP 3 | 4 | #include 5 | #include "CTRPluginFrameworkImpl/Graphics/Button.hpp" 6 | 7 | namespace CTRPluginFramework { 8 | class HotkeysModifier { 9 | public: 10 | HotkeysModifier(u32 &keys, const string &message); 11 | ~HotkeysModifier(void); 12 | 13 | void operator()(void); 14 | 15 | private: 16 | void _DrawTop(void) const; 17 | void _DrawBottom(void); 18 | void _Update(void); 19 | 20 | u32 &_keys; 21 | vector