├── .clang-format ├── .gitignore ├── .vscode └── settings.json ├── CMakeLists.txt ├── LICENSE ├── README.md ├── app ├── 3rdparty │ ├── intraFont-G │ │ ├── CMakeLists.txt │ │ ├── LICENSE │ │ ├── Makefile │ │ ├── README │ │ ├── fonttest │ │ │ ├── Makefile │ │ │ └── fonttest.c │ │ ├── include │ │ │ ├── intraFont.h │ │ │ └── libccc.h │ │ ├── intraFont.c │ │ ├── libccc.c │ │ ├── libraries │ │ │ ├── framebuffer.c │ │ │ ├── framebuffer.h │ │ │ ├── graphics.c │ │ │ └── graphics.h │ │ └── sinusoid │ │ │ ├── Makefile │ │ │ └── sinus.c │ └── rapidjson │ │ ├── allocators.h │ │ ├── document.h │ │ ├── encodedstream.h │ │ ├── encodings.h │ │ ├── error │ │ ├── en.h │ │ └── error.h │ │ ├── filereadstream.h │ │ ├── filewritestream.h │ │ ├── internal │ │ ├── biginteger.h │ │ ├── diyfp.h │ │ ├── dtoa.h │ │ ├── ieee754.h │ │ ├── itoa.h │ │ ├── meta.h │ │ ├── pow10.h │ │ ├── stack.h │ │ ├── strfunc.h │ │ ├── strtod.h │ │ └── swap.h │ │ ├── memorybuffer.h │ │ ├── memorystream.h │ │ ├── msinttypes │ │ ├── inttypes.h │ │ └── stdint.h │ │ ├── pointer.h │ │ ├── prettywriter.h │ │ ├── rapidjson.h │ │ ├── reader.h │ │ ├── stringbuffer.h │ │ └── writer.h ├── CMakeLists.txt ├── resources │ ├── PARAM.SFO │ ├── PARAM_GO.SFO │ ├── icon.xcf │ ├── icon0.png │ ├── icon0.xcf │ ├── parallaxleft.tga │ ├── parallaxright.tga │ ├── pic1.png │ └── symbol.pgf └── src │ ├── animation.h │ ├── animations.cpp │ ├── animations.h │ ├── application.cpp │ ├── application.h │ ├── backgroundview.cpp │ ├── backgroundview.h │ ├── blockallocator.cpp │ ├── blockallocator.h │ ├── buttonarbiter.cpp │ ├── buttonarbiter.h │ ├── buttonevent.cpp │ ├── buttonevent.h │ ├── buttontransition.cpp │ ├── buttontransition.h │ ├── circularbuffer.h │ ├── colouredrectangle.cpp │ ├── colouredrectangle.h │ ├── compatibilityconfig.cpp │ ├── compatibilityconfig.h │ ├── compatibilitymodule.cpp │ ├── compatibilitymodule.h │ ├── configscreen.cpp │ ├── configscreen.h │ ├── creditsscreen.cpp │ ├── creditsscreen.h │ ├── errorscreen.cpp │ ├── errorscreen.h │ ├── event.cpp │ ├── event.h │ ├── eventhandler.h │ ├── eventsource.cpp │ ├── eventsource.h │ ├── exitscreen.cpp │ ├── exitscreen.h │ ├── firework.cpp │ ├── firework.h │ ├── flashingrectangle.cpp │ ├── flashingrectangle.h │ ├── font.cpp │ ├── font.h │ ├── font2.h │ ├── font_png.h │ ├── fontgen.cpp │ ├── fontgen.h │ ├── fontmanager.cpp │ ├── fontmanager.h │ ├── functortransition.cpp │ ├── functortransition.h │ ├── glfont.h │ ├── gltext.cpp │ ├── gltext.h │ ├── graphicsdevice.cpp │ ├── graphicsdevice.h │ ├── homescreen.cpp │ ├── homescreen.h │ ├── infinityintro.cpp │ ├── infinityintro.h │ ├── initstate.h │ ├── installscreen.cpp │ ├── installscreen.h │ ├── installupdate.cpp │ ├── installupdate.h │ ├── installupdatescreen.cpp │ ├── installupdatescreen.h │ ├── localupdatescreen.cpp │ ├── localupdatescreen.h │ ├── main.cpp │ ├── menu.cpp │ ├── menu.h │ ├── menuselectionevent.cpp │ ├── menuselectionevent.h │ ├── menuselectiontransition.cpp │ ├── menuselectiontransition.h │ ├── mutex.cpp │ ├── mutex.h │ ├── mutexlocker.cpp │ ├── mutexlocker.h │ ├── numberanimation.cpp │ ├── numberanimation.h │ ├── pageview.cpp │ ├── pageview.h │ ├── particlesource.cpp │ ├── particlesource.h │ ├── pspguwrapper.cpp │ ├── pspguwrapper.h │ ├── randomgenerator.cpp │ ├── randomgenerator.h │ ├── rectangle.cpp │ ├── rectangle.h │ ├── scene.cpp │ ├── scene.h │ ├── snowscene.cpp │ ├── snowscene.h │ ├── state.cpp │ ├── state.h │ ├── statemachine.cpp │ ├── statemachine.h │ ├── stateview.cpp │ ├── stateview.h │ ├── tailedparticle.cpp │ ├── tailedparticle.h │ ├── textrenderer.cpp │ ├── textrenderer.h │ ├── texture.cpp │ ├── texture.h │ ├── texture2.h │ ├── tgatexture.cpp │ ├── tgatexture.h │ ├── thread.cpp │ ├── thread.h │ ├── timer.cpp │ ├── timer.h │ ├── transition.cpp │ ├── transition.h │ ├── updateinformation.cpp │ ├── updateinformation.h │ ├── updateinformationparser.cpp │ ├── updateinformationparser.h │ ├── uptodatescreen.cpp │ ├── uptodatescreen.h │ ├── utility.cpp │ ├── utility.h │ ├── vertextype.h │ ├── view.cpp │ ├── view.h │ ├── viewmanager.cpp │ ├── viewmanager.h │ ├── vram.c │ └── vram.h ├── cmake └── psp-toolchain.cmake ├── firmware ├── CMakeLists.txt ├── bootloader │ ├── CMakeLists.txt │ ├── exports.exp │ ├── include │ │ └── kernel_helper.h │ └── src │ │ ├── intercept.S │ │ └── main.c ├── compat_interface │ ├── CMakeLists.txt │ └── include │ │ └── compat_interface.h ├── infinityboot │ ├── 661mapfile.txt │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── exports.exp │ ├── include │ │ └── libinfinity.h │ └── src │ │ └── main.c ├── infinityctrl │ ├── 661mapfile.txt │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── exports.exp │ ├── include │ │ └── libinfinity.h │ └── src │ │ ├── infinity_ver.S │ │ ├── libinfinity.c │ │ └── main.c ├── mecompat │ ├── CMakeLists.txt │ ├── README.md │ ├── linkfile.l │ └── src │ │ ├── crt0.S │ │ └── main.c ├── procompat │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── linkfile.l │ └── src │ │ ├── crt0.S │ │ ├── main.c │ │ └── rebootex_conf.h ├── reboot │ ├── 661mapfile.txt │ ├── CMakeLists.txt │ ├── exports.exp │ ├── include │ │ └── reboot.h │ └── src │ │ ├── reboot.c │ │ ├── utility.c │ │ └── utility.h ├── rebootex │ ├── CMakeLists.txt │ ├── LICENSE │ ├── README.md │ ├── include │ │ └── rebootex_interface.h │ ├── linkfile.l │ └── src │ │ ├── btcnf.c │ │ ├── btcnf.h │ │ ├── btcnfpatch.c │ │ ├── btcnfpatch.h │ │ ├── compatibility.c │ │ ├── compatibility.h │ │ ├── crt0.S │ │ ├── kprintf.c │ │ ├── kprintf.h │ │ ├── lfatpatch.c │ │ ├── lfatpatch.h │ │ ├── libc.c │ │ ├── loadcorepatch.c │ │ ├── loadcorepatch.h │ │ ├── main.c │ │ ├── patch.h │ │ ├── psp_uart.c │ │ ├── psp_uart.h │ │ ├── syscon.c │ │ ├── syscon.h │ │ ├── sysreg.c │ │ ├── sysreg.h │ │ ├── utility.c │ │ └── utility.h └── recovery │ ├── CMakeLists.txt │ ├── README.md │ ├── linkfile.l │ └── src │ ├── crt0.S │ └── main.c ├── kernel_helper ├── 661mapfile.txt ├── CMakeLists.txt ├── exports.exp ├── include │ └── kernel_helper.h └── src │ └── main.c ├── kexploit ├── CMakeLists.txt ├── include │ └── kexploit.h └── src │ ├── cache.cpp │ ├── cache.h │ ├── findproc.cpp │ ├── findproc.h │ ├── k660.cpp │ ├── k660.h │ └── main.cpp ├── libconfig ├── 661mapfile.txt ├── CMakeLists.txt ├── exports.exp ├── include │ └── config.h └── src │ ├── config.c │ └── main.c ├── sdk ├── CMakeLists.txt ├── include │ ├── kubridge.h │ ├── pspinit.h │ ├── psploadcore.h │ ├── psploadexec_kernel.h │ ├── pspmodulemgr.h │ ├── pspmodulemgr_kernel.h │ ├── pspsysmem.h │ ├── pspsysmem_kernel.h │ ├── pspusbdevice.h │ ├── systemctrl.h │ ├── systemctrl_se.h │ └── vshctrl.h ├── lib │ ├── libpspinit.a │ ├── libpspkdebug.a │ ├── libpspkubridge.a │ ├── libpsploadexec_kernel.a │ ├── libpspmodulemgr_kernel.a │ ├── libpspmodulemgr_user.a │ ├── libpspsysmem_kernel.a │ ├── libpspsysmem_user.a │ ├── libpspsystemctrl_kernel.a │ ├── libpspsystemctrl_user.a │ ├── libpspumd_kernel.a │ ├── libpspusbdevice.a │ ├── libpspusbdevice_driver.a │ └── libpspvshctrl.a └── readme.txt ├── stubs ├── CMakeLists.txt ├── memlmd │ ├── CMakeLists.txt │ ├── include │ │ └── memlmd.h │ └── semaphore.S ├── modulemgr │ ├── CMakeLists.txt │ ├── ModuleMgrForUser.S │ └── include │ │ └── modulemgr.h ├── netifhandle │ ├── CMakeLists.txt │ ├── include │ │ └── netifhandle.h │ └── sceNetIfhandle_lib.S ├── power │ ├── CMakeLists.txt │ └── scePower.S ├── syscon │ ├── CMakeLists.txt │ ├── include │ │ └── syscon.h │ └── sceSyscon_driver.S └── vshbridge │ ├── CMakeLists.txt │ ├── include │ └── vshbridge.h │ └── sceVshBridge.S ├── tools ├── CMakeLists.txt ├── bin2cpp │ └── bin2cpp.py ├── hashgen │ └── hashgen.py ├── psppack │ └── psppack.py └── psptools │ ├── pack_kernel_module.py │ ├── pack_updater.py │ ├── pack_user_fw_module.py │ └── psptool │ ├── __init__.py │ ├── kirk.py │ ├── pack.py │ ├── pbp.py │ ├── prx.py │ ├── prxtypes │ ├── __init__.py │ ├── common.py │ ├── type2.py │ ├── type6.py │ ├── type8.py │ └── type9.py │ └── psar.py └── utils ├── CMakeLists.txt └── include └── pspmacro.h /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | BasedOnStyle: Mozilla 3 | AlwaysBreakAfterDefinitionReturnType: None 4 | AlwaysBreakAfterReturnType: None 5 | BraceWrapping: 6 | AfterClass: true 7 | AfterControlStatement: true 8 | AfterEnum: true 9 | AfterFunction: true 10 | AfterNamespace: true 11 | AfterStruct: true 12 | AfterUnion: true 13 | BeforeCatch: true 14 | BeforeElse: true 15 | IndentBraces: true 16 | BreakBeforeBraces: Allman 17 | ColumnLimit: '100' 18 | ConstructorInitializerIndentWidth: '4' 19 | ContinuationIndentWidth: '4' 20 | IndentWidth: '4' 21 | NamespaceIndentation: All 22 | AccessModifierOffset: -4 23 | ... 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | tools/psptools/psptool/__pycache__ 3 | tools/psptools/psptool/prxtypes/__pycache__ 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | 3 | project(infinity VERSION 2.0.3) 4 | 5 | if (NOT CMAKE_TOOLCHAIN_FILE) 6 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 7 | endif() 8 | 9 | if(NOT CMAKE_BUILD_TYPE) 10 | set(CMAKE_BUILD_TYPE Release) 11 | endif() 12 | 13 | add_subdirectory(tools) 14 | add_subdirectory(utils) 15 | add_subdirectory(sdk) 16 | add_subdirectory(stubs) 17 | add_subdirectory(kexploit) 18 | add_subdirectory(kernel_helper) 19 | add_subdirectory(libconfig) 20 | add_subdirectory(firmware) 21 | add_subdirectory(app) 22 | 23 | install(FILES README.md LICENSE 24 | DESTINATION . 25 | ) 26 | 27 | set(CPACK_GENERATOR "ZIP") 28 | SET(CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) 29 | SET(CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR}) 30 | SET(CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH}) 31 | set(CPACK_PACKAGE_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}) 32 | include(CPack) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015-2019, David "Davee" Morgan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(intraFont-G VERSION 1.0 LANGUAGES C) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | link_directories(lib) 13 | 14 | add_library(intrafont intraFont.c libccc.c) 15 | 16 | target_link_libraries(intrafont 17 | c 18 | pspvfpu 19 | pspgum 20 | pspgu 21 | psprtc 22 | m 23 | pspdebug 24 | pspdisplay 25 | pspge 26 | pspctrl 27 | pspsdk 28 | c 29 | psputility 30 | pspuser 31 | pspkernel 32 | ) 33 | 34 | target_include_directories(intrafont 35 | PUBLIC 36 | $ 37 | PRIVATE 38 | include 39 | ) 40 | -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/LICENSE: -------------------------------------------------------------------------------- 1 | This work is licensed under the Creative Commons Attribution-Share Alike 3.0 License. 2 | To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ 3 | or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA. -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/Makefile: -------------------------------------------------------------------------------- 1 | PSPSDK = $(shell psp-config --pspsdk-path) 2 | PSPDIR = $(shell psp-config --psp-prefix) 3 | 4 | CFLAGS = -O2 -G0 5 | 6 | OBJS = intraFont.o libccc.o 7 | TARGET_LIB = libintrafont.a 8 | 9 | include $(PSPSDK)/lib/build.mak 10 | 11 | install: all 12 | mkdir -p $(PSPDIR)/include $(PSPDIR)/lib 13 | cp *.h $(PSPDIR)/include 14 | cp *.a $(PSPDIR)/lib 15 | -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/3rdparty/intraFont-G/README -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/fonttest/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = intraFontTest 2 | OBJS = fonttest.o\ 3 | ../libraries/graphics.o ../libraries/framebuffer.o\ 4 | ../libccc.o ../intraFont.o 5 | 6 | INCDIR = 7 | CFLAGS = -O2 -G0 -Wall -g 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | LIBDIR = 12 | LDFLAGS = 13 | LIBS = -lpspgum -lpspgu -lpng -lz -lm 14 | 15 | EXTRA_TARGETS = EBOOT.PBP 16 | PSP_EBOOT_TITLE = intraFont-G Test 17 | 18 | PSPSDK=$(shell psp-config --pspsdk-path) 19 | include $(PSPSDK)/lib/build.mak 20 | 21 | -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/fonttest/fonttest.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/3rdparty/intraFont-G/fonttest/fonttest.c -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/libraries/framebuffer.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "graphics.h" 3 | 4 | Color* g_vram_base = (Color*) (0x40000000 | 0x04000000); 5 | -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/libraries/framebuffer.h: -------------------------------------------------------------------------------- 1 | #ifndef FRAMEBUFFER_H 2 | #define FRAMEBUFFER_H 3 | 4 | #include 5 | 6 | extern u32* g_vram_base; 7 | 8 | #endif 9 | -------------------------------------------------------------------------------- /app/3rdparty/intraFont-G/sinusoid/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = intraFontTest 2 | OBJS = sinus.o\ 3 | ../libraries/graphics.o ../libraries/framebuffer.o\ 4 | ../libccc.o ../intraFont.o 5 | 6 | INCDIR = 7 | CFLAGS = -O2 -G0 -Wall -g 8 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 9 | ASFLAGS = $(CFLAGS) 10 | 11 | LIBDIR = 12 | LDFLAGS = 13 | LIBS = -lpspgum -lpspgu -lpng -lz -lm 14 | 15 | EXTRA_TARGETS = EBOOT.PBP 16 | PSP_EBOOT_TITLE = intraFont-G Sinusoid Test 17 | 18 | PSPSDK=$(shell psp-config --pspsdk-path) 19 | include $(PSPSDK)/lib/build.mak 20 | 21 | -------------------------------------------------------------------------------- /app/3rdparty/rapidjson/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | //! Custom strlen() which works on different character types. 24 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 25 | \param s Null-terminated input string. 26 | \return Number of characters in the string. 27 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 28 | */ 29 | template 30 | inline SizeType StrLen(const Ch* s) { 31 | const Ch* p = s; 32 | while (*p) ++p; 33 | return SizeType(p - s); 34 | } 35 | 36 | } // namespace internal 37 | RAPIDJSON_NAMESPACE_END 38 | 39 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 40 | -------------------------------------------------------------------------------- /app/3rdparty/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | //! Custom swap() to avoid dependency on C++ header 24 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 25 | \note This has the same semantics as std::swap(). 26 | */ 27 | template 28 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 29 | T tmp = a; 30 | a = b; 31 | b = tmp; 32 | } 33 | 34 | } // namespace internal 35 | RAPIDJSON_NAMESPACE_END 36 | 37 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 38 | -------------------------------------------------------------------------------- /app/resources/PARAM.SFO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/PARAM.SFO -------------------------------------------------------------------------------- /app/resources/PARAM_GO.SFO: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/PARAM_GO.SFO -------------------------------------------------------------------------------- /app/resources/icon.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/icon.xcf -------------------------------------------------------------------------------- /app/resources/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/icon0.png -------------------------------------------------------------------------------- /app/resources/icon0.xcf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/icon0.xcf -------------------------------------------------------------------------------- /app/resources/parallaxleft.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/parallaxleft.tga -------------------------------------------------------------------------------- /app/resources/parallaxright.tga: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/parallaxright.tga -------------------------------------------------------------------------------- /app/resources/pic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/pic1.png -------------------------------------------------------------------------------- /app/resources/symbol.pgf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/resources/symbol.pgf -------------------------------------------------------------------------------- /app/src/animation.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef ANIMATION_H 27 | #define ANIMATION_H 28 | 29 | #include 30 | 31 | class Animation 32 | { 33 | public: 34 | using AnimationCompleteHandler = std::function; 35 | 36 | public: 37 | virtual void start(void) = 0; 38 | virtual void onComplete(AnimationCompleteHandler handler) = 0; 39 | 40 | private: 41 | }; 42 | 43 | #endif // ANIMATION_H 44 | -------------------------------------------------------------------------------- /app/src/animations.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include "animations.h" 26 | #include "numberanimation.h" 27 | #include "pageview.h" 28 | #include "transition.h" 29 | 30 | void smoothFadeOutAnimation(StateView* source, StateView* dest, Transition* transition) 31 | { 32 | auto animation = std::make_shared(0, 255); 33 | 34 | animation->setHandler([source, dest](float number) { 35 | source->setOpacity((255.f - number) / 255.f); 36 | dest->setOpacity(number / 255.f); 37 | }); 38 | 39 | transition->addAnimation(animation); 40 | source->addTransition(transition, dest); 41 | } 42 | -------------------------------------------------------------------------------- /app/src/animations.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef ANIMATIONS_H 26 | #define ANIMATIONS_H 27 | 28 | #include 29 | 30 | class StateView; 31 | class Transition; 32 | 33 | void smoothFadeOutAnimation(StateView* source, StateView* dest, Transition* transition); 34 | 35 | #endif // ANIMATIONS_H 36 | -------------------------------------------------------------------------------- /app/src/application.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef APPLICATION_H 27 | #define APPLICATION_H 28 | 29 | #include "eventhandler.h" 30 | #include "eventsource.h" 31 | #include 32 | 33 | using EventHandlerList = std::vector; 34 | using EventSourceList = std::vector; 35 | 36 | class Application 37 | { 38 | public: 39 | static Application* instance(void); 40 | 41 | public: 42 | void submitEvent(Event* event); 43 | void addEventHandler(EventHandler handler); 44 | void processEvents(void); 45 | void addEventSource(EventSource* source); 46 | 47 | private: 48 | Application(void); 49 | 50 | private: 51 | static Application* m_instance; 52 | EventHandlerList m_handlers; 53 | EventSourceList m_sources; 54 | }; 55 | 56 | #endif // APPLICATION_H 57 | -------------------------------------------------------------------------------- /app/src/blockallocator.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef BLOCKALLOCATOR_H 27 | #define BLOCKALLOCATOR_H 28 | 29 | class Allocator; 30 | 31 | class BlockAllocator 32 | { 33 | public: 34 | BlockAllocator(void* base, unsigned int size); 35 | 36 | void* allocate(unsigned int size); 37 | void* allocate_aligned(unsigned int size, unsigned int alignment); 38 | 39 | private: 40 | void* m_base = nullptr; 41 | unsigned int m_size = 0; 42 | }; 43 | 44 | #endif // BLOCKALLOCATOR_H 45 | -------------------------------------------------------------------------------- /app/src/buttonarbiter.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef BUTTONARBITER_H 27 | #define BUTTONARBITER_H 28 | 29 | #include "eventsource.h" 30 | 31 | #include 32 | #include 33 | 34 | using ButtonHandler = std::function; 35 | using ButtonHandlerList = std::vector>; 36 | 37 | class ButtonArbiter : public EventSource 38 | { 39 | public: 40 | ButtonArbiter(void); 41 | 42 | unsigned int buttons(void); 43 | void bind(unsigned int buttons, ButtonHandler handler); 44 | 45 | void reset(void); 46 | 47 | EventList processEvents(void) override; 48 | 49 | private: 50 | unsigned int m_previousButtons; 51 | ButtonHandlerList m_handlers; 52 | }; 53 | 54 | #endif // BUTTONARBITER_H 55 | -------------------------------------------------------------------------------- /app/src/buttonevent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "buttonevent.h" 27 | 28 | ButtonEvent::ButtonEvent(unsigned int buttons) 29 | : Event(Event::Button) 30 | , m_buttons(buttons) 31 | { 32 | } 33 | 34 | unsigned int ButtonEvent::buttons(void) const 35 | { 36 | return m_buttons; 37 | } 38 | -------------------------------------------------------------------------------- /app/src/buttonevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef BUTTONEVENT_H 27 | #define BUTTONEVENT_H 28 | 29 | #include "event.h" 30 | 31 | class ButtonEvent : public Event 32 | { 33 | public: 34 | ButtonEvent(unsigned int buttons); 35 | unsigned int buttons(void) const; 36 | 37 | private: 38 | unsigned int m_buttons; 39 | }; 40 | 41 | #endif // BUTTONEVENT_H 42 | -------------------------------------------------------------------------------- /app/src/buttontransition.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "buttontransition.h" 27 | #include "buttonevent.h" 28 | 29 | ButtonTransition::ButtonTransition(unsigned int buttons) 30 | : m_buttons(buttons) 31 | { 32 | } 33 | 34 | bool ButtonTransition::onEvent(Event* event) 35 | { 36 | if (event->type() != Event::Button) 37 | return false; 38 | 39 | ButtonEvent* buttonEvent = static_cast(event); 40 | 41 | if (buttonEvent->buttons() == m_buttons) 42 | { 43 | return true; 44 | } 45 | 46 | return false; 47 | } 48 | -------------------------------------------------------------------------------- /app/src/buttontransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef BUTTONTRANSITION_H 27 | #define BUTTONTRANSITION_H 28 | 29 | #include "transition.h" 30 | 31 | class ButtonTransition : public Transition 32 | { 33 | public: 34 | explicit ButtonTransition(unsigned int buttons); 35 | 36 | private: 37 | bool onEvent(Event* event) override; 38 | 39 | private: 40 | unsigned int m_buttons; 41 | }; 42 | 43 | #endif // BUTTONTRANSITION_H 44 | -------------------------------------------------------------------------------- /app/src/colouredrectangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef COLOUREDRECTANGLE_H 27 | #define COLOUREDRECTANGLE_H 28 | 29 | #include "rectangle.h" 30 | 31 | class ColouredRectangle : public Rectangle 32 | { 33 | public: 34 | ColouredRectangle(float x, 35 | float y, 36 | float width, 37 | float height, 38 | unsigned int colour = 0xFFFFFFFF); 39 | ColouredRectangle(const Rectangle& rectangle, unsigned int colour = 0xFFFFFFFF); 40 | 41 | void setOpacity(float opacity); 42 | float opacity(void); 43 | 44 | void render(void); 45 | 46 | private: 47 | unsigned int m_colour; 48 | float m_opacity; 49 | }; 50 | 51 | #endif // COLOUREDRECTANGLE_H 52 | -------------------------------------------------------------------------------- /app/src/compatibilityconfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef COMPATIBILITYCONFIG_H 26 | #define COMPATIBILITYCONFIG_H 27 | 28 | #include 29 | #include 30 | 31 | class CompatibilityModule; 32 | 33 | using CompatibilityModulePtr = std::shared_ptr; 34 | using CompatibilityModuleList = std::vector; 35 | 36 | CompatibilityModuleList parseCompatibilityConfig(const std::string& json); 37 | std::string generateCompatibilityConfig(const CompatibilityModuleList& list); 38 | 39 | #endif // COMPATIBILITYCONFIG_H 40 | -------------------------------------------------------------------------------- /app/src/compatibilitymodule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "compatibilitymodule.h" 27 | 28 | CompatibilityModule::CompatibilityModule(void) {} 29 | 30 | const std::string& CompatibilityModule::name(void) const 31 | { 32 | return m_name; 33 | } 34 | 35 | void CompatibilityModule::setName(const std::string& name) 36 | { 37 | m_name = name; 38 | } 39 | 40 | const std::string& CompatibilityModule::author(void) const 41 | { 42 | return m_author; 43 | } 44 | 45 | void CompatibilityModule::setAuthor(const std::string& author) 46 | { 47 | m_author = author; 48 | } 49 | 50 | const std::string& CompatibilityModule::path(void) const 51 | { 52 | return m_path; 53 | } 54 | 55 | void CompatibilityModule::setPath(const std::string& path) 56 | { 57 | m_path = path; 58 | } 59 | -------------------------------------------------------------------------------- /app/src/compatibilitymodule.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef COMPATIBILITYMODULE_H 27 | #define COMPATIBILITYMODULE_H 28 | 29 | #include 30 | 31 | class CompatibilityModule 32 | { 33 | public: 34 | CompatibilityModule(void); 35 | 36 | const std::string& name(void) const; 37 | void setName(const std::string& name); 38 | const std::string& author(void) const; 39 | void setAuthor(const std::string& author); 40 | const std::string& path(void) const; 41 | void setPath(const std::string& path); 42 | 43 | private: 44 | std::string m_name, m_author, m_path; 45 | }; 46 | 47 | #endif // COMPATIBILITYMODULE_H 48 | -------------------------------------------------------------------------------- /app/src/errorscreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef ERRORSCREEN_H 27 | #define ERRORSCREEN_H 28 | 29 | #include "view.h" 30 | 31 | #include 32 | 33 | class TextRenderer; 34 | 35 | class ErrorScreen : public View 36 | { 37 | public: 38 | ErrorScreen(const std::string& msg); 39 | ErrorScreen(const std::string& msg, unsigned int code); 40 | 41 | void setOpacity(float opacity) override; 42 | float opacity(void) override; 43 | 44 | protected: 45 | void update(float dt) override; 46 | void render(void) override; 47 | 48 | private: 49 | TextRenderer* m_latinText; 50 | float m_opacity; 51 | std::string m_errorMessage; 52 | }; 53 | 54 | #endif // ERRORSCREEN_H 55 | -------------------------------------------------------------------------------- /app/src/event.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "event.h" 27 | 28 | Event::Event(Type type) 29 | : m_type(type) 30 | { 31 | } 32 | 33 | Event::~Event(void) {} 34 | 35 | Event::Type Event::type(void) const 36 | { 37 | return m_type; 38 | } 39 | -------------------------------------------------------------------------------- /app/src/event.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef EVENT_H 27 | #define EVENT_H 28 | 29 | class Event 30 | { 31 | public: 32 | enum Type 33 | { 34 | None, 35 | Button, 36 | MenuSelection 37 | }; 38 | 39 | public: 40 | Event(Type type); 41 | virtual ~Event(void); 42 | 43 | Type type(void) const; 44 | 45 | private: 46 | Type m_type; 47 | }; 48 | 49 | #endif // EVENT_H 50 | -------------------------------------------------------------------------------- /app/src/eventhandler.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef EVENTHANDLER_H 27 | #define EVENTHANDLER_H 28 | 29 | #include 30 | 31 | class Event; 32 | using EventHandler = std::function; 33 | 34 | #endif // EVENTHANDLER_H 35 | -------------------------------------------------------------------------------- /app/src/eventsource.cpp: -------------------------------------------------------------------------------- 1 | #include "eventsource.h" 2 | #include "application.h" 3 | 4 | EventSource::EventSource(void) 5 | { 6 | Application::instance()->addEventSource(this); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/eventsource.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef EVENTSOURCE_H 27 | #define EVENTSOURCE_H 28 | 29 | #include "eventhandler.h" 30 | #include 31 | 32 | using EventList = std::vector; 33 | 34 | class EventSource 35 | { 36 | public: 37 | EventSource(void); 38 | virtual EventList processEvents(void) = 0; 39 | }; 40 | 41 | #endif // EVENTSOURCE_H 42 | -------------------------------------------------------------------------------- /app/src/flashingrectangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef FLASHINGRECTANGLE_H 27 | #define FLASHINGRECTANGLE_H 28 | 29 | #include "rectangle.h" 30 | 31 | class FlashingRectangle : public Rectangle 32 | { 33 | public: 34 | FlashingRectangle(float x, float y, float width, float height, unsigned int colour = 0xFFFFFF); 35 | FlashingRectangle(const Rectangle& rect, unsigned int colour = 0xFFFFFF); 36 | 37 | void setColour(unsigned int colour); 38 | void setOpacity(float opacity); 39 | void update(float t); 40 | void draw(void); 41 | 42 | private: 43 | float m_opacity; 44 | unsigned int m_colour, m_alpha; 45 | }; 46 | 47 | #endif // FLASHINGRECTANGLE_H 48 | -------------------------------------------------------------------------------- /app/src/fontgen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "fontgen.h" 27 | #include "glfont.h" 28 | 29 | static int isBitSet(unsigned char container, int n) 30 | { 31 | return (container & (1 << n)) ? (1) : (0); 32 | } 33 | 34 | int genFontTexture(char* dst) 35 | { 36 | unsigned int* rgba8888 = (unsigned int*)dst; 37 | 38 | for (unsigned int i = 0; i < sizeof(g_generated_font); ++i) 39 | { 40 | unsigned char ch = g_generated_font[i]; 41 | 42 | for (unsigned int j = 0; j < 8; ++j) 43 | { 44 | *rgba8888 = 0x00FFFFFF | (isBitSet(ch, j) ? (0xFF000000) : (0)); 45 | rgba8888++; 46 | } 47 | } 48 | 49 | // return the size 50 | return rgba8888 - (unsigned int*)dst; 51 | } 52 | -------------------------------------------------------------------------------- /app/src/fontgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef FONTGEN_H 27 | #define FONTGEN_H 28 | 29 | int genFontTexture(char* dst); 30 | 31 | #endif // FONTGEN_H 32 | -------------------------------------------------------------------------------- /app/src/fontmanager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "fontmanager.h" 27 | #include "font2.h" 28 | 29 | FontManager* FontManager::m_instance = nullptr; 30 | 31 | FontManager* FontManager::instance(void) 32 | { 33 | if (FontManager::m_instance == nullptr) 34 | { 35 | FontManager::m_instance = new FontManager(); 36 | } 37 | 38 | return FontManager::m_instance; 39 | } 40 | 41 | Font* FontManager::defaultFont(void) 42 | { 43 | return FontManager::instance()->m_defaultFont; 44 | } 45 | 46 | FontManager::FontManager(void) 47 | : m_defaultFont(new Font("flash0:/font/ltn0.pgf")) 48 | { 49 | } 50 | 51 | FontManager::~FontManager(void) {} 52 | -------------------------------------------------------------------------------- /app/src/fontmanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef FONTMANAGER_H 27 | #define FONTMANAGER_H 28 | 29 | class Font; 30 | 31 | class FontManager 32 | { 33 | public: 34 | static FontManager* instance(void); 35 | static Font* defaultFont(void); 36 | 37 | private: 38 | FontManager(void); 39 | ~FontManager(void); 40 | 41 | private: 42 | static FontManager* m_instance; 43 | Font* m_defaultFont; 44 | }; 45 | 46 | #endif // FONTMANAGER_H 47 | -------------------------------------------------------------------------------- /app/src/functortransition.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "functortransition.h" 27 | #include "buttonevent.h" 28 | 29 | FunctorTransition::FunctorTransition(Functor functor, TransitionPtr transition) 30 | : m_functor(functor) 31 | , m_transition(transition) 32 | { 33 | } 34 | 35 | bool FunctorTransition::onEvent(Event* event) 36 | { 37 | if (m_transition->onEvent(event)) 38 | { 39 | return m_functor(); 40 | } 41 | 42 | return false; 43 | } 44 | -------------------------------------------------------------------------------- /app/src/functortransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef FUNCTORTRANSITION_H 27 | #define FUNCTORTRANSITION_H 28 | 29 | #include "transition.h" 30 | 31 | #include 32 | #include 33 | 34 | class FunctorTransition : public Transition 35 | { 36 | public: 37 | using Functor = std::function; 38 | using TransitionPtr = std::shared_ptr; 39 | 40 | public: 41 | FunctorTransition(Functor functor, TransitionPtr transition); 42 | 43 | private: 44 | bool onEvent(Event* event) override; 45 | 46 | private: 47 | Functor m_functor; 48 | TransitionPtr m_transition; 49 | }; 50 | 51 | #endif // FUNCTORTRANSITION_H 52 | -------------------------------------------------------------------------------- /app/src/graphicsdevice.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef GRAPHICSDEVICE_H 27 | #define GRAPHICSDEVICE_H 28 | 29 | class BlockAllocator; 30 | 31 | class GraphicsDevice 32 | { 33 | enum InitialisationState 34 | { 35 | GU_INITIALISED, 36 | GU_UNINITIALISED 37 | }; 38 | 39 | public: 40 | GraphicsDevice(void); 41 | ~GraphicsDevice(void); 42 | 43 | // initialise/shutdown pspgu 44 | void initialise(void); 45 | void shutdown(void); 46 | 47 | unsigned int* displayList(void); 48 | BlockAllocator* vramAllocator(void); 49 | 50 | private: 51 | InitialisationState m_pspguState; 52 | BlockAllocator* m_vramAllocator; 53 | unsigned int m_fb0, m_fb1, m_zbp; 54 | unsigned int* m_displayList; 55 | }; 56 | 57 | #endif // GRAPHICSDEVICE_H 58 | -------------------------------------------------------------------------------- /app/src/homescreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef HOMESCREEN_H 26 | #define HOMESCREEN_H 27 | 28 | #include "pageview.h" 29 | #include 30 | 31 | class TextRenderer; 32 | class TailedParticle; 33 | 34 | class HomeScreen : public PageView 35 | { 36 | public: 37 | HomeScreen(ViewManager* viewManager); 38 | 39 | void setOpacity(float opacity) override; 40 | float opacity(void) override; 41 | 42 | protected: 43 | void update(float dt) override; 44 | void render(void) override; 45 | 46 | private: 47 | TextRenderer* m_latinText; 48 | TailedParticle* m_particles; 49 | float m_opacity; 50 | float m_t; 51 | }; 52 | 53 | #endif // HOMESCREEN_H 54 | -------------------------------------------------------------------------------- /app/src/localupdatescreen.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include "localupdatescreen.h" 26 | 27 | LocalUpdateScreen::LocalUpdateScreen(ViewManager* viewManager) 28 | : PageView(viewManager, "Local Update") 29 | , m_opacity(1.0f) 30 | { 31 | } 32 | 33 | void LocalUpdateScreen::setOpacity(float opacity) 34 | { 35 | m_opacity = opacity; 36 | } 37 | 38 | float LocalUpdateScreen::opacity(void) 39 | { 40 | return m_opacity; 41 | } 42 | 43 | void LocalUpdateScreen::update(float dt) 44 | { 45 | PageView::update(dt); 46 | } 47 | 48 | void LocalUpdateScreen::render(void) 49 | { 50 | PageView::render(); 51 | } 52 | -------------------------------------------------------------------------------- /app/src/localupdatescreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef LOCALUPDATESCREEN_H 26 | #define LOCALUPDATESCREEN_H 27 | 28 | #include "pageview.h" 29 | 30 | class LocalUpdateScreen : public PageView 31 | { 32 | public: 33 | LocalUpdateScreen(ViewManager* viewManager); 34 | 35 | void setOpacity(float opacity) override; 36 | float opacity(void) override; 37 | 38 | protected: 39 | void update(float dt) override; 40 | void render(void) override; 41 | 42 | private: 43 | float m_opacity; 44 | }; 45 | 46 | #endif // LOCALUPDATESCREEN_H 47 | -------------------------------------------------------------------------------- /app/src/menuselectionevent.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "menuselectionevent.h" 27 | 28 | MenuSelectionEvent::MenuSelectionEvent(Menu* menu, const std::string& item, int index) 29 | : Event(Event::MenuSelection) 30 | , m_menu(menu) 31 | , m_item(item) 32 | , m_index(index) 33 | { 34 | } 35 | 36 | Menu* MenuSelectionEvent::menu(void) const 37 | { 38 | return m_menu; 39 | } 40 | 41 | const std::string& MenuSelectionEvent::item(void) const 42 | { 43 | return m_item; 44 | } 45 | 46 | int MenuSelectionEvent::index(void) const 47 | { 48 | return m_index; 49 | } 50 | -------------------------------------------------------------------------------- /app/src/menuselectionevent.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef MENUSELECTION_H 27 | #define MENUSELECTION_H 28 | 29 | #include "event.h" 30 | 31 | #include 32 | 33 | class Menu; 34 | 35 | class MenuSelectionEvent : public Event 36 | { 37 | public: 38 | MenuSelectionEvent(Menu* menu, const std::string& item, int index); 39 | Menu* menu(void) const; 40 | const std::string& item(void) const; 41 | int index(void) const; 42 | 43 | private: 44 | Menu* m_menu; 45 | std::string m_item; 46 | int m_index; 47 | }; 48 | 49 | #endif // MENUSELECTION_H 50 | -------------------------------------------------------------------------------- /app/src/menuselectiontransition.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "menuselectiontransition.h" 27 | #include "menu.h" 28 | #include "menuselectionevent.h" 29 | 30 | MenuSelectionTransition::MenuSelectionTransition(Menu* menu, const std::string& item) 31 | : m_menu(menu) 32 | , m_item(item) 33 | { 34 | m_menu->addItem(item); 35 | } 36 | 37 | bool MenuSelectionTransition::onEvent(Event* event) 38 | { 39 | if (event->type() != Event::MenuSelection) 40 | return false; 41 | 42 | MenuSelectionEvent* selectionEvent = static_cast(event); 43 | 44 | if (selectionEvent->menu() == m_menu && selectionEvent->item() == m_item) 45 | { 46 | return true; 47 | } 48 | 49 | return false; 50 | } 51 | -------------------------------------------------------------------------------- /app/src/menuselectiontransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef MENUSELECTIONTRANSITION_H 27 | #define MENUSELECTIONTRANSITION_H 28 | 29 | #include "transition.h" 30 | 31 | #include 32 | 33 | class Menu; 34 | 35 | class MenuSelectionTransition : public Transition 36 | { 37 | public: 38 | MenuSelectionTransition(Menu* menu, const std::string& m_item); 39 | 40 | private: 41 | bool onEvent(Event* event) override; 42 | 43 | private: 44 | Menu* m_menu; 45 | std::string m_item; 46 | }; 47 | 48 | #endif // MENUSELECTIONTRANSITION_H 49 | -------------------------------------------------------------------------------- /app/src/mutex.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include "mutex.h" 26 | 27 | #include 28 | 29 | Mutex::Mutex(void) 30 | : m_mutexId(-1) 31 | { 32 | m_mutexId = sceKernelCreateSema("infinityMutex", 0, 1, 1, NULL); 33 | } 34 | 35 | Mutex::~Mutex(void) 36 | { 37 | sceKernelDeleteSema(m_mutexId); 38 | } 39 | 40 | void Mutex::lock(void) 41 | { 42 | sceKernelWaitSema(m_mutexId, 1, NULL); 43 | } 44 | 45 | void Mutex::unlock(void) 46 | { 47 | sceKernelSignalSema(m_mutexId, 1); 48 | } 49 | -------------------------------------------------------------------------------- /app/src/mutex.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef MUTEX_H 26 | #define MUTEX_H 27 | 28 | #include 29 | 30 | class Mutex 31 | { 32 | public: 33 | Mutex(void); 34 | ~Mutex(void); 35 | 36 | void lock(void); 37 | void unlock(void); 38 | 39 | private: 40 | SceUID m_mutexId; 41 | }; 42 | 43 | #endif // MUTEX_H 44 | -------------------------------------------------------------------------------- /app/src/mutexlocker.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include "mutexlocker.h" 26 | #include "mutex.h" 27 | 28 | MutexLocker::MutexLocker(Mutex* mutex) 29 | : m_mutex(mutex) 30 | { 31 | m_mutex->lock(); 32 | } 33 | 34 | MutexLocker::~MutexLocker(void) 35 | { 36 | m_mutex->unlock(); 37 | } 38 | -------------------------------------------------------------------------------- /app/src/mutexlocker.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef MUTEXLOCKER_H 26 | #define MUTEXLOCKER_H 27 | 28 | class Mutex; 29 | 30 | class MutexLocker 31 | { 32 | public: 33 | MutexLocker(Mutex* mutex); 34 | ~MutexLocker(void); 35 | 36 | private: 37 | Mutex* m_mutex; 38 | }; 39 | 40 | #endif // MUTEXLOCKER_H 41 | -------------------------------------------------------------------------------- /app/src/pspguwrapper.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef PSPGUWRAPPER_H 27 | #define PSPGUWRAPPER_H 28 | 29 | class PSPGUManager 30 | { 31 | public: 32 | static PSPGUManager* instance(void); 33 | 34 | void init(void); 35 | unsigned int* displayList(void); 36 | 37 | private: 38 | PSPGUManager(void); 39 | 40 | private: 41 | unsigned int __attribute__((aligned(16))) m_displayList[262144]; 42 | static PSPGUManager* g_instance; 43 | }; 44 | 45 | #endif // PSPGUWRAPPER_H 46 | -------------------------------------------------------------------------------- /app/src/randomgenerator.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "randomgenerator.h" 27 | 28 | RandomGenerator::RandomGenerator(u32 seed) 29 | { 30 | sceKernelUtilsMt19937Init(&m_ctx, seed); 31 | } 32 | 33 | u32 RandomGenerator::random(u32 max) 34 | { 35 | return sceKernelUtilsMt19937UInt(&m_ctx) % max; 36 | } 37 | 38 | float RandomGenerator::randomF(void) 39 | { 40 | return ((float)random() / INT_MAX); 41 | } 42 | 43 | float RandomGenerator::randomDirectionF(void) 44 | { 45 | return -1.0 + 2.0 * randomF(); 46 | } 47 | -------------------------------------------------------------------------------- /app/src/randomgenerator.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef RANDOMGENERATOR_H 27 | #define RANDOMGENERATOR_H 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | class RandomGenerator 34 | { 35 | public: 36 | RandomGenerator(u32 seed); 37 | 38 | u32 random(u32 max = INT_MAX); 39 | float randomF(void); 40 | float randomDirectionF(void); 41 | 42 | private: 43 | SceKernelUtilsMt19937Context m_ctx; 44 | }; 45 | 46 | #endif // RANDOMGENERATOR_H 47 | -------------------------------------------------------------------------------- /app/src/rectangle.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef RECTANGLE_H 27 | #define RECTANGLE_H 28 | 29 | class Rectangle 30 | { 31 | public: 32 | Rectangle(void); 33 | Rectangle(float x, float y, float width, float height); 34 | 35 | void setX(float x); 36 | float x(void) const; 37 | 38 | void setY(float y); 39 | float y(void) const; 40 | 41 | void setWidth(float width); 42 | float width(void) const; 43 | 44 | void setHeight(float height); 45 | float height(void) const; 46 | 47 | private: 48 | float m_x, m_y; 49 | float m_width, m_height; 50 | }; 51 | 52 | #endif // RECTANGLE_H 53 | -------------------------------------------------------------------------------- /app/src/scene.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "scene.h" 27 | -------------------------------------------------------------------------------- /app/src/scene.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef SCENE_H 27 | #define SCENE_H 28 | 29 | class Scene 30 | { 31 | public: 32 | virtual void init() = 0; 33 | virtual void render(void) = 0; 34 | virtual void update(float t) = 0; 35 | }; 36 | 37 | #endif // SCENE_H 38 | -------------------------------------------------------------------------------- /app/src/state.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "state.h" 27 | 28 | State::State(void) {} 29 | 30 | State::~State(void) {} 31 | 32 | void State::addTransition(Transition* transition, State* state) 33 | { 34 | transition->setTarget(state); 35 | m_transitions.push_back(transition); 36 | } 37 | 38 | const TransitionList& State::transitions(void) const 39 | { 40 | return m_transitions; 41 | } 42 | -------------------------------------------------------------------------------- /app/src/state.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef STATE_H 27 | #define STATE_H 28 | 29 | #include "transition.h" 30 | #include 31 | 32 | class ConfigurationMenu; 33 | 34 | class State; 35 | using StatePtr = std::shared_ptr; 36 | 37 | #include 38 | using TransitionList = std::vector; 39 | 40 | class State 41 | { 42 | public: 43 | State(void); 44 | virtual ~State(void); 45 | 46 | void addTransition(Transition* transition, State* state); 47 | const TransitionList& transitions(void) const; 48 | 49 | virtual void begin(State* parent) = 0; 50 | virtual void end(void) = 0; 51 | 52 | private: 53 | TransitionList m_transitions; 54 | }; 55 | 56 | #endif // STATE_H 57 | -------------------------------------------------------------------------------- /app/src/statemachine.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef STATEMACHINE_H 27 | #define STATEMACHINE_H 28 | 29 | #include "state.h" 30 | #include 31 | 32 | class Event; 33 | 34 | class StateMachine : public State 35 | { 36 | public: 37 | StateMachine(void); 38 | 39 | void setInitialState(StatePtr state); 40 | void start(void); 41 | void addState(StatePtr state); 42 | 43 | protected: 44 | void begin(State* parent) override; 45 | void end(void) override; 46 | 47 | private: 48 | void processEvent(Event* event); 49 | 50 | private: 51 | using StateList = std::vector; 52 | 53 | StateList m_states; 54 | bool m_running; 55 | State* m_state; 56 | int m_animationsRunning; 57 | }; 58 | 59 | #endif // STATEMACHINE_H 60 | -------------------------------------------------------------------------------- /app/src/stateview.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/app/src/stateview.cpp -------------------------------------------------------------------------------- /app/src/stateview.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2016, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef STATEVIEW_H 27 | #define STATEVIEW_H 28 | 29 | #include "state.h" 30 | #include "view.h" 31 | 32 | class StateView 33 | : public View 34 | , public State 35 | { 36 | }; 37 | 38 | #endif // STATEVIEW_H 39 | -------------------------------------------------------------------------------- /app/src/tailedparticle.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include "circularbuffer.h" 5 | #include "vertextype.h" 6 | #include 7 | 8 | class GraphicsDevice; 9 | class ParticleSource; 10 | 11 | class TailedParticle 12 | { 13 | public: 14 | TailedParticle(GraphicsDevice* device, int length); 15 | void moveTo(float x, float y); 16 | void update(float dt); 17 | void draw(void); 18 | void setOpacity(float opacity); 19 | 20 | private: 21 | GraphicsDevice* m_graphicsDevice; 22 | int m_particleN; 23 | float m_particleSize; 24 | std::vector m_vertices; 25 | TextureVertex* m_verticesVRAM; 26 | CircularBuffer m_vertices2; 27 | unsigned char* m_texture; 28 | ParticleSource* m_particleSource; 29 | float m_opacity; 30 | }; 31 | -------------------------------------------------------------------------------- /app/src/texture2.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef TEXTURE_H 27 | #define TEXTURE_H 28 | 29 | class Texture 30 | { 31 | public: 32 | Texture(void); 33 | virtual ~Texture(void); 34 | 35 | virtual int width(void) const = 0; 36 | virtual int height(void) const = 0; 37 | virtual int textureWidth(void) const = 0; 38 | virtual int textureHeight(void) const = 0; 39 | virtual int pixelSize(void) const = 0; 40 | virtual unsigned char* data(void) = 0; 41 | 42 | bool swizzled(void) const; 43 | void swizzle(void); 44 | 45 | private: 46 | bool m_swizzled; 47 | }; 48 | 49 | #endif // TEXTURE_H 50 | -------------------------------------------------------------------------------- /app/src/thread.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef THREAD_H 26 | #define THREAD_H 27 | 28 | #include 29 | 30 | class Thread 31 | { 32 | public: 33 | Thread(void); 34 | virtual ~Thread(void); 35 | 36 | bool isFinished(void); 37 | bool isRunning(void); 38 | void start(void); 39 | 40 | protected: 41 | virtual void run(void) = 0; 42 | 43 | private: 44 | static int entry(unsigned int args, void* argp); 45 | 46 | private: 47 | SceUID m_thid; 48 | }; 49 | 50 | #endif // THREAD_H 51 | -------------------------------------------------------------------------------- /app/src/timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef TIMER_H 27 | #define TIMER_H 28 | 29 | #include 30 | #include 31 | #include 32 | 33 | class Timer 34 | { 35 | public: 36 | using TimerListener = std::function; 37 | using TimerListenerList = std::vector; 38 | 39 | public: 40 | void start(void); 41 | float elapsed(bool delta = true); 42 | 43 | public: 44 | static Timer* instance(void); 45 | static void listen(TimerListener handler); 46 | 47 | private: 48 | float m_tickResolution; 49 | u64 m_time; 50 | TimerListenerList m_listeners; 51 | 52 | private: 53 | static Timer* m_instance; 54 | 55 | private: 56 | Timer(void); 57 | }; 58 | 59 | #endif // TIMER_H 60 | -------------------------------------------------------------------------------- /app/src/transition.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "transition.h" 27 | 28 | Transition::~Transition(void) {} 29 | 30 | void Transition::setTarget(State* target) 31 | { 32 | m_target = target; 33 | } 34 | 35 | State* Transition::target(void) const 36 | { 37 | return m_target; 38 | } 39 | 40 | void Transition::addAnimation(AnimationPtr animation) 41 | { 42 | m_animations.push_back(animation); 43 | } 44 | 45 | AnimationList Transition::animations(void) const 46 | { 47 | return m_animations; 48 | } 49 | -------------------------------------------------------------------------------- /app/src/transition.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef TRANSITION_H 27 | #define TRANSITION_H 28 | 29 | #include 30 | #include 31 | 32 | class State; 33 | 34 | class Animation; 35 | using AnimationPtr = std::shared_ptr; 36 | using AnimationList = std::vector; 37 | 38 | class Event; 39 | 40 | class Transition 41 | { 42 | friend class State; 43 | 44 | public: 45 | Transition() = default; 46 | virtual ~Transition(void); 47 | 48 | void setTarget(State* target); 49 | State* target(void) const; 50 | 51 | void addAnimation(AnimationPtr animation); 52 | AnimationList animations(void) const; 53 | 54 | virtual bool onEvent(Event* event) = 0; 55 | 56 | private: 57 | State* m_target = nullptr; 58 | AnimationList m_animations; 59 | }; 60 | 61 | #endif // TRANSITION_H 62 | -------------------------------------------------------------------------------- /app/src/updateinformation.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | class UpdateInformation 29 | { 30 | public: 31 | UpdateInformation(void); 32 | 33 | const std::string& version(void) const; 34 | void setVersion(const std::string& version); 35 | 36 | const std::string& url(void) const; 37 | void setUrl(const std::string& url); 38 | 39 | int coreVersion(void) const; 40 | void setCoreVersion(int version); 41 | 42 | int subsetVersion(void) const; 43 | void setSubsetVersion(int version); 44 | 45 | private: 46 | std::string m_version, m_url; 47 | int m_coreVersion, m_subsetVersion; 48 | }; 49 | -------------------------------------------------------------------------------- /app/src/updateinformationparser.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | class UpdateInformation; 29 | using UpdateInformationPtr = std::shared_ptr; 30 | 31 | UpdateInformationPtr parseUpdateInformation(const std::string& json); 32 | -------------------------------------------------------------------------------- /app/src/uptodatescreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2019, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #pragma once 26 | 27 | #include "pageview.h" 28 | 29 | #include 30 | 31 | class ViewManager; 32 | class TextRenderer; 33 | 34 | class UptoDateScreen : public PageView 35 | { 36 | public: 37 | UptoDateScreen(ViewManager* viewManager); 38 | 39 | void setOpacity(float opacity) final; 40 | float opacity(void) final; 41 | 42 | protected: 43 | void update(float dt) final; 44 | void render(void) final; 45 | 46 | private: 47 | TextRenderer* m_latinText; 48 | float m_opacity; 49 | std::string m_updateDateScreen; 50 | }; 51 | -------------------------------------------------------------------------------- /app/src/vertextype.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef VERTEXTYPE_H 27 | #define VERTEXTYPE_H 28 | 29 | typedef struct 30 | { 31 | unsigned int colour; 32 | float x, y, z; 33 | } Vertex; 34 | 35 | typedef struct 36 | { 37 | float u, v; 38 | unsigned int colour; 39 | float x, y, z; 40 | } TextureVertex; 41 | 42 | #endif // VERTEXTYPE_H 43 | -------------------------------------------------------------------------------- /app/src/view.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include "view.h" 27 | #include 28 | 29 | View::View(void) 30 | { 31 | gumLoadIdentity(&m_modelMatrix); 32 | } 33 | 34 | View::~View(void) {} 35 | 36 | ScePspFMatrix4* View::model(void) 37 | { 38 | return &m_modelMatrix; 39 | } 40 | -------------------------------------------------------------------------------- /app/src/view.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef VIEW_H 27 | #define VIEW_H 28 | 29 | #include 30 | 31 | class View 32 | { 33 | friend class ViewManager; 34 | 35 | public: 36 | View(void); 37 | virtual ~View(void); 38 | 39 | ScePspFMatrix4* model(void); 40 | 41 | virtual void setOpacity(float opacity) = 0; 42 | virtual float opacity(void) = 0; 43 | 44 | protected: 45 | virtual void update(float dt) = 0; 46 | virtual void render(void) = 0; 47 | 48 | private: 49 | ScePspFMatrix4 m_modelMatrix; 50 | }; 51 | 52 | #endif // VIEW_H 53 | -------------------------------------------------------------------------------- /app/src/viewmanager.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #ifndef VIEWMANAGER_H 27 | #define VIEWMANAGER_H 28 | 29 | #include "view.h" 30 | #include 31 | 32 | using ViewList = std::vector; 33 | 34 | class GraphicsDevice; 35 | class ButtonArbiter; 36 | class StateMachine; 37 | class Scene; 38 | 39 | class ViewManager 40 | { 41 | public: 42 | ViewManager(void); 43 | 44 | void addView(View* view); 45 | void removeView(View* view); 46 | 47 | void setStateMachine(StateMachine* machine); 48 | 49 | GraphicsDevice* graphics(void); 50 | 51 | void exec(void); 52 | 53 | private: 54 | GraphicsDevice* m_graphicsDevice; 55 | ButtonArbiter* m_buttonArbiter; 56 | StateMachine* m_stateMachine; 57 | Scene* m_scene; 58 | ViewList m_views; 59 | }; 60 | 61 | #endif // VIEWMANAGER_H 62 | -------------------------------------------------------------------------------- /app/src/vram.c: -------------------------------------------------------------------------------- 1 | #include "vram.h" 2 | 3 | #include 4 | #include 5 | 6 | static unsigned int staticOffset = 0; 7 | 8 | static unsigned int getMemorySize(unsigned int width, unsigned int height, unsigned int psm) 9 | { 10 | switch (psm) 11 | { 12 | case GU_PSM_T4: 13 | return (width * height) >> 1; 14 | 15 | case GU_PSM_T8: 16 | return width * height; 17 | 18 | case GU_PSM_5650: 19 | case GU_PSM_5551: 20 | case GU_PSM_4444: 21 | case GU_PSM_T16: 22 | return 2 * width * height; 23 | 24 | case GU_PSM_8888: 25 | case GU_PSM_T32: 26 | return 4 * width * height; 27 | 28 | default: 29 | return 0; 30 | } 31 | } 32 | 33 | void* getStaticVramBuffer(unsigned int width, unsigned int height, unsigned int psm) 34 | { 35 | unsigned int memSize = getMemorySize(width, height, psm); 36 | void* result = (void*)staticOffset; 37 | staticOffset += memSize; 38 | 39 | if (staticOffset % 16) 40 | staticOffset++; 41 | 42 | return result; 43 | } 44 | 45 | void* getStaticVramTexture(unsigned int width, unsigned int height, unsigned int psm) 46 | { 47 | void* result = getStaticVramBuffer(width, height, psm); 48 | return (void*)((0x40000000 | (unsigned int)result) + ((unsigned int)sceGeEdramGetAddr())); 49 | } 50 | -------------------------------------------------------------------------------- /app/src/vram.h: -------------------------------------------------------------------------------- 1 | #ifndef common_vram_h 2 | #define common_vram_h 3 | 4 | #ifdef __cplusplus 5 | extern "C" 6 | { 7 | #endif 8 | 9 | /* 10 | The following are a few helperfunctions to help manage vram in gu-examples. 11 | Do not use for your own code, it's better you manage it in your own way. 12 | */ 13 | 14 | /* make a static allocation of vram memory and return pointer relative to vram start */ 15 | void* getStaticVramBuffer(unsigned int width, unsigned int height, unsigned int psm); 16 | /* make a static allocation of vram memory and return absolute pointer */ 17 | void* getStaticVramTexture(unsigned int width, unsigned int height, unsigned int psm); 18 | 19 | // the following is not yet implemented 20 | /* 21 | void beginDynamicVramFrame(); 22 | void endDynamicVramFrame(); 23 | 24 | void* getDynamicVramBuffer(unsigned int width, unsigned int height, unsigned int psm); 25 | void* getDynamicVramTexture(unsigned int width, unsigned int height, unsigned int psm); 26 | */ 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /firmware/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(infinity-firmware VERSION 2.0 LANGUAGES C ASM) 3 | 4 | set(INFINITY_PSP_TAG 0xF0F0F0F0 CACHE STRING "PSP tag to use") 5 | set(INFINITY_OE_TAG 0x00001E22 CACHE STRING "OE tag to use") 6 | 7 | add_subdirectory(compat_interface) 8 | add_subdirectory(reboot) 9 | add_subdirectory(infinityboot) 10 | add_subdirectory(infinityctrl) 11 | add_subdirectory(rebootex) 12 | add_subdirectory(mecompat) 13 | add_subdirectory(procompat) 14 | add_subdirectory(bootloader) 15 | add_subdirectory(recovery) 16 | -------------------------------------------------------------------------------- /firmware/bootloader/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_HASH(module_start) 8 | PSP_EXPORT_VAR_HASH(module_info) 9 | PSP_EXPORT_END 10 | 11 | PSP_EXPORT_START(Kernel_Library, 0x0011, 0x0001) 12 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x092968F4) 13 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x15B6446B) 14 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x1839852A) 15 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x1FC64E09) 16 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x293B45B8) 17 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x37431849) 18 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x3AD10D4D) 19 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x3B84732D) 20 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x47A0B729) 21 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x5F10D406) 22 | PSP_EXPORT_FUNC_NID(interceptMemsetEntry, 0xA089ECA4) 23 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0xB55249D2) 24 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0xBEA46419) 25 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0xC1734599) 26 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0xD13BDE95) 27 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0xDC692EE3) 28 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0xFA835CDE) 29 | PSP_EXPORT_END 30 | 31 | PSP_EXPORT_START(sceGe_lazy, 0x0011, 0x0001) 32 | PSP_EXPORT_FUNC_NID(kernelLibraryHandlerStub, 0x31129B95) 33 | PSP_EXPORT_END 34 | 35 | PSP_END_EXPORTS -------------------------------------------------------------------------------- /firmware/bootloader/include/kernel_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef INFINITYKINSTALLER_H_ 2 | #define INFINITYKINSTALLER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | unsigned int getBaryon(void); 9 | int getTrueModel(void); 10 | int setHomePopup(int value); 11 | 12 | void boot_infinity(void); 13 | 14 | #define MODEL(x) (1 << x) 15 | #define ALL_MODELS (0xFFFFFFFF) 16 | 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | 21 | #endif // INFINITYKINSTALLER_H_ 22 | -------------------------------------------------------------------------------- /firmware/bootloader/src/intercept.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | .set noat 3 | .global interceptMemsetEntry 4 | .ent interceptMemsetEntry 5 | interceptMemsetEntry: 6 | j interceptMemset 7 | move $a3, $ra 8 | .end interceptMemsetEntry 9 | -------------------------------------------------------------------------------- /firmware/compat_interface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(compat_interface VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | add_library(compat_interface INTERFACE) 13 | 14 | target_include_directories(compat_interface 15 | INTERFACE 16 | $ 17 | ) 18 | 19 | target_link_libraries(compat_interface 20 | INTERFACE 21 | sdk 22 | ) 23 | 24 | target_compile_definitions(compat_interface 25 | INTERFACE 26 | COMPATIBILITY_MODULE_ADDR=0x88F50000 27 | ) 28 | -------------------------------------------------------------------------------- /firmware/infinityboot/661mapfile.txt: -------------------------------------------------------------------------------- 1 | @SysMemForKernel 2 | 0x55A40B2C:0xC4EEAF20 //NID RESOLVED 3 | 0x9697CD32:0x13F4A0DE //NID RESOLVED 4 | 0xB2C7AA36:0x83B5226D //NID RESOLVED 5 | 0x3FC9AE6A:0xC886B169 //NID RESOLVED 6 | 0x6373995D:0x07C586A1 //NID RESOLVED 7 | 0x237DBD4F:0x7158CE7E 8 | 0x9D9A5BA1:0xF12A62F7 9 | @memlmd 10 | 0x7CF1CD3E:0xEF73E85B //NID RESOLVED 11 | @LoadCoreForKernel 12 | 0xCF8A41B1:0xF6B1BF0F //NID RESOLVED 13 | 0xCCE4A157:0x40972E6E //NID RESOLVED 14 | 0xD8779AC6:0x8D46E9DF //NOT exported 15 | @ModuleMgrForKernel 16 | 0x644395E2:0x303FAB7F //NID RESOLVED 17 | @ExceptionManagerForKernel 18 | 0x565C0B0E:0x0A998599 //NID RESOLVED 19 | @end -------------------------------------------------------------------------------- /firmware/infinityboot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(infinityboot VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | add_executable(infinityboot "src/main.c" exports.c) 13 | 14 | set_target_properties(infinityboot 15 | PROPERTIES 16 | ENABLE_EXPORTS true 17 | OUTPUT_NAME infinityboot.prx 18 | ) 19 | 20 | target_link_libraries(infinityboot 21 | PRIVATE 22 | -nostartfiles 23 | rebootex_interface 24 | compat_interface 25 | libconfig_static 26 | reboot 27 | utils 28 | rebootex 29 | sdk 30 | pspkernel 31 | pspctrl_driver 32 | pspsdk 33 | ) 34 | 35 | target_include_directories(infinityboot 36 | PUBLIC 37 | $ 38 | PRIVATE 39 | ${PSP_KERNEL_LIBC} 40 | include 41 | ) 42 | 43 | target_compile_definitions(infinityboot 44 | PUBLIC 45 | INFINITYBOOT_EXEC_PATH="flash0:/kd/infinityboot.prx" 46 | ) 47 | 48 | add_custom_command(OUTPUT exports.c 49 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/exports.exp 50 | COMMAND psp-build-exports -b ${CMAKE_CURRENT_SOURCE_DIR}/exports.exp > exports.c 51 | ) 52 | 53 | add_custom_command(TARGET infinityboot 54 | POST_BUILD 55 | COMMAND psp-fixup-imports infinityboot.prx 56 | COMMAND psp-prxgen infinityboot.prx infinityboot.prx 57 | COMMAND psp-fixup-imports -m ${CMAKE_CURRENT_SOURCE_DIR}/661mapfile.txt infinityboot.prx 58 | COMMAND $ --vanity=\"Things are only impossible until they're not.\" infinityboot.prx infinityboot.prx 59 | ) 60 | -------------------------------------------------------------------------------- /firmware/infinityboot/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015, David "Davee" Morgan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /firmware/infinityboot/README.md: -------------------------------------------------------------------------------- 1 | TODO: this -------------------------------------------------------------------------------- /firmware/infinityboot/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_NID(module_start,0xD3744BE0) 8 | PSP_EXPORT_FUNC_HASH(module_reboot_phase) 9 | PSP_EXPORT_VAR_HASH(module_info) 10 | PSP_EXPORT_END 11 | 12 | PSP_END_EXPORTS 13 | -------------------------------------------------------------------------------- /firmware/infinityboot/include/libinfinity.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef LIBINFINITY_H 26 | #define LIBINFINITY_H 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif // __cplusplus 31 | 32 | int infGetVersion(void); 33 | int infGetRedirectionStatus(void); 34 | void infSetRedirectionStatus(int enabled); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif // __cplusplus 39 | 40 | #endif // LIBINFINITY_H 41 | -------------------------------------------------------------------------------- /firmware/infinityboot/src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2019, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include 26 | #include 27 | #include 28 | 29 | PSP_MODULE_INFO("infinity_boot", 0x7007, 1, 0); 30 | 31 | int module_start(SceSize args, void* argp) 32 | { 33 | setLoadCompatModule(1); 34 | loadRebootModules(); 35 | return 0; 36 | } 37 | -------------------------------------------------------------------------------- /firmware/infinityctrl/661mapfile.txt: -------------------------------------------------------------------------------- 1 | @SysMemForKernel 2 | 0x55A40B2C:0xC4EEAF20 //NID RESOLVED 3 | 0x9697CD32:0x13F4A0DE //NID RESOLVED 4 | 0xB2C7AA36:0x83B5226D //NID RESOLVED 5 | 0x3FC9AE6A:0xC886B169 //NID RESOLVED 6 | 0x6373995D:0x07C586A1 //NID RESOLVED 7 | 0x237DBD4F:0x7158CE7E 8 | 0x9D9A5BA1:0xF12A62F7 9 | @memlmd 10 | 0x7CF1CD3E:0xEF73E85B //NID RESOLVED 11 | @LoadCoreForKernel 12 | 0xCF8A41B1:0xF6B1BF0F //NID RESOLVED 13 | 0xCCE4A157:0x40972E6E //NID RESOLVED 14 | 0xD8779AC6:0x8D46E9DF //NOT exported 15 | @ModuleMgrForKernel 16 | 0x644395E2:0x303FAB7F //NID RESOLVED 17 | @ExceptionManagerForKernel 18 | 0x565C0B0E:0x0A998599 //NID RESOLVED 19 | @end -------------------------------------------------------------------------------- /firmware/infinityctrl/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015, David "Davee" Morgan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /firmware/infinityctrl/README.md: -------------------------------------------------------------------------------- 1 | TODO: this -------------------------------------------------------------------------------- /firmware/infinityctrl/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_NID(module_start,0xD3744BE0) 8 | PSP_EXPORT_FUNC_HASH(module_reboot_phase) 9 | PSP_EXPORT_VAR_HASH(module_info) 10 | PSP_EXPORT_END 11 | 12 | PSP_EXPORT_START(libinfinityKernel, 0, 0x0001) 13 | PSP_EXPORT_FUNC_HASH(infGetVersion) 14 | PSP_EXPORT_FUNC_HASH(infGetRedirectionStatus) 15 | PSP_EXPORT_FUNC_HASH(infSetRedirectionStatus) 16 | PSP_EXPORT_END 17 | 18 | PSP_EXPORT_START(libinfinityUser, 0, 0x4001) 19 | PSP_EXPORT_FUNC_HASH(infGetVersion) 20 | PSP_EXPORT_FUNC_HASH(infGetRedirectionStatus) 21 | PSP_EXPORT_FUNC_HASH(infSetRedirectionStatus) 22 | PSP_EXPORT_END 23 | PSP_END_EXPORTS 24 | -------------------------------------------------------------------------------- /firmware/infinityctrl/include/libinfinity.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef LIBINFINITY_H 26 | #define LIBINFINITY_H 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif // __cplusplus 31 | 32 | int infGetVersion(void); 33 | int infGetRedirectionStatus(void); 34 | void infSetRedirectionStatus(int enabled); 35 | 36 | #ifdef __cplusplus 37 | } 38 | #endif // __cplusplus 39 | 40 | #endif // LIBINFINITY_H 41 | -------------------------------------------------------------------------------- /firmware/infinityctrl/src/libinfinity.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #include "libinfinity.h" 26 | 27 | int infGetVersion(void) 28 | { 29 | return ((INFINITY_VERSION_MAJOR & 0x7F) << 24) | ((INFINITY_VERSION_MINOR & 0xFFF) << 12) | 30 | (INFINITY_VERSION_PATCH & 0xFFF); 31 | } 32 | 33 | // these do nothing 34 | int infGetRedirectionStatus(void) 35 | { 36 | return 0; 37 | } 38 | 39 | void infSetRedirectionStatus(int enabled) 40 | { 41 | (void)enabled; 42 | } 43 | -------------------------------------------------------------------------------- /firmware/mecompat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(mecompat VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | set(CMAKE_EXE_LINKER_FLAGS "") 13 | 14 | set (MECOMPAT_SOURCES 15 | "src/crt0.S" 16 | "src/main.c" 17 | ) 18 | 19 | add_executable(mecompat ${MECOMPAT_SOURCES}) 20 | 21 | set_target_properties(mecompat 22 | PROPERTIES 23 | ENABLE_EXPORTS true 24 | OUTPUT_NAME mecompat.bin 25 | ) 26 | 27 | target_link_libraries(mecompat 28 | PRIVATE 29 | compat_interface 30 | utils 31 | sdk 32 | -nostartfiles 33 | -nostdlib 34 | -T ${CMAKE_CURRENT_SOURCE_DIR}/linkfile.l 35 | ) 36 | 37 | target_compile_definitions(mecompat 38 | PUBLIC 39 | MECOMPAT_EXEC_PATH="flash0:/kd/mecompat.bin" 40 | ) 41 | 42 | add_custom_command(TARGET mecompat 43 | POST_BUILD 44 | COMMAND ${CMAKE_OBJCOPY} -O binary mecompat.bin mecompat.bin 45 | ) 46 | -------------------------------------------------------------------------------- /firmware/mecompat/README.md: -------------------------------------------------------------------------------- 1 | TODO: this -------------------------------------------------------------------------------- /firmware/mecompat/linkfile.l: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlemips") 2 | OUTPUT_ARCH(mips) 3 | 4 | ENTRY(compat_entry) 5 | 6 | SECTIONS 7 | { 8 | . = 0x88F50000; 9 | .text.start : { 10 | *(.text.start) 11 | } 12 | .text : { 13 | *(.text) 14 | } 15 | .rodata : { 16 | *(.rodata) 17 | } 18 | .data : { 19 | *(.data) 20 | } 21 | .bss : { 22 | *(.bss) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /firmware/mecompat/src/crt0.S: -------------------------------------------------------------------------------- 1 | # PSP Software Development Kit - http://www.pspdev.org 2 | # ----------------------------------------------------------------------- 3 | # Licensed under the BSD license, see LICENSE in PSPSDK root for details. 4 | # 5 | # crt0.S - Startup functions and definitions. Inspired by nem's helloworld. 6 | # 7 | # Copyright (c) 2005 Marcus R. Brown 8 | # Copyright (c) 2005 James Forshaw 9 | # Copyright (c) 2005 John Kelley 10 | # 11 | # $Id: crt0.S 363 2005-06-27 20:35:14Z tyranid $ 12 | 13 | .set noreorder 14 | 15 | .text 16 | 17 | .extern main 18 | 19 | #include "as_reg_compat.h" 20 | 21 | 22 | ############################################################################## 23 | 24 | # Support for _init() and _fini(). 25 | ; .global _init 26 | ; .global _fini 27 | ; .type _init, @function 28 | ; .type _fini, @function 29 | 30 | # The .weak keyword ensures there's no error if 31 | # _init/_fini aren't defined. 32 | ; .weak _init 33 | ; .weak _fini 34 | 35 | # Define the main thread attribute variable as weak 36 | ; .weak _main_thread_attr 37 | 38 | .global _start 39 | .ent _start 40 | _start: 41 | 42 | j compat_entry 43 | nop 44 | 45 | .end _start 46 | .global _exit 47 | .ent _exit 48 | 49 | _exit: 50 | # Exit 51 | .end _exit 52 | 53 | .bss 54 | -------------------------------------------------------------------------------- /firmware/procompat/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(procompat VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | set(CMAKE_EXE_LINKER_FLAGS "") 13 | 14 | set (PROCOMPAT_SOURCES 15 | "src/crt0.S" 16 | "src/main.c" 17 | ) 18 | 19 | add_executable(procompat ${PROCOMPAT_SOURCES}) 20 | 21 | set_target_properties(procompat 22 | PROPERTIES 23 | ENABLE_EXPORTS true 24 | OUTPUT_NAME procompat.bin 25 | ) 26 | 27 | target_link_libraries(procompat 28 | PRIVATE 29 | compat_interface 30 | utils 31 | sdk 32 | -nostartfiles 33 | -nostdlib 34 | -T ${CMAKE_CURRENT_SOURCE_DIR}/linkfile.l 35 | ) 36 | 37 | add_custom_command(TARGET procompat 38 | POST_BUILD 39 | COMMAND ${CMAKE_OBJCOPY} -O binary procompat.bin procompat.bin 40 | ) 41 | 42 | target_compile_definitions(procompat 43 | PUBLIC 44 | PROCOMPAT_EXEC_PATH="flash0:/kd/procompat.bin" 45 | ) 46 | -------------------------------------------------------------------------------- /firmware/procompat/README.md: -------------------------------------------------------------------------------- 1 | TODO: this -------------------------------------------------------------------------------- /firmware/procompat/linkfile.l: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlemips") 2 | OUTPUT_ARCH(mips) 3 | 4 | ENTRY(compat_entry) 5 | 6 | SECTIONS 7 | { 8 | . = 0x88F50000; 9 | .text.start : { 10 | *(.text.start) 11 | } 12 | .text : { 13 | *(.text) 14 | } 15 | .rodata : { 16 | *(.rodata) 17 | } 18 | .data : { 19 | *(.data) 20 | } 21 | .bss : { 22 | *(.bss) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /firmware/procompat/src/crt0.S: -------------------------------------------------------------------------------- 1 | # PSP Software Development Kit - http://www.pspdev.org 2 | # ----------------------------------------------------------------------- 3 | # Licensed under the BSD license, see LICENSE in PSPSDK root for details. 4 | # 5 | # crt0.S - Startup functions and definitions. Inspired by nem's helloworld. 6 | # 7 | # Copyright (c) 2005 Marcus R. Brown 8 | # Copyright (c) 2005 James Forshaw 9 | # Copyright (c) 2005 John Kelley 10 | # 11 | # $Id: crt0.S 363 2005-06-27 20:35:14Z tyranid $ 12 | 13 | .set noreorder 14 | 15 | .text 16 | 17 | .extern main 18 | 19 | #include "as_reg_compat.h" 20 | 21 | 22 | ############################################################################## 23 | 24 | # Support for _init() and _fini(). 25 | ; .global _init 26 | ; .global _fini 27 | ; .type _init, @function 28 | ; .type _fini, @function 29 | 30 | # The .weak keyword ensures there's no error if 31 | # _init/_fini aren't defined. 32 | ; .weak _init 33 | ; .weak _fini 34 | 35 | # Define the main thread attribute variable as weak 36 | ; .weak _main_thread_attr 37 | 38 | .global _start 39 | .ent _start 40 | _start: 41 | 42 | j compat_entry 43 | nop 44 | 45 | .end _start 46 | .global _exit 47 | .ent _exit 48 | 49 | _exit: 50 | # Exit 51 | .end _exit 52 | 53 | .bss 54 | -------------------------------------------------------------------------------- /firmware/reboot/661mapfile.txt: -------------------------------------------------------------------------------- 1 | @SysMemForKernel 2 | 0x55A40B2C:0xC4EEAF20 //NID RESOLVED 3 | 0x9697CD32:0x13F4A0DE //NID RESOLVED 4 | 0xB2C7AA36:0x83B5226D //NID RESOLVED 5 | 0x3FC9AE6A:0xC886B169 //NID RESOLVED 6 | 0x6373995D:0x07C586A1 //NID RESOLVED 7 | 0x237DBD4F:0x7158CE7E 8 | 0x9D9A5BA1:0xF12A62F7 9 | @memlmd 10 | 0x7CF1CD3E:0xEF73E85B //NID RESOLVED 11 | @LoadCoreForKernel 12 | 0xCF8A41B1:0xF6B1BF0F //NID RESOLVED 13 | 0xCCE4A157:0x40972E6E //NID RESOLVED 14 | 0xD8779AC6:0x8D46E9DF //NOT exported 15 | @ModuleMgrForKernel 16 | 0x644395E2:0x303FAB7F //NID RESOLVED 17 | @ExceptionManagerForKernel 18 | 0x565C0B0E:0x0A998599 //NID RESOLVED 19 | @end -------------------------------------------------------------------------------- /firmware/reboot/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(reboot VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | set (REBOOT_SOURCES 13 | "src/reboot.c" 14 | "src/utility.c" 15 | ) 16 | 17 | add_library(reboot STATIC ${REBOOT_SOURCES}) 18 | 19 | target_link_libraries(reboot 20 | PUBLIC 21 | rebootex_interface 22 | compat_interface 23 | libconfig_static 24 | 25 | PRIVATE 26 | rebootex_interface 27 | compat_interface 28 | libconfig_static 29 | pspkernel 30 | sdk 31 | utils 32 | rebootex 33 | ) 34 | 35 | target_include_directories(reboot 36 | PUBLIC 37 | $ 38 | PRIVATE 39 | ${PSP_KERNEL_LIBC} 40 | include 41 | ) 42 | -------------------------------------------------------------------------------- /firmware/reboot/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_NID(module_start,0xD3744BE0) 8 | PSP_EXPORT_FUNC_HASH(module_reboot_phase) 9 | PSP_EXPORT_VAR_HASH(module_info) 10 | PSP_EXPORT_END 11 | 12 | PSP_EXPORT_START(libinfinityKernel, 0, 0x0001) 13 | PSP_EXPORT_FUNC_HASH(infGetVersion) 14 | PSP_EXPORT_FUNC_HASH(infGetRedirectionStatus) 15 | PSP_EXPORT_FUNC_HASH(infSetRedirectionStatus) 16 | PSP_EXPORT_END 17 | 18 | PSP_EXPORT_START(libinfinityUser, 0, 0x4001) 19 | PSP_EXPORT_FUNC_HASH(infGetVersion) 20 | PSP_EXPORT_FUNC_HASH(infGetRedirectionStatus) 21 | PSP_EXPORT_FUNC_HASH(infSetRedirectionStatus) 22 | PSP_EXPORT_END 23 | PSP_END_EXPORTS 24 | -------------------------------------------------------------------------------- /firmware/reboot/include/reboot.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef REBOOT_H 26 | #define REBOOT_H 27 | 28 | #define SONY_REBOOT_ADDRESS (0x88600000) 29 | 30 | #define REBOOT_STAGE_POST_REBOOT_BEFORE (3) 31 | #define REBOOT_STAGE_PRE_USER_KILLED (2) 32 | #define REBOOT_STAGE_PRE_KERNEL_KILLED (1) 33 | 34 | void setLoadCompatModule(int load); 35 | void loadRebootModules(void); 36 | 37 | #endif // REBOOT_H 38 | -------------------------------------------------------------------------------- /firmware/reboot/src/utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | */ 24 | 25 | #ifndef UTILITY_H_ 26 | #define UTILITY_H_ 27 | 28 | #include 29 | 30 | #ifdef __cplusplus 31 | extern "C" { 32 | #endif // __cplusplus 33 | 34 | int FileSize(const char *file); 35 | int ReadFile(const char *file, int seek, void *buf, int size); 36 | void ClearCaches(void); 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif // __cplusplus 41 | 42 | #endif // UTILITY_H_ 43 | -------------------------------------------------------------------------------- /firmware/rebootex/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(rebootex VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | set(CMAKE_EXE_LINKER_FLAGS "") 13 | 14 | set (REBOOTEX_SOURCES 15 | "src/crt0.S" 16 | "src/btcnf.c" 17 | "src/btcnfpatch.c" 18 | "src/compatibility.c" 19 | "src/kprintf.c" 20 | "src/lfatpatch.c" 21 | "src/libc.c" 22 | "src/loadcorepatch.c" 23 | "src/main.c" 24 | "src/psp_uart.c" 25 | "src/syscon.c" 26 | "src/sysreg.c" 27 | "src/utility.c" 28 | ) 29 | 30 | add_library(rebootex_interface INTERFACE) 31 | 32 | target_compile_definitions(rebootex_interface 33 | INTERFACE 34 | REBOOTEX_ADDRESS=0x88F10000 35 | ) 36 | 37 | target_include_directories(rebootex_interface 38 | INTERFACE 39 | $ 40 | ) 41 | 42 | target_link_libraries(rebootex_interface 43 | INTERFACE 44 | sdk 45 | ) 46 | 47 | add_executable(rebootex ${REBOOTEX_SOURCES}) 48 | 49 | set_target_properties(rebootex 50 | PROPERTIES 51 | ENABLE_EXPORTS true 52 | OUTPUT_NAME rebootex.bin 53 | COMPILE_FLAGS "-Wno-unused-but-set-variable" 54 | ) 55 | 56 | target_link_libraries(rebootex 57 | PRIVATE 58 | rebootex_interface 59 | compat_interface 60 | utils 61 | -nostartfiles 62 | -nostdlib 63 | -T ${CMAKE_CURRENT_SOURCE_DIR}/linkfile.l 64 | ) 65 | 66 | target_compile_definitions(rebootex 67 | PUBLIC 68 | REBOOTEX_EXEC_PATH="flash0:/kd/rebootex.bin" 69 | PRIVATE 70 | INFINITY_OE_TAG=${INFINITY_OE_TAG} 71 | ) 72 | 73 | add_custom_command(TARGET rebootex 74 | POST_BUILD 75 | COMMAND ${CMAKE_OBJCOPY} -O binary rebootex.bin rebootex.bin 76 | ) 77 | -------------------------------------------------------------------------------- /firmware/rebootex/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (C) 2015, David "Davee" Morgan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and associated documentation files (the "Software"), 5 | to deal in the Software without restriction, including without limitation 6 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 7 | and/or sell copies of the Software, and to permit persons to whom the 8 | Software is furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19 | DEALINGS IN THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /firmware/rebootex/README.md: -------------------------------------------------------------------------------- 1 | TODO: this -------------------------------------------------------------------------------- /firmware/rebootex/include/rebootex_interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2019, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | */ 22 | 23 | #pragma once 24 | 25 | #include 26 | 27 | typedef int (* REBOOTEX_ENTRY)(SceKernelBootParam *reboot_param, SceLoadExecInternalParam *exec_param, int api, int initial_rnd, int is_compat, int firmware); 28 | int rebootex_entry(SceKernelBootParam *reboot_param, SceLoadExecInternalParam *exec_param, int api, int initial_rnd, int is_compat, int firmware); 29 | -------------------------------------------------------------------------------- /firmware/rebootex/linkfile.l: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlemips") 2 | OUTPUT_ARCH(mips) 3 | 4 | ENTRY(rebootex_entry) 5 | 6 | SECTIONS 7 | { 8 | . = 0x88F10000; 9 | .text.start : { 10 | *(.text.start) 11 | } 12 | .text : { 13 | *(.text) 14 | } 15 | .rodata : { 16 | *(.rodata) 17 | } 18 | .data : { 19 | *(.data) 20 | } 21 | .bss : { 22 | *(.bss) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /firmware/rebootex/src/btcnf.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #ifndef BTCNF_H 25 | #define BTCNF_H 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | int InsertModuleBtcnfAfter(char* new_mod, 32 | char* after_mod, 33 | BtcnfHeader* header, 34 | int* size, 35 | u16 flags); 36 | int InsertModuleBtcnfBefore(char* new_mod, 37 | char* before_mod, 38 | BtcnfHeader* header, 39 | int* size, 40 | u16 flags); 41 | int ReplaceModuleBtcnf(char* new_mod, char* replace_mod, BtcnfHeader* header, int* size, u16 flags); 42 | 43 | #endif // BTCNF_H 44 | -------------------------------------------------------------------------------- /firmware/rebootex/src/btcnfpatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #ifndef BTCNFPATCH_H 25 | #define BTCNFPATCH_H 26 | 27 | void applyBtcnfPatches(int model, int firmware); 28 | 29 | #endif // BTCNFPATCH_H 30 | -------------------------------------------------------------------------------- /firmware/rebootex/src/compatibility.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #ifndef COMPATIBILITY_H 25 | #define COMPATIBILITY_H 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | void setCompatibilityInformation(int is_compat, int model, int is_recovery, int firmware); 32 | int compatibilityModuleExists(void); 33 | int runCompatibilityModule(BtcnfHeader* btcnf, int size); 34 | 35 | #endif // COMPATIBILITY_H 36 | -------------------------------------------------------------------------------- /firmware/rebootex/src/crt0.S: -------------------------------------------------------------------------------- 1 | # PSP Software Development Kit - http://www.pspdev.org 2 | # ----------------------------------------------------------------------- 3 | # Licensed under the BSD license, see LICENSE in PSPSDK root for details. 4 | # 5 | # crt0.S - Startup functions and definitions. Inspired by nem's helloworld. 6 | # 7 | # Copyright (c) 2005 Marcus R. Brown 8 | # Copyright (c) 2005 James Forshaw 9 | # Copyright (c) 2005 John Kelley 10 | # 11 | # $Id: crt0.S 363 2005-06-27 20:35:14Z tyranid $ 12 | 13 | .set noreorder 14 | 15 | .text 16 | 17 | .extern main 18 | 19 | #include "as_reg_compat.h" 20 | 21 | 22 | ############################################################################## 23 | 24 | # Support for _init() and _fini(). 25 | ; .global _init 26 | ; .global _fini 27 | ; .type _init, @function 28 | ; .type _fini, @function 29 | 30 | # The .weak keyword ensures there's no error if 31 | # _init/_fini aren't defined. 32 | ; .weak _init 33 | ; .weak _fini 34 | 35 | # Define the main thread attribute variable as weak 36 | ; .weak _main_thread_attr 37 | 38 | .global _start 39 | .ent _start 40 | _start: 41 | j rebootex_entry 42 | nop 43 | 44 | .end _start 45 | .global _exit 46 | .ent _exit 47 | 48 | _exit: 49 | # Exit 50 | .end _exit 51 | 52 | .bss 53 | -------------------------------------------------------------------------------- /firmware/rebootex/src/kprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef __KPRINTF_H__ 2 | #define __KPRINTF_H__ 3 | 4 | void kprintf(const char* text, ...); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /firmware/rebootex/src/lfatpatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #ifndef LFATPATCH_H 25 | #define LFATPATCH_H 26 | 27 | #ifdef MS0_LOAD 28 | void setInfinityctrl(const char* data, int size); 29 | #endif // MS0_LOAD 30 | 31 | void applyLfatPatches(int model); 32 | 33 | #endif // LFATPATCH_H 34 | -------------------------------------------------------------------------------- /firmware/rebootex/src/loadcorepatch.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #ifndef LOADCOREPATCH_H 25 | #define LOADCOREPATCH_H 26 | 27 | void applyLoadcorePatch(int model); 28 | 29 | #endif // LOADCOREPATCH_H 30 | -------------------------------------------------------------------------------- /firmware/rebootex/src/patch.h: -------------------------------------------------------------------------------- 1 | #ifndef __PSP_PATCH_H__ 2 | #define __PSP_PATCH_H__ 3 | 4 | #define REG32(ADDR) (*(vu32*)(ADDR)) 5 | 6 | #define MIPS_LUI(R, IMM) 0x3c000000 | (R << 16) | ((unsigned int)(IMM)&0xffff) 7 | 8 | #define MIPS_ADDI(RT, RS, IMM) (0x20000000 | (RS << 21) | (RT << 16) | ((unsigned int)(IMM)&0xffff)) 9 | #define MIPS_ADDIU(RT, RS, IMM) \ 10 | (0x24000000 | (RS << 21) | (RT << 16) | ((unsigned int)(IMM)&0xffff)) 11 | #define MIPS_ANDI(RT, RS, IMM) (0x30000000 | (RS << 21) | (RT << 16) | ((unsigned int)(IMM)&0xffff)) 12 | #define MIPS_ORI(RT, RS, IMM) (0x34000000 | (RS << 21) | (RT << 16) | ((unsigned int)(IMM)&0xffff)) 13 | #define MIPS_NOP 0x00000000 14 | #define MIPS_J(ADDR) (0x08000000 + ((((unsigned int)(ADDR)) & 0x0ffffffc) >> 2)) 15 | #define MIPS_JR(R) (0x00000008 + ((R) << 21)) 16 | #define MIPS_JAL(ADDR) (0x0c000000 + (((unsigned int)(ADDR) >> 2) & 0x03ffffff)) 17 | #define MIPS_SYSCALL(NUM) (0x0000000C + ((NUM) << 6)) 18 | 19 | #define MIPS_AND(RD, RS, RT) (0x00000024 | (RD << 11) | (RT << 16) | (RS << 21)) 20 | #define MIPS_ADD(RD, RS, RT) (0x00000020 | (RD << 11) | (RT << 16) | (RS << 21)) 21 | #define MIPS_ADDU(RD, RS, RT) (0x00000021 | (RD << 11) | (RT << 16) | (RS << 21)) 22 | 23 | #define MIPS_SW(RT, BASE, OFFSET) (0xac000000 | (BASE << 21) | (RT << 16) | (OFFSET & 0xFFFF)) 24 | #define MIPS_SH(RT, BASE, OFFSET) (0xa4000000 | (BASE << 21) | (RT << 16) | (OFFSET & 0xFFFF)) 25 | 26 | #define SYNC() asm(" sync; nop" ::) 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /firmware/rebootex/src/psp_uart.h: -------------------------------------------------------------------------------- 1 | #ifndef __PSP_UART_H__ 2 | #define __PSP_UART_H__ 3 | 4 | // uncomment to enable debugging through serial 5 | //#define ENABLE_DEBUG 6 | 7 | void psp_uart_init(int bps); 8 | void psp_uart_putc(int txd); 9 | int psp_uart_getc(void); 10 | void uart_dbg_putc(int arg1, int code); 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /firmware/rebootex/src/sysreg.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | PSP IPL SYSREG Driver 3 | ****************************************************************************/ 4 | #include 5 | //#include "kprintf.h" 6 | 7 | #define REG32(ADDR) (*(vu32*)(ADDR)) 8 | #define SYNC() asm(" sync; nop" ::) 9 | 10 | u32 sceSysregSpiClkSelect(int a1, int a2) 11 | { 12 | u32 shift; 13 | u32 in, out; 14 | 15 | shift = a1 << 2; 16 | 17 | in = REG32(0xbc100064); 18 | out = in & ~(7 << shift); 19 | out |= a2 << shift; 20 | REG32(0xbc100064) = out; 21 | return (in > shift) & 7; 22 | } 23 | 24 | u32 sceSysregSpiClkEnable(u32 bit) 25 | { 26 | u32 in, out; 27 | u32 mask = (1 << bit); 28 | u32 a2 = 1; 29 | 30 | // 1128(mask,1) 31 | in = REG32(0xbc100058); 32 | out = (in & (~mask)); 33 | if (a2) 34 | out |= mask; 35 | REG32(0xbc100058) = out; 36 | return in & mask; 37 | } 38 | -------------------------------------------------------------------------------- /firmware/rebootex/src/sysreg.h: -------------------------------------------------------------------------------- 1 | #ifndef __SYSREG_H__ 2 | #define __SYSREG_H__ 3 | u32 sceSysregSpiClkSelect(int a1, int a2); 4 | u32 sceSysregSpiClkEnable(u32 bit); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /firmware/rebootex/src/utility.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #include "utility.h" 25 | 26 | void ClearCaches(void) 27 | { 28 | /* Clear the Icache */ 29 | void (*clear_icache)(void) = (void*)0x8860013C; 30 | void (*clear_dcache)(void) = (void*)0x88600890; 31 | 32 | clear_icache(); 33 | clear_dcache(); 34 | } 35 | -------------------------------------------------------------------------------- /firmware/rebootex/src/utility.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2015, David "Davee" Morgan 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a 5 | copy of this software and associated documentation files (the "Software"), 6 | to deal in the Software without restriction, including without limitation 7 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 | and/or sell copies of the Software, and to permit persons to whom the 9 | Software is furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 19 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 20 | DEALINGS IN THE SOFTWARE. 21 | 22 | */ 23 | 24 | #ifndef UTILITY_H 25 | #define UTILITY_H 26 | 27 | void ClearCaches(void); 28 | 29 | #endif // UTILITY_H 30 | -------------------------------------------------------------------------------- /firmware/recovery/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(recovery VERSION 1.0 LANGUAGES C ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | set(CMAKE_EXE_LINKER_FLAGS "") 13 | 14 | set (RECOVERY_SOURCES 15 | "src/crt0.S" 16 | "src/main.c" 17 | ) 18 | 19 | add_executable(recovery ${RECOVERY_SOURCES}) 20 | 21 | set_target_properties(recovery 22 | PROPERTIES 23 | ENABLE_EXPORTS true 24 | OUTPUT_NAME recovery.bin 25 | ) 26 | 27 | target_link_libraries(recovery 28 | PRIVATE 29 | utils 30 | sdk 31 | -nostartfiles 32 | -nostdlib 33 | -T ${CMAKE_CURRENT_SOURCE_DIR}/linkfile.l 34 | ) 35 | 36 | add_custom_command(TARGET recovery 37 | POST_BUILD 38 | COMMAND ${CMAKE_OBJCOPY} -O binary recovery.bin recovery.bin 39 | ) 40 | -------------------------------------------------------------------------------- /firmware/recovery/README.md: -------------------------------------------------------------------------------- 1 | TODO: this -------------------------------------------------------------------------------- /firmware/recovery/linkfile.l: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlemips") 2 | OUTPUT_ARCH(mips) 3 | 4 | ENTRY(recovery_entry) 5 | 6 | SECTIONS 7 | { 8 | . = 0x9800000; 9 | .text.start : { 10 | *(.text.start) 11 | } 12 | .text : { 13 | *(.text) 14 | } 15 | .rodata : { 16 | *(.rodata) 17 | } 18 | .data : { 19 | *(.data) 20 | } 21 | .bss : { 22 | *(.bss) 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /firmware/recovery/src/crt0.S: -------------------------------------------------------------------------------- 1 | # PSP Software Development Kit - http://www.pspdev.org 2 | # ----------------------------------------------------------------------- 3 | # Licensed under the BSD license, see LICENSE in PSPSDK root for details. 4 | # 5 | # crt0.S - Startup functions and definitions. Inspired by nem's helloworld. 6 | # 7 | # Copyright (c) 2005 Marcus R. Brown 8 | # Copyright (c) 2005 James Forshaw 9 | # Copyright (c) 2005 John Kelley 10 | # 11 | # $Id: crt0.S 363 2005-06-27 20:35:14Z tyranid $ 12 | 13 | .set noreorder 14 | 15 | .text 16 | 17 | .extern main 18 | 19 | #include "as_reg_compat.h" 20 | 21 | 22 | ############################################################################## 23 | 24 | # Support for _init() and _fini(). 25 | ; .global _init 26 | ; .global _fini 27 | ; .type _init, @function 28 | ; .type _fini, @function 29 | 30 | # The .weak keyword ensures there's no error if 31 | # _init/_fini aren't defined. 32 | ; .weak _init 33 | ; .weak _fini 34 | 35 | # Define the main thread attribute variable as weak 36 | ; .weak _main_thread_attr 37 | 38 | .global _start 39 | .ent _start 40 | _start: 41 | .word go_entry+0x40000000 42 | go_entry: 43 | j recovery_entry 44 | nop 45 | 46 | .end _start 47 | .global _exit 48 | .ent _exit 49 | 50 | _exit: 51 | # Exit 52 | .end _exit 53 | 54 | .bss 55 | -------------------------------------------------------------------------------- /kernel_helper/661mapfile.txt: -------------------------------------------------------------------------------- 1 | @SysMemForKernel 2 | 0x55A40B2C:0xC4EEAF20 //NID RESOLVED 3 | 0x9697CD32:0x13F4A0DE //NID RESOLVED 4 | 0xB2C7AA36:0x83B5226D //NID RESOLVED 5 | 0x3FC9AE6A:0xC886B169 //NID RESOLVED 6 | 0x6373995D:0x07C586A1 //NID RESOLVED 7 | 0x237DBD4F:0x7158CE7E 8 | 0x9D9A5BA1:0xF12A62F7 9 | @memlmd 10 | 0x7CF1CD3E:0xEF73E85B //NID RESOLVED 11 | @LoadCoreForKernel 12 | 0xCF8A41B1:0xF6B1BF0F //NID RESOLVED 13 | 0xCCE4A157:0x40972E6E //NID RESOLVED 14 | 0xD8779AC6:0x8D46E9DF //NOT exported 15 | @ModuleMgrForKernel 16 | 0x644395E2:0x303FAB7F //NID RESOLVED 17 | @ExceptionManagerForKernel 18 | 0x565C0B0E:0x0A998599 //NID RESOLVED 19 | @end -------------------------------------------------------------------------------- /kernel_helper/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_NID(module_start,0xD3744BE0) 8 | PSP_EXPORT_VAR_HASH(module_info) 9 | PSP_EXPORT_END 10 | 11 | PSP_EXPORT_START(kernel_helper_user, 0, 0x4009) 12 | PSP_EXPORT_FUNC_HASH(boot_infinity) 13 | PSP_EXPORT_FUNC_HASH(getTrueModel) 14 | PSP_EXPORT_FUNC_HASH(setHomePopup) 15 | PSP_EXPORT_FUNC_HASH(pspSignCheck) 16 | PSP_EXPORT_END 17 | PSP_END_EXPORTS 18 | -------------------------------------------------------------------------------- /kernel_helper/include/kernel_helper.h: -------------------------------------------------------------------------------- 1 | #ifndef INFINITYKINSTALLER_H_ 2 | #define INFINITYKINSTALLER_H_ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | unsigned int getBaryon(void); 9 | int getTrueModel(void); 10 | int setHomePopup(int value); 11 | 12 | void boot_infinity(void); 13 | 14 | int pspSignCheck(u8 *buf); 15 | 16 | #define MODEL(x) (1 << x) 17 | #define ALL_MODELS (0xFFFFFFFF) 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif // INFINITYKINSTALLER_H_ 24 | -------------------------------------------------------------------------------- /kexploit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(kexploit VERSION 1.0 LANGUAGES C CXX) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | add_library(kexploit STATIC src/main.cpp src/cache.cpp src/findproc.cpp src/k660.cpp) 13 | 14 | target_link_libraries(kexploit PUBLIC sdk PRIVATE utils netifhandle) 15 | 16 | target_include_directories(kexploit 17 | PUBLIC 18 | $ 19 | PRIVATE 20 | include 21 | ) 22 | -------------------------------------------------------------------------------- /kexploit/include/kexploit.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif // __cplusplus 6 | 7 | #include 8 | #include 9 | 10 | typedef struct 11 | { 12 | uintptr_t (* findProc)(const char *modname, const char *libname, unsigned int nid); 13 | void (* clearCaches)(void); 14 | SceModule2 *(* pspKernelFindModuleByName)(const char *modname); 15 | int (* pspKernelGetModel)(void); 16 | } KernelContext; 17 | 18 | typedef void (* KernelFunction)(const KernelContext *ctx); 19 | 20 | int executeInKernelMode(KernelFunction kfunc); 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif // __cplusplus 25 | -------------------------------------------------------------------------------- /kexploit/src/cache.cpp: -------------------------------------------------------------------------------- 1 | #include "cache.h" 2 | 3 | #include 4 | 5 | void ClearCaches(void) 6 | { 7 | sceKernelDcacheWritebackInvalidateAll(); 8 | sceKernelIcacheInvalidateAll(); 9 | } 10 | 11 | void KClearCaches(void) 12 | { 13 | // Clear the Icache 14 | asm("\ 15 | .word 0x40088000; .word 0x24091000; .word 0x7D081240;\ 16 | .word 0x01094804; .word 0x4080E000; .word 0x4080E800;\ 17 | .word 0x00004021; .word 0xBD010000; .word 0xBD030000;\ 18 | .word 0x25080040; .word 0x1509FFFC; .word 0x00000000;\ 19 | " ::); 20 | 21 | // Clear the dcache 22 | asm("\ 23 | .word 0x40088000; .word 0x24090800; .word 0x7D081180;\ 24 | .word 0x01094804; .word 0x00004021; .word 0xBD140000;\ 25 | .word 0xBD140000; .word 0x25080040; .word 0x1509FFFC;\ 26 | .word 0x00000000; .word 0x0000000F; .word 0x00000000;\ 27 | " ::); 28 | } 29 | -------------------------------------------------------------------------------- /kexploit/src/cache.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | void ClearCaches(void); 4 | void KClearCaches(void); 5 | -------------------------------------------------------------------------------- /kexploit/src/findproc.cpp: -------------------------------------------------------------------------------- 1 | #include "findproc.h" 2 | 3 | #include 4 | #include 5 | 6 | uintptr_t findProc(KernelContext* ctx, const char* modname, const char* lib, unsigned int nid) 7 | { 8 | // declare our local vars 9 | unsigned int i = 0, u = 0; 10 | 11 | // find the module 12 | auto mod = ctx->pspKernelFindModuleByName(modname); 13 | 14 | // if no mod, error 15 | if (!mod) 16 | { 17 | return 0; 18 | } 19 | 20 | // get the entry info 21 | unsigned int entry_size = mod->ent_size; 22 | unsigned int entry_start = (unsigned int)mod->ent_top; 23 | 24 | // scan through the export list 25 | while (i < entry_size) 26 | { 27 | // point to the entry 28 | SceLibraryEntryTable* entry = (SceLibraryEntryTable*)(entry_start + i); 29 | 30 | // if there is a libname, check if it's the libname we want 31 | if (entry->libname && (strcmp((char*)entry->libname, lib) == 0)) 32 | { 33 | // now lets scan through the stubs for our nid 34 | unsigned int* table = reinterpret_cast(entry->entrytable); 35 | unsigned int total = entry->stubcount + entry->vstubcount; 36 | 37 | // if there is nids, lets continue 38 | if (total > 0) 39 | { 40 | // scan through the nidtable 41 | for (u = 0; u < total; u++) 42 | { 43 | // check if its the nid we're looking for 44 | if (table[u] == nid) 45 | { 46 | // our nid, let return the address 47 | return table[u + total]; 48 | } 49 | } 50 | } 51 | } 52 | 53 | // update entry counter 54 | i += (entry->len << 2); 55 | } 56 | 57 | // lib not found ): 58 | return 0; 59 | } 60 | -------------------------------------------------------------------------------- /kexploit/src/findproc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | uintptr_t findProc(KernelContext* ctx, const char* modname, const char* lib, unsigned int nid); 7 | -------------------------------------------------------------------------------- /kexploit/src/k660.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace k660 6 | { 7 | int executeInKernelMode(KernelFunction kfunc); 8 | } 9 | -------------------------------------------------------------------------------- /kexploit/src/main.cpp: -------------------------------------------------------------------------------- 1 | #include "kexploit.h" 2 | 3 | #include "k660.h" 4 | 5 | #include 6 | #include 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace 13 | { 14 | constexpr auto firmwareVersion(const char fw[4]) 15 | { 16 | return ((fw[0] - '0') << 24) | ((fw[2] - '0') << 16) | ((fw[3] - '0') << 8) | 0x10; 17 | } 18 | 19 | struct SupportedFirmware 20 | { 21 | int version; 22 | int (*executeInKernelMode)(KernelFunction kfunc); 23 | }; 24 | 25 | constexpr std::array g_supported{ { 26 | { firmwareVersion("6.60"), k660::executeInKernelMode }, 27 | { firmwareVersion("6.61"), k660::executeInKernelMode }, 28 | } }; 29 | } 30 | 31 | int executeInKernelMode(KernelFunction kfunc) 32 | { 33 | auto version = sceKernelDevkitVersion(); 34 | 35 | auto it = std::find_if(g_supported.cbegin(), g_supported.cend(), [version](auto supported) { 36 | return (version == supported.version); 37 | }); 38 | 39 | if (it == g_supported.end()) 40 | return -1; 41 | 42 | return it->executeInKernelMode(kfunc); 43 | } 44 | -------------------------------------------------------------------------------- /libconfig/661mapfile.txt: -------------------------------------------------------------------------------- 1 | @SysMemForKernel 2 | 0x55A40B2C:0xC4EEAF20 //NID RESOLVED 3 | 0x9697CD32:0x13F4A0DE //NID RESOLVED 4 | 0xB2C7AA36:0x83B5226D //NID RESOLVED 5 | 0x3FC9AE6A:0xC886B169 //NID RESOLVED 6 | 0x6373995D:0x07C586A1 //NID RESOLVED 7 | 0x237DBD4F:0x7158CE7E 8 | 0x9D9A5BA1:0xF12A62F7 9 | @memlmd 10 | 0x7CF1CD3E:0xEF73E85B //NID RESOLVED 11 | @LoadCoreForKernel 12 | 0xCF8A41B1:0xF6B1BF0F //NID RESOLVED 13 | 0xCCE4A157:0x40972E6E //NID RESOLVED 14 | 0xD8779AC6:0x8D46E9DF //NOT exported 15 | @ModuleMgrForKernel 16 | 0x644395E2:0x303FAB7F //NID RESOLVED 17 | @ExceptionManagerForKernel 18 | 0x565C0B0E:0x0A998599 //NID RESOLVED 19 | @end -------------------------------------------------------------------------------- /libconfig/exports.exp: -------------------------------------------------------------------------------- 1 | # Define the exports for the prx 2 | PSP_BEGIN_EXPORTS 3 | 4 | # These four lines are mandatory (although you can add other functions like module_stop) 5 | # syslib is a psynonym for the single mandatory export. 6 | PSP_EXPORT_START(syslib, 0, 0x8000) 7 | PSP_EXPORT_FUNC_NID(module_start,0xD3744BE0) 8 | PSP_EXPORT_FUNC_HASH(module_stop) 9 | PSP_EXPORT_FUNC_HASH(module_reboot_before) 10 | PSP_EXPORT_VAR_HASH(module_info) 11 | PSP_EXPORT_END 12 | 13 | PSP_EXPORT_START(libconfig_kernel, 0, 0x0009) 14 | PSP_EXPORT_FUNC_HASH(infIsConfigAssigned) 15 | PSP_EXPORT_FUNC_HASH(infInitConfig) 16 | PSP_EXPORT_FUNC_HASH(infCreateConfig) 17 | PSP_EXPORT_FUNC_HASH(infAssignConfig) 18 | PSP_EXPORT_FUNC_HASH(infChangeConfigLocation) 19 | PSP_EXPORT_FUNC_HASH(infGetEntryInfo) 20 | PSP_EXPORT_FUNC_HASH(infGetEntry) 21 | PSP_EXPORT_FUNC_HASH(infAddEntry) 22 | PSP_EXPORT_FUNC_HASH(infUpdateEntry) 23 | PSP_EXPORT_FUNC_HASH(infDeleteEntry) 24 | PSP_EXPORT_FUNC_HASH(infFlushConfig) 25 | PSP_EXPORT_FUNC_HASH(infDiscardConfig) 26 | PSP_EXPORT_END 27 | 28 | PSP_EXPORT_START(libconfig_user, 0, 0x4009) 29 | PSP_EXPORT_FUNC_HASH(infIsConfigAssigned) 30 | PSP_EXPORT_FUNC_HASH(infInitConfig) 31 | PSP_EXPORT_FUNC_HASH(infCreateConfig) 32 | PSP_EXPORT_FUNC_HASH(infAssignConfig) 33 | PSP_EXPORT_FUNC_HASH(infChangeConfigLocation) 34 | PSP_EXPORT_FUNC_HASH(infGetEntryInfo) 35 | PSP_EXPORT_FUNC_HASH(infGetEntry) 36 | PSP_EXPORT_FUNC_HASH(infAddEntry) 37 | PSP_EXPORT_FUNC_HASH(infUpdateEntry) 38 | PSP_EXPORT_FUNC_HASH(infDeleteEntry) 39 | PSP_EXPORT_FUNC_HASH(infFlushConfig) 40 | PSP_EXPORT_FUNC_HASH(infDiscardConfig) 41 | PSP_EXPORT_END 42 | 43 | PSP_END_EXPORTS 44 | -------------------------------------------------------------------------------- /libconfig/src/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015, David "Davee" Morgan 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the "Software"), 7 | to deal in the Software without restriction, including without limitation 8 | the rights to use, copy, modify, merge, publish, distribute, sublicense, 9 | and/or sell copies of the Software, and to permit persons to whom the 10 | Software is furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 | THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 | FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 | DEALINGS IN THE SOFTWARE. 22 | 23 | 24 | */ 25 | 26 | #include 27 | #include 28 | 29 | PSP_MODULE_INFO("libconfig", 0x1000, 1, 0); 30 | 31 | int module_start(SceSize args, void* argp) 32 | { 33 | return 0; 34 | } 35 | 36 | int module_stop(SceSize args, void* argp) 37 | { 38 | infFlushConfig(); 39 | return 0; 40 | } 41 | 42 | int module_reboot_before(void) 43 | { 44 | infFlushConfig(); 45 | return 0; 46 | } 47 | -------------------------------------------------------------------------------- /sdk/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.13.4) 2 | project(sdk VERSION 1.0) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | add_library(sdk INTERFACE) 9 | 10 | target_link_directories(sdk 11 | BEFORE 12 | INTERFACE 13 | $ 14 | ) 15 | 16 | target_include_directories(sdk 17 | BEFORE 18 | INTERFACE 19 | $ 20 | ) 21 | -------------------------------------------------------------------------------- /sdk/include/kubridge.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/include/kubridge.h -------------------------------------------------------------------------------- /sdk/include/pspmodulemgr_kernel.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/include/pspmodulemgr_kernel.h -------------------------------------------------------------------------------- /sdk/include/pspusbdevice.h: -------------------------------------------------------------------------------- 1 | #ifndef __PSPUSBDEVICE_H__ 2 | #define __PSPUSBDEVICE_H__ 3 | 4 | /** 5 | * This functions require flash0:/kd/usbdevice.prx to be loaded/started first. 6 | 7 | * Link with pspusbdevice for user mode access or with pspusbdevice_driver for kernel access 8 | */ 9 | 10 | #define PSP_USBDEVICE_FLASH0 0 11 | #define PSP_USBDEVICE_FLASH1 1 12 | #define PSP_USBDEVICE_FLASH2 2 13 | #define PSP_USBDEVICE_FLASH3 3 14 | #define PSP_USBDEVICE_UMD9660 4 15 | 16 | #define UNASSIGN_MASK_FLASH0 1 17 | #define UNASSIGN_MASK_FLASH1 2 18 | #define UNASSIGN_MASK_FLASH2 3 19 | #define UNASSIGN_MASK_FLASH3 4 20 | 21 | /** 22 | * Sets the usb device. Call this function when you are about to do the sceUsbStart and sceUsbActivate stuff 23 | * 24 | * @param device - The usb device, one of listed above. 25 | * @param ronly - If non-zero indicates read only access. This parameters is ignored for PSP_USBDEVICE_UMD9660 26 | * @param unassign_mask - It unassigns automatically the flashes indicated by the mask. 27 | * The flashes will be reassigned automatically after calling pspUsbDeviceFinishDevice 28 | * 29 | * Set this param to 0 if you don't need it (vshctrl doesn't use it). 30 | * 31 | * @returns 0 on success, < 0 on error. 32 | */ 33 | int pspUsbDeviceSetDevice(u32 device, int ronly, int unassign_mask); 34 | 35 | /** 36 | * Finishes the usb device. Call this function after stoping usbstor driver 37 | * 38 | * @returns 0 in success, < 0 on error 39 | */ 40 | int pspUsbDeviceFinishDevice(); 41 | 42 | 43 | #endif 44 | 45 | -------------------------------------------------------------------------------- /sdk/include/vshctrl.h: -------------------------------------------------------------------------------- 1 | #ifndef __VSHCTRL_H__ 2 | #define __VSHCTRL_H__ 3 | 4 | /** 5 | * This api is for vsh menu. (flash0:/vsh/module/satelite.prx) 6 | * 7 | * The vsh menu is an user mode module, and because of this, these functions are 8 | * only available to user mode. 9 | */ 10 | 11 | /** 12 | * Registers the vsh menu. 13 | * When HOME is pressed, vshctrl will load the satelite module. 14 | * In module_start, call this function to register the vsh menu. 15 | * 16 | * @param ctrl - The function that will be executed each time 17 | * the system calls ReadBufferPositive. Despite satelite.prx being 18 | * an user module, this function will be executed in kernel mode. 19 | * 20 | * @returns 0 on success, < 0 on error. 21 | */ 22 | int vctrlVSHRegisterVshMenu(int (* ctrl)(SceCtrlData *, int)); 23 | 24 | /** 25 | * Exits the vsh menu. 26 | * vshmenu module must call this module after destroying vsh menu display and 27 | * freeing resources. 28 | * 29 | * vshmenu module doesn't need to stop-unload itself, as that is vshctrl job. 30 | * 31 | * @param conf - Indicates the new config. vshctrl will update the internal 32 | * vshctrl and systemctrl variables with the new configuration given by this param. 33 | * However is job of satelite.prx to save those settings to the configuration file. 34 | * using sctrlSESetConfig. 35 | * 36 | * @param videoiso - Indicates the videoiso to mount, or NULL if none. 37 | * @param disctype - The disctype of the videoiso (0x20=video, 0x40=audio) 38 | * 39 | * @returns 0 on success, < 0 on error. 40 | */ 41 | int vctrlVSHExitVSHMenu(SEConfig *conf, char *videoiso, int disctype); 42 | 43 | 44 | #endif 45 | 46 | -------------------------------------------------------------------------------- /sdk/lib/libpspinit.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspinit.a -------------------------------------------------------------------------------- /sdk/lib/libpspkdebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspkdebug.a -------------------------------------------------------------------------------- /sdk/lib/libpspkubridge.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspkubridge.a -------------------------------------------------------------------------------- /sdk/lib/libpsploadexec_kernel.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpsploadexec_kernel.a -------------------------------------------------------------------------------- /sdk/lib/libpspmodulemgr_kernel.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspmodulemgr_kernel.a -------------------------------------------------------------------------------- /sdk/lib/libpspmodulemgr_user.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspmodulemgr_user.a -------------------------------------------------------------------------------- /sdk/lib/libpspsysmem_kernel.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspsysmem_kernel.a -------------------------------------------------------------------------------- /sdk/lib/libpspsysmem_user.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspsysmem_user.a -------------------------------------------------------------------------------- /sdk/lib/libpspsystemctrl_kernel.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspsystemctrl_kernel.a -------------------------------------------------------------------------------- /sdk/lib/libpspsystemctrl_user.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspsystemctrl_user.a -------------------------------------------------------------------------------- /sdk/lib/libpspumd_kernel.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspumd_kernel.a -------------------------------------------------------------------------------- /sdk/lib/libpspusbdevice.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspusbdevice.a -------------------------------------------------------------------------------- /sdk/lib/libpspusbdevice_driver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspusbdevice_driver.a -------------------------------------------------------------------------------- /sdk/lib/libpspvshctrl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/sdk/lib/libpspvshctrl.a -------------------------------------------------------------------------------- /sdk/readme.txt: -------------------------------------------------------------------------------- 1 | SDK for 4.01 M33 2 | 3 | This update adds the function sctrlHENLoadModuleOnReboot which may be used for programs that 4 | need to have reboot control (e.g. shells). 5 | 6 | A sample is included in samples/bootload. 7 | 8 | Copy EBOOT.PBP and rdriver.prx to /PSP/GAME4XX/bootload (the sample will not work in other path). 9 | The sample demonstrates how to load homebrew, isos, and psx games, while still having the control 10 | of returning to your application. 11 | 12 | ----- 13 | 14 | psp-packer, this tool is to compress prx's and pbp's. This is only for 3.xx and 4.xx kernel. 15 | What the tool can compress and its compatibility: 16 | 17 | kernel prx: yes, compatible with 3.71 M33-3 and higher 18 | PBP user: yes, compatible with 3.71 M33-1 or 3 (i don't remember) and higher 19 | PBP kernel and PBP vsh: no 20 | user prx: yes, compatible with 4.01 M33 and higher 21 | vsh prx: no. 22 | 23 | The usage of the tool is very simple: 24 | 25 | psp-packer myprx.prx -> it will compress myprx.prx in place 26 | psp-packer myprx.prx myprx_packed.prx -> it will compress myprx.prx into myprx_packed.prx 27 | 28 | If you want the prx to have a sce_header, add the "-s" switch before the other parameters. 29 | 30 | Note: pbps need to have 0x200 flags. If the user pbp has not those flags, the program will ask 31 | to convert it, this shouldn't cause any problem to the program. 32 | 33 | Windows binary is included. In linux x86, just type make and alternativelly make install. 34 | It won't work on big endian systems. 35 | -------------------------------------------------------------------------------- /stubs/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(stubs VERSION 1.0) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | add_subdirectory(power) 13 | add_subdirectory(syscon) 14 | add_subdirectory(vshbridge) 15 | add_subdirectory(netifhandle) 16 | add_subdirectory(memlmd) 17 | add_subdirectory(modulemgr) 18 | -------------------------------------------------------------------------------- /stubs/memlmd/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(memlmd VERSION 1.0 LANGUAGES ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | function(build_stubs _OBJS STUB_NAME STUB_COUNT) 13 | foreach(X RANGE ${STUB_COUNT}) 14 | string(LENGTH "0000${X}" X_POSTFIX_LENGTH) 15 | math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4") 16 | string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX) 17 | add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S") 18 | target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}") 19 | set(OBJS ${OBJS} "$") 20 | endforeach() 21 | set(${_OBJS} ${OBJS} PARENT_SCOPE) 22 | endfunction() 23 | 24 | build_stubs(semaphore_OBJS semaphore 1) 25 | 26 | add_library(memlmd STATIC 27 | ${semaphore_OBJS} 28 | ) 29 | 30 | target_include_directories(memlmd 31 | PUBLIC 32 | $ 33 | ) 34 | -------------------------------------------------------------------------------- /stubs/memlmd/include/memlmd.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | int sceUtilsBufferCopyWithRange(void *dst, size_t dst_size, const void *src, size_t src_size, int cmd); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /stubs/memlmd/semaphore.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "semaphore",0x00090011,0x00010005 6 | STUB_FUNC 0x4C537C72,sceUtilsBufferCopyWithRange 7 | STUB_END 8 | -------------------------------------------------------------------------------- /stubs/modulemgr/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(modulemgr VERSION 1.0 LANGUAGES ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | function(build_stubs _OBJS STUB_NAME STUB_COUNT) 13 | foreach(X RANGE ${STUB_COUNT}) 14 | string(LENGTH "0000${X}" X_POSTFIX_LENGTH) 15 | math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4") 16 | string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX) 17 | add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S") 18 | target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}") 19 | set(OBJS ${OBJS} "$") 20 | endforeach() 21 | set(${_OBJS} ${OBJS} PARENT_SCOPE) 22 | endfunction() 23 | 24 | build_stubs(modulemgr_OBJS ModuleMgrForUser 1) 25 | 26 | add_library(modulemgr STATIC ${modulemgr_OBJS}) 27 | 28 | target_include_directories(modulemgr 29 | INTERFACE 30 | $ 31 | ) 32 | -------------------------------------------------------------------------------- /stubs/modulemgr/ModuleMgrForUser.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "ModuleMgrForUser", 0x40010000, 0x00010005 6 | STUB_FUNC 0xD8B73127, sceKernelGetModuleIdByAddress 7 | STUB_END -------------------------------------------------------------------------------- /stubs/modulemgr/include/modulemgr.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | #include 8 | 9 | SceUID sceKernelGetModuleIdByAddress(uintptr_t ptr); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | -------------------------------------------------------------------------------- /stubs/netifhandle/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(netifhandle VERSION 1.0 LANGUAGES ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | function(build_stubs _OBJS STUB_NAME STUB_COUNT) 13 | foreach(X RANGE ${STUB_COUNT}) 14 | string(LENGTH "0000${X}" X_POSTFIX_LENGTH) 15 | math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4") 16 | string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX) 17 | add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S") 18 | target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}") 19 | set(OBJS ${OBJS} "$") 20 | endforeach() 21 | set(${_OBJS} ${OBJS} PARENT_SCOPE) 22 | endfunction() 23 | 24 | build_stubs(sceNetIfhandle_lib_OBJS sceNetIfhandle_lib 1) 25 | 26 | add_library(netifhandle STATIC 27 | ${sceNetIfhandle_lib_OBJS} 28 | ) 29 | 30 | target_include_directories(netifhandle 31 | PUBLIC 32 | $ 33 | ) 34 | -------------------------------------------------------------------------------- /stubs/netifhandle/include/netifhandle.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | typedef struct SceKernelIfHandleParam 8 | { 9 | struct SceKernelIfHandleParam *unk_0; 10 | unsigned int unk_4; 11 | unsigned int unk_8; 12 | unsigned int unk_12; 13 | unsigned short unk_16; 14 | unsigned short unk_18; 15 | unsigned int unk_20; 16 | unsigned int unk_24; 17 | unsigned int unk_28; 18 | unsigned int unk_32; 19 | unsigned int unk_36; 20 | unsigned int unk_40; 21 | unsigned int unk_44; 22 | unsigned int unk_48; 23 | unsigned int unk_52; 24 | unsigned int unk_56; 25 | unsigned int unk_60; 26 | unsigned int unk_64; 27 | unsigned int unk_68; 28 | unsigned int unk_72; 29 | } SceKernelIfHandleParam; 30 | 31 | int sceNetMPulldown(SceKernelIfHandleParam *param, int unk, int unk2, void *unk3); 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /stubs/netifhandle/sceNetIfhandle_lib.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "sceNetIfhandle_lib",0x40090000,0x00010005 6 | STUB_FUNC 0xE80F00A4, sceNetMPulldown 7 | STUB_END 8 | -------------------------------------------------------------------------------- /stubs/power/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(power VERSION 1.0 LANGUAGES ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | function(build_stubs _OBJS STUB_NAME STUB_COUNT) 13 | foreach(X RANGE ${STUB_COUNT}) 14 | string(LENGTH "0000${X}" X_POSTFIX_LENGTH) 15 | math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4") 16 | string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX) 17 | add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S") 18 | target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}") 19 | set(OBJS ${OBJS} "$") 20 | endforeach() 21 | set(${_OBJS} ${OBJS} PARENT_SCOPE) 22 | endfunction() 23 | 24 | build_stubs(scePower_OBJS scePower 2) 25 | 26 | add_library(power STATIC 27 | ${scePower_OBJS} 28 | ) 29 | 30 | target_include_directories(power 31 | PUBLIC 32 | $ 33 | ) 34 | -------------------------------------------------------------------------------- /stubs/power/scePower.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "scePower", 0x40010000, 0x00020005 6 | STUB_FUNC 0x2B7C7CF4, scePowerRequestStandby 7 | STUB_FUNC 0x0442D852, scePowerRequestColdReset 8 | STUB_END -------------------------------------------------------------------------------- /stubs/syscon/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(syscon VERSION 1.0 LANGUAGES ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | function(build_stubs _OBJS STUB_NAME STUB_COUNT) 13 | foreach(X RANGE ${STUB_COUNT}) 14 | string(LENGTH "0000${X}" X_POSTFIX_LENGTH) 15 | math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4") 16 | string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX) 17 | add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S") 18 | target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}") 19 | set(OBJS ${OBJS} "$") 20 | endforeach() 21 | set(${_OBJS} ${OBJS} PARENT_SCOPE) 22 | endfunction() 23 | 24 | build_stubs(sceSyscon_driver_OBJS sceSyscon_driver 1) 25 | 26 | add_library(syscon STATIC 27 | ${sceSyscon_driver_OBJS} 28 | ) 29 | 30 | target_include_directories(syscon 31 | PUBLIC 32 | $ 33 | ) 34 | -------------------------------------------------------------------------------- /stubs/syscon/include/syscon.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" { 5 | #endif 6 | 7 | void sceSysconGetBaryonVersion(unsigned int *baryon); 8 | 9 | #ifdef __cplusplus 10 | } 11 | #endif 12 | -------------------------------------------------------------------------------- /stubs/syscon/sceSyscon_driver.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "sceSyscon_driver",0x00090000,0x00010005 6 | STUB_FUNC 0x7EC5A957,sceSysconGetBaryonVersion 7 | STUB_END 8 | -------------------------------------------------------------------------------- /stubs/vshbridge/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(vshbridge VERSION 1.0 LANGUAGES ASM) 3 | 4 | if (NOT CMAKE_TOOLCHAIN_FILE) 5 | set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/psp-toolchain.cmake) 6 | endif() 7 | 8 | if(NOT CMAKE_BUILD_TYPE) 9 | set(CMAKE_BUILD_TYPE Release) 10 | endif() 11 | 12 | function(build_stubs _OBJS STUB_NAME STUB_COUNT) 13 | foreach(X RANGE ${STUB_COUNT}) 14 | string(LENGTH "0000${X}" X_POSTFIX_LENGTH) 15 | math(EXPR X_POSTFIX_LENGTH "${X_POSTFIX_LENGTH}-4") 16 | string(SUBSTRING "0000${X}" ${X_POSTFIX_LENGTH} 4 X_POSTFIX) 17 | add_library("${STUB_NAME}_${X_POSTFIX}" OBJECT "${STUB_NAME}.S") 18 | target_compile_definitions("${STUB_NAME}_${X_POSTFIX}" PRIVATE "F_${STUB_NAME}_${X_POSTFIX}") 19 | set(OBJS ${OBJS} "$") 20 | endforeach() 21 | set(${_OBJS} ${OBJS} PARENT_SCOPE) 22 | endfunction() 23 | 24 | build_stubs(vshbridge_OBJS sceVshBridge 1) 25 | 26 | add_library(vshbridge STATIC ${vshbridge_OBJS}) 27 | 28 | target_link_libraries(vshbridge INTERFACE pspvshbridge) 29 | 30 | target_include_directories(vshbridge 31 | INTERFACE 32 | $ 33 | ) 34 | -------------------------------------------------------------------------------- /stubs/vshbridge/include/vshbridge.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifdef __cplusplus 4 | extern "C" 5 | { 6 | #endif 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | int vshKernelExitVSHVSH(void* unk); 14 | int vshKernelLoadModuleVSH(const char* filename, int flags, const SceKernelLMOption* opt); 15 | int vshKernelLoadModuleBufferVSH(unsigned int size, 16 | const void* buffer, 17 | int flags, 18 | const SceKernelLMOption* option); 19 | int vshCtrlReadBufferPositive(SceCtrlData* pad, int samples); 20 | 21 | #ifdef __cplusplus 22 | } 23 | #endif 24 | -------------------------------------------------------------------------------- /stubs/vshbridge/sceVshBridge.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "sceVshBridge", 0x40010000, 0x00010005 6 | STUB_FUNC 0xD47041CA, vshKernelExitVSHVSH 7 | STUB_END -------------------------------------------------------------------------------- /tools/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required (VERSION 3.1) 2 | project(tools VERSION 1.0) 3 | 4 | add_custom_target(bin2cpp ALL 5 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/bin2cpp/bin2cpp.py 6 | ) 7 | 8 | set_property(TARGET bin2cpp PROPERTY EXEC ${CMAKE_CURRENT_SOURCE_DIR}/bin2cpp/bin2cpp.py) 9 | 10 | add_custom_target(hashgen ALL 11 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/hashgen/hashgen.py 12 | ) 13 | 14 | set_property(TARGET hashgen PROPERTY EXEC ${CMAKE_CURRENT_SOURCE_DIR}/hashgen/hashgen.py) 15 | 16 | add_custom_target(psppack ALL 17 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/psppack/psppack.py 18 | ) 19 | 20 | set_property(TARGET psppack PROPERTY EXEC ${CMAKE_CURRENT_SOURCE_DIR}/psppack/psppack.py) 21 | 22 | add_custom_target(pack_user_fw_module ALL 23 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/psptools/pack_user_fw_module.py 24 | ) 25 | 26 | set_property(TARGET pack_user_fw_module PROPERTY EXEC ${CMAKE_CURRENT_SOURCE_DIR}/psptools/pack_user_fw_module.py) 27 | 28 | 29 | add_custom_target(pack_kernel_module ALL 30 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/psptools/pack_kernel_module.py 31 | ) 32 | 33 | set_property(TARGET pack_kernel_module PROPERTY EXEC ${CMAKE_CURRENT_SOURCE_DIR}/psptools/pack_kernel_module.py) 34 | 35 | add_custom_target(pack_updater ALL 36 | DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/psptools/pack_updater.py 37 | ) 38 | 39 | set_property(TARGET pack_updater PROPERTY EXEC ${CMAKE_CURRENT_SOURCE_DIR}/psptools/pack_updater.py) 40 | -------------------------------------------------------------------------------- /tools/bin2cpp/bin2cpp.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import hashlib 5 | 6 | def readfile(file): 7 | if file[0] == '*': 8 | return bytearray.fromhex(file[1:]) 9 | else: 10 | with open(file, 'rb') as f: 11 | return f.read() 12 | 13 | def split_values(x): 14 | s = x.split('=') 15 | return {s[0] : readfile(s[1])} 16 | 17 | def generate_h(name, data): 18 | s = 'namespace {} {{\n'.format(name) 19 | s += 'extern std::array data;\n'.format(len(data)) 20 | s += '}\n' 21 | return s 22 | 23 | def generate_cpp(name, data): 24 | c_bytes = ", ".join(['0x{:02X}'.format(x) for x in data]) 25 | s = '#include \n' 26 | s += 'namespace {} {{\n'.format(name) 27 | s += 'alignas(64) std::array data = {{ {} }};\n'.format(len(data), c_bytes) 28 | s += '}\n' 29 | return s 30 | 31 | parser = argparse.ArgumentParser(description="bin2cpp, embed files in your binaries") 32 | parser.add_argument('files', metavar='NAME=FILE', type=split_values, nargs='+', 33 | help='Key value pair of names to files to generate hashes for') 34 | parser.add_argument('header_output', type=argparse.FileType('w'), help='Location to store the output header file') 35 | parser.add_argument('cpp_output', type=argparse.FileType('w'), help='Location to store the output cpp file') 36 | args = parser.parse_args() 37 | 38 | args.header_output.write('#pragma once\n\n') 39 | args.header_output.write('#include \n\n') 40 | args.header_output.write('namespace files {\n') 41 | 42 | args.cpp_output.write('#include \n') 43 | args.cpp_output.write('namespace files {\n') 44 | 45 | for hash in args.files: 46 | args.header_output.write('{}\n'.format(generate_h(*hash.keys(), *hash.values()))) 47 | args.cpp_output.write('{}\n'.format(generate_cpp(*hash.keys(), *hash.values()))) 48 | 49 | args.header_output.write('}\n') 50 | args.cpp_output.write('}\n') 51 | -------------------------------------------------------------------------------- /tools/hashgen/hashgen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import hashlib 5 | 6 | def hash(file): 7 | if file[0] == '*': 8 | return bytearray.fromhex(file[1:]) 9 | else: 10 | with open(file, 'rb') as f: 11 | return hashlib.sha1(f.read()).digest() 12 | 13 | def split_values(x): 14 | s = x.split('=') 15 | return {s[0] : hash(s[1])} 16 | 17 | def generate_h(name, hash): 18 | return 'extern const std::vector& {}();'.format(name) 19 | 20 | def generate_c(name, hash): 21 | c_bytes = ", ".join(['0x{:02X}'.format(x) for x in hash]) 22 | return 'const std::vector& {}() {{ static std::vector hash{{ {} }}; return hash; }}'.format(name, c_bytes) 23 | 24 | parser = argparse.ArgumentParser(description="Infinity hash generator") 25 | parser.add_argument('files', metavar='NAME=FILE', type=split_values, nargs='+', 26 | help='Key value pair of names to files to generate hashes for') 27 | parser.add_argument('header_output', type=argparse.FileType('w'), help='Location to store the output header file') 28 | parser.add_argument('source_output', type=argparse.FileType('w'), help='Location to store the output source file') 29 | args = parser.parse_args() 30 | 31 | args.header_output.write('#pragma once\n') 32 | args.header_output.write('#include \n') 33 | 34 | for hash in args.files: 35 | args.header_output.write('{}\n'.format(generate_h(*hash.keys(), *hash.values()))) 36 | 37 | args.source_output.write('#include \n') 38 | 39 | for hash in args.files: 40 | args.source_output.write('{}\n'.format(generate_c(*hash.keys(), *hash.values()))) -------------------------------------------------------------------------------- /tools/psptools/pack_kernel_module.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | 5 | from psptool.pack import pack_prx 6 | from psptool.prx import encrypt 7 | 8 | parser = argparse.ArgumentParser(description="Infinity Kernel Module Packer") 9 | parser.add_argument('input', type=argparse.FileType('rb'), 10 | help='The raw kernel PRX to pack') 11 | parser.add_argument('--vanity', type=str, 12 | help='Some vanity text in the executable header') 13 | parser.add_argument('output', type=str, 14 | help='The output to write the packed PRX') 15 | args = parser.parse_args() 16 | 17 | executable = args.input.read() 18 | executable = encrypt(pack_prx(executable, is_pbp=False, 19 | psptag=lambda x: 0x00000000), vanity=args.vanity) 20 | 21 | with open(args.output, 'wb') as f: 22 | f.write(executable) 23 | -------------------------------------------------------------------------------- /tools/psptools/pack_updater.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | 5 | from psptool.pbp import is_pbp, PBP 6 | from psptool.pack import pack_prx 7 | from psptool.prx import encrypt 8 | 9 | parser = argparse.ArgumentParser(description="Infinity Updater Packer") 10 | parser.add_argument('input', type=argparse.FileType('rb'), 11 | help='The raw PBP to pack') 12 | parser.add_argument('--vanity', type=str, 13 | help='Some vanity text in the executable header') 14 | parser.add_argument('output', type=str, 15 | help='The output to write the packed PBP') 16 | args = parser.parse_args() 17 | 18 | executable = args.input.read() 19 | 20 | if not is_pbp(executable): 21 | raise ValueError("not a PBP") 22 | 23 | pbp = PBP(executable) 24 | pbp.prx = encrypt(pack_prx(pbp.prx, is_pbp=True, 25 | psptag=lambda x: 0x0B000000), vanity=args.vanity) 26 | 27 | with open(args.output, 'wb') as f: 28 | f.write(pbp.pack()) 29 | -------------------------------------------------------------------------------- /tools/psptools/pack_user_fw_module.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | 5 | from psptool.pack import pack_prx 6 | from psptool.prx import encrypt 7 | 8 | parser = argparse.ArgumentParser( 9 | description="Infinity User Firmware Module Packer") 10 | parser.add_argument('input', type=argparse.FileType('rb'), 11 | help='The raw user PRX to pack') 12 | parser.add_argument('--id', type=str, help='The btcnf id to set') 13 | parser.add_argument('output', type=str, 14 | help='The output to write the packed PRX') 15 | args = parser.parse_args() 16 | 17 | executable = args.input.read() 18 | executable = encrypt(pack_prx(executable, is_pbp=False, 19 | psptag=lambda x: 0x457B8AF0), id=bytes.fromhex(args.id)) 20 | 21 | with open(args.output, 'wb') as f: 22 | f.write(executable) 23 | -------------------------------------------------------------------------------- /tools/psptools/psptool/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaveeFTW/Infinity/6a4f269f8abcf65696064cad94ba9ac8b845bd74/tools/psptools/psptool/__init__.py -------------------------------------------------------------------------------- /tools/psptools/psptool/pbp.py: -------------------------------------------------------------------------------- 1 | import struct 2 | 3 | PBP_HEADER_MAGIC = 0x50425000 4 | 5 | 6 | def is_pbp(data): 7 | return struct.unpack(' 13 | ) 14 | --------------------------------------------------------------------------------