Ejemplo n.º 1
0
        public void StartPpuDebug(NESManager newManager)
        {
            manager  = newManager;
            emulator = manager.Emulator;
            ppu      = emulator.Ppu;

            paletteTextures = new Texture2D[paletteImages.Length];
            paletteBuffers  = new Color32[paletteImages.Length][];
            for (int i = 0; i < paletteTextures.Length; i++)
            {
                paletteTextures[i]            = new Texture2D(4, 1, TextureFormat.RGBA32, false);
                paletteTextures[i].filterMode = FilterMode.Point;
                paletteImages[i].texture      = paletteTextures[i];
                paletteBuffers[i]             = new Color32[paletteTextures[i].width * paletteTextures[i].height];
            }

            patternTextures = new Texture2D[patternImages.Length];
            patternBuffers  = new Color32[patternImages.Length][];
            for (int i = 0; i < patternTextures.Length; i++)
            {
                patternTextures[i]            = new Texture2D(16 * 8, 16 * 8, TextureFormat.RGBA32, false);
                paletteTextures[i].filterMode = FilterMode.Point;
                patternImages[i].texture      = patternTextures[i];
                patternBuffers[i]             = new Color32[patternTextures[i].width * patternTextures[i].height];
            }

            patternBuffer = new byte[patternTextures[0].width, patternTextures[0].height];
            paletteBuffer = new byte[4];

            oamBuilder = new StringBuilder();
        }
Ejemplo n.º 2
0
        public void StartOutput(NESManager newManager)
        {
            manager = newManager;
            ppu     = manager.Emulator.Ppu;

            screenTexture = new Texture2D(Emulator.ScreenWidth, Emulator.ScreenHeight, TextureFormat.RGBA32, false)
            {
                filterMode = FilterMode.Point
            };
            screenImage.texture = screenTexture;
            bufferLength        = screenTexture.width * screenTexture.height;
            screenBuffer        = new Color32[bufferLength];

            // RGBA32 texture format data layout exactly matches Color32 struct
            nativeScreenTexture = screenTexture.GetRawTextureData <Color32>();
        }
Ejemplo n.º 3
0
 public void StartOutput(NESManager newManager)
 {
     manager = newManager;
     apu     = manager.Emulator.Apu;
 }