From 327570e031e5c0ad992f2046185e59d883f0f369 Mon Sep 17 00:00:00 2001
From: sin365 <353374337@qq.com>
Date: Wed, 8 Jan 2025 18:24:56 +0800
Subject: [PATCH] =?UTF-8?q?=E4=B8=AD=E9=97=B4=E5=9B=BE=E5=BD=A2=E8=BD=AC?=
=?UTF-8?q?=E6=8D=A2=E5=BA=93?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AxibugEmuOnline.GameScreenConvert.csproj | 13 ++++
...bugEmuOnline.GameScreenConvert.csproj.user | 6 ++
.../PublishProfiles/FolderProfile.pubxml | 13 ++++
.../PublishProfiles/FolderProfile.pubxml.user | 10 +++
.../ScreenConvert.cs | 61 +++++++++++++++++++
AxibugEmuOnline.sln | 6 ++
6 files changed, 109 insertions(+)
create mode 100644 AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj
create mode 100644 AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj.user
create mode 100644 AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml
create mode 100644 AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml.user
create mode 100644 AxibugEmuOnline.GameScreenConvert/ScreenConvert.cs
diff --git a/AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj b/AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj
new file mode 100644
index 00000000..06287911
--- /dev/null
+++ b/AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj
@@ -0,0 +1,13 @@
+
+
+
+ netstandard2.0
+
+
+ 8.0
+
+
+
+
+
+
diff --git a/AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj.user b/AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj.user
new file mode 100644
index 00000000..4ed71907
--- /dev/null
+++ b/AxibugEmuOnline.GameScreenConvert/AxibugEmuOnline.GameScreenConvert.csproj.user
@@ -0,0 +1,6 @@
+
+
+
+ <_LastSelectedProfileId>G:\Sin365\AxibugEmuOnline\AxibugEmuOnline.GameScreenConvert\Properties\PublishProfiles\FolderProfile.pubxml
+
+
\ No newline at end of file
diff --git a/AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml b/AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml
new file mode 100644
index 00000000..659e1eea
--- /dev/null
+++ b/AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml
@@ -0,0 +1,13 @@
+
+
+
+
+ Release
+ Any CPU
+ bin\Release\netstandard2.0\publish\
+ FileSystem
+ <_TargetId>Folder
+
+
\ No newline at end of file
diff --git a/AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml.user b/AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml.user
new file mode 100644
index 00000000..090649b1
--- /dev/null
+++ b/AxibugEmuOnline.GameScreenConvert/Properties/PublishProfiles/FolderProfile.pubxml.user
@@ -0,0 +1,10 @@
+
+
+
+
+ True|2025-01-08T10:23:00.0935802Z||;True|2025-01-08T17:56:27.1142682+08:00||;
+
+
+
\ No newline at end of file
diff --git a/AxibugEmuOnline.GameScreenConvert/ScreenConvert.cs b/AxibugEmuOnline.GameScreenConvert/ScreenConvert.cs
new file mode 100644
index 00000000..67afe96c
--- /dev/null
+++ b/AxibugEmuOnline.GameScreenConvert/ScreenConvert.cs
@@ -0,0 +1,61 @@
+namespace AxibugEmuOnline.GameScreenConvert
+{
+ public static class ScreenConvert
+ {
+ ///
+ /// 转换
+ ///
+ ///
+ /// enum RomPlatformType
+ ///{
+ /// Invalid = 0;
+ /// Nes = 1;
+ /// Master_System = 2;
+ /// Game_Gear = 3;
+ /// Game_Boy = 4;
+ /// Game_Boy_Color = 5;
+ /// Coleco_Vision = 6;
+ /// SC_3000 = 7;
+ /// SG_1000 = 8;
+ /// All = 999;
+ ///}
+ ///
+ ///
+ ///
+ /// 品质0~100
+ ///
+ ///
+ public static bool Convert(int platform, byte[] srcData, out byte[] imageData)
+ {
+ IScreenConvert convert = default;
+ switch (platform)
+ {
+ case 1://nes
+ //
+ break;
+ default:
+ convert = new SampleScreenConvert();
+ break;
+ }
+ return convert.ScreenDataToRGBA32Data(platform, srcData, out imageData);
+ }
+ }
+
+ public interface IScreenConvert
+ {
+
+ bool ScreenDataToRGBA32Data(int platform, byte[] srcData, out byte[] imageData);
+ }
+
+ public class SampleScreenConvert : IScreenConvert
+ {
+ public bool ScreenDataToRGBA32Data(int platform, byte[] srcData, out byte[] imageData)
+ {
+ imageData = null;
+ //TODO 这里加上自己从原始数据中的颜色处理 比如颜色查找表
+ //System.Span 也是可用的
+ //统一处理成RGBA32的通道顺序
+ return imageData != null;
+ }
+ }
+}
diff --git a/AxibugEmuOnline.sln b/AxibugEmuOnline.sln
index ad516089..06886ec7 100644
--- a/AxibugEmuOnline.sln
+++ b/AxibugEmuOnline.sln
@@ -9,6 +9,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AxibugEmuOnline.Server", "A
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VirtualNes.Core", "Core\VirtualNes.Core\VirtualNes.Core.csproj", "{637EB35A-4D1A-41EA-9A7B-459E17E93981}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AxibugEmuOnline.GameScreenConvert", "AxibugEmuOnline.GameScreenConvert\AxibugEmuOnline.GameScreenConvert.csproj", "{A70AD410-E2F2-4792-AEC1-A0DB83392E52}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -27,6 +29,10 @@ Global
{637EB35A-4D1A-41EA-9A7B-459E17E93981}.Debug|Any CPU.Build.0 = Debug|Any CPU
{637EB35A-4D1A-41EA-9A7B-459E17E93981}.Release|Any CPU.ActiveCfg = Release|Any CPU
{637EB35A-4D1A-41EA-9A7B-459E17E93981}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A70AD410-E2F2-4792-AEC1-A0DB83392E52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A70AD410-E2F2-4792-AEC1-A0DB83392E52}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A70AD410-E2F2-4792-AEC1-A0DB83392E52}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A70AD410-E2F2-4792-AEC1-A0DB83392E52}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE