public void InitializeFsServer(LibHac.Horizon horizon, out HorizonClient fsServerClient) { LocalFileSystem serverBaseFs = new LocalFileSystem(AppDataManager.BaseDirPath); fsServerClient = horizon.CreatePrivilegedHorizonClient(); var fsServer = new FileSystemServer(fsServerClient); DefaultFsServerObjects fsServerObjects = DefaultFsServerObjects.GetDefaultEmulatedCreators(serverBaseFs, KeySet, fsServer); // Use our own encrypted fs creator that always uses all-zero keys fsServerObjects.FsCreators.EncryptedFileSystemCreator = new EncryptedFileSystemCreator(); GameCard = fsServerObjects.GameCard; SdCard = fsServerObjects.SdCard; SdCard.SetSdCardInsertionStatus(true); var fsServerConfig = new FileSystemServerConfig { DeviceOperator = fsServerObjects.DeviceOperator, ExternalKeySet = KeySet.ExternalKeySet, FsCreators = fsServerObjects.FsCreators }; FileSystemServerInitializer.InitializeWithConfig(fsServerClient, fsServer, fsServerConfig); }
public override void BusConnect() { if (!_isSandbox) { if (card?.IsOpened() == true) { card.Close(); } card = new SdCard(); if (!string.IsNullOrEmpty(_imageFileName)) { card.Open(_imageFileName); } } }
public void Reload() { ReloadKeySet(); LocalFileSystem serverBaseFs = new LocalFileSystem(GetBasePath()); DefaultFsServerObjects fsServerObjects = DefaultFsServerObjects.GetDefaultEmulatedCreators(serverBaseFs, KeySet); GameCard = fsServerObjects.GameCard; SdCard = fsServerObjects.SdCard; SdCard.SetSdCardInsertionStatus(true); FileSystemServerConfig fsServerConfig = new FileSystemServerConfig { FsCreators = fsServerObjects.FsCreators, DeviceOperator = fsServerObjects.DeviceOperator, ExternalKeySet = KeySet.ExternalKeySet }; FsServer = new FileSystemServer(fsServerConfig); FsClient = FsServer.CreateFileSystemClient(); }
public Result Create(out IFileSystem fileSystem) { fileSystem = default; if (!SdCard.IsSdCardInserted()) { return(ResultFs.SdCardNotFound.Log()); } if (SdCardFileSystem != null) { fileSystem = SdCardFileSystem; return(Result.Success); } if (RootFileSystem == null) { return(ResultFs.PreconditionViolation.Log()); } string path = Path ?? DefaultPath; // Todo: Add ProxyFileSystem? Result rc = Util.CreateSubFileSystem(out IFileSystem sdFileSystem, RootFileSystem, path, true); if (rc.IsFailure()) { return(rc); } SdCardFileSystem = sdFileSystem; fileSystem = sdFileSystem; return(Result.Success); }
public Result Create(out IFileSystem fileSystem, bool isCaseSensitive) { UnsafeHelpers.SkipParamInit(out fileSystem); if (!SdCard.IsSdCardInserted()) { return(ResultFs.PortSdCardNoDevice.Log()); } if (SdCardFileSystem != null) { fileSystem = SdCardFileSystem; return(Result.Success); } if (RootFileSystem == null) { return(ResultFs.PreconditionViolation.Log()); } string path = Path ?? DefaultPath; // Todo: Add ProxyFileSystem? Result rc = Util.CreateSubFileSystem(out IFileSystem sdFileSystem, RootFileSystem, path, true); if (rc.IsFailure()) { return(rc); } SdCardFileSystem = sdFileSystem; fileSystem = sdFileSystem; return(Result.Success); }
public SdReader(SdCard sd) { _sd = sd; }
public override void BusConnect() { card = new SdCard(); }
public CardReaderAdapter(SdCard sdCard) { _sdCard = sdCard; }