├── .gitattributes ├── .gitignore ├── .gitmodules ├── AppXTimeStamper.ps1 ├── BeetleNGP.LibRetriX ├── BeetleNGP.LibRetriX.csproj ├── Core.cs └── NativeDllInfo.cs ├── BeetleNGP ├── BeetleNGP.vcxproj ├── BeetleNGP.vcxproj.filters └── targetver.h ├── BeetlePCEFast.LibRetriX ├── BeetlePCEFast.LibRetriX.csproj ├── Core.cs └── NativeDllInfo.cs ├── BeetlePCEFast ├── BeetlePCEFast.vcxproj ├── BeetlePCEFast.vcxproj.filters └── targetver.h ├── BeetlePCFX.LibRetriX ├── BeetlePCFX.LibRetriX.csproj ├── Core.cs └── NativeDllInfo.cs ├── BeetlePCFX ├── BeetlePCFX.vcxproj ├── BeetlePCFX.vcxproj.filters └── targetver.h ├── BeetlePSX.LibRetriX ├── BeetlePSX.LibRetriX.csproj ├── Core.cs └── NativeDllInfo.cs ├── BeetlePSX ├── BeetlePSX.vcxproj ├── BeetlePSX.vcxproj.filters └── targetver.h ├── BeetleSaturn.LibRetriX ├── BeetleSaturn.LibRetriX.csproj ├── Core.cs └── NativeDllInfo.cs ├── BeetleSaturn ├── BeetleSaturn.vcxproj ├── BeetleSaturn.vcxproj.filters └── targetver.h ├── BeetleWswan.LibRetriX ├── BeetleWswan.LibRetriX.csproj ├── Core.cs └── NativeDllInfo.cs ├── BeetleWswan ├── BeetleWswan.vcxproj ├── BeetleWswan.vcxproj.filters └── targetver.h ├── FBAlpha.LibRetriX ├── Core.cs ├── FBAlpha.LibRetriX.csproj └── NativeDllInfo.cs ├── FBAlpha ├── FBAlpha.vcxproj ├── FBAlpha.vcxproj.filters └── targetver.h ├── FCEUMM.LibRetriX ├── Core.cs ├── FCEUMM.LibRetriX.csproj └── NativeDllInfo.cs ├── FCEUMM ├── FCEUMM.vcxproj ├── FCEUMM.vcxproj.filters └── targetver.h ├── GPGX.LibRetriX ├── Core.cs ├── GPGX.LibRetriX.csproj └── NativeDllInfo.cs ├── GPGX ├── GPGX.vcxproj ├── GPGX.vcxproj.filters └── targetver.h ├── Gambatte.LibRetriX ├── Core.cs ├── Gambatte.LibRetriX.csproj └── NativeDllInfo.cs ├── Gambatte ├── Gambatte.vcxproj ├── Gambatte.vcxproj.filters └── targetver.h ├── LibRetriX ├── LibRetriX.Primitives │ ├── Enums │ │ ├── InputTypes.cs │ │ ├── PixelFormats.cs │ │ └── Rotations.cs │ ├── ICore.cs │ ├── LibRetriX.Primitives.csproj │ └── Types │ │ ├── CoreOption.cs │ │ ├── FileDependency.cs │ │ ├── GameGeometry.cs │ │ └── SystemTimings.cs ├── LibRetriX.RetroBindings.Static │ ├── LibRetriX.RetroBindings.Static.projitems │ ├── LibRetriX.RetroBindings.Static.shproj │ ├── LibretroAPI.cs │ ├── LibretroCore.cs │ └── VFSHandler.cs ├── LibRetriX.RetroBindings │ ├── Constants.cs │ ├── ControllerDescription.cs │ ├── ControllerInfo.cs │ ├── Delegates.cs │ ├── Framebuffer.cs │ ├── GameInfo.cs │ ├── HwRenderContextNegotiationInterfaceTypes.cs │ ├── HwRenderInterfaceTypes.cs │ ├── Keys.cs │ ├── Languages.cs │ ├── LibRetriX.RetroBindings.csproj │ ├── LibretroVariable.cs │ ├── LogCallbackDescriptor.cs │ ├── LogLevels.cs │ ├── Modifiers.cs │ ├── SystemAVInfo.cs │ ├── SystemInfo.cs │ ├── Tools │ │ └── Converter.cs │ ├── Unsafe │ │ ├── UnmanagedLists.cs │ │ └── UnmanagedLists.tt │ ├── VFSInterface.cs │ └── VFSInterfaceInfo.cs ├── LibRetriX.Test.Base │ ├── CoreTestBase.cs │ ├── LibRetriX.Test.Base.csproj │ └── StreamProvider.cs └── LibRetriX.Test.UWP │ ├── Assets │ ├── LockScreenLogo.scale-200.png │ ├── SplashScreen.scale-200.png │ ├── Square150x150Logo.scale-200.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── StoreLogo.png │ └── Wide310x150Logo.scale-200.png │ ├── BeetleNGPTest.cs │ ├── BeetlePCEFastTest.cs │ ├── BeetlePCFXTest.cs │ ├── BeetlePSXTest.cs │ ├── BeetleWswanTest.cs │ ├── FBAlphaTest.cs │ ├── FCEUMMTest.cs │ ├── GPGXTest.cs │ ├── GambatteTest.cs │ ├── LibRetriX.Test.UWP.csproj │ ├── MelonDSTest.cs │ ├── NestopiaTest.cs │ ├── Package.appxmanifest │ ├── Properties │ ├── AssemblyInfo.cs │ └── UnitTestApp.rd.xml │ ├── Snes9XTest.cs │ ├── UnitTestApp.xaml │ ├── UnitTestApp.xaml.cs │ └── VBAMTest.cs ├── LibretroRT.sln ├── LibretroRTLogo.png ├── License.txt ├── MelonDS.LibRetriX ├── Core.cs ├── MelonDS.LibRetriX.csproj └── NativeDllInfo.cs ├── MelonDS ├── MelonDS.vcxproj ├── MelonDS.vcxproj.filters └── targetver.h ├── Nestopia.LibRetriX ├── Core.cs ├── NativeDllInfo.cs └── Nestopia.LibRetriX.csproj ├── Nestopia ├── Nestopia.vcxproj ├── Nestopia.vcxproj.filters └── targetver.h ├── ParallelN64.LibRetriX ├── Core.cs ├── NativeDllInfo.cs └── ParallelN64.LibRetriX.csproj ├── ParallelN64 ├── ParallelN64.vcxproj ├── ParallelN64.vcxproj.filters └── targetver.h ├── RetriX.Shared.Test ├── ExtensionMethods │ └── StringHasherTest.cs ├── RetriX.Shared.Test.csproj ├── Services │ ├── CryptographyServiceTest.cs │ └── SaveStateServiceTest.cs ├── StreamProviders │ ├── ArchiveStreamProviderTest.cs │ ├── FolderStreamProviderTest.cs │ ├── SingleFileStreamProviderTest.cs │ └── StreamProviderTestBase.cs ├── TestBase.cs ├── TestFiles │ ├── A │ │ └── B │ │ │ └── AnotherFile.cds │ ├── AnotherFile.cds │ ├── Archive.zip │ └── TestFile.txt └── ViewModels │ └── FileImporterViewModelTest.cs ├── RetriX.Shared ├── App.cs ├── AppStart.cs ├── ExtensionMethods │ └── StringHasher.cs ├── Presentation │ └── ICurrentViewModelPresenter.cs ├── Properties │ └── AssemblyInfo.cs ├── Resources │ ├── Strings.Designer.cs │ └── Strings.resx ├── RetriX.Shared.csproj ├── Services │ ├── CryptographyService.cs │ ├── EmulationService.cs │ ├── GameSystemsProviderServiceBase.cs │ ├── IAudioService.cs │ ├── ICryptographyService.cs │ ├── IEmulationService.cs │ ├── IGameSystemsProviderService.cs │ ├── IInitializable.cs │ ├── IInputService.cs │ ├── IPlatformService.cs │ ├── ISaveStateService.cs │ ├── IVideoService.cs │ ├── PlatformServiceEventArgs.cs │ └── SaveStateService.cs ├── StreamProviders │ ├── ArchiveStreamProvider.cs │ ├── CombinedStreamProvider.cs │ ├── FolderStreamProvider.cs │ ├── IStreamProvider.cs │ ├── SingleFileStreamProvider.cs │ └── StreamProviderBase.cs └── ViewModels │ ├── AboutViewModel.cs │ ├── FileImporterViewModel.cs │ ├── GamePlayerViewModel.cs │ ├── GameSystemSelectionViewModel.cs │ ├── GameSystemViewModel.cs │ └── SettingsViewModel.cs ├── RetriX.UWP.Unsafe ├── Components │ ├── FramebufferConverter.cs │ ├── IMemoryBufferByteAccess.cs │ └── RenderTargetManager.cs ├── Properties │ ├── AssemblyInfo.cs │ └── RetriX.UWP.Unsafe.rd.xml ├── RetriX.UWP.Unsafe.csproj └── Services │ ├── AudioService.cs │ ├── InputService.cs │ └── VideoService.cs ├── RetriX.UWP ├── App.xaml ├── App.xaml.cs ├── AppResources.xaml ├── AppResources.xaml.cs ├── Assets │ ├── BadgeLogo.scale-100.png │ ├── BadgeLogo.scale-125.png │ ├── BadgeLogo.scale-150.png │ ├── BadgeLogo.scale-200.png │ ├── BadgeLogo.scale-400.png │ ├── FileIcon.targetsize-16.png │ ├── FileIcon.targetsize-256.png │ ├── FileIcon.targetsize-32.png │ ├── FileIcon.targetsize-48.png │ ├── FileIconMaster.svg │ ├── GameGlyphs.ttf │ ├── Icon Master.svg │ ├── Icons.zip │ ├── LargeTile.scale-100.png │ ├── LargeTile.scale-125.png │ ├── LargeTile.scale-150.png │ ├── LargeTile.scale-200.png │ ├── LargeTile.scale-400.png │ ├── PackageLogo.scale-100.png │ ├── PackageLogo.scale-125.png │ ├── PackageLogo.scale-150.png │ ├── PackageLogo.scale-200.png │ ├── PackageLogo.scale-400.png │ ├── SmallTile.scale-100.png │ ├── SmallTile.scale-125.png │ ├── SmallTile.scale-150.png │ ├── SmallTile.scale-200.png │ ├── SmallTile.scale-400.png │ ├── SplashScreen.scale-100.png │ ├── SplashScreen.scale-125.png │ ├── SplashScreen.scale-150.png │ ├── SplashScreen.scale-200.png │ ├── SplashScreen.scale-400.png │ ├── Square150x150Logo.scale-100.png │ ├── Square150x150Logo.scale-125.png │ ├── Square150x150Logo.scale-150.png │ ├── Square150x150Logo.scale-200.png │ ├── Square150x150Logo.scale-400.png │ ├── Square44x44Logo.altform-unplated_targetsize-16.png │ ├── Square44x44Logo.altform-unplated_targetsize-256.png │ ├── Square44x44Logo.altform-unplated_targetsize-32.png │ ├── Square44x44Logo.altform-unplated_targetsize-48.png │ ├── Square44x44Logo.scale-100.png │ ├── Square44x44Logo.scale-125.png │ ├── Square44x44Logo.scale-150.png │ ├── Square44x44Logo.scale-200.png │ ├── Square44x44Logo.scale-400.png │ ├── Square44x44Logo.targetsize-16.png │ ├── Square44x44Logo.targetsize-24.png │ ├── Square44x44Logo.targetsize-24_altform-unplated.png │ ├── Square44x44Logo.targetsize-256.png │ ├── Square44x44Logo.targetsize-32.png │ ├── Square44x44Logo.targetsize-48.png │ ├── Wide310x150Logo.scale-100.png │ ├── Wide310x150Logo.scale-125.png │ ├── Wide310x150Logo.scale-150.png │ ├── Wide310x150Logo.scale-200.png │ └── Wide310x150Logo.scale-400.png ├── Controls │ ├── FileImporter.xaml │ ├── FileImporter.xaml.cs │ ├── PlayerOverlay.xaml │ ├── PlayerOverlay.xaml.cs │ ├── VirtualPad.xaml │ └── VirtualPad.xaml.cs ├── Converters │ └── ItemClickEventArgsConverter.cs ├── Package.appxmanifest ├── Presentation │ └── CurrentViewModelPresenter.cs ├── Properties │ ├── AssemblyInfo.cs │ └── Default.rd.xml ├── RetriX.UWP.csproj ├── Services │ ├── GameSystemsProviderService.cs │ └── PlatformService.cs ├── Setup.cs ├── Strings │ └── en-US │ │ └── Resources.resw └── Views │ ├── AboutView.xaml │ ├── AboutView.xaml.cs │ ├── GamePlayerView.xaml │ ├── GamePlayerView.xaml.cs │ ├── GameSystemSelectionView.xaml │ ├── GameSystemSelectionView.xaml.cs │ ├── SettingsView.xaml │ └── SettingsView.xaml.cs ├── Retrix.UWP.Native ├── D3DSurfaceMap.cpp ├── D3DSurfaceMap.h ├── Retrix.UWP.Native.vcxproj ├── Retrix.UWP.Native.vcxproj.filters ├── packages.config ├── pch.cpp └── pch.h ├── Snes9X.LibRetriX ├── Core.cs ├── NativeDllInfo.cs └── Snes9X.LibRetriX.csproj ├── Snes9X ├── Snes9X.vcxproj ├── Snes9X.vcxproj.filters └── targetver.h ├── VBAM.LibRetriX ├── Core.cs ├── NativeDllInfo.cs └── VBAM.LibRetriX.csproj ├── VBAM ├── VBAM.vcxproj ├── VBAM.vcxproj.filters └── targetver.h ├── Yabause.LibRetriX ├── Core.cs ├── NativeDllInfo.cs └── Yabause.LibRetriX.csproj ├── Yabause ├── Yabause.vcxproj ├── Yabause.vcxproj.filters └── targetver.h └── readme.md /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "GPGX/src"] 2 | path = GPGX/src 3 | url = https://github.com/libretro/Genesis-Plus-GX.git 4 | branch = master 5 | [submodule "Snes9X/src"] 6 | path = Snes9X/src 7 | url = https://github.com/libretro/snes9x.git 8 | branch = master 9 | [submodule "VBAM/src"] 10 | path = VBAM/src 11 | url = https://github.com/libretro/vbam-libretro.git 12 | branch = master 13 | [submodule "Nestopia/src"] 14 | path = Nestopia/src 15 | url = https://github.com/libretro/nestopia.git 16 | branch = master 17 | [submodule "FCEUMM/src"] 18 | path = FCEUMM/src 19 | url = https://github.com/libretro/libretro-fceumm.git 20 | branch = master 21 | [submodule "Gambatte/src"] 22 | path = Gambatte/src 23 | url = https://github.com/libretro/gambatte-libretro.git 24 | branch = master 25 | [submodule "BeetlePSX/src"] 26 | path = BeetlePSX/src 27 | url = https://github.com/libretro/beetle-psx-libretro.git 28 | branch = master 29 | [submodule "Yabause/src"] 30 | path = Yabause/src 31 | url = https://github.com/libretro/yabause.git 32 | branch = master 33 | [submodule "MelonDS/src"] 34 | path = MelonDS/src 35 | url = https://github.com/libretro/melonDS.git 36 | branch = master 37 | [submodule "ParallelN64/src"] 38 | path = ParallelN64/src 39 | url = https://github.com/libretro/parallel-n64.git 40 | branch = master 41 | [submodule "BeetleWswan/src"] 42 | path = BeetleWswan/src 43 | url = https://github.com/libretro/beetle-wswan-libretro.git 44 | branch = master 45 | [submodule "BeetleNGP/src"] 46 | path = BeetleNGP/src 47 | url = https://github.com/libretro/beetle-ngp-libretro.git 48 | branch = master 49 | [submodule "BeetlePCEFast/src"] 50 | path = BeetlePCEFast/src 51 | url = https://github.com/libretro/beetle-pce-fast-libretro.git 52 | branch = master 53 | [submodule "BeetleSaturn/src"] 54 | path = BeetleSaturn/src 55 | url = https://github.com/libretro/beetle-saturn-libretro.git 56 | branch = master 57 | [submodule "BeetlePCFX/src"] 58 | path = BeetlePCFX/src 59 | url = https://github.com/libretro/beetle-pcfx-libretro.git 60 | branch = master 61 | [submodule "FBAlpha/src"] 62 | path = FBAlpha/src 63 | url = https://github.com/libretro/fbalpha.git 64 | branch = master 65 | -------------------------------------------------------------------------------- /AppXTimeStamper.ps1: -------------------------------------------------------------------------------- 1 | $appXFile = Get-ChildItem -Filter "*.appxbundle" | Select-Object -First 1; 2 | $appXPath = $appXFile.FullName; 3 | &"C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe" sign /fd SHA256 /a /n "Alberto Fustinoni" /tr http://tsa.startssl.com/rfc3161 "$appXPath"; -------------------------------------------------------------------------------- /BeetleNGP.LibRetriX/BeetleNGP.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /BeetleNGP.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.BeetleNGP 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BeetleNGP.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "BeetleNGP"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /BeetleNGP/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /BeetlePCEFast.LibRetriX/BeetlePCEFast.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /BeetlePCEFast.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.BeetlePCEFast 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("syscard3.pce", "PC Engine CD BIOS", "ff1a674273fe3540ccef576376407d1d"), 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /BeetlePCEFast.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "BeetlePCEFast"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /BeetlePCEFast/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /BeetlePCFX.LibRetriX/BeetlePCFX.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /BeetlePCFX.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.BeetlePCFX 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("pcfx.rom", "PC-FX BIOS", "08e36edbea28a017f79f8d4f7ff9b6d7"), 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /BeetlePCFX.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "BeetlePCFX"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /BeetlePCFX/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /BeetlePSX.LibRetriX/BeetlePSX.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /BeetlePSX.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.BeetlePSX 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies, Options, 1); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("scph5500.bin", "PlayStation (v3.0 09/09/96 J) BIOS", "8dd7d5296a650fac7319bce665a6a53c"), 23 | new FileDependency("scph5501.bin", "PlayStation (v3.0 11/18/96 A) BIOS", "490f666e1afb15b7362b406ed1cea246"), 24 | new FileDependency("scph5502.bin", "PlayStation (v3.0 01/06/97 E) BIOS", "32736f17079d0b2b7024407c39bd3050"), 25 | }; 26 | 27 | private static readonly Tuple[] Options = 28 | { 29 | Tuple.Create("beetle_psx_frame_duping_enable", 1U), 30 | Tuple.Create("beetle_psx_analog_calibration", 1U), 31 | Tuple.Create("beetle_psx_skipbios", 1U), 32 | }; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /BeetlePSX.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "BeetlePSX"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /BeetlePSX/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /BeetleSaturn.LibRetriX/BeetleSaturn.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /BeetleSaturn.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.BeetleSaturn 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BeetleSaturn.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "BeetleSaturn"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /BeetleSaturn/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /BeetleWswan.LibRetriX/BeetleWswan.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /BeetleWswan.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.BeetleWswan 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /BeetleWswan.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "BeetleWswan"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /BeetleWswan/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /FBAlpha.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.FBAlpha 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("neogeo.zip", "NeoGeo BIOS collection", "93adcaa22d652417cbc3927d46b11806"), 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /FBAlpha.LibRetriX/FBAlpha.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /FBAlpha.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "FBAlpha"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /FBAlpha/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /FCEUMM.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.FCEUMM 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /FCEUMM.LibRetriX/FCEUMM.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /FCEUMM.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "FCEUMM"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /FCEUMM/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /GPGX.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.GPGX 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("BIOS_CD_E.bin", "Mega-CD (Model 1 1.00 Europe) BIOS", "e66fa1dc5820d254611fdcdba0662372"), 23 | new FileDependency("BIOS_CD_J.bin", "Mega-CD (Model 1 1.00 Japan) BIOS", "278a9397d192149e84e820ac621a8edd"), 24 | new FileDependency("BIOS_CD_U.bin", "Mega-CD (Model 1 1.00 USA) BIOS", "2efd74e3232ff260e371b99f84024f7f"), 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /GPGX.LibRetriX/GPGX.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /GPGX.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "GPGX"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /GPGX/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Gambatte.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.Gambatte 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Gambatte.LibRetriX/Gambatte.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Gambatte.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "Gambatte"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Gambatte/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Enums/InputTypes.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | public enum InputTypes 4 | { 5 | DeviceIdJoypadB, 6 | DeviceIdJoypadY, 7 | DeviceIdJoypadSelect, 8 | DeviceIdJoypadStart, 9 | DeviceIdJoypadUp, 10 | DeviceIdJoypadDown, 11 | DeviceIdJoypadLeft, 12 | DeviceIdJoypadRight, 13 | DeviceIdJoypadA, 14 | DeviceIdJoypadX, 15 | DeviceIdJoypadL, 16 | DeviceIdJoypadR, 17 | DeviceIdJoypadL2, 18 | DeviceIdJoypadR2, 19 | DeviceIdJoypadL3, 20 | DeviceIdJoypadR3, 21 | DeviceIdAnalogLeftX, 22 | DeviceIdAnalogLeftY, 23 | DeviceIdAnalogRightX, 24 | DeviceIdAnalogRightY, 25 | DeviceIdMouseX, 26 | DeviceIdMouseY, 27 | DeviceIdMouseLeft, 28 | DeviceIdMouseRight, 29 | DeviceIdMouseWheelup, 30 | DeviceIdMouseWheeldown, 31 | DeviceIdMouseMiddle, 32 | DeviceIdMouseHorizWheelup, 33 | DeviceIdMouseHorizWheeldown, 34 | DeviceIdLightgunX, 35 | DeviceIdLightgunY, 36 | DeviceIdLightgunTrigger, 37 | DeviceIdLightgunCursor, 38 | DeviceIdLightgunTurbo, 39 | DeviceIdLightgunPause, 40 | DeviceIdLightgunStart, 41 | DeviceIdPointerX, 42 | DeviceIdPointerY, 43 | DeviceIdPointerPressed, 44 | DeviceIdUnknown 45 | }; 46 | } 47 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Enums/PixelFormats.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | public enum PixelFormats 4 | { 5 | /// 6 | /// 0RGB1555, native endian, 0 bit must be set to 0. 7 | /// This pixel format is default for compatibility concerns only. 8 | /// If a 15/16-bit pixel format is desired, consider using RGB565. 9 | /// 10 | RGB0555 = 0, 11 | 12 | /// 13 | /// XRGB8888, native endian. X bits are ignored. 14 | /// 15 | XRGB8888 = 1, 16 | 17 | /// 18 | /// RGB565, native endian. 19 | /// This pixel format is the recommended format to use if a 15/16-bit format is desired 20 | /// as it is the pixel format that is typically available on a wide range of low-power devices. 21 | /// It is also natively supported in APIs like OpenGL ES. 22 | /// 23 | RGB565 = 2, 24 | 25 | Unknown = int.MaxValue 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Enums/Rotations.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | public enum Rotations 4 | { 5 | CCW0 = 0, 6 | CCW90 = 1, 7 | CCW180 = 2, 8 | CCW270 = 3, 9 | }; 10 | } 11 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/ICore.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | 4 | namespace LibRetriX 5 | { 6 | /// 7 | /// Video frame render callbacks 8 | /// 9 | /// Framebuffer data. Only valid while inside the callback 10 | /// Framebufer width in pixels 11 | /// Framebuffer height in pixels 12 | /// Number of elements between horizontal lines (framebuffer is not always packed in memory) 13 | public delegate void RenderVideoFrameUshortDelegate(IReadOnlyList data, uint width, uint height, ulong pitch); 14 | public delegate void RenderVideoFrameUintDelegate(IReadOnlyList data, uint width, uint height, ulong pitch); 15 | 16 | /// 17 | /// Audio data render callback. Use to fill audio buffers of whatever playback mechanism the front end uses 18 | /// 19 | /// Audio data. Only valid while inside the callback 20 | public delegate void RenderAudioFramesDelegate(IReadOnlyList data, ulong numFrames); 21 | 22 | public delegate void PollInputDelegate(); 23 | public delegate short GetInputStateDelegate(uint port, InputTypes inputType); 24 | 25 | public delegate void GeometryChangedDelegate(GameGeometry geometry); 26 | public delegate void TimingsChangedDelegate(SystemTimings timing); 27 | public delegate void RotationChangedDelegate(Rotations rotation); 28 | public delegate void PixelFormatChangedDelegate(PixelFormats format); 29 | 30 | public delegate Stream OpenFileStreamDelegate(string path, FileAccess fileAccess); 31 | public delegate void CloseFileStreamDelegate(Stream stream); 32 | 33 | /// 34 | /// Interface for Libretro cores 35 | /// 36 | public interface ICore 37 | { 38 | string Name { get; } 39 | string Version { get; } 40 | IReadOnlyList SupportedExtensions { get; } 41 | bool NativeArchiveSupport { get; } 42 | 43 | string SystemRootPath { get; set; } 44 | string SaveRootPath { get; set; } 45 | 46 | IReadOnlyDictionary Options { get; } 47 | IReadOnlyList FileDependencies { get; } 48 | 49 | PixelFormats PixelFormat { get; } 50 | GameGeometry Geometry { get; } 51 | SystemTimings Timings { get; } 52 | Rotations Rotation { get; } 53 | ulong SerializationSize { get; } 54 | 55 | bool LoadGame(string mainGameFilePath); 56 | void UnloadGame(); 57 | 58 | void RunFrame(); 59 | void Reset(); 60 | 61 | bool SaveState(Stream outputStream); 62 | bool LoadState(Stream inputStream); 63 | 64 | event RenderVideoFrameUshortDelegate RenderVideoFrameRGB0555; 65 | event RenderVideoFrameUshortDelegate RenderVideoFrameRGB565; 66 | event RenderVideoFrameUintDelegate RenderVideoFrameXRGB8888; 67 | event RenderAudioFramesDelegate RenderAudioFrames; 68 | event PixelFormatChangedDelegate PixelFormatChanged; 69 | event GeometryChangedDelegate GeometryChanged; 70 | event TimingsChangedDelegate TimingsChanged; 71 | event RotationChangedDelegate RotationChanged; 72 | 73 | PollInputDelegate PollInput { get; set; } 74 | GetInputStateDelegate GetInputState { get; set; } 75 | OpenFileStreamDelegate OpenFileStream { get; set; } 76 | CloseFileStreamDelegate CloseFileStream { get; set; } 77 | }; 78 | } 79 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/LibRetriX.Primitives.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.3 5 | LibRetriX 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Types/CoreOption.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | 4 | namespace LibRetriX 5 | { 6 | public class CoreOption 7 | { 8 | public string Description { get; private set; } 9 | public IReadOnlyList Values { get; private set; } 10 | 11 | private uint selectedValueIx; 12 | public uint SelectedValueIx 13 | { 14 | get => selectedValueIx; 15 | set 16 | { 17 | if (value >= Values.Count) 18 | { 19 | throw new ArgumentException(); 20 | } 21 | 22 | selectedValueIx = value; 23 | } 24 | } 25 | 26 | public CoreOption(string description, IReadOnlyList values) 27 | { 28 | Description = description; 29 | Values = values; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Types/FileDependency.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | public class FileDependency 4 | { 5 | public string Name { get; private set; } 6 | public string Description { get; private set; } 7 | public string MD5 { get; private set; } 8 | 9 | public FileDependency(string name, string description, string md5) 10 | { 11 | Name = name; 12 | Description = description; 13 | MD5 = md5; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Types/GameGeometry.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace LibRetriX 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct GameGeometry 7 | { 8 | private uint baseWidth; 9 | /// 10 | /// Nominal video width of game 11 | /// 12 | public uint BaseWidth => baseWidth; 13 | 14 | private uint baseHeight; 15 | /// 16 | /// Nominal video height of game 17 | /// 18 | public uint BaseHeight => baseHeight; 19 | 20 | private uint maxWidth; 21 | /// 22 | /// Maximum possible width of game 23 | /// 24 | public uint MaxWidth => maxWidth; 25 | 26 | private uint maxHeight; 27 | /// 28 | /// Maximum possible height of game 29 | /// 30 | public uint MaxHeight => maxHeight; 31 | 32 | private float aspectRatio; 33 | /// 34 | /// Nominal aspect ratio of game. 35 | /// If aspect_ratio is <= 0.0, an aspect ratio 36 | /// of base_width / base_height is assumed. 37 | /// A frontend could override this setting 38 | /// if desired 39 | /// 40 | public float AspectRatio => aspectRatio; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Primitives/Types/SystemTimings.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace LibRetriX 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct SystemTimings 7 | { 8 | private double fps; 9 | /// 10 | /// FPS of video content 11 | /// 12 | public double FPS => fps; 13 | 14 | private double sampleRate; 15 | /// 16 | /// Sampling rate of audio 17 | /// 18 | public double SampleRate => sampleRate; 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings.Static/LibRetriX.RetroBindings.Static.projitems: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | $(MSBuildAllProjects);$(MSBuildThisFileFullPath) 5 | true 6 | 3f31cf6f-c2df-489a-9c2a-0b9958d0c143 7 | 8 | 9 | LibRetriX.RetroBindings 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings.Static/LibRetriX.RetroBindings.Static.shproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 3f31cf6f-c2df-489a-9c2a-0b9958d0c143 5 | 14.0 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/ControllerDescription.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct ControllerDescription 8 | { 9 | private IntPtr descriptionStringPtr; 10 | /// 11 | /// Human-readable description of the controller. 12 | /// Even if using a generic input device type, this can be set to the particular device type the core uses. 13 | /// 14 | public IntPtr DescriptionStringPtr => descriptionStringPtr; 15 | 16 | private uint id; 17 | /// 18 | /// Device type passed to retro_set_controller_port_device(). 19 | /// If the device type is a sub-class of a generic input device type, 20 | /// use the RETRO_DEVICE_SUBCLASS macro to create an ID. 21 | /// E.g. RETRO_DEVICE_SUBCLASS(RETRO_DEVICE_JOYPAD, 1). 22 | /// 23 | public uint Id => id; 24 | }; 25 | } 26 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/ControllerInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct ControllerInfo 8 | { 9 | private IntPtr descriptionsPtr; 10 | public IntPtr DescriptionsPtr => descriptionsPtr; 11 | 12 | private uint numDescriptions; 13 | public uint NumDescriptions => numDescriptions; 14 | }; 15 | } 16 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/Framebuffer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct Framebuffer 8 | { 9 | private IntPtr data; 10 | /// 11 | /// The framebuffer which the core can render into. 12 | /// Set by frontend in GET_CURRENT_SOFTWARE_FRAMEBUFFER. 13 | /// The initial contents of data are unspecified. 14 | /// 15 | public IntPtr Data => data; 16 | 17 | private uint width; 18 | /// 19 | /// The framebuffer width used by the core. Set by core. 20 | /// 21 | public uint Width => width; 22 | 23 | private uint height; 24 | /// 25 | /// The framebuffer height used by the core. Set by core. 26 | /// 27 | public uint Height => height; 28 | 29 | private IntPtr pitch; 30 | /// 31 | /// The number of bytes between the beginning of a scanline, 32 | /// and beginning of the next scanline. 33 | /// Set by frontend in GET_CURRENT_SOFTWARE_FRAMEBUFFER. 34 | /// 35 | public IntPtr Pitch => pitch; 36 | 37 | private PixelFormats format; 38 | /// 39 | /// The pixel format the core must use to render into data. 40 | /// This format could differ from the format used in SET_PIXEL_FORMAT. 41 | /// Set by frontend in GET_CURRENT_SOFTWARE_FRAMEBUFFER. 42 | /// 43 | public PixelFormats Format => format; 44 | 45 | private uint accessFlags; 46 | /// 47 | /// How the core will access the memory in the framebuffer. 48 | /// RETRO_MEMORY_ACCESS_* flags. 49 | /// Set by core. */ 50 | /// 51 | public uint AccessFlags => accessFlags; 52 | 53 | private uint memoryFlags; 54 | /// 55 | /// Flags telling core how the memory has been mapped. 56 | /// RETRO_MEMORY_TYPE_* flags. 57 | /// Set by frontend in GET_CURRENT_SOFTWARE_FRAMEBUFFER 58 | /// 59 | public uint MemoryFlags => memoryFlags; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/GameInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 7 | public struct GameInfo 8 | { 9 | [MarshalAs(UnmanagedType.LPStr)] 10 | private string path; 11 | /// 12 | /// Path to game. Sometimes used as a reference for building other paths. 13 | /// May be NULL if game was loaded from stdin or similar, but in this case some cores will be unable to load `data`. 14 | /// So, it is preferable to fabricate something here instead of passing NULL, which will help more cores to succeed. 15 | /// retro_system_info::need_fullpath requires that this path is valid. 16 | /// 17 | public string Path 18 | { 19 | get { return path; } 20 | set { path = value; } 21 | } 22 | 23 | private IntPtr dataPtr; 24 | private IntPtr dataSize; 25 | /// 26 | /// Set game data to the specified array 27 | /// 28 | /// Byte array holding game data 29 | /// Handle to pinned data. Release when unloading game. 30 | public GCHandle SetGameData(byte[] data) 31 | { 32 | var handle = GCHandle.Alloc(data, GCHandleType.Pinned); 33 | dataPtr = handle.AddrOfPinnedObject(); 34 | dataSize = (IntPtr)data.Length; 35 | return handle; 36 | } 37 | 38 | private IntPtr meta; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/HwRenderContextNegotiationInterfaceTypes.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX.RetroBindings 2 | { 3 | public enum HwRenderContextNegotiationInterfaceTypes 4 | { 5 | Vulkan = 0, 6 | Dummy = int.MaxValue 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/HwRenderInterfaceTypes.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX.RetroBindings 2 | { 3 | public enum HwRenderInterfaceTypes 4 | { 5 | Vulkan = 0, 6 | Dumy = int.MaxValue 7 | }; 8 | } 9 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/Languages.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX.RetroBindings 2 | { 3 | public enum Languages 4 | { 5 | RETRO_LANGUAGE_ENGLISH = 0, 6 | RETRO_LANGUAGE_JAPANESE = 1, 7 | RETRO_LANGUAGE_FRENCH = 2, 8 | RETRO_LANGUAGE_SPANISH = 3, 9 | RETRO_LANGUAGE_GERMAN = 4, 10 | RETRO_LANGUAGE_ITALIAN = 5, 11 | RETRO_LANGUAGE_DUTCH = 6, 12 | RETRO_LANGUAGE_PORTUGUESE_BRAZIL = 7, 13 | RETRO_LANGUAGE_PORTUGUESE_PORTUGAL = 8, 14 | RETRO_LANGUAGE_RUSSIAN = 9, 15 | RETRO_LANGUAGE_KOREAN = 10, 16 | RETRO_LANGUAGE_CHINESE_TRADITIONAL = 11, 17 | RETRO_LANGUAGE_CHINESE_SIMPLIFIED = 12, 18 | RETRO_LANGUAGE_ESPERANTO = 13, 19 | RETRO_LANGUAGE_POLISH = 14, 20 | RETRO_LANGUAGE_VIETNAMESE = 15, 21 | RETRO_LANGUAGE_LAST, 22 | 23 | /* Ensure sizeof(enum) == sizeof(int) */ 24 | RETRO_LANGUAGE_DUMMY = int.MaxValue 25 | }; 26 | } 27 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/LibRetriX.RetroBindings.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | UnmanagedLists.tt 15 | True 16 | True 17 | 18 | 19 | 20 | 21 | 22 | UnmanagedLists.cs 23 | TextTemplatingFileGenerator 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/LibretroVariable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct LibretroVariable 8 | { 9 | private IntPtr keyPtr; 10 | /// 11 | /// Variable to query in RETRO_ENVIRONMENT_GET_VARIABLE. 12 | /// If NULL, obtains the complete environment string if more complex parsing is necessary. 13 | /// The environment string is formatted as key-value pairs delimited by semicolons as so: 14 | /// "key1=value1;key2=value2;..." 15 | /// 16 | public IntPtr KeyPtr => keyPtr; 17 | 18 | private IntPtr valuePtr; 19 | /// 20 | /// Value to be obtained. If key does not exist, it is set to NULL. 21 | /// 22 | public IntPtr ValuePtr 23 | { 24 | get => valuePtr; 25 | set { valuePtr = value; } 26 | } 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/LogCallbackDescriptor.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace LibRetriX.RetroBindings 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct LogCallbackDescriptor 7 | { 8 | private LibretroLogDelegate logCallback; 9 | public LibretroLogDelegate LogCallback 10 | { 11 | get => logCallback; 12 | set { logCallback = value; } 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/LogLevels.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX.RetroBindings 2 | { 3 | public enum LogLevels 4 | { 5 | Debug = 0, 6 | Info, 7 | Warning, 8 | Error, 9 | 10 | Fummy = int.MaxValue 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/Modifiers.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX.RetroBindings 2 | { 3 | public enum Modifiers 4 | { 5 | RETROKMOD_NONE = 0x0000, 6 | 7 | RETROKMOD_SHIFT = 0x01, 8 | RETROKMOD_CTRL = 0x02, 9 | RETROKMOD_ALT = 0x04, 10 | RETROKMOD_META = 0x08, 11 | 12 | RETROKMOD_NUMLOCK = 0x10, 13 | RETROKMOD_CAPSLOCK = 0x20, 14 | RETROKMOD_SCROLLOCK = 0x40, 15 | 16 | RETROKMOD_DUMMY = int.MaxValue /* Ensure sizeof(enum) == sizeof(int) */ 17 | }; 18 | } 19 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/SystemAVInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace LibRetriX.RetroBindings 4 | { 5 | [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] 6 | public struct SystemAVInfo 7 | { 8 | private GameGeometry geometry; 9 | public GameGeometry Geometry => geometry; 10 | 11 | private SystemTimings timings; 12 | public SystemTimings Timings => timings; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/SystemInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | /// 7 | /// All pointers are owned by libretro implementation, and pointers must 8 | /// remain valid until retro_deinit() is called. 9 | /// 10 | [StructLayout(LayoutKind.Sequential)] 11 | public struct SystemInfo 12 | { 13 | private IntPtr libraryName; 14 | /// 15 | /// Descriptive name of library. Should not contain any version numbers, etc. 16 | /// 17 | public string LibraryName => Marshal.PtrToStringAnsi(libraryName); 18 | 19 | private IntPtr libraryVersion; 20 | /// 21 | /// Descriptive version of core. 22 | /// 23 | public string LibraryVersion => Marshal.PtrToStringAnsi(libraryVersion); 24 | 25 | private IntPtr validExtensions; 26 | /// 27 | /// A string listing probably content extensions the core will be able to load, separated with pipe. 28 | /// I.e. "bin|rom|iso". 29 | /// Typically used for a GUI to filter out extensions. 30 | /// 31 | public string ValidExtensions => Marshal.PtrToStringAnsi(validExtensions); 32 | 33 | [MarshalAs(UnmanagedType.I1)] 34 | private bool needFullpath; 35 | /// 36 | /// If true, retro_load_game() is guaranteed to provide a valid pathname in path. data and size are both invalid. 37 | /// If false, data and size are guaranteed to be valid, path might not be valid. 38 | /// This is typically set to true for libretro implementations that must load from file. 39 | /// Implementations should strive for setting this to false, as it allows the frontend to perform patching, etc. 40 | /// 41 | public bool NeedFullpath => needFullpath; 42 | 43 | [MarshalAs(UnmanagedType.I1)] 44 | private bool blockExtract; 45 | /// 46 | /// If true, the frontend is not allowed to extract any archives before loading the real content. 47 | /// Necessary for certain libretro implementations that load games from zipped archives. 48 | /// 49 | public bool BlockExtract => blockExtract; 50 | }; 51 | } 52 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/Unsafe/UnmanagedLists.tt: -------------------------------------------------------------------------------- 1 | <#@ template hostspecific="false" language="C#" #> 2 | <#@ output extension=".cs" #> 3 | 4 | using System; 5 | using System.Collections; 6 | using System.Collections.Generic; 7 | 8 | namespace LibRetriX.RetroBindings.Unsafe 9 | { 10 | <# foreach(var TemplateData in new Tuple[] { Tuple.Create("Short","short"), Tuple.Create("UShort","ushort"), Tuple.Create("Int","int"), Tuple.Create("UInt","uint")}) 11 | { 12 | #> 13 | public unsafe class UnmanagedList<#Write($"{TemplateData.Item1}");#> : IReadOnlyList<<#Write($"{TemplateData.Item2}");#>> 14 | { 15 | private class InnerEnumerator : IEnumerator<<#Write($"{TemplateData.Item2}");#>> 16 | { 17 | private <#Write($"{TemplateData.Item2}");#>* StartPtr { get; } 18 | private <#Write($"{TemplateData.Item2}");#>* EndPtr { get; } 19 | private <#Write($"{TemplateData.Item2}");#>* CurrentPtr { get; set; } = null; 20 | 21 | public <#Write($"{TemplateData.Item2}");#> Current => *CurrentPtr; 22 | object IEnumerator.Current => Current; 23 | 24 | public InnerEnumerator(<#Write($"{TemplateData.Item2}");#>* startPtr, <#Write($"{TemplateData.Item2}");#>* endPtr) 25 | { 26 | StartPtr = startPtr; 27 | EndPtr = endPtr; 28 | } 29 | 30 | public void Dispose() 31 | { 32 | } 33 | 34 | public bool MoveNext() 35 | { 36 | CurrentPtr++; 37 | return CurrentPtr < EndPtr; 38 | } 39 | 40 | public void Reset() 41 | { 42 | CurrentPtr = StartPtr; 43 | } 44 | } 45 | 46 | private <#Write($"{TemplateData.Item2}");#>* StartPtr { get; } 47 | 48 | public int Count { get; } 49 | public <#Write($"{TemplateData.Item2}");#> this[int index] => StartPtr[index]; 50 | 51 | public UnmanagedList<#Write($"{TemplateData.Item1}");#>(IntPtr startPtr, int count) 52 | { 53 | StartPtr = (<#Write($"{TemplateData.Item2}");#>*)startPtr.ToPointer(); 54 | Count = count; 55 | } 56 | 57 | public IEnumerator<<#Write($"{TemplateData.Item2}");#>> GetEnumerator() 58 | { 59 | return new InnerEnumerator(StartPtr, StartPtr + Count); 60 | } 61 | 62 | IEnumerator IEnumerable.GetEnumerator() 63 | { 64 | return GetEnumerator(); 65 | } 66 | } 67 | 68 | <# 69 | } 70 | #> 71 | } 72 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/VFSInterface.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.InteropServices; 2 | 3 | namespace LibRetriX.RetroBindings 4 | { 5 | [StructLayout(LayoutKind.Sequential)] 6 | public struct VFSInterface 7 | { 8 | private VFSGetPathDelegate getPath; 9 | public VFSGetPathDelegate GetPath 10 | { 11 | get => getPath; 12 | set { getPath = value; } 13 | } 14 | 15 | private VFSOpenDelegate open; 16 | public VFSOpenDelegate Open 17 | { 18 | get => open; 19 | set { open = value; } 20 | } 21 | 22 | private VFSCloseDelegate close; 23 | public VFSCloseDelegate Close 24 | { 25 | get => close; 26 | set { close = value; } 27 | } 28 | 29 | private VFSGetSizeDelegate getSize; 30 | public VFSGetSizeDelegate GetSize 31 | { 32 | get => getSize; 33 | set { getSize = value; } 34 | } 35 | 36 | private VFSGetPositionDelegate getPosition; 37 | public VFSGetPositionDelegate GetPosition 38 | { 39 | get => getPosition; 40 | set { getPosition = value; } 41 | } 42 | 43 | private VFSSetPositionDelegate setPosition; 44 | public VFSSetPositionDelegate SetPosition 45 | { 46 | get => setPosition; 47 | set { setPosition = value; } 48 | } 49 | 50 | private VFSReadDelegate read; 51 | public VFSReadDelegate Read 52 | { 53 | get => read; 54 | set { read = value; } 55 | } 56 | 57 | private VFSWriteDelegate write; 58 | public VFSWriteDelegate Write 59 | { 60 | get => write; 61 | set { write = value; } 62 | } 63 | 64 | private VFSFlushDelegate flush; 65 | public VFSFlushDelegate Flush 66 | { 67 | get => flush; 68 | set { flush = value; } 69 | } 70 | 71 | private VFSDeleteDelegate delete; 72 | public VFSDeleteDelegate Delete 73 | { 74 | get => delete; 75 | set { delete = value; } 76 | } 77 | 78 | private VFSRenameDelegate rename; 79 | public VFSRenameDelegate Rename 80 | { 81 | get => rename; 82 | set { rename = value; } 83 | } 84 | }; 85 | } 86 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.RetroBindings/VFSInterfaceInfo.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace LibRetriX.RetroBindings 5 | { 6 | [StructLayout(LayoutKind.Sequential)] 7 | public struct VFSInterfaceInfo 8 | { 9 | private uint requiredInterfaceVersion; 10 | /// 11 | /// Set by core: should this be higher than the version the front end supports, 12 | /// front end will return false in the RETRO_ENVIRONMENT_GET_VFS_INTERFACE call. 13 | /// Introduced in VFS API v1. 14 | /// 15 | public uint RequiredInterfaceVersion 16 | { 17 | get => requiredInterfaceVersion; 18 | set { requiredInterfaceVersion = value; } 19 | } 20 | 21 | private IntPtr vfs_interface; 22 | /// 23 | /// Frontend writes interface function pointers here. 24 | /// The frontend also sets the actual version, must be at least required_interface_version. 25 | /// Introduced in VFS API v1. 26 | /// 27 | public IntPtr Interface 28 | { 29 | get => vfs_interface; 30 | set { vfs_interface = value; } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.Base/LibRetriX.Test.Base.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netstandard1.4 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.Base/StreamProvider.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | 6 | namespace LibRetriX.Test.Base 7 | { 8 | public class StreamProvider : IDisposable 9 | { 10 | private readonly string handledScheme; 11 | public string HandledScheme => handledScheme; 12 | 13 | private readonly IDirectoryInfo RootFolder; 14 | private readonly List OpenStreams = new List(); 15 | 16 | public StreamProvider(string scheme, IDirectoryInfo rootFolder) 17 | { 18 | handledScheme = scheme; 19 | RootFolder = rootFolder; 20 | } 21 | 22 | public void Dispose() 23 | { 24 | foreach (var i in OpenStreams) 25 | { 26 | i.Dispose(); 27 | } 28 | } 29 | 30 | public Stream OpenFileStream(string path, FileAccess fileAccess) 31 | { 32 | if (fileAccess != FileAccess.Read) 33 | { 34 | var memoryStream = new MemoryStream(); 35 | OpenStreams.Add(memoryStream); 36 | return memoryStream; 37 | } 38 | 39 | path = path.Substring(HandledScheme.Length); 40 | var output = default(Stream); 41 | try 42 | { 43 | var file = RootFolder.GetFileAsync(path).Result; 44 | output = file.OpenAsync(fileAccess).Result; 45 | } 46 | catch 47 | { 48 | return null; 49 | } 50 | 51 | OpenStreams.Add(output); 52 | return output; 53 | } 54 | 55 | public void CloseFileStream(Stream stream) 56 | { 57 | if (OpenStreams.Contains(stream)) 58 | { 59 | stream.Dispose(); 60 | OpenStreams.Remove(stream); 61 | } 62 | } 63 | } 64 | } 65 | 66 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/LockScreenLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/LockScreenLogo.scale-200.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/StoreLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/StoreLogo.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibRetriX/LibRetriX.Test.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/BeetleNGPTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.BeetleNGP; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class BeetleNGPTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "NeoGeoPocketGame.ngc" }, 14 | }; 15 | 16 | public BeetleNGPTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/BeetlePCEFastTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.BeetlePCEFast; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class BeetlePCEFastTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "PCEngineGame.pce" }, 14 | new object[] { "PCEngineCDGame.chd" } 15 | }; 16 | 17 | public BeetlePCEFastTest() : base(() => Core.Instance) 18 | { 19 | } 20 | 21 | [Theory] 22 | [MemberData(nameof(RomNames))] 23 | public override Task LoadingRomWorks(string romName) 24 | { 25 | return LoadingRomWorksInternal(romName); 26 | } 27 | 28 | [Theory] 29 | [MemberData(nameof(RomNames))] 30 | public override Task ExecutionWorks(string romName) 31 | { 32 | return ExecutionWorksInternal(romName); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/BeetlePCFXTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.BeetlePCFX; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class BeetlePCFXTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "PCFXGame.chd" }, 14 | }; 15 | 16 | public BeetlePCFXTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/BeetlePSXTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.BeetlePSX; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class BeetlePSXTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "PlayStationGame.chd" }, 14 | }; 15 | 16 | public BeetlePSXTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/BeetleWswanTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.BeetleWswan; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class BeetleWswanTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "WonderSwanGame.wsc" }, 14 | }; 15 | 16 | public BeetleWswanTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/FBAlphaTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.FBAlpha; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class FBAlphaTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "3wondersu.zip" }, 14 | new object[] { "dkong.zip" }, 15 | new object[] { "mslug.zip" }, 16 | new object[] { "sfiii.zip" }, 17 | new object[] { "xmcota.zip" }, 18 | }; 19 | 20 | public FBAlphaTest() : base(() => Core.Instance) 21 | { 22 | } 23 | 24 | [Theory] 25 | [MemberData(nameof(RomNames))] 26 | public override Task LoadingRomWorks(string romName) 27 | { 28 | return LoadingRomWorksInternal(romName); 29 | } 30 | 31 | [Theory] 32 | [MemberData(nameof(RomNames))] 33 | public override Task ExecutionWorks(string romName) 34 | { 35 | return ExecutionWorksInternal(romName); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/FCEUMMTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.FCEUMM; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class FCEUMMTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "NESGame.nes" }, 14 | }; 15 | 16 | public FCEUMMTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/GPGXTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.GPGX; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class GPGXTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "GenesisGame.md" }, 14 | new object[] { "MegaCDGame.chd" } 15 | }; 16 | 17 | public GPGXTest() : base(() => Core.Instance) 18 | { 19 | } 20 | 21 | [Theory] 22 | [MemberData(nameof(RomNames))] 23 | public override Task LoadingRomWorks(string romName) 24 | { 25 | return LoadingRomWorksInternal(romName); 26 | } 27 | 28 | [Theory] 29 | [MemberData(nameof(RomNames))] 30 | public override Task ExecutionWorks(string romName) 31 | { 32 | return ExecutionWorksInternal(romName); 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/GambatteTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.Gambatte; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class GambatteTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "GBCGame.gbc" }, 14 | }; 15 | 16 | public GambatteTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/MelonDSTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.MelonDS; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class MelonDSTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "NDSGame.nds" }, 14 | }; 15 | 16 | public MelonDSTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/NestopiaTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.Nestopia; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class NestopiaTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "NESGame.nes" }, 14 | }; 15 | 16 | public NestopiaTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Package.appxmanifest: -------------------------------------------------------------------------------- 1 |  2 | 7 | 8 | 11 | 12 | 13 | 14 | 15 | LibRetriX.Test.UWP 16 | Alberto 17 | Assets\StoreLogo.png 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | [assembly: AssemblyTitle("LibRetriX.Test.UWP")] 6 | [assembly: AssemblyDescription("")] 7 | [assembly: AssemblyConfiguration("")] 8 | [assembly: AssemblyCompany("")] 9 | [assembly: AssemblyProduct("LibRetriX.Test.UWP")] 10 | [assembly: AssemblyCopyright("Copyright © 2018")] 11 | [assembly: AssemblyTrademark("")] 12 | [assembly: AssemblyCulture("")] 13 | [assembly: AssemblyMetadata("TargetPlatform","UAP")] 14 | 15 | // [assembly: AssemblyVersion("1.0.*")] 16 | [assembly: AssemblyVersion("1.0.0.0")] 17 | [assembly: AssemblyFileVersion("1.0.0.0")] 18 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Properties/UnitTestApp.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/Snes9XTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.Snes9X; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class Snes9XTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "SNESGame.sfc" }, 14 | }; 15 | 16 | public Snes9XTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/UnitTestApp.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 9 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/UnitTestApp.xaml.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Runtime.InteropServices.WindowsRuntime; 6 | using Windows.ApplicationModel; 7 | using Windows.ApplicationModel.Activation; 8 | using Windows.Foundation; 9 | using Windows.Foundation.Collections; 10 | using Windows.UI.Xaml; 11 | using Windows.UI.Xaml.Controls; 12 | using Windows.UI.Xaml.Controls.Primitives; 13 | using Windows.UI.Xaml.Data; 14 | using Windows.UI.Xaml.Input; 15 | using Windows.UI.Xaml.Media; 16 | using Windows.UI.Xaml.Navigation; 17 | 18 | namespace LibRetriX.Test.UWP 19 | { 20 | /// 21 | /// Provides application-specific behavior to supplement the default Application class. 22 | /// 23 | sealed partial class App : Application 24 | { 25 | /// 26 | /// Initializes the singleton application object. This is the first line of authored code 27 | /// executed, and as such is the logical equivalent of main() or WinMain(). 28 | /// 29 | public App() 30 | { 31 | this.InitializeComponent(); 32 | this.Suspending += OnSuspending; 33 | } 34 | 35 | /// 36 | /// Invoked when the application is launched normally by the end user. Other entry points 37 | /// will be used such as when the application is launched to open a specific file. 38 | /// 39 | /// Details about the launch request and process. 40 | protected override void OnLaunched(LaunchActivatedEventArgs e) 41 | { 42 | 43 | #if DEBUG 44 | if (System.Diagnostics.Debugger.IsAttached) 45 | { 46 | this.DebugSettings.EnableFrameRateCounter = true; 47 | } 48 | #endif 49 | 50 | Frame rootFrame = Window.Current.Content as Frame; 51 | 52 | // Do not repeat app initialization when the Window already has content, 53 | // just ensure that the window is active 54 | if (rootFrame == null) 55 | { 56 | // Create a Frame to act as the navigation context and navigate to the first page 57 | rootFrame = new Frame(); 58 | 59 | rootFrame.NavigationFailed += OnNavigationFailed; 60 | 61 | if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) 62 | { 63 | //TODO: Load state from previously suspended application 64 | } 65 | 66 | // Place the frame in the current Window 67 | Window.Current.Content = rootFrame; 68 | } 69 | 70 | Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI(); 71 | 72 | // Ensure the current window is active 73 | Window.Current.Activate(); 74 | 75 | Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments); 76 | } 77 | 78 | /// 79 | /// Invoked when Navigation to a certain page fails 80 | /// 81 | /// The Frame which failed navigation 82 | /// Details about the navigation failure 83 | void OnNavigationFailed(object sender, NavigationFailedEventArgs e) 84 | { 85 | throw new Exception("Failed to load Page " + e.SourcePageType.FullName); 86 | } 87 | 88 | /// 89 | /// Invoked when application execution is being suspended. Application state is saved 90 | /// without knowing whether the application will be terminated or resumed with the contents 91 | /// of memory still intact. 92 | /// 93 | /// The source of the suspend request. 94 | /// Details about the suspend request. 95 | private void OnSuspending(object sender, SuspendingEventArgs e) 96 | { 97 | var deferral = e.SuspendingOperation.GetDeferral(); 98 | //TODO: Save application state and stop any background activity 99 | deferral.Complete(); 100 | } 101 | } 102 | } 103 | -------------------------------------------------------------------------------- /LibRetriX/LibRetriX.Test.UWP/VBAMTest.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.VBAM; 2 | using LibRetriX.Test.Base; 3 | using System.Collections.Generic; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace LibRetriX.Test.UWP 8 | { 9 | public class VBAMTest : CoreTestBase 10 | { 11 | public static IEnumerable RomNames => new List 12 | { 13 | new object[] { "GBAGame.gba" }, 14 | }; 15 | 16 | public VBAMTest() : base(() => Core.Instance) 17 | { 18 | } 19 | 20 | [Theory] 21 | [MemberData(nameof(RomNames))] 22 | public override Task LoadingRomWorks(string romName) 23 | { 24 | return LoadingRomWorksInternal(romName); 25 | } 26 | 27 | [Theory] 28 | [MemberData(nameof(RomNames))] 29 | public override Task ExecutionWorks(string romName) 30 | { 31 | return ExecutionWorksInternal(romName); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /LibretroRTLogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/LibretroRTLogo.png -------------------------------------------------------------------------------- /MelonDS.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.MelonDS 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("bios7.bin", "Nintendo DS ARM7 BIOS", "df692a80a5b1bc90728bc3dfc76cd948"), 23 | new FileDependency("bios9.bin", "Nintendo DS ARM9 BIOS", "a392174eb3e572fed6447e956bde4b25"), 24 | new FileDependency("firmware.bin", "Nintendo DS Firmware", "b10f39a8a5a573753406f9da2e7232c8"), 25 | }; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /MelonDS.LibRetriX/MelonDS.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /MelonDS.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "MelonDS"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /MelonDS/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Nestopia.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.Nestopia 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(Dependencies); 16 | core.Initialize(); 17 | return core; 18 | } 19 | 20 | private static readonly FileDependency[] Dependencies = 21 | { 22 | new FileDependency("disksys.rom", "Famicom Disk System BIOS", "ca30b50f880eb660a320674ed365ef7a"), 23 | }; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Nestopia.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "Nestopia"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Nestopia.LibRetriX/Nestopia.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Nestopia/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /ParallelN64.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.ParallelN64 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /ParallelN64.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "ParallelN64"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /ParallelN64.LibRetriX/ParallelN64.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /ParallelN64/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/ExtensionMethods/StringHasherTest.cs: -------------------------------------------------------------------------------- 1 | using RetriX.Shared.ExtensionMethods; 2 | using Xunit; 3 | 4 | namespace RetriX.Shared.Test.ExtensionMethods 5 | { 6 | public class StringHasherTest 7 | { 8 | private const string TestString = nameof(TestString); 9 | 10 | [Fact] 11 | public void MD5Works() 12 | { 13 | var expectedvalue = "5b56f40f8828701f97fa4511ddcd25fb"; 14 | Assert.Equal(expectedvalue, TestString.MD5()); 15 | Assert.Equal(expectedvalue, TestString.MD5()); 16 | } 17 | 18 | [Fact] 19 | public void SHA1Works() 20 | { 21 | var expectedvalue = "d598b03bee8866ae03b54cb6912efdfef107fd6d"; 22 | Assert.Equal(expectedvalue, TestString.SHA1()); 23 | Assert.Equal(expectedvalue, TestString.SHA1()); 24 | } 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/RetriX.Shared.Test.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | netcoreapp2.0 5 | 6 | false 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | PreserveNewest 24 | 25 | 26 | PreserveNewest 27 | 28 | 29 | PreserveNewest 30 | 31 | 32 | PreserveNewest 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/Services/CryptographyServiceTest.cs: -------------------------------------------------------------------------------- 1 | using RetriX.Shared.Services; 2 | using System.Threading.Tasks; 3 | using Xunit; 4 | 5 | namespace RetriX.Shared.Test.Services 6 | { 7 | public class CryptographyServiceTest : TestBase 8 | { 9 | protected override CryptographyService InstantiateTarget() 10 | { 11 | return new CryptographyService(); 12 | } 13 | 14 | [Theory] 15 | [InlineData("TestFile.txt", "669539c50a711d6ae846d4e554600798")] 16 | public async Task MD5ComputingWorks(string fileName, string expectedMD5) 17 | { 18 | var folder = await GetTestFilesFolderAsync(); 19 | var file = await folder.GetFileAsync(fileName); 20 | var md5 = await Target.ComputeMD5Async(file); 21 | 22 | Assert.Equal(expectedMD5.ToLowerInvariant(), md5.ToLowerInvariant()); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/StreamProviders/ArchiveStreamProviderTest.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | using Xunit; 3 | 4 | namespace RetriX.Shared.Test.StreamProviders 5 | { 6 | /*public class ArchiveStreamProviderTest : FileProviderTestBase 7 | { 8 | protected override ArchiveStreamProvider InstantiateTarget() 9 | { 10 | var file = GetTestFilesFolderAsync().Result.GetFileAsync("Archive.zip").Result; 11 | return new ArchiveStreamProvider("scheme:\\", file); 12 | } 13 | 14 | [Fact] 15 | public Task ListingEntriesWorks() 16 | { 17 | return ListingEntriesWorks(4); 18 | } 19 | 20 | [Theory] 21 | [InlineData("scheme:\\TestFile.txt", true)] 22 | [InlineData("scheme:\\AnotherFile.cds", true)] 23 | [InlineData("scheme:\\Afolder\\File.zzz", true)] 24 | [InlineData("scheme2:\\SomeFile.ext", false)] 25 | [InlineData("scheme:\\SomeFi.ext", false)] 26 | [InlineData("scheme:\\Dir\\file.ext", false)] 27 | public Task OpeningFileWorks(string path, bool expectedSuccess) 28 | { 29 | return OpeningFileWorksInternal(path, expectedSuccess); 30 | } 31 | }*/ 32 | } 33 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/StreamProviders/FolderStreamProviderTest.cs: -------------------------------------------------------------------------------- 1 | using RetriX.Shared.StreamProviders; 2 | using System.Threading.Tasks; 3 | using Xunit; 4 | 5 | namespace RetriX.Shared.Test.StreamProviders 6 | { 7 | public class FolderStreamProviderTest : StreamProviderTestBase 8 | { 9 | const string HandledScheme = "SCHEME"; 10 | 11 | protected override async Task GetTargetAsync() 12 | { 13 | var folder = await GetTestFilesFolderAsync(); 14 | return new FolderStreamProvider(HandledScheme, folder); 15 | } 16 | 17 | [Fact] 18 | public Task ListingEntriesWorks() 19 | { 20 | return ListingEntriesWorksInternal(4); 21 | } 22 | 23 | [Theory] 24 | [InlineData("SCHEME\\TestFile.txt", true)] 25 | [InlineData("SCHEME\\Archive.zip", true)] 26 | [InlineData("SCHEME\\A\\B\\AnotherFile.cds", true)] 27 | [InlineData("SCHEME\\A\\C\\AnotherFile.cds", false)] 28 | [InlineData("ASCHEME\\Archive.zip", false)] 29 | [InlineData("ASCHEME\\SomeFi.ext", false)] 30 | [InlineData("ASCHEME\\Dir\\file.ext", false)] 31 | public Task OpeningFileWorks(string path, bool expectedSuccess) 32 | { 33 | return OpeningFileWorksInternal(path, expectedSuccess); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/StreamProviders/SingleFileStreamProviderTest.cs: -------------------------------------------------------------------------------- 1 | using RetriX.Shared.StreamProviders; 2 | using System.Threading.Tasks; 3 | using Xunit; 4 | 5 | namespace RetriX.Shared.Test.StreamProviders 6 | { 7 | public class SingleFileStreamProviderTest : StreamProviderTestBase 8 | { 9 | private const string FilePath = "SCHEME\\SomeFile.ext"; 10 | 11 | protected override async Task GetTargetAsync() 12 | { 13 | var folder = await GetTestFilesFolderAsync(); 14 | var file = await folder.GetFileAsync("TestFile.txt"); 15 | return new SingleFileStreamProvider(FilePath, file); 16 | } 17 | 18 | [Fact] 19 | public Task ListingEntriesWorks() 20 | { 21 | return ListingEntriesWorksInternal(1); 22 | } 23 | 24 | [Theory] 25 | [InlineData(FilePath, true)] 26 | [InlineData("SCHEME2\\SomeFile.ext", false)] 27 | [InlineData("SCHEME\\SomeFi.ext", false)] 28 | [InlineData("SCHEME\\Dir\\file.ext", false)] 29 | public Task OpeningFileWorks(string path, bool expectedSuccess) 30 | { 31 | return OpeningFileWorksInternal(path, expectedSuccess); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/StreamProviders/StreamProviderTestBase.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using RetriX.Shared.StreamProviders; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using Xunit; 6 | 7 | namespace RetriX.Shared.Test.StreamProviders 8 | { 9 | public abstract class StreamProviderTestBase 10 | { 11 | protected abstract Task GetTargetAsync(); 12 | 13 | protected async Task ListingEntriesWorksInternal(int numExpectedEntries) 14 | { 15 | var target = await GetTargetAsync(); 16 | var entries = await target.ListEntriesAsync(); 17 | Assert.Equal(numExpectedEntries, entries.Count()); 18 | } 19 | 20 | protected async Task OpeningFileWorksInternal(string path, bool expectedSuccess) 21 | { 22 | var target = await GetTargetAsync(); 23 | var stream = await target.OpenFileStreamAsync(path, System.IO.FileAccess.Read); 24 | if (expectedSuccess) 25 | { 26 | Assert.NotNull(stream); 27 | } 28 | else 29 | { 30 | Assert.Null(stream); 31 | } 32 | 33 | stream?.Dispose(); 34 | } 35 | 36 | protected Task GetTestFilesFolderAsync() 37 | { 38 | return Plugin.FileSystem.CrossFileSystem.Current.GetDirectoryFromPathAsync("TestFiles"); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/TestBase.cs: -------------------------------------------------------------------------------- 1 | using Acr.UserDialogs; 2 | using Moq; 3 | using Plugin.FileSystem.Abstractions; 4 | using Plugin.LocalNotifications.Abstractions; 5 | using RetriX.Shared.Services; 6 | using System.Threading.Tasks; 7 | using Xunit; 8 | 9 | namespace RetriX.Shared.Test 10 | { 11 | [Collection(nameof(Test))] 12 | public abstract class TestBase where T : class 13 | { 14 | protected abstract T InstantiateTarget(); 15 | 16 | protected readonly T Target; 17 | 18 | protected readonly Mock FileSystemMock = new Mock(); 19 | protected readonly Mock DialogsServiceMock = new Mock(); 20 | protected readonly Mock PlatformServiceMock = new Mock(); 21 | protected readonly Mock NotificationServiceMock = new Mock(); 22 | protected readonly Mock CryptographyServiceMock = new Mock(); 23 | 24 | public TestBase() 25 | { 26 | Target = InstantiateTarget(); 27 | } 28 | 29 | protected Task GetTestFilesFolderAsync() 30 | { 31 | return Plugin.FileSystem.CrossFileSystem.Current.GetDirectoryFromPathAsync("TestFiles"); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/TestFiles/A/B/AnotherFile.cds: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace RetriX.Shared.Test.TestFiles 8 | { 9 | class TestFile 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/TestFiles/AnotherFile.cds: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace RetriX.Shared.Test.TestFiles 8 | { 9 | class TestFile 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/TestFiles/Archive.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.Shared.Test/TestFiles/Archive.zip -------------------------------------------------------------------------------- /RetriX.Shared.Test/TestFiles/TestFile.txt: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace RetriX.Shared.Test.TestFiles 8 | { 9 | class TestFile 10 | { 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /RetriX.Shared.Test/ViewModels/FileImporterViewModelTest.cs: -------------------------------------------------------------------------------- 1 | using Moq; 2 | using Plugin.FileSystem.Abstractions; 3 | using RetriX.Shared.ViewModels; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | using Xunit; 9 | 10 | namespace RetriX.Shared.Test.ViewModels 11 | { 12 | public class FileImporterViewModelTest : TestBase 13 | { 14 | protected override FileImporterViewModel InstantiateTarget() 15 | { 16 | return FileImporterViewModel.CreateFileImporterAsync(FileSystemMock.Object, DialogsServiceMock.Object, PlatformServiceMock.Object, CryptographyServiceMock.Object, GetTestFilesFolderAsync().Result, "TargetFile.ext", "Target file description", "SomeMD5").Result; 17 | } 18 | 19 | [Theory] 20 | [InlineData(true)] 21 | [InlineData(false)] 22 | public async Task ImportingWorks(bool providedFileMD5Matches) 23 | { 24 | Assert.False(Target.FileAvailable); 25 | Assert.Null(await Target.GetTargetFileAsync()); 26 | Assert.True(Target.ImportCommand.CanExecute(null)); 27 | 28 | var folder = await GetTestFilesFolderAsync(); 29 | var pickedFile = await folder.GetFileAsync("TestFile.txt"); 30 | FileSystemMock.Setup(d => d.PickFileAsync(It.Is>(e => e.Contains(Path.GetExtension(Target.TargetFileName))))).Returns(Task.FromResult(pickedFile)); 31 | 32 | var computedHash = providedFileMD5Matches ? Target.TargetMD5.ToUpperInvariant() : "otherHash"; 33 | CryptographyServiceMock.Setup(d => d.ComputeMD5Async(pickedFile)).Returns(Task.FromResult(computedHash)); 34 | 35 | Target.ImportCommand.Execute(null); 36 | await Task.Delay(100); 37 | 38 | var expectedDialogServiceCalledTimes = providedFileMD5Matches ? Times.Never() : Times.Once(); 39 | DialogsServiceMock.Verify(d => d.AlertAsync(It.Is(e => e == Resources.Strings.FileHashMismatchMessage), It.Is(e => e == Resources.Strings.FileHashMismatchTitle), null, null), expectedDialogServiceCalledTimes); 40 | 41 | Assert.Equal(providedFileMD5Matches, Target.FileAvailable); 42 | Assert.Equal(!providedFileMD5Matches, Target.ImportCommand.CanExecute(null)); 43 | 44 | if (providedFileMD5Matches) 45 | { 46 | var targetFile = await Target.GetTargetFileAsync(); 47 | Assert.NotNull(targetFile); 48 | await targetFile.DeleteAsync(); 49 | } 50 | } 51 | 52 | [Fact] 53 | public async Task NoFileSelectionIsHandled() 54 | { 55 | Assert.False(Target.FileAvailable); 56 | 57 | FileSystemMock.Setup(d => d.PickFileAsync(It.Is>(e => e.Contains(Path.GetExtension(Target.TargetFileName))))).Returns(Task.FromResult(default(IFileInfo))); 58 | 59 | CryptographyServiceMock.Verify(d => d.ComputeMD5Async(It.IsAny()), Times.Never); 60 | DialogsServiceMock.Verify(d => d.AlertAsync(It.IsAny(), It.IsAny(), null, null), Times.Never); 61 | 62 | Target.ImportCommand.Execute(null); 63 | await Task.Delay(100); 64 | 65 | Assert.False(Target.FileAvailable); 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /RetriX.Shared/App.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Core.ViewModels; 2 | using MvvmCross.Platform; 3 | using RetriX.Shared.Services; 4 | 5 | namespace RetriX.Shared 6 | { 7 | public class App : MvxApplication 8 | { 9 | public App() 10 | { 11 | Mvx.RegisterSingleton(Acr.UserDialogs.UserDialogs.Instance); 12 | Mvx.RegisterSingleton(Plugin.FileSystem.CrossFileSystem.Current); 13 | Mvx.RegisterSingleton(Plugin.LocalNotifications.CrossLocalNotifications.Current); 14 | Mvx.RegisterSingleton(Plugin.VersionTracking.CrossVersionTracking.Current); 15 | Mvx.RegisterSingleton(Plugin.Settings.CrossSettings.Current); 16 | Mvx.ConstructAndRegisterSingleton(); 17 | Mvx.ConstructAndRegisterSingleton(); 18 | Mvx.LazyConstructAndRegisterSingleton(); 19 | Mvx.LazyConstructAndRegisterSingleton(); 20 | } 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /RetriX.Shared/AppStart.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Core.Navigation; 2 | using MvvmCross.Core.ViewModels; 3 | using Plugin.FileSystem.Abstractions; 4 | using RetriX.Shared.Presentation; 5 | using RetriX.Shared.Services; 6 | using RetriX.Shared.ViewModels; 7 | 8 | namespace RetriX.Shared 9 | { 10 | public class AppStart : IMvxAppStart 11 | { 12 | private IMvxNavigationService NavigationService { get; } 13 | private ICurrentViewModelPresenter Presenter { get; } 14 | private IGameSystemsProviderService GameSystemsProviderService { get; } 15 | 16 | public AppStart(IMvxNavigationService navigationService, ICurrentViewModelPresenter presenter, IGameSystemsProviderService gameSystemsProviderService) 17 | { 18 | NavigationService = navigationService; 19 | Presenter = presenter; 20 | GameSystemsProviderService = gameSystemsProviderService; 21 | } 22 | 23 | public async void Start(object hint = null) 24 | { 25 | var file = hint as IFileInfo; 26 | if (file == null) 27 | { 28 | await NavigationService.Navigate(); 29 | return; 30 | } 31 | 32 | var param = await GameSystemsProviderService.GenerateGameLaunchEnvironmentAsync(file); 33 | if (param != null && Presenter.CurrentViewModel is GamePlayerViewModel) 34 | { 35 | var currentGamePlayerVM = Presenter.CurrentViewModel as GamePlayerViewModel; 36 | currentGamePlayerVM.Prepare(param); 37 | await currentGamePlayerVM.Initialize(); 38 | } 39 | else if (Presenter.CurrentViewModel is GameSystemSelectionViewModel) 40 | { 41 | var currentSystemSelectionVM = Presenter.CurrentViewModel as GameSystemSelectionViewModel; 42 | currentSystemSelectionVM.Prepare(file); 43 | await currentSystemSelectionVM.Initialize(); 44 | } 45 | else 46 | { 47 | await NavigationService.Navigate(file); 48 | } 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /RetriX.Shared/ExtensionMethods/StringHasher.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Security.Cryptography; 3 | using System.Text; 4 | 5 | namespace RetriX.Shared.ExtensionMethods 6 | { 7 | public static class StringHasher 8 | { 9 | private static readonly UTF8Encoding Encoder = new UTF8Encoding(); 10 | 11 | public static string MD5(this string input) 12 | { 13 | return HashString(input, HashAlgorithmName.MD5); 14 | } 15 | 16 | public static string SHA1(this string input) 17 | { 18 | return HashString(input, HashAlgorithmName.SHA1); 19 | } 20 | 21 | private static string HashString(string input, HashAlgorithmName algorithmName) 22 | { 23 | using (var hasher = IncrementalHash.CreateHash(algorithmName)) 24 | { 25 | var bytes = Encoder.GetBytes(input); 26 | hasher.AppendData(bytes); 27 | bytes = hasher.GetHashAndReset(); 28 | var hash = BitConverter.ToString(bytes); 29 | return hash.Replace("-", string.Empty).ToLower(); 30 | } 31 | } 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /RetriX.Shared/Presentation/ICurrentViewModelPresenter.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Core.ViewModels; 2 | using MvvmCross.Core.Views; 3 | 4 | namespace RetriX.Shared.Presentation 5 | { 6 | public interface ICurrentViewModelPresenter : IMvxViewPresenter 7 | { 8 | IMvxViewModel CurrentViewModel { get; } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RetriX.Shared/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Runtime.CompilerServices; 2 | 3 | [assembly:InternalsVisibleTo("RetriX.Shared.Test")] -------------------------------------------------------------------------------- /RetriX.Shared/RetriX.Shared.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.4 5 | portable-net45+win8+wp8+wpa81 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | True 30 | True 31 | Strings.resx 32 | 33 | 34 | 35 | 36 | 37 | ResXFileCodeGenerator 38 | Strings.Designer.cs 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/CryptographyService.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using System; 3 | using System.IO; 4 | using System.Security.Cryptography; 5 | using System.Threading.Tasks; 6 | 7 | namespace RetriX.Shared.Services 8 | { 9 | public class CryptographyService : ICryptographyService 10 | { 11 | public async Task ComputeMD5Async(IFileInfo file) 12 | { 13 | using (var inputStream = await file.OpenAsync(FileAccess.Read)) 14 | using (var hasher = IncrementalHash.CreateHash(HashAlgorithmName.MD5)) 15 | { 16 | var buffer = new byte[1024 * 1024]; 17 | while (inputStream.Position < inputStream.Length) 18 | { 19 | var bytesRead = await inputStream.ReadAsync(buffer, 0, buffer.Length); 20 | hasher.AppendData(buffer, 0, bytesRead); 21 | } 22 | 23 | var hashBytes = hasher.GetHashAndReset(); 24 | var hashString = BitConverter.ToString(hashBytes); 25 | return hashString.Replace("-", string.Empty); 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/GameSystemsProviderServiceBase.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using RetriX.Shared.StreamProviders; 3 | using RetriX.Shared.ViewModels; 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | using System.Threading; 9 | using System.Threading.Tasks; 10 | 11 | namespace RetriX.Shared.Services 12 | { 13 | public abstract class GameSystemsProviderServiceBase : IGameSystemsProviderService 14 | { 15 | protected abstract IReadOnlyList GenerateSystemsList(IFileSystem fileSystem); 16 | 17 | private IFileSystem FileSystem { get; } 18 | 19 | protected Lazy> systems { get; } 20 | public IReadOnlyList Systems => systems.Value; 21 | 22 | public GameSystemsProviderServiceBase(IFileSystem fileSystem) 23 | { 24 | FileSystem = fileSystem; 25 | 26 | systems = new Lazy>(() => GenerateSystemsList(FileSystem), LazyThreadSafetyMode.PublicationOnly); 27 | } 28 | 29 | public Task GenerateGameLaunchEnvironmentAsync(IFileInfo file) 30 | { 31 | var extension = Path.GetExtension(file.Name); 32 | var compatibleSystems = Systems.Where(d => d.SupportedExtensions.Contains(extension)).ToArray(); 33 | if (compatibleSystems.Length != 1) 34 | { 35 | return Task.FromResult(default(GamePlayerViewModel.Parameter)); 36 | } 37 | 38 | return GenerateGameLaunchEnvironmentAsync(compatibleSystems.First(), file, null); 39 | } 40 | 41 | public async Task GenerateGameLaunchEnvironmentAsync(GameSystemViewModel system, IFileInfo file, IDirectoryInfo rootFolder) 42 | { 43 | var dependenciesMet = await system.CheckDependenciesMetAsync(); 44 | if (!dependenciesMet || (system.CheckRootFolderRequired(file) && rootFolder == null)) 45 | { 46 | return null; 47 | } 48 | 49 | var vfsRomPath = "ROM"; 50 | var vfsSystemPath = "System"; 51 | var vfsSavePath = "Save"; 52 | 53 | var core = system.Core; 54 | 55 | string virtualMainFilePath = null; 56 | var provider = default(IStreamProvider); 57 | 58 | if (core.NativeArchiveSupport || !ArchiveStreamProvider.SupportedExtensions.Contains(Path.GetExtension(file.Name))) 59 | { 60 | virtualMainFilePath = $"{vfsRomPath}{Path.DirectorySeparatorChar}{file.Name}"; 61 | provider = new SingleFileStreamProvider(virtualMainFilePath, file); 62 | if (rootFolder != null) 63 | { 64 | virtualMainFilePath = file.FullName.Substring(rootFolder.FullName.Length + 1); 65 | virtualMainFilePath = $"{vfsRomPath}{Path.DirectorySeparatorChar}{virtualMainFilePath}"; 66 | provider = new FolderStreamProvider(vfsRomPath, rootFolder); 67 | } 68 | } 69 | else 70 | { 71 | var archiveProvider = new ArchiveStreamProvider(vfsRomPath, file); 72 | await archiveProvider.InitializeAsync(); 73 | provider = archiveProvider; 74 | var entries = await provider.ListEntriesAsync(); 75 | virtualMainFilePath = entries.FirstOrDefault(d => system.SupportedExtensions.Contains(Path.GetExtension(d))); 76 | } 77 | 78 | var systemFolder = await system.GetSystemDirectoryAsync(); 79 | var systemProvider = new FolderStreamProvider(vfsSystemPath, systemFolder); 80 | core.SystemRootPath = vfsSystemPath; 81 | var saveFolder = await system.GetSaveDirectoryAsync(); 82 | var saveProvider = new FolderStreamProvider(vfsSavePath, saveFolder); 83 | core.SaveRootPath = vfsSavePath; 84 | 85 | provider = new CombinedStreamProvider(new HashSet() { provider, systemProvider, saveProvider }); 86 | 87 | return new GamePlayerViewModel.Parameter(core, provider, virtualMainFilePath); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/IAudioService.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | 5 | namespace RetriX.Shared.Services 6 | { 7 | public interface IAudioService : IInitializable 8 | { 9 | bool ShouldDelayNextFrame { get; } 10 | void TimingChanged(SystemTimings timings); 11 | void RenderAudioFrames(IReadOnlyList data, ulong numFrames); 12 | void Stop(); 13 | } 14 | } -------------------------------------------------------------------------------- /RetriX.Shared/Services/ICryptographyService.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using System.Threading.Tasks; 3 | 4 | namespace RetriX.Shared.Services 5 | { 6 | public interface ICryptographyService 7 | { 8 | Task ComputeMD5Async(IFileInfo file); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/IEmulationService.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX; 2 | using RetriX.Shared.StreamProviders; 3 | using System; 4 | using System.Threading.Tasks; 5 | 6 | namespace RetriX.Shared.Services 7 | { 8 | public enum InjectedInputTypes 9 | { 10 | DeviceIdJoypadB = 0, 11 | DeviceIdJoypadY = 1, 12 | DeviceIdJoypadSelect = 2, 13 | DeviceIdJoypadStart = 3, 14 | DeviceIdJoypadUp = 4, 15 | DeviceIdJoypadDown = 5, 16 | DeviceIdJoypadLeft = 6, 17 | DeviceIdJoypadRight = 7, 18 | DeviceIdJoypadA = 8, 19 | DeviceIdJoypadX = 9, 20 | }; 21 | 22 | public interface IEmulationService 23 | { 24 | Task StartGameAsync(ICore core, IStreamProvider streamProvider, string mainFilePath); 25 | 26 | Task ResetGameAsync(); 27 | Task StopGameAsync(); 28 | 29 | Task PauseGameAsync(); 30 | Task ResumeGameAsync(); 31 | 32 | Task SaveGameStateAsync(uint slotID); 33 | Task LoadGameStateAsync(uint slotID); 34 | 35 | void InjectInputPlayer1(InjectedInputTypes inputType); 36 | 37 | event EventHandler GameStarted; 38 | event EventHandler GameStopped; 39 | event EventHandler GameRuntimeExceptionOccurred; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/IGameSystemsProviderService.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Threading.Tasks; 3 | using Plugin.FileSystem.Abstractions; 4 | using RetriX.Shared.ViewModels; 5 | 6 | namespace RetriX.Shared.Services 7 | { 8 | public interface IGameSystemsProviderService 9 | { 10 | IReadOnlyList Systems { get; } 11 | 12 | Task GenerateGameLaunchEnvironmentAsync(GameSystemViewModel system, IFileInfo file, IDirectoryInfo rootFolder); 13 | Task GenerateGameLaunchEnvironmentAsync(IFileInfo file); 14 | } 15 | } -------------------------------------------------------------------------------- /RetriX.Shared/Services/IInitializable.cs: -------------------------------------------------------------------------------- 1 | using System.Threading.Tasks; 2 | 3 | namespace RetriX.Shared.Services 4 | { 5 | public interface IInitializable 6 | { 7 | Task InitAsync(); 8 | Task DeinitAsync(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/IInputService.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX; 2 | 3 | namespace RetriX.Shared.Services 4 | { 5 | public interface IInputService : IInitializable 6 | { 7 | void InjectInputPlayer1(InputTypes inputType); 8 | void PollInput(); 9 | short GetInputState(uint port, InputTypes inputType); 10 | } 11 | } -------------------------------------------------------------------------------- /RetriX.Shared/Services/IPlatformService.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Threading.Tasks; 3 | 4 | namespace RetriX.Shared.Services 5 | { 6 | public enum FullScreenChangeType { Enter, Exit, Toggle }; 7 | 8 | public enum MousePointerVisibility { Visible, Hidden }; 9 | 10 | public interface IPlatformService 11 | { 12 | bool FullScreenChangingPossible { get; } 13 | bool IsFullScreenMode { get; } 14 | bool ShouldDisplayTouchGamepad { get; } 15 | bool HandleGameplayKeyShortcuts { get; set; } 16 | 17 | Task ChangeFullScreenStateAsync(FullScreenChangeType changeType); 18 | void ChangeMousePointerVisibility(MousePointerVisibility visibility); 19 | void ForceUIElementFocus(); 20 | 21 | void CopyToClipboard(string content); 22 | 23 | event EventHandler FullScreenChangeRequested; 24 | 25 | event EventHandler PauseToggleRequested; 26 | 27 | event EventHandler GameStateOperationRequested; 28 | } 29 | } -------------------------------------------------------------------------------- /RetriX.Shared/Services/ISaveStateService.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using System.Threading.Tasks; 3 | 4 | namespace RetriX.Shared.Services 5 | { 6 | public interface ISaveStateService 7 | { 8 | void SetGameId(string id); 9 | 10 | Task GetStreamForSlotAsync(uint slotId, FileAccess access); 11 | Task SlotHasDataAsync(uint slotId); 12 | Task ClearSavesAsync(); 13 | }; 14 | } 15 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/IVideoService.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX; 2 | using System; 3 | using System.Collections.Generic; 4 | 5 | namespace RetriX.Shared.Services 6 | { 7 | public enum TextureFilterTypes { NearestNeighbor, Bilinear }; 8 | 9 | public interface IVideoService : IInitializable 10 | { 11 | event EventHandler RequestRunCoreFrame; 12 | 13 | void GeometryChanged(GameGeometry geometry); 14 | void PixelFormatChanged(PixelFormats format); 15 | void RotationChanged(Rotations rotation); 16 | void TimingsChanged(SystemTimings timings); 17 | void RenderVideoFrameRGB0555(IReadOnlyList data, uint width, uint height, ulong pitch); 18 | void RenderVideoFrameRGB565(IReadOnlyList data, uint width, uint height, ulong pitch); 19 | void RenderVideoFrameXRGB8888(IReadOnlyList data, uint width, uint height, ulong pitch); 20 | void SetFilter(TextureFilterTypes filterType); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/PlatformServiceEventArgs.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace RetriX.Shared.Services 4 | { 5 | public class FullScreenChangeEventArgs : EventArgs 6 | { 7 | public FullScreenChangeType Type { get; private set; } 8 | 9 | public FullScreenChangeEventArgs(FullScreenChangeType type) 10 | { 11 | Type = type; 12 | } 13 | } 14 | 15 | public class GameStateOperationEventArgs : EventArgs 16 | { 17 | public enum GameStateOperationType { Save, Load }; 18 | 19 | public GameStateOperationType Type { get; private set; } 20 | public uint SlotID { get; private set; } 21 | 22 | public GameStateOperationEventArgs(GameStateOperationType type, uint slotID) 23 | { 24 | Type = type; 25 | SlotID = slotID; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /RetriX.Shared/Services/SaveStateService.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using RetriX.Shared.ExtensionMethods; 3 | using System.IO; 4 | using System.Threading.Tasks; 5 | 6 | namespace RetriX.Shared.Services 7 | { 8 | public class SaveStateService : ISaveStateService 9 | { 10 | private const string SaveStatesFolderName = "SaveStates"; 11 | 12 | private readonly IFileSystem FileSystem; 13 | 14 | private string GameId { get; set; } 15 | 16 | private bool OperationInProgress = false; 17 | private bool AllowOperations => !(OperationInProgress || SaveStatesFolder == null || GameId == null); 18 | 19 | private IDirectoryInfo SaveStatesFolder; 20 | 21 | public SaveStateService(IFileSystem fileSystem) 22 | { 23 | FileSystem = fileSystem; 24 | 25 | GetSubfolderAsync(FileSystem.LocalStorage, SaveStatesFolderName).ContinueWith(d => 26 | { 27 | SaveStatesFolder = d.Result; 28 | }); 29 | 30 | GameId = null; 31 | } 32 | 33 | public void SetGameId(string id) 34 | { 35 | GameId = null; 36 | if(string.IsNullOrEmpty(id) || string.IsNullOrWhiteSpace(id)) 37 | { 38 | return; 39 | } 40 | 41 | GameId = id.MD5(); 42 | } 43 | 44 | public async Task GetStreamForSlotAsync(uint slotId, FileAccess access) 45 | { 46 | if (!AllowOperations) 47 | { 48 | return null; 49 | } 50 | 51 | OperationInProgress = true; 52 | 53 | var statesFolder = await GetGameSaveStatesFolderAsync(); 54 | var fileName = GenerateSaveFileName(slotId); 55 | var file = await statesFolder.GetFileAsync(fileName); 56 | if (file == null) 57 | { 58 | if (access == FileAccess.Read) 59 | { 60 | OperationInProgress = false; 61 | return null; 62 | } 63 | 64 | file = await statesFolder.CreateFileAsync(fileName); 65 | //This should never happen 66 | if (file == null) 67 | { 68 | return null; 69 | } 70 | } 71 | 72 | var stream = await file.OpenAsync(access); 73 | OperationInProgress = false; 74 | return stream; 75 | } 76 | 77 | public async Task SlotHasDataAsync(uint slotId) 78 | { 79 | if (!AllowOperations) 80 | { 81 | return false; 82 | } 83 | 84 | OperationInProgress = true; 85 | 86 | var statesFolder = await GetGameSaveStatesFolderAsync(); 87 | var fileName = GenerateSaveFileName(slotId); 88 | var file = await statesFolder.GetFileAsync(fileName); 89 | 90 | OperationInProgress = false; 91 | return file != null; 92 | } 93 | 94 | public async Task ClearSavesAsync() 95 | { 96 | if (!AllowOperations) 97 | { 98 | return; 99 | } 100 | 101 | OperationInProgress = true; 102 | 103 | var statesFolder = await GetGameSaveStatesFolderAsync(); 104 | await statesFolder.DeleteAsync(); 105 | await GetGameSaveStatesFolderAsync(); 106 | 107 | OperationInProgress = false; 108 | } 109 | 110 | private string GenerateSaveFileName(uint slotId) 111 | { 112 | return $"{GameId}_S{slotId}.sav"; 113 | } 114 | 115 | private Task GetGameSaveStatesFolderAsync() 116 | { 117 | return GetSubfolderAsync(SaveStatesFolder, GameId); 118 | } 119 | 120 | private static async Task GetSubfolderAsync(IDirectoryInfo parent, string name) 121 | { 122 | IDirectoryInfo output = await parent.GetDirectoryAsync(name); 123 | if (output == null) 124 | { 125 | output = await parent.CreateDirectoryAsync(name); 126 | } 127 | 128 | return output; 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /RetriX.Shared/StreamProviders/ArchiveStreamProvider.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.IO.Compression; 6 | using System.Linq; 7 | using System.Threading.Tasks; 8 | 9 | namespace RetriX.Shared.StreamProviders 10 | { 11 | public class ArchiveStreamProvider : IStreamProvider 12 | { 13 | public static ISet SupportedExtensions { get; } = new HashSet { ".zip" }; 14 | 15 | private string HandledScheme { get; } 16 | private IFileInfo ArchiveFile { get; } 17 | private IDictionary EntriesBufferMapping { get; } = new Dictionary(); 18 | 19 | public ArchiveStreamProvider(string handledScheme, IFileInfo archiveFile) 20 | { 21 | HandledScheme = handledScheme; 22 | ArchiveFile = archiveFile; 23 | } 24 | 25 | public void Dispose() 26 | { 27 | } 28 | 29 | public async Task InitializeAsync() 30 | { 31 | var stream = await ArchiveFile.OpenAsync(FileAccess.Read); 32 | using (var archive = new ZipArchive(stream, ZipArchiveMode.Read)) 33 | { 34 | foreach (var i in archive.Entries) 35 | { 36 | using (var entryStream = i.Open()) 37 | { 38 | var memoryStream = new MemoryStream(); 39 | await entryStream.CopyToAsync(memoryStream); 40 | EntriesBufferMapping.Add(Path.Combine(HandledScheme,i.FullName), memoryStream.ToArray()); 41 | } 42 | } 43 | } 44 | } 45 | 46 | public Task> ListEntriesAsync() 47 | { 48 | return Task.FromResult(EntriesBufferMapping.Keys.OrderBy(d => d) as IEnumerable); 49 | } 50 | 51 | public Task OpenFileStreamAsync(string path, FileAccess accessType) 52 | { 53 | if (!EntriesBufferMapping.Keys.Contains(path, StringComparer.OrdinalIgnoreCase)) 54 | { 55 | return Task.FromResult(null as Stream); 56 | } 57 | 58 | var output = new MemoryStream(EntriesBufferMapping[path]); 59 | return Task.FromResult(output as Stream); 60 | } 61 | 62 | public void CloseStream(Stream stream) 63 | { 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /RetriX.Shared/StreamProviders/CombinedStreamProvider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | 6 | namespace RetriX.Shared.StreamProviders 7 | { 8 | public class CombinedStreamProvider : IStreamProvider 9 | { 10 | private readonly ISet Providers; 11 | 12 | public CombinedStreamProvider(ISet providers) 13 | { 14 | Providers = providers; 15 | } 16 | 17 | public void Dispose() 18 | { 19 | foreach (var i in Providers) 20 | { 21 | i.Dispose(); 22 | } 23 | } 24 | 25 | public async Task> ListEntriesAsync() 26 | { 27 | var tasks = Providers.Select(d => d.ListEntriesAsync()).ToArray(); 28 | var results = await Task.WhenAll(tasks); 29 | var output = results.SelectMany(d => d.ToArray()).OrderBy(d => d).ToArray(); 30 | return output; 31 | } 32 | 33 | public async Task OpenFileStreamAsync(string path, FileAccess accessType) 34 | { 35 | foreach(var i in Providers) 36 | { 37 | var stream = await i.OpenFileStreamAsync(path, accessType); 38 | if (stream != null) 39 | { 40 | return stream; 41 | } 42 | } 43 | 44 | return null; 45 | } 46 | 47 | public void CloseStream(Stream stream) 48 | { 49 | foreach (var i in Providers) 50 | { 51 | i.CloseStream(stream); 52 | } 53 | } 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /RetriX.Shared/StreamProviders/FolderStreamProvider.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | 7 | namespace RetriX.Shared.StreamProviders 8 | { 9 | public class FolderStreamProvider : StreamProviderBase 10 | { 11 | private readonly string HandledScheme; 12 | private readonly IDirectoryInfo RootFolder; 13 | private IDictionary Contents; 14 | 15 | public FolderStreamProvider(string handledScheme, IDirectoryInfo rootFolder) 16 | { 17 | HandledScheme = handledScheme; 18 | RootFolder = rootFolder; 19 | } 20 | 21 | public override async Task> ListEntriesAsync() 22 | { 23 | var contents = await GetContents(); 24 | return contents.Keys.Select(d => HandledScheme + d).ToArray(); 25 | } 26 | 27 | protected override async Task OpenFileStreamAsyncInternal(string path, FileAccess accessType) 28 | { 29 | if (!path.StartsWith(HandledScheme)) 30 | { 31 | return null; 32 | } 33 | 34 | var contents = await GetContents(); 35 | path = path.Substring(HandledScheme.Length).ToLowerInvariant(); 36 | contents.TryGetValue(path, out var file); 37 | if (accessType == FileAccess.Read && file == null) 38 | { 39 | return null; 40 | } 41 | 42 | if (file == null) 43 | { 44 | file = await RootFolder.CreateFileAsync(path); 45 | Contents.Add(GenerateSchemaName(file), file); 46 | } 47 | 48 | var output = await file.OpenAsync(accessType); 49 | return output; 50 | } 51 | 52 | private string GenerateSchemaName(IFileInfo file) 53 | { 54 | return file.FullName.Substring(RootFolder.FullName.Length).ToLowerInvariant(); 55 | } 56 | 57 | private async Task> GetContents() 58 | { 59 | if (Contents == null) 60 | { 61 | Contents = new SortedDictionary(); 62 | var list = await ListFilesRecursiveAsync(RootFolder); 63 | foreach (var i in list) 64 | { 65 | Contents.Add(GenerateSchemaName(i), i); 66 | } 67 | } 68 | 69 | return Contents; 70 | } 71 | 72 | private async Task> ListFilesRecursiveAsync(IDirectoryInfo folder) 73 | { 74 | IEnumerable files = await folder.EnumerateFilesAsync(); 75 | var subfolders = await folder.EnumerateDirectoriesAsync(); 76 | foreach (var i in subfolders) 77 | { 78 | var subfolderFiles = await ListFilesRecursiveAsync(i); 79 | files = files.Concat(subfolderFiles); 80 | } 81 | 82 | return files; 83 | } 84 | } 85 | } 86 | -------------------------------------------------------------------------------- /RetriX.Shared/StreamProviders/IStreamProvider.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Threading.Tasks; 5 | 6 | namespace RetriX.Shared.StreamProviders 7 | { 8 | public interface IStreamProvider : IDisposable 9 | { 10 | Task> ListEntriesAsync(); 11 | Task OpenFileStreamAsync(string path, FileAccess accessType); 12 | void CloseStream(Stream stream); 13 | } 14 | } -------------------------------------------------------------------------------- /RetriX.Shared/StreamProviders/SingleFileStreamProvider.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using System; 3 | using System.Collections.Generic; 4 | using System.IO; 5 | using System.Threading.Tasks; 6 | 7 | namespace RetriX.Shared.StreamProviders 8 | { 9 | public class SingleFileStreamProvider : StreamProviderBase 10 | { 11 | private readonly string Path; 12 | private readonly IFileInfo File; 13 | 14 | public SingleFileStreamProvider(string path, IFileInfo file) 15 | { 16 | Path = path; 17 | File = file; 18 | } 19 | 20 | public override Task> ListEntriesAsync() 21 | { 22 | var output = new string[] { Path }; 23 | return Task.FromResult(output as IEnumerable); 24 | } 25 | 26 | protected override Task OpenFileStreamAsyncInternal(string path, FileAccess accessType) 27 | { 28 | if (Path.Equals(path, StringComparison.OrdinalIgnoreCase)) 29 | { 30 | return File.OpenAsync(accessType); 31 | } 32 | 33 | return Task.FromResult(default(Stream)); 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /RetriX.Shared/StreamProviders/StreamProviderBase.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.IO; 3 | using System.Threading.Tasks; 4 | 5 | namespace RetriX.Shared.StreamProviders 6 | { 7 | public abstract class StreamProviderBase : IStreamProvider 8 | { 9 | private readonly HashSet OpenStreams = new HashSet(); 10 | 11 | public abstract Task> ListEntriesAsync(); 12 | protected abstract Task OpenFileStreamAsyncInternal(string path, FileAccess accessType); 13 | 14 | public virtual void Dispose() 15 | { 16 | foreach(var i in OpenStreams) 17 | { 18 | i.Dispose(); 19 | } 20 | } 21 | 22 | public async Task OpenFileStreamAsync(string path, FileAccess accessType) 23 | { 24 | var stream = await OpenFileStreamAsyncInternal(path, accessType); 25 | if (stream != null) 26 | { 27 | OpenStreams.Add(stream); 28 | } 29 | 30 | return stream; 31 | } 32 | 33 | public void CloseStream(Stream stream) 34 | { 35 | if (OpenStreams.Contains(stream)) 36 | { 37 | OpenStreams.Remove(stream); 38 | stream.Dispose(); 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /RetriX.Shared/ViewModels/AboutViewModel.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Core.ViewModels; 2 | using Plugin.VersionTracking.Abstractions; 3 | 4 | namespace RetriX.Shared.ViewModels 5 | { 6 | public class AboutViewModel : MvxViewModel 7 | { 8 | public string Version { get; } 9 | 10 | public AboutViewModel(IVersionTracking versionTracker) 11 | { 12 | Version = versionTracker.CurrentVersion; 13 | } 14 | } 15 | } -------------------------------------------------------------------------------- /RetriX.Shared/ViewModels/FileImporterViewModel.cs: -------------------------------------------------------------------------------- 1 | using Acr.UserDialogs; 2 | using MvvmCross.Core.ViewModels; 3 | using Plugin.FileSystem.Abstractions; 4 | using RetriX.Shared.Services; 5 | using System.IO; 6 | using System.Threading.Tasks; 7 | 8 | namespace RetriX.Shared.ViewModels 9 | { 10 | public class FileImporterViewModel : MvxViewModel 11 | { 12 | public const string SerachLinkFormat = "https://www.google.com/search?q={0}"; 13 | 14 | private readonly IFileSystem FileSystem; 15 | private readonly IUserDialogs DialogsService; 16 | private readonly IPlatformService PlatformService; 17 | private readonly ICryptographyService CryptographyService; 18 | 19 | public IDirectoryInfo TargetFolder { get; } 20 | public string TargetFileName { get; } 21 | public string TargetDescription { get; } 22 | public string TargetMD5 { get; } 23 | 24 | public string SearchLink => string.Format(SerachLinkFormat, TargetMD5); 25 | 26 | private bool fileAvailable = false; 27 | public bool FileAvailable 28 | { 29 | get => fileAvailable; 30 | private set { if (SetProperty(ref fileAvailable, value)) { ImportCommand.RaiseCanExecuteChanged(); } } 31 | } 32 | 33 | public IMvxCommand ImportCommand { get; } 34 | public IMvxCommand CopyMD5ToClipboardCommand { get; } 35 | 36 | protected FileImporterViewModel(IFileSystem fileSystem, IUserDialogs dialogsService, IPlatformService platformService, ICryptographyService cryptographyService, IDirectoryInfo folder, string fileName, string description, string MD5) 37 | { 38 | FileSystem = fileSystem; 39 | DialogsService = dialogsService; 40 | PlatformService = platformService; 41 | CryptographyService = cryptographyService; 42 | 43 | TargetFolder = folder; 44 | TargetFileName = fileName; 45 | TargetDescription = description; 46 | TargetMD5 = MD5; 47 | 48 | ImportCommand = new MvxCommand(ImportHandler, () => !FileAvailable); 49 | CopyMD5ToClipboardCommand = new MvxCommand(() => PlatformService.CopyToClipboard(TargetMD5)); 50 | } 51 | 52 | public static async Task CreateFileImporterAsync(IFileSystem fileSystem, IUserDialogs dialogsService, IPlatformService platformService, ICryptographyService cryptographyService, IDirectoryInfo folder, string fileName, string description, string MD5) 53 | { 54 | var output = new FileImporterViewModel(fileSystem, dialogsService, platformService, cryptographyService, folder, fileName, description, MD5); 55 | var targetFile = await output.GetTargetFileAsync(); 56 | output.FileAvailable = targetFile != null; 57 | return output; 58 | } 59 | 60 | public Task GetTargetFileAsync() 61 | { 62 | return TargetFolder.GetFileAsync(TargetFileName); 63 | } 64 | 65 | private async void ImportHandler() 66 | { 67 | var fileExt = Path.GetExtension(TargetFileName); 68 | var sourceFile = await FileSystem.PickFileAsync(new string[] { fileExt }); 69 | if (sourceFile == null) 70 | { 71 | return; 72 | } 73 | 74 | var md5 = await CryptographyService.ComputeMD5Async(sourceFile); 75 | if (md5.ToLowerInvariant() != TargetMD5.ToLowerInvariant()) 76 | { 77 | var title = Resources.Strings.FileHashMismatchTitle; 78 | var message = Resources.Strings.FileHashMismatchMessage; 79 | await DialogsService.AlertAsync(message, title); 80 | return; 81 | } 82 | 83 | using (var inStream = await sourceFile.OpenAsync(FileAccess.Read)) 84 | { 85 | var targetFile = await TargetFolder.CreateFileAsync(TargetFileName); 86 | using (var outStream = await targetFile.OpenAsync(FileAccess.ReadWrite)) 87 | { 88 | await inStream.CopyToAsync(outStream); 89 | await outStream.FlushAsync(); 90 | } 91 | 92 | FileAvailable = true; 93 | } 94 | } 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /RetriX.Shared/ViewModels/SettingsViewModel.cs: -------------------------------------------------------------------------------- 1 | using Acr.UserDialogs; 2 | using LibRetriX; 3 | using MvvmCross.Core.ViewModels; 4 | using Plugin.FileSystem.Abstractions; 5 | using RetriX.Shared.Services; 6 | using System.Collections.Generic; 7 | using System.Linq; 8 | using System.Threading.Tasks; 9 | 10 | namespace RetriX.Shared.ViewModels 11 | { 12 | public class SettingsViewModel : MvxViewModel 13 | { 14 | private IGameSystemsProviderService GameSystemsProvider { get; } 15 | private IFileSystem FileSystem { get; } 16 | private IUserDialogs DialogsService { get; } 17 | private IPlatformService PlatformService { get; } 18 | private ICryptographyService CryptographyService { get; } 19 | 20 | private IReadOnlyList fileDependencyImporters; 21 | public IReadOnlyList FileDependencyImporters 22 | { 23 | get => fileDependencyImporters; 24 | private set => SetProperty(ref fileDependencyImporters, value); 25 | } 26 | 27 | public SettingsViewModel(IGameSystemsProviderService gameSystemsProvider, IFileSystem fileSystem, IUserDialogs dialogsService, IPlatformService platformService, ICryptographyService cryptographyService) 28 | { 29 | GameSystemsProvider = gameSystemsProvider; 30 | FileSystem = fileSystem; 31 | DialogsService = dialogsService; 32 | PlatformService = platformService; 33 | CryptographyService = cryptographyService; 34 | 35 | Task.Run(GetFileDependencyImportersAsync).ContinueWith(d => FileDependencyImporters = d.Result, TaskScheduler.FromCurrentSynchronizationContext()); 36 | } 37 | 38 | private async Task> GetFileDependencyImportersAsync() 39 | { 40 | var importers = new List(); 41 | var distinctCores = new HashSet(); 42 | foreach (var i in GameSystemsProvider.Systems) 43 | { 44 | var core = i.Core; 45 | if (distinctCores.Contains(core)) 46 | { 47 | continue; 48 | } 49 | 50 | distinctCores.Add(core); 51 | var systemFolder = await i.GetSystemDirectoryAsync(); 52 | var tasks = core.FileDependencies.Select(d => FileImporterViewModel.CreateFileImporterAsync(FileSystem, DialogsService, PlatformService, CryptographyService, systemFolder, d.Name, d.Description, d.MD5)).ToArray(); 53 | var newImporters = await Task.WhenAll(tasks); 54 | importers.AddRange(newImporters); 55 | } 56 | 57 | return importers; 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /RetriX.UWP.Unsafe/Components/FramebufferConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace RetriX.UWP.Components 6 | { 7 | internal unsafe static class FramebufferConverter 8 | { 9 | private const uint LookupTableSize = ushort.MaxValue + 1; 10 | 11 | private static readonly uint[] RGB0555LookupTable = new uint[LookupTableSize]; 12 | private static readonly GCHandle RGB0555LookupTableHandle; 13 | private static readonly uint* RGB0555LookupTablePtr; 14 | 15 | private static readonly uint[] RGB565LookupTable = new uint[LookupTableSize]; 16 | private static readonly GCHandle RGB565LookupTableHandle; 17 | private static readonly uint* RGB565LookupTablePtr; 18 | 19 | static FramebufferConverter() 20 | { 21 | uint r, g, b; 22 | for (uint i = 0; i < LookupTableSize; i++) 23 | { 24 | r = (i >> 11) & 0x1F; 25 | g = (i >> 5) & 0x3F; 26 | b = (i & 0x1F); 27 | 28 | r = (uint)Math.Round(r * 255.0 / 31.0); 29 | g = (uint)Math.Round(g * 255.0 / 63.0); 30 | b = (uint)Math.Round(b * 255.0 / 31.0); 31 | 32 | RGB565LookupTable[i] = 0xFF000000 | r << 16 | g << 8 | b; 33 | } 34 | 35 | for (uint i = 0; i < LookupTableSize; i++) 36 | { 37 | r = (i >> 10) & 0x1F; 38 | g = (i >> 5) & 0x1F; 39 | b = (i & 0x1F); 40 | 41 | r = (uint)Math.Round(r * 255.0 / 31.0); 42 | g = (uint)Math.Round(g * 255.0 / 31.0); 43 | b = (uint)Math.Round(b * 255.0 / 31.0); 44 | 45 | RGB0555LookupTable[i] = 0xFF000000 | r << 16 | g << 8 | b; 46 | } 47 | 48 | RGB0555LookupTableHandle = GCHandle.Alloc(RGB0555LookupTable, GCHandleType.Pinned); 49 | RGB0555LookupTablePtr = (uint*)RGB0555LookupTableHandle.AddrOfPinnedObject(); 50 | 51 | RGB565LookupTableHandle = GCHandle.Alloc(RGB565LookupTable, GCHandleType.Pinned); 52 | RGB565LookupTablePtr = (uint*)RGB565LookupTableHandle.AddrOfPinnedObject(); 53 | } 54 | 55 | public static void ConvertFrameBufferRGB0555ToXRGB8888(uint width, uint height, IReadOnlyList input, int inputPitch, byte* output, int outputPitch) 56 | { 57 | ConvertFrameBufferUshortToXRGB8888WithLUT(width, height, input, inputPitch, output, outputPitch, RGB0555LookupTablePtr); 58 | } 59 | 60 | public static void ConvertFrameBufferRGB565ToXRGB8888(uint width, uint height, IReadOnlyList input, int inputPitch, byte* output, int outputPitch) 61 | { 62 | ConvertFrameBufferUshortToXRGB8888WithLUT(width, height, input, inputPitch, output, outputPitch, RGB565LookupTablePtr); 63 | } 64 | 65 | public static void ConvertFrameBufferXRGB8888(uint width, uint height, IReadOnlyList input, int inputPitch, byte* output, int outputPitch) 66 | { 67 | var inLineStartIx = 0; 68 | for (var i = 0; i < height; i++) 69 | { 70 | var outLineStart = (uint*)output; 71 | for (var j = 0; j < width; j++) 72 | { 73 | outLineStart[j] = input[inLineStartIx + j]; 74 | } 75 | 76 | inLineStartIx += inputPitch; 77 | output += outputPitch; 78 | } 79 | } 80 | 81 | private static void ConvertFrameBufferUshortToXRGB8888WithLUT(uint width, uint height, IReadOnlyList input, int inputPitch, byte* output, int outputPitch, uint* lutPtr) 82 | { 83 | var inLineStartIx = 0; 84 | for (var i = 0; i < height; i++) 85 | { 86 | var outLineStart = (uint*)output; 87 | for (var j = 0; j < width; j++) 88 | { 89 | outLineStart[j] = lutPtr[input[inLineStartIx + j]]; 90 | } 91 | 92 | inLineStartIx += inputPitch; 93 | output += outputPitch; 94 | } 95 | } 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /RetriX.UWP.Unsafe/Components/IMemoryBufferByteAccess.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | 4 | namespace RetriX.UWP.Components 5 | { 6 | [ComImport] 7 | [Guid("5B0D3235-4DBA-4D44-865E-8F1D0E4FD04D")] 8 | [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] 9 | internal unsafe interface IMemoryBufferByteAccess 10 | { 11 | void GetBuffer(out byte* buffer, out uint capacity); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /RetriX.UWP.Unsafe/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RetriX.UWP.Unsafe")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RetriX.UWP.Unsafe")] 13 | [assembly: AssemblyCopyright("Copyright © 2018")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /RetriX.UWP.Unsafe/Properties/RetriX.UWP.Unsafe.rd.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /RetriX.UWP/App.xaml: -------------------------------------------------------------------------------- 1 |  6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /RetriX.UWP/AppResources.xaml: -------------------------------------------------------------------------------- 1 |  7 | 8 | 800 9 | 16,0 10 | 11 | 17 | 18 | 23 | 24 | /Assets/GameGlyphs.ttf#Flaticon 25 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /RetriX.UWP/AppResources.xaml.cs: -------------------------------------------------------------------------------- 1 | namespace RetriX.UWP 2 | { 3 | partial class AppResources 4 | { 5 | public AppResources() 6 | { 7 | InitializeComponent(); 8 | } 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /RetriX.UWP/Assets/BadgeLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/BadgeLogo.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/BadgeLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/BadgeLogo.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/BadgeLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/BadgeLogo.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/BadgeLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/BadgeLogo.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/BadgeLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/BadgeLogo.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/FileIcon.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/FileIcon.targetsize-16.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/FileIcon.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/FileIcon.targetsize-256.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/FileIcon.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/FileIcon.targetsize-32.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/FileIcon.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/FileIcon.targetsize-48.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/GameGlyphs.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/GameGlyphs.ttf -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Icons.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Icons.zip -------------------------------------------------------------------------------- /RetriX.UWP/Assets/LargeTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/LargeTile.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/LargeTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/LargeTile.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/LargeTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/LargeTile.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/LargeTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/LargeTile.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/LargeTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/LargeTile.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/PackageLogo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/PackageLogo.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/PackageLogo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/PackageLogo.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/PackageLogo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/PackageLogo.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/PackageLogo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/PackageLogo.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/PackageLogo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/PackageLogo.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SmallTile.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SmallTile.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SmallTile.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SmallTile.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SmallTile.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SmallTile.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SmallTile.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SmallTile.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SmallTile.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SmallTile.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SplashScreen.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SplashScreen.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SplashScreen.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SplashScreen.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SplashScreen.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SplashScreen.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SplashScreen.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SplashScreen.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/SplashScreen.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/SplashScreen.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square150x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square150x150Logo.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square150x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square150x150Logo.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square150x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square150x150Logo.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square150x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square150x150Logo.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square150x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square150x150Logo.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-16.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-256.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-32.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.altform-unplated_targetsize-48.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.targetsize-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.targetsize-16.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.targetsize-24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.targetsize-24.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.targetsize-24_altform-unplated.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.targetsize-256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.targetsize-256.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.targetsize-32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.targetsize-32.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Square44x44Logo.targetsize-48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Square44x44Logo.targetsize-48.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Wide310x150Logo.scale-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Wide310x150Logo.scale-100.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Wide310x150Logo.scale-125.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Wide310x150Logo.scale-125.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Wide310x150Logo.scale-150.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Wide310x150Logo.scale-150.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Wide310x150Logo.scale-200.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Wide310x150Logo.scale-200.png -------------------------------------------------------------------------------- /RetriX.UWP/Assets/Wide310x150Logo.scale-400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Aftnet/LibretroRT/3515ee9cc370426ad61eaa01f091df93a3ca7aad/RetriX.UWP/Assets/Wide310x150Logo.scale-400.png -------------------------------------------------------------------------------- /RetriX.UWP/Controls/FileImporter.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /RetriX.UWP/Controls/FileImporter.xaml.cs: -------------------------------------------------------------------------------- 1 | using RetriX.Shared.ViewModels; 2 | using Windows.UI.Xaml; 3 | using Windows.UI.Xaml.Controls; 4 | 5 | namespace RetriX.UWP.Controls 6 | { 7 | public sealed partial class FileImporter : UserControl 8 | { 9 | public FileImporterViewModel VM 10 | { 11 | get { return (FileImporterViewModel)GetValue(VMProperty); } 12 | set { SetValue(VMProperty, value); } 13 | } 14 | 15 | // Using a DependencyProperty as the backing store for VM. This enables animation, styling, binding, etc... 16 | public static readonly DependencyProperty VMProperty = DependencyProperty.Register(nameof(VM), typeof(FileImporterViewModel), typeof(FileImporter), new PropertyMetadata(null)); 17 | 18 | public FileImporter() 19 | { 20 | this.InitializeComponent(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /RetriX.UWP/Controls/PlayerOverlay.xaml.cs: -------------------------------------------------------------------------------- 1 | using RetriX.Shared.ViewModels; 2 | using Windows.UI.Xaml; 3 | using Windows.UI.Xaml.Controls; 4 | 5 | namespace RetriX.UWP.Controls 6 | { 7 | public sealed partial class PlayerOverlay : UserControl 8 | { 9 | public GamePlayerViewModel ViewModel 10 | { 11 | get { return (GamePlayerViewModel)GetValue(VMProperty); } 12 | set { SetValue(VMProperty, value); } 13 | } 14 | 15 | // Using a DependencyProperty as the backing store for VM. This enables animation, styling, binding, etc... 16 | public static readonly DependencyProperty VMProperty = DependencyProperty.Register(nameof(ViewModel), typeof(GamePlayerViewModel), typeof(PlayerOverlay), new PropertyMetadata(null)); 17 | 18 | public PlayerOverlay() 19 | { 20 | InitializeComponent(); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /RetriX.UWP/Controls/VirtualPad.xaml: -------------------------------------------------------------------------------- 1 |  10 | 11 | 12 | 21 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /RetriX.UWP/Converters/ItemClickEventArgsConverter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Windows.UI.Xaml.Controls; 3 | using Windows.UI.Xaml.Data; 4 | 5 | namespace RetriX.UWP.Converters 6 | { 7 | public class ItemClickEventArgsConverter : IValueConverter 8 | { 9 | public object Convert(object value, Type targetType, object parameter, string language) 10 | { 11 | var args = value as ItemClickEventArgs; 12 | return args.ClickedItem; 13 | } 14 | 15 | public object ConvertBack(object value, Type targetType, object parameter, string language) 16 | { 17 | throw new NotImplementedException(); 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /RetriX.UWP/Presentation/CurrentViewModelPresenter.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Core.ViewModels; 2 | using MvvmCross.Uwp.Views; 3 | using RetriX.Shared.Presentation; 4 | 5 | namespace RetriX.UWP.Presentation 6 | { 7 | public class CurrentViewModelPresenter : MvxWindowsViewPresenter, ICurrentViewModelPresenter 8 | { 9 | public IMvxViewModel CurrentViewModel => (_rootFrame.Content as MvxWindowsPage)?.ViewModel; 10 | 11 | public CurrentViewModelPresenter(IMvxWindowsFrame rootFrame) : base(rootFrame) 12 | { 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /RetriX.UWP/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // General Information about an assembly is controlled through the following 6 | // set of attributes. Change these attribute values to modify the information 7 | // associated with an assembly. 8 | [assembly: AssemblyTitle("RetriX.UWP")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("RetriX.UWP")] 13 | [assembly: AssemblyCopyright("Copyright © 2017")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // Version information for an assembly consists of the following four values: 18 | // 19 | // Major Version 20 | // Minor Version 21 | // Build Number 22 | // Revision 23 | // 24 | // You can specify all the values or you can default the Build and Revision Numbers 25 | // by using the '*' as shown below: 26 | // [assembly: AssemblyVersion("1.0.*")] 27 | [assembly: AssemblyVersion("1.0.0.0")] 28 | [assembly: AssemblyFileVersion("1.0.0.0")] 29 | [assembly: ComVisible(false)] -------------------------------------------------------------------------------- /RetriX.UWP/Properties/Default.rd.xml: -------------------------------------------------------------------------------- 1 | 17 | 18 | 19 | 20 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /RetriX.UWP/Services/GameSystemsProviderService.cs: -------------------------------------------------------------------------------- 1 | using Plugin.FileSystem.Abstractions; 2 | using RetriX.Shared.Services; 3 | using RetriX.Shared.ViewModels; 4 | using System.Collections.Generic; 5 | 6 | namespace RetriX.UWP.Services 7 | { 8 | public class GameSystemsProviderService : GameSystemsProviderServiceBase 9 | { 10 | public GameSystemsProviderService(IFileSystem fileSystem) : base(fileSystem) 11 | { 12 | } 13 | 14 | protected override IReadOnlyList GenerateSystemsList(IFileSystem fileSystem) 15 | { 16 | return new GameSystemViewModel[] 17 | { 18 | GameSystemViewModel.MakeNES(LibRetriX.FCEUMM.Core.Instance, fileSystem), 19 | GameSystemViewModel.MakeSNES(LibRetriX.Snes9X.Core.Instance, fileSystem), 20 | //GameSystemViewModel.MakeN64(LibRetriX.ParallelN64.Core.Instance, fileSystem), 21 | GameSystemViewModel.MakeGB(LibRetriX.Gambatte.Core.Instance, fileSystem), 22 | GameSystemViewModel.MakeGBA(LibRetriX.VBAM.Core.Instance, fileSystem), 23 | GameSystemViewModel.MakeDS(LibRetriX.MelonDS.Core.Instance, fileSystem), 24 | GameSystemViewModel.MakeSG1000(LibRetriX.GPGX.Core.Instance, fileSystem), 25 | GameSystemViewModel.MakeMasterSystem(LibRetriX.GPGX.Core.Instance, fileSystem), 26 | GameSystemViewModel.MakeGameGear(LibRetriX.GPGX.Core.Instance, fileSystem), 27 | GameSystemViewModel.MakeMegaDrive(LibRetriX.GPGX.Core.Instance, fileSystem), 28 | GameSystemViewModel.MakeMegaCD(LibRetriX.GPGX.Core.Instance, fileSystem), 29 | //GameSystemViewModel.MakeSaturn(LibRetriX.BeetleSaturn.Core.Instance, fileSystem), 30 | GameSystemViewModel.MakePlayStation(LibRetriX.BeetlePSX.Core.Instance, fileSystem), 31 | GameSystemViewModel.MakePCEngine(LibRetriX.BeetlePCEFast.Core.Instance, fileSystem), 32 | GameSystemViewModel.MakePCEngineCD(LibRetriX.BeetlePCEFast.Core.Instance, fileSystem), 33 | GameSystemViewModel.MakePCFX(LibRetriX.BeetlePCFX.Core.Instance, fileSystem), 34 | GameSystemViewModel.MakeWonderSwan(LibRetriX.BeetleWswan.Core.Instance, fileSystem), 35 | GameSystemViewModel.MakeArcade(LibRetriX.FBAlpha.Core.Instance, fileSystem), 36 | GameSystemViewModel.MakeNeoGeoPocket(LibRetriX.BeetleNGP.Core.Instance, fileSystem), 37 | GameSystemViewModel.MakeNeoGeo(LibRetriX.FBAlpha.Core.Instance, fileSystem), 38 | }; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /RetriX.UWP/Setup.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Core.ViewModels; 2 | using MvvmCross.Platform; 3 | using MvvmCross.Platform.Logging; 4 | using MvvmCross.Uwp.Platform; 5 | using MvvmCross.Uwp.Views; 6 | using RetriX.Shared.Presentation; 7 | using RetriX.Shared.Services; 8 | using RetriX.UWP.Presentation; 9 | using RetriX.UWP.Services; 10 | using Windows.UI.Xaml.Controls; 11 | 12 | namespace RetriX.UWP 13 | { 14 | public class Setup : MvxWindowsSetup 15 | { 16 | private CurrentViewModelPresenter Presenter; 17 | 18 | public Setup(Frame rootFrame) : base(rootFrame) 19 | { 20 | } 21 | 22 | protected override IMvxApplication CreateApp() 23 | { 24 | return new Shared.App(); 25 | } 26 | 27 | protected override void InitializeFirstChance() 28 | { 29 | Mvx.ConstructAndRegisterSingleton(); 30 | Mvx.ConstructAndRegisterSingleton(); 31 | Mvx.ConstructAndRegisterSingleton(); 32 | Mvx.ConstructAndRegisterSingleton(); 33 | } 34 | 35 | protected override void InitializeLastChance() 36 | { 37 | Mvx.ConstructAndRegisterSingleton(); 38 | } 39 | 40 | protected override IMvxWindowsViewPresenter CreateViewPresenter(IMvxWindowsFrame rootFrame) 41 | { 42 | Presenter = new CurrentViewModelPresenter(rootFrame); 43 | Mvx.RegisterSingleton(Presenter); 44 | return Presenter; 45 | } 46 | 47 | protected override MvxLogProviderType GetDefaultLogProviderType() 48 | { 49 | return MvxLogProviderType.None; 50 | } 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /RetriX.UWP/Views/AboutView.xaml: -------------------------------------------------------------------------------- 1 |  9 | 10 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | Aftnet 24 | 25 | 26 | Libretro 27 | 28 | 29 | Playing Videogames icon pack 30 | Freepik 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /RetriX.UWP/Views/AboutView.xaml.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Uwp.Views; 2 | using RetriX.Shared.ViewModels; 3 | 4 | namespace RetriX.UWP.Pages 5 | { 6 | public sealed partial class AboutView : MvxWindowsPage 7 | { 8 | public AboutViewModel VM => ViewModel as AboutViewModel; 9 | 10 | public AboutView() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /RetriX.UWP/Views/GamePlayerView.xaml.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Platform; 2 | using MvvmCross.Uwp.Views; 3 | using RetriX.Shared.Services; 4 | using RetriX.Shared.ViewModels; 5 | 6 | namespace RetriX.UWP.Pages 7 | { 8 | public sealed partial class GamePlayerView : MvxWindowsPage 9 | { 10 | public GamePlayerViewModel VM => ViewModel as GamePlayerViewModel; 11 | private VideoService Renderer { get; } = Mvx.Resolve() as VideoService; 12 | 13 | public GamePlayerView() 14 | { 15 | InitializeComponent(); 16 | Unloaded += OnUnloading; 17 | 18 | Renderer.RenderPanel = PlayerPanel; 19 | } 20 | 21 | private void OnUnloading(object sender, Windows.UI.Xaml.RoutedEventArgs e) 22 | { 23 | Renderer.RenderPanel = null; 24 | PlayerPanel.RemoveFromVisualTree(); 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /RetriX.UWP/Views/GameSystemSelectionView.xaml.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Uwp.Views; 2 | using RetriX.Shared.ViewModels; 3 | 4 | namespace RetriX.UWP.Pages 5 | { 6 | public sealed partial class GameSystemSelectionView : MvxWindowsPage 7 | { 8 | public GameSystemSelectionViewModel VM => ViewModel as GameSystemSelectionViewModel; 9 | 10 | public GameSystemSelectionView() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /RetriX.UWP/Views/SettingsView.xaml: -------------------------------------------------------------------------------- 1 |  12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /RetriX.UWP/Views/SettingsView.xaml.cs: -------------------------------------------------------------------------------- 1 | using MvvmCross.Uwp.Views; 2 | using RetriX.Shared.ViewModels; 3 | 4 | namespace RetriX.UWP.Pages 5 | { 6 | public sealed partial class SettingsView : MvxWindowsPage 7 | { 8 | public SettingsViewModel VM => ViewModel as SettingsViewModel; 9 | 10 | public SettingsView() 11 | { 12 | this.InitializeComponent(); 13 | } 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Retrix.UWP.Native/D3DSurfaceMap.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | #include "D3DSurfaceMap.h" 3 | 4 | using namespace Retrix::UWP::Native; 5 | using namespace Platform; 6 | 7 | D3DSurfaceMap::D3DSurfaceMap(CanvasDevice^ device, IDirect3DSurface^ surface) 8 | { 9 | ComPtr d3dDevice; 10 | __abi_ThrowIfFailed(GetDXGIInterface(device, d3dDevice.GetAddressOf())); 11 | 12 | d3dDevice->GetImmediateContext(d3dContext.GetAddressOf()); 13 | __abi_ThrowIfFailed(GetDXGIInterface(surface, d3dTexture.GetAddressOf())); 14 | 15 | D3D11_MAPPED_SUBRESOURCE mappedResource; 16 | __abi_ThrowIfFailed(d3dContext->Map(d3dTexture.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource)); 17 | 18 | pitchBytes = mappedResource.RowPitch; 19 | data = (UnsafeIntPtr)mappedResource.pData; 20 | } 21 | 22 | D3DSurfaceMap::~D3DSurfaceMap() 23 | { 24 | d3dContext->Unmap(d3dTexture.Get(), 0); 25 | } 26 | 27 | IDirect3DSurface^ D3DSurfaceMap::CreateMappableD3DSurface(CanvasDevice^ device, unsigned int width, unsigned int height) 28 | { 29 | ComPtr d3dDevice; 30 | __abi_ThrowIfFailed(GetDXGIInterface(device, d3dDevice.GetAddressOf())); 31 | 32 | D3D11_TEXTURE2D_DESC texDesc = { 0 }; 33 | texDesc.Width = width; 34 | texDesc.Height = height; 35 | texDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; 36 | texDesc.MipLevels = 1; 37 | texDesc.ArraySize = 1; 38 | texDesc.SampleDesc.Count = 1; 39 | texDesc.SampleDesc.Quality = 0; 40 | texDesc.Usage = D3D11_USAGE_DYNAMIC; 41 | texDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE; 42 | texDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; 43 | texDesc.MiscFlags = 0; 44 | 45 | ComPtr d3dTexture; 46 | __abi_ThrowIfFailed(d3dDevice->CreateTexture2D(&texDesc, nullptr, d3dTexture.GetAddressOf())); 47 | 48 | ComPtr d3dSurface; 49 | __abi_ThrowIfFailed(d3dTexture.As(&d3dSurface)); 50 | 51 | auto winRTSurface = CreateDirect3DSurface(d3dSurface.Get()); 52 | return winRTSurface; 53 | } -------------------------------------------------------------------------------- /Retrix.UWP.Native/D3DSurfaceMap.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | using namespace Microsoft::Graphics::Canvas; 4 | using namespace Microsoft::WRL; 5 | using namespace Platform; 6 | using namespace Windows::Graphics::DirectX::Direct3D11; 7 | 8 | namespace Retrix 9 | { 10 | namespace UWP 11 | { 12 | namespace Native 13 | { 14 | public ref class D3DSurfaceMap sealed 15 | { 16 | #ifdef _WIN64 17 | typedef int64 UnsafeIntPtr; 18 | #else 19 | typedef int32 UnsafeIntPtr; 20 | #endif 21 | private: 22 | ComPtr d3dContext; 23 | ComPtr d3dTexture; 24 | 25 | uint32 pitchBytes; 26 | UnsafeIntPtr data; 27 | 28 | public: 29 | property uint32 PitchBytes { uint32 get() { return pitchBytes; } } 30 | property UnsafeIntPtr Data {UnsafeIntPtr get() { return data; } } 31 | 32 | D3DSurfaceMap(CanvasDevice^ device, IDirect3DSurface^ surface); 33 | virtual ~D3DSurfaceMap(); 34 | 35 | static IDirect3DSurface^ CreateMappableD3DSurface(CanvasDevice^ device, unsigned int width, unsigned int height); 36 | }; 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Retrix.UWP.Native/Retrix.UWP.Native.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | c927d09c-81d1-40d2-865f-0d5be74a53dd 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Retrix.UWP.Native/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /Retrix.UWP.Native/pch.cpp: -------------------------------------------------------------------------------- 1 | #include "pch.h" 2 | -------------------------------------------------------------------------------- /Retrix.UWP.Native/pch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | // DirectX headers. 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | // Win2D headers. 15 | #include -------------------------------------------------------------------------------- /Snes9X.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.Snes9X 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Snes9X.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "Snes9X"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Snes9X.LibRetriX/Snes9X.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Snes9X/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /VBAM.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.VBAM 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /VBAM.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "VBAM"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /VBAM.LibRetriX/VBAM.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /VBAM/VBAM.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 6 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tga;tiff;tif;png;wav;mfcribbon-ms 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /VBAM/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /Yabause.LibRetriX/Core.cs: -------------------------------------------------------------------------------- 1 | using LibRetriX.RetroBindings; 2 | using System; 3 | using System.Threading; 4 | 5 | namespace LibRetriX.Yabause 6 | { 7 | public static class Core 8 | { 9 | private static Lazy core = new Lazy(InitCore, LazyThreadSafetyMode.ExecutionAndPublication); 10 | 11 | public static ICore Instance => core.Value; 12 | 13 | private static ICore InitCore() 14 | { 15 | var core = new LibretroCore(); 16 | core.Initialize(); 17 | return core; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Yabause.LibRetriX/NativeDllInfo.cs: -------------------------------------------------------------------------------- 1 | namespace LibRetriX 2 | { 3 | internal static class NativeDllInfo 4 | { 5 | public const string DllName = "Yabause"; 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /Yabause.LibRetriX/Yabause.LibRetriX.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | netstandard1.3 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /Yabause/targetver.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // Including SDKDDKVer.h defines the highest available Windows platform. 4 | 5 | // If you wish to build your application for a previous Windows platform, include WinSDKVer.h and 6 | // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. 7 | 8 | #include 9 | --------------------------------------------------------------------------------