diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs index dec3d3a1..5d57af62 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/EmuTimer.cs @@ -172,8 +172,8 @@ namespace MAME.Core { for (int i = 0; i < Count; i++) { - timerArray[i] = null; timerArray[i].ReleaseRef(); + timerArray[i] = null; } Count = 0; _frist_Timer = null; diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs index b932dfb7..2a8b153b 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/emu/Motion.cs @@ -312,6 +312,8 @@ int endX = Video.offsetx + Video.width; int startY = Video.offsety; int endY = Video.offsety + Video.height; + + int* bitmapbaseN_curbitmap_0_Ptrs = &Video.bitmapbaseN_Ptrs[Video.curbitmap][0]; if (single_step || Mame.paused) { byte bright = 0xa7; @@ -322,9 +324,15 @@ { //i = y * Video.fullwidth + x; i = stepIndex + x; - red = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff0000) >> 16) * bright / 0xff; - green = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff00) >> 8) * bright / 0xff; - blue = (Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff) * bright / 0xff; + //red = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff0000) >> 16) * bright / 0xff; + //green = ((Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff00) >> 8) * bright / 0xff; + //blue = (Video.bitmapbaseN_Ptrs[Video.curbitmap][i] & 0xff) * bright / 0xff; + + int bitmapbaseN_curbitmap_i_value = bitmapbaseN_curbitmap_0_Ptrs[i]; + red = ((bitmapbaseN_curbitmap_i_value & 0xff0000) >> 16) * bright / 0xff; + green = ((bitmapbaseN_curbitmap_i_value & 0xff00) >> 8) * bright / 0xff; + blue = (bitmapbaseN_curbitmap_i_value & 0xff) * bright / 0xff; + //Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)Palette.make_argb(0xff, red, green, blue); Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)((((uint)(0xff) & 0xff) << 24) | (((uint)(blue) & 0xff) << 16) | (((uint)(green) & 0xff) << 8) | ((uint)(red) & 0xff)); } @@ -339,7 +347,8 @@ { //i = y * Video.fullwidth + x; i = stepIndex + x; - Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)(0xff000000 | (uint)Video.bitmapbaseN_Ptrs[Video.curbitmap][i]); + //Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)(0xff000000 | (uint)Video.bitmapbaseN_Ptrs[Video.curbitmap][i]); + Video.bitmapcolorRect_Ptrunsafe[target_i] = (int)(0xff000000 | (uint)bitmapbaseN_curbitmap_0_Ptrs[i]); } } } diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs index f9b038a1..bf4e30f9 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Memory.cs @@ -1078,6 +1078,7 @@ namespace MAME.Core MWriteLong(address, value); } } + const ushort prot_9a37_r_vale = 0x9a37; public static sbyte MReadByte_mslug3(int address) { address &= 0xffffff; diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs index fa07ebf3..a7163d63 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/mame/neogeo/Video.cs @@ -26,7 +26,25 @@ namespace MAME.Core private static double[] rgb_weights_normal_bit15; private static double[] rgb_weights_dark; private static double[] rgb_weights_dark_bit15; - public static int[,] zoom_x_tables; + public readonly static int[,] zoom_x_tables = new int[,] + { + { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0 }, + { 0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0 }, + { 0,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0 }, + { 0,0,1,0,1,0,0,0,1,0,0,0,1,0,0,0 }, + { 0,0,1,0,1,0,0,0,1,0,0,0,1,0,1,0 }, + { 0,0,1,0,1,0,1,0,1,0,0,0,1,0,1,0 }, + { 0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0 }, + { 1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0 }, + { 1,0,1,0,1,0,1,0,1,1,1,0,1,0,1,0 }, + { 1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,0 }, + { 1,0,1,1,1,0,1,0,1,1,1,0,1,0,1,1 }, + { 1,0,1,1,1,0,1,1,1,1,1,0,1,0,1,1 }, + { 1,0,1,1,1,0,1,1,1,1,1,0,1,1,1,1 }, + { 1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1 }, + { 1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1 }, + { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } + }; private static int[] transarray, bgarray; private static int trans_color; private static byte combine_5_weights(double[] tab, int w0, int w1, int w2, int w3, int w4) @@ -420,7 +438,7 @@ namespace MAME.Core //if (sprite_on_scanline(scanline, y, rows)) //手动内联 开始 int tempRows = rows; - if ((rows == 0) || (rows > 0x20)) + if ((tempRows == 0) || (tempRows > 0x20)) tempRows = 0x20; int max_y = (y + (tempRows * 0x10) - 1) & 0x1ff; if (((max_y >= y) && (scanline >= y) && (scanline <= max_y)) || @@ -482,6 +500,7 @@ namespace MAME.Core x_inc = 1; } int pixel_addr_offsetx, pixel_addr_offsety; + int pixel_addr_offsety_x_384 = scanline * 384; if (x <= 0x01f0) { int i; @@ -496,7 +515,7 @@ namespace MAME.Core if (spriteGfx[gfx_offset] != 0) { //Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; - bitmapbase[pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + spriteGfx[gfx_offset]]; + bitmapbase[pixel_addr_offsety_x_384 + pixel_addr_offsetx] = pens[line_pens_offset + spriteGfx[gfx_offset]]; } pixel_addr_offsetx++; } @@ -521,7 +540,7 @@ namespace MAME.Core if (spriteGfx[gfx_offset] != 0) { //Video.bitmapbaseN_Ptrs[iBitmap][pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + sprite_gfx[gfx_offset]]; - bitmapbase[pixel_addr_offsety * 384 + pixel_addr_offsetx] = pens[line_pens_offset + spriteGfx[gfx_offset]]; + bitmapbase[pixel_addr_offsety_x_384 + pixel_addr_offsetx] = pens[line_pens_offset + spriteGfx[gfx_offset]]; } pixel_addr_offsetx++; } @@ -959,7 +978,7 @@ namespace MAME.Core rgb_weights_normal_bit15 = new double[5] { 136.26711031260342, 63.784604843122239, 29.978764292156193, 13.626711058241233, 7.6868626613063098 }; rgb_weights_dark = new double[5] { 77.012238506947057, 36.048281863327709, 16.942692484743652, 7.7012238659431276, 4.3442801368916566 }; rgb_weights_dark_bit15 = new double[5] { 76.322306339305158, 35.725334891159271, 16.790907407744047, 7.6322306490423326, 4.3053608862660706 }; - zoom_x_tables = new int[,] + /*zoom_x_tables = new int[,] { { 0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0 }, { 0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0 }, @@ -977,7 +996,7 @@ namespace MAME.Core { 1,1,1,1,1,0,1,1,1,1,1,0,1,1,1,1 }, { 1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1 }, { 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 } - }; + };*/ Array.Clear(palettes, 0, 0x2000); Array.Clear(pens, 0, 0x1000); Array.Clear(neogeo_videoram, 0, 0x10000); diff --git a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs index e920e857..6e804403 100644 --- a/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs +++ b/AxibugEmuOnline.Client/Assets/Plugins/Mame.Core/sound/FM.cs @@ -1,6 +1,4 @@ -using NUnit; -using System; -using static MAME.Core.EmuTimer; +using System; namespace MAME.Core {