public Result GetGameCardHandle(out GameCardHandle handle) { if (!GameCard.IsGameCardInserted()) { handle = default; return(ResultFs.GameCardNotInsertedOnGetHandle.Log()); } handle = GameCard.GetGameCardHandle(); return(Result.Success); }
public Result Read(GameCardHandle handle, long offset, Span <byte> destination) { if (IsGameCardHandleInvalid(handle)) { return(ResultFs.InvalidGameCardHandleOnRead.Log()); } if (!IsGameCardInserted()) { return(ResultFs.GameCardNotInserted.Log()); } return(CardImageStorage.Read(offset, destination)); }
internal Result GetXci(out Xci xci, GameCardHandle handle) { xci = default; if (IsGameCardHandleInvalid(handle)) { return(ResultFs.InvalidGameCardHandleOnRead.Log()); } if (!IsGameCardInserted()) { return(ResultFs.GameCardNotInserted.Log()); } xci = CardImage; return(Result.Success); }
internal Result GetCardInfo(out GameCardInfo cardInfo, GameCardHandle handle) { cardInfo = default; if (IsGameCardHandleInvalid(handle)) { return(ResultFs.InvalidGameCardHandleOnGetCardInfo.Log()); } if (!IsGameCardInserted()) { return(ResultFs.GameCardNotInserted.Log()); } cardInfo = GetCardInfoImpl(); return(Result.Success); }
public Result OpenGameCardStorage(out IStorage storage, GameCardHandle handle, GameCardPartitionRaw partitionId) { switch (partitionId) { case GameCardPartitionRaw.Normal: return(FsCreators.GameCardStorageCreator.CreateNormal(handle, out storage)); case GameCardPartitionRaw.Secure: return(FsCreators.GameCardStorageCreator.CreateSecure(handle, out storage)); case GameCardPartitionRaw.Writable: return(FsCreators.GameCardStorageCreator.CreateWritable(handle, out storage)); default: throw new ArgumentOutOfRangeException(nameof(partitionId), partitionId, null); } }
public Result OpenGameCardFileSystem(out IFileSystem fileSystem, GameCardHandle handle, GameCardPartition partitionId) { Result rc; int tries = 0; do { rc = FsCreators.GameCardFileSystemCreator.Create(out fileSystem, handle, partitionId); if (!ResultFs.DataCorrupted.Includes(rc)) { break; } tries++; } while (tries < 2); return(rc); }
public Result OpenGameCardStorage(out IStorage storage, GameCardHandle handle, GameCardPartitionRaw partitionId) { // Missing permission check and StorageInterfaceAdapter return(FsProxyCore.OpenGameCardStorage(out storage, handle, partitionId)); }
public bool IsGameCardHandleInvalid(GameCardHandle handle) { return(Handle != handle.Value); }
public Result OpenGameCardFileSystem(out IFileSystem fileSystem, GameCardHandle handle, GameCardPartition partitionId) { return(FsCreators.GameCardFileSystemCreator.Create(out fileSystem, handle, partitionId)); }