From c30df0b284af3243a46c24e752ea6bd41aefdaa4 Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Fri, 16 Aug 2024 10:39:51 +0800 Subject: [PATCH] Fix texture channel for psvita --- .../Assets/Script/NesEmulator/VideoProvider.cs | 6 ++++-- .../Assets/Script/NesEmulator/VirtuaNesDraw.shader | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs index 70ade97..6688bbc 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs @@ -21,7 +21,8 @@ namespace AxibugEmuOnline.Client { if (wrapTex == null) { - wrapTex = new Texture2D(272, 240, TextureFormat.BGRA32, false); + //wrapTex = new Texture2D(272, 240, TextureFormat.BGRA32, false); + wrapTex = new Texture2D(272, 240, TextureFormat.RGBA32, false); wrapTex.filterMode = FilterMode.Point; wrapTexBuffer = screenData; @@ -36,7 +37,8 @@ namespace AxibugEmuOnline.Client TexBufferSize = wrapTexBuffer.Length * 4; var palRaw = PaletteDefine.m_cnPalette[0]; - pPal = new Texture2D(palRaw.Length, 1, TextureFormat.BGRA32, 1, true); + //pPal = new Texture2D(palRaw.Length, 1, TextureFormat.BGRA32, 1, true); + pPal = new Texture2D(palRaw.Length, 1, TextureFormat.RGBA32, false); pPal.filterMode = FilterMode.Point; for (int i = 0; i < palRaw.Length; i++) { diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VirtuaNesDraw.shader b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VirtuaNesDraw.shader index 63fad39..411973b 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VirtuaNesDraw.shader +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VirtuaNesDraw.shader @@ -109,7 +109,8 @@ half4 color = tex2D(_MainTex,mapUV); - float rawIndex = color.b; + //float rawIndex = color.b; + float rawIndex = color.r; color = tex2D(_PalTex,float2(rawIndex,0.5));