Compare commits
No commits in common. "main" and "bak_beforeInput" have entirely different histories.
main
...
bak_before
@ -1,36 +1,21 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
|
|
||||||
namespace MAME.Core.AxiBitmap
|
namespace MAME.Core.AxiBitmap
|
||||||
{
|
{
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Explicit)]
|
|
||||||
public struct AxiColor
|
public struct AxiColor
|
||||||
{
|
{
|
||||||
[FieldOffset(0)]
|
public byte r, g, b, a;
|
||||||
public int sdColor;
|
// 构造函数
|
||||||
[FieldOffset(0)]
|
|
||||||
public byte r;
|
|
||||||
[FieldOffset(1)]
|
|
||||||
public byte g;
|
|
||||||
[FieldOffset(2)]
|
|
||||||
public byte b;
|
|
||||||
[FieldOffset(3)]
|
|
||||||
public byte a;
|
|
||||||
|
|
||||||
public AxiColor(byte _r, byte _g, byte _b)
|
public AxiColor(byte _r, byte _g, byte _b)
|
||||||
{
|
{
|
||||||
r = g = b = a = 0;
|
|
||||||
sdColor = 0;
|
|
||||||
r = _r;
|
r = _r;
|
||||||
g = _g;
|
g = _g;
|
||||||
b = _b;
|
b = _b;
|
||||||
a = byte.MaxValue;
|
a = 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
public AxiColor(byte _r, byte _g, byte _b, byte _a)
|
public AxiColor(byte _r, byte _g, byte _b, byte _a)
|
||||||
{
|
{
|
||||||
r = g = b = a = 0;
|
|
||||||
sdColor = 0;
|
|
||||||
r = _r;
|
r = _r;
|
||||||
g = _g;
|
g = _g;
|
||||||
b = _b;
|
b = _b;
|
||||||
@ -38,17 +23,15 @@ namespace MAME.Core.AxiBitmap
|
|||||||
}
|
}
|
||||||
public static AxiColor FromArgb(int argb)
|
public static AxiColor FromArgb(int argb)
|
||||||
{
|
{
|
||||||
return new AxiColor { sdColor = argb };
|
byte a = (byte)((argb >> 24) & 0xFF);
|
||||||
|
byte r = (byte)((argb >> 16) & 0xFF);
|
||||||
|
byte g = (byte)((argb >> 8) & 0xFF);
|
||||||
|
byte b = (byte)(argb & 0xFF);
|
||||||
|
return new AxiColor { r = r, g = g, b = b, a = a };
|
||||||
}
|
}
|
||||||
|
|
||||||
public override string ToString()
|
|
||||||
{
|
|
||||||
return String.Format("{0:X8}", sdColor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int ToArgb(AxiColor color)
|
public static int ToArgb(AxiColor color)
|
||||||
{
|
{
|
||||||
return color.sdColor;
|
return (color.a << 24) | (color.r << 16) | (color.g << 8) | color.b;
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 颜色定义
|
#region 颜色定义
|
||||||
@ -194,7 +177,86 @@ namespace MAME.Core.AxiBitmap
|
|||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public struct Rectangle
|
||||||
|
{
|
||||||
|
public int X;
|
||||||
|
public int Y;
|
||||||
|
public int Width;
|
||||||
|
public int Height;
|
||||||
|
public Rectangle(int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
X = x;
|
||||||
|
Y = y;
|
||||||
|
Width = width;
|
||||||
|
Height = height;
|
||||||
|
}
|
||||||
|
public int Right => X + Width;
|
||||||
|
public int Bottom => Y + Height;
|
||||||
|
public int Area { get { return Width * Height; } }
|
||||||
|
public bool Contains(int pointX, int pointY) { return pointX >= X && pointX < X + Width && pointY >= Y && pointY < Y + Height; }
|
||||||
|
}
|
||||||
|
public enum RotateFlipType
|
||||||
|
{
|
||||||
|
RotateNoneFlipNone = 0,
|
||||||
|
Rotate90FlipNone = 1,
|
||||||
|
Rotate180FlipNone = 2,
|
||||||
|
Rotate270FlipNone = 3,
|
||||||
|
RotateNoneFlipX = 4,
|
||||||
|
Rotate90FlipX = 5,
|
||||||
|
Rotate180FlipX = 6,
|
||||||
|
Rotate270FlipX = 7,
|
||||||
|
RotateNoneFlipY = Rotate180FlipX, // 注意:FlipY 可以通过FlipX两次来实现,但这里为了完整性列出
|
||||||
|
Rotate90FlipY = 5, // 注意:FlipY在这里与FlipX相同角度的旋转结合,因为直接FlipY不是90度的倍数
|
||||||
|
Rotate180FlipY = 6,
|
||||||
|
Rotate270FlipY = 7,
|
||||||
|
// 注意:上面的FlipY情况实际上在90度旋转的上下文中并不直接对应,因为FlipY通常意味着沿Y轴翻转,
|
||||||
|
// 但在这里我们假设FlipX和FlipY在枚举中是为了完整性。在实际应用中,您可能只需要处理FlipNone。
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AxiBitmap
|
||||||
|
{
|
||||||
|
public AxiColor[] mData;
|
||||||
|
public int Width;
|
||||||
|
public int Height;
|
||||||
|
|
||||||
|
public AxiBitmap(int width, int height)
|
||||||
|
{
|
||||||
|
Width = width;
|
||||||
|
Height = height;
|
||||||
|
mData = new AxiColor[width * height];
|
||||||
|
}
|
||||||
|
|
||||||
|
public void SetPixel(int x, int y, AxiColor color)
|
||||||
|
{
|
||||||
|
mData[y * Width + x] = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
public AxiColor GetPixel(int x, int y)
|
||||||
|
{
|
||||||
|
return mData[y * Width + x];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//public AxiBitmap Clone(Rectangle rect)
|
||||||
|
//{
|
||||||
|
// // 检查矩形是否超出位图边界
|
||||||
|
// if (rect.X < 0 || rect.Right > Width || rect.Y < 0 || rect.Bottom > Height)
|
||||||
|
// {
|
||||||
|
// throw new ArgumentException("out of");
|
||||||
|
// }
|
||||||
|
|
||||||
|
// AxiBitmap clonedBitmap = new AxiBitmap(rect.Width, rect.Height);
|
||||||
|
|
||||||
|
// int srcStartIndex = rect.Y * Width + rect.X;
|
||||||
|
|
||||||
|
// for (int y = 0; y < rect.Height; y++)
|
||||||
|
// {
|
||||||
|
// Array.Copy(mData, srcStartIndex + y * Width, clonedBitmap.mData, y * rect.Width, rect.Width);
|
||||||
|
// }
|
||||||
|
// return clonedBitmap;
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static class AxiBitmapEx
|
public static class AxiBitmapEx
|
||||||
{
|
{
|
||||||
@ -202,29 +264,32 @@ namespace MAME.Core.AxiBitmap
|
|||||||
{
|
{
|
||||||
return (color.a << 24) | (color.r << 16) | (color.g << 8) | color.b;
|
return (color.a << 24) | (color.r << 16) | (color.g << 8) | color.b;
|
||||||
}
|
}
|
||||||
|
//public static AxiBitmap Clone(this AxiBitmap baseBitmap, Rectangle rect)
|
||||||
|
|
||||||
//public static void CloneIntColorArr(int[] baseBitmap, int[] targetBitmap, int baseWidth, int baseHeight, Rectangle rect)
|
|
||||||
//{
|
//{
|
||||||
// // 检查矩形是否超出位图边界
|
// unsafe
|
||||||
// if (rect.X < 0 || rect.X + rect.Width > baseWidth || rect.Y < 0 || rect.Y + rect.Height > baseHeight)
|
|
||||||
// {
|
// {
|
||||||
// throw new ArgumentException("Rectangle is out of bitmap bounds.");
|
// if (rect.X < 0 || rect.Right > baseBitmap.Width || rect.Y < 0 || rect.Bottom > baseBitmap.Height)
|
||||||
// }
|
// {
|
||||||
|
// throw new ArgumentException("The rectangle is out of the bitmap bounds.");
|
||||||
|
// }
|
||||||
|
// AxiBitmap clonedBitmap = new AxiBitmap(rect.Width, rect.Height);
|
||||||
|
|
||||||
// int baseStartIndex = rect.Y * baseWidth + rect.X;
|
// for (int y = 0; y < rect.Height; y++)
|
||||||
// int targetStartIndex = rect.Y * rect.Width;
|
// {
|
||||||
|
// int srcStartIndex = (rect.Y + y) * baseBitmap.Width * sizeof(AxiColor) + rect.X * sizeof(AxiColor);
|
||||||
// for (int y = 0; y < rect.Height; y++)
|
// int dstStartIndex = y * rect.Width * sizeof(AxiColor);
|
||||||
// {
|
// Array.Copy(baseBitmap.mData, srcStartIndex, clonedBitmap.mData, dstStartIndex, rect.Width * sizeof(AxiColor));
|
||||||
// // 注意这里使用了rect.Width作为要拷贝的元素数量,而不是baseWidth
|
// }
|
||||||
// Buffer.BlockCopy(baseBitmap, baseStartIndex + y * baseWidth, targetBitmap, targetStartIndex + y * rect.Width, rect.Width * sizeof(int));
|
// return clonedBitmap;
|
||||||
// // 或者使用Array.Copy,但要注意类型的大小(在这里是int)
|
|
||||||
// // Array.Copy(baseBitmap, baseStartIndex + y * baseWidth, targetBitmap, targetStartIndex + y * rect.Width, rect.Width);
|
|
||||||
// }
|
// }
|
||||||
//}
|
//}
|
||||||
|
|
||||||
public static void CloneIntColorArr(int[] baseBitmap, int[] targetBitmap, int Width, int Height, Rectangle rect)
|
public static void Clear(this AxiBitmap baseBitmap, AxiColor color)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static int[] CloneIntColorArr(int[] baseBitmap, int Width, int Height, Rectangle rect)
|
||||||
{
|
{
|
||||||
// 检查矩形是否超出位图边界
|
// 检查矩形是否超出位图边界
|
||||||
if (rect.X < 0 || rect.Right > Width || rect.Y < 0 || rect.Bottom > Height)
|
if (rect.X < 0 || rect.Right > Width || rect.Y < 0 || rect.Bottom > Height)
|
||||||
@ -232,32 +297,159 @@ namespace MAME.Core.AxiBitmap
|
|||||||
throw new ArgumentException("out of");
|
throw new ArgumentException("out of");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//int[] result = new int[Width * Height];
|
||||||
|
|
||||||
|
int[] result = new int[rect.Width * rect.Height];
|
||||||
|
|
||||||
int srcStartIndex = rect.Y * Width + rect.X;
|
int srcStartIndex = rect.Y * Width + rect.X;
|
||||||
|
|
||||||
for (int y = 0; y < rect.Height; y++)
|
for (int y = 0; y < rect.Height; y++)
|
||||||
{
|
{
|
||||||
Array.Copy(baseBitmap, srcStartIndex + y * Width, targetBitmap, y * rect.Width, rect.Width);
|
Array.Copy(baseBitmap, srcStartIndex + y * Width, result, y * rect.Width, rect.Width);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct Rectangle
|
//public static int[] CloneIntColorArr(int[] baseBitmap, int Width, int Height, Rectangle rect)
|
||||||
|
//{
|
||||||
|
// unsafe
|
||||||
|
// {
|
||||||
|
// if (rect.X < 0 || rect.Right > Width || rect.Y < 0 || rect.Bottom > Height)
|
||||||
|
// {
|
||||||
|
// throw new ArgumentException("The rectangle is out of the bitmap bounds.");
|
||||||
|
// }
|
||||||
|
// int[] result = new int[Width * Height];
|
||||||
|
// for (int y = 0; y < rect.Height; y++)
|
||||||
|
// {
|
||||||
|
// int srcStartIndex = (rect.Y + y) * Width * sizeof(int) + rect.X * sizeof(int);
|
||||||
|
// int dstStartIndex = y * rect.Width * sizeof(int);
|
||||||
|
// Array.Copy(baseBitmap, srcStartIndex, result, dstStartIndex, rect.Width * sizeof(int));
|
||||||
|
// }
|
||||||
|
// return result;
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
// DrawImage 方法,用于在当前 AxiBitmap 上绘制另一个 AxiBitmap 的一部分
|
||||||
|
public static void DrawImage(this AxiBitmap baseBitmap, AxiBitmap source, Rectangle destRect, Rectangle srcRect)
|
||||||
{
|
{
|
||||||
public int X;
|
|
||||||
public int Y;
|
if (!source.Contains(srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height))
|
||||||
public int Width;
|
throw new ArgumentException("Err");
|
||||||
public int Height;
|
|
||||||
public Rectangle(int x, int y, int width, int height)
|
// 遍历源矩形的每个像素
|
||||||
|
for (int y = srcRect.Y; y < srcRect.Bottom; y++)
|
||||||
{
|
{
|
||||||
X = x;
|
for (int x = srcRect.X; x < srcRect.Right; x++)
|
||||||
Y = y;
|
{
|
||||||
Width = width;
|
// 计算目标位置
|
||||||
Height = height;
|
int destX = destRect.X + (x - srcRect.X);
|
||||||
|
int destY = destRect.Y + (y - srcRect.Y);
|
||||||
|
|
||||||
|
// 确保目标位置在当前位图范围内(如果需要)
|
||||||
|
// if (destX < 0 || destX >= Width || destY < 0 || destY >= Height)
|
||||||
|
// continue; // 或者抛出异常,取决于你的需求
|
||||||
|
|
||||||
|
// 获取源像素并设置到目标位置
|
||||||
|
AxiColor sourceColor = source.GetPixel(x, y);
|
||||||
|
baseBitmap.SetPixel(destX, destY, sourceColor);
|
||||||
|
|
||||||
|
// 如果需要处理透明度混合,则在这里添加代码
|
||||||
|
// 注意:你的 AxiColor 已经包含了 alpha 通道,但 SetPixel 并没有使用它
|
||||||
|
// 你可能需要实现一个混合像素的方法,比如 BlendPixels
|
||||||
|
}
|
||||||
}
|
}
|
||||||
public int Right => X + Width;
|
|
||||||
public int Bottom => Y + Height;
|
|
||||||
public int Area { get { return Width * Height; } }
|
|
||||||
public bool Contains(int pointX, int pointY) { return pointX >= X && pointX < X + Width && pointY >= Y && pointY < Y + Height; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 辅助方法,用于检查一个点是否在位图范围内
|
||||||
|
private static bool Contains(this AxiBitmap baseBitmap, int x, int y, int width, int height)
|
||||||
|
{
|
||||||
|
return x >= 0 && x + width <= baseBitmap.Width && y >= 0 && y + height <= baseBitmap.Height;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ... 其他省略 ...
|
||||||
|
|
||||||
|
public static void RotateFlip(this AxiBitmap baseBitmap, RotateFlipType rotateFlipType)
|
||||||
|
{
|
||||||
|
// 先处理旋转部分
|
||||||
|
switch (rotateFlipType)
|
||||||
|
{
|
||||||
|
case RotateFlipType.Rotate90FlipNone:
|
||||||
|
Rotate90(baseBitmap);
|
||||||
|
break;
|
||||||
|
case RotateFlipType.Rotate180FlipNone:
|
||||||
|
Rotate180(baseBitmap);
|
||||||
|
break;
|
||||||
|
case RotateFlipType.Rotate270FlipNone:
|
||||||
|
Rotate270(baseBitmap);
|
||||||
|
break;
|
||||||
|
// 如果需要处理FlipX或FlipY,可以添加额外的case或方法
|
||||||
|
default:
|
||||||
|
// 无需旋转或翻转
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 注意:这里没有处理FlipX或FlipY,因为通常它们不是通过旋转来实现的
|
||||||
|
// 如果需要FlipX或FlipY,请添加额外的逻辑
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Rotate90(this AxiBitmap baseBitmap)
|
||||||
|
{
|
||||||
|
int newWidth = baseBitmap.Height;
|
||||||
|
int newHeight = baseBitmap.Width;
|
||||||
|
AxiColor[] newData = new AxiColor[baseBitmap.mData.Length];
|
||||||
|
|
||||||
|
for (int x = 0; x < baseBitmap.Width; x++)
|
||||||
|
{
|
||||||
|
for (int y = 0; y < baseBitmap.Height; y++)
|
||||||
|
{
|
||||||
|
int oldIndex = (y * baseBitmap.Width + x);
|
||||||
|
int newIndex = (newHeight - 1 - x) * newWidth + y;
|
||||||
|
newData[newIndex] = baseBitmap.mData[oldIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
baseBitmap.mData = newData;
|
||||||
|
baseBitmap.Width = newWidth;
|
||||||
|
baseBitmap.Height = newHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Rotate180(this AxiBitmap baseBitmap)
|
||||||
|
{
|
||||||
|
for (int y = 0; y < baseBitmap.Height / 2; y++)
|
||||||
|
{
|
||||||
|
for (int x = 0; x < baseBitmap.Width; x++)
|
||||||
|
{
|
||||||
|
int topLeftIndex = y * baseBitmap.Width + x;
|
||||||
|
int bottomRightIndex = (baseBitmap.Height - 1 - y) * baseBitmap.Width + x;
|
||||||
|
AxiColor temp = baseBitmap.mData[topLeftIndex];
|
||||||
|
baseBitmap.mData[topLeftIndex] = baseBitmap.mData[bottomRightIndex];
|
||||||
|
baseBitmap.mData[bottomRightIndex] = temp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void Rotate270(this AxiBitmap baseBitmap)
|
||||||
|
{
|
||||||
|
// Rotate270 可以通过 Rotate90 两次或 Rotate180 后再 Rotate90 来实现
|
||||||
|
// 这里直接实现 Rotate270 以避免额外的旋转调用
|
||||||
|
int newWidth = baseBitmap.Height;
|
||||||
|
int newHeight = baseBitmap.Width;
|
||||||
|
AxiColor[] newData = new AxiColor[baseBitmap.mData.Length];
|
||||||
|
|
||||||
|
for (int x = 0; x < baseBitmap.Width; x++)
|
||||||
|
{
|
||||||
|
for (int y = 0; y < baseBitmap.Height; y++)
|
||||||
|
{
|
||||||
|
int oldIndex = (y * baseBitmap.Width + x);
|
||||||
|
int newIndex = y * newWidth + (newWidth - 1 - x);
|
||||||
|
newData[newIndex] = baseBitmap.mData[oldIndex];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
baseBitmap.mData = newData;
|
||||||
|
baseBitmap.Width = newWidth;
|
||||||
|
baseBitmap.Height = newHeight;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 19fb05683c89f9d438ce6cb7e65de2ec
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using MAME.Core;
|
using MAME.Core.run_interface;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace mame
|
||||||
{
|
{
|
||||||
public static class EmuLogger
|
public static class EmuLogger
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 152466b6f17e41244be3f9dd18aee4e1
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
|
||||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<PackageReference Include="ImageProcessor.Core" Version="1.1.0" />
|
|
||||||
<PackageReference Include="LamarCodeGeneration" Version="6.3.0" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<_LastSelectedProfileId>G:\Sin365\MAME.Core\MAME.Core\Properties\PublishProfiles\FolderProfile.pubxml</_LastSelectedProfileId>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@ -1,37 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
|
|
||||||
|
|
||||||
namespace MAME.Core
|
|
||||||
{
|
|
||||||
public class MAMEDBHelper
|
|
||||||
{
|
|
||||||
public static void LoadROMXML(string xmbString)
|
|
||||||
{
|
|
||||||
XElement xe = XElement.Parse(xmbString);
|
|
||||||
IEnumerable<XElement> elements = from ele in xe.Elements("game") select ele;
|
|
||||||
showInfoByElements(elements);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void showInfoByElements(IEnumerable<XElement> elements)
|
|
||||||
{
|
|
||||||
RomInfo.romList = new List<RomInfo>();
|
|
||||||
RomInfo.dictName2Rom = new Dictionary<string, RomInfo>();
|
|
||||||
foreach (var ele in elements)
|
|
||||||
{
|
|
||||||
RomInfo rom = new RomInfo();
|
|
||||||
rom.Name = ele.Attribute("name").Value;
|
|
||||||
rom.Board = ele.Attribute("board").Value;
|
|
||||||
rom.Parent = ele.Element("parent").Value;
|
|
||||||
rom.Direction = ele.Element("direction").Value;
|
|
||||||
rom.Description = ele.Element("description").Value;
|
|
||||||
rom.Year = ele.Element("year").Value;
|
|
||||||
rom.Manufacturer = ele.Element("manufacturer").Value;
|
|
||||||
RomInfo.romList.Add(rom);
|
|
||||||
RomInfo.dictName2Rom[rom.Name] = rom;
|
|
||||||
//loadform.listView1.Items.Add(new ListViewItem(new string[] { rom.Description, rom.Year, rom.Name, rom.Parent, rom.Direction, rom.Manufacturer, rom.Board }));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 22cdf3c2148e1a24ca9353926f553d77
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,66 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.IO;
|
|
||||||
using System.Threading;
|
|
||||||
|
|
||||||
namespace MAME.Core
|
|
||||||
{
|
|
||||||
public class MAMEEmu : IDisposable
|
|
||||||
{
|
|
||||||
public MameMainMotion mameMainMotion { get; private set; }
|
|
||||||
//byte[] mGameTileData;
|
|
||||||
//byte[] mtileListData;
|
|
||||||
public MAMEEmu()
|
|
||||||
{
|
|
||||||
mameMainMotion = new MameMainMotion();
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool bRom => mameMainMotion.bRom;
|
|
||||||
|
|
||||||
public void Init(
|
|
||||||
string RomDir,
|
|
||||||
ILog ilog,
|
|
||||||
IResources iRes,
|
|
||||||
IVideoPlayer ivp,
|
|
||||||
ISoundPlayer isp,
|
|
||||||
IKeyboard ikb,
|
|
||||||
IMouse imou,
|
|
||||||
ITimeSpan itime
|
|
||||||
) => mameMainMotion.Init(RomDir, ilog, iRes, ivp, isp, ikb, imou, itime);
|
|
||||||
|
|
||||||
public Dictionary<string, RomInfo> GetGameList() => mameMainMotion.GetGameList();
|
|
||||||
public void LoadRom(string Name) => mameMainMotion.LoadRom(Name);
|
|
||||||
public void GetGameScreenSize(out int _width, out int _height, out IntPtr _framePtr) => mameMainMotion.GetGameScreenSize(out _width, out _height, out _framePtr);
|
|
||||||
public void StartGame() => mameMainMotion.StartGame();
|
|
||||||
public void UpdateFrame() => Mame.mame_execute_UpdateMode_NextFrame();
|
|
||||||
public void UnlockNextFreme(int moreTick = 1) => mameMainMotion.UnlockNextFreme(moreTick);
|
|
||||||
public void StopGame() => mameMainMotion.StopGame();
|
|
||||||
public long currEmuFrame => Video.screenstate.frame_number;
|
|
||||||
|
|
||||||
public void LoadState(BinaryReader sr)
|
|
||||||
{
|
|
||||||
Mame.paused = true;
|
|
||||||
Thread.Sleep(20);
|
|
||||||
State.loadstate_callback.Invoke(sr);
|
|
||||||
Mame.postload();
|
|
||||||
Thread.Sleep(20);
|
|
||||||
Mame.paused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SaveState(BinaryWriter sw)
|
|
||||||
{
|
|
||||||
Mame.paused = true;
|
|
||||||
Thread.Sleep(20);
|
|
||||||
State.savestate_callback.Invoke(sw);
|
|
||||||
Thread.Sleep(20);
|
|
||||||
Mame.paused = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
mameMainMotion.StopGame();
|
|
||||||
mameMainMotion = null;
|
|
||||||
GC.Collect();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 35d7d011a9c354848a421281c06f5f8c
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ebd8f2e90f8767b498f2431f7394ede9
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: eacdf053bdef1934d8cdec1c463f8847
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +1,12 @@
|
|||||||
using cpu.m68000;
|
using cpu.m68000;
|
||||||
using cpu.nec;
|
using cpu.nec;
|
||||||
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public partial class CheatMotion
|
public partial class cheatMotion
|
||||||
{
|
{
|
||||||
public enum LockState
|
public enum LockState
|
||||||
{
|
{
|
||||||
@ -24,7 +25,7 @@ namespace MAME.Core
|
|||||||
#region
|
#region
|
||||||
List<string> mTxList_tbResult = new List<string>();
|
List<string> mTxList_tbResult = new List<string>();
|
||||||
#endregion
|
#endregion
|
||||||
public CheatMotion()
|
public cheatMotion()
|
||||||
{
|
{
|
||||||
cheatForm_Load();
|
cheatForm_Load();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public partial class CpsMotion
|
public partial class cpsMotion
|
||||||
{
|
{
|
||||||
private string[] sde2 = new string[] { "," };
|
private string[] sde2 = new string[] { "," };
|
||||||
private int locationX, locationY;
|
private int locationX, locationY;
|
||||||
@ -31,7 +31,7 @@ namespace MAME.Core
|
|||||||
public string tbScrollsy = string.Empty;
|
public string tbScrollsy = string.Empty;
|
||||||
public List<string> tbResult = new List<string>();
|
public List<string> tbResult = new List<string>();
|
||||||
#endregion
|
#endregion
|
||||||
public CpsMotion()
|
public cpsMotion()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 08bc0c1fe9979244e872263dfe2c09b0
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,6 +1,6 @@
|
|||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public class Konami68000Motion
|
public class konami68000Motion
|
||||||
{
|
{
|
||||||
private int locationX, locationY;
|
private int locationX, locationY;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@
|
|||||||
public bool cbSprite = false;
|
public bool cbSprite = false;
|
||||||
public string tbSprite;
|
public string tbSprite;
|
||||||
#endregion
|
#endregion
|
||||||
public Konami68000Motion()
|
public konami68000Motion()
|
||||||
{
|
{
|
||||||
tbSprite = "0000-4000";
|
tbSprite = "0000-4000";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 85d3575e43093a54f82622b4c53c1a40
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -2,9 +2,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public class M68000Motion
|
public class m68000Motion
|
||||||
{
|
{
|
||||||
private string[] sde6 = new string[1] { "," }, sde7 = new string[1] { ";" }, sde9 = new string[1] { "$" }, sde10 = new string[] { "+" };
|
private string[] sde6 = new string[1] { "," }, sde7 = new string[1] { ";" }, sde9 = new string[1] { "$" }, sde10 = new string[] { "+" };
|
||||||
private bool bLogNew, bNew;
|
private bool bLogNew, bNew;
|
||||||
@ -54,7 +54,7 @@ namespace MAME.Core
|
|||||||
M68000_STOP,
|
M68000_STOP,
|
||||||
}
|
}
|
||||||
public static M68000State m68000State, m68000FState;
|
public static M68000State m68000State, m68000FState;
|
||||||
public M68000Motion()
|
public m68000Motion()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
mTxList_tbDs = new string[8];
|
mTxList_tbDs = new string[8];
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 43abb82203533b94fa07632370f6ca15
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,10 +1,11 @@
|
|||||||
using cpu.m6809;
|
using cpu.m6809;
|
||||||
|
using mame;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
public partial class M6809Motion
|
public partial class m6809Motion
|
||||||
{
|
{
|
||||||
//private Disassembler disassembler;
|
//private Disassembler disassembler;
|
||||||
private bool bLogNew;
|
private bool bLogNew;
|
||||||
@ -33,7 +34,7 @@ namespace MAME.Core
|
|||||||
public string tbDisassemble = string.Empty;
|
public string tbDisassemble = string.Empty;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public M6809Motion()
|
public m6809Motion()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
public void GetData()
|
public void GetData()
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2c291a8abf15d254596af257bb937441
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,37 +1,36 @@
|
|||||||
using System;
|
using mame;
|
||||||
|
using MAME.Core.run_interface;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public class MameMainMotion
|
public class mainMotion
|
||||||
{
|
{
|
||||||
public string tsslStatus;
|
public string tsslStatus;
|
||||||
public CheatMotion cheatmotion;
|
public cheatMotion cheatmotion;
|
||||||
public M68000Motion m68000motion;
|
public m68000Motion m68000motion;
|
||||||
public Z80Motion z80motion;
|
public z80Motion z80motion;
|
||||||
public M6809Motion m6809motion;
|
public m6809Motion m6809motion;
|
||||||
public CpsMotion cpsmotion;
|
public cpsMotion cpsmotion;
|
||||||
public NeogeoMotion neogeomotion;
|
public neogeoMotion neogeomotion;
|
||||||
public Konami68000Motion konami68000motion;
|
public konami68000Motion konami68000motion;
|
||||||
public string sSelect;
|
public string sSelect;
|
||||||
//public static Thread mainThread;
|
public static Thread t1;
|
||||||
|
|
||||||
//初始化停帧信号量
|
|
||||||
//public AutoResetEvent emuAutoLoopEvent;
|
|
||||||
|
|
||||||
public static IResources resource;
|
public static IResources resource;
|
||||||
public bool bRom => Machine.bRom;
|
|
||||||
|
|
||||||
public MameMainMotion()
|
public mainMotion()
|
||||||
{
|
{
|
||||||
neogeomotion = new NeogeoMotion();
|
neogeomotion = new neogeoMotion();
|
||||||
cheatmotion = new CheatMotion();
|
cheatmotion = new cheatMotion();
|
||||||
m68000motion = new M68000Motion();
|
m68000motion = new m68000Motion();
|
||||||
m6809motion = new M6809Motion();
|
m6809motion = new m6809Motion();
|
||||||
z80motion = new Z80Motion();
|
z80motion = new z80Motion();
|
||||||
cpsmotion = new CpsMotion();
|
cpsmotion = new cpsMotion();
|
||||||
konami68000motion = new Konami68000Motion();
|
konami68000motion = new konami68000Motion();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Init(
|
public void Init(
|
||||||
@ -41,9 +40,7 @@ namespace MAME.Core
|
|||||||
IVideoPlayer ivp,
|
IVideoPlayer ivp,
|
||||||
ISoundPlayer isp,
|
ISoundPlayer isp,
|
||||||
IKeyboard ikb,
|
IKeyboard ikb,
|
||||||
IMouse imou,
|
IMouse imou)
|
||||||
ITimeSpan itime
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
Mame.RomRoot = RomDir;
|
Mame.RomRoot = RomDir;
|
||||||
EmuLogger.BindFunc(ilog);
|
EmuLogger.BindFunc(ilog);
|
||||||
@ -51,32 +48,48 @@ namespace MAME.Core
|
|||||||
Sound.BindFunc(isp);
|
Sound.BindFunc(isp);
|
||||||
resource = iRes;
|
resource = iRes;
|
||||||
|
|
||||||
sSelect = string.Empty;
|
//StreamReader sr1 = new StreamReader("mame.ini");
|
||||||
|
//sr1.ReadLine();
|
||||||
|
//sSelect = sr1.ReadLine();
|
||||||
|
//sr1.Close();
|
||||||
|
|
||||||
|
//TODO 上次选择
|
||||||
|
sSelect = "samsho2";
|
||||||
|
|
||||||
|
|
||||||
RomInfo.Rom = new RomInfo();
|
RomInfo.Rom = new RomInfo();
|
||||||
MAMEDBHelper.LoadROMXML(resource.mame);
|
LoadROMXML();
|
||||||
Keyboard.InitializeInput(ikb);
|
//TODO Wavebuffer
|
||||||
Mouse.InitialMouse(imou);
|
//desc1.BufferBytes = 0x9400;
|
||||||
AxiTimeSpan.Init(itime);
|
Keyboard.InitializeInput(this, ikb);
|
||||||
|
Mouse.InitialMouse(this, imou);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void LoadROMXML()
|
||||||
public Dictionary<string, RomInfo> GetGameList()
|
|
||||||
{
|
{
|
||||||
return RomInfo.dictName2Rom;
|
XElement xe = XElement.Parse(resource.Get_mame_xml());
|
||||||
|
IEnumerable<XElement> elements = from ele in xe.Elements("game") select ele;
|
||||||
|
showInfoByElements(elements);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void GetGameScreenSize(out int _width, out int _height, out IntPtr _framePtr)
|
private void showInfoByElements(IEnumerable<XElement> elements)
|
||||||
{
|
{
|
||||||
//_width = Video.fullwidth;
|
RomInfo.romList = new List<RomInfo>();
|
||||||
//_height = Video.fullheight;
|
foreach (var ele in elements)
|
||||||
//_framePtr = Video.bitmapcolor_Ptr;
|
{
|
||||||
_width = Video.width;
|
RomInfo rom = new RomInfo();
|
||||||
_height = Video.height;
|
rom.Name = ele.Attribute("name").Value;
|
||||||
_framePtr = Video.bitmapcolorRect_Ptr;
|
rom.Board = ele.Attribute("board").Value;
|
||||||
|
rom.Parent = ele.Element("parent").Value;
|
||||||
|
rom.Direction = ele.Element("direction").Value;
|
||||||
|
rom.Description = ele.Element("description").Value;
|
||||||
|
rom.Year = ele.Element("year").Value;
|
||||||
|
rom.Manufacturer = ele.Element("manufacturer").Value;
|
||||||
|
RomInfo.romList.Add(rom);
|
||||||
|
//loadform.listView1.Items.Add(new ListViewItem(new string[] { rom.Description, rom.Year, rom.Name, rom.Parent, rom.Direction, rom.Manufacturer, rom.Board }));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void LoadRom(string Name)
|
public void LoadRom(string Name)
|
||||||
{
|
{
|
||||||
RomInfo.Rom = RomInfo.GetRomByName(Name);
|
RomInfo.Rom = RomInfo.GetRomByName(Name);
|
||||||
@ -86,9 +99,9 @@ namespace MAME.Core
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
EmuTimer.lt = new List<EmuTimer.emu_timer>();
|
mame.Timer.lt = new List<mame.Timer.emu_timer>();
|
||||||
sSelect = RomInfo.Rom.Name;
|
sSelect = RomInfo.Rom.Name;
|
||||||
Machine.mainMotion = this;
|
Machine.FORM = this;
|
||||||
Machine.rom = RomInfo.Rom;
|
Machine.rom = RomInfo.Rom;
|
||||||
Machine.sName = Machine.rom.Name;
|
Machine.sName = Machine.rom.Name;
|
||||||
Machine.sParent = Machine.rom.Parent;
|
Machine.sParent = Machine.rom.Parent;
|
||||||
@ -103,96 +116,107 @@ namespace MAME.Core
|
|||||||
case "CPS-1":
|
case "CPS-1":
|
||||||
case "CPS-1(QSound)":
|
case "CPS-1(QSound)":
|
||||||
case "CPS2":
|
case "CPS2":
|
||||||
|
Video.nMode = 3;
|
||||||
Video.nMode = 1;
|
|
||||||
Video.iMode = 2;
|
|
||||||
//Video.nMode = 3;
|
|
||||||
itemSelect();
|
itemSelect();
|
||||||
CPS.CPSInit();
|
CPS.CPSInit();
|
||||||
|
CPS.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Data East":
|
case "Data East":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Dataeast.DataeastInit();
|
Dataeast.DataeastInit();
|
||||||
|
Dataeast.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Tehkan":
|
case "Tehkan":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Tehkan.PbactionInit();
|
Tehkan.PbactionInit();
|
||||||
|
Tehkan.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Neo Geo":
|
case "Neo Geo":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Neogeo.NeogeoInit();
|
Neogeo.NeogeoInit();
|
||||||
|
Neogeo.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "SunA8":
|
case "SunA8":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
SunA8.SunA8Init();
|
SunA8.SunA8Init();
|
||||||
|
SunA8.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Namco System 1":
|
case "Namco System 1":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Namcos1.Namcos1Init();
|
Namcos1.Namcos1Init();
|
||||||
|
Namcos1.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "IGS011":
|
case "IGS011":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
IGS011.IGS011Init();
|
IGS011.IGS011Init();
|
||||||
|
IGS011.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "PGM":
|
case "PGM":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
PGM.PGMInit();
|
PGM.PGMInit();
|
||||||
|
PGM.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "M72":
|
case "M72":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
M72.M72Init();
|
M72.M72Init();
|
||||||
|
M72.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "M92":
|
case "M92":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
M92.M92Init();
|
M92.M92Init();
|
||||||
|
M92.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Taito":
|
case "Taito":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Taito.TaitoInit();
|
Taito.TaitoInit();
|
||||||
|
Taito.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Taito B":
|
case "Taito B":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Taitob.TaitobInit();
|
Taitob.TaitobInit();
|
||||||
|
Taitob.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Konami 68000":
|
case "Konami 68000":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Konami68000.Konami68000Init();
|
Konami68000.Konami68000Init();
|
||||||
|
Konami68000.GDIInit();
|
||||||
break;
|
break;
|
||||||
case "Capcom":
|
case "Capcom":
|
||||||
Video.nMode = 1;
|
Video.nMode = 1;
|
||||||
Video.iMode = 0;
|
Video.iMode = 0;
|
||||||
itemSelect();
|
itemSelect();
|
||||||
Capcom.CapcomInit();
|
Capcom.CapcomInit();
|
||||||
|
Capcom.GDIInit();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (Machine.bRom)
|
if (Machine.bRom)
|
||||||
{
|
{
|
||||||
EmuLogger.Log("MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]");
|
EmuLogger.Log("MAME.NET: " + Machine.sDescription + " [" + Machine.sName + "]");
|
||||||
Mame.init_machine();
|
Mame.init_machine(this);
|
||||||
Generic.nvram_load();
|
Generic.nvram_load();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -201,71 +225,6 @@ namespace MAME.Core
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void StartGame()
|
|
||||||
{
|
|
||||||
M68000Motion.iStatus = 0;
|
|
||||||
M68000Motion.iValue = 0;
|
|
||||||
Mame.exit_pending = false;
|
|
||||||
|
|
||||||
//初始化停帧信号量
|
|
||||||
//emuAutoLoopEvent = new AutoResetEvent(false);
|
|
||||||
|
|
||||||
//mainThread = new Thread(Mame.mame_execute);
|
|
||||||
//mainThread.Start();
|
|
||||||
|
|
||||||
Mame.mame_execute_UpdateMode_Start();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public static object unlockMoreFrameObj = new object();
|
|
||||||
public static int unlockMoreFrame;
|
|
||||||
/// <summary>
|
|
||||||
/// 放开帧
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="moveTick"></param>
|
|
||||||
public void UnlockNextFreme(int moreTick = 1)
|
|
||||||
{
|
|
||||||
//emuAutoLoopEvent.Set();
|
|
||||||
|
|
||||||
//TODO 等待跳帧时测试
|
|
||||||
if (moreTick > 1)
|
|
||||||
{
|
|
||||||
lock (unlockMoreFrameObj)
|
|
||||||
{
|
|
||||||
unlockMoreFrame += moreTick;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 等待放行帧
|
|
||||||
/// </summary>
|
|
||||||
public void WaitNextFrame()
|
|
||||||
{
|
|
||||||
//TODO 等待跳帧时测试
|
|
||||||
lock (unlockMoreFrameObj)
|
|
||||||
{
|
|
||||||
if (unlockMoreFrame > 0)
|
|
||||||
{
|
|
||||||
unlockMoreFrame--;
|
|
||||||
//还有记数,则直接放行
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//等待停帧数
|
|
||||||
//Machine.mainMotion.emuAutoLoopEvent.WaitOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void StopGame()
|
|
||||||
{
|
|
||||||
if (Machine.bRom)
|
|
||||||
{
|
|
||||||
Mame.exit_pending = true;
|
|
||||||
Thread.Sleep(50);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void itemSelect()
|
private void itemSelect()
|
||||||
{
|
{
|
||||||
switch (Machine.sBoard)
|
switch (Machine.sBoard)
|
||||||
@ -1,8 +1,11 @@
|
|||||||
using System.Collections.Generic;
|
using mame;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public partial class NeogeoMotion
|
public partial class neogeoMotion
|
||||||
{
|
{
|
||||||
private string[] sde2 = new string[] { "," };
|
private string[] sde2 = new string[] { "," };
|
||||||
private int locationX, locationY;
|
private int locationX, locationY;
|
||||||
@ -17,7 +20,7 @@ namespace MAME.Core
|
|||||||
bool cbL0 = false;
|
bool cbL0 = false;
|
||||||
bool cbL1 = false;
|
bool cbL1 = false;
|
||||||
#endregion
|
#endregion
|
||||||
public NeogeoMotion()
|
public neogeoMotion()
|
||||||
{
|
{
|
||||||
tbResult = new List<string>();
|
tbResult = new List<string>();
|
||||||
neogeoForm_Load();
|
neogeoForm_Load();
|
||||||
@ -32,5 +35,58 @@ namespace MAME.Core
|
|||||||
tbSOffset = "01cb0600";
|
tbSOffset = "01cb0600";
|
||||||
tbPensoffset = "ed0";
|
tbPensoffset = "ed0";
|
||||||
}
|
}
|
||||||
|
private void DumpRam()
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
BinaryWriter bw1 = new BinaryWriter(new FileStream("dump1.dat", FileMode.Create));
|
||||||
|
bw1.Write(Memory.mainram, 0, 0x10000);
|
||||||
|
bw1.Close();
|
||||||
|
BinaryWriter bw2 = new BinaryWriter(new FileStream("dump2.dat", FileMode.Create));
|
||||||
|
bw2.Write(Neogeo.mainram2, 0, 0x10000);
|
||||||
|
bw2.Close();
|
||||||
|
BinaryWriter bw3 = new BinaryWriter(new FileStream("dump3.dat", FileMode.Create));
|
||||||
|
for (i = 0; i < 0x10000; i++)
|
||||||
|
{
|
||||||
|
bw3.Write(Neogeo.neogeo_videoram[i]);
|
||||||
|
}
|
||||||
|
BinaryWriter bw4 = new BinaryWriter(new FileStream("dump4.dat", FileMode.Create));
|
||||||
|
for (i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 0x1000; j++)
|
||||||
|
{
|
||||||
|
bw4.Write(Neogeo.palettes[i, j]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private void WriteRam()
|
||||||
|
{
|
||||||
|
int i, j;
|
||||||
|
byte[] bb1 = new byte[0x10000], bb2 = new byte[0x10000], bb3 = new byte[0x20000], bb4 = new byte[0x4000];
|
||||||
|
BinaryReader br1 = new BinaryReader(new FileStream("dump1.dat", FileMode.Open));
|
||||||
|
br1.Read(bb1, 0, 0x10000);
|
||||||
|
br1.Close();
|
||||||
|
Array.Copy(bb1, Memory.mainram, 0x10000);
|
||||||
|
BinaryReader br2 = new BinaryReader(new FileStream("dump2.dat", FileMode.Open));
|
||||||
|
br2.Read(bb2, 0, 0x10000);
|
||||||
|
br2.Close();
|
||||||
|
Array.Copy(bb2, Neogeo.mainram2, 0x10000);
|
||||||
|
BinaryReader br3 = new BinaryReader(new FileStream("dump3.dat", FileMode.Open));
|
||||||
|
br3.Read(bb3, 0, 0x20000);
|
||||||
|
br3.Close();
|
||||||
|
for (i = 0; i < 0x10000; i++)
|
||||||
|
{
|
||||||
|
Neogeo.neogeo_videoram[i] = (ushort)(bb3[i * 2] + bb3[i * 2 + 1] * 0x100);
|
||||||
|
}
|
||||||
|
BinaryReader br4 = new BinaryReader(new FileStream("dump4.dat", FileMode.Open));
|
||||||
|
br4.Read(bb4, 0, 0x4000);
|
||||||
|
br4.Close();
|
||||||
|
for (i = 0; i < 2; i++)
|
||||||
|
{
|
||||||
|
for (j = 0; j < 0x1000; j++)
|
||||||
|
{
|
||||||
|
Neogeo.palettes[i, j] = (ushort)(bb4[i * 0x2000 + j * 2] + bb4[i * 0x2000 + j * 2 + 1] * 0x100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b1dce3116faca2f43a19f5e965e245e7
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
using cpu.z80;
|
using cpu.z80;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace MAME.Core
|
namespace MAME.Core.Common
|
||||||
{
|
{
|
||||||
public enum CPUState
|
public enum CPUState
|
||||||
{
|
{
|
||||||
@ -12,7 +12,7 @@ namespace MAME.Core
|
|||||||
STEP3,
|
STEP3,
|
||||||
STOP,
|
STOP,
|
||||||
}
|
}
|
||||||
public partial class Z80Motion
|
public partial class z80Motion
|
||||||
{
|
{
|
||||||
private Disassembler disassembler;
|
private Disassembler disassembler;
|
||||||
private bool bLogNew;
|
private bool bLogNew;
|
||||||
@ -55,7 +55,7 @@ namespace MAME.Core
|
|||||||
Z80A_STOP,
|
Z80A_STOP,
|
||||||
}
|
}
|
||||||
public static Z80AState z80State, z80FState;
|
public static Z80AState z80State, z80FState;
|
||||||
public Z80Motion()
|
public z80Motion()
|
||||||
{
|
{
|
||||||
disassembler = new Disassembler();
|
disassembler = new Disassembler();
|
||||||
Disassembler.GenerateOpcodeSizes();
|
Disassembler.GenerateOpcodeSizes();
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 0cb936512a0186e449fa3a9053127b42
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,438 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Reflection;
|
|
||||||
using System.Text;
|
|
||||||
|
|
||||||
namespace MAME.Core
|
|
||||||
{
|
|
||||||
internal static class ObjectPoolAuto
|
|
||||||
{
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或者创建一个新的
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>Remember to <see cref="Release{T}(T)"/> 需要回收参见这个</remarks>
|
|
||||||
public static T Acquire<T>()
|
|
||||||
where T : class, new()
|
|
||||||
=> ObjectPool<T>.Acquire();
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或者创建一个新的
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>Remember to <see cref="Release{T}(T)"/> 需要回收参见这个</remarks>
|
|
||||||
public static void Acquire<T>(out T item)
|
|
||||||
where T : class, new()
|
|
||||||
=> item = ObjectPool<T>.Acquire();
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收对象
|
|
||||||
/// </summary>
|
|
||||||
public static void Release<T>(T item)
|
|
||||||
where T : class, new()
|
|
||||||
=> ObjectPool<T>.Release(item);
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收对象
|
|
||||||
/// </summary>
|
|
||||||
public static void Release<T>(ref T item) where T : class, new()
|
|
||||||
{
|
|
||||||
if (item != null)
|
|
||||||
{
|
|
||||||
ObjectPool<T>.Release(item);
|
|
||||||
item = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
public const string
|
|
||||||
NotClearError = " They must be cleared before being released to the pool and not modified after that.";
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或创建List
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>Remember to <see cref="Release{T}(List{T})"/> 回收参见此方法</remarks>
|
|
||||||
public static List<T> AcquireList<T>()
|
|
||||||
{
|
|
||||||
var list = ObjectPool<List<T>>.Acquire();
|
|
||||||
EmuLogger.Assert(list.Count == 0, "A pooled list is not empty." + NotClearError);
|
|
||||||
return list;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收List
|
|
||||||
/// </summary>
|
|
||||||
public static void Release<T>(List<T> list)
|
|
||||||
{
|
|
||||||
list.Clear();
|
|
||||||
ObjectPool<List<T>>.Release(list);
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 回收List内容
|
|
||||||
/// </summary>
|
|
||||||
/// <typeparam name="T"></typeparam>
|
|
||||||
/// <param name="list"></param>
|
|
||||||
public static void ReleaseListContent<T>(List<T> list) where T : class, new()
|
|
||||||
{
|
|
||||||
foreach (var item in list)
|
|
||||||
{
|
|
||||||
ObjectPool<T>.Release(item);
|
|
||||||
}
|
|
||||||
list.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取或创建HashSet
|
|
||||||
/// </summary>
|
|
||||||
public static HashSet<T> AcquireSet<T>()
|
|
||||||
{
|
|
||||||
var set = ObjectPool<HashSet<T>>.Acquire();
|
|
||||||
EmuLogger.Assert(set.Count == 0, "A pooled set is not empty." + NotClearError);
|
|
||||||
return set;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 释放HashSet
|
|
||||||
/// </summary>
|
|
||||||
public static void Release<T>(HashSet<T> set)
|
|
||||||
{
|
|
||||||
set.Clear();
|
|
||||||
ObjectPool<HashSet<T>>.Release(set);
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取一个字符串StringBuilder
|
|
||||||
/// </summary>
|
|
||||||
/// <remarks>Remember to <see cref="Release(StringBuilder)"/>回收参见这个</remarks>
|
|
||||||
public static StringBuilder AcquireStringBuilder()
|
|
||||||
{
|
|
||||||
var builder = ObjectPool<StringBuilder>.Acquire();
|
|
||||||
EmuLogger.Assert(builder.Length == 0, $"A pooled {nameof(StringBuilder)} is not empty." + NotClearError);
|
|
||||||
return builder;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收 StringBuilder
|
|
||||||
/// </summary>
|
|
||||||
public static void Release(StringBuilder builder)
|
|
||||||
{
|
|
||||||
builder.Length = 0;
|
|
||||||
ObjectPool<StringBuilder>.Release(builder);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 回收 StringBuilder
|
|
||||||
/// </summary>
|
|
||||||
public static string ReleaseToString(this StringBuilder builder)
|
|
||||||
{
|
|
||||||
var result = builder.ToString();
|
|
||||||
Release(builder);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
private static class Cache<T>
|
|
||||||
{
|
|
||||||
public static readonly Dictionary<MethodInfo, KeyValuePair<Func<T>, T>>
|
|
||||||
Results = new Dictionary<MethodInfo, KeyValuePair<Func<T>, T>>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 此方法主要用于频繁绘制缓存,比如说GUI绘制
|
|
||||||
/// </summary>
|
|
||||||
public static T GetCachedResult<T>(Func<T> function)
|
|
||||||
{
|
|
||||||
var method = function.Method;
|
|
||||||
if (!Cache<T>.Results.TryGetValue(method, out var result))
|
|
||||||
{
|
|
||||||
|
|
||||||
result = new KeyValuePair<Func<T>, T>(function, function());
|
|
||||||
Cache<T>.Results.Add(method, result);
|
|
||||||
}
|
|
||||||
else if (result.Key != function)
|
|
||||||
{
|
|
||||||
EmuLogger.Log(
|
|
||||||
$"{nameof(GetCachedResult)}<{typeof(T).Name}>" +
|
|
||||||
$" was previously called on {method.Name} with a different target." +
|
|
||||||
" This likely means that a new delegate is being passed into every call" +
|
|
||||||
" so it can't actually return the same cached object.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return result.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
public static class Disposable
|
|
||||||
{
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calls <see cref="ObjectPool{T}.Disposable.Acquire"/> to get a spare <see cref="List{T}"/> if
|
|
||||||
/// </summary>
|
|
||||||
public static IDisposable Acquire<T>(out T item)
|
|
||||||
where T : class, new()
|
|
||||||
=> ObjectPool<T>.Disposable.Acquire(out item);
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calls <see cref="ObjectPool{T}.Disposable.Acquire"/> to get a spare <see cref="List{T}"/> if
|
|
||||||
/// </summary>
|
|
||||||
public static IDisposable AcquireList<T>(out List<T> list)
|
|
||||||
{
|
|
||||||
var disposable = ObjectPool<List<T>>.Disposable.Acquire(out list, onRelease: (l) => l.Clear());
|
|
||||||
EmuLogger.Assert(list.Count == 0, "A pooled list is not empty." + NotClearError);
|
|
||||||
return disposable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calls <see cref="ObjectPool{T}.Disposable.Acquire"/> to get a spare <see cref="HashSet{T}"/> if
|
|
||||||
/// </summary>
|
|
||||||
public static IDisposable AcquireSet<T>(out HashSet<T> set)
|
|
||||||
{
|
|
||||||
var disposable = ObjectPool<HashSet<T>>.Disposable.Acquire(out set, onRelease: (s) => s.Clear());
|
|
||||||
EmuLogger.Assert(set.Count == 0, "A pooled set is not empty." + NotClearError);
|
|
||||||
return disposable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
}
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
public static class ObjectPool<T> where T : class, new()
|
|
||||||
{
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
private static readonly List<T>
|
|
||||||
Items = new List<T>();
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>The number of spare items currently in the pool.</summary>
|
|
||||||
public static int Count
|
|
||||||
{
|
|
||||||
get => Items.Count;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
var count = Items.Count;
|
|
||||||
if (count < value)
|
|
||||||
{
|
|
||||||
if (Items.Capacity < value)
|
|
||||||
Items.Capacity = NextPowerOfTwo(value);
|
|
||||||
|
|
||||||
do
|
|
||||||
{
|
|
||||||
Items.Add(new T());
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
while (count < value);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (count > value)
|
|
||||||
{
|
|
||||||
Items.RemoveRange(value, count - value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 计算大于或等于给定数的最小的2的幂
|
|
||||||
public static int NextPowerOfTwo(int value)
|
|
||||||
{
|
|
||||||
// 处理value为0的特殊情况
|
|
||||||
if (value == 0)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
// value已经是2的幂的情况
|
|
||||||
if ((value & (value - 1)) == 0)
|
|
||||||
return value;
|
|
||||||
|
|
||||||
// 不断左移直到找到一个大于或等于value的2的幂
|
|
||||||
int powerOfTwo = 1;
|
|
||||||
while (powerOfTwo < value)
|
|
||||||
{
|
|
||||||
powerOfTwo <<= 1; // 左移一位,相当于乘以2
|
|
||||||
}
|
|
||||||
|
|
||||||
return powerOfTwo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// If the <see cref="Count"/> is less than the specified value, this method increases it to that value by
|
|
||||||
/// creating new objects.
|
|
||||||
/// </summary>
|
|
||||||
public static void SetMinCount(int count)
|
|
||||||
{
|
|
||||||
if (Count < count)
|
|
||||||
Count = count;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>The <see cref="List{T}.Capacity"/> of the internal list of spare items.</summary>
|
|
||||||
public static int Capacity
|
|
||||||
{
|
|
||||||
get => Items.Capacity;
|
|
||||||
set
|
|
||||||
{
|
|
||||||
if (Items.Count > value)
|
|
||||||
Items.RemoveRange(value, Items.Count - value);
|
|
||||||
Items.Capacity = value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>Returns a spare item if there are any, or creates a new one.</summary>
|
|
||||||
/// <remarks>Remember to <see cref="Release(T)"/> it when you are done.</remarks>
|
|
||||||
public static T Acquire()
|
|
||||||
{
|
|
||||||
var count = Items.Count;
|
|
||||||
if (count == 0)
|
|
||||||
{
|
|
||||||
return new T();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
count--;
|
|
||||||
var item = Items[count];
|
|
||||||
Items.RemoveAt(count);
|
|
||||||
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>Adds the `item` to the list of spares so it can be reused.</summary>
|
|
||||||
public static void Release(T item)
|
|
||||||
{
|
|
||||||
Items.Add(item);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>Returns a description of the state of this pool.</summary>
|
|
||||||
public static string GetDetails()
|
|
||||||
{
|
|
||||||
return
|
|
||||||
$"{typeof(T).Name}" +
|
|
||||||
$" ({nameof(Count)} = {Items.Count}" +
|
|
||||||
$", {nameof(Capacity)} = {Items.Capacity}" +
|
|
||||||
")";
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// An <see cref="IDisposable"/> system to allow pooled objects to be acquired and released within <c>using</c>
|
|
||||||
/// statements instead of needing to manually release everything.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class Disposable : IDisposable
|
|
||||||
{
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
private static readonly List<Disposable> LazyStack = new List<Disposable>();
|
|
||||||
|
|
||||||
private static int _ActiveDisposables;
|
|
||||||
|
|
||||||
private T _Item;
|
|
||||||
private Action<T> _OnRelease;
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
private Disposable() { }
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Calls <see cref="ObjectPool{T}.Acquire"/> to set the `item` and returns an <see cref="IDisposable"/>
|
|
||||||
/// that will call <see cref="Release(T)"/> on the `item` when disposed.
|
|
||||||
/// </summary>
|
|
||||||
public static IDisposable Acquire(out T item, Action<T> onRelease = null)
|
|
||||||
{
|
|
||||||
Disposable disposable;
|
|
||||||
|
|
||||||
if (LazyStack.Count <= _ActiveDisposables)
|
|
||||||
{
|
|
||||||
LazyStack.Add(disposable = new Disposable());
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
disposable = LazyStack[_ActiveDisposables];
|
|
||||||
}
|
|
||||||
|
|
||||||
_ActiveDisposables++;
|
|
||||||
|
|
||||||
disposable._Item = item = ObjectPool<T>.Acquire();
|
|
||||||
disposable._OnRelease = onRelease;
|
|
||||||
return disposable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
|
|
||||||
void IDisposable.Dispose()
|
|
||||||
{
|
|
||||||
_OnRelease?.Invoke(_Item);
|
|
||||||
Release(_Item);
|
|
||||||
_ActiveDisposables--;
|
|
||||||
}
|
|
||||||
/************************************************************************************************************************/
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#region ExtFunctions
|
|
||||||
public struct PoolHandle<T> : IDisposable
|
|
||||||
where T : class, new()
|
|
||||||
{
|
|
||||||
public T Ins;
|
|
||||||
internal static PoolHandle<T> Create(T poolIns)
|
|
||||||
{
|
|
||||||
return new PoolHandle<T> { Ins = poolIns };
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
ObjectPoolAuto.Release<T>(Ins);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
public struct PoolListHandle<T> : IDisposable
|
|
||||||
{
|
|
||||||
public List<T> Ins;
|
|
||||||
internal static PoolListHandle<T> Create(List<T> poolIns)
|
|
||||||
{
|
|
||||||
return new PoolListHandle<T> { Ins = poolIns };
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
ObjectPoolAuto.Release<T>(Ins);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static PoolHandle<T> PoolScope<T>()
|
|
||||||
where T : class, new()
|
|
||||||
{
|
|
||||||
return PoolHandle<T>.Create(ObjectPoolAuto.Acquire<T>());
|
|
||||||
}
|
|
||||||
public static PoolListHandle<T> PoolListScope<T>()
|
|
||||||
{
|
|
||||||
return PoolListHandle<T>.Create(ObjectPoolAuto.AcquireList<T>());
|
|
||||||
}
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f22c2fa157c9e6045ad5307124c8a365
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e0f2056e5d40c9e4b87a70bb42c0665d
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 87f805602538c22479c796f78f64b052
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
|
||||||
-->
|
|
||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Any CPU</Platform>
|
|
||||||
<PublishDir>bin\Release\netstandard2.0\publish\</PublishDir>
|
|
||||||
<PublishProtocol>FileSystem</PublishProtocol>
|
|
||||||
<_TargetId>Folder</_TargetId>
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6e66dd647cf36e64eba535a9422b5dfd
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,10 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<!--
|
|
||||||
https://go.microsoft.com/fwlink/?LinkID=208121.
|
|
||||||
-->
|
|
||||||
<Project>
|
|
||||||
<PropertyGroup>
|
|
||||||
<History>True|2024-08-30T07:41:53.2597006Z||;True|2024-08-29T17:00:35.4694695+08:00||;True|2024-08-29T16:40:23.7314446+08:00||;True|2024-08-29T16:17:16.6219882+08:00||;False|2024-08-29T15:55:34.5778980+08:00||;True|2024-08-29T15:34:15.1410739+08:00||;False|2024-08-29T15:31:15.0815441+08:00||;False|2024-08-29T15:29:46.6749330+08:00||;False|2024-08-29T15:27:48.9116490+08:00||;False|2024-08-29T15:27:23.2208875+08:00||;True|2024-08-28T16:12:23.3416224+08:00||;True|2024-08-28T13:18:21.7983285+08:00||;True|2024-08-28T12:54:14.9742502+08:00||;True|2024-08-28T12:09:37.5280942+08:00||;True|2024-08-28T12:07:03.6717540+08:00||;True|2024-08-07T18:02:59.4096796+08:00||;False|2024-08-07T18:02:44.0239078+08:00||;True|2024-07-31T17:00:23.0585720+08:00||;True|2024-07-31T17:00:19.8123170+08:00||;True|2024-07-30T20:51:40.9773933+08:00||;True|2024-07-30T17:04:12.3440051+08:00||;True|2024-07-30T17:01:28.0849009+08:00||;True|2024-07-30T10:36:57.5301145+08:00||;</History>
|
|
||||||
<LastFailureDetails />
|
|
||||||
</PropertyGroup>
|
|
||||||
</Project>
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: a5cd247a5a04ff44bbdce6ed08ab6ccb
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 69d9e952f0a1b3349b7127b9f01238f3
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
using MAME.Core;
|
|
||||||
|
|
||||||
namespace MAME.Core
|
|
||||||
{
|
|
||||||
public static class AxiTimeSpan
|
|
||||||
{
|
|
||||||
public static ITimeSpan itime { get; private set; }
|
|
||||||
public static void Init(ITimeSpan itimespan)
|
|
||||||
{
|
|
||||||
itime = itimespan;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 13fc2a860c40ef54b917a94ebf44f187
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETStandard,Version=v2.0/",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETStandard,Version=v2.0": {},
|
|
||||||
".NETStandard,Version=v2.0/": {
|
|
||||||
"MAME.Core/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NETStandard.Library": "2.0.3"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"MAME.Core.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/1.1.0": {},
|
|
||||||
"NETStandard.Library/2.0.3": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"MAME.Core/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
|
|
||||||
"path": "microsoft.netcore.platforms/1.1.0",
|
|
||||||
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NETStandard.Library/2.0.3": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
|
||||||
"path": "netstandard.library/2.0.3",
|
|
||||||
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETStandard,Version=v2.0/",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETStandard,Version=v2.0": {},
|
|
||||||
".NETStandard,Version=v2.0/": {
|
|
||||||
"MAME.Core/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NETStandard.Library": "2.0.3"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"MAME.Core.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/1.1.0": {},
|
|
||||||
"NETStandard.Library/2.0.3": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"MAME.Core/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
|
|
||||||
"path": "microsoft.netcore.platforms/1.1.0",
|
|
||||||
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NETStandard.Library/2.0.3": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
|
||||||
"path": "netstandard.library/2.0.3",
|
|
||||||
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@ -1,47 +0,0 @@
|
|||||||
{
|
|
||||||
"runtimeTarget": {
|
|
||||||
"name": ".NETStandard,Version=v2.0/",
|
|
||||||
"signature": ""
|
|
||||||
},
|
|
||||||
"compilationOptions": {},
|
|
||||||
"targets": {
|
|
||||||
".NETStandard,Version=v2.0": {},
|
|
||||||
".NETStandard,Version=v2.0/": {
|
|
||||||
"MAME.Core/1.0.0": {
|
|
||||||
"dependencies": {
|
|
||||||
"NETStandard.Library": "2.0.3"
|
|
||||||
},
|
|
||||||
"runtime": {
|
|
||||||
"MAME.Core.dll": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/1.1.0": {},
|
|
||||||
"NETStandard.Library/2.0.3": {
|
|
||||||
"dependencies": {
|
|
||||||
"Microsoft.NETCore.Platforms": "1.1.0"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"libraries": {
|
|
||||||
"MAME.Core/1.0.0": {
|
|
||||||
"type": "project",
|
|
||||||
"serviceable": false,
|
|
||||||
"sha512": ""
|
|
||||||
},
|
|
||||||
"Microsoft.NETCore.Platforms/1.1.0": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
|
|
||||||
"path": "microsoft.netcore.platforms/1.1.0",
|
|
||||||
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
|
|
||||||
},
|
|
||||||
"NETStandard.Library/2.0.3": {
|
|
||||||
"type": "package",
|
|
||||||
"serviceable": true,
|
|
||||||
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
|
|
||||||
"path": "netstandard.library/2.0.3",
|
|
||||||
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5256a2747754bc84095436214447d27b
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: efa49c62f62f6f048a465cb5e940eeae
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9f888c964f0338f48a49e0eaedeb54ac
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,7 +1,6 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
//using System.IO;
|
|
||||||
|
|
||||||
namespace cpu.m6502
|
namespace cpu.m6502
|
||||||
{
|
{
|
||||||
@ -141,6 +140,15 @@ namespace cpu.m6502
|
|||||||
}
|
}
|
||||||
public int m6502_execute(int cycles)
|
public int m6502_execute(int cycles)
|
||||||
{
|
{
|
||||||
|
StreamWriter sw30 = null, sw31 = null;
|
||||||
|
if (Cpuexec.bLog0 == 1 && Cpuexec.bLog02)
|
||||||
|
{
|
||||||
|
sw30 = new StreamWriter(@"\VS2008\compare1\compare1\bin\Debug\20.txt", true);
|
||||||
|
}
|
||||||
|
if (Cpuexec.bLog1 == 1 && Cpuexec.bLog12)
|
||||||
|
{
|
||||||
|
sw31 = new StreamWriter(@"\VS2008\compare1\compare1\bin\Debug\21.txt", true);
|
||||||
|
}
|
||||||
pendingCycles = cycles;
|
pendingCycles = cycles;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@ -181,8 +189,26 @@ namespace cpu.m6502
|
|||||||
pending_irq = 1;
|
pending_irq = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (Cpuexec.bLog0 == 1 && Cpuexec.bLog02)
|
||||||
|
{
|
||||||
|
sw30.WriteLine(ppc.d.ToString("x") + "\t" + op.ToString("x") + "\t" + pendingCycles.ToString("x"));
|
||||||
|
sw30.WriteLine(sp.LowWord.ToString("x") + "\t" + p.ToString("x") + "\t" + a.ToString("x") + "\t" + x.ToString("x") + "\t" + y.ToString("x") + "\t" + pending_irq.ToString("x") + "\t" + after_cli.ToString("x") + "\t" + nmi_state.ToString("x") + "\t" + irq_state.ToString("x") + "\t" + so_state.ToString("x"));
|
||||||
|
}
|
||||||
|
if (Cpuexec.bLog1 == 1 && Cpuexec.bLog12)
|
||||||
|
{
|
||||||
|
sw31.WriteLine(ppc.d.ToString("x") + "\t" + op.ToString("x") + "\t" + pendingCycles.ToString("x"));
|
||||||
|
sw31.WriteLine(sp.LowWord.ToString("x") + "\t" + p.ToString("x") + "\t" + a.ToString("x") + "\t" + x.ToString("x") + "\t" + y.ToString("x") + "\t" + pending_irq.ToString("x") + "\t" + after_cli.ToString("x") + "\t" + nmi_state.ToString("x") + "\t" + irq_state.ToString("x") + "\t" + so_state.ToString("x"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
while (pendingCycles > 0);
|
while (pendingCycles > 0);
|
||||||
|
if (Cpuexec.bLog0 == 1 && Cpuexec.bLog02)
|
||||||
|
{
|
||||||
|
sw30.Close();
|
||||||
|
}
|
||||||
|
if (Cpuexec.bLog1 == 1 && Cpuexec.bLog12)
|
||||||
|
{
|
||||||
|
sw31.Close();
|
||||||
|
}
|
||||||
return cycles - pendingCycles;
|
return cycles - pendingCycles;
|
||||||
}
|
}
|
||||||
public override void set_irq_line(int irqline, LineState state)
|
public override void set_irq_line(int irqline, LineState state)
|
||||||
@ -191,7 +217,7 @@ namespace cpu.m6502
|
|||||||
}
|
}
|
||||||
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
private void m6502_set_irq_line(int irqline, LineState state)
|
private void m6502_set_irq_line(int irqline, LineState state)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e27c96a34afca8c4f991cc6209a8895e
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: fb223c61fecbecc4fb762d9ebe649194
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
|
|
||||||
namespace cpu.m6502
|
namespace cpu.m6502
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: df989ce237c20a84aa97ead349d2093e
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 317be4f8630ce90409e488310814c936
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@ -26,7 +26,7 @@ namespace cpu.m6800
|
|||||||
public byte trcsr, rmcr, rdr, tdr, rsr, tsr;
|
public byte trcsr, rmcr, rdr, tdr, rsr, tsr;
|
||||||
public int rxbits, txbits, trcsr_read, tx;
|
public int rxbits, txbits, trcsr_read, tx;
|
||||||
public M6800_TX_STATE txstate;
|
public M6800_TX_STATE txstate;
|
||||||
public EmuTimer.emu_timer m6800_rx_timer, m6800_tx_timer;
|
public Timer.emu_timer m6800_rx_timer, m6800_tx_timer;
|
||||||
private byte TCSR_OLVL = 0x01, TCSR_IEDG = 0x02, TCSR_ETOI = 0x04, TCSR_EOCI = 0x08, TCSR_EICI = 0x10, TCSR_TOF = 0x20, TCSR_OCF = 0x40, TCSR_ICF = 0x80;
|
private byte TCSR_OLVL = 0x01, TCSR_IEDG = 0x02, TCSR_ETOI = 0x04, TCSR_EOCI = 0x08, TCSR_EICI = 0x10, TCSR_TOF = 0x20, TCSR_OCF = 0x40, TCSR_ICF = 0x80;
|
||||||
protected byte M6800_WAI = 8, M6800_SLP = 0x10;
|
protected byte M6800_WAI = 8, M6800_SLP = 0x10;
|
||||||
private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1;
|
private const byte M6800_IRQ_LINE = 0, M6800_TIN_LINE = 1;
|
||||||
@ -246,8 +246,8 @@ namespace cpu.m6800
|
|||||||
cycles = cycles_63701;
|
cycles = cycles_63701;
|
||||||
clock = 1536000;
|
clock = 1536000;
|
||||||
irq_callback = null;
|
irq_callback = null;
|
||||||
m6800_rx_timer = EmuTimer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
|
m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
|
||||||
m6800_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
|
m6800_tx_timer = Timer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
|
||||||
}
|
}
|
||||||
public override void Reset()
|
public override void Reset()
|
||||||
{
|
{
|
||||||
@ -844,8 +844,8 @@ namespace cpu.m6800
|
|||||||
ram_ctrl |= 0x40;
|
ram_ctrl |= 0x40;
|
||||||
trcsr = M6800_TRCSR_TDRE;
|
trcsr = M6800_TRCSR_TDRE;
|
||||||
rmcr = 0;
|
rmcr = 0;
|
||||||
EmuTimer.timer_enable(m6800_rx_timer, false);
|
Timer.timer_enable(m6800_rx_timer, false);
|
||||||
EmuTimer.timer_enable(m6800_tx_timer, false);
|
Timer.timer_enable(m6800_tx_timer, false);
|
||||||
txstate = M6800_TX_STATE.INIT;
|
txstate = M6800_TX_STATE.INIT;
|
||||||
txbits = rxbits = 0;
|
txbits = rxbits = 0;
|
||||||
trcsr_read = 0;
|
trcsr_read = 0;
|
||||||
@ -905,7 +905,7 @@ namespace cpu.m6800
|
|||||||
}
|
}
|
||||||
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
public override int ExecuteCycles(int cycles)
|
public override int ExecuteCycles(int cycles)
|
||||||
{
|
{
|
||||||
@ -1167,16 +1167,16 @@ namespace cpu.m6800
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
case 3: // not implemented
|
case 3: // not implemented
|
||||||
EmuTimer.timer_enable(m6800_rx_timer, false);
|
Timer.timer_enable(m6800_rx_timer, false);
|
||||||
EmuTimer.timer_enable(m6800_tx_timer, false);
|
Timer.timer_enable(m6800_tx_timer, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
{
|
{
|
||||||
int divisor = M6800_RMCR_SS[rmcr & M6800_RMCR_SS_MASK];
|
int divisor = M6800_RMCR_SS[rmcr & M6800_RMCR_SS_MASK];
|
||||||
EmuTimer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
|
Timer.timer_adjust_periodic(m6800_rx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
|
||||||
EmuTimer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
|
Timer.timer_adjust_periodic(m6800_tx_timer, Attotime.ATTOTIME_ZERO, new Atime(0, (long)(1e18 / (clock / divisor))));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1345,8 +1345,8 @@ namespace cpu.m6800
|
|||||||
};
|
};
|
||||||
clock = 1000000;
|
clock = 1000000;
|
||||||
irq_callback = Cpuint.cpu_3_irq_callback;
|
irq_callback = Cpuint.cpu_3_irq_callback;
|
||||||
m6800_rx_timer = EmuTimer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
|
m6800_rx_timer = Timer.timer_alloc_common(m6800_rx_tick, "m6800_rx_tick", false);
|
||||||
m6800_tx_timer = EmuTimer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
|
m6800_tx_timer = Timer.timer_alloc_common(m6800_tx_tick, "m6800_tx_tick", false);
|
||||||
}
|
}
|
||||||
public override int ExecuteCycles(int cycles)
|
public override int ExecuteCycles(int cycles)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b048d365a2726014e8b35b00934ba716
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
|
|
||||||
namespace cpu.m6800
|
namespace cpu.m6800
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7ac480a98cd915a488d75cf520ceeb12
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 5363a2171a5a06e458069790876245da
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: ae3b5a67d5c131646a72ea967ddd303f
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d595cf6577109d144b95da9cb77cfdd9
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 3b9a46ea2abd2a04b88ef2ad2aa34650
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f00bdfe992953ee40bfa6536dcda1148
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2095e1daba88c5b4b935aaa55d3ed2e1
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: c8ae0dd765643d44da568a00571a176e
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -192,7 +192,7 @@ namespace cpu.m68000
|
|||||||
}
|
}
|
||||||
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
public void Pulse_Reset()
|
public void Pulse_Reset()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: cde299f017f5c6c4d83cb4a8e4cfe543
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8ca60a438b9bb004189843e1d4dad73c
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,126 +0,0 @@
|
|||||||
namespace cpu.m68000
|
|
||||||
{
|
|
||||||
partial class MC68000
|
|
||||||
{
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 重写的68000指令调度
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="op"></param>
|
|
||||||
void DoOpCode(ushort op)
|
|
||||||
{
|
|
||||||
MC68000Code opType = MC68000CodeArr[op];
|
|
||||||
switch (opType)
|
|
||||||
{
|
|
||||||
case MC68000Code.ORI: ORI(); return;
|
|
||||||
case MC68000Code.ILL: ILL(); return;
|
|
||||||
case MC68000Code.ORI_CCR: ORI_CCR(); return;
|
|
||||||
case MC68000Code.ORI_SR: ORI_SR(); return;
|
|
||||||
case MC68000Code.BTSTr: BTSTr(); return;
|
|
||||||
case MC68000Code.MOVEP: MOVEP(); return;
|
|
||||||
case MC68000Code.BCHGr: BCHGr(); return;
|
|
||||||
case MC68000Code.BCLRr: BCLRr(); return;
|
|
||||||
case MC68000Code.BSETr: BSETr(); return;
|
|
||||||
case MC68000Code.ANDI: ANDI(); return;
|
|
||||||
case MC68000Code.ANDI_CCR: ANDI_CCR(); return;
|
|
||||||
case MC68000Code.ANDI_SR: ANDI_SR(); return;
|
|
||||||
case MC68000Code.SUBI: SUBI(); return;
|
|
||||||
case MC68000Code.ADDI: ADDI(); return;
|
|
||||||
case MC68000Code.BTSTi: BTSTi(); return;
|
|
||||||
case MC68000Code.BCHGi: BCHGi(); return;
|
|
||||||
case MC68000Code.BCLRi: BCLRi(); return;
|
|
||||||
case MC68000Code.BSETi: BSETi(); return;
|
|
||||||
case MC68000Code.EORI: EORI(); return;
|
|
||||||
case MC68000Code.EORI_CCR: EORI_CCR(); return;
|
|
||||||
case MC68000Code.EORI_SR: EORI_SR(); return;
|
|
||||||
case MC68000Code.CMPI: CMPI(); return;
|
|
||||||
case MC68000Code.MOVE: MOVE(); return;
|
|
||||||
case MC68000Code.MOVEA: MOVEA(); return;
|
|
||||||
case MC68000Code.NEGX: NEGX(); return;
|
|
||||||
case MC68000Code.MOVEfSR: MOVEfSR(); return;
|
|
||||||
case MC68000Code.CHK: CHK(); return;
|
|
||||||
case MC68000Code.LEA: LEA(); return;
|
|
||||||
case MC68000Code.CLR: CLR(); return;
|
|
||||||
case MC68000Code.NEG: NEG(); return;
|
|
||||||
case MC68000Code.MOVECCR: MOVECCR(); return;
|
|
||||||
case MC68000Code.NOT: NOT(); return;
|
|
||||||
case MC68000Code.MOVEtSR: MOVEtSR(); return;
|
|
||||||
case MC68000Code.NBCD: NBCD(); return;
|
|
||||||
case MC68000Code.SWAP: SWAP(); return;
|
|
||||||
case MC68000Code.PEA: PEA(); return;
|
|
||||||
case MC68000Code.EXT: EXT(); return;
|
|
||||||
case MC68000Code.MOVEM0: MOVEM0(); return;
|
|
||||||
case MC68000Code.TST: TST(); return;
|
|
||||||
case MC68000Code.TAS: TAS(); return;
|
|
||||||
case MC68000Code.ILLEGAL: ILLEGAL(); return;
|
|
||||||
case MC68000Code.MOVEM1: MOVEM1(); return;
|
|
||||||
case MC68000Code.TRAP: TRAP(); return;
|
|
||||||
case MC68000Code.LINK: LINK(); return;
|
|
||||||
case MC68000Code.UNLK: UNLK(); return;
|
|
||||||
case MC68000Code.MOVEUSP: MOVEUSP(); return;
|
|
||||||
case MC68000Code.RESET: RESET(); return;
|
|
||||||
case MC68000Code.NOP: NOP(); return;
|
|
||||||
case MC68000Code.STOP: STOP(); return;
|
|
||||||
case MC68000Code.RTE: RTE(); return;
|
|
||||||
case MC68000Code.RTS: RTS(); return;
|
|
||||||
case MC68000Code.TRAPV: TRAPV(); return;
|
|
||||||
case MC68000Code.RTR: RTR(); return;
|
|
||||||
case MC68000Code.JSR: JSR(); return;
|
|
||||||
case MC68000Code.JMP: JMP(); return;
|
|
||||||
case MC68000Code.ADDQ: ADDQ(); return;
|
|
||||||
case MC68000Code.Scc: Scc(); return;
|
|
||||||
case MC68000Code.DBcc: DBcc(); return;
|
|
||||||
case MC68000Code.SUBQ: SUBQ(); return;
|
|
||||||
case MC68000Code.BRA: BRA(); return;
|
|
||||||
case MC68000Code.BSR: BSR(); return;
|
|
||||||
case MC68000Code.Bcc: Bcc(); return;
|
|
||||||
case MC68000Code.MOVEQ: MOVEQ(); return;
|
|
||||||
case MC68000Code.OR0: OR0(); return;
|
|
||||||
case MC68000Code.DIVU: DIVU(); return;
|
|
||||||
case MC68000Code.SBCD0: SBCD0(); return;
|
|
||||||
case MC68000Code.SBCD1: SBCD1(); return;
|
|
||||||
case MC68000Code.OR1: OR1(); return;
|
|
||||||
case MC68000Code.DIVS: DIVS(); return;
|
|
||||||
case MC68000Code.SUB0: SUB0(); return;
|
|
||||||
case MC68000Code.SUBA: SUBA(); return;
|
|
||||||
case MC68000Code.SUBX0: SUBX0(); return;
|
|
||||||
case MC68000Code.SUBX1: SUBX1(); return;
|
|
||||||
case MC68000Code.SUB1: SUB1(); return;
|
|
||||||
case MC68000Code.CMP: CMP(); return;
|
|
||||||
case MC68000Code.CMPA: CMPA(); return;
|
|
||||||
case MC68000Code.EOR: EOR(); return;
|
|
||||||
case MC68000Code.CMPM: CMPM(); return;
|
|
||||||
case MC68000Code.AND0: AND0(); return;
|
|
||||||
case MC68000Code.MULU: MULU(); return;
|
|
||||||
case MC68000Code.ABCD0: ABCD0(); return;
|
|
||||||
case MC68000Code.ABCD1: ABCD1(); return;
|
|
||||||
case MC68000Code.AND1: AND1(); return;
|
|
||||||
case MC68000Code.EXGdd: EXGdd(); return;
|
|
||||||
case MC68000Code.EXGaa: EXGaa(); return;
|
|
||||||
case MC68000Code.EXGda: EXGda(); return;
|
|
||||||
case MC68000Code.MULS: MULS(); return;
|
|
||||||
case MC68000Code.ADD0: ADD0(); return;
|
|
||||||
case MC68000Code.ADDA: ADDA(); return;
|
|
||||||
case MC68000Code.ADDX0: ADDX0(); return;
|
|
||||||
case MC68000Code.ADDX1: ADDX1(); return;
|
|
||||||
case MC68000Code.ADD1: ADD1(); return;
|
|
||||||
case MC68000Code.ASRd: ASRd(); return;
|
|
||||||
case MC68000Code.LSRd: LSRd(); return;
|
|
||||||
case MC68000Code.ROXRd: ROXRd(); return;
|
|
||||||
case MC68000Code.RORd: RORd(); return;
|
|
||||||
case MC68000Code.ASRd0: ASRd0(); return;
|
|
||||||
case MC68000Code.ASLd: ASLd(); return;
|
|
||||||
case MC68000Code.LSLd: LSLd(); return;
|
|
||||||
case MC68000Code.ROXLd: ROXLd(); return;
|
|
||||||
case MC68000Code.ROLd: ROLd(); return;
|
|
||||||
case MC68000Code.ASLd0: ASLd0(); return;
|
|
||||||
case MC68000Code.LSRd0: LSRd0(); return;
|
|
||||||
case MC68000Code.LSLd0: LSLd0(); return;
|
|
||||||
case MC68000Code.ROXRd0: ROXRd0(); return;
|
|
||||||
case MC68000Code.ROXLd0: ROXLd0(); return;
|
|
||||||
case MC68000Code.RORd0: RORd0(); return;
|
|
||||||
case MC68000Code.ROLd0: ROLd0(); return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 6be477f2e8966cf4c8eb308e23568bbf
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
File diff suppressed because one or more lines are too long
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: fb52db132edb72746a600471b199d49b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dd115883ec0396d42abef36787464a37
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1cec51d80caf2184681dc0898d9dec38
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@ -540,7 +540,7 @@ namespace cpu.m6805
|
|||||||
}
|
}
|
||||||
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
public override int ExecuteCycles(int cycles)
|
public override int ExecuteCycles(int cycles)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 84fc920b98828f14c8f326b4f1520eb0
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
|
|
||||||
namespace cpu.m6805
|
namespace cpu.m6805
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: e0c310d005b3a9f4d8861c58a32603b9
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 24967d13608942c4289d335114c41269
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@ -555,7 +555,7 @@ namespace cpu.m6809
|
|||||||
}
|
}
|
||||||
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
public override int ExecuteCycles(int cycles)
|
public override int ExecuteCycles(int cycles)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 727532af9b9469442a63c74022c8905b
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
|
|
||||||
namespace cpu.m6809
|
namespace cpu.m6809
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 2fd2fa6c87071aa4482ca5895aa105e7
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9712b77131e67e342acd3852569c6692
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ namespace cpu.nec
|
|||||||
{
|
{
|
||||||
if (line >= 0 && line < 35)
|
if (line >= 0 && line < 35)
|
||||||
{
|
{
|
||||||
Cpuint.lirq.Add(new irq(cpunum, line, state, vector, EmuTimer.get_current_time()));
|
Cpuint.lirq.Add(new irq(cpunum, line, state, vector, Timer.get_current_time()));
|
||||||
int event_index = Cpuint.input_event_index[cpunum, line]++;
|
int event_index = Cpuint.input_event_index[cpunum, line]++;
|
||||||
if (event_index >= 35)
|
if (event_index >= 35)
|
||||||
{
|
{
|
||||||
@ -74,7 +74,7 @@ namespace cpu.nec
|
|||||||
//Cpuint.input_event_queue[cpunum][line][event_index] = input_event;
|
//Cpuint.input_event_queue[cpunum][line][event_index] = input_event;
|
||||||
//if (event_index == 0)
|
//if (event_index == 0)
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: d3565408bc12d5c4eafb64846e799d0f
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7d5f27e4fff949a459570d38e744620f
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 1dd5cd4e2bf67fa4b9221127b7fca5be
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 20de18d94833a3f43bbeceac70edcc66
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 330693b766ebedc47a340cdcf561859d
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 9c09602ef08e6484da16a66054f9fcbf
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 8c96c195554ad5940b560fc6284134f7
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 63e5e1ff77e9301458ec650c273796e2
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: f8aa162d7c8690a46b4dd0f9c6cf5eaa
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
using MAME.Core;
|
using mame;
|
||||||
using System;
|
using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
@ -86,7 +86,7 @@ namespace cpu.z80
|
|||||||
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
public override void cpunum_set_input_line_and_vector(int cpunum, int line, LineState state, int vector)
|
||||||
{
|
{
|
||||||
Atime time1;
|
Atime time1;
|
||||||
time1 = EmuTimer.get_current_time();
|
time1 = Timer.get_current_time();
|
||||||
bool b1 = false;
|
bool b1 = false;
|
||||||
foreach (irq irq1 in Cpuint.lirq)
|
foreach (irq irq1 in Cpuint.lirq)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ namespace cpu.z80
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EmuTimer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
Timer.timer_set_internal(Cpuint.cpunum_empty_event_queue, "cpunum_empty_event_queue");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: dd46bd23b3b45ae49adfb6aa6c807213
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 386b71aba86862047bbefefc784eac87
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
namespace MAME.Core
|
namespace mame
|
||||||
{
|
{
|
||||||
public struct Atime
|
public struct Atime
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,11 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: cfd1896a9cde00f4ea338e1f9cb3454c
|
|
||||||
MonoImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
serializedVersion: 2
|
|
||||||
defaultReferences: []
|
|
||||||
executionOrder: 0
|
|
||||||
icon: {instanceID: 0}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user