public IMapper GetMapper(byte number, Ines ines, Memory <byte> sram) { return(number switch { 0 => GetMapper0(ines, sram), _ => throw new MapperException("未知的Mapper号", number), });
public Cartridge(Ines ines, Memory <byte> sram) { var mapper = MapperFactory.Factory.GetMapper(ines.Header.MapperNumber(), ines, sram); Mapper = mapper; Ines = ines; Sram = sram; }