diff --git a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs index f0963d1..495cf09 100644 --- a/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs +++ b/AxibugEmuOnline.Client/Assets/Script/NesEmulator/VideoProvider.cs @@ -57,8 +57,8 @@ namespace AxibugEmuOnline.Client public unsafe void SetDrawData(uint* screenData) { PrepareUI(screenData); - if (GPUTurbo) PrepareForGPU(screenData); - else PrepareForCPU(screenData); + if (GPUTurbo) PrepareForGPU(screenData);//判断使用GPU还是CPU + else PrepareForCPU(screenData);//使用CPU if (GPUTurbo) { @@ -144,6 +144,7 @@ namespace AxibugEmuOnline.Client for (int line = 0; line < PPU.SCREEN_HEIGHT; line++) { + //PS:如果是CPU计算,宽度减少16的不必要部分,才能对齐 width = PPU.SCREEN_WIDTH - 16; while (width > 0) @@ -151,14 +152,17 @@ namespace AxibugEmuOnline.Client var edx = screenData[pScn + 8]; uint index = edx & 0xFF; + //按下标颜色查找表中真实颜色 var colorData = palRaw[index]; //dst中颜色排列为abgr,而colorData排列为argb uint r = (colorData & 0x00FF0000) >> 16; // 提取Red通道 uint g = (colorData & 0x0000FF00) >> 8; // 提取Green通道 uint b = (colorData & 0x000000FF); // 提取Blue通道 + //用rgb构建颜色对象(如果非unity 可以用这个rgb 构建System.Drawing.Color 单个颜色对象) uint abgr = 0xFF000000 | (b << 16) | (g << 8) | (r << 0); + //放进颜色矩阵 Dst[pDst] = abgr; pScn += 1; diff --git a/README.md b/README.md index 2b97e1e..2fb69bb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # AxibugEmuOnline +### 涓涓法骞冲彴鐨勩佽嚜鍔ㄥ寲鑱旀満鐨勩佺函C#瀹炵幇鐨勩佸紑婧愮殑妯℃嫙鍣ㄩ」鐩 + 鐢ㄤ簬娓告垙妯℃嫙鍣ㄥ悓姝ョ殑鑱旀満绾疌#瀹炵幇 AxibugEmuOnline.Server 鏄湇鍔$ .Net8 @@ -10,7 +12,7 @@ - NES EmuCore NES妯℃嫙鍣ㄦ牳蹇 - VirtualNes 锛圕++鎵嬪姩缈昏瘧鍒癈#锛 + VirtualNes 锛圕++鎵嬪姩缈昏瘧鍒癈#锛屽苟鏀剁撼姘戦棿鍚勭鎵╁睍Mapper瀹炵幇锛屾帴杩戜簬鏈鍏ㄧ殑娓告垙鏀寔銆傚疄娴嬶紝楂樺嶉熷姞閫熸父鎴忕殑鍚屾椂锛堝嚑鐧緁ps锛夛紝涓旇繘琛岀綉缁滃悓姝ワ紝鎬ц兘涓鑷达紝瀹屽叏鍚屾锛 ~~My Nes~~ (鍔熻兘鍏紝浣嗘槸鎬ц兘灞闄愶紝涓嶄綔涓轰富瑕佷娇鐢紝浣嗗凡缁忕Щ妞嶇函.Net Standard2.0褰掓。) @@ -30,11 +32,25 @@ 鐩墠鍏朵粬璺ㄥ钩鍙拌仈鏈猴紝浠呴檺浜庣數鑴戝拰鎵嬫満 -#### 2.鑹ソ浣撻獙涓虹洰鏍 +#### 2.鑷姩鍖栬仈鏈 - 浠ョ幇浠e寲鑱旀満鏂瑰紡浣滀负鍩烘湰鏂瑰悜 - -#### 3.鍚勭鏈夋剰涔夌殑鎺㈢储锛堜綔涓洪澶栧姛鑳斤級 + 鐜╁涓嶇敤鍏冲績浠讳綍璇稿IP鎴栬呬换浣曡仈鏈洪厤缃紝鐩存帴鐜┿傛湇鍔″櫒鏄洿鎺ユ彁渚涚殑锛岀帺瀹舵棤鎰熺煡銆 + + 鐢氳嚦涓嶇敤鎵嬪姩鍒涘缓鎴块棿锛屾父鐜╁氨鏄埧闂淬傚姞鍏ユ斁涔熶笉鐢ㄤ笓闂ㄤ笅杞斤紝鐩存帴閫夋嫨鎴块棿涔嬪悗锛岃嚜鍔ㄥ寲涓嬭浇瀹屾垚娓告垙骞惰繘鍏ユ父鎴忋 + +#### 3.鏌旀х綉缁滄灦鏋 + + 鏈缁堟晥鏋滐紝涓嶄細鍑虹幇寤惰繜楂樻椂鐨勫崱椤垮拰鏆傚仠绛夊緟锛屼篃涓嶄細鍑虹幇鎴块棿鍒涘缓鑰呭拰鍔犲叆鑰呬箣闂 鍥犵綉缁滅姸鍐靛樊寮傞犳垚浣撻獙宸紓锛屼繚璇佸叕骞炽 + + 鏌旀ф寚锛氭牴鎹綉缁滃欢杩熷拰鏈ㄦ《鏁堝簲鍔ㄦ佽皟鏁村抚鍚屾鎻愬墠閲忋備綔涓鸿鍔ㄦ帹甯с + + 鏍稿績鍘熺悊鏄敤鍒氬ソ鏃犻檺瓒嬭繎浜庣墿鐞嗗欢杩熸湰韬殑缂撳啿浣滐紝鏉ユ姷娑堜腑闂寸瓑寰呫 + + 鏈潵鐜╁鐨勫湴鐞嗕綅缃甫鏉ョ殑鐗╃悊寤惰繜鏄笉鍙姉鍥犵礌锛屼絾鎴戜滑鎶婅繖閮ㄥ垎鎷垮埄鐢ㄨ捣鏉ュ鍐诧紝浠讳綍鑰楁椂鎿嶄綔锛岄槦鍒楋紝鍫嗘爤澶勭悊閮藉湪杩欓儴鍒嗗畬鎴愩傛病鏈夊浣欍 + + 鏈缁堣揪鍒颁簡闄や簡鐗╃悊寤惰繜涔嬪锛屾病鏈変换浣曟氮璐癸紝骞跺嵆渚挎槸缃戠粶鐘跺喌鏋佸樊鏃讹紝浠呰〃鐜颁负鎿嶄綔寤惰繜锛岃屼笉鏄叾浠栦竴浜涙ā鎷熷櫒鐨勯】甯у崱椤裤備笖鍚屾涓鑷存у緱浠ヤ繚璇併 + +#### 4.鍚勭鏈夋剰涔夌殑鎺㈢储锛堜綔涓洪澶栧姛鑳斤紝鍜岃仈鏈烘棤鍏筹級 搴旇鏄疷nity寮曟搸涓浜庢ā鎷熷櫒鍐呮牳鐨勭敾闈㈡帴鍏ヨ壇濂界殑鑼冧緥 @@ -130,6 +146,4 @@ Mapper鏀寔瓒婂锛岄氫織璁插氨鏄敮鎸佹洿澶氬崱甯︺ 鏈缁堜細缁ф壙鍒版湰椤圭洰涓 - http://git.axibug.com/sin365/MAME.Core - - + http://git.axibug.com/sin365/MAME.Core \ No newline at end of file