コード例 #1
0
        public void Awake()
        {
            UNES = GetComponent <UNESBehaviour>();
            var data = Resources.Load <TextAsset>(RomFile).bytes;

            UNES.Boot(data);
        }
コード例 #2
0
ファイル: UnityRenderer.cs プロジェクト: ls9512/UNES
        public void Init(UNESBehaviour nes)
        {
            UnesBehaviour = nes;
            RenderTexture = nes.RenderTexture;
            _drawTexture  = new Texture2D(UNESBehaviour.GameWidth, UNESBehaviour.GameHeight);
            _pixelCache   = new Color[UNESBehaviour.GameWidth * UNESBehaviour.GameHeight];

            _clearTexture = new Texture2D(1, 1);
            _clearTexture.SetPixel(0, 0, Color.clear);
            _clearTexture.Apply();
        }
コード例 #3
0
ファイル: NesController.cs プロジェクト: ls9512/UNES
        public NesController(UNESBehaviour nse)
        {
            _nes = nse;

            _keyMapping = new Dictionary <KeyCode, int>
            {
                { Config.A, 7 },
                { Config.B, 6 },
                { Config.Select, 5 },
                { Config.Start, 4 },
                { Config.Up, 3 },
                { Config.Down, 2 },
                { Config.Left, 1 },
                { Config.Right, 0 },
            };
        }