├── Data ├── Roms │ └── ROMS_Go_here.txt ├── Daedalus.cht ├── Resources │ ├── logo.png │ └── OpenSans.ttf ├── Languages │ ├── Default.7z │ └── German.lng └── ControllerConfigs │ ├── defaultzlswap.ini │ ├── VitaRightStick.ini │ ├── dpadandstick.ini │ ├── dpad.ini │ ├── cbuttons.ini │ ├── dpadandbuttons.ini │ ├── dpadandbuttonsinv.ini │ ├── gamecubedpad.ini │ ├── gamecubedpadz.ini │ ├── gamecubedefault.ini │ ├── gamecubedeflcdc.ini │ ├── gamecubedpadlcdc.ini │ ├── gamecubedpadzlcdc.ini │ ├── gamecubedefjoyswap.ini │ ├── gamecubedpadtriggerswap.ini │ ├── gamecubedeftriggerswap.ini │ └── gamecubedefjoytrigswap.ini ├── Source ├── Utility │ ├── MemoryPool.cpp │ ├── Paths.h │ ├── VolatileMem.h │ ├── StringUtil.h │ ├── CRC.h │ ├── CMakeLists.txt │ ├── Hash.h │ ├── Timer.h │ ├── FastMemcpy.h │ ├── FramerateLimiter.h │ ├── Translate.h │ ├── MemoryHeap.h │ ├── String.h │ └── FastMemcpy_test.cpp ├── SysCTR │ ├── Resources │ │ ├── icon.png │ │ ├── romfs.bin │ │ ├── banner.bnr │ │ ├── banner.png │ │ ├── daedalus.smdh │ │ ├── audio_silent.wav │ │ └── romfs │ │ │ └── Roboto-Medium.ttf │ ├── UI │ │ ├── RomSelector.h │ │ ├── InGameMenu.h │ │ ├── UserInterface.h │ │ ├── CMakeLists.txt │ │ └── UserInterface.cpp │ ├── Debug │ │ ├── CMakeLists.txt │ │ └── DaedalusAssertCTR.cpp │ ├── Utility │ │ ├── CMakeLists.txt │ │ ├── MemoryCTR.h │ │ └── CacheCTR.S │ ├── Graphics │ │ └── CMakeLists.txt │ ├── CMakeLists.txt │ └── HLEGraphics │ │ ├── CMakeLists.txt │ │ ├── BlendModes.h │ │ └── Combiner │ │ └── CombinerInput.h ├── SysPSP │ ├── PRX │ │ ├── DveMgr │ │ │ ├── libpspdve_driver.a │ │ │ ├── libpspimpose_driver.a │ │ │ ├── pspDveManager.S │ │ │ ├── pspDveManager_driver.S │ │ │ ├── exports.exp │ │ │ ├── Makefile │ │ │ └── exports.c │ │ ├── MediaEngine │ │ │ ├── MediaEngine.S │ │ │ ├── exports.exp │ │ │ ├── Makefile │ │ │ ├── me_stub.S │ │ │ ├── me.h │ │ │ └── me.c │ │ ├── ExceptionHandler │ │ │ ├── exports.exp │ │ │ ├── Makefile │ │ │ └── main.c │ │ └── CMakeLists.txt │ ├── Resources │ │ └── eboot_icons │ │ │ ├── icon0.png │ │ │ └── pic1.png │ ├── Utility │ │ ├── DisableFPUExceptions.S │ │ ├── CMakeLists.txt │ │ ├── ModulePSP.h │ │ ├── DebugMemory.cpp │ │ └── ModulePSP.cpp │ ├── Debug │ │ └── CMakeLists.txt │ ├── Graphics │ │ ├── CMakeLists.txt │ │ └── VideoMemoryManager.h │ ├── CMakeLists.txt │ └── HLEGraphics │ │ ├── CMakeLists.txt │ │ ├── BlendModes.h │ │ └── Combiner │ │ └── CombinerInput.h ├── SysPosix │ ├── Debug │ │ ├── Web │ │ │ ├── img │ │ │ │ ├── glyphicons-halflings.png │ │ │ │ └── glyphicons-halflings-white.png │ │ │ └── css │ │ │ │ └── dldebugger.css │ │ ├── WebDebugTemplate.h │ │ ├── CMakeLists.txt │ │ └── WebDebugTemplate.cpp │ ├── HLEGraphics │ │ ├── TextureCacheWebDebug.h │ │ └── CMakeLists.txt │ ├── Utility │ │ ├── CMakeLists.txt │ │ └── CondPosix.cpp │ └── CMakeLists.txt ├── SysW32 │ ├── Debug │ │ └── CMakeLists.txt │ ├── Utility │ │ └── CMakeLists.txt │ └── CMakeLists.txt ├── HLEAudio │ ├── Plugin │ │ ├── AudioPluginNone.cpp │ │ ├── PSP │ │ │ ├── CMakeLists.txt │ │ │ └── old │ │ │ │ └── AudioPluginPSP.h │ │ ├── CMakeLists.txt │ │ └── CTR │ │ │ ├── AudioPluginCTR.h │ │ │ └── AudioOutput.h │ ├── CMakeLists.txt │ ├── ABI1.cpp │ └── AudioPlugin.h ├── OSHLE │ ├── OSTask.h │ ├── CMakeLists.txt │ ├── OS.h │ └── patch_cache_hle.inl ├── System │ ├── Condition.h │ ├── CMakeLists.txt │ ├── Timing │ │ ├── Timing.h │ │ ├── CTR │ │ │ └── Timing.cpp │ │ ├── Posix │ │ │ └── Timing.cpp │ │ ├── PSP │ │ │ └── Timing.cpp │ │ └── Windows │ │ │ └── Timing.cpp │ ├── SystemInit.h │ ├── Endian.h │ └── SpinLock.h ├── HLEGraphics │ ├── ConvertTile.h │ ├── RDP.cpp │ ├── ConvertImage.h │ ├── DisplayListDebugger.h │ ├── DLParser.h │ ├── CMakeLists.txt │ ├── TMEM.h │ └── GraphicsPlugin.h ├── DynaRec │ ├── x64 │ │ ├── DynarecStubX64.S │ │ ├── DynarecStubX64.asm │ │ └── DynarecTargetX64.h │ ├── mips │ │ └── DynaRecDebug.h │ ├── CMakeLists.txt │ ├── x86 │ │ └── DynarecTargetX86.h │ ├── CodeBufferManager.h │ ├── IndirectExitMap.h │ ├── DynaRecProfile.h │ ├── dummy │ │ └── AssemblyUtilsDummy.cpp │ └── Trace.h ├── Input │ ├── CMakeLists.txt │ └── InputManager.h ├── Debug │ ├── CMakeLists.txt │ ├── PrintOpCode.h │ ├── DebugConsoleImpl.h │ └── DBGConsole.h ├── Interface │ ├── CMakeLists.txt │ ├── SaveState.h │ └── Preferences.h ├── Graphics │ ├── CMakeLists.txt │ ├── TextureTransform.h │ └── PngUtil.h ├── RomFile │ ├── CMakeLists.txt │ ├── RomFileMemory.h │ └── RomFileUncompressed.h ├── SysGLES │ ├── CMakeLists.txt │ ├── GL.h │ └── HLEGraphics │ │ └── RendererGL.h ├── SysGL │ ├── CMakeLists.txt │ ├── GL.h │ └── HLEGraphics │ │ └── RendererGL.h ├── UI │ ├── DrawTextUtilities.h │ ├── UIAlignment.h │ ├── Dialogs.h │ ├── PauseScreen.h │ ├── SplashScreen.h │ ├── MainMenuScreen.h │ ├── AboutComponent.h │ ├── AdjustDeadzoneScreen.h │ ├── RomPreferencesScreen.h │ ├── GlobalSettingsComponent.h │ ├── CheatOptionsScreen.h │ ├── AdvancedOptionsScreen.h │ ├── RomSelectorComponent.h │ ├── PauseOptionsComponent.h │ ├── ColourPulser.h │ ├── UIScreen.h │ ├── SelectedRomComponent.h │ ├── UICommand.cpp │ ├── SavestateSelectorComponent.h │ ├── CMakeLists.txt │ ├── UISpacer.h │ └── ColourPulser.cpp ├── Core │ ├── Interpret.h │ ├── Save.h │ ├── CMakeLists.txt │ ├── FlashMem.h │ ├── Dynamo.h │ ├── RDRam.h │ ├── RSP_HLE.h │ ├── PIF.h │ ├── DMA.h │ ├── R4300.h │ ├── TLB.h │ └── R4300Instruction.h ├── CMakeSettings.json ├── third_party │ └── webby │ │ ├── webby_unix.h │ │ ├── tundra.lua │ │ ├── webby_win32.h │ │ └── LICENSE ├── Base │ └── Macros.h └── Ultra │ ├── ultra_mbi.h │ └── ultra_sptask.h ├── vcpkg.json ├── CMakeLists.txt ├── vcpkg-configuration.json ├── .gitignore ├── .vscode └── c_cpp_properties.json └── .github └── ISSUE_TEMPLATE └── bug_report.md /Data/Roms/ROMS_Go_here.txt: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Data/Daedalus.cht: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Data/Daedalus.cht -------------------------------------------------------------------------------- /Data/Resources/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Data/Resources/logo.png -------------------------------------------------------------------------------- /Data/Languages/Default.7z: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Data/Languages/Default.7z -------------------------------------------------------------------------------- /Data/Languages/German.lng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Data/Languages/German.lng -------------------------------------------------------------------------------- /Source/Utility/MemoryPool.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Base/Types.h" 3 | 4 | #include "Utility/MemoryPool.h" 5 | -------------------------------------------------------------------------------- /Data/Resources/OpenSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Data/Resources/OpenSans.ttf -------------------------------------------------------------------------------- /Source/SysCTR/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/icon.png -------------------------------------------------------------------------------- /Source/SysCTR/Resources/romfs.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/romfs.bin -------------------------------------------------------------------------------- /Source/SysCTR/Resources/banner.bnr: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/banner.bnr -------------------------------------------------------------------------------- /Source/SysCTR/Resources/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/banner.png -------------------------------------------------------------------------------- /Source/SysCTR/Resources/daedalus.smdh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/daedalus.smdh -------------------------------------------------------------------------------- /Source/SysCTR/Resources/audio_silent.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/audio_silent.wav -------------------------------------------------------------------------------- /Source/SysCTR/UI/RomSelector.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | namespace UI 6 | { 7 | std::string DrawRomSelector(); 8 | } -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/libpspdve_driver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysPSP/PRX/DveMgr/libpspdve_driver.a -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/libpspimpose_driver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysPSP/PRX/DveMgr/libpspimpose_driver.a -------------------------------------------------------------------------------- /Source/SysPSP/Resources/eboot_icons/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysPSP/Resources/eboot_icons/icon0.png -------------------------------------------------------------------------------- /Source/SysPSP/Resources/eboot_icons/pic1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysPSP/Resources/eboot_icons/pic1.png -------------------------------------------------------------------------------- /Source/SysCTR/Resources/romfs/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysCTR/Resources/romfs/Roboto-Medium.ttf -------------------------------------------------------------------------------- /Source/SysPosix/Debug/Web/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysPosix/Debug/Web/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": [ 3 | "zlib", 4 | "glew", 5 | "libpng", 6 | "sdl2", 7 | "sdl2-ttf", 8 | "glm" 9 | ] 10 | } 11 | -------------------------------------------------------------------------------- /Source/SysPosix/Debug/Web/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/DaedalusX64/daedalus/HEAD/Source/SysPosix/Debug/Web/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /Source/SysW32/Debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Debug_Win DaedalusAssertW32.cpp DebugConsoleW32.cpp) 2 | 3 | list(APPEND daed_libs Debug_Win) 4 | set(daed_libs ${daed_libs} PARENT_SCOPE) 5 | 6 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.20) 2 | project (DaedalusX64 LANGUAGES C CXX ASM) 3 | 4 | message(${CMAKE_SYSTEM_PROCESSOR} " Detected") 5 | 6 | INCLUDE(FindPkgConfig) 7 | 8 | add_subdirectory(Source) -------------------------------------------------------------------------------- /Source/SysPSP/PRX/MediaEngine/MediaEngine.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "MediaEngine",0x40090000,0x00020005 6 | STUB_FUNC 0x284FAFFC,InitME 7 | STUB_FUNC 0xE6B12941,KillME 8 | STUB_END 9 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/ExceptionHandler/exports.exp: -------------------------------------------------------------------------------- 1 | PSP_BEGIN_EXPORTS 2 | PSP_EXPORT_START(syslib, 0, 0x8000) 3 | PSP_EXPORT_FUNC_HASH(module_start) 4 | PSP_EXPORT_VAR_HASH(module_info) 5 | PSP_EXPORT_END 6 | 7 | PSP_END_EXPORTS 8 | -------------------------------------------------------------------------------- /Source/Utility/Paths.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTILITY_PATHS_H 3 | #define UTILITY_PATHS_H 4 | 5 | 6 | #include 7 | 8 | 9 | std::filesystem::path setBasePath(const std::filesystem::path& path); 10 | #endif //UTILITY_PATHS_H -------------------------------------------------------------------------------- /Source/SysCTR/UI/InGameMenu.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "RomFile/RomSettings.h" 4 | 5 | namespace UI 6 | { 7 | void LoadRomPreferences(RomID mRomID); 8 | bool DrawOptionsPage(RomID mRomID); 9 | void DrawInGameMenu(); 10 | } -------------------------------------------------------------------------------- /Source/SysPosix/HLEGraphics/TextureCacheWebDebug.h: -------------------------------------------------------------------------------- 1 | #ifndef HLEGRAPHICS_TEXTURECACHEWEBDEBUG_H_ 2 | #define HLEGRAPHICS_TEXTURECACHEWEBDEBUG_H_ 3 | 4 | bool TextureCache_RegisterWebDebug(); 5 | 6 | #endif // HLEGRAPHICS_TEXTURECACHEWEBDEBUG_H_ 7 | -------------------------------------------------------------------------------- /Source/SysCTR/UI/UserInterface.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace UI 8 | { 9 | void Initialize(); 10 | void RestoreRenderState(); 11 | } -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/pspDveManager.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "pspDveManager",0x40090000,0x00020005 6 | STUB_FUNC 0x2ACFCB6D,pspDveMgrCheckVideoOut 7 | STUB_FUNC 0xF9C86C73,pspDveMgrSetVideoOut 8 | STUB_END 9 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/pspDveManager_driver.S: -------------------------------------------------------------------------------- 1 | .set noreorder 2 | 3 | #include "pspstub.s" 4 | 5 | STUB_START "pspDveManager_driver",0x00090000,0x00020005 6 | STUB_FUNC 0x2ACFCB6D,pspDveMgrCheckVideoOut 7 | STUB_FUNC 0xF9C86C73,pspDveMgrSetVideoOut 8 | STUB_END 9 | -------------------------------------------------------------------------------- /Source/SysCTR/Debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Debug_CTR OBJECT 2 | DaedalusAssertCTR.cpp 3 | DBGConsoleCTR.cpp 4 | ) 5 | 6 | 7 | list(APPEND daed_libs "Debug_CTR") 8 | set(daed_libs ${daed_libs} PARENT_SCOPE) 9 | -------------------------------------------------------------------------------- /Source/HLEAudio/Plugin/AudioPluginNone.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Base/Types.h" 3 | #include "HLEAudio/AudioPlugin.h" 4 | #include "Interface/ConfigOptions.h" 5 | 6 | EAudioPluginMode gAudioPluginEnabled = APM_DISABLED; 7 | 8 | std::unique_ptr CreateAudioPlugin() 9 | { 10 | return NULL; 11 | } 12 | -------------------------------------------------------------------------------- /Source/OSHLE/OSTask.h: -------------------------------------------------------------------------------- 1 | #ifndef OSHLE_OSTASK_H_ 2 | #define OSHLE_OSTASK_H_ 3 | 4 | #include "Ultra/ultra_sptask.h" 5 | 6 | class COSTask 7 | { 8 | public: 9 | COSTask(OSTask * pTask) 10 | { 11 | m_pTask = pTask; 12 | } 13 | 14 | protected: 15 | OSTask * m_pTask; 16 | 17 | }; 18 | 19 | #endif // OSHLE_OSTASK_H_ 20 | -------------------------------------------------------------------------------- /Source/HLEAudio/Plugin/PSP/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(DAEDALUS_SDL) 2 | add_library(HLEAudio_PSP OBJECT ${PROJECT_SOURCE_DIR}/Source/SysPosix/HLEAudio/AudioPluginSDL.cpp) 3 | else() 4 | add_library(HLEAudio_PSP OBJECT AudioPluginPSP.cpp) 5 | endif() 6 | 7 | list(APPEND daed_libs "HLEAudio_PSP") 8 | set(daed_libs ${daed_libs} PARENT_SCOPE) 9 | -------------------------------------------------------------------------------- /Source/SysPosix/HLEGraphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(HLEGraphics_POSIX OBJECT 2 | DisplayListDebugger.cpp 3 | TextureCacheWebDebug.cpp 4 | ) 5 | 6 | 7 | list(APPEND daed_libs HLEGraphics_POSIX) 8 | set(daed_libs ${daed_libs} PARENT_SCOPE) 9 | 10 | -------------------------------------------------------------------------------- /Source/OSHLE/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(OSHLE OBJECT 2 | OS.cpp 3 | patch.cpp 4 | ) 5 | 6 | if(DAEDALUS_PROFILE_OSHLE) 7 | target_compile_options(OSHLE PRIVATE -pg) 8 | endif(DAEDALUS_PROFILE_OSHLE) 9 | 10 | list(APPEND daed_libs "OSHLE") 11 | set(daed_libs ${daed_libs} PARENT_SCOPE) 12 | -------------------------------------------------------------------------------- /Source/SysPSP/Utility/DisableFPUExceptions.S: -------------------------------------------------------------------------------- 1 | 2 | .global _DisableFPUExceptions 3 | 4 | .set push 5 | .set noreorder 6 | _DisableFPUExceptions: 7 | cfc1 $2, $31 8 | lui $8, 0x80 9 | and $8, $2, $8 # Mask off all bits except for 23 of FCR 10 | ctc1 $8, $31 11 | jr $31 12 | nop 13 | .set pop 14 | -------------------------------------------------------------------------------- /Source/System/Condition.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef UTILITY_COND_H_ 4 | #define UTILITY_COND_H_ 5 | 6 | class Mutex; 7 | struct Cond; 8 | 9 | extern const double kTimeoutInfinity; 10 | 11 | Cond * CondCreate(); 12 | void CondDestroy(Cond * cond); 13 | void CondWait(Cond * cond, Mutex * mutex, double timeout); 14 | void CondSignal(Cond * cond); 15 | 16 | #endif // UTILITY_COND_H_ 17 | -------------------------------------------------------------------------------- /Source/SysPosix/Utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Utility_POSIX OBJECT 2 | CondPosix.cpp 3 | ) 4 | 5 | if(DAEDALUS_PROFILE_UTILITY_POSIX) 6 | target_compile_options(Utility_POSIX PRIVATE -pg) 7 | endif(DAEDALUS_PROFILE_UTILITY_POSIX) 8 | 9 | 10 | list(APPEND daed_libs Utility_POSIX) 11 | set(daed_libs ${daed_libs} PARENT_SCOPE) 12 | 13 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Plugins_PSP OBJECT 2 | DveMgr/pspDveManager.S 3 | MediaEngine/me.c 4 | MediaEngine/MediaEngine.S 5 | ) 6 | 7 | 8 | list(APPEND daed_libs "Plugins_PSP") 9 | set(daed_libs ${daed_libs} PARENT_SCOPE) 10 | -------------------------------------------------------------------------------- /Source/SysPSP/Debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Debug_PSP OBJECT 2 | DaedalusAssertPSP.cpp 3 | DBGConsolePSP.cpp 4 | ) 5 | 6 | if(DAEDALUS_PROFILE_DEBUG_PSP) 7 | target_compile_options(Debug_PSP PRIVATE -pg) 8 | endif(DAEDALUS_PROFILE_DEBUG_PSP) 9 | 10 | list(APPEND daed_libs "Debug_PSP") 11 | set(daed_libs ${daed_libs} PARENT_SCOPE) 12 | -------------------------------------------------------------------------------- /Source/HLEGraphics/ConvertTile.h: -------------------------------------------------------------------------------- 1 | #ifndef HLEGRAPHICS_CONVERTTILE_H_ 2 | #define HLEGRAPHICS_CONVERTTILE_H_ 3 | 4 | #include "Graphics/TextureFormat.h" 5 | 6 | struct NativePf8888; 7 | struct TextureInfo; 8 | 9 | bool ConvertTile(const TextureInfo & ti, 10 | void * texels, 11 | NativePf8888 * palette, 12 | ETextureFormat texture_format, 13 | u32 pitch); 14 | 15 | #endif // HLEGRAPHICS_CONVERTTILE_H_ 16 | -------------------------------------------------------------------------------- /vcpkg-configuration.json: -------------------------------------------------------------------------------- 1 | { 2 | "default-registry": { 3 | "kind": "git", 4 | "baseline": "aa628ceb5f15f0c30d4d481f14fa5b2be2b4a658", 5 | "repository": "https://github.com/microsoft/vcpkg" 6 | }, 7 | "registries": [ 8 | { 9 | "kind": "artifact", 10 | "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", 11 | "name": "microsoft" 12 | } 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /Source/DynaRec/x64/DynarecStubX64.S: -------------------------------------------------------------------------------- 1 | .globl __EnterDynaRec 2 | .globl _EnterDynaRec 3 | .text 4 | _EnterDynaRec: 5 | __EnterDynaRec: 6 | pushq %rbp 7 | pushq %rbx 8 | pushq %r15 9 | pushq %r14 10 | 11 | movq %rdi, %rax 12 | movq %rsi, %rbx 13 | movq %rdx, %r15 14 | movq %rcx, %r14 15 | 16 | call *%rax 17 | 18 | popq %r14 19 | popq %r15 20 | popq %rbx 21 | popq %rbp 22 | 23 | ret -------------------------------------------------------------------------------- /Source/SysPosix/Debug/WebDebugTemplate.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSPOSIX_DEBUG_WEBDEBUGTEMPLATE_H_ 2 | #define SYSPOSIX_DEBUG_WEBDEBUGTEMPLATE_H_ 3 | 4 | #include 5 | 6 | class WebDebugConnection; 7 | 8 | void WriteStandardHeader(WebDebugConnection * connection, const char * title); 9 | void WriteStandardFooter(WebDebugConnection * connection, const char * user_script = NULL); 10 | 11 | #endif // SYSPOSIX_DEBUG_WEBDEBUGTEMPLATE_H_ 12 | -------------------------------------------------------------------------------- /Source/SysCTR/Utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Utility_CTR OBJECT 2 | CacheCTR.S 3 | MemoryCTR.c 4 | ) 5 | 6 | if(DAEDALUS_PROFILE_UTILITY_CTR) 7 | target_compile_options(Utility_CTR PRIVATE -pg) 8 | endif(DAEDALUS_PROFILE_UTILITY_CTR) 9 | 10 | 11 | list(APPEND daed_libs "Utility_CTR") 12 | set(daed_libs ${daed_libs} PARENT_SCOPE) 13 | 14 | 15 | -------------------------------------------------------------------------------- /Source/SysW32/Utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Utility_Win OBJECT 2 | CondW32.cpp 3 | ) 4 | 5 | if(DEBUG) 6 | add_library(Utility_Win OBJECT 7 | DISASM86.cpp 8 | ) 9 | list(APPEND daed_libs Utility_Win) 10 | endif() 11 | list(APPEND daed_libs Utility_Win) 12 | set(daed_libs ${daed_libs} PARENT_SCOPE) 13 | 14 | -------------------------------------------------------------------------------- /Source/SysCTR/Graphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Graphics_CTR OBJECT 2 | GraphicsContextCTR.cpp 3 | NativeTextureCTR.cpp 4 | ) 5 | 6 | if(DAEDALUS_PROFILE_GRAPHICS_CTR) 7 | target_compile_options(Graphics_CTR PRIVATE -pg) 8 | endif(DAEDALUS_PROFILE_GRAPHICS_CTR) 9 | 10 | 11 | list(APPEND daed_libs "Graphics_CTR") 12 | set(daed_libs ${daed_libs} PARENT_SCOPE) 13 | -------------------------------------------------------------------------------- /Source/SysCTR/UI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_library(UI_CTR OBJECT 3 | InGameMenu.cpp 4 | RomSelector.cpp 5 | UserInterface.cpp 6 | ) 7 | if(DAEDALUS_PROFILE_UI_CTR) 8 | target_compile_options(UI_CTR PRIVATE -pg) 9 | endif(DAEDALUS_PROFILE_UI_CTR) 10 | 11 | 12 | list(APPEND daed_libs "UI_CTR") 13 | set(daed_libs ${daed_libs} PARENT_SCOPE) 14 | -------------------------------------------------------------------------------- /Source/SysPosix/Debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Debug_POSIX OBJECT 2 | DaedalusAssertPosix.cpp 3 | DebugConsolePosix.cpp 4 | WebDebug.cpp 5 | WebDebugTemplate.cpp 6 | ${PROJECT_SOURCE_DIR}/Source/third_party/webby/webby.c) 7 | 8 | list(APPEND daed_libs Debug_POSIX) 9 | set(daed_libs ${daed_libs} PARENT_SCOPE) 10 | 11 | -------------------------------------------------------------------------------- /Source/Input/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(DAEDALUS_PSP) 2 | add_library(Input OBJECT PSP/InputManagerPSP.cpp) 3 | elseif(DAEDALUS_CTR) 4 | add_library(Input OBJECT CTR/InputManagerCTR.cpp) 5 | else() 6 | add_library(Input OBJECT SDL/InputManagerSDL.cpp) 7 | endif() 8 | 9 | if(DAEDALUS_PROFILE_INPUT) 10 | target_compile_options(Input PRIVATE -pg) 11 | endif(DAEDALUS_PROFILE_INPUT) 12 | 13 | list(APPEND daed_libs "Input") 14 | set(daed_libs ${daed_libs} PARENT_SCOPE) 15 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/defaultzlswap.ini: -------------------------------------------------------------------------------- 1 | Name=Default Z+L Swap 2 | Description=Default But The "Z" Button Is Now Swapped With The "L" Trigger Now. 3 | 4 | [Buttons] 5 | N64.Start = PSP.Start 6 | N64.A = PSP.Cross 7 | N64.B = PSP.Square 8 | N64.Z = PSP.LTrigger 9 | N64.LTrigger = PSP.Triangle 10 | N64.RTrigger = PSP.RTrigger 11 | N64.Up = 12 | N64.Down = 13 | N64.Left = 14 | N64.Right = 15 | N64.CUp = PSP.Up 16 | N64.CDown = PSP.Down 17 | N64.CLeft = PSP.Left 18 | N64.CRight = PSP.Right -------------------------------------------------------------------------------- /Source/Debug/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Debug OBJECT 2 | DebugConsoleImpl.cpp 3 | DebugLog.cpp 4 | Dump.cpp 5 | PrintOpCode.cpp 6 | Registers.cpp 7 | Synchroniser.cpp 8 | ) 9 | 10 | if(DAEDALUS_PROFILE_DEBUG) 11 | target_compile_options(Debug PRIVATE -pg) 12 | endif(DAEDALUS_PROFILE_DEBUG) 13 | 14 | list(APPEND daed_libs "Debug") 15 | set(daed_libs ${daed_libs} PARENT_SCOPE) 16 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/VitaRightStick.ini: -------------------------------------------------------------------------------- 1 | Name=Vita right stick C 2 | Description=Default But The PS Vita right stick is the C buttons. 3 | JoystickSwap=D 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.Triangle 10 | N64.LTrigger = PSP.LTrigger 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = 13 | N64.Down = 14 | N64.Left = 15 | N64.Right = 16 | N64.CUp = PSP.Up 17 | N64.CDown = PSP.Down 18 | N64.CLeft = PSP.Left 19 | N64.CRight = PSP.Right 20 | -------------------------------------------------------------------------------- /Source/SysCTR/Utility/MemoryCTR.h: -------------------------------------------------------------------------------- 1 | #ifndef __MEMORYCTR_H__ 2 | #define __MEMORYCTR_H__ 3 | 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | int hack3dsTestDynamicRecompilation(void); 9 | 10 | int _SetMemoryPermission(void *buffer, int size, int permission); 11 | void _InvalidateInstructionCache(void); 12 | void _FlushDataCache(void); 13 | void _InvalidateAndFlushCaches(void); 14 | int _InitializeSvcHack(void); 15 | 16 | #ifdef __cplusplus 17 | } 18 | #endif 19 | 20 | #endif //__MEMORYCTR_H__ -------------------------------------------------------------------------------- /Source/SysCTR/Utility/CacheCTR.S: -------------------------------------------------------------------------------- 1 | .arm 2 | 3 | .global _InvalidateAndFlushCaches 4 | 5 | _ClearCacheKernel: 6 | cpsid aif 7 | mov r0, #0 8 | mcr p15, 0, r0, c7, c10, 0 @ Clean entire data cache 9 | mcr p15, 0, r0, c7, c10, 5 @ Data Memory Barrier 10 | mcr p15, 0, r0, c7, c5, 0 @ Invalidate entire instruction cache / Flush BTB 11 | mcr p15, 0, r0, c7, c10, 4 @ Data Sync Barrier 12 | bx lr 13 | 14 | _InvalidateAndFlushCaches: 15 | ldr r0, =_ClearCacheKernel 16 | svc 0x80 @ svcCustomBackdoor 17 | bx lr -------------------------------------------------------------------------------- /Data/ControllerConfigs/dpadandstick.ini: -------------------------------------------------------------------------------- 1 | Name=PSP Joystick as N64 Dpad 2 | Description=Use PSP analog stick as N64 Dpad. 3 | JoystickSwap=B 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = !PSP.LTrigger & PSP.Cross 8 | N64.B = !PSP.LTrigger & PSP.Square 9 | N64.Z = PSP.Triangle 10 | N64.LTrigger = PSP.LTrigger 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up 13 | N64.Down = PSP.Down 14 | N64.Left = PSP.Left 15 | N64.Right = PSP.Right 16 | N64.CUp = 17 | N64.CDown = 18 | N64.CLeft = 19 | N64.CRight = 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.DS_Store 2 | *.d 3 | *.o 4 | *.prx 5 | *.elf 6 | *.sublime-workspace 7 | EBOOT.PBP 8 | PARAM.SFO 9 | Makefile.cache 10 | Source/SysPSP/DveMgr/pspDveManager.S 11 | Source/SysPSP/DveMgr/pspDveManager_driver.S 12 | Source/SysPSP/MediaEnginePRX/MediaEngine.S 13 | DaedalusX64/ 14 | Dumps/ 15 | SaveGames/ 16 | preferences.ini 17 | rom.db 18 | .svn/ 19 | Source/tmp 20 | .vscode/launch.json 21 | .vscode/tasks.json 22 | *build 23 | *build_* 24 | .vs/ 25 | *.cia 26 | *.3dsx 27 | /debug/ 28 | /vcpkg_installed/ 29 | /CMakeSettings.json 30 | -------------------------------------------------------------------------------- /.vscode/c_cpp_properties.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Linux", 5 | "includePath": [ 6 | "${workspaceFolder}/**" 7 | ], 8 | "defines": [], 9 | "compilerPath": "/usr/bin/clang", 10 | "cStandard": "c11", 11 | "cppStandard": "c++14", 12 | "intelliSenseMode": "linux-clang-x64", 13 | "compileCommands": "${workspaceFolder}/build/compile_commands.json" 14 | } 15 | ], 16 | "version": 4 17 | } -------------------------------------------------------------------------------- /Source/Interface/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Interface OBJECT 2 | ConfigOptions.cpp 3 | Cheats.cpp 4 | Preferences.cpp 5 | RomDB.cpp 6 | SaveState.cpp 7 | ) 8 | 9 | 10 | if(DAEDALUS_PROFILE_INTERFACE) 11 | target_compile_options(Interface PRIVATE -pg) 12 | endif(DAEDALUS_PROFILE_INTERFACE) 13 | 14 | list(APPEND daed_libs "Interface") 15 | set(daed_libs ${daed_libs} PARENT_SCOPE) 16 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/MediaEngine/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(MediaEngine, 0, 0x4001) 12 | PSP_EXPORT_FUNC(InitME) 13 | PSP_EXPORT_FUNC(KillME) 14 | PSP_EXPORT_END 15 | 16 | PSP_END_EXPORTS 17 | -------------------------------------------------------------------------------- /Source/DynaRec/x64/DynarecStubX64.asm: -------------------------------------------------------------------------------- 1 | .code 2 | 3 | PUBLIC _EnterDynaRec 4 | 5 | _EnterDynaRec PROC FRAME 6 | push rbp 7 | .PUSHREG RBP 8 | push rbx 9 | .PUSHREG RBX 10 | push r15 11 | .PUSHREG R15 12 | push r14 13 | .PUSHREG R14 14 | sub rsp, 32 15 | .allocstack 32 16 | .ENDPROLOG 17 | mov rax, rcx 18 | mov rbx, rdx 19 | mov r15, r8 20 | mov r14, r9 21 | 22 | call rax 23 | 24 | add rsp, 32 25 | pop r14 26 | pop r15 27 | pop rbx 28 | pop rbp 29 | 30 | ret 31 | _EnterDynaRec ENDP 32 | 33 | END 34 | -------------------------------------------------------------------------------- /Source/Graphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Graphics OBJECT 2 | ColourValue.cpp 3 | HvqmTask.cpp 4 | JpegTask.cpp 5 | PngUtil.cpp 6 | TextureTransform.cpp 7 | ) 8 | 9 | target_include_directories(Graphics PUBLIC ${PNG_INCLUDE_DIRS}) 10 | 11 | if(DAEDALUS_PROFILE_GRAPHICS) 12 | target_compile_options(Graphics PRIVATE -pg) 13 | endif(DAEDALUS_PROFILE_GRAPHICS) 14 | 15 | list(APPEND daed_libs "Graphics") 16 | set(daed_libs ${daed_libs} PARENT_SCOPE) 17 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/dpad.ini: -------------------------------------------------------------------------------- 1 | Name=DPad 2 | Description=By default the PSP DPad maps to the N64 DPad. Hold Circle to map to the CButtons. 3 | 4 | [Buttons] 5 | N64.Start = PSP.Start 6 | N64.A = PSP.Cross 7 | N64.B = PSP.Square 8 | N64.Z = PSP.Triangle 9 | N64.LTrigger = PSP.LTrigger 10 | N64.RTrigger = PSP.RTrigger 11 | N64.Up = !PSP.Circle & PSP.Up 12 | N64.Down = !PSP.Circle & PSP.Down 13 | N64.Left = !PSP.Circle & PSP.Left 14 | N64.Right = !PSP.Circle & PSP.Right 15 | N64.CUp = PSP.Circle & PSP.Up 16 | N64.CDown = PSP.Circle & PSP.Down 17 | N64.CLeft = PSP.Circle & PSP.Left 18 | N64.CRight = PSP.Circle & PSP.Right -------------------------------------------------------------------------------- /Data/ControllerConfigs/cbuttons.ini: -------------------------------------------------------------------------------- 1 | Name=CButtons 2 | Description=By default the PSP DPad maps to the CButtons. Hold Circle to map to the N64 DPad. 3 | 4 | [Buttons] 5 | N64.Start = PSP.Start 6 | N64.A = PSP.Cross 7 | N64.B = PSP.Square 8 | N64.Z = PSP.Triangle 9 | N64.LTrigger = PSP.LTrigger 10 | N64.RTrigger = PSP.RTrigger 11 | N64.Up = PSP.Circle & PSP.Up 12 | N64.Down = PSP.Circle & PSP.Down 13 | N64.Left = PSP.Circle & PSP.Left 14 | N64.Right = PSP.Circle & PSP.Right 15 | N64.CUp = !PSP.Circle & PSP.Up 16 | N64.CDown = !PSP.Circle & PSP.Down 17 | N64.CLeft = !PSP.Circle & PSP.Left 18 | N64.CRight = !PSP.Circle & PSP.Right -------------------------------------------------------------------------------- /Source/RomFile/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | 3 | add_library(RomFile OBJECT 4 | RomFile.cpp 5 | RomFileCache.cpp 6 | RomFileCompressed.cpp 7 | RomFileMemory.cpp 8 | RomFileUncompressed.cpp 9 | ROMBuffer.cpp 10 | RomSettings.cpp 11 | ) 12 | 13 | if(DAEDALUS_PROFILE_ROMFILE) 14 | target_compile_options(RomFile PRIVATE -pg) 15 | endif(DAEDALUS_PROFILE_ROMFILE) 16 | 17 | 18 | 19 | list(APPEND daed_libs "RomFile") 20 | set(daed_libs ${daed_libs} PARENT_SCOPE) 21 | -------------------------------------------------------------------------------- /Source/Utility/VolatileMem.h: -------------------------------------------------------------------------------- 1 | 2 | 3 | #ifndef UTILITY_VOLATILEMEM_H_ 4 | #define UTILITY_VOLATILEMEM_H_ 5 | 6 | #ifdef DAEDALUS_PSP 7 | void* malloc_volatile_PSP(size_t size); 8 | void free_volatile_PSP(void* ptr); 9 | #endif 10 | 11 | inline void* malloc_volatile(size_t size) 12 | { 13 | #ifdef DAEDALUS_PSP 14 | return malloc_volatile_PSP(size); 15 | #else 16 | return malloc(size); 17 | #endif 18 | } 19 | 20 | inline void free_volatile(void* ptr) 21 | { 22 | #ifdef DAEDALUS_PSP 23 | free_volatile_PSP(ptr); 24 | #else 25 | free(ptr); 26 | #endif 27 | } 28 | 29 | #endif // UTILITY_VOLATILEMEM_H_ 30 | -------------------------------------------------------------------------------- /Source/Utility/StringUtil.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILITY_STRINGUTIL_H_ 2 | #define UTILITY_STRINGUTIL_H_ 3 | 4 | #include 5 | #include "Utility/String.h" 6 | 7 | // Splits at all instances of split_char. 8 | void Split(ConstStringRef str, char split_char, std::vector * pieces); 9 | 10 | // Splits at the first instance of split_char. 11 | void SplitAt(ConstStringRef str, char split_char, ConstStringRef * left, ConstStringRef * right); 12 | 13 | // Unlike atoi, atol etc, this works with unterminated ranges. 14 | u32 ParseU32(ConstStringRef str, u32 base); 15 | 16 | char * Tidy(char * s); 17 | 18 | #endif // UTILITY_STRINGUTIL_H_ 19 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/ExceptionHandler/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = exception 2 | OBJS = main.o exception_asm.o 3 | 4 | # Define to build this as a prx (instead of a static elf) 5 | BUILD_PRX=1 6 | # Define the name of our custom exports (minus the .exp extension) 7 | PRX_EXPORTS=exports.exp 8 | 9 | USE_KERNEL_LIBC = 1 10 | USE_KERNEL_LIBS = 1 11 | 12 | INCDIR = 13 | CFLAGS = -Os -G0 -Wall -nostartfiles 14 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 15 | ASFLAGS = $(CFLAGS) 16 | 17 | LIBDIR = 18 | 19 | PSP_FW_VERSION=500 20 | 21 | PSPSDK=$(shell psp-config --pspsdk-path) 22 | include $(PSPSDK)/lib/build.mak 23 | 24 | all: $(FINAL_TARGET) 25 | -------------------------------------------------------------------------------- /Source/SysGLES/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES Graphics/*.cpp HLEGraphics/*.cpp) 2 | 3 | add_library(SysGLES OBJECT ${SRC_FILES}) 4 | 5 | target_include_directories(SysGLES PUBLIC ${OPENGLES_INCLUDE_DIR}) 6 | target_include_directories(SysGLES PUBLIC ${SDL2_INCLUDE_DIRS}) 7 | target_include_directories(SysGLES PUBLIC ${SDL2_TTF_INCLUDE_DIRS}) 8 | 9 | install(FILES ${PROJECT_SOURCE_DIR}/Source/SysGLES/HLEGraphics/n64.psh DESTINATION DaedalusX64) 10 | 11 | if(DAEDALUS_PROFILE_GRAPHICS_GL) 12 | target_compile_options(SysGLES PRIVATE -pg) 13 | endif(DAEDALUS_PROFILE_GRAPHICS_GL) 14 | 15 | list(APPEND daed_libs "SysGLES") 16 | set(daed_libs ${daed_libs} PARENT_SCOPE) 17 | -------------------------------------------------------------------------------- /Source/Graphics/TextureTransform.h: -------------------------------------------------------------------------------- 1 | #ifndef GRAPHICS_TEXTURETRANSFORM_H_ 2 | #define GRAPHICS_TEXTURETRANSFORM_H_ 3 | 4 | #include "Graphics/TextureFormat.h" 5 | 6 | class c32; 7 | 8 | void ClampTexels( void * texels, u32 n64_width, u32 n64_height, u32 native_width, u32 native_height, u32 native_stride, ETextureFormat texture_format ); 9 | void Recolour( void * data, void * palette, u32 width, u32 height, u32 stride, ETextureFormat texture_format, c32 colour ); 10 | void MirrorTexels( bool mirror_s, bool mirror_t, void * dst, u32 dst_stride, const void * src, u32 src_stride, ETextureFormat tex_fmt, u32 width, u32 height ); 11 | 12 | #endif // GRAPHICS_TEXTURETRANSFORM_H_ 13 | -------------------------------------------------------------------------------- /Source/HLEAudio/Plugin/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if(PSP) 2 | add_library(Audio_Plugin OBJECT PSP/AudioPluginPSP.cpp ) 3 | elseif(DAEDALUS_CTR) 4 | add_library(Audio_Plugin OBJECT CTR/AudioOutput.cpp CTR/AudioPluginCTR.cpp) 5 | elseif(WIN32) 6 | add_library(Audio_Plugin OBJECT SDL/AudioPluginSDL.cpp) 7 | elseif(APPLE AND NOT UNIX) 8 | add_library(Audio_Plugin OBJECT macOS/AudioPluginOSX.cpp ) 9 | else() 10 | add_library(Audio_Plugin OBJECT SDL/AudioPluginSDL.cpp) 11 | endif() 12 | 13 | if(DAEDALUS_PROFILE_AUDIOPLUGIN) 14 | target_compile_options(Audio_Plugin PRIVATE -pg) 15 | endif(DAEDALUS_PROFILE_AUDIOPLUGIN) 16 | 17 | list(APPEND daed_libs "Audio_Plugin") 18 | set(daed_libs ${daed_libs} PARENT_SCOPE) -------------------------------------------------------------------------------- /Source/SysCTR/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Debug) 2 | add_subdirectory(Graphics) 3 | add_subdirectory(HLEGraphics) 4 | add_subdirectory(UI) 5 | add_subdirectory(Utility) 6 | 7 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../DaedalusX64.3dsx DESTINATION DaedalusX64) 8 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../DaedalusX64.cia DESTINATION DaedalusX64) 9 | install(DIRECTORY ${PROJECT_BINARY_DIR}/../Data/ DESTINATION DaedalusX64) 10 | 11 | list(APPEND sys_libraries "imgui" "picaGL") 12 | set(sys_libraries ${sys_libraries} PARENT_SCOPE) 13 | 14 | 15 | set(daed_libs ${daed_libs} PARENT_SCOPE) 16 | set(sys_libraries ${sys_libraries} PARENT_SCOPE) 17 | 18 | set(plat_main SysCTR/main.cpp PARENT_SCOPE) -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "[BUG]" 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Describe the bug 11 | A clear and concise description of what the bug is. 12 | 13 | To Reproduce 14 | Steps to reproduce the behavior: 15 | 16 | Expected behavior 17 | A clear and concise description of what you expected to happen. 18 | 19 | Screenshots 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | Device: 23 | - Device: [e.g. PSP Model or VITA] 24 | - FW:[e.g. Current System Firmware] 25 | - Daedalus Version [e.g. 1.1.6] 26 | 27 | Additional context 28 | Add any other context about the problem here. 29 | -------------------------------------------------------------------------------- /Source/SysGL/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | file(GLOB SRC_FILES Graphics/*.cpp HLEGraphics/*.cpp) 2 | 3 | add_library(SysGL OBJECT ${SRC_FILES}) 4 | 5 | target_include_directories(SysGL PUBLIC ${OPENGL_INCLUDE_DIR}) 6 | target_include_directories(SysGL PUBLIC ${GLEW_INCLUDE_DIRS}) 7 | target_include_directories(SysGL PUBLIC ${SDL2_INCLUDE_DIRS}) 8 | target_include_directories(SysGL PUBLIC ${SDL2_TTF_INCLUDE_DIRS}) 9 | 10 | install(FILES ${PROJECT_SOURCE_DIR}/Source/SysGL/HLEGraphics/n64.psh DESTINATION DaedalusX64) 11 | 12 | if(DAEDALUS_PROFILE_GRAPHICS_GL) 13 | target_compile_options(SysGL PRIVATE -pg) 14 | endif(DAEDALUS_PROFILE_GRAPHICS_GL) 15 | 16 | list(APPEND daed_libs "SysGL") 17 | set(daed_libs ${daed_libs} PARENT_SCOPE) 18 | -------------------------------------------------------------------------------- /Source/UI/DrawTextUtilities.h: -------------------------------------------------------------------------------- 1 | #ifndef DRAWTEXT_UTILIEIES_H_ 2 | #define DRAWTEXT_UTILIEIES_H_ 3 | 4 | #include 5 | 6 | #include 7 | 8 | #include "Graphics/ColourValue.h" 9 | #include "UI/UIAlignment.h" 10 | #include "UI/DrawText.h" 11 | 12 | namespace DrawTextUtilities 13 | { 14 | extern const c32 TextWhite; 15 | extern const c32 TextWhiteDisabled; 16 | extern const c32 TextBlue; 17 | extern const c32 TextBlueDisabled; 18 | extern const c32 TextRed; 19 | extern const c32 TextRedDisabled; 20 | extern const c32 TextGreen; 21 | extern const c32 TextYellow; 22 | 23 | void WrapText(CDrawText::EFont font, s32 width, const char *p_str, u32 length, std::vector &lengths, bool &match); 24 | } 25 | 26 | #endif -------------------------------------------------------------------------------- /Source/SysPSP/PRX/MediaEngine/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = mediaengine 2 | OBJS = me_stub.o main.o 3 | 4 | INCDIR = 5 | CFLAGS = -O2 -G0 -Wall 6 | 7 | 8 | CXXFLAGS = $(CFLAGS) 9 | ASFLAGS = $(CFLAGS) 10 | 11 | BUILD_PRX = 1 12 | PRX_EXPORTS = exports.exp 13 | 14 | USE_KERNEL_LIBC=1 15 | USE_KERNEL_LIBS=1 16 | 17 | LIBDIR = ../../../Projects/PSP/SDK/lib 18 | LDFLAGS = -nostartfiles 19 | LIBS = -lpspkernel 20 | 21 | PSP_FW_VERSION=500 22 | 23 | 24 | PSPSDK=$(shell psp-config --pspsdk-path) 25 | include $(PSPSDK)/lib/build.mak 26 | 27 | EXTRA_TARGETS = MediaEngine.S 28 | 29 | MediaEngine.S : $(PRX_EXPORTS) 30 | psp-build-exports --build-stubs $(PRX_EXPORTS) 31 | 32 | all: $(FINAL_TARGET) MediaEngine.S 33 | 34 | -------------------------------------------------------------------------------- /Source/SysGLES/GL.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSGLES_GL_H_ 2 | #define SYSGLES_GL_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include "Base/Types.h" 9 | 10 | extern SDL_Window * gWindow; 11 | extern SDL_Renderer * gSdlRenderer; 12 | // FIXME: burn all of this with fire. 13 | 14 | void sceGuFog(float mn, float mx, u32 col); 15 | 16 | enum EGuTextureWrapMode 17 | { 18 | GU_CLAMP = GL_CLAMP_TO_EDGE, 19 | GU_REPEAT = GL_REPEAT, 20 | }; 21 | 22 | enum EGuMatrixType 23 | { 24 | GU_PROJECTION = GL_PROJECTION, 25 | }; 26 | 27 | struct ScePspFMatrix4 28 | { 29 | float m[16]; 30 | }; 31 | 32 | void sceGuSetMatrix(EGuMatrixType type, const ScePspFMatrix4 * mtx); 33 | 34 | 35 | #endif // SYSGLES_GL_H_ 36 | -------------------------------------------------------------------------------- /Source/SysGL/GL.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSGL_GL_H_ 2 | #define SYSGL_GL_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | 9 | #include "Base/Types.h" 10 | 11 | extern SDL_Window * gWindow; 12 | extern SDL_Renderer * gSdlRenderer; 13 | 14 | // FIXME: burn all of this with fire. 15 | 16 | void sceGuFog(float mn, float mx, u32 col); 17 | 18 | enum EGuTextureWrapMode 19 | { 20 | GU_CLAMP = GL_CLAMP_TO_EDGE, 21 | GU_REPEAT = GL_REPEAT, 22 | }; 23 | 24 | enum EGuMatrixType 25 | { 26 | GU_PROJECTION = GL_PROJECTION, 27 | }; 28 | 29 | struct ScePspFMatrix4 30 | { 31 | float m[16]; 32 | }; 33 | 34 | void sceGuSetMatrix(EGuMatrixType type, const ScePspFMatrix4 * mtx); 35 | 36 | 37 | #endif // SYSGL_GL_H_ 38 | -------------------------------------------------------------------------------- /Source/SysPosix/Debug/Web/css/dldebugger.css: -------------------------------------------------------------------------------- 1 | body { padding-top: 20px; } 2 | 3 | .fixed { 4 | font-family: Menlo,Monaco,"Courier New",monospace; 5 | font-size: 12px; 6 | } 7 | 8 | .scrub { width: 640px; } 9 | .scrub input { width: 100%; } 10 | 11 | .combine { 12 | display: inline-block; 13 | } 14 | 15 | .screen-container { 16 | white-space:nowrap; 17 | } 18 | 19 | .screen { 20 | vertical-align:top; 21 | display:inline-block; 22 | background-color:#000; 23 | } 24 | 25 | .dlist { 26 | display:inline-block; 27 | float:none; 28 | background-color: whiteSmoke; 29 | height: 480px; 30 | color: #fff; 31 | overflow: scroll; 32 | position: relative; 33 | } 34 | 35 | .dlist pre { 36 | white-space: pre; 37 | word-wrap: normal; 38 | } 39 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/dpadandbuttons.ini: -------------------------------------------------------------------------------- 1 | Name=DPad and Buttons 2 | Description=The PSP DPad and Cross/Square/Triangle/Circle buttons map to the N64 DPad and A/B/L/R respectively. Hold down the PSP's Left trigger to toggle Cross/Square/Triangle and Circle to the N64's CButtons. 3 | 4 | [Buttons] 5 | N64.Start = PSP.Start 6 | N64.A = !PSP.LTrigger & PSP.Cross 7 | N64.B = !PSP.LTrigger & PSP.Square 8 | N64.Z = PSP.RTrigger 9 | N64.LTrigger = !PSP.LTrigger & PSP.Triangle 10 | N64.RTrigger = !PSP.LTrigger & PSP.Circle 11 | N64.Up = PSP.Up 12 | N64.Down = PSP.Down 13 | N64.Left = PSP.Left 14 | N64.Right = PSP.Right 15 | N64.CUp = PSP.LTrigger & PSP.Triangle 16 | N64.CDown = PSP.LTrigger & PSP.Cross 17 | N64.CLeft = PSP.LTrigger & PSP.Square 18 | N64.CRight = PSP.LTrigger & PSP.Circle -------------------------------------------------------------------------------- /Source/SysPSP/PRX/ExceptionHandler/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | PSP_MODULE_INFO("exception", 0x1007, 1, 1); // better not unload 6 | 7 | PspDebugErrorHandler curr_handler; 8 | PspDebugRegBlock *exception_regs; 9 | 10 | void _pspDebugExceptionHandler(void); 11 | int sceKernelRegisterDefaultExceptionHandler(void *func); 12 | 13 | int module_start(SceSize args, void *argp) 14 | { 15 | if(args != 8) return -1; 16 | curr_handler = (PspDebugErrorHandler)((int *)argp)[0]; 17 | exception_regs = (PspDebugRegBlock *)((int *)argp)[1]; 18 | if(!curr_handler || !exception_regs) return -1; 19 | 20 | return sceKernelRegisterDefaultExceptionHandler((void *)_pspDebugExceptionHandler); 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Source/SysCTR/HLEGraphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | add_library(HLEGraphics_CTR OBJECT 3 | BlendModes.cpp 4 | ColourAdjuster.cpp 5 | GraphicsPluginCTR.cpp 6 | RendererCTR.cpp 7 | Combiner/BlendConstant.cpp 8 | Combiner/CombinerExpression.cpp 9 | Combiner/CombinerTree.cpp 10 | Combiner/RenderSettings.cpp 11 | ) 12 | 13 | if(DAEDALUS_PROFILE_HLEGRAPHICS_CTR) 14 | target_compile_options(HLEGraphics_CTR PRIVATE -pg) 15 | endif(DAEDALUS_PROFILE_HLEGRAPHICS_CTR) 16 | 17 | 18 | 19 | list(APPEND daed_libs "HLEGraphics_CTR") 20 | set(daed_libs ${daed_libs} PARENT_SCOPE) 21 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/dpadandbuttonsinv.ini: -------------------------------------------------------------------------------- 1 | Name=DPad and Buttons Inverted 2 | Description=The PSP DPad and Cross/Square/Triangle/Circle buttons map to the N64 DPad and CButtons respectively. Hold down the PSP's Left trigger to toggle Cross/Square/Triangle and Circle to the N64's A/B/L/R buttons. 3 | 4 | [Buttons] 5 | N64.Start = PSP.Start 6 | N64.A = PSP.LTrigger & PSP.Cross 7 | N64.B = PSP.LTrigger & PSP.Square 8 | N64.Z = PSP.RTrigger 9 | N64.LTrigger = PSP.LTrigger & PSP.Triangle 10 | N64.RTrigger = PSP.LTrigger & PSP.Circle 11 | N64.Up = PSP.Up 12 | N64.Down = PSP.Down 13 | N64.Left = PSP.Left 14 | N64.Right = PSP.Right 15 | N64.CUp = !PSP.LTrigger & PSP.Triangle 16 | N64.CDown = !PSP.LTrigger & PSP.Cross 17 | N64.CLeft = !PSP.LTrigger & PSP.Square 18 | N64.CRight = !PSP.LTrigger & PSP.Circle -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedpad.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style Dpad 2 | Description=Triangle and Circle act as C Left and C right respectively. Dpad acts as the N64 Dpad, but hold the Select button to use as C Buttons. Use Note button as the Z button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.Note 10 | N64.LTrigger = PSP.LTrigger 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & !PSP.Select 13 | N64.Down = PSP.Down & !PSP.Select 14 | N64.Left = PSP.Left & !PSP.Select 15 | N64.Right = PSP.Right & !PSP.Select 16 | N64.CUp = PSP.Up & PSP.Select 17 | N64.CDown = PSP.Down & PSP.Select 18 | N64.CLeft = (PSP.Left & PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedpadz.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style Dpad with Z 2 | Description=Triangle and Circle act as C Left and C right respectively. Dpad acts as the N64 Dpad, but hold the Select button to use as C buttons. Use Note button as the L button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.LTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & !PSP.Select 13 | N64.Down = PSP.Down & !PSP.Select 14 | N64.Left = PSP.Left & !PSP.Select 15 | N64.Right = PSP.Right & !PSP.Select 16 | N64.CUp = PSP.Up & PSP.Select 17 | N64.CDown = PSP.Down & PSP.Select 18 | N64.CLeft = (PSP.Left & PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedefault.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style Default 2 | Description=Triangle and Circle act as C Left and C Right respectively. Dpad acts as all the C buttons, but hold the Select button to use as N64 Dpad. Use Note button as the L button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.LTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & PSP.Select 13 | N64.Down = PSP.Down & PSP.Select 14 | N64.Left = PSP.Left & PSP.Select 15 | N64.Right = PSP.Right & PSP.Select 16 | N64.CUp = PSP.Up & !PSP.Select 17 | N64.CDown = PSP.Down & !PSP.Select 18 | N64.CLeft = (PSP.Left & !PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & !PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Source/SysPSP/Utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Utility_PSP OBJECT 2 | AtomicPrimitives.S 3 | BatteryPSP.cpp 4 | DebugMemory.cpp 5 | # DisableFPUExceptions.S 6 | exception.cpp 7 | FastMemcpyPSP.cpp 8 | ModulePSP.cpp 9 | VolatileMemPSP.cpp 10 | ) 11 | 12 | if(DAEDALUS_PROFILE_UTILITY_PSP) 13 | target_compile_options(RomFile PRIVATE -pg) 14 | endif(DAEDALUS_PROFILE_UTILITY_PSP) 15 | 16 | 17 | 18 | list(APPEND daed_libs "Utility_PSP") 19 | set(daed_libs ${daed_libs} PARENT_SCOPE) 20 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/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_FUNC(module_stop) 10 | PSP_EXPORT_END 11 | 12 | PSP_EXPORT_START(pspDveManager, 0, 0x4001) 13 | PSP_EXPORT_FUNC_HASH(pspDveMgrCheckVideoOut) 14 | PSP_EXPORT_FUNC_HASH(pspDveMgrSetVideoOut) 15 | PSP_EXPORT_END 16 | 17 | PSP_EXPORT_START(pspDveManager_driver, 0, 0x0001) 18 | PSP_EXPORT_FUNC_HASH(pspDveMgrCheckVideoOut) 19 | PSP_EXPORT_FUNC_HASH(pspDveMgrSetVideoOut) 20 | PSP_EXPORT_END 21 | 22 | PSP_END_EXPORTS 23 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedeflcdc.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style with Left C and Down C 2 | Description=Triangle and Circle act as C Left and C Down respectively. Dpad acts as all the C buttons, but hold the Select button to use as N64 Dpad. Use Note button as the L button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.LTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & PSP.Select 13 | N64.Down = PSP.Down & PSP.Select 14 | N64.Left = PSP.Left & PSP.Select 15 | N64.Right = PSP.Right & PSP.Select 16 | N64.CUp = PSP.Up & !PSP.Select 17 | N64.CDown = (PSP.Down & !PSP.Select) | PSP.Circle 18 | N64.CLeft = (PSP.Left & !PSP.Select) | PSP.Triangle 19 | N64.CRight = PSP.Right & !PSP.Select 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedpadlcdc.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style Dpad with Left C and Down C 2 | Description=Triangle and Circle act as C Left and C Down respectively. Dpad acts as the N64 Dpad, but hold the Select button to use as C Buttons. Use Note button as the Z button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.Note 10 | N64.LTrigger = PSP.LTrigger 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & !PSP.Select 13 | N64.Down = PSP.Down & !PSP.Select 14 | N64.Left = PSP.Left & !PSP.Select 15 | N64.Right = PSP.Right & !PSP.Select 16 | N64.CUp = PSP.Up & PSP.Select 17 | N64.CDown = (PSP.Down & PSP.Select) | PSP.Circle 18 | N64.CLeft = (PSP.Left & PSP.Select) | PSP.Triangle 19 | N64.CRight = PSP.Right & PSP.Select 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedpadzlcdc.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style Dpad with Left C Down C and Z 2 | Description=Triangle and Circle act as C Left and C Down respectively. Dpad acts as the N64 Dpad, but hold the Select button to use as C buttons. Use Note button as the L button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.LTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & !PSP.Select 13 | N64.Down = PSP.Down & !PSP.Select 14 | N64.Left = PSP.Left & !PSP.Select 15 | N64.Right = PSP.Right & !PSP.Select 16 | N64.CUp = PSP.Up & PSP.Select 17 | N64.CDown = (PSP.Down & PSP.Select) | PSP.Circle 18 | N64.CLeft = (PSP.Left & PSP.Select) | PSP.Triangle 19 | N64.CRight = PSP.Right & PSP.Select 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Source/SysPSP/Graphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | #Ideally Daedalus SDL would trigger the font off. 2 | if(INTRAFONT) 3 | set(DRAW_TEXT DrawTextPSP.cpp) 4 | else() 5 | set(DRAW_TEXT ${PROJECT_SOURCE_DIR}/Source/SysGL/Graphics/DrawTextSDL.cpp) 6 | endif() 7 | 8 | add_library(Graphics_PSP OBJECT 9 | 10 | GraphicsContextPSP.cpp 11 | NativeTexturePSP.cpp 12 | VideoMemoryManager.cpp 13 | UIContextPSP.cpp 14 | ${DRAW_TEXT} 15 | ) 16 | 17 | if(DAEDALUS_PROFILE_GRAPHICS_PSP) 18 | target_compile_options(Graphics_PSP PRIVATE -pg) 19 | endif(DAEDALUS_PROFILE_GRAPHICS_PSP) 20 | 21 | list(APPEND daed_libs "Graphics_PSP") 22 | set(daed_libs ${daed_libs} PARENT_SCOPE) 23 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedefjoyswap.ini: -------------------------------------------------------------------------------- 1 | Name=Joypad with C Buttons 2 | Description=Dpad acts as the N64 Joystick. Triangle and Circle act as C Left and C Right respectively. Analog Stick acts as all the C buttons, but hold the Select button to use as N64 Dpad. Use Note button as the L button. 3 | JoystickSwap=B 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.LTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.RTrigger 12 | N64.Up = PSP.Up & PSP.Select 13 | N64.Down = PSP.Down & PSP.Select 14 | N64.Left = PSP.Left & PSP.Select 15 | N64.Right = PSP.Right & PSP.Select 16 | N64.CUp = PSP.Up & !PSP.Select 17 | N64.CDown = PSP.Down & !PSP.Select 18 | N64.CLeft = (PSP.Left & !PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & !PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedpadtriggerswap.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style Dpad with Triggers Swapped 2 | Description=L and R buttons are reversed. Triangle and Circle act as C Left and C right respectively. Dpad acts as the N64 Dpad, but hold the Select button to use as C Buttons. Use Note button as the Z button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.Note 10 | N64.LTrigger = PSP.RTrigger 11 | N64.RTrigger = PSP.LTrigger 12 | N64.Up = PSP.Up & !PSP.Select 13 | N64.Down = PSP.Down & !PSP.Select 14 | N64.Left = PSP.Left & !PSP.Select 15 | N64.Right = PSP.Right & !PSP.Select 16 | N64.CUp = PSP.Up & PSP.Select 17 | N64.CDown = PSP.Down & PSP.Select 18 | N64.CLeft = (PSP.Left & PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedeftriggerswap.ini: -------------------------------------------------------------------------------- 1 | Name=Gamecube Style with Triggers Swapped 2 | Description=PSP L acts as N64 R, while PSP R acts as N64 Z. Triangle and Circle act as C Left and C Right respectively. Dpad acts as all the C buttons, but hold the Select button to use as N64 Dpad. Use Note button as the L button. 3 | JoystickSwap=A 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.RTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.LTrigger 12 | N64.Up = PSP.Up & PSP.Select 13 | N64.Down = PSP.Down & PSP.Select 14 | N64.Left = PSP.Left & PSP.Select 15 | N64.Right = PSP.Right & PSP.Select 16 | N64.CUp = PSP.Up & !PSP.Select 17 | N64.CDown = PSP.Down & !PSP.Select 18 | N64.CLeft = (PSP.Left & !PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & !PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Source/Core/Interpret.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | void Inter_Reset(); 23 | void Inter_SelectCore(); 24 | -------------------------------------------------------------------------------- /Source/DynaRec/mips/DynaRecDebug.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001 StrmnNrmn 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | static void DumpDynarecStats( float elapsed_time ); -------------------------------------------------------------------------------- /Source/HLEAudio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Plugin) # Plugin based Audio added here 2 | 3 | add_library(HLEAudio OBJECT 4 | ABI1.cpp 5 | ABI2.cpp 6 | ABI3.cpp 7 | ABI3mp3.cpp 8 | AudioBuffer.cpp 9 | ABI_ADPCM.cpp 10 | ABI_Buffers.cpp 11 | ABI_Filters.cpp 12 | ABI_MixerInterleave.cpp 13 | ABI_Resample.cpp 14 | ENV_Mixer.cpp 15 | HLEAudioState.cpp 16 | HLEMain.cpp 17 | ) 18 | 19 | if(DAEDALUS_PROFILE_HLEAUDIO) 20 | target_compile_options(HLEAudio PRIVATE -pg) 21 | endif(DAEDALUS_PROFILE_HLEAUDIO) 22 | 23 | list(APPEND daed_libs "HLEAudio") 24 | set(daed_libs ${daed_libs} PARENT_SCOPE) 25 | -------------------------------------------------------------------------------- /Data/ControllerConfigs/gamecubedefjoytrigswap.ini: -------------------------------------------------------------------------------- 1 | Name=Joypad with C Buttons and Triggers Swapped 2 | Description=PSP L acts as N64 R, while PSP R acts as N64 Z. Dpad acts as the N64 Joystick. Triangle and Circle act as C Left and C Right respectively. Analog Stick acts as all the C buttons, but hold the Select button to use as N64 Dpad. Use Note button as the L button. 3 | JoystickSwap=B 4 | 5 | [Buttons] 6 | N64.Start = PSP.Start 7 | N64.A = PSP.Cross 8 | N64.B = PSP.Square 9 | N64.Z = PSP.RTrigger 10 | N64.LTrigger = PSP.Note 11 | N64.RTrigger = PSP.LTrigger 12 | N64.Up = PSP.Up & PSP.Select 13 | N64.Down = PSP.Down & PSP.Select 14 | N64.Left = PSP.Left & PSP.Select 15 | N64.Right = PSP.Right & PSP.Select 16 | N64.CUp = PSP.Up & !PSP.Select 17 | N64.CDown = PSP.Down & !PSP.Select 18 | N64.CLeft = (PSP.Left & !PSP.Select) | PSP.Triangle 19 | N64.CRight = (PSP.Right & !PSP.Select) | PSP.Circle 20 | #N64.GSButton = -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = dvemgr 2 | OBJS = main.o exports.o 3 | 4 | CFLAGS = -Os -G0 -Wall -fshort-wchar -fno-pic -mno-check-zero-division 5 | CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti 6 | ASFLAGS = $(CFLAGS) 7 | 8 | PSP_FW_VERSION=500 9 | BUILD_PRX = 1 10 | PRX_EXPORTS = exports.exp 11 | 12 | USE_KERNEL_LIBC = 1 13 | USE_KERNEL_LIBS = 1 14 | 15 | LDFLAGS = -nostartfiles 16 | LIBS = -lpspdve_driver -lpsphprm_driver -lpspimpose_driver 17 | 18 | 19 | 20 | PSPSDK=$(shell psp-config --pspsdk-path) 21 | include $(PSPSDK)/lib/build.mak 22 | 23 | EXTRA_TARGETS = pspDveManager.S pspDveManager_driver.S 24 | 25 | pspDveManager.S : $(PRX_EXPORTS) 26 | psp-build-exports --build-stubs $(PRX_EXPORTS) 27 | 28 | pspDveManager_driver.S : $(PRX_EXPORTS) 29 | psp-build-exports --build-stubs $(PRX_EXPORTS) 30 | 31 | all: $(FINAL_TARGET) pspDveManager.S pspDveManager_driver.S 32 | -------------------------------------------------------------------------------- /Source/System/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | if(DAEDALUS_PSP) 3 | set(Timing Timing/PSP/Timing.cpp) 4 | set(Thread Thread/PSP/Thread.cpp) 5 | elseif(DAEDALUS_CTR) 6 | set(Timing Timing/CTR/Timing.cpp) 7 | set(Thread Thread/CTR/Thread.cpp) 8 | elseif(WIN32) 9 | set(Timing Timing/Windows/Timing.cpp) 10 | set(Thread Thread/Posix/Thread.cpp) 11 | else() 12 | set(Timing Timing/Posix/Timing.cpp) 13 | set(Thread Thread/Posix/Thread.cpp) 14 | endif() 15 | 16 | add_library(System OBJECT 17 | CompressedStream.cpp 18 | ${Thread} 19 | SystemInit.cpp 20 | ${Timing} 21 | ) 22 | 23 | target_include_directories(System PUBLIC ${ZLIB_INCLUDE_DIRS}) 24 | 25 | if(DAEDALUS_PROFILE_SYSTEM) 26 | target_compile_options(System PRIVATE -pg) 27 | endif(DAEDALUS_PROFILE_SYSTEM) 28 | 29 | 30 | list(APPEND daed_libs "System") 31 | set(daed_libs ${daed_libs} PARENT_SCOPE) 32 | -------------------------------------------------------------------------------- /Source/CMakeSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "configurations": [ 3 | { 4 | "name": "Daedalus", 5 | "generator": "Visual Studio 16 2019", 6 | "configurationType": "Release", 7 | "inheritEnvironments": [ "msvc_x86" ], 8 | "buildRoot": "${projectDir}\\out\\build\\${name}", 9 | "installRoot": "${projectDir}\\out\\install\\${name}", 10 | "cmakeCommandArgs": "", 11 | "buildCommandArgs": "", 12 | "ctestCommandArgs": "", 13 | "variables": [] 14 | }, 15 | { 16 | "name": "Daedalus-Debug", 17 | "generator": "Visual Studio 16 2019", 18 | "configurationType": "Debug", 19 | "buildRoot": "${projectDir}\\out\\build\\${name}", 20 | "installRoot": "${projectDir}\\out\\install\\${name}", 21 | "cmakeCommandArgs": "", 22 | "buildCommandArgs": "", 23 | "ctestCommandArgs": "", 24 | "inheritEnvironments": [ "msvc_x86" ], 25 | "variables": [ {} ] 26 | } 27 | ] 28 | } -------------------------------------------------------------------------------- /Source/Utility/CRC.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_CRC_H_ 21 | #define UTILITY_CRC_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | u32 daedalus_crc32(u32 crc, const u8 *buf, u32 len); 26 | 27 | #endif // UTILITY_CRC_H_ 28 | -------------------------------------------------------------------------------- /Source/Utility/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Utility OBJECT 2 | BatchTest.cpp 3 | CRC.cpp 4 | FastMemcpy.cpp 5 | FramerateLimiter.cpp 6 | Hash.cpp 7 | IniFile.cpp 8 | MemoryHeap.cpp 9 | Paths.cpp 10 | Profiler.cpp 11 | Stream.cpp 12 | StringUtil.cpp 13 | Timer.cpp 14 | Translate.cpp 15 | 16 | ) 17 | 18 | 19 | # Utility/FastMemcpy_test.cpp Utility/MemoryPool.cpp These are testing 20 | 21 | if(DAEDALUS_PROFILE_UTILITY) 22 | target_compile_options(Utility PRIVATE -pg) 23 | endif(DAEDALUS_PROFILE_UTILITY) 24 | 25 | list(APPEND daed_libs "Utility") 26 | set(daed_libs ${daed_libs} PARENT_SCOPE) 27 | -------------------------------------------------------------------------------- /Source/Core/Save.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008-2009 Howard Su (howard0su@gmail.com) 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | bool Save_Reset(); 23 | void Save_Fini(); 24 | 25 | void Save_MarkSaveDirty(); 26 | void Save_MarkMempackDirty(); 27 | 28 | void Save_Flush(); 29 | -------------------------------------------------------------------------------- /Source/HLEGraphics/RDP.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2002 StrmnNrmn 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | 22 | #include "Base/Types.h" 23 | #include "HLEGraphics/RDP.h" 24 | 25 | // This needs a huge clean up or be removed as is now, it only holds debug code.. 26 | -------------------------------------------------------------------------------- /Source/third_party/webby/webby_unix.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | typedef int webby_socket_t; 10 | typedef socklen_t webby_socklen_t; 11 | 12 | #define WB_ALIGN(x) __attribute__((aligned(x))) 13 | #define WB_INVALID_SOCKET (-1) 14 | 15 | static int wb_socket_error(void) 16 | { 17 | return errno; 18 | } 19 | 20 | static int wb_valid_socket(webby_socket_t socket) 21 | { 22 | return socket > 0; 23 | } 24 | 25 | static void wb_close_socket(webby_socket_t socket) 26 | { 27 | close(socket); 28 | } 29 | 30 | static int wb_is_blocking_error(int error) 31 | { 32 | return EAGAIN == error; 33 | } 34 | 35 | static int wb_set_blocking(webby_socket_t socket, int blocking) 36 | { 37 | int flags = fcntl(socket, F_GETFL); 38 | if (blocking) 39 | return fcntl(socket, F_SETFL, flags & ~O_NONBLOCK); 40 | else 41 | return fcntl(socket, F_SETFL, flags | O_NONBLOCK); 42 | } 43 | -------------------------------------------------------------------------------- /Source/Core/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(Core OBJECT 2 | 3 | 4 | CPU.cpp 5 | DMA.cpp 6 | Dynamo.cpp 7 | FlashMem.cpp 8 | Interpret.cpp 9 | Interrupt.cpp 10 | Memory.cpp 11 | PIF.cpp 12 | R4300.cpp 13 | RDRam.cpp 14 | ROM.cpp 15 | ROMImage.cpp 16 | RSP_HLE.cpp 17 | Save.cpp 18 | TLB.cpp 19 | ) 20 | 21 | # Cannot compile with -O2 or above on Apple Intel 22 | if(APPLE) 23 | set_source_files_properties(R4300.cpp PROPERTIES COMPILE_FLAGS -O0) 24 | endif(APPLE) 25 | 26 | if(DAEDALUS_PROFILE_CORE) 27 | target_compile_options(Core PRIVATE -pg) 28 | endif(DAEDALUS_PROFILE_CORE) 29 | 30 | list(APPEND daed_libs "Core") 31 | set(daed_libs ${daed_libs} PARENT_SCOPE) 32 | -------------------------------------------------------------------------------- /Source/SysPosix/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Debug) 2 | add_subdirectory(HLEGraphics) 3 | add_subdirectory(Utility) 4 | 5 | 6 | list(APPEND sys_libraries "dl") 7 | set(sys_libraries ${sys_libraries} PARENT_SCOPE) 8 | 9 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../daedalus DESTINATION DaedalusX64 10 | PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ) 11 | 12 | if(DAEDALUS_GL) 13 | install(FILES ${PROJECT_SOURCE_DIR}/Source/SysGL/HLEGraphics/n64.psh DESTINATION DaedalusX64) 14 | endif(DAEDALUS_GL) 15 | 16 | if(DAEDALUS_GLES) 17 | install(FILES ${PROJECT_SOURCE_DIR}/Source/SysGLES/HLEGraphics/n64.psh DESTINATION DaedalusX64) 18 | endif(DAEDALUS_GLES) 19 | 20 | install(FILES ${PROJECT_BINARY_DIR}/../Data/roms.ini DESTINATION DaedalusX64) 21 | install(FILES ${PROJECT_BINARY_DIR}/../Data/readme.txt DESTINATION DaedalusX64) 22 | install(FILES ${PROJECT_BINARY_DIR}/../Data/copying.txt DESTINATION DaedalusX64) 23 | 24 | set(daed_libs ${daed_libs} PARENT_SCOPE) 25 | set(plat_main SysPosix/main.cpp PARENT_SCOPE) 26 | -------------------------------------------------------------------------------- /Source/Core/FlashMem.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008-2009 Howard Su (howard0su@gmail.com) 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef FLASHMEM_H_ 23 | #define FLASHMEM_H_ 24 | // 25 | // Flash RAM Support 26 | // 27 | void Flash_DoCommand(u32); 28 | void Flash_Init(); 29 | extern u32 FlashStatus[2]; 30 | 31 | #endif // FLASHMEM_H_ 32 | -------------------------------------------------------------------------------- /Source/SysPSP/Utility/ModulePSP.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Salvy 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef SYSPSP_UTILITY_MODULEPSP_H_ 21 | #define SYSPSP_UTILITY_MODULEPSP_H_ 22 | #include 23 | namespace CModule 24 | { 25 | void Unload( int id ); 26 | int Load( const std::filesystem::path path ); 27 | } 28 | 29 | #endif // SYSPSP_UTILITY_MODULEPSP_H_ 30 | -------------------------------------------------------------------------------- /Source/Debug/PrintOpCode.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_PRINTOPCODE_H_ 21 | #define UTILITY_PRINTOPCODE_H_ 22 | 23 | struct OpCode; 24 | 25 | void SprintOpCodeInfo( char *str, u32 address, OpCode op ); 26 | void SprintRSPOpCodeInfo( char *str, u32 address, OpCode op ); 27 | 28 | #endif // UTILITY_PRINTOPCODE_H_ 29 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/MediaEngine/me_stub.S: -------------------------------------------------------------------------------- 1 | // this stub is from the melib package, (c)mrbrown 2 | 3 | #include 4 | 5 | #define STATUS $12 6 | #define CAUSE $13 7 | #define CONFIG $16 8 | #define TAGLO $28 9 | #define TAGHI $29 10 | #define IXIST 0x01 11 | #define DXIST 0x11 12 | 13 | .global me_stub 14 | .global me_stub_end 15 | .set noreorder 16 | .set noat 17 | 18 | me_stub: 19 | li k0, 0xbc100000 20 | li t0, 7 21 | sw t0, 80(k0) 22 | li t0, 2 23 | sw t0, 64(k0) 24 | mtc0 zero, TAGLO 25 | mtc0 zero, TAGHI 26 | li k1, 8192 27 | a: 28 | addi k1, k1, -64 29 | bne k1, zero, a 30 | cache IXIST, 0(k1) 31 | li k1, 8192 32 | b: 33 | addi k1, k1, -64 34 | bne k1, zero, b 35 | cache DXIST, 0(k1) 36 | mtc0 zero, CAUSE 37 | 38 | li t0, 0xbc00002c 39 | li t1, 0xbc000000 40 | li t2, -1 41 | c: 42 | sw t2, 0(t1) 43 | bne t1, t0, c 44 | addiu t1, t1, 4 45 | 46 | li k0, 0x20000000 47 | mtc0 k0, STATUS 48 | sync 49 | li t0, 0xbfc00000 50 | lw a0, 0x604(t0) 51 | lw k0, 0x600(t0) 52 | li sp, 0x80200000 53 | jr k0 54 | nop 55 | me_stub_end: 56 | -------------------------------------------------------------------------------- /Source/Core/Dynamo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | void Dynamo_SelectCore(); 23 | void Dynamo_Reset(); 24 | 25 | #ifdef DAEDALUS_DEBUG_DYNAREC 26 | void CPU_DumpFragmentCache(); 27 | #endif 28 | void Dynarec_ClearedCPUStuffToDo(); 29 | void Dynarec_SetCPUStuffToDo(); 30 | 31 | void CPU_ResetFragmentCache(); 32 | -------------------------------------------------------------------------------- /Source/Utility/Hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef UTILITY_HASH_H_ 23 | #define UTILITY_HASH_H_ 24 | 25 | unsigned int murmur2_hash ( const void * key, int len, unsigned int seed ); 26 | unsigned int murmur2_neutral_hash ( const void * key, int len, unsigned int seed ); 27 | 28 | #endif // UTILITY_HASH_H_ 29 | -------------------------------------------------------------------------------- /Source/third_party/webby/tundra.lua: -------------------------------------------------------------------------------- 1 | local CFiles = { ".c", ".h" } 2 | Build { 3 | Configs = { 4 | Config { 5 | Name = "generic-gcc", 6 | DefaultOnHost = "linux", 7 | Tools = { "gcc" }, 8 | }, 9 | Config { 10 | Name = "macosx-gcc", 11 | DefaultOnHost = "macosx", 12 | Tools = { "gcc-osx" }, 13 | Env = { 14 | CCOPTS = { 15 | { '-Wall', '-Werror' }, 16 | { '-g'; Config = "*-*-debug" }, 17 | { '-O2'; Config = "*-*-release" }, 18 | }, 19 | }, 20 | }, 21 | Config { 22 | Name = "win64-msvc", 23 | DefaultOnHost = "windows", 24 | Tools = { "msvc-winsdk"; TargetPlatform = "x64" }, 25 | Env = { 26 | CPPDEFS = { "_CRT_SECURE_NO_WARNINGS" }, 27 | CCOPTS = { '/W4', '/wd4127', '/wd4100' }, 28 | { GENERATE_PDB = 1; Config = "*-*-debug" }, 29 | }, 30 | }, 31 | }, 32 | Units = function() 33 | require "tundra.syntax.glob" 34 | local demo = Program { 35 | Name = "webbydemo", 36 | Sources = { "demo.c", "webby.c" }, 37 | Libs = { { "ws2_32.lib"; Config = "win64-msvc" } }, 38 | } 39 | Default(demo) 40 | end, 41 | } 42 | -------------------------------------------------------------------------------- /Source/SysW32/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Debug) 2 | add_subdirectory(Utility) 3 | 4 | install(FILES ${PROJECT_BINARY_DIR}/../Data/roms.ini DESTINATION DaedalusX64) 5 | install(FILES ${PROJECT_BINARY_DIR}/../Data/readme.txt DESTINATION DaedalusX64) 6 | install(FILES ${PROJECT_BINARY_DIR}/../Data/copying.txt DESTINATION DaedalusX64) 7 | 8 | #MSVC adds some extra paths for the executable, need to cater for them (for now, we'll be able to use Clang later) 9 | if(MSVC) 10 | if(DEBUG) 11 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../Debug/daedalus.exe DESTINATION DaedalusX64) 12 | else() 13 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../Release/daedalus.exe DESTINATION DaedalusX64) 14 | endif() 15 | else() 16 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../daedalus.exe DESTINATION DaedalusX64) 17 | endif() 18 | list(APPEND daed_libs) 19 | set(daed_libs ${daed_libs} Shlwapi.lib Dsound.lib Xinput.lib uuid.lib PARENT_SCOPE) 20 | set(plat_main SysPosix/main.cpp PARENT_SCOPE) 21 | 22 | file(GLOB DYNAMIC_LIBRARIES "${CMAKE_CURRENT_BINARY_DIR}/../*.dll") 23 | 24 | install(FILES ${DYNAMIC_LIBRARIES} DESTINATION DaedalusX64) -------------------------------------------------------------------------------- /Source/UI/UIAlignment.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UI_UIALIGNMENT_H_ 21 | #define UI_UIALIGNMENT_H_ 22 | 23 | enum EAlignType 24 | { 25 | AT_LEFT, 26 | AT_RIGHT, 27 | AT_CENTRE, 28 | }; 29 | 30 | enum EVerticalAlign 31 | { 32 | VA_TOP, 33 | VA_BOTTOM, 34 | }; 35 | 36 | 37 | #endif // UI_UIALIGNMENT_H_ 38 | -------------------------------------------------------------------------------- /Source/Base/Macros.h: -------------------------------------------------------------------------------- 1 | #ifndef UTILITY_MACROS_H_ 2 | #define UTILITY_MACROS_H_ 3 | 4 | #include 5 | #include 6 | 7 | 8 | 9 | 10 | 11 | #define DAEDALUS_USE(...) do { (void)sizeof(__VA_ARGS__, 0); } while(0) 12 | 13 | 14 | #ifdef DAEDALUS_PSP 15 | template 16 | constexpr T make_uncached_ptr(T ptr) 17 | { 18 | std::uintptr_t ptrInt = std::bit_cast(ptr); 19 | ptrInt |= 0x40000000; 20 | return std::bit_cast(ptrInt); 21 | } 22 | #else 23 | template 24 | constexpr T make_uncached_ptr(T ptr) { return ptr; } 25 | #endif 26 | 27 | // We need this directive for backwards compatibility with devices that do not have C++ 20 available which enables use of std::format or fmt::format (with external library) 28 | #if __has_include() 29 | #include 30 | #define FORMAT_NAMESPACE std 31 | #elif __has_include() 32 | #include 33 | #define FORMAT_NAMESPACE fmt 34 | #else 35 | #error "No supported format library found!" 36 | #endif 37 | 38 | #endif // UTILITY_MACROS_H_ 39 | -------------------------------------------------------------------------------- /Source/Input/InputManager.h: -------------------------------------------------------------------------------- 1 | #ifndef INPUT_INPUTMANAGER_H_ 2 | #define INPUT_INPUTMANAGER_H_ 3 | 4 | #include "Ultra/ultra_os.h" 5 | #include "Base/Singleton.h" 6 | 7 | #include 8 | 9 | class CInputManager : public CSingleton< CInputManager > 10 | { 11 | public: 12 | virtual ~CInputManager() {} 13 | 14 | virtual u32 GetNumConfigurations() const = 0; 15 | virtual const char * GetConfigurationName( u32 configuration_idx ) const = 0; 16 | virtual const char * GetConfigurationDescription( u32 configuration_idx ) const = 0; 17 | virtual void SetConfiguration( u32 configuration_idx ) = 0; 18 | 19 | virtual u32 GetConfigurationFromName( const char * name ) const = 0; 20 | 21 | virtual bool Initialise() = 0; 22 | virtual void Finalise() = 0; 23 | 24 | virtual void GetState( OSContPad pPad[4] ) = 0; 25 | 26 | static bool Init() { return CInputManager::Get()->Initialise();} 27 | static void Fini() { CInputManager::Get()->Finalise();} 28 | }; 29 | 30 | glm::vec2 ApplyDeadzone( const glm::vec2 & in, f32 min_deadzone, f32 max_deadzone ); 31 | 32 | #endif // INPUT_INPUTMANAGER_H_ 33 | -------------------------------------------------------------------------------- /Source/System/Timing/Timing.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_TIMING_H_ 21 | #define UTILITY_TIMING_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | namespace NTiming { 26 | 27 | bool GetPreciseFrequency( u64 * p_freq ); 28 | bool GetPreciseTime( u64 * p_time ); 29 | u64 ToMilliseconds( u64 ticks ); 30 | 31 | } 32 | 33 | #endif // UTILITY_TIMING_H_ 34 | -------------------------------------------------------------------------------- /Source/DynaRec/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | if (${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv") 2 | file(GLOB SRC_FILES ARM/*.cpp ARM/*.S) 3 | elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86_64") 4 | file(GLOB SRC_FILES x64/*.cpp x64/*.S) 5 | elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "AMD64") 6 | file(GLOB SRC_FILES x64/*.cpp x64/*.asm) 7 | elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "x86") 8 | file(GLOB SRC_FILES x86/*.cpp x86/*.S) 9 | elseif(${CMAKE_SYSTEM_PROCESSOR} STREQUAL "mips") 10 | file(GLOB SRC_FILES mips/*.cpp mips/*.S) 11 | else() 12 | file(GLOB SRC_FILES dummy/*.cpp) 13 | endif() 14 | 15 | add_library(DynaRec OBJECT 16 | ${SRC_FILES} 17 | BranchType.cpp 18 | DynaRecProfile.cpp 19 | Fragment.cpp 20 | FragmentCache.cpp 21 | IndirectExitMap.cpp 22 | StaticAnalysis.cpp 23 | TraceRecorder.cpp 24 | ) 25 | 26 | if(DAEDALUS_PROFILE_DEBUG) 27 | target_compile_options(DynaRec PRIVATE -pg) 28 | endif(DAEDALUS_PROFILE_DEBUG) 29 | 30 | list(APPEND daed_libs "DynaRec") 31 | set(daed_libs ${daed_libs} PARENT_SCOPE) 32 | -------------------------------------------------------------------------------- /Source/SysPosix/Debug/WebDebugTemplate.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Base/Types.h" 3 | 4 | #ifdef DAEDALUS_DEBUG_DISPLAYLIST 5 | #include "SysPosix/Debug/WebDebugTemplate.h" 6 | #include "SysPosix/Debug/WebDebug.h" 7 | 8 | void WriteStandardHeader(WebDebugConnection * connection, const char * title) 9 | { 10 | connection->WriteString( 11 | "\n" 12 | "\n" 13 | " \n" 14 | " \n" 15 | " \n" 16 | ); 17 | connection->WriteF(" %s\n", title); 18 | connection->WriteString(" \n"); 19 | } 20 | 21 | void WriteStandardFooter(WebDebugConnection * connection, const char * user_script) 22 | { 23 | connection->WriteString( 24 | "\n" 25 | "\n" 26 | ); 27 | 28 | // If there's a user script, append it after the other scripts. 29 | if (user_script) 30 | connection->WriteF("\n", user_script); 31 | 32 | connection->WriteString( 33 | "\n" 34 | "\n" 35 | ); 36 | } 37 | #endif 38 | -------------------------------------------------------------------------------- /Source/Debug/DebugConsoleImpl.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | 23 | enum ETerminalColour 24 | { 25 | TC_DEFAULT = 0, 26 | TC_r, TC_g, TC_y, TC_b, TC_m, TC_c, TC_w, 27 | TC_R, TC_G, TC_Y, TC_B, TC_M, TC_C, TC_W, 28 | TC_INVALID, 29 | NUM_TERMINAL_COLOURS, 30 | }; 31 | 32 | ETerminalColour GetTerminalColour(char c); 33 | const char * GetTerminalColourString(ETerminalColour tc); 34 | -------------------------------------------------------------------------------- /Source/UI/Dialogs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Salvy6735 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UI_DIALOGS_H_ 21 | #define UI_DIALOGS_H_ 22 | #include 23 | class CUIContext; 24 | class CDialog 25 | { 26 | public: 27 | virtual ~CDialog(); 28 | bool Render(CUIContext * p_context, const char * message, bool only_dialog); 29 | }; 30 | 31 | extern std::unique_ptr gShowDialog; 32 | 33 | #endif // UI_DIALOGS_H_ 34 | 35 | -------------------------------------------------------------------------------- /Source/UI/PauseScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_PAUSESCREEN_H_ 22 | #define UI_PAUSESCREEN_H_ 23 | 24 | class CUIContext; 25 | 26 | class CPauseScreen 27 | { 28 | public: 29 | virtual ~CPauseScreen(); 30 | 31 | static std::unique_ptr Create( CUIContext * p_context ); 32 | 33 | virtual void Run() = 0; 34 | }; 35 | 36 | #endif // UI_PAUSESCREEN_H_ 37 | -------------------------------------------------------------------------------- /Source/UI/SplashScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_SPLASHSCREEN_H_ 22 | #define UI_SPLASHSCREEN_H_ 23 | 24 | class CUIContext; 25 | 26 | class CSplashScreen 27 | { 28 | public: 29 | virtual ~CSplashScreen(); 30 | 31 | static std::unique_ptr Create( CUIContext * p_context ); 32 | 33 | virtual void Run() = 0; 34 | }; 35 | 36 | #endif // UI_SPLASHSCREEN_H_ 37 | -------------------------------------------------------------------------------- /Source/third_party/webby/webby_win32.h: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | 4 | typedef SOCKET webby_socket_t; 5 | 6 | #if defined(__GNUC__) 7 | #define WB_ALIGN(x) __attribute__((aligned(x))) 8 | #else 9 | #define WB_ALIGN(x) __declspec(align(x)) 10 | #endif 11 | 12 | #define WB_INVALID_SOCKET INVALID_SOCKET 13 | #define snprintf _snprintf 14 | 15 | typedef int webby_socklen_t; 16 | 17 | static int wb_socket_error(void) 18 | { 19 | return WSAGetLastError(); 20 | } 21 | 22 | #if !defined(__GNUC__) 23 | static int strcasecmp(const char *a, const char *b) 24 | { 25 | return _stricmp(a, b); 26 | } 27 | 28 | static int strncasecmp(const char *a, const char *b, size_t len) 29 | { 30 | return _strnicmp(a, b, len); 31 | } 32 | #endif 33 | 34 | static int wb_set_blocking(webby_socket_t socket, int blocking) 35 | { 36 | u_long val = !blocking; 37 | return ioctlsocket(socket, FIONBIO, &val); 38 | } 39 | 40 | static int wb_valid_socket(webby_socket_t socket) 41 | { 42 | return INVALID_SOCKET != socket; 43 | } 44 | 45 | static void wb_close_socket(webby_socket_t socket) 46 | { 47 | closesocket(socket); 48 | } 49 | 50 | static int wb_is_blocking_error(int error) 51 | { 52 | return WSAEWOULDBLOCK == error; 53 | } 54 | -------------------------------------------------------------------------------- /Source/HLEGraphics/ConvertImage.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef HLEGRAPHICS_CONVERTIMAGE_H_ 21 | #define HLEGRAPHICS_CONVERTIMAGE_H_ 22 | 23 | #include "Graphics/TextureFormat.h" 24 | 25 | struct TextureInfo; 26 | struct NativePf8888; 27 | 28 | bool ConvertTexture(const TextureInfo & ti, 29 | void * texels, 30 | NativePf8888 * palette, 31 | ETextureFormat texture_format, 32 | u32 pitch); 33 | 34 | #endif // HLEGRAPHICS_CONVERTIMAGE_H_ 35 | -------------------------------------------------------------------------------- /Source/UI/MainMenuScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_MAINMENUSCREEN_H_ 22 | #define UI_MAINMENUSCREEN_H_ 23 | 24 | class CUIContext; 25 | 26 | class CMainMenuScreen 27 | { 28 | public: 29 | virtual ~CMainMenuScreen(); 30 | 31 | static std::unique_ptr Create( CUIContext * p_context ); 32 | 33 | virtual void Run() = 0; 34 | }; 35 | 36 | void DisplayRomsAndChoose(bool show_splash); 37 | 38 | #endif // UI_MAINMENUSCREEN_H_ 39 | -------------------------------------------------------------------------------- /Source/SysCTR/UI/UserInterface.cpp: -------------------------------------------------------------------------------- 1 | #include <3ds.h> 2 | #include 3 | #include 4 | 5 | #include "UserInterface.h" 6 | 7 | //Loads the font 8 | void UI::Initialize() 9 | { 10 | // Setup Dear ImGui context 11 | ImGui::CreateContext(); 12 | ImGuiIO &io = ImGui::GetIO(); 13 | 14 | io.Fonts->AddFontFromFileTTF("romfs:/Roboto-Medium.ttf", 14); 15 | // Setup Platform/Renderer bindings 16 | ImGui_Impl3DS_Init(); 17 | ImGui_ImplOpenGL2_Init(); 18 | 19 | ImGui::StyleCustomDark(); 20 | 21 | ImGui::GetStyle().WindowRounding = 0.0f; 22 | } 23 | 24 | void UI::RestoreRenderState() 25 | { 26 | pglSelectScreen(GFX_BOTTOM, GFX_LEFT); 27 | 28 | glClearColor(0.0f, 0.0f, 0.0f, 1.0f); 29 | 30 | glViewport(0,0,320,240); 31 | 32 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 33 | 34 | glEnable(GL_BLEND); 35 | 36 | glDisable(GL_CULL_FACE); 37 | glDisable(GL_ALPHA_TEST); 38 | glDisable(GL_DEPTH_TEST); 39 | glDisable(GL_SCISSOR_TEST); 40 | glDisable(GL_FOG); 41 | 42 | glEnable(GL_TEXTURE_2D); 43 | glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 44 | 45 | glMatrixMode(GL_PROJECTION); 46 | glOrtho(0, 320, 240, 0, -1, 1); 47 | 48 | glMatrixMode(GL_MODELVIEW); 49 | glLoadIdentity(); 50 | } -------------------------------------------------------------------------------- /Source/UI/AboutComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_ABOUTCOMPONENT_H_ 22 | #define UI_ABOUTCOMPONENT_H_ 23 | 24 | #include "UIComponent.h" 25 | 26 | class CAboutComponent : public CUIComponent 27 | { 28 | public: 29 | CAboutComponent( CUIContext * p_context ); 30 | virtual ~CAboutComponent(); 31 | static CAboutComponent * Create( CUIContext * p_context ); 32 | }; 33 | 34 | 35 | #endif // UI_ABOUTCOMPONENT_H_ 36 | -------------------------------------------------------------------------------- /Source/UI/AdjustDeadzoneScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_ADJUSTDEADZONESCREEN_H_ 22 | #define UI_ADJUSTDEADZONESCREEN_H_ 23 | 24 | class CUIContext; 25 | 26 | class CAdjustDeadzoneScreen 27 | { 28 | public: 29 | virtual ~CAdjustDeadzoneScreen(); 30 | 31 | static CAdjustDeadzoneScreen * Create( CUIContext * p_context ); 32 | 33 | virtual void Run() = 0; 34 | }; 35 | 36 | #endif // UI_ADJUSTDEADZONESCREEN_H_ 37 | -------------------------------------------------------------------------------- /Source/HLEGraphics/DisplayListDebugger.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2006 StrmnNrmn 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #pragma once 22 | 23 | #ifndef HLEGRAPHICS_DISPLAYLISTDEBUGGER_H_ 24 | #define HLEGRAPHICS_DISPLAYLISTDEBUGGER_H_ 25 | 26 | #ifdef DAEDALUS_DEBUG_DISPLAYLIST 27 | bool DLDebugger_IsDebugging(void); 28 | void DLDebugger_RequestDebug(); 29 | bool DLDebugger_Process(void); 30 | 31 | bool DLDebugger_RegisterWebDebug(void); 32 | #endif 33 | 34 | #endif // HLEGRAPHICS_DISPLAYLISTDEBUGGER_H_ 35 | -------------------------------------------------------------------------------- /Source/System/SystemInit.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 Howard Su (howard0su@gmail.com) 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | #include 22 | // Initialize the whole system 23 | bool System_Init(); 24 | 25 | // Open a ROM. After this call, you can call CPU_Run safely. 26 | bool System_Open(const std::filesystem::path &filename); 27 | 28 | // Close the ROM and cleanup the resources 29 | void System_Close(); 30 | 31 | // Finalize the whole system 32 | void System_Finalize(); 33 | 34 | -------------------------------------------------------------------------------- /Source/Utility/Timer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_TIMER_H_ 21 | #define UTILITY_TIMER_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | class CTimer 26 | { 27 | public: 28 | CTimer(); 29 | 30 | float GetElapsedSecondsSinceReset(); 31 | float GetElapsedSeconds(); 32 | void Reset(); 33 | 34 | private: 35 | u64 mResetTime; 36 | u64 mLastTime; 37 | f32 mFreqInv; 38 | }; 39 | 40 | #endif // UTILITY_TIMER_H_ 41 | 42 | -------------------------------------------------------------------------------- /Source/SysPSP/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_subdirectory(Debug) 2 | add_subdirectory(Graphics) 3 | add_subdirectory(HLEGraphics) 4 | add_subdirectory(PRX) 5 | add_subdirectory(Utility) 6 | 7 | # Create and install Plugin files 8 | 9 | install(DIRECTORY DESTINATION DaedalusX64/Plugins) 10 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/PRX/MediaEngine/mediaengine.prx DESTINATION DaedalusX64/Plugins) 11 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/PRX/DveMgr/dvemgr.prx DESTINATION DaedalusX64/Plugins) 12 | install(FILES ${CMAKE_CURRENT_SOURCE_DIR}//PRX/ExceptionHandler/exception.prx DESTINATION DaedalusX64/Plugins) 13 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../EBOOT.PBP DESTINATION DaedalusX64) 14 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/../daedalus.prx DESTINATION DaedalusX64) # in the CI Build this is deleted 15 | 16 | list(APPEND daed_libs) 17 | set(daed_libs ${daed_libs} PARENT_SCOPE) 18 | 19 | if(DAEDALUS_SDL) 20 | list(APPEND sys_libraries pspkubridge pspfpu pspdebug SDL2_ttf freetype harfbuzz bz2) 21 | else() 22 | list(APPEND sys_libraries intrafont pspkubridge pspfpu pspdebug pspgu pspge pspaudio pspaudiolib psppower pspctrl pspdisplay) 23 | endif() 24 | set(sys_libraries ${sys_libraries} PARENT_SCOPE) 25 | 26 | set(plat_main SysPSP/main.cpp PARENT_SCOPE) 27 | -------------------------------------------------------------------------------- /Source/SysPSP/HLEGraphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(HLEGraphics_PSP OBJECT 2 | Blender.cpp 3 | BlendModes.cpp 4 | ColourAdjuster.cpp 5 | ConvertVertices.S 6 | DisplayListDebugger.cpp 7 | GraphicsPluginPSP.cpp 8 | RendererPSP.cpp 9 | TnLVFPU.S 10 | TransformWithColour.S 11 | TransformWithLighting.S 12 | VectorClipping.S 13 | 14 | Combiner/BlendConstant.cpp 15 | Combiner/CombinerExpression.cpp 16 | Combiner/CombinerTree.cpp 17 | Combiner/RenderSettings.cpp 18 | ) 19 | 20 | if(DAEDALUS_PROFILE_HLEGRAPHICS_PSP) 21 | target_compile_options(HLEGraphics_PSP PRIVATE -pg) 22 | endif(DAEDALUS_PROFILE_HLEGRAPHICS_PSP) 23 | 24 | list(APPEND daed_libs "HLEGraphics_PSP") 25 | set(daed_libs ${daed_libs} PARENT_SCOPE) 26 | -------------------------------------------------------------------------------- /Source/Ultra/ultra_mbi.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef OSHLE_ULTRA_MBI_H_ 21 | #define OSHLE_ULTRA_MBI_H_ 22 | 23 | #define M_GFXTASK 1 24 | #define M_AUDTASK 2 25 | #define M_VIDTASK 3 26 | #define M_JPGTASK 4 27 | #define M_FBTASK 7 28 | 29 | #define NUM_SEGMENTS (16) 30 | #define SEGMENT_OFFSET(a) ((unsigned int)(a) & 0x00ffffff) 31 | #define SEGMENT_NUMBER(a) ((unsigned int)(a) >> 24) 32 | #define SEGMENT_ADDR(num, off) (((num) << 24) + (off)) 33 | 34 | 35 | #endif // OSHLE_ULTRA_MBI_H_ 36 | -------------------------------------------------------------------------------- /Source/HLEGraphics/DLParser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef HLEGRAPHICS_DLPARSER_H_ 22 | #define HLEGRAPHICS_DLPARSER_H_ 23 | 24 | #include 25 | 26 | #include "Base/Types.h" 27 | 28 | class DLDebugOutput; 29 | 30 | bool DLParser_Initialise(); 31 | void DLParser_Finalise(); 32 | 33 | const u32 kUnlimitedInstructionCount = u32( ~0 ); 34 | u32 DLParser_Process(u32 instruction_limit = kUnlimitedInstructionCount, DLDebugOutput * debug_output = nullptr); 35 | 36 | #endif // HLEGRAPHICS_DLPARSER_H_ 37 | -------------------------------------------------------------------------------- /Source/RomFile/RomFileMemory.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UTILITY_ROMFILEMEMORY_H_ 22 | #define UTILITY_ROMFILEMEMORY_H_ 23 | 24 | #include "Base/Types.h" 25 | #include "Base/Singleton.h" 26 | 27 | class CROMFileMemory : public CSingleton< CROMFileMemory > 28 | { 29 | public: 30 | virtual ~CROMFileMemory(); 31 | 32 | // virtual bool IsAvailable() = 0; 33 | virtual void * Alloc( u32 size ) = 0; 34 | virtual void Free( void * ptr ) = 0; 35 | }; 36 | 37 | 38 | #endif // UTILITY_ROMFILEMEMORY_H_ 39 | -------------------------------------------------------------------------------- /Source/UI/RomPreferencesScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_ROMPREFERENCESSCREEN_H_ 22 | #define UI_ROMPREFERENCESSCREEN_H_ 23 | 24 | class CUIContext; 25 | class RomID; 26 | 27 | class CRomPreferencesScreen 28 | { 29 | public: 30 | virtual ~CRomPreferencesScreen(); 31 | 32 | static std::unique_ptr Create( CUIContext * p_context, const RomID & rom_id ); 33 | 34 | virtual void Run() = 0; 35 | }; 36 | 37 | #endif // UI_ROMPREFERENCESSCREEN_H_ 38 | -------------------------------------------------------------------------------- /Source/System/Endian.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2008 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UTILITY_ENDIAN_H_ 22 | #define UTILITY_ENDIAN_H_ 23 | #include "Base/Types.h" 24 | #include 25 | #include 26 | 27 | constexpr bool is_big_endian = std::endian::native == std::endian::big; 28 | 29 | constexpr auto U8_TWIDDLE = is_big_endian ? 0x0 : 0x3; 30 | constexpr auto U16_TWIDDLE = is_big_endian ? 0x0 : 0x2; 31 | constexpr auto U16H_TWIDDLE = is_big_endian ? 0x0 : 0x1; 32 | 33 | 34 | #define BSWAP32(x) std::byteswap(x) 35 | #endif // UTILITY_ENDIAN_H_ 36 | -------------------------------------------------------------------------------- /Source/UI/GlobalSettingsComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_GLOBALSETTINGSCOMPONENT_H_ 22 | #define UI_GLOBALSETTINGSCOMPONENT_H_ 23 | 24 | #include "UIComponent.h" 25 | 26 | class CGlobalSettingsComponent : public CUIComponent 27 | { 28 | public: 29 | CGlobalSettingsComponent( CUIContext * p_context ); 30 | virtual ~CGlobalSettingsComponent(); 31 | 32 | static CGlobalSettingsComponent * Create( CUIContext * p_context ); 33 | }; 34 | 35 | #endif // UI_GLOBALSETTINGSCOMPONENT_H_ 36 | -------------------------------------------------------------------------------- /Source/UI/CheatOptionsScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_CHEATOPTIONSSCREEN_H_ 22 | #define UI_CHEATOPTIONSSCREEN_H_ 23 | 24 | #include 25 | 26 | class CUIContext; 27 | class RomID; 28 | 29 | class CCheatOptionsScreen 30 | { 31 | public: 32 | virtual ~CCheatOptionsScreen(); 33 | 34 | static std::unique_ptr Create( CUIContext * p_context, const RomID & rom_id ); 35 | 36 | virtual void Run() = 0; 37 | }; 38 | 39 | #endif // UI_CHEATOPTIONSSCREEN_H_ 40 | -------------------------------------------------------------------------------- /Source/Interface/SaveState.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001 Lkb 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #pragma once 22 | 23 | #ifndef CORE_SAVESTATE_H_ 24 | #define CORE_SAVESTATE_H_ 25 | 26 | #include "Utility/Paths.h" 27 | 28 | class RomID; 29 | 30 | bool SaveState_LoadFromFile( const std::filesystem::path &filename ); 31 | bool SaveState_SaveToFile( const std::filesystem::path &filename ); 32 | RomID SaveState_GetRomID( const std::filesystem::path &filename ); 33 | const std::string SaveState_GetRom(const std::filesystem::path &filename); 34 | 35 | #endif // CORE_SAVESTATE_H_ 36 | -------------------------------------------------------------------------------- /Source/Core/RDRam.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2020 Rinnegatamante 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef RDRAM_H_ 23 | #define RDRAM_H_ 24 | 25 | 26 | 27 | /* RDRam operations */ 28 | void rdram_read_many_u8(u8 *dst, u32 address, u32 count); 29 | void rdram_read_many_u16(u16 *dst, u32 address, u32 count); 30 | void rdram_write_many_u16(const u16 *src, u32 address, u32 count); 31 | u32 rdram_read_u32(u32 address); 32 | void rdram_write_many_u32(const u32 *src, u32 address, u32 count); 33 | void rdram_read_many_u32(u32 *dst, u32 address, u32 count); 34 | 35 | #endif // CORE_MEMORY_H_ 36 | -------------------------------------------------------------------------------- /Source/System/Timing/CTR/Timing.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include "System/Timing/Timing.h" 22 | 23 | #include <3ds.h> 24 | 25 | #define TICKS_PER_SEC 268123480.0 26 | 27 | namespace NTiming { 28 | 29 | bool GetPreciseFrequency( u64 * p_freq ) 30 | { 31 | *p_freq = TICKS_PER_SEC; 32 | return true; 33 | } 34 | 35 | bool GetPreciseTime( u64 * p_time ) 36 | { 37 | *p_time = svcGetSystemTick(); 38 | return true; 39 | } 40 | 41 | u64 ToMilliseconds( u64 ticks ) 42 | { 43 | //? 44 | return (ticks * 1000 * 1000) / TICKS_PER_SEC; 45 | } 46 | 47 | } // NTiming -------------------------------------------------------------------------------- /Source/UI/AdvancedOptionsScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_ADVANCEDOPTIONSSCREEN_H_ 22 | #define UI_ADVANCEDOPTIONSSCREEN_H_ 23 | 24 | #include 25 | 26 | class CUIContext; 27 | class RomID; 28 | 29 | class CAdvancedOptionsScreen 30 | { 31 | public: 32 | virtual ~CAdvancedOptionsScreen(); 33 | 34 | static std::unique_ptr Create( CUIContext * p_context, const RomID & rom_id ); 35 | 36 | virtual void Run() = 0; 37 | }; 38 | 39 | #endif // UI_ADVANCEDOPTIONSSCREEN_H_ 40 | -------------------------------------------------------------------------------- /Source/DynaRec/x86/DynarecTargetX86.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001,2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef SYSW32_DYNAREC_X86_DYNARECTARGETX86_H_ 23 | #define SYSW32_DYNAREC_X86_DYNARECTARGETX86_H_ 24 | 25 | // Intel register codes. Odd ordering is for intel bytecode 26 | enum EIntelReg { 27 | INVALID_CODE = 0xFFFFFFFF, 28 | EAX_CODE = 0, 29 | ECX_CODE = 1, 30 | EDX_CODE = 2, 31 | EBX_CODE = 3, 32 | ESP_CODE = 4, 33 | EBP_CODE = 5, 34 | ESI_CODE = 6, 35 | EDI_CODE = 7, 36 | 37 | NUM_X86_REGISTERS = 8, 38 | }; 39 | 40 | 41 | #endif // SYSW32_DYNAREC_X86_DYNARECTARGETX86_H_ 42 | -------------------------------------------------------------------------------- /Source/Utility/FastMemcpy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef UTILITY_FASTMEMCPY_H_ 3 | #define UTILITY_FASTMEMCPY_H_ 4 | 5 | #include 6 | #include 7 | 8 | //#define PROFILE_MEMCPY 9 | 10 | #ifdef PROFILE_MEMCPY 11 | void memcpy_test( void * dst, const void * src, size_t size ); 12 | #endif 13 | 14 | void memcpy_byteswap( void* dst, const void* src, size_t size ); // Little endian, platform independent, ALWAYS swaps. 15 | 16 | // memcpy_swizzle is just a regular memcpy on big-endian targets. 17 | #ifdef DAEDALUS_ENDIAN_BIG 18 | #define memcpy_swizzle memcpy 19 | #elif DAEDALUS_ENDIAN_LITTLE 20 | #define memcpy_swizzle memcpy_byteswap 21 | #else 22 | #error No DAEDALUS_ENDIAN_MODE specified 23 | #endif 24 | 25 | 26 | // The PSP build defines fast versions of memcpy/memcpy_swizzle. 27 | #ifdef DAEDALUS_PSP 28 | 29 | void memcpy_vfpu( void* dst, const void* src, size_t size ); 30 | void memcpy_vfpu_byteswap( void* dst, const void* src, size_t size ); 31 | 32 | #define fast_memcpy memcpy_vfpu 33 | #define fast_memcpy_swizzle memcpy_vfpu_byteswap 34 | 35 | #else // DAEDALUS_PSP 36 | 37 | // Just use regular memcpy/memcpy_swizzle. 38 | #define fast_memcpy memcpy 39 | #define fast_memcpy_swizzle memcpy_swizzle 40 | 41 | #endif // DAEDALUS_PSP 42 | 43 | 44 | #endif // UTILITY_FASTMEMCPY_H_ 45 | -------------------------------------------------------------------------------- /Source/UI/RomSelectorComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_ROMSELECTORCOMPONENT_H_ 22 | #define UI_ROMSELECTORCOMPONENT_H_ 23 | 24 | #include "UIComponent.h" 25 | #include 26 | 27 | class CRomSelectorComponent : public CUIComponent 28 | { 29 | public: 30 | CRomSelectorComponent( CUIContext * p_context ); 31 | virtual ~CRomSelectorComponent(); 32 | 33 | static CRomSelectorComponent * Create( CUIContext * p_context, std::function on_rom_selected ); 34 | }; 35 | 36 | #endif // UI_ROMSELECTORCOMPONENT_H_ 37 | -------------------------------------------------------------------------------- /Source/System/SpinLock.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef UTILITY_SPINLOCK_H_ 23 | #define UTILITY_SPINLOCK_H_ 24 | 25 | #include "System/Thread/Thread.h" 26 | 27 | class CSpinLock 28 | { 29 | public: 30 | inline explicit CSpinLock( volatile u32 * var ) : Var( var ) 31 | { 32 | // N.B. - this probably needs to use a CAS to prevent race conditions 33 | while( *Var != 0 ) 34 | { 35 | ThreadYield(); 36 | } 37 | *Var = 1; 38 | } 39 | 40 | inline ~CSpinLock() 41 | { 42 | *Var = 0; 43 | } 44 | 45 | private: 46 | volatile u32 * Var; 47 | }; 48 | 49 | #endif // UTILITY_SPINLOCK_H_ 50 | -------------------------------------------------------------------------------- /Source/UI/PauseOptionsComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_PAUSEOPTIONSCOMPONENT_H_ 22 | #define UI_PAUSEOPTIONSCOMPONENT_H_ 23 | 24 | #include "UIComponent.h" 25 | #include 26 | 27 | 28 | class CPauseOptionsComponent : public CUIComponent 29 | { 30 | public: 31 | CPauseOptionsComponent( CUIContext * p_context ); 32 | virtual ~CPauseOptionsComponent(); 33 | 34 | static CPauseOptionsComponent * Create( CUIContext * p_context, std::function on_resume, std::function on_reset); 35 | }; 36 | 37 | #endif // UI_PAUSEOPTIONSCOMPONENT_H_ 38 | -------------------------------------------------------------------------------- /Source/Core/RSP_HLE.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef CORE_RSP_HLE_H_ 23 | #define CORE_RSP_HLE_H_ 24 | 25 | #include "Core/Memory.h" 26 | 27 | // Returns true if the rsp is running either LLE or HLE 28 | inline bool RSP_IsRunning(){ return (Memory_SP_GetRegister( SP_STATUS_REG ) & SP_STATUS_HALT) == 0; } 29 | 30 | enum EProcessResult 31 | { 32 | PR_NOT_STARTED, // Couldn't start 33 | PR_STARTED, // Was started asynchronously, active 34 | PR_COMPLETED, // Was processed synchronously, completed 35 | }; 36 | 37 | void RSP_HLE_Reset(); 38 | void RSP_HLE_ProcessTask(); 39 | 40 | #endif // CORE_RSP_HLE_H_ 41 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/MediaEngine/me.h: -------------------------------------------------------------------------------- 1 | #ifndef me_h 2 | #define me_h 3 | 4 | #include 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | struct me_struct 12 | { 13 | int start; 14 | int done; 15 | int (*func)(int); // function ptr - func takes an int argument and returns int 16 | int param; // function argument 17 | int result; // function return value 18 | int precache_len; // amount of space to invalidate before running func, -1 = all 19 | void *precache_addr; // address of space to invalidate before running func 20 | int postcache_len; // amount of space to flush after running func, -1 = all 21 | void *postcache_addr; // address of space to flush after running func 22 | unsigned int signals; 23 | int init; 24 | }; 25 | 26 | int InitME(volatile struct me_struct *mei ); 27 | void KillME(volatile struct me_struct *mei ); 28 | int CallME(volatile struct me_struct *mei, int func, int param, int prelen, void *preadr, int postlen, void *postadr); 29 | int WaitME(volatile struct me_struct *mei); 30 | int BeginME(volatile struct me_struct *mei, int func, int param, int prelen, void *preadr, int postlen, void *postadr); 31 | int CheckME(volatile struct me_struct *mei); 32 | unsigned int SignalME(volatile struct me_struct *mei, unsigned int sigmask, unsigned int sigset); 33 | 34 | #ifdef __cplusplus 35 | } 36 | #endif 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Source/OSHLE/OS.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef OSHLE_OS_H_ 21 | #define OSHLE_OS_H_ 22 | 23 | #include "OSHLE/patch.h" 24 | #include "OSHLE/patch_symbols.h" 25 | 26 | #include 27 | 28 | #define DAED_OS_MESSAGE_QUEUES 29 | 30 | #ifdef DUMPOSFUNCTIONS 31 | #ifdef DAED_OS_MESSAGE_QUEUES 32 | using QueueVector = std::vector < u32 > 33 | extern QueueVector g_MessageQueues; 34 | #endif 35 | #endif 36 | 37 | void OS_Reset(); 38 | 39 | u32 OS_HLE___osProbeTLB(u32 vaddr); 40 | 41 | #ifdef DAED_OS_MESSAGE_QUEUES 42 | void OS_HLE_osCreateMesgQueue(u32 queue, u32 msgBuffer, u32 msgCount); 43 | #endif 44 | 45 | #endif // OSHLE_OS_H_ 46 | -------------------------------------------------------------------------------- /Source/UI/ColourPulser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_COLOURPULSER_H_ 22 | #define UI_COLOURPULSER_H_ 23 | 24 | #include "Graphics/ColourValue.h" 25 | 26 | class CColourPulser 27 | { 28 | public: 29 | CColourPulser( c32 dim_colour, c32 bright_colour, u32 cycle_period ); 30 | ~CColourPulser(); 31 | 32 | void Update( u32 elapsed_ms ); 33 | c32 GetCurrentColour() const { return mCurrentColour; } 34 | 35 | private: 36 | u32 mTimeCounter; 37 | u32 mCyclePeriod; 38 | c32 mDimColour; 39 | c32 mBrightColour; 40 | 41 | c32 mCurrentColour; 42 | }; 43 | 44 | #endif // UI_COLOURPULSER_H_ 45 | -------------------------------------------------------------------------------- /Source/Core/PIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef CORE_PIF_H_ 23 | #define CORE_PIF_H_ 24 | 25 | #include "Base/Singleton.h" 26 | 27 | // XXXX GCC 28 | //enum ESaveType; 29 | //#include "ROM.h" 30 | 31 | class CController : public CSingleton< CController > 32 | { 33 | public: 34 | virtual ~CController() {} 35 | 36 | virtual bool OnRomOpen() = 0; 37 | virtual void OnRomClose() = 0; 38 | 39 | virtual void Process() = 0; 40 | 41 | static bool Reset() { return CController::Get()->OnRomOpen(); } 42 | static void RomClose() { CController::Get()->OnRomClose(); } 43 | }; 44 | 45 | #endif // CORE_PIF_H_ 46 | -------------------------------------------------------------------------------- /Source/Core/DMA.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001 NAME 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef CORE_DMA_H_ 22 | #define CORE_DMA_H_ 23 | 24 | #include "Base/Types.h" 25 | 26 | void DMA_PI_CopyToRDRAM(); 27 | void DMA_PI_CopyFromRDRAM(); 28 | 29 | void DMA_SP_CopyToRDRAM(); 30 | void DMA_SP_CopyFromRDRAM(); 31 | 32 | void DMA_SI_CopyFromDRAM(); 33 | void DMA_SI_CopyToDRAM(); 34 | 35 | bool DMA_HandleTransfer( u8 * p_dst, u32 dst_offset, u32 dst_size, const u8 * p_src, u32 src_offset, u32 src_size, u32 length ); 36 | bool DMA_FLASH_CopyToDRAM(u32 dest, u32 StartOffset, u32 len); 37 | bool DMA_FLASH_CopyFromDRAM(u32 dest, u32 len); 38 | 39 | extern bool gDMAUsed; 40 | 41 | 42 | #endif // CORE_DMA_H_ 43 | -------------------------------------------------------------------------------- /Source/HLEGraphics/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(HLEGraphics OBJECT 2 | BaseRenderer.cpp 3 | CachedTexture.cpp 4 | ConvertImage.cpp 5 | ConvertTile.cpp 6 | DLDebug.cpp 7 | DLParser.cpp 8 | Microcode.cpp 9 | RDP.cpp 10 | RDPStateManager.cpp 11 | TextureCache.cpp 12 | TextureInfo.cpp 13 | TMEM.cpp 14 | uCodes/Ucode.cpp 15 | 16 | ) 17 | 18 | if(DAEDALUS_GL) 19 | 20 | message(STATUS "Building HLEGraphics with OpenGL support: ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS}") 21 | target_include_directories(HLEGraphics PUBLIC ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS}) 22 | endif(DAEDALUS_GL) 23 | 24 | if(DAEDALUS_GLES) 25 | message(STATUS "Building HLEGraphics with OpenGLES support: ${OPENGLES_INCLUDE_DIR} ") 26 | target_include_directories(HLEGraphics PUBLIC ${OPENGLES_INCLUDE_DIR}) 27 | endif(DAEDALUS_GLES) 28 | 29 | if(DAEDALUS_PROFILE_HLEGRAPHICS) 30 | target_compile_options(HLEGraphics PRIVATE -pg) 31 | endif(DAEDALUS_PROFILE_HLEGRAPHICS) 32 | 33 | list(APPEND daed_libs "HLEGraphics") 34 | set(daed_libs ${daed_libs} PARENT_SCOPE) 35 | -------------------------------------------------------------------------------- /Source/SysPSP/Graphics/VideoMemoryManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef SYSPSP_GRAPHICS_VIDEOMEMORYMANAGER_H_ 22 | #define SYSPSP_GRAPHICS_VIDEOMEMORYMANAGER_H_ 23 | 24 | #include "Base/Types.h" 25 | #include "Base/Singleton.h" 26 | 27 | class CVideoMemoryManager : public CSingleton< CVideoMemoryManager > 28 | { 29 | public: 30 | virtual ~CVideoMemoryManager(); 31 | 32 | virtual bool Alloc( u32 size, void ** data, bool * isvidmem ) = 0; 33 | virtual void Free( void * ptr ) = 0; 34 | #ifdef DAEDALUS_DEBUG_MEMORY 35 | virtual void DisplayDebugInfo() = 0; 36 | #endif 37 | }; 38 | 39 | 40 | #endif // SYSPSP_GRAPHICS_VIDEOMEMORYMANAGER_H_ 41 | -------------------------------------------------------------------------------- /Source/SysCTR/Debug/DaedalusAssertCTR.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2001 StrmnNrmn 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | 22 | 23 | #include 24 | #include "Base/Assert.h" 25 | 26 | #ifdef DAEDALUS_ENABLE_ASSERTS 27 | 28 | EAssertResult DaedalusAssert(const char * expression, const char * file, unsigned int line, const char * msg, ...); 29 | 30 | DaedalusAssertHook gAssertHook = &DaedalusAssert; 31 | // 32 | // Return -1 to ignore once, 0 to ignore permenantly, 1 to break 33 | // 34 | EAssertResult DaedalusAssert(const char * expression, const char * file, unsigned int line, const char * msg, ...) 35 | { 36 | return AR_BREAK; 37 | } 38 | 39 | #endif //DAEDALUS_ENABLE_ASSERTS 40 | -------------------------------------------------------------------------------- /Source/SysCTR/HLEGraphics/BlendModes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #include "Graphics/ColourValue.h" 23 | #include "SysCTR/HLEGraphics/ColourAdjuster.h" 24 | 25 | struct SBlendModeDetails 26 | { 27 | c32 EnvColour; 28 | c32 PrimColour; 29 | 30 | bool InstallTexture; 31 | CColourAdjuster ColourAdjuster; 32 | }; 33 | 34 | #define BLEND_MODE_ARGS SBlendModeDetails & details 35 | 36 | typedef void (*OverrideBlendModeFn)( BLEND_MODE_ARGS ); 37 | 38 | bool IsInexactDefault( OverrideBlendModeFn Fn ); 39 | OverrideBlendModeFn LookupOverrideBlendModeInexact( u64 mux ); 40 | OverrideBlendModeFn LookupOverrideBlendModeForced( u64 mux ); 41 | -------------------------------------------------------------------------------- /Source/System/Timing/Posix/Timing.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #include "System/Timing/Timing.h" 21 | 22 | #include 23 | 24 | namespace NTiming { 25 | bool GetPreciseFrequency( u64 * p_freq ) 26 | { 27 | *p_freq = 1 * 1000 * 1000; // Microseconds 28 | return true; 29 | } 30 | 31 | bool GetPreciseTime( u64 * p_time ) 32 | { 33 | timeval tv; 34 | if(::gettimeofday( &tv, NULL ) == 0) 35 | { 36 | *p_time = u64(tv.tv_sec) * 1000000LL + u64(tv.tv_usec); 37 | return true; 38 | } 39 | 40 | *p_time = 0; 41 | return false; 42 | } 43 | 44 | u64 ToMilliseconds( u64 ticks ) 45 | { 46 | return (ticks*1000LL) / 1000000LL; 47 | } 48 | 49 | } // NTiming 50 | 51 | -------------------------------------------------------------------------------- /Source/UI/UIScreen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_UISCREEN_H_ 22 | #define UI_UISCREEN_H_ 23 | 24 | #include "Base/Types.h" 25 | 26 | class v2; 27 | class c32; 28 | class CUIContext; 29 | class CUIComponent; 30 | 31 | class CUIScreen 32 | { 33 | public: 34 | CUIScreen( CUIContext * p_context ); 35 | virtual ~CUIScreen(); 36 | 37 | virtual void Update( float elapsed_time, const glm::vec2 & stick, u32 old_buttons, u32 new_buttons ) = 0; 38 | virtual void Render() = 0; 39 | virtual bool IsFinished() const = 0; 40 | 41 | void Run(); 42 | 43 | protected: 44 | CUIContext * mpContext; 45 | 46 | }; 47 | 48 | #endif // UI_UISCREEN_H_ 49 | -------------------------------------------------------------------------------- /Source/HLEGraphics/TMEM.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006,2007 StrmnNrmn 3 | This program is free software; you can redistribute it and/or 4 | modify it under the terms of the GNU General Public License 5 | as published by the Free Software Foundation; either version 2 6 | of the License, or (at your option) any later version. 7 | This program is distributed in the hope that it will be useful, 8 | but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 | GNU General Public License for more details. 11 | You should have received a copy of the GNU General Public License 12 | along with this program; if not, write to the Free Software 13 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 14 | */ 15 | 16 | #ifndef HLEGRAPHICS_TMEM_H_ 17 | #define HLEGRAPHICS_TMEM_H_ 18 | 19 | #ifdef DAEDALUS_ACCURATE_TMEM 20 | 21 | void CopyLineQwords(void * dst, const void * src, u32 qwords); 22 | void CopyLineQwordsSwap(void * dst, const void * src, u32 qwords); 23 | void CopyLineQwordsSwap32(void * dst, const void * src, u32 qwords); 24 | void CopyLine(void * dst, const void * src, u32 bytes); 25 | void CopyLine16(u16 * dst16, const u16 * src16, u32 words); 26 | void CopyLineSwap(void * dst, const void * src, u32 bytes); 27 | void CopyLineSwap32(void * dst, const void * src, u32 bytes); 28 | 29 | #endif // DAEDALUS_ACCURATE_TMEM 30 | 31 | #endif // HLEGRAPHICS_TMEM_H_ -------------------------------------------------------------------------------- /Source/UI/SelectedRomComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_SELECTEDROMCOMPONENT_H_ 22 | #define UI_SELECTEDROMCOMPONENT_H_ 23 | 24 | #include "UIComponent.h" 25 | #include 26 | 27 | class RomID; 28 | 29 | class CSelectedRomComponent : public CUIComponent 30 | { 31 | public: 32 | CSelectedRomComponent( CUIContext * p_context ); 33 | virtual ~CSelectedRomComponent(); 34 | 35 | static CSelectedRomComponent * Create( CUIContext * p_context, std::function on_start_emulation ); 36 | 37 | virtual void SetRomID( const RomID & rom_id ) = 0; 38 | }; 39 | 40 | #endif // UI_SELECTEDROMCOMPONENT_H_ 41 | -------------------------------------------------------------------------------- /Source/third_party/webby/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012, Andreas Fredriksson 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | 7 | 1. Redistributions of source code must retain the above copyright notice, this 8 | list of conditions and the following disclaimer. 9 | 2. Redistributions in binary form must reproduce the above copyright notice, 10 | this list of conditions and the following disclaimer in the documentation 11 | and/or other materials provided with the distribution. 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 14 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 15 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 16 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 17 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 18 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 19 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 20 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 22 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | -------------------------------------------------------------------------------- /Source/System/Timing/PSP/Timing.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include 22 | #include 23 | 24 | #include "System/Timing/Timing.h" 25 | 26 | namespace NTiming { 27 | 28 | bool GetPreciseFrequency( u64 * p_freq ) 29 | { 30 | *p_freq = ::sceRtcGetTickResolution(); 31 | return true; 32 | } 33 | 34 | bool GetPreciseTime( u64 * p_time ) 35 | { 36 | if(::sceRtcGetCurrentTick( p_time ) == 0) 37 | { 38 | return true; 39 | } 40 | 41 | *p_time = 0; 42 | return false; 43 | } 44 | 45 | u64 ToMilliseconds( u64 ticks ) 46 | { 47 | static u64 tick_resolution = sceRtcGetTickResolution(); 48 | return (ticks*1000LL) / tick_resolution; 49 | } 50 | 51 | } // NTiming 52 | -------------------------------------------------------------------------------- /Source/DynaRec/CodeBufferManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef DYNAREC_CODEBUFFERMANAGER_H_ 21 | #define DYNAREC_CODEBUFFERMANAGER_H_ 22 | 23 | #include "Base/Types.h" 24 | #include 25 | 26 | class CCodeGenerator; 27 | 28 | class CCodeBufferManager 29 | { 30 | public: 31 | virtual ~CCodeBufferManager() {} 32 | virtual bool Initialise() = 0; 33 | virtual void Reset() = 0; 34 | virtual void Finalise() = 0; 35 | 36 | virtual std::shared_ptr StartNewBlock() = 0; 37 | virtual u32 FinaliseCurrentBlock() = 0; 38 | 39 | public: 40 | static std::shared_ptr Create(); 41 | }; 42 | 43 | 44 | #endif // DYNAREC_CODEBUFFERMANAGER_H_ 45 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/DveMgr/exports.c: -------------------------------------------------------------------------------- 1 | #include 2 | #define NULL ((void *) 0) 3 | 4 | extern int module_start; 5 | extern int module_stop; 6 | extern int module_info; 7 | static const unsigned int __syslib_exports[6] __attribute__((section(".rodata.sceResident"))) = { 8 | 0xD632ACDB, 9 | 0xCEE8593C, 10 | 0xF01D73A7, 11 | (unsigned int) &module_start, 12 | (unsigned int) &module_stop, 13 | (unsigned int) &module_info, 14 | }; 15 | 16 | extern int pspDveMgrCheckVideoOut; 17 | extern int pspDveMgrSetVideoOut; 18 | static const unsigned int __pspDveManager_exports[4] __attribute__((section(".rodata.sceResident"))) = { 19 | 0x2ACFCB6D, 20 | 0xF9C86C73, 21 | (unsigned int) &pspDveMgrCheckVideoOut, 22 | (unsigned int) &pspDveMgrSetVideoOut, 23 | }; 24 | 25 | extern int pspDveMgrCheckVideoOut; 26 | extern int pspDveMgrSetVideoOut; 27 | static const unsigned int __pspDveManager_driver_exports[4] __attribute__((section(".rodata.sceResident"))) = { 28 | 0x2ACFCB6D, 29 | 0xF9C86C73, 30 | (unsigned int) &pspDveMgrCheckVideoOut, 31 | (unsigned int) &pspDveMgrSetVideoOut, 32 | }; 33 | 34 | const struct _PspLibraryEntry __library_exports[3] __attribute__((section(".lib.ent"), used)) = { 35 | { NULL, 0x0000, 0x8000, 4, 1, 2, (unsigned int *) &__syslib_exports }, 36 | { "pspDveManager", 0x0000, 0x4001, 4, 0, 2, (unsigned int *) &__pspDveManager_exports }, 37 | { "pspDveManager_driver", 0x0000, 0x0001, 4, 0, 2, (unsigned int *) &__pspDveManager_driver_exports }, 38 | }; 39 | -------------------------------------------------------------------------------- /Source/Utility/FramerateLimiter.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_FRAMERATELIMITER_H_ 21 | #define UTILITY_FRAMERATELIMITER_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | extern u32 gSpeedSyncEnabled; 26 | 27 | bool FramerateLimiter_Reset(); 28 | void FramerateLimiter_Limit(); 29 | f32 FramerateLimiter_GetSync(); // Returns fraction of real n64 we're running at (1 = 100%) 30 | u32 FramerateLimiter_GetTvFrequencyHz(); 31 | 32 | // Override the sync function, e.g. if the audio plugin wants to control sync. 33 | using FramerateSyncFn = void (*)(void * arg); 34 | 35 | void FramerateLimiter_SetAuxillarySyncFunction(FramerateSyncFn fn, void * arg); 36 | 37 | #endif // UTILITY_FRAMERATELIMITER_H_ 38 | -------------------------------------------------------------------------------- /Source/HLEGraphics/GraphicsPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef PLUGINS_GRAPHICSPLUGIN_H_ 23 | #define PLUGINS_GRAPHICSPLUGIN_H_ 24 | 25 | class CGraphicsPlugin 26 | { 27 | public: 28 | virtual ~CGraphicsPlugin(); 29 | 30 | virtual bool StartEmulation() = 0; 31 | 32 | virtual void ViStatusChanged() = 0; 33 | virtual void ViWidthChanged() = 0; 34 | virtual void ProcessDList() = 0; 35 | 36 | virtual void UpdateScreen() = 0; 37 | 38 | virtual void RomClosed() = 0; 39 | }; 40 | 41 | // 42 | // This needs to be defined for all targets. 43 | // 44 | std::unique_ptr CreateGraphicsPlugin(); 45 | extern std::unique_ptr gGraphicsPlugin; 46 | 47 | #endif // PLUGINS_GRAPHICSPLUGIN_H_ 48 | -------------------------------------------------------------------------------- /Source/Core/R4300.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef CORE_R4300_H_ 21 | #define CORE_R4300_H_ 22 | 23 | #include "Core/R4300OpCode.h" 24 | #include "Core/R4300Instruction.h" 25 | 26 | void R4300_SetSR( u32 new_value ); 27 | 28 | extern CPU_Instruction R4300Instruction[64]; 29 | extern CPU_Instruction R4300Cop1DInstruction[64]; 30 | 31 | inline CPU_Instruction R4300_GetDInstructionHandler( OpCode op_code ) 32 | { 33 | return R4300Cop1DInstruction[ op_code.cop1_funct ]; 34 | } 35 | 36 | CPU_Instruction R4300_GetInstructionHandler( OpCode op_code ); 37 | bool R4300_InstructionHandlerNeedsPC( OpCode op_code ); 38 | inline void R4300_ExecuteInstruction( OpCode op_code ) 39 | { 40 | R4300Instruction[ op_code.op ]( op_code._u32 ); 41 | } 42 | 43 | #endif // CORE_R4300_H_ 44 | -------------------------------------------------------------------------------- /Source/Core/TLB.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2009 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #include "Base/Types.h" 23 | 24 | struct TLBEntry 25 | { 26 | public: 27 | u32 pagemask, hi, pfne, pfno; 28 | u32 mask, g; 29 | 30 | private: 31 | // For speed/convenience 32 | u32 mask2; // Mask, Mask/2 33 | u32 vpnmask, vpn2mask; // Vpn Mask, VPN/2 Mask 34 | u32 pfnohi, pfnehi; // Even/Odd highbits 35 | u32 checkbit; 36 | 37 | u32 addrcheck; // vpn2 & vpnmask 38 | 39 | static bool FindTLBEntry( u32 address, u32 * p_idx ); 40 | 41 | public: 42 | void UpdateValue(u32 _pagemask, u32 _hi, u32 _pfne, u32 _pfno); 43 | void Reset(); 44 | static u32 Translate(u32 address, bool& missing); 45 | }; 46 | 47 | // ALIGNED_EXTERN(TLBEntry, g_TLBs[32], CACHE_ALIGN); 48 | extern std::array g_TLBs; 49 | -------------------------------------------------------------------------------- /Source/SysPSP/Utility/DebugMemory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include "Base/Types.h" 22 | 23 | #include 24 | #include 25 | 26 | #include "Base/Types.h" 27 | 28 | //#define DAEDALUS_LOG_ALLOCATIONS 29 | 30 | // 31 | // In public releases, just use the standard memory allocators 32 | // 33 | #ifndef DAEDALUS_SILENT 34 | 35 | #if defined( DAEDALUS_LOG_ALLOCATIONS ) || defined( _DEBUG ) 36 | 37 | #define SAVE_RA( ra ) \ 38 | u32 ra {0}; \ 39 | asm volatile \ 40 | ( \ 41 | "sw $ra, %0\n" \ 42 | : "+m"(ra) : : "memory" \ 43 | ) 44 | 45 | #else 46 | 47 | #define SAVE_RA( ra ) static const u32 ra( 0 ) 48 | 49 | #endif 50 | 51 | 52 | #endif //DAEDALUS_SILENT 53 | -------------------------------------------------------------------------------- /Source/DynaRec/x64/DynarecTargetX64.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001,2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef SYSW32_DYNAREC_X64_DYNARECTARGETX64_H_ 23 | #define SYSW32_DYNAREC_X64_DYNARECTARGETX64_H_ 24 | 25 | // Intel register codes. Odd ordering is for intel bytecode 26 | enum EIntelReg { 27 | INVALID_CODE = 0xFFFFFFFF, 28 | RAX_CODE = 0, 29 | RCX_CODE = 1, 30 | RDX_CODE = 2, 31 | RBX_CODE = 3, 32 | RSP_CODE = 4, 33 | RBP_CODE = 5, 34 | RSI_CODE = 6, 35 | RDI_CODE = 7, 36 | 37 | R8_CODE = 8, 38 | R9_CODE = 9, 39 | R10_CODE = 10, 40 | R11_CODE = 11, 41 | R12_CODE = 12, 42 | R13_CODE = 13, 43 | R14_CODE = 14, 44 | R15_CODE = 15, 45 | 46 | NUM_X64_REGISTERS = 16, 47 | }; 48 | 49 | 50 | #endif // SYSW32_DYNAREC_X64_DYNARECTARGETX64_H_ 51 | -------------------------------------------------------------------------------- /Source/Graphics/PngUtil.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef GRAPHICS_PNGUTIL_H_ 21 | #define GRAPHICS_PNGUTIL_H_ 22 | 23 | #include 24 | 25 | #include "Graphics/TextureFormat.h" 26 | 27 | class CNativeTexture; 28 | 29 | void PngSaveImage( const std::filesystem::path& filename, const void * data, const void * palette, ETextureFormat pixelformat, s32 pitch, u32 width, u32 height, bool use_alpha ); 30 | void PngSaveImage( std::ofstream& file, const void * data, const void * palette, ETextureFormat pixelformat, s32 pitch, u32 width, u32 height, bool use_alpha ); 31 | void PngSaveImage( std::ofstream& file, const std::shared_ptr texture ); 32 | 33 | void FlattenTexture(const std::shared_ptr texture, void * dst, size_t len); 34 | 35 | #endif // GRAPHICS_PNGUTIL_H_ 36 | -------------------------------------------------------------------------------- /Source/Core/R4300Instruction.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001,2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef CORE_R4300INSTRUCTION_H_ 21 | #define CORE_R4300INSTRUCTION_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | // Through various tests, it seems the compiler generates much better code by 26 | // passing the opcode as a primitive datatype (as it can stick the value directly 27 | // in a register rather than passing it via the stack). Unfortunately we have to 28 | // create a temporary to be able to pull the various fields from the opcode, but 29 | // the compiler is clever enough to optimiste this overhead away. 30 | 31 | #define R4300_CALL_SIGNATURE u32 op_code_bits [[maybe_unused]] 32 | #define R4300_CALL_ARGUMENTS op_code_bits 33 | 34 | typedef void ( *CPU_Instruction )( R4300_CALL_SIGNATURE ); 35 | 36 | 37 | #endif // CORE_R4300INSTRUCTION_H_ 38 | -------------------------------------------------------------------------------- /Source/DynaRec/IndirectExitMap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef DYNAREC_INDIRECTEXITMAP_H_ 21 | #define DYNAREC_INDIRECTEXITMAP_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | class CFragment; 26 | class CFragmentCache; 27 | 28 | class CIndirectExitMap 29 | { 30 | public: 31 | CIndirectExitMap(); 32 | ~CIndirectExitMap(); 33 | 34 | CFragment * LookupIndirectExit( u32 exit_address ); 35 | void SetCache( const CFragmentCache * p_cache ) { mpCache = p_cache; } 36 | 37 | private: 38 | const CFragmentCache * mpCache; 39 | }; 40 | 41 | // 42 | // C-stub to allow easy access from dynarec code 43 | // 44 | extern "C" { const void * IndirectExitMap_Lookup( CIndirectExitMap * p_map, u32 exit_address ); } 45 | 46 | #endif // DYNAREC_INDIRECTEXITMAP_H_ 47 | -------------------------------------------------------------------------------- /Source/UI/UICommand.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include "Base/Types.h" 22 | #include "DrawTextUtilities.h" 23 | #include "UICommand.h" 24 | #include "UIContext.h" 25 | 26 | 27 | u32 CUICommand::GetHeight( CUIContext * context ) const 28 | { 29 | return context->GetFontHeight() + 2; 30 | } 31 | 32 | void CUICommand::Draw( CUIContext * context, s32 min_x, s32 max_x, EAlignType halign, s32 y, bool selected ) const 33 | { 34 | const c32 colour = !IsSelectable() ? DrawTextUtilities::TextWhiteDisabled : 35 | selected ? context ->GetSelectedTextColour() : 36 | context->GetDefaultTextColour(); 37 | 38 | const auto font_height = context->GetFontHeight(); 39 | context->DrawTextAlign( min_x, max_x, halign, y + context->GetFontHeight(), mName.c_str(), colour ); 40 | } 41 | -------------------------------------------------------------------------------- /Source/HLEAudio/Plugin/CTR/AudioPluginCTR.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef _AUDIOPLUGINCTR_H_ 21 | #define _AUDIOPLUGINCTR_H_ 22 | 23 | #include "HLEAudio/AudioPlugin.h" 24 | 25 | class AudioOutput; 26 | 27 | class CAudioPluginCTR : public CAudioPlugin 28 | { 29 | private: 30 | 31 | public: 32 | CAudioPluginCTR(); 33 | static std::unique_ptr Create(); 34 | 35 | 36 | virtual ~CAudioPluginCTR(); 37 | virtual bool StartEmulation(); 38 | virtual void StopEmulation(); 39 | 40 | virtual void DacrateChanged( int SystemType ); 41 | virtual void LenChanged(); 42 | virtual u32 ReadLength(); 43 | virtual EProcessResult ProcessAList(); 44 | 45 | // void SetAdaptFrequecy( bool adapt ); 46 | 47 | private: 48 | AudioOutput * mAudioOutput; 49 | }; 50 | 51 | 52 | #endif // _AUDIOPLUGINCTR_H_ 53 | 54 | -------------------------------------------------------------------------------- /Source/SysPSP/HLEGraphics/BlendModes.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef SYSPSP_HLEGRAPHICS_BLENDMODES_H_ 21 | #define SYSPSP_HLEGRAPHICS_BLENDMODES_H_ 22 | 23 | #include "Graphics/ColourValue.h" 24 | #include "SysPSP/HLEGraphics/ColourAdjuster.h" 25 | 26 | struct SBlendModeDetails 27 | { 28 | c32 EnvColour; 29 | c32 PrimColour; 30 | 31 | bool InstallTexture; 32 | CColourAdjuster ColourAdjuster; 33 | }; 34 | 35 | #define BLEND_MODE_ARGS SBlendModeDetails & details 36 | using OverrideBlendModeFn = void (*)(BLEND_MODE_ARGS); 37 | 38 | 39 | bool IsInexactDefault( OverrideBlendModeFn Fn ); 40 | OverrideBlendModeFn LookupOverrideBlendModeInexact( u64 mux ); 41 | OverrideBlendModeFn LookupOverrideBlendModeForced( u64 mux ); 42 | 43 | #endif // SYSPSP_HLEGRAPHICS_BLENDMODES_H_ 44 | -------------------------------------------------------------------------------- /Source/UI/SavestateSelectorComponent.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_SAVESTATESELECTORCOMPONENT_H_ 22 | #define UI_SAVESTATESELECTORCOMPONENT_H_ 23 | 24 | #include "UIComponent.h" 25 | #include 26 | 27 | class CSavestateSelectorComponent : public CUIComponent 28 | { 29 | public: 30 | CSavestateSelectorComponent( CUIContext * p_context ); 31 | virtual ~CSavestateSelectorComponent(); 32 | 33 | enum EAccessType 34 | { 35 | AT_SAVING, 36 | AT_LOADING, 37 | }; 38 | 39 | static CSavestateSelectorComponent * Create( CUIContext * p_context, EAccessType access_type, std::function on_savestate_selected, const std::filesystem::path& running_rom ); 40 | void LoadState(); 41 | void SaveState(); 42 | }; 43 | 44 | #endif // UI_SAVESTATESELECTORCOMPONENT_H_ 45 | -------------------------------------------------------------------------------- /Source/Utility/Translate.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2012 Salvy6735 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_TRANSLATE_H_ 21 | #define UTILITY_TRANSLATE_H_ 22 | 23 | #include "Base/Types.h" 24 | #include 25 | #include 26 | 27 | bool Translate_Init(); 28 | // 29 | // Translate multiple strings 30 | // 31 | const char * Translate_Strings(const std::string& original, u32 & len); 32 | // 33 | // Translate a single string 34 | // 35 | const char * Translate_String(const char *original); 36 | bool Translate_Read(u32 idx, const std::filesystem::path& dir); 37 | void Translate_Unload(); 38 | void Translate_Load( const std::filesystem::path& p_dir ); 39 | const char * Translate_Name(u32 idx); 40 | u32 Translate_Number(); 41 | u32 Translate_IndexFromName( const char * name ); 42 | const char * Translate_NameFromIndex( u32 idx ); 43 | 44 | #endif // UTILITY_TRANSLATE_H_ 45 | -------------------------------------------------------------------------------- /Source/UI/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_library(UI OBJECT 2 | AboutComponent.cpp 3 | # AdjustDeadzoneScreen.cpp 4 | AdvancedOptionsScreen.cpp 5 | CheatOptionsScreen.cpp 6 | ColourPulser.cpp 7 | Dialogs.cpp 8 | GlobalSettingsComponent.cpp 9 | MainMenuScreen.cpp 10 | PauseOptionsComponent.cpp 11 | PauseScreen.cpp 12 | RomPreferencesScreen.cpp 13 | RomSelectorComponent.cpp 14 | SavestateSelectorComponent.cpp 15 | SelectedRomComponent.cpp 16 | SplashScreen.cpp 17 | UICommand.cpp 18 | UIComponent.cpp 19 | UIElement.cpp 20 | UIScreen.cpp 21 | UISetting.cpp 22 | DrawTextUtilities.cpp 23 | ) 24 | 25 | if(DAEDALUS_GL) 26 | target_include_directories(UI PUBLIC ${OPENGL_INCLUDE_DIR} ${GLEW_INCLUDE_DIRS}) 27 | endif(DAEDALUS_GL) 28 | 29 | if(DAEDALUS_GLES) 30 | target_include_directories(UI PUBLIC ${OPENGLES_INCLUDE_DIR}) 31 | endif(DAEDALUS_GLES) 32 | 33 | if(DAEDALUS_PROFILE_UI) 34 | target_compile_options(UI PRIVATE -pg) 35 | endif(DAEDALUS_PROFILE_UI) 36 | 37 | list(APPEND daed_libs "UI") 38 | set(daed_libs ${daed_libs} PARENT_SCOPE) 39 | -------------------------------------------------------------------------------- /Source/DynaRec/DynaRecProfile.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef DYNAREC_DYNARECPROFILE_H_ 21 | #define DYNAREC_DYNARECPROFILE_H_ 22 | 23 | //#define DAEDALUS_ENABLE_DYNAREC_PROFILE 24 | 25 | class CFragment; 26 | 27 | #ifdef DAEDALUS_ENABLE_DYNAREC_PROFILE 28 | namespace DynarecProfile 29 | { 30 | void LogLookup( u32 address, CFragment * fragment ); 31 | void LogEnterExit( u32 enter_address, u32 exit_address, u32 instruction_count ); 32 | } 33 | 34 | #define DYNAREC_PROFILE_LOGLOOKUP( a, f ) DynarecProfile::LogLookup( a, f ) 35 | #define DYNAREC_PROFILE_ENTEREXIT( enter, exit, cnt ) DynarecProfile::LogEnterExit( enter, exit, cnt ) 36 | 37 | #else 38 | 39 | #define DYNAREC_PROFILE_LOGLOOKUP( a, f ) 40 | #define DYNAREC_PROFILE_ENTEREXIT( enter, exit, cnt ) 41 | 42 | #endif 43 | 44 | #endif // DYNAREC_DYNARECPROFILE_H_ 45 | -------------------------------------------------------------------------------- /Source/RomFile/RomFileUncompressed.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef UTILITY_ROMFILEUNCOMPRESSED_H_ 23 | #define UTILITY_ROMFILEUNCOMPRESSED_H_ 24 | 25 | #include 26 | 27 | #include "RomFile/RomFile.h" 28 | 29 | 30 | class ROMFileUncompressed : public ROMFile 31 | { 32 | public: 33 | ROMFileUncompressed( const std::filesystem::path filename ); 34 | virtual ~ROMFileUncompressed(); 35 | 36 | virtual bool Open( COutputStream & messages ); 37 | 38 | virtual bool IsCompressed() const { return false; } 39 | virtual u32 GetRomSize() const { return mRomSize; } 40 | virtual bool LoadRawData( u32 bytes_to_read, u8 *p_bytes, COutputStream & messages ); 41 | 42 | virtual bool ReadChunk( u32 offset, u8 * p_dst, u32 length ); 43 | 44 | private: 45 | std::fstream mFH; 46 | u32 mRomSize; 47 | }; 48 | 49 | #endif // UTILITY_ROMFILEUNCOMPRESSED_H_ 50 | -------------------------------------------------------------------------------- /Source/System/Timing/Windows/Timing.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2005 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include "System/Timing/Timing.h" 22 | 23 | #include 24 | 25 | namespace NTiming { 26 | 27 | bool GetPreciseFrequency( u64 * p_freq ) 28 | { 29 | LARGE_INTEGER freq; 30 | if(::QueryPerformanceFrequency( &freq )) 31 | { 32 | *p_freq = freq.QuadPart; 33 | return true; 34 | } 35 | 36 | *p_freq = 1; 37 | return false; 38 | } 39 | 40 | bool GetPreciseTime( u64 * p_time ) 41 | { 42 | LARGE_INTEGER time; 43 | if(::QueryPerformanceCounter( &time )) 44 | { 45 | *p_time = time.QuadPart; 46 | return true; 47 | } 48 | 49 | *p_time = 0; 50 | return false; 51 | } 52 | 53 | u64 ToMilliseconds( u64 ticks ) 54 | { 55 | static u64 tick_resolution = 0; 56 | if (tick_resolution == 0) 57 | GetPreciseFrequency(&tick_resolution); 58 | return (ticks*1000LL) / tick_resolution; 59 | } 60 | 61 | } // NTiming 62 | -------------------------------------------------------------------------------- /Source/SysCTR/HLEGraphics/Combiner/CombinerInput.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef SYSPSP_HLEGRAPHICS_COMBINER_COMBINERINPUT_H_ 23 | #define SYSPSP_HLEGRAPHICS_COMBINER_COMBINERINPUT_H_ 24 | 25 | //***************************************************************************** 26 | // 27 | //***************************************************************************** 28 | enum ECombinerInput 29 | { 30 | CI_COMBINED, 31 | CI_TEXEL0, 32 | CI_TEXEL1, 33 | CI_PRIMITIVE, 34 | CI_SHADE, 35 | CI_ENV, 36 | CI_COMBINED_ALPHA, 37 | CI_TEXEL0_ALPHA, 38 | CI_TEXEL1_ALPHA, 39 | CI_PRIMITIVE_ALPHA, 40 | CI_SHADE_ALPHA, 41 | CI_ENV_ALPHA, 42 | CI_LOD_FRACTION, 43 | CI_PRIM_LOD_FRACTION, 44 | CI_K5, 45 | CI_1, 46 | CI_0, 47 | CI_UNKNOWN, 48 | }; 49 | 50 | const char * GetCombinerInputName( ECombinerInput input ); 51 | 52 | #endif // SYSPSP_HLEGRAPHICS_COMBINER_COMBINERINPUT_H_ 53 | -------------------------------------------------------------------------------- /Source/HLEAudio/ABI1.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 Azimer 3 | Copyright (C) 2001,2006 StrmnNrmn 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // 22 | // N.B. This source code is derived from Azimer's Audio plugin (v0.55?) 23 | // and modified by StrmnNrmn to work with Daedalus PSP. Thanks Azimer! 24 | // Drop me a line if you get chance :) 25 | // 26 | 27 | #include "Base/Types.h" 28 | 29 | 30 | #include "Utility/MathUtil.h" 31 | #include "HLEAudio/HLEAudioInternal.h" 32 | #include "HLEAudio/HLEAudioState.h" 33 | 34 | AudioHLEInstruction ABI1[0x20] = { 35 | // std::array ABI1 = { 36 | SPNOOP, ADPCM, CLEARBUFF, ENVMIXER, LOADBUFF, RESAMPLE, SAVEBUFF, 37 | SEGMENT, SETBUFF, SETVOL, DMEMMOVE, LOADADPCM, MIXER, INTERLEAVE, 38 | UNKNOWN, SETLOOP}; 39 | // SPNOOP ADPCM CLEARBUFF ENVMIXER LOADBUFF RESAMPLE SAVEBUFF SEGMENT SETBUFF SETVOl DMEMMOVE LOADADPCM 40 | // MIXER INTERLEAVE POLEF SETLOOP -------------------------------------------------------------------------------- /Source/HLEAudio/Plugin/PSP/old/AudioPluginPSP.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef SYSPSP_HLEAUDIO_AUDIOPLUGINPSP_H_ 21 | #define SYSPSP_HLEAUDIO_AUDIOPLUGINPSP_H_ 22 | 23 | #include "HLEAudio/AudioPlugin.h" 24 | 25 | class AudioOutput; 26 | 27 | class CAudioPluginPsp : public CAudioPlugin 28 | { 29 | private: 30 | CAudioPluginPsp(); 31 | public: 32 | static CAudioPluginPsp * Create(); 33 | 34 | 35 | virtual ~CAudioPluginPsp(); 36 | virtual bool StartEmulation(); 37 | virtual void StopEmulation(); 38 | 39 | virtual void DacrateChanged( int SystemType ); 40 | virtual void LenChanged(); 41 | virtual u32 ReadLength(); 42 | virtual EProcessResult ProcessAList(); 43 | 44 | // void SetAdaptFrequecy( bool adapt ); 45 | 46 | private: 47 | AudioOutput * mAudioOutput; 48 | }; 49 | 50 | 51 | #endif // SYSPSP_HLEAUDIO_AUDIOPLUGINPSP_H_ 52 | 53 | -------------------------------------------------------------------------------- /Source/Utility/MemoryHeap.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef UTILITY_MEMORYHEAP_H_ 23 | #define UTILITY_MEMORYHEAP_H_ 24 | 25 | #include "Base/Types.h" 26 | 27 | class CMemoryHeap 28 | { 29 | public: 30 | static CMemoryHeap * Create( u32 size ); // Allocate and manage a new region of this size 31 | static CMemoryHeap * Create( void * base_ptr, u32 size ); // Manage this region of pre-allocated memory 32 | 33 | virtual ~CMemoryHeap(); 34 | 35 | virtual void * Alloc( u32 size ) = 0; 36 | virtual void Free( void * ptr ) = 0; 37 | 38 | virtual bool IsFromHeap( void * ptr ) const = 0; // Does this chunk of memory belong to this heap? 39 | #ifdef DAEDALUS_DEBUG_MEMORY 40 | //virtual u32 GetAvailableMemory() const = 0; 41 | virtual void DisplayDebugInfo() const = 0; 42 | #endif 43 | }; 44 | 45 | #endif // UTILITY_MEMORYHEAP_H_ 46 | -------------------------------------------------------------------------------- /Source/SysGL/HLEGraphics/RendererGL.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSGL_HLEGRAPHICS_RENDERERGL_H_ 2 | #define SYSGL_HLEGRAPHICS_RENDERERGL_H_ 3 | 4 | #include "HLEGraphics/BaseRenderer.h" 5 | 6 | class RendererGL : public BaseRenderer 7 | { 8 | public: 9 | virtual void RestoreRenderStates(); 10 | 11 | virtual void RenderTriangles(DaedalusVtx * p_vertices, u32 num_vertices, bool disable_zbuffer); 12 | 13 | virtual void TexRect(u32 tile_idx, const glm::vec2 & xy0, const glm::vec2 & xy1, TexCoord st0, TexCoord st1); 14 | virtual void TexRectFlip(u32 tile_idx, const glm::vec2 & xy0, const glm::vec2 & xy1, TexCoord st0, TexCoord st1); 15 | virtual void FillRect(const glm::vec2 & xy0, const glm::vec2 & xy1, u32 color); 16 | 17 | virtual void Draw2DTexture(f32 x0, f32 y0, f32 x1, f32 y1, 18 | f32 u0, f32 v0, f32 u1, f32 v1, std::shared_ptr texture); 19 | virtual void Draw2DTextureR(f32 x0, f32 y0, f32 x1, f32 y1, 20 | f32 x2, f32 y2, f32 x3, f32 y3, 21 | f32 s, f32 t, std::shared_ptr texture); 22 | 23 | private: 24 | void MakeShaderConfigFromCurrentState(struct ShaderConfiguration * config) const; 25 | 26 | void PrepareRenderState(const float* mat_project, bool disable_zbuffer); 27 | 28 | void RenderDaedalusVtx(int prim, const DaedalusVtx * vertices, int count); 29 | void RenderDaedalusVtxStreams(int prim, const float * positions, const TexCoord * uvs, const u32 * colours, int count); 30 | }; 31 | 32 | // NB: this is equivalent to gRenderer, but points to the implementation class, for platform-specific functionality. 33 | extern RendererGL * gRendererGL; 34 | 35 | #endif // SYSGL_HLEGRAPHICS_RENDERERGL_H_ 36 | -------------------------------------------------------------------------------- /Source/SysGLES/HLEGraphics/RendererGL.h: -------------------------------------------------------------------------------- 1 | #ifndef SYSGL_HLEGRAPHICS_RENDERERGL_H_ 2 | #define SYSGL_HLEGRAPHICS_RENDERERGL_H_ 3 | 4 | #include "HLEGraphics/BaseRenderer.h" 5 | 6 | class RendererGL : public BaseRenderer 7 | { 8 | public: 9 | virtual void RestoreRenderStates(); 10 | 11 | virtual void RenderTriangles(DaedalusVtx * p_vertices, u32 num_vertices, bool disable_zbuffer); 12 | 13 | virtual void TexRect(u32 tile_idx, const glm::vec2 & xy0, const glm::vec2 & xy1, TexCoord st0, TexCoord st1); 14 | virtual void TexRectFlip(u32 tile_idx, const glm::vec2 & xy0, const glm::vec2 & xy1, TexCoord st0, TexCoord st1); 15 | virtual void FillRect(const glm::vec2 & xy0, const glm::vec2 & xy1, u32 color); 16 | 17 | virtual void Draw2DTexture(f32 x0, f32 y0, f32 x1, f32 y1, 18 | f32 u0, f32 v0, f32 u1, f32 v1, std::shared_ptr texture); 19 | virtual void Draw2DTextureR(f32 x0, f32 y0, f32 x1, f32 y1, 20 | f32 x2, f32 y2, f32 x3, f32 y3, 21 | f32 s, f32 t, std::shared_ptr texture); 22 | 23 | private: 24 | void MakeShaderConfigFromCurrentState(struct ShaderConfiguration * config) const; 25 | 26 | void PrepareRenderState(const float* mat_project, bool disable_zbuffer); 27 | 28 | void RenderDaedalusVtx(int prim, const DaedalusVtx * vertices, int count); 29 | void RenderDaedalusVtxStreams(int prim, const float * positions, const TexCoord * uvs, const u32 * colours, int count); 30 | }; 31 | 32 | // NB: this is equivalent to gRenderer, but points to the implementation class, for platform-specific functionality. 33 | extern RendererGL * gRendererGL; 34 | 35 | #endif // SYSGL_HLEGRAPHICS_RENDERERGL_H_ 36 | -------------------------------------------------------------------------------- /Source/UI/UISpacer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #ifndef UI_UISPACER_H_ 22 | #define UI_UISPACER_H_ 23 | 24 | #include "UIElement.h" 25 | 26 | 27 | class CUISpacer : public CUIElement 28 | { 29 | public: 30 | CUISpacer( u32 height ) 31 | : mHeight( height ) 32 | {} 33 | 34 | virtual ~CUISpacer() {} 35 | 36 | virtual bool IsSelectable() const { return false; } 37 | 38 | virtual u32 GetHeight( CUIContext * context [[maybe_unused]] ) const { return mHeight; } 39 | virtual void Draw( CUIContext * context [[maybe_unused]], s32 min_x [[maybe_unused]], [[maybe_unused]] s32 max_x [[maybe_unused]], EAlignType halign [[maybe_unused]], s32 y [[maybe_unused]], bool selected [[maybe_unused]] ) const {} 40 | 41 | virtual const std::string GetDescription() const { return ""; } 42 | 43 | private: 44 | u32 mHeight; 45 | }; 46 | 47 | 48 | #endif // UI_UISPACER_H_ 49 | -------------------------------------------------------------------------------- /Source/Debug/DBGConsole.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef DEBUG_DBGCONSOLE_H_ 23 | #define DEBUG_DBGCONSOLE_H_ 24 | 25 | #include "Base/Types.h" 26 | #include "Base/Singleton.h" 27 | #include "Base/Macros.h" 28 | 29 | #ifdef DAEDALUS_DEBUG_CONSOLE 30 | 31 | class CDebugConsole : public CSingleton< CDebugConsole > 32 | { 33 | public: 34 | virtual ~CDebugConsole(); 35 | 36 | virtual void Msg( u32 type, const char * format, ... ) = 0; 37 | 38 | virtual void MsgOverwriteStart() = 0; 39 | virtual void MsgOverwrite( u32 type, const char * format, ... ) = 0; 40 | virtual void MsgOverwriteEnd() = 0; 41 | }; 42 | 43 | #define DBGConsole_Msg( type, ... ) CDebugConsole::Get()->Msg( type, __VA_ARGS__ ) 44 | 45 | #else 46 | 47 | #define DBGConsole_Msg(...) do { DAEDALUS_USE(__VA_ARGS__); } while(0) 48 | 49 | #endif // DAEDALUS_DEBUG_CONSOLE 50 | 51 | #endif // DEBUG_DBGCONSOLE_H_ 52 | 53 | -------------------------------------------------------------------------------- /Source/Utility/String.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef UTILITY_STRING_H_ 21 | #define UTILITY_STRING_H_ 22 | 23 | #include 24 | 25 | #include "Base/Types.h" 26 | 27 | #ifdef WIN32 28 | #define strncasecmp _strnicmp 29 | #define strcasecmp _stricmp 30 | #endif 31 | 32 | struct ConstStringRef 33 | { 34 | ConstStringRef() : Begin(NULL), End(NULL) {} 35 | /*explicit */ConstStringRef(const char * str) : Begin(str), End(str+strlen(str)) {} 36 | explicit ConstStringRef(const char * b, const char * e) : Begin(b), End(e) {} 37 | 38 | size_t size() const { return End - Begin; } 39 | 40 | bool operator==(const char * rhs) const { return operator==(ConstStringRef(rhs)); } 41 | bool operator==(const ConstStringRef & rhs) const 42 | { 43 | return size() == rhs.size() && memcmp(Begin, rhs.Begin, size()) == 0; 44 | } 45 | 46 | const char * Begin; 47 | const char * End; 48 | }; 49 | 50 | 51 | #endif // UTILITY_STRING_H_ 52 | -------------------------------------------------------------------------------- /Source/HLEAudio/AudioPlugin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef PLUGINS_AUDIOPLUGIN_H_ 23 | #define PLUGINS_AUDIOPLUGIN_H_ 24 | 25 | #include "Core/RSP_HLE.h" 26 | #include 27 | 28 | class CAudioPlugin { 29 | public: 30 | virtual ~CAudioPlugin() {} 31 | 32 | virtual bool StartEmulation() = 0; 33 | virtual void StopEmulation() = 0; 34 | 35 | enum ESystemType { 36 | ST_NTSC, 37 | ST_PAL, 38 | ST_MPAL, 39 | }; 40 | 41 | virtual void DacrateChanged(int SystemType) = 0; 42 | virtual void LenChanged() = 0; 43 | virtual u32 ReadLength() = 0; 44 | virtual EProcessResult ProcessAList() = 0; 45 | 46 | }; 47 | 48 | // 49 | // This needs to be defined for all targets. 50 | // The implementation can return NULL if audio is not supported 51 | // 52 | extern std::unique_ptr gAudioPlugin; 53 | std::unique_ptr CreateAudioPlugin(); 54 | 55 | #endif // PLUGINS_AUDIOPLUGIN_H_ 56 | -------------------------------------------------------------------------------- /Source/Interface/Preferences.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef UTILITY_PREFERENCES_H_ 23 | #define UTILITY_PREFERENCES_H_ 24 | 25 | #include "Base/Singleton.h" 26 | #include "Interface/GlobalPreferences.h" 27 | #include "Interface/RomPreferences.h" 28 | 29 | class RomID; 30 | 31 | class CPreferences : public CSingleton 32 | { 33 | public: 34 | virtual ~CPreferences(); 35 | 36 | virtual bool OpenPreferencesFile(const std::filesystem::path &filename) = 0; 37 | virtual void Commit() = 0; 38 | 39 | virtual bool GetRomPreferences(const RomID& id, SRomPreferences* preferences) const = 0; 40 | virtual void SetRomPreferences(const RomID& id, const SRomPreferences& preferences) = 0; 41 | }; 42 | 43 | const char* Preferences_GetTextureHashFrequencyDescription(ETextureHashFrequency thf); 44 | const char* Preferences_GetFrameskipDescription(EFrameskipValue value); 45 | 46 | #endif // UTILITY_PREFERENCES_H_ 47 | -------------------------------------------------------------------------------- /Source/SysPSP/HLEGraphics/Combiner/CombinerInput.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2007 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #pragma once 21 | 22 | #ifndef SYSPSP_HLEGRAPHICS_COMBINER_COMBINERINPUT_H_ 23 | #define SYSPSP_HLEGRAPHICS_COMBINER_COMBINERINPUT_H_ 24 | 25 | //***************************************************************************** 26 | // 27 | //***************************************************************************** 28 | enum ECombinerInput 29 | { 30 | CI_COMBINED, 31 | CI_TEXEL0, 32 | CI_TEXEL1, 33 | CI_PRIMITIVE, 34 | CI_SHADE, 35 | CI_ENV, 36 | CI_COMBINED_ALPHA, 37 | CI_TEXEL0_ALPHA, 38 | CI_TEXEL1_ALPHA, 39 | CI_PRIMITIVE_ALPHA, 40 | CI_SHADE_ALPHA, 41 | CI_ENV_ALPHA, 42 | CI_LOD_FRACTION, 43 | CI_PRIM_LOD_FRACTION, 44 | CI_K5, 45 | CI_1, 46 | CI_0, 47 | CI_UNKNOWN, 48 | }; 49 | 50 | const char * GetCombinerInputName( ECombinerInput input ); 51 | 52 | #endif // SYSPSP_HLEGRAPHICS_COMBINER_COMBINERINPUT_H_ 53 | -------------------------------------------------------------------------------- /Source/SysPSP/Utility/ModulePSP.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Salvy6735 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include "Base/Types.h" 22 | #include "SysPSP/Utility/ModulePSP.h" 23 | 24 | #include 25 | #include 26 | 27 | 28 | #include 29 | 30 | namespace CModule 31 | { 32 | void Unload( int id ) 33 | { 34 | int ret {0}, status {0}; 35 | sceKernelStopModule(id, 0, nullptr, &status, nullptr); // Stop module first before unloading it 36 | 37 | ret = sceKernelUnloadModule(id); 38 | 39 | if(ret < 0) 40 | { 41 | std::cout << "Couldn't unload module!" << id <<": " << ret << std::endl; 42 | } 43 | } 44 | 45 | int Load( const std::filesystem::path path ) 46 | { 47 | int ret = pspSdkLoadStartModule(path.c_str(), PSP_MEMORY_PARTITION_KERNEL); 48 | 49 | if( ret < 0 ) 50 | { 51 | std::cout << "Failed to load" << path <<": " << ret << std::endl; 52 | return ret; //-1 53 | } 54 | 55 | std::cout << "Successfully loaded" << path <<": " << ret << std::endl; 56 | return ret; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Source/SysPSP/PRX/MediaEngine/me.c: -------------------------------------------------------------------------------- 1 | #include "me.h" 2 | 3 | 4 | int CallME(volatile struct me_struct *mei, int func, int param, int prelen, void *preadr, int postlen, void *postadr) 5 | { 6 | if (!mei->done) 7 | return -1; 8 | 9 | mei->done = 0; 10 | // Warning : Quiet the compiler casting func. The behaviour is still compiler-defined. 11 | mei->func = (int (*)(int))func; 12 | mei->param = param; 13 | mei->result = 0; 14 | mei->precache_len = prelen; 15 | mei->precache_addr = preadr; 16 | mei->postcache_len = postlen; 17 | mei->postcache_addr = postadr; 18 | mei->signals = 0; 19 | mei->start = 1; 20 | 21 | while (!mei->done); 22 | return mei->result; 23 | } 24 | 25 | 26 | int WaitME(volatile struct me_struct *mei) 27 | { 28 | while (!mei->done); 29 | return mei->result; 30 | } 31 | 32 | 33 | int BeginME(volatile struct me_struct *mei, int func, int param, int prelen, void *preadr, int postlen, void *postadr) 34 | { 35 | if (!mei->done) 36 | return -1; 37 | 38 | mei->done = 0; 39 | // Warning : Quiet the compiler casting func. The behaviour is still compiler-defined. 40 | mei->func = (int (*)(int))func; 41 | mei->param = param; 42 | mei->result = 0; 43 | mei->precache_len = prelen; 44 | mei->precache_addr = preadr; 45 | mei->postcache_len = postlen; 46 | mei->postcache_addr = postadr; 47 | mei->signals = 0; 48 | mei->start = 1; 49 | 50 | return 0; 51 | } 52 | 53 | 54 | int CheckME(volatile struct me_struct *mei) 55 | { 56 | return mei->done; 57 | } 58 | 59 | 60 | unsigned int SignalME(volatile struct me_struct *mei, unsigned int sigmask, unsigned int sigset) 61 | { 62 | unsigned int signals; 63 | 64 | signals = mei->signals; 65 | mei->signals = (mei->signals & ~sigmask) | (sigset & sigmask); 66 | 67 | return signals; 68 | } 69 | -------------------------------------------------------------------------------- /Source/Utility/FastMemcpy_test.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Utility/FastMemcpy.h" 3 | #include "System/Endian.h" 4 | 5 | 6 | #include 7 | 8 | TEST(memcpy_byteswap, WorksWithZeroLength) 9 | { 10 | u8 dst = 92; 11 | const u8 src = 14; 12 | memcpy_byteswap(&dst, &src, 0); 13 | EXPECT_EQ(92, dst); 14 | } 15 | 16 | class MemcpyByteSwapTest : public ::testing::TestWithParam< ::std::tr1::tuple > 17 | { 18 | protected: 19 | virtual void SetUp() 20 | { 21 | for (u32 i = 0; i < 64; ++i) 22 | mSrc[i] = i; 23 | memset(mDst, 0, sizeof(mDst)); 24 | memset(mExpected, 0, sizeof(mExpected)); 25 | 26 | } 27 | u8 alignas(CACHE_ALIGN) mSrc[64]; 28 | u8 alignas(CACHE_ALIGN) mDst[64]; 29 | u8 alignas(CACHE_ALIGN) mExpected[64]; 30 | }; 31 | 32 | static void memcpy_byteswap_reference( void * dst, u32 dst_off, const void * src, u32 src_off, size_t size ) 33 | { 34 | const u8* src8 = (const u8*)src; 35 | u8* dst8 = (u8*)dst; 36 | 37 | for (size_t i = 0; i < size; ++i) 38 | { 39 | dst8[(dst_off + i) ^ U8_TWIDDLE] = src8[(src_off + i) ^ U8_TWIDDLE]; 40 | } 41 | } 42 | 43 | TEST_P(MemcpyByteSwapTest, WorksWithSmallCopies) 44 | { 45 | u32 src_off = ::std::tr1::get<0>(GetParam()); 46 | u32 dst_off = ::std::tr1::get<1>(GetParam()); 47 | u32 len = ::std::tr1::get<2>(GetParam()); 48 | 49 | memcpy_byteswap(&mDst[dst_off], &mSrc[src_off], len); 50 | memcpy_byteswap_reference(mExpected, dst_off, mSrc, src_off, len); 51 | for (u32 i = 0; i < 64; ++i) 52 | EXPECT_EQ(mExpected[i], mDst[i]); 53 | } 54 | 55 | INSTANTIATE_TEST_CASE_P(X, MemcpyByteSwapTest, ::testing::Combine(::testing::Values(0,1,2,3), 56 | ::testing::Values(0,1,2,3), 57 | ::testing::Values(0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16))); -------------------------------------------------------------------------------- /Source/DynaRec/dummy/AssemblyUtilsDummy.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2020 MasterFeizz 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | #include 20 | 21 | #include "DynaRec/AssemblyUtils.h" 22 | 23 | namespace AssemblyUtils 24 | { 25 | 26 | //***************************************************************************** 27 | // Patch a long jump to target the specified location. 28 | // Return true if the patching succeeded (i.e. within range), false otherwise 29 | //***************************************************************************** 30 | bool PatchJumpLong( CJumpLocation jump [[maybe_unused]], CCodeLabel target [[maybe_unused]] ) 31 | { 32 | return false; 33 | } 34 | 35 | //***************************************************************************** 36 | // As above no (need to flush on intel) 37 | //***************************************************************************** 38 | bool PatchJumpLongAndFlush( CJumpLocation jump [[maybe_unused]], CCodeLabel target [[maybe_unused]] ) 39 | { 40 | return false; 41 | } 42 | } -------------------------------------------------------------------------------- /Source/HLEAudio/Plugin/CTR/AudioOutput.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2003 Azimer 3 | Copyright (C) 2001,2006 StrmnNrmn 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef SYSCTR_HLEAUDIO_AUDIOOUTPUT_H_ 22 | #define SYSCTR_HLEAUDIO_AUDIOOUTPUT_H_ 23 | 24 | #include "Base/Types.h" 25 | 26 | struct Sample; 27 | class CAudioBuffer; 28 | 29 | class AudioOutput 30 | { 31 | public: 32 | AudioOutput(); 33 | ~AudioOutput(); 34 | 35 | // Buffer Functions for the Audio Code 36 | void SetFrequency( u32 frequency ); // Sets the Nintendo64 Game Audio Frequency 37 | void AddBuffer( u8 * start, u32 length ); // Uploads a new buffer 38 | 39 | // Management functions 40 | void StopAudio( ); // Stops the Audio PlayBack (as if paused) 41 | void StartAudio( ); // Starts the Audio PlayBack (as if unpaused) 42 | 43 | public: 44 | void FillBuffer( Sample * buffer, u32 num_samples ); 45 | 46 | private: 47 | bool mAudioPlaying; 48 | bool mExitAudioThread; 49 | u32 mFrequency; 50 | }; 51 | 52 | #endif // SYSCTR_HLEAUDIO_AUDIOOUTPUT_H_ 53 | -------------------------------------------------------------------------------- /Source/UI/ColourPulser.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | 21 | #include "Base/Types.h" 22 | 23 | #include "Graphics/ColourValue.h" 24 | 25 | #include "ColourPulser.h" 26 | #include 27 | 28 | #ifdef DAEDALUS_PSP 29 | #include "SysPSP/Math/Math.h" 30 | #endif 31 | 32 | CColourPulser::CColourPulser( c32 dim_colour, c32 bright_colour, u32 cycle_period ) 33 | : mTimeCounter( 0 ) 34 | , mCyclePeriod( cycle_period ) 35 | , mDimColour( dim_colour ) 36 | , mBrightColour( bright_colour ) 37 | , mCurrentColour( mDimColour ) 38 | {} 39 | 40 | CColourPulser::~CColourPulser() {} 41 | 42 | void CColourPulser::Update( u32 elapsed_ms ) 43 | { 44 | mTimeCounter = (mTimeCounter + elapsed_ms) % mCyclePeriod; 45 | 46 | f32 cycle_fraction = static_cast(mTimeCounter) / static_cast(mCyclePeriod); 47 | 48 | f32 sin_val = cosf( cycle_fraction * 2.0f * M_PI ); // In range -1..+1 49 | f32 factor = ( sin_val + 1.0f ) / 2.0f; // In range 0..1 50 | 51 | mCurrentColour = mDimColour.Interpolate( mBrightColour, factor ); 52 | } 53 | -------------------------------------------------------------------------------- /Source/SysPosix/Utility/CondPosix.cpp: -------------------------------------------------------------------------------- 1 | 2 | #include "Base/Types.h" 3 | #include "System/Condition.h" 4 | #include "System/Mutex.h" 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | const double kTimeoutInfinity = 0.f; 11 | 12 | // Cond wrapper derived from GLFW 2.7, see http://www.glfw.org/. 13 | 14 | // Displaylist Debugger 15 | Cond * CondCreate() 16 | { 17 | pthread_cond_t * cond = (pthread_cond_t *)malloc( sizeof(pthread_cond_t) ); 18 | if (!cond) 19 | { 20 | return NULL; 21 | } 22 | 23 | pthread_cond_init( cond, NULL ); 24 | return (Cond *)cond; 25 | } 26 | 27 | 28 | void CondDestroy(Cond * cond) 29 | { 30 | // pthread_cond_destroy( (pthread_cond_t *)cond ); 31 | free( cond ); 32 | } 33 | // Displaylist Debugger 34 | 35 | static void ComputeWait(double timeout, timespec * wait) 36 | { 37 | timeval currenttime; 38 | gettimeofday( ¤ttime, NULL ); 39 | long dt_sec = (long)timeout; 40 | long dt_usec = (long)((timeout - (double)dt_sec) * 1000000.0); 41 | 42 | wait->tv_nsec = (currenttime.tv_usec + dt_usec) * 1000L; 43 | if (wait->tv_nsec > 1000000000L) 44 | { 45 | wait->tv_nsec -= 1000000000L; 46 | dt_sec++; 47 | } 48 | wait->tv_sec = currenttime.tv_sec + dt_sec; 49 | } 50 | 51 | // Displaylist Debugger 52 | void CondWait(Cond * cond [[maybe_unused]], Mutex * mutex [[maybe_unused]], double timeout) 53 | { 54 | if (timeout <= 0) 55 | { 56 | // pthread_cond_wait( (pthread_cond_t *)cond, &mutex->mMutex ); 57 | } 58 | else 59 | { 60 | timespec wait; 61 | ComputeWait(timeout, &wait); 62 | 63 | // pthread_cond_timedwait( (pthread_cond_t *)cond, &mutex->mMutex, &wait ); 64 | } 65 | } 66 | 67 | // DisplayList Debugger 68 | void CondSignal(Cond * cond) 69 | { 70 | pthread_cond_signal( (pthread_cond_t *)cond ); 71 | } 72 | -------------------------------------------------------------------------------- /Source/OSHLE/patch_cache_hle.inl: -------------------------------------------------------------------------------- 1 | #define TEST_DISABLE_CACHE_FUNCS DAEDALUS_PROFILE(__FUNCTION__); 2 | 3 | 4 | 5 | u32 Patch_osInvalICache_Mario() 6 | { 7 | TEST_DISABLE_CACHE_FUNCS 8 | #ifdef DAEDALUS_ENABLE_DYNAREC 9 | u32 p = gGPR[REG_a0]._u32_0; 10 | u32 len = gGPR[REG_a1]._u32_0; 11 | 12 | if (len < 0x4000) 13 | CPU_InvalidateICacheRange(p, len); 14 | else 15 | CPU_InvalidateICache(); 16 | #endif 17 | 18 | return PATCH_RET_JR_RA; 19 | } 20 | 21 | u32 Patch_osInvalICache_Rugrats() 22 | { 23 | return Patch_osInvalICache_Mario(); 24 | } 25 | 26 | 27 | u32 Patch_osInvalDCache_Mario() 28 | { 29 | TEST_DISABLE_CACHE_FUNCS 30 | //u32 p = gGPR[REG_a0]._u32_0; 31 | //u32 len = gGPR[REG_a1]._u32_0; 32 | 33 | //DBGConsole_Msg(0, "osInvalDCache(0x%08x, %d)", p, len); 34 | 35 | return PATCH_RET_JR_RA; 36 | } 37 | u32 Patch_osInvalDCache_Rugrats() 38 | { 39 | TEST_DISABLE_CACHE_FUNCS 40 | //u32 p = gGPR[REG_a0]._u32_0; 41 | //u32 len = gGPR[REG_a1]._u32_0; 42 | 43 | //DBGConsole_Msg(0, "osInvalDCache(0x%08x, %d)", p, len); 44 | 45 | return PATCH_RET_JR_RA; 46 | } 47 | 48 | 49 | u32 Patch_osWritebackDCache_Mario() 50 | { 51 | TEST_DISABLE_CACHE_FUNCS 52 | //u32 p = gGPR[REG_a0]._u32_0; 53 | //u32 len = gGPR[REG_a1]._u32_0; 54 | 55 | //DBGConsole_Msg(0, "osWritebackDCache(0x%08x, %d)", p, len); 56 | 57 | return PATCH_RET_JR_RA; 58 | } 59 | u32 Patch_osWritebackDCache_Rugrats() 60 | { 61 | TEST_DISABLE_CACHE_FUNCS 62 | //u32 p = gGPR[REG_a0]._u32_0; 63 | //u32 len = gGPR[REG_a1]._u32_0; 64 | 65 | //DBGConsole_Msg(0, "osWritebackDCache(0x%08x, %d)", p, len); 66 | 67 | return PATCH_RET_JR_RA; 68 | } 69 | 70 | 71 | u32 Patch_osWritebackDCacheAll() 72 | { 73 | TEST_DISABLE_CACHE_FUNCS 74 | //DBGConsole_Msg(0, "osWritebackDCacheAll()"); 75 | 76 | return PATCH_RET_JR_RA; 77 | } 78 | -------------------------------------------------------------------------------- /Source/Ultra/ultra_sptask.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2001 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef OSHLE_ULTRA_SPTASK_H_ 21 | #define OSHLE_ULTRA_SPTASK_H_ 22 | 23 | #include "Base/Types.h" 24 | 25 | 26 | // Pointers are 32 bits. 27 | using osptr = u32; 28 | 29 | typedef struct { 30 | u32 type; 31 | u32 flags; 32 | 33 | osptr ucode_boot; 34 | u32 ucode_boot_size; 35 | 36 | osptr ucode; 37 | u32 ucode_size; 38 | 39 | osptr ucode_data; 40 | u32 ucode_data_size; 41 | 42 | osptr dram_stack; 43 | u32 dram_stack_size; 44 | 45 | osptr output_buff; 46 | osptr output_buff_size; 47 | 48 | osptr data_ptr; 49 | u32 data_size; 50 | 51 | osptr yield_data_ptr; 52 | u32 yield_data_size; 53 | 54 | } OSTask_t; 55 | 56 | typedef union { 57 | OSTask_t t; 58 | u64 force_structure_alignment; 59 | } OSTask; 60 | 61 | #define OS_TASK_YIELDED 0x0001 62 | #define OS_TASK_DP_WAIT 0x0002 63 | #define OS_TASK_USR0 0x0010 64 | #define OS_TASK_USR1 0x0020 65 | #define OS_TASK_USR2 0x0040 66 | #define OS_TASK_USR3 0x0080 67 | 68 | #endif // OSHLE_ULTRA_SPTASK_H_ 69 | -------------------------------------------------------------------------------- /Source/DynaRec/Trace.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2006 StrmnNrmn 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with this program; if not, write to the Free Software 16 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 | 18 | */ 19 | 20 | #ifndef DYNAREC_TRACE_H_ 21 | #define DYNAREC_TRACE_H_ 22 | 23 | #include "Core/R4300OpCode.h" 24 | #include "DynaRec/StaticAnalysis.h" 25 | 26 | struct STraceEntry 27 | { 28 | u32 Address; 29 | struct OpCode OpCode; 30 | StaticAnalysis::RegisterUsage Usage; 31 | u32 BranchIdx; 32 | bool BranchDelaySlot; 33 | }; 34 | 35 | enum SpeedHackProbe 36 | { 37 | SHACK_NONE, 38 | SHACK_POSSIBLE, 39 | SHACK_SKIPTOEVENT, 40 | SHACK_COPYREG 41 | }; 42 | 43 | struct SBranchDetails 44 | { 45 | SBranchDetails( ) 46 | : TargetAddress( u32(~0) ) 47 | , DelaySlotTraceIndex( -1 ) 48 | , ConditionalBranchTaken( false ) 49 | , Likely( false ) 50 | , Direct( false ) 51 | , Eret( false ) 52 | , SpeedHack( SHACK_NONE ) 53 | { 54 | } 55 | 56 | u32 TargetAddress; 57 | 58 | s32 DelaySlotTraceIndex; 59 | bool ConditionalBranchTaken; 60 | bool Likely; 61 | bool Direct; 62 | bool Eret; 63 | SpeedHackProbe SpeedHack; 64 | }; 65 | 66 | #endif // DYNAREC_TRACE_H_ 67 | --------------------------------------------------------------------------------