清理不必要代码

This commit is contained in:
sin365 2024-07-29 14:12:46 +08:00
parent b2230163b5
commit 7c6fc880d1
34 changed files with 1005 additions and 1672 deletions

View File

@ -177,279 +177,11 @@ 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
{ {
public static int ToArgb(this AxiColor color) public static int ToArgb(this AxiColor color)
{ {
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)
//{
// unsafe
// {
// 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);
// for (int y = 0; y < rect.Height; y++)
// {
// int srcStartIndex = (rect.Y + y) * baseBitmap.Width * sizeof(AxiColor) + rect.X * sizeof(AxiColor);
// int dstStartIndex = y * rect.Width * sizeof(AxiColor);
// Array.Copy(baseBitmap.mData, srcStartIndex, clonedBitmap.mData, dstStartIndex, rect.Width * sizeof(AxiColor));
// }
// return clonedBitmap;
// }
//}
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)
{
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;
for (int y = 0; y < rect.Height; y++)
{
Array.Copy(baseBitmap, srcStartIndex + y * Width, result, y * rect.Width, rect.Width);
}
return result;
}
//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)
{
if (!source.Contains(srcRect.X, srcRect.Y, srcRect.Width, srcRect.Height))
throw new ArgumentException("Err");
// 遍历源矩形的每个像素
for (int y = srcRect.Y; y < srcRect.Bottom; y++)
{
for (int x = srcRect.X; x < srcRect.Right; x++)
{
// 计算目标位置
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
}
}
}
// 辅助方法,用于检查一个点是否在位图范围内
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;
}
} }
} }

View File

@ -35,58 +35,5 @@ namespace MAME.Core.Common
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);
}
}
}
} }
} }

View File

@ -1,6 +1,7 @@
using mame; using mame;
using System; using System;
using System.IO; using System.IO;
//using System.IO;
namespace cpu.m6502 namespace cpu.m6502
{ {
@ -140,15 +141,6 @@ 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
{ {
@ -189,26 +181,8 @@ 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)

View File

@ -1,4 +1,4 @@
using Bitmap = MAME.Core.AxiBitmap.AxiBitmap; 
using Color = MAME.Core.AxiBitmap.AxiColor; using Color = MAME.Core.AxiBitmap.AxiColor;
namespace mame namespace mame
@ -9,7 +9,6 @@ namespace mame
{ {
public bool[] used; public bool[] used;
public bool[] visible; public bool[] visible;
public Bitmap[] bitmap;
/*bitmap_t * bitmap[MAX_PLAYERS]; /*bitmap_t * bitmap[MAX_PLAYERS];
render_texture * texture[MAX_PLAYERS]; render_texture * texture[MAX_PLAYERS];
const device_config *screen[MAX_PLAYERS];*/ const device_config *screen[MAX_PLAYERS];*/
@ -86,7 +85,6 @@ namespace mame
{ {
global.used = new bool[8]; global.used = new bool[8];
global.visible = new bool[8]; global.visible = new bool[8];
global.bitmap = new Bitmap[8];
global.x = new int[8]; global.x = new int[8];
global.y = new int[8]; global.y = new int[8];
switch (Machine.sName) switch (Machine.sName)
@ -99,7 +97,6 @@ namespace mame
case "opwolfp": case "opwolfp":
global.used[0] = true; global.used[0] = true;
global.visible[0] = true; global.visible[0] = true;
create_bitmap(0);
Video.drawcrosshair = Video.drawcrosshair_opwolf; Video.drawcrosshair = Video.drawcrosshair_opwolf;
break; break;
default: default:
@ -107,30 +104,6 @@ namespace mame
break; break;
} }
} }
public static void create_bitmap(int player)
{
global.bitmap[player] = new Bitmap(100, 100);
int x, y;
uint color = crosshair_colors[player];
for (y = 0; y < 100; y++)
{
for (x = 0; x < 100; x++)
{
global.bitmap[player].SetPixel(x, y, Color.FromArgb(0xffffff));
}
}
for (y = 0; y < 50; y++)
{
for (x = 0; x < 100; x++)
{
if (((crosshair_raw_top[y * (107 / 8) + x / 8] << (x % 8)) & 0x80) != 0)
{
global.bitmap[player].SetPixel(x, y, Color.FromArgb(unchecked((int)(0xff000000 | color))));
global.bitmap[player].SetPixel(x, 99 - y, Color.FromArgb(unchecked((int)(0xff000000 | color))));
}
}
}
}
public static void animate_opwolf() public static void animate_opwolf()
{ {
int player; int player;

View File

@ -1,8 +1,6 @@
using MAME.Core.AxiBitmap; using MAME.Core.AxiBitmap;
using System; using System;
using Bitmap = MAME.Core.AxiBitmap.AxiBitmap;
using Color = MAME.Core.AxiBitmap.AxiColor; using Color = MAME.Core.AxiBitmap.AxiColor;
using Rectangle = MAME.Core.AxiBitmap.Rectangle;
namespace mame namespace mame
{ {
@ -34,17 +32,6 @@ namespace mame
// return bm2; // return bm2;
//} //}
public static Bitmap drawcrosshair_opwolf(Bitmap bm1)
{
Bitmap bm2 = bm1;
bm2.DrawImage(
MultiplyAlpha(Crosshair.global.bitmap[0], (float)Crosshair.global.fade / 0xff),
new Rectangle(Crosshair.global.x[0] - 10,
Crosshair.global.y[0] - 10, 20, 20),
new Rectangle(0, 0, 100, 100));
return bm2;
}
public static int[] drawcrosshair_opwolf(int[] bm1) public static int[] drawcrosshair_opwolf(int[] bm1)
{ {
int[] bm2 = bm1; int[] bm2 = bm1;
@ -67,33 +54,6 @@ namespace mame
return result; return result;
}*/ }*/
/// <summary>
///
/// </summary>
/// <param name="bitmap"></param>
/// <param name="factor"></param>
/// <returns></returns>
public static Bitmap MultiplyAlpha(Bitmap bitmap, float factor)
{
Bitmap result = new Bitmap(bitmap.Width, bitmap.Height);
for (int y = 0; y < bitmap.Height; y++)
{
for (int x = 0; x < bitmap.Width; x++)
{
Color originalColor = bitmap.GetPixel(x, y);
byte newAlpha = (byte)Math.Min(255, (int)(originalColor.a * factor));
Color newColor = new Color
{
r = originalColor.r,
g = originalColor.g,
b = originalColor.b,
a = newAlpha
};
result.SetPixel(x, y, newColor);
}
}
return result;
}
/// <summary> /// <summary>
/// ///
@ -184,23 +144,23 @@ namespace mame
{ {
try try
{ {
int[] TempData = AxiBitmapEx.CloneIntColorArr(Video.bitmapcolor, Video.fullwidth, Video.fullheight, new Rectangle(offsetx, offsety, width, height)); //int[] TempData = AxiBitmapEx.CloneIntColorArr(Video.bitmapcolor, Video.fullwidth, Video.fullheight, new Rectangle(offsetx, offsety, width, height));
drawcrosshair(TempData); //drawcrosshair(TempData);
//bbmp[iMode] = drawcrosshair(bitmapGDI.Clone(new Rectangle(offsetx, offsety, width, height))); //bbmp[iMode] = drawcrosshair(bitmapGDI.Clone(new Rectangle(offsetx, offsety, width, height)));
switch (Machine.sDirection) //switch (Machine.sDirection)
{ //{
case "": // case "":
break; // break;
case "90": // case "90":
bbmp[iMode].RotateFlip(RotateFlipType.Rotate90FlipNone); // bbmp[iMode].RotateFlip(RotateFlipType.Rotate90FlipNone);
break; // break;
case "180": // case "180":
bbmp[iMode].RotateFlip(RotateFlipType.Rotate180FlipNone); // bbmp[iMode].RotateFlip(RotateFlipType.Rotate180FlipNone);
break; // break;
case "270": // case "270":
bbmp[iMode].RotateFlip(RotateFlipType.Rotate270FlipNone); // bbmp[iMode].RotateFlip(RotateFlipType.Rotate270FlipNone);
break; // break;
} //}
//Machine.FORM.pictureBox1.Image = bbmp[iMode]; //Machine.FORM.pictureBox1.Image = bbmp[iMode];
SubmitVideo(Video.bitmapcolor); SubmitVideo(Video.bitmapcolor);
} }
@ -210,37 +170,6 @@ namespace mame
} }
} }
public static void CopyDataFrom(AxiBitmap destBitmap, byte[] sourceData, int sourceStride)
{
int pixelCount = destBitmap.Width * destBitmap.Height;
if (sourceData.Length < pixelCount * 4) // 假设每个AxiColor是4字节
throw new ArgumentException("Source data is too small.");
// 注意这里我们假设sourceStride是源数据的每行字节数它可能包含额外的填充字节
// 以确保每行的开始都是4的倍数。但是对于紧密打包的AxiColor数组我们可以忽略它。
for (int y = 0; y < destBitmap.Height; y++)
{
int sourceOffset = y * sourceStride; // 但对于紧密打包的AxiColor这将是 y * (destBitmap.Width * 4)
// 然而由于我们知道sourceData是直接对应于AxiColor的我们可以简化为
sourceOffset = y * destBitmap.Width * 4; // 假设没有行填充
for (int x = 0; x < destBitmap.Width; x++)
{
int index = y * destBitmap.Width + x;
int sourceIndex = sourceOffset + x * 4;
byte r = sourceData[sourceIndex];
byte g = sourceData[sourceIndex + 1];
byte b = sourceData[sourceIndex + 2];
byte a = sourceData[sourceIndex + 3];
destBitmap.mData[index] = new AxiColor { r = r, g = g, b = b, a = a };
}
}
}
} }
} }

View File

@ -643,13 +643,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -678,13 +678,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -701,13 +701,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
keypressed = true; keypressed = true;
delta -= analog_p0.delta * 0x200; delta -= analog_p0.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
keypressed = true; keypressed = true;
delta += analog_p0.delta * 0x200; delta += analog_p0.delta * 0x200;
@ -724,13 +724,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -747,13 +747,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -770,13 +770,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -793,13 +793,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -816,13 +816,13 @@ namespace mame
int value2; int value2;
value2 = apply_analog_min_max(analog, analog.accum); value2 = apply_analog_min_max(analog, analog.accum);
analog.previous = analog.accum = value2; analog.previous = analog.accum = value2;
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -847,13 +847,13 @@ namespace mame
delta = rawvalue; delta = rawvalue;
analog.lastdigital = 0; analog.lastdigital = 0;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;
@ -892,13 +892,13 @@ namespace mame
delta = rawvalue; delta = rawvalue;
analog.lastdigital = 0; analog.lastdigital = 0;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
keypressed = true; keypressed = true;
delta -= analog.delta * 0x200; delta -= analog.delta * 0x200;
analog.lastdigital = 1; analog.lastdigital = 1;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
keypressed = true; keypressed = true;
delta += analog.delta * 0x200; delta += analog.delta * 0x200;

View File

@ -6,18 +6,18 @@ namespace mame
public partial class Inptport public partial class Inptport
{ {
private static List<KeyStruct> lks; private static List<KeyStruct> lks;
public static List<Key> lk; public static List<Corekey> lk;
public class KeyStruct public class KeyStruct
{ {
public Key key; public Corekey key;
public char c; public char c;
public KeyStruct(Key _key, char _c) public KeyStruct(Corekey _key, char _c)
{ {
key = _key; key = _key;
c = _c; c = _c;
} }
} }
public static char getcharbykey(Key key1) public static char getcharbykey(Corekey key1)
{ {
char c1 = ' '; char c1 = ' ';
foreach (KeyStruct ks in lks) foreach (KeyStruct ks in lks)
@ -32,80 +32,80 @@ namespace mame
} }
public static void input_init() public static void input_init()
{ {
lk = new List<Key>(); lk = new List<Corekey>();
lk.Add(Key.D1); lk.Add(Corekey.D1);
lk.Add(Key.D2); lk.Add(Corekey.D2);
lk.Add(Key.D3); lk.Add(Corekey.D3);
lk.Add(Key.D4); lk.Add(Corekey.D4);
lk.Add(Key.D5); lk.Add(Corekey.D5);
lk.Add(Key.D6); lk.Add(Corekey.D6);
lk.Add(Key.D7); lk.Add(Corekey.D7);
lk.Add(Key.D8); lk.Add(Corekey.D8);
lk.Add(Key.D9); lk.Add(Corekey.D9);
lk.Add(Key.D0); lk.Add(Corekey.D0);
lk.Add(Key.A); lk.Add(Corekey.A);
lk.Add(Key.B); lk.Add(Corekey.B);
lk.Add(Key.C); lk.Add(Corekey.C);
lk.Add(Key.D); lk.Add(Corekey.D);
lk.Add(Key.E); lk.Add(Corekey.E);
lk.Add(Key.F); lk.Add(Corekey.F);
lk.Add(Key.G); lk.Add(Corekey.G);
lk.Add(Key.H); lk.Add(Corekey.H);
lk.Add(Key.I); lk.Add(Corekey.I);
lk.Add(Key.J); lk.Add(Corekey.J);
lk.Add(Key.K); lk.Add(Corekey.K);
lk.Add(Key.L); lk.Add(Corekey.L);
lk.Add(Key.M); lk.Add(Corekey.M);
lk.Add(Key.N); lk.Add(Corekey.N);
lk.Add(Key.O); lk.Add(Corekey.O);
lk.Add(Key.P); lk.Add(Corekey.P);
lk.Add(Key.Q); lk.Add(Corekey.Q);
lk.Add(Key.R); lk.Add(Corekey.R);
lk.Add(Key.S); lk.Add(Corekey.S);
lk.Add(Key.T); lk.Add(Corekey.T);
lk.Add(Key.U); lk.Add(Corekey.U);
lk.Add(Key.V); lk.Add(Corekey.V);
lk.Add(Key.W); lk.Add(Corekey.W);
lk.Add(Key.X); lk.Add(Corekey.X);
lk.Add(Key.Y); lk.Add(Corekey.Y);
lk.Add(Key.Z); lk.Add(Corekey.Z);
lks = new List<KeyStruct>(); lks = new List<KeyStruct>();
lks.Add(new KeyStruct(Key.D1, '1')); lks.Add(new KeyStruct(Corekey.D1, '1'));
lks.Add(new KeyStruct(Key.D2, '2')); lks.Add(new KeyStruct(Corekey.D2, '2'));
lks.Add(new KeyStruct(Key.D3, '3')); lks.Add(new KeyStruct(Corekey.D3, '3'));
lks.Add(new KeyStruct(Key.D4, '4')); lks.Add(new KeyStruct(Corekey.D4, '4'));
lks.Add(new KeyStruct(Key.D5, '5')); lks.Add(new KeyStruct(Corekey.D5, '5'));
lks.Add(new KeyStruct(Key.D6, '6')); lks.Add(new KeyStruct(Corekey.D6, '6'));
lks.Add(new KeyStruct(Key.D7, '7')); lks.Add(new KeyStruct(Corekey.D7, '7'));
lks.Add(new KeyStruct(Key.D8, '8')); lks.Add(new KeyStruct(Corekey.D8, '8'));
lks.Add(new KeyStruct(Key.D9, '9')); lks.Add(new KeyStruct(Corekey.D9, '9'));
lks.Add(new KeyStruct(Key.D0, '0')); lks.Add(new KeyStruct(Corekey.D0, '0'));
lks.Add(new KeyStruct(Key.A, 'a')); lks.Add(new KeyStruct(Corekey.A, 'a'));
lks.Add(new KeyStruct(Key.B, 'b')); lks.Add(new KeyStruct(Corekey.B, 'b'));
lks.Add(new KeyStruct(Key.C, 'c')); lks.Add(new KeyStruct(Corekey.C, 'c'));
lks.Add(new KeyStruct(Key.D, 'd')); lks.Add(new KeyStruct(Corekey.D, 'd'));
lks.Add(new KeyStruct(Key.E, 'e')); lks.Add(new KeyStruct(Corekey.E, 'e'));
lks.Add(new KeyStruct(Key.F, 'f')); lks.Add(new KeyStruct(Corekey.F, 'f'));
lks.Add(new KeyStruct(Key.G, 'g')); lks.Add(new KeyStruct(Corekey.G, 'g'));
lks.Add(new KeyStruct(Key.H, 'h')); lks.Add(new KeyStruct(Corekey.H, 'h'));
lks.Add(new KeyStruct(Key.I, 'i')); lks.Add(new KeyStruct(Corekey.I, 'i'));
lks.Add(new KeyStruct(Key.J, 'j')); lks.Add(new KeyStruct(Corekey.J, 'j'));
lks.Add(new KeyStruct(Key.K, 'k')); lks.Add(new KeyStruct(Corekey.K, 'k'));
lks.Add(new KeyStruct(Key.L, 'l')); lks.Add(new KeyStruct(Corekey.L, 'l'));
lks.Add(new KeyStruct(Key.M, 'm')); lks.Add(new KeyStruct(Corekey.M, 'm'));
lks.Add(new KeyStruct(Key.N, 'n')); lks.Add(new KeyStruct(Corekey.N, 'n'));
lks.Add(new KeyStruct(Key.O, 'o')); lks.Add(new KeyStruct(Corekey.O, 'o'));
lks.Add(new KeyStruct(Key.P, 'p')); lks.Add(new KeyStruct(Corekey.P, 'p'));
lks.Add(new KeyStruct(Key.Q, 'q')); lks.Add(new KeyStruct(Corekey.Q, 'q'));
lks.Add(new KeyStruct(Key.R, 'r')); lks.Add(new KeyStruct(Corekey.R, 'r'));
lks.Add(new KeyStruct(Key.S, 's')); lks.Add(new KeyStruct(Corekey.S, 's'));
lks.Add(new KeyStruct(Key.T, 't')); lks.Add(new KeyStruct(Corekey.T, 't'));
lks.Add(new KeyStruct(Key.U, 'u')); lks.Add(new KeyStruct(Corekey.U, 'u'));
lks.Add(new KeyStruct(Key.V, 'v')); lks.Add(new KeyStruct(Corekey.V, 'v'));
lks.Add(new KeyStruct(Key.W, 'w')); lks.Add(new KeyStruct(Corekey.W, 'w'));
lks.Add(new KeyStruct(Key.X, 'x')); lks.Add(new KeyStruct(Corekey.X, 'x'));
lks.Add(new KeyStruct(Key.Y, 'y')); lks.Add(new KeyStruct(Corekey.Y, 'y'));
lks.Add(new KeyStruct(Key.Z, 'z')); lks.Add(new KeyStruct(Corekey.Z, 'z'));
} }
} }
} }

View File

@ -14,11 +14,11 @@ namespace mame
mKeyboard = ikb; mKeyboard = ikb;
} }
public static bool IsPressed(Key key) public static bool IsPressed(Corekey key)
{ {
return mKeyboard.IsPressed(key); return mKeyboard.IsPressed(key);
} }
public static bool IsTriggered(Key key) public static bool IsTriggered(Corekey key)
{ {
return mKeyboard.IsTriggered(key); return mKeyboard.IsTriggered(key);
} }

View File

@ -1,7 +1,6 @@
using MAME.Core.Common; using MAME.Core.Common;
using MAME.Core.run_interface; using MAME.Core.run_interface;
using System.IO; using System.IO;
using System.Threading;
namespace mame namespace mame
{ {
@ -181,7 +180,7 @@ namespace mame
{ {
Video.sDrawText = "Select position to save to"; Video.sDrawText = "Select position to save to";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000;
if (Keyboard.IsTriggered(Key.Escape)) if (Keyboard.IsTriggered(Corekey.Escape))
{ {
Video.sDrawText = "Save cancelled"; Video.sDrawText = "Save cancelled";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
@ -190,30 +189,6 @@ namespace mame
Motion.motion_handler_callback = Motion.handler_ingame; Motion.motion_handler_callback = Motion.handler_ingame;
return; return;
} }
char file;
foreach (Key key1 in Inptport.lk)
{
if (Keyboard.IsTriggered(key1))
{
file = Inptport.getcharbykey(key1);
if (!Directory.Exists("sta\\" + Machine.sName))
{
Directory.CreateDirectory("sta\\" + Machine.sName);
}
FileStream fs1 = new FileStream("sta\\" + Machine.sName + "\\" + file + ".sta", FileMode.Create);
BinaryWriter bw1 = new BinaryWriter(fs1);
State.savestate_callback(bw1);
bw1.Close();
fs1.Close();
Video.sDrawText = "Save to position " + file;
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
playState = PlayState.PLAY_RUNNING;
Motion.motion_handler_callback = Motion.handler_ingame;
Thread.Sleep(500);
mame_pause(false);
return;
}
}
} }
} }
private static void handle_load() private static void handle_load()
@ -224,7 +199,7 @@ namespace mame
{ {
Video.sDrawText = "Select position to load from"; Video.sDrawText = "Select position to load from";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000;
if (Keyboard.IsTriggered(Key.Escape)) if (Keyboard.IsTriggered(Corekey.Escape))
{ {
Video.sDrawText = "Load cancelled"; Video.sDrawText = "Load cancelled";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
@ -233,43 +208,6 @@ namespace mame
Motion.motion_handler_callback = Motion.handler_ingame; Motion.motion_handler_callback = Motion.handler_ingame;
return; return;
} }
char file;
foreach (Key key1 in Inptport.lk)
{
if (Keyboard.IsTriggered(key1))
{
file = Inptport.getcharbykey(key1);
if (!File.Exists("sta\\" + Machine.sName + "\\" + file + ".sta"))
{
Video.sDrawText = "Load fail";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
playState = PlayState.PLAY_RUNNING;
Thread.Sleep(500);
mame_pause(false);
Motion.motion_handler_callback = Motion.handler_ingame;
return;
}
FileStream fs1 = new FileStream("sta\\" + Machine.sName + "\\" + file + ".sta", FileMode.Open);
BinaryReader br1 = new BinaryReader(fs1);
State.loadstate_callback(br1);
br1.Close();
fs1.Close();
postload();
Video.sDrawText = "Load from position " + file;
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
/*FileStream fs2 = new FileStream(@"\VS2008\compare1\compare1\bin\Debug\sta1\" + Machine.sName + "\\" + file + ".sta", FileMode.Create);
BinaryWriter bw1 = new BinaryWriter(fs2);
State.savestate_callback(bw1);
bw1.Close();
fs2.Close();
return;*/
playState = PlayState.PLAY_RUNNING;
Motion.motion_handler_callback = Motion.handler_ingame;
Thread.Sleep(500);
mame_pause(false);
return;
}
}
} }
} }
private static void handle_record() private static void handle_record()
@ -282,7 +220,7 @@ namespace mame
{ {
Video.sDrawText = "Select position to record to"; Video.sDrawText = "Select position to record to";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000;
if (Keyboard.IsTriggered(Key.Escape)) if (Keyboard.IsTriggered(Corekey.Escape))
{ {
Video.sDrawText = "Record cancelled"; Video.sDrawText = "Record cancelled";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
@ -291,39 +229,6 @@ namespace mame
Motion.motion_handler_callback = Motion.handler_ingame; Motion.motion_handler_callback = Motion.handler_ingame;
return; return;
} }
char file;
foreach (Key key1 in Inptport.lk)
{
if (Keyboard.IsTriggered(key1))
{
file = Inptport.getcharbykey(key1);
if (!Directory.Exists("inp\\" + Machine.sName))
{
Directory.CreateDirectory("inp\\" + Machine.sName);
}
FileStream fs1 = new FileStream("inp\\" + Machine.sName + "\\" + file + ".sta", FileMode.Create);
BinaryWriter bw1 = new BinaryWriter(fs1);
State.savestate_callback(bw1);
bw1.Close();
fs1.Close();
if (bwRecord != null)
{
bwRecord.Close();
bwRecord = null;
}
FileStream fs2 = new FileStream("inp\\" + Machine.sName + "\\" + file + ".inp", FileMode.Create);
bwRecord = new BinaryWriter(fs2);
Memory.memory_reset2();
Inptport.record_port_callback();
Video.sDrawText = "Record to position " + file;
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
playState = PlayState.PLAY_RECORDRUNNING;
Motion.motion_handler_callback = Motion.handler_ingame;
Thread.Sleep(500);
mame_pause(false);
return;
}
}
} }
else if (playState == PlayState.PLAY_RECORDEND) else if (playState == PlayState.PLAY_RECORDEND)
{ {
@ -345,7 +250,7 @@ namespace mame
{ {
Video.sDrawText = "Select position to replay from"; Video.sDrawText = "Select position to replay from";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 1000;
if (Keyboard.IsTriggered(Key.Escape)) if (Keyboard.IsTriggered(Corekey.Escape))
{ {
Video.sDrawText = "Replay cancelled"; Video.sDrawText = "Replay cancelled";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2; Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
@ -354,63 +259,6 @@ namespace mame
Motion.motion_handler_callback = Motion.handler_ingame; Motion.motion_handler_callback = Motion.handler_ingame;
return; return;
} }
char file;
foreach (Key key1 in Inptport.lk)
{
if (Keyboard.IsTriggered(key1))
{
file = Inptport.getcharbykey(key1);
if (!File.Exists("inp\\" + Machine.sName + "\\" + file + ".sta") || !File.Exists("inp\\" + Machine.sName + "\\" + file + ".inp"))
{
Video.sDrawText = "Replay fail";
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
playState = PlayState.PLAY_RUNNING;
Thread.Sleep(500);
mame_pause(false);
Motion.motion_handler_callback = Motion.handler_ingame;
return;
}
if (bwRecord != null)
{
bwRecord.Close();
bwRecord = null;
}
if (fsRecord != null)
{
fsRecord.Close();
fsRecord = null;
}
if (brRecord != null)
{
brRecord.Close();
brRecord = null;
}
FileStream fs1 = new FileStream("inp\\" + Machine.sName + "\\" + file + ".sta", FileMode.Open);
BinaryReader br1 = new BinaryReader(fs1);
State.loadstate_callback(br1);
br1.Close();
fs1.Close();
postload();
/*FileStream fs2 = new FileStream(@"\VS2008\compare1\compare1\bin\Debug\inp1\" + Machine.sName + "\\" + file + ".sta", FileMode.Create);
BinaryWriter bw1 = new BinaryWriter(fs2);
State.savestate_callback(bw1);
bw1.Close();
fs2.Close();
return;*/
fsRecord = new FileStream("inp\\" + Machine.sName + "\\" + file + ".inp", FileMode.Open);
brRecord = new BinaryReader(fsRecord);
Memory.memory_reset();
Inptport.bReplayRead = true;
Inptport.replay_port_callback();
Video.sDrawText = "Replay from position " + file;
Video.popup_text_end = Wintime.osd_ticks() + Wintime.ticks_per_second * 2;
playState = PlayState.PLAY_REPLAYRUNNING;
Motion.motion_handler_callback = Motion.handler_ingame;
Thread.Sleep(500);
mame_pause(false);
return;
}
}
} }
} }
if (playState == PlayState.PLAY_REPLAYEND) if (playState == PlayState.PLAY_REPLAYEND)

View File

@ -194,15 +194,15 @@ namespace mame
} }
if (Mame.is_foreground) if (Mame.is_foreground)
{ {
if (Keyboard.IsPressed(Key.F3)) if (Keyboard.IsPressed(Corekey.F3))
{ {
cpurun(); cpurun();
Mame.playState = Mame.PlayState.PLAY_RESET; Mame.playState = Mame.PlayState.PLAY_RESET;
} }
if (Keyboard.IsTriggered(Key.F7)) if (Keyboard.IsTriggered(Corekey.F7))
{ {
cpurun(); cpurun();
if (Keyboard.IsPressed(Key.LeftShift) || Keyboard.IsPressed(Key.RightShift)) if (Keyboard.IsPressed(Corekey.LeftShift) || Keyboard.IsPressed(Corekey.RightShift))
{ {
Mame.playState = Mame.PlayState.PLAY_SAVE; Mame.playState = Mame.PlayState.PLAY_SAVE;
} }
@ -212,10 +212,10 @@ namespace mame
} }
return; return;
} }
if (Keyboard.IsTriggered(Key.F8)) if (Keyboard.IsTriggered(Corekey.F8))
{ {
cpurun(); cpurun();
if (Keyboard.IsPressed(Key.LeftShift) || Keyboard.IsPressed(Key.RightShift)) if (Keyboard.IsPressed(Corekey.LeftShift) || Keyboard.IsPressed(Corekey.RightShift))
{ {
if (Mame.playState == Mame.PlayState.PLAY_RECORDRUNNING) if (Mame.playState == Mame.PlayState.PLAY_RECORDRUNNING)
{ {
@ -232,9 +232,9 @@ namespace mame
} }
return; return;
} }
if (Keyboard.IsTriggered(Key.P)) if (Keyboard.IsTriggered(Corekey.P))
{ {
if (is_paused && (Keyboard.IsPressed(Key.LeftShift) || Keyboard.IsPressed(Key.RightShift))) if (is_paused && (Keyboard.IsPressed(Corekey.LeftShift) || Keyboard.IsPressed(Corekey.RightShift)))
{ {
single_step = true; single_step = true;
Mame.mame_pause(false); Mame.mame_pause(false);
@ -244,7 +244,7 @@ namespace mame
Mame.mame_pause(!Mame.mame_is_paused()); Mame.mame_pause(!Mame.mame_is_paused());
} }
} }
if (Keyboard.IsTriggered(Key.F10)) if (Keyboard.IsTriggered(Corekey.F10))
{ {
Keyboard.bF10 = true; Keyboard.bF10 = true;
bool b1 = Video.global_throttle; bool b1 = Video.global_throttle;

View File

@ -1,7 +1,6 @@
using MAME.Core.run_interface; using MAME.Core.run_interface;
using System; using System;
using System.IO; using System.IO;
using Bitmap = MAME.Core.AxiBitmap.AxiBitmap;
namespace mame namespace mame
{ {
@ -42,8 +41,6 @@ namespace mame
public static int fullwidth, fullheight; public static int fullwidth, fullheight;
public static bool global_throttle; public static bool global_throttle;
public static int scanline_param; public static int scanline_param;
private static Bitmap bitmapGDI;
private static Bitmap[] bbmp;
public static RECT new_clip; public static RECT new_clip;
public static int curbitmap; public static int curbitmap;
public static string sDrawText; public static string sDrawText;
@ -109,15 +106,10 @@ namespace mame
frame_update_time = new Atime(0, (long)(1e18 / 59.61));//59.61Hz frame_update_time = new Atime(0, (long)(1e18 / 59.61));//59.61Hz
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
Motion.motion_update_callback = Motion.ui_updateC; Motion.motion_update_callback = Motion.ui_updateC;
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200]; bitmapbase[0] = new ushort[0x200 * 0x200];
bitmapbase[1] = new ushort[0x200 * 0x200]; bitmapbase[1] = new ushort[0x200 * 0x200];
bbmp = new Bitmap[3];
bbmp[0] = new Bitmap(512, 512);
bbmp[1] = new Bitmap(512, 256);
bbmp[2] = new Bitmap(384, 224);
video_update_callback = CPS.video_update_cps1; video_update_callback = CPS.video_update_cps1;
video_eof_callback = CPS.video_eof_cps1; video_eof_callback = CPS.video_eof_cps1;
break; break;
@ -133,15 +125,10 @@ namespace mame
frame_update_time = new Atime(0, (long)(1e18 / 8000000) * 512 * 262);//59.637404580152669Hz frame_update_time = new Atime(0, (long)(1e18 / 8000000) * 512 * 262);//59.637404580152669Hz
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
Motion.motion_update_callback = Motion.ui_updateC; Motion.motion_update_callback = Motion.ui_updateC;
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200]; bitmapbase[0] = new ushort[0x200 * 0x200];
bitmapbase[1] = new ushort[0x200 * 0x200]; bitmapbase[1] = new ushort[0x200 * 0x200];
bbmp = new Bitmap[3];
bbmp[0] = new Bitmap(512, 512);
bbmp[1] = new Bitmap(512, 256);
bbmp[2] = new Bitmap(384, 224);
video_update_callback = CPS.video_update_cps1; video_update_callback = CPS.video_update_cps1;
video_eof_callback = CPS.video_eof_cps1; video_eof_callback = CPS.video_eof_cps1;
break; break;
@ -157,13 +144,10 @@ namespace mame
frame_update_time = new Atime(0, (long)(1e18 / 60)); frame_update_time = new Atime(0, (long)(1e18 / 60));
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
Motion.motion_update_callback = Motion.ui_updateC; Motion.motion_update_callback = Motion.ui_updateC;
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x100 * 0x100]; bitmapbase[0] = new ushort[0x100 * 0x100];
bitmapbase[1] = new ushort[0x100 * 0x100]; bitmapbase[1] = new ushort[0x100 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(256, 256);
video_update_callback = Dataeast.video_update_pcktgal; video_update_callback = Dataeast.video_update_pcktgal;
video_eof_callback = Dataeast.video_eof_pcktgal; video_eof_callback = Dataeast.video_eof_pcktgal;
switch (Machine.sName) switch (Machine.sName)
@ -190,13 +174,10 @@ namespace mame
frame_update_time = new Atime(0, (long)(1e18 / 60)); frame_update_time = new Atime(0, (long)(1e18 / 60));
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
Motion.motion_update_callback = Motion.ui_updateTehkan; Motion.motion_update_callback = Motion.ui_updateTehkan;
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x100 * 0x100]; bitmapbase[0] = new ushort[0x100 * 0x100];
bitmapbase[1] = new ushort[0x100 * 0x100]; bitmapbase[1] = new ushort[0x100 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(256, 256);
video_update_callback = Tehkan.video_update_pbaction; video_update_callback = Tehkan.video_update_pbaction;
video_eof_callback = Tehkan.video_eof_pbaction; video_eof_callback = Tehkan.video_eof_pbaction;
break; break;
@ -216,8 +197,6 @@ namespace mame
bitmapbaseN = new int[2][]; bitmapbaseN = new int[2][];
bitmapbaseN[0] = new int[384 * 264]; bitmapbaseN[0] = new int[384 * 264];
bitmapbaseN[1] = new int[384 * 264]; bitmapbaseN[1] = new int[384 * 264];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(320, 224);
video_update_callback = Neogeo.video_update_neogeo; video_update_callback = Neogeo.video_update_neogeo;
video_eof_callback = Neogeo.video_eof_neogeo; video_eof_callback = Neogeo.video_eof_neogeo;
break; break;
@ -237,8 +216,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x100 * 0x100]; bitmapbase[0] = new ushort[0x100 * 0x100];
bitmapbase[1] = new ushort[0x100 * 0x100]; bitmapbase[1] = new ushort[0x100 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(256, 224);
video_update_callback = SunA8.video_update_suna8; video_update_callback = SunA8.video_update_suna8;
video_eof_callback = SunA8.video_eof_suna8; video_eof_callback = SunA8.video_eof_suna8;
break; break;
@ -255,13 +232,9 @@ namespace mame
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
Motion.motion_update_callback = Motion.ui_updateNa; Motion.motion_update_callback = Motion.ui_updateNa;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200]; bitmapbase[0] = new ushort[0x200 * 0x200];
bitmapbase[1] = new ushort[0x200 * 0x200]; bitmapbase[1] = new ushort[0x200 * 0x200];
bbmp = new Bitmap[2];
bbmp[0] = new Bitmap(512, 512);
bbmp[1] = new Bitmap(288, 224);
video_update_callback = Namcos1.video_update_namcos1; video_update_callback = Namcos1.video_update_namcos1;
video_eof_callback = Namcos1.video_eof_namcos1; video_eof_callback = Namcos1.video_eof_namcos1;
break; break;
@ -278,12 +251,9 @@ namespace mame
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
Motion.motion_update_callback = Motion.ui_updateIGS011; Motion.motion_update_callback = Motion.ui_updateIGS011;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200]; bitmapbase[0] = new ushort[0x200 * 0x200];
bitmapbase[1] = new ushort[0x200 * 0x200]; bitmapbase[1] = new ushort[0x200 * 0x200];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(512, 240);
video_update_callback = IGS011.video_update_igs011; video_update_callback = IGS011.video_update_igs011;
video_eof_callback = IGS011.video_eof_igs011; video_eof_callback = IGS011.video_eof_igs011;
break; break;
@ -300,12 +270,9 @@ namespace mame
screenstate.vblank_period = 0; screenstate.vblank_period = 0;
video_attributes = 0; video_attributes = 0;
Motion.motion_update_callback = Motion.ui_updatePGM; Motion.motion_update_callback = Motion.ui_updatePGM;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200]; bitmapbase[0] = new ushort[0x200 * 0x200];
bitmapbase[1] = new ushort[0x200 * 0x200]; bitmapbase[1] = new ushort[0x200 * 0x200];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(448, 224);
video_update_callback = PGM.video_update_pgm; video_update_callback = PGM.video_update_pgm;
video_eof_callback = PGM.video_eof_pgm; video_eof_callback = PGM.video_eof_pgm;
break; break;
@ -325,8 +292,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200];//0x11c bitmapbase[0] = new ushort[0x200 * 0x200];//0x11c
bitmapbase[1] = new ushort[0x200 * 0x200];//0x11c bitmapbase[1] = new ushort[0x200 * 0x200];//0x11c
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(512, 284);
video_update_callback = M72.video_update_m72; video_update_callback = M72.video_update_m72;
video_eof_callback = M72.video_eof_m72; video_eof_callback = M72.video_eof_m72;
break; break;
@ -346,8 +311,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x200]; bitmapbase[0] = new ushort[0x200 * 0x200];
bitmapbase[1] = new ushort[0x200 * 0x200]; bitmapbase[1] = new ushort[0x200 * 0x200];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(0x200, 0x100);
video_update_callback = M92.video_update_m92; video_update_callback = M92.video_update_m92;
video_eof_callback = M92.video_eof_m92; video_eof_callback = M92.video_eof_m92;
break; break;
@ -391,8 +354,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x100 * 0x100]; bitmapbase[0] = new ushort[0x100 * 0x100];
bitmapbase[1] = new ushort[0x100 * 0x100]; bitmapbase[1] = new ushort[0x100 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(256, 224);
video_update_callback = Taito.video_update_bublbobl; video_update_callback = Taito.video_update_bublbobl;
video_eof_callback = Taito.video_eof_taito; video_eof_callback = Taito.video_eof_taito;
break; break;
@ -415,8 +376,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x140 * 0x100]; bitmapbase[0] = new ushort[0x140 * 0x100];
bitmapbase[1] = new ushort[0x140 * 0x100]; bitmapbase[1] = new ushort[0x140 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(320, 240);
video_update_callback = Taito.video_update_opwolf; video_update_callback = Taito.video_update_opwolf;
video_eof_callback = Taito.video_eof_taito; video_eof_callback = Taito.video_eof_taito;
break; break;
@ -438,8 +397,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x100]; bitmapbase[0] = new ushort[0x200 * 0x100];
bitmapbase[1] = new ushort[0x200 * 0x100]; bitmapbase[1] = new ushort[0x200 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(320, 224);
video_update_callback = Taitob.video_update_taitob; video_update_callback = Taitob.video_update_taitob;
video_eof_callback = Taitob.video_eof_taitob; video_eof_callback = Taitob.video_eof_taitob;
break; break;
@ -455,8 +412,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x100]; bitmapbase[0] = new ushort[0x200 * 0x100];
bitmapbase[1] = new ushort[0x200 * 0x100]; bitmapbase[1] = new ushort[0x200 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(288, 224);
video_eof_callback = Konami68000.video_eof; video_eof_callback = Konami68000.video_eof;
switch (Machine.sName) switch (Machine.sName)
{ {
@ -607,8 +562,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x100 * 0x100]; bitmapbase[0] = new ushort[0x100 * 0x100];
bitmapbase[1] = new ushort[0x100 * 0x100]; bitmapbase[1] = new ushort[0x100 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(256, 224);
video_update_callback = Capcom.video_update_gng; video_update_callback = Capcom.video_update_gng;
video_eof_callback = Capcom.video_eof_gng; video_eof_callback = Capcom.video_eof_gng;
break; break;
@ -633,8 +586,6 @@ namespace mame
bitmapbase = new ushort[2][]; bitmapbase = new ushort[2][];
bitmapbase[0] = new ushort[0x200 * 0x100]; bitmapbase[0] = new ushort[0x200 * 0x100];
bitmapbase[1] = new ushort[0x200 * 0x100]; bitmapbase[1] = new ushort[0x200 * 0x100];
bbmp = new Bitmap[1];
bbmp[0] = new Bitmap(384, 224);
video_update_callback = Capcom.video_update_sf; video_update_callback = Capcom.video_update_sf;
video_eof_callback = Capcom.video_eof; video_eof_callback = Capcom.video_eof;
break; break;
@ -645,7 +596,6 @@ namespace mame
screenstate.scantime = screenstate.frame_period / screenstate.height; screenstate.scantime = screenstate.frame_period / screenstate.height;
screenstate.pixeltime = screenstate.frame_period / (screenstate.height * screenstate.width); screenstate.pixeltime = screenstate.frame_period / (screenstate.height * screenstate.width);
screenstate.frame_number = 0; screenstate.frame_number = 0;
bitmapGDI = new Bitmap(Video.fullwidth, Video.fullheight);
bitmapcolor = new int[Video.fullwidth * Video.fullheight]; bitmapcolor = new int[Video.fullwidth * Video.fullheight];
vblank_begin_timer = Timer.timer_alloc_common(vblank_begin_callback, "vblank_begin_callback", false); vblank_begin_timer = Timer.timer_alloc_common(vblank_begin_callback, "vblank_begin_callback", false);
Timer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER); Timer.timer_adjust_periodic(vblank_begin_timer, video_screen_get_time_until_vblank_start(), Attotime.ATTOTIME_NEVER);

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_gng() public static void loop_inputports_gng()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
bytes &= unchecked((byte)~0x40); bytes &= unchecked((byte)~0x40);
} }
@ -14,7 +14,7 @@ namespace mame
{ {
bytes |= 0x40; bytes |= 0x40;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
bytes &= unchecked((byte)~0x80); bytes &= unchecked((byte)~0x80);
} }
@ -22,7 +22,7 @@ namespace mame
{ {
bytes |= 0x80; bytes |= 0x80;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
bytes &= unchecked((byte)~0x01); bytes &= unchecked((byte)~0x01);
} }
@ -30,7 +30,7 @@ namespace mame
{ {
bytes |= 0x01; bytes |= 0x01;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
bytes &= unchecked((byte)~0x02); bytes &= unchecked((byte)~0x02);
} }
@ -38,7 +38,7 @@ namespace mame
{ {
bytes |= 0x02; bytes |= 0x02;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
@ -46,7 +46,7 @@ namespace mame
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte1 &= unchecked((byte)~0x02); byte1 &= unchecked((byte)~0x02);
} }
@ -54,7 +54,7 @@ namespace mame
{ {
byte1 |= 0x02; byte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte1 &= unchecked((byte)~0x04); byte1 &= unchecked((byte)~0x04);
} }
@ -62,7 +62,7 @@ namespace mame
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
@ -70,7 +70,7 @@ namespace mame
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
@ -78,7 +78,7 @@ namespace mame
{ {
byte1 |= 0x10; byte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte1 &= unchecked((byte)~0x20); byte1 &= unchecked((byte)~0x20);
} }
@ -86,7 +86,7 @@ namespace mame
{ {
byte1 |= 0x20; byte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte2 &= unchecked((byte)~0x01); byte2 &= unchecked((byte)~0x01);
} }
@ -94,7 +94,7 @@ namespace mame
{ {
byte2 |= 0x01; byte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte2 &= unchecked((byte)~0x02); byte2 &= unchecked((byte)~0x02);
} }
@ -102,7 +102,7 @@ namespace mame
{ {
byte2 |= 0x02; byte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte2 &= unchecked((byte)~0x04); byte2 &= unchecked((byte)~0x04);
} }
@ -110,7 +110,7 @@ namespace mame
{ {
byte2 |= 0x04; byte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -118,7 +118,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -126,7 +126,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }
@ -134,7 +134,7 @@ namespace mame
{ {
byte2 |= 0x20; byte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
bytes &= unchecked((byte)~0x20); bytes &= unchecked((byte)~0x20);
} }
@ -145,7 +145,7 @@ namespace mame
} }
public static void loop_inputports_diamond() public static void loop_inputports_diamond()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
bytes &= unchecked((byte)~0x40); bytes &= unchecked((byte)~0x40);
} }
@ -153,7 +153,7 @@ namespace mame
{ {
bytes |= 0x40; bytes |= 0x40;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
bytes &= unchecked((byte)~0x80); bytes &= unchecked((byte)~0x80);
} }
@ -161,7 +161,7 @@ namespace mame
{ {
bytes |= 0x80; bytes |= 0x80;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
bytes &= unchecked((byte)~0x01); bytes &= unchecked((byte)~0x01);
} }
@ -169,7 +169,7 @@ namespace mame
{ {
bytes |= 0x01; bytes |= 0x01;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
bytes &= unchecked((byte)~0x02); bytes &= unchecked((byte)~0x02);
} }
@ -177,7 +177,7 @@ namespace mame
{ {
bytes |= 0x02; bytes |= 0x02;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
@ -185,7 +185,7 @@ namespace mame
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte1 &= unchecked((byte)~0x02); byte1 &= unchecked((byte)~0x02);
} }
@ -193,7 +193,7 @@ namespace mame
{ {
byte1 |= 0x02; byte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte1 &= unchecked((byte)~0x04); byte1 &= unchecked((byte)~0x04);
} }
@ -201,7 +201,7 @@ namespace mame
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
@ -209,7 +209,7 @@ namespace mame
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
@ -220,7 +220,7 @@ namespace mame
} }
public static void loop_inputports_sfus() public static void loop_inputports_sfus()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
short0 &= ~0x0001; short0 &= ~0x0001;
} }
@ -228,7 +228,7 @@ namespace mame
{ {
short0 |= 0x0001; short0 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
short0 &= ~0x0002; short0 &= ~0x0002;
} }
@ -236,7 +236,7 @@ namespace mame
{ {
short0 |= 0x0002; short0 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
shorts &= ~0x0001; shorts &= ~0x0001;
} }
@ -244,7 +244,7 @@ namespace mame
{ {
shorts |= 0x0001; shorts |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
shorts &= ~0x0002; shorts &= ~0x0002;
} }
@ -252,7 +252,7 @@ namespace mame
{ {
shorts |= 0x0002; shorts |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
short1 &= ~0x0001; short1 &= ~0x0001;
} }
@ -260,7 +260,7 @@ namespace mame
{ {
short1 |= 0x0001; short1 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
short1 &= ~0x0002; short1 &= ~0x0002;
} }
@ -268,7 +268,7 @@ namespace mame
{ {
short1 |= 0x0002; short1 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
short1 &= ~0x0004; short1 &= ~0x0004;
} }
@ -276,7 +276,7 @@ namespace mame
{ {
short1 |= 0x0004; short1 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
short1 &= ~0x0008; short1 &= ~0x0008;
} }
@ -284,7 +284,7 @@ namespace mame
{ {
short1 |= 0x0008; short1 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
short1 &= ~0x0010; short1 &= ~0x0010;
} }
@ -292,7 +292,7 @@ namespace mame
{ {
short1 |= 0x0010; short1 |= 0x0010;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
short1 &= ~0x0020; short1 &= ~0x0020;
} }
@ -300,7 +300,7 @@ namespace mame
{ {
short1 |= 0x0020; short1 |= 0x0020;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
short0 &= ~0x0200; short0 &= ~0x0200;
} }
@ -308,7 +308,7 @@ namespace mame
{ {
short0 |= 0x0200; short0 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
short1 &= ~0x0040; short1 &= ~0x0040;
} }
@ -316,7 +316,7 @@ namespace mame
{ {
short1 |= 0x0040; short1 |= 0x0040;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
short1 &= ~0x0080; short1 &= ~0x0080;
} }
@ -324,7 +324,7 @@ namespace mame
{ {
short1 |= 0x0080; short1 |= 0x0080;
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
short0 &= ~0x0004; short0 &= ~0x0004;
} }
@ -332,7 +332,7 @@ namespace mame
{ {
short0 |= 0x0004; short0 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
short1 &= ~0x0100; short1 &= ~0x0100;
} }
@ -340,7 +340,7 @@ namespace mame
{ {
short1 |= 0x0100; short1 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
short1 &= ~0x0200; short1 &= ~0x0200;
} }
@ -348,7 +348,7 @@ namespace mame
{ {
short1 |= 0x0200; short1 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
short1 &= ~0x0400; short1 &= ~0x0400;
} }
@ -356,7 +356,7 @@ namespace mame
{ {
short1 |= 0x0400; short1 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
short1 &= ~0x0800; short1 &= ~0x0800;
} }
@ -364,7 +364,7 @@ namespace mame
{ {
short1 |= 0x0800; short1 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
short1 &= ~0x1000; short1 &= ~0x1000;
} }
@ -372,7 +372,7 @@ namespace mame
{ {
short1 |= 0x1000; short1 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
short1 &= ~0x2000; short1 &= ~0x2000;
} }
@ -380,7 +380,7 @@ namespace mame
{ {
short1 |= 0x2000; short1 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
short0 &= ~0x0400; short0 &= ~0x0400;
} }
@ -388,7 +388,7 @@ namespace mame
{ {
short0 |= 0x0400; short0 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
short1 &= ~0x4000; short1 &= ~0x4000;
} }
@ -396,7 +396,7 @@ namespace mame
{ {
short1 |= 0x4000; short1 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
short1 &= unchecked((short)~0x8000); short1 &= unchecked((short)~0x8000);
} }
@ -404,7 +404,7 @@ namespace mame
{ {
short1 |= unchecked((short)0x8000); short1 |= unchecked((short)0x8000);
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
short0 &= ~0x0100; short0 &= ~0x0100;
} }
@ -412,7 +412,7 @@ namespace mame
{ {
short0 |= 0x0100; short0 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
shorts &= ~0x0004; shorts &= ~0x0004;
} }
@ -420,7 +420,7 @@ namespace mame
{ {
shorts |= 0x0004; shorts |= 0x0004;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
//sbyte0 &= ~0x40; //sbyte0 &= ~0x40;
} }
@ -431,7 +431,7 @@ namespace mame
} }
public static void loop_inputports_sfjp() public static void loop_inputports_sfjp()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
shortc &= ~0x0001; shortc &= ~0x0001;
} }
@ -439,7 +439,7 @@ namespace mame
{ {
shortc |= 0x0001; shortc |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
shortc &= ~0x0002; shortc &= ~0x0002;
} }
@ -447,7 +447,7 @@ namespace mame
{ {
shortc |= 0x0002; shortc |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
shorts &= ~0x0001; shorts &= ~0x0001;
} }
@ -455,7 +455,7 @@ namespace mame
{ {
shorts |= 0x0001; shorts |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
shorts &= ~0x0002; shorts &= ~0x0002;
} }
@ -463,7 +463,7 @@ namespace mame
{ {
shorts |= 0x0002; shorts |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
short1 &= ~0x0001; short1 &= ~0x0001;
} }
@ -471,7 +471,7 @@ namespace mame
{ {
short1 |= 0x0001; short1 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
short1 &= ~0x0002; short1 &= ~0x0002;
} }
@ -479,7 +479,7 @@ namespace mame
{ {
short1 |= 0x0002; short1 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
short1 &= ~0x0004; short1 &= ~0x0004;
} }
@ -487,7 +487,7 @@ namespace mame
{ {
short1 |= 0x0004; short1 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
short1 &= ~0x0008; short1 &= ~0x0008;
} }
@ -495,7 +495,7 @@ namespace mame
{ {
short1 |= 0x0008; short1 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
short1 &= ~0x0100; short1 &= ~0x0100;
} }
@ -503,7 +503,7 @@ namespace mame
{ {
short1 |= 0x0100; short1 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
short1 &= ~0x0200; short1 &= ~0x0200;
} }
@ -511,7 +511,7 @@ namespace mame
{ {
short1 |= 0x0200; short1 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
short1 &= ~0x0400; short1 &= ~0x0400;
} }
@ -519,7 +519,7 @@ namespace mame
{ {
short1 |= 0x0400; short1 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
short1 &= ~0x1000; short1 &= ~0x1000;
} }
@ -527,7 +527,7 @@ namespace mame
{ {
short1 |= 0x1000; short1 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
short1 &= ~0x2000; short1 &= ~0x2000;
} }
@ -535,7 +535,7 @@ namespace mame
{ {
short1 |= 0x2000; short1 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
short1 &= ~0x4000; short1 &= ~0x4000;
} }
@ -543,7 +543,7 @@ namespace mame
{ {
short1 |= 0x4000; short1 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
short2 &= ~0x0001; short2 &= ~0x0001;
} }
@ -551,7 +551,7 @@ namespace mame
{ {
short2 |= 0x0001; short2 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
short2 &= ~0x0002; short2 &= ~0x0002;
} }
@ -559,7 +559,7 @@ namespace mame
{ {
short2 |= 0x0002; short2 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
short2 &= ~0x0004; short2 &= ~0x0004;
} }
@ -567,7 +567,7 @@ namespace mame
{ {
short2 |= 0x0004; short2 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
short2 &= ~0x0008; short2 &= ~0x0008;
} }
@ -575,7 +575,7 @@ namespace mame
{ {
short2 |= 0x0008; short2 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
short2 &= ~0x0100; short2 &= ~0x0100;
} }
@ -583,7 +583,7 @@ namespace mame
{ {
short2 |= 0x0100; short2 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
short2 &= ~0x0200; short2 &= ~0x0200;
} }
@ -591,7 +591,7 @@ namespace mame
{ {
short2 |= 0x0200; short2 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
short2 &= ~0x0400; short2 &= ~0x0400;
} }
@ -599,7 +599,7 @@ namespace mame
{ {
short2 |= 0x0400; short2 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
short2 &= ~0x1000; short2 &= ~0x1000;
} }
@ -607,7 +607,7 @@ namespace mame
{ {
short2 |= 0x1000; short2 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
short2 &= ~0x2000; short2 &= ~0x2000;
} }
@ -615,7 +615,7 @@ namespace mame
{ {
short2 |= 0x2000; short2 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
short2 &= ~0x4000; short2 &= ~0x4000;
} }
@ -623,7 +623,7 @@ namespace mame
{ {
short2 |= 0x4000; short2 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
shorts &= ~0x0004; shorts &= ~0x0004;
} }
@ -631,7 +631,7 @@ namespace mame
{ {
shorts |= 0x0004; shorts |= 0x0004;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
//sbyte0 &= ~0x40; //sbyte0 &= ~0x40;
} }
@ -642,7 +642,7 @@ namespace mame
} }
public static void loop_inputports_sfan() public static void loop_inputports_sfan()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
shortc &= ~0x0001; shortc &= ~0x0001;
} }
@ -650,7 +650,7 @@ namespace mame
{ {
shortc |= 0x0001; shortc |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
shortc &= ~0x0002; shortc &= ~0x0002;
} }
@ -658,7 +658,7 @@ namespace mame
{ {
shortc |= 0x0002; shortc |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
shorts &= ~0x0001; shorts &= ~0x0001;
} }
@ -666,7 +666,7 @@ namespace mame
{ {
shorts |= 0x0001; shorts |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
shorts &= ~0x0002; shorts &= ~0x0002;
} }
@ -674,7 +674,7 @@ namespace mame
{ {
shorts |= 0x0002; shorts |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
short0 &= ~0x0001; short0 &= ~0x0001;
} }
@ -682,7 +682,7 @@ namespace mame
{ {
short0 |= 0x0001; short0 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
short0 &= ~0x0002; short0 &= ~0x0002;
} }
@ -690,7 +690,7 @@ namespace mame
{ {
short0 |= 0x0002; short0 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
short0 &= ~0x0004; short0 &= ~0x0004;
} }
@ -698,7 +698,7 @@ namespace mame
{ {
short0 |= 0x0004; short0 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
short0 &= ~0x0008; short0 &= ~0x0008;
} }
@ -706,7 +706,7 @@ namespace mame
{ {
short0 |= 0x0008; short0 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
sbyte1 |= 0x01; sbyte1 |= 0x01;
} }
@ -714,7 +714,7 @@ namespace mame
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
sbyte1 |= 0x02; sbyte1 |= 0x02;
} }
@ -722,7 +722,7 @@ namespace mame
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
} }
@ -730,7 +730,7 @@ namespace mame
{ {
sbyte1 &= ~0x04; sbyte1 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
} }
@ -738,7 +738,7 @@ namespace mame
{ {
sbyte2 &= ~0x01; sbyte2 &= ~0x01;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
@ -746,7 +746,7 @@ namespace mame
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
sbyte2 |= 0x04; sbyte2 |= 0x04;
} }
@ -754,7 +754,7 @@ namespace mame
{ {
sbyte2 &= ~0x04; sbyte2 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
short0 &= ~0x0100; short0 &= ~0x0100;
} }
@ -762,7 +762,7 @@ namespace mame
{ {
short0 |= 0x0100; short0 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
short0 &= ~0x0200; short0 &= ~0x0200;
} }
@ -770,7 +770,7 @@ namespace mame
{ {
short0 |= 0x0200; short0 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
short0 &= ~0x0400; short0 &= ~0x0400;
} }
@ -778,7 +778,7 @@ namespace mame
{ {
short0 |= 0x0400; short0 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
short0 &= ~0x0800; short0 &= ~0x0800;
} }
@ -786,7 +786,7 @@ namespace mame
{ {
short0 |= 0x0800; short0 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte3 |= 0x01; sbyte3 |= 0x01;
} }
@ -794,7 +794,7 @@ namespace mame
{ {
sbyte3 &= ~0x01; sbyte3 &= ~0x01;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte3 |= 0x02; sbyte3 |= 0x02;
} }
@ -802,7 +802,7 @@ namespace mame
{ {
sbyte3 &= ~0x02; sbyte3 &= ~0x02;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
sbyte3 |= 0x04; sbyte3 |= 0x04;
} }
@ -810,7 +810,7 @@ namespace mame
{ {
sbyte3 &= ~0x04; sbyte3 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
sbyte4 |= 0x01; sbyte4 |= 0x01;
} }
@ -818,7 +818,7 @@ namespace mame
{ {
sbyte4 &= ~0x01; sbyte4 &= ~0x01;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
sbyte4 &= ~0x02; sbyte4 &= ~0x02;
} }
@ -826,7 +826,7 @@ namespace mame
{ {
sbyte4 |= 0x02; sbyte4 |= 0x02;
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
sbyte4 |= 0x04; sbyte4 |= 0x04;
} }
@ -834,7 +834,7 @@ namespace mame
{ {
sbyte4 &= ~0x04; sbyte4 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
shorts &= ~0x0004; shorts &= ~0x0004;
} }
@ -842,7 +842,7 @@ namespace mame
{ {
shorts |= 0x0004; shorts |= 0x0004;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
//sbyte0 &= ~0x40; //sbyte0 &= ~0x40;
} }

View File

@ -1,4 +1,4 @@
using Bitmap = MAME.Core.AxiBitmap.AxiBitmap; 
using Color = MAME.Core.AxiBitmap.AxiColor; using Color = MAME.Core.AxiBitmap.AxiColor;
namespace mame namespace mame
@ -29,8 +29,6 @@ namespace mame
private static int layercontrolG, scrollrows1G; private static int layercontrolG, scrollrows1G;
private static int[] rowscroll1G; private static int[] rowscroll1G;
public static int[] cps1_scrollxG, cps1_scrollyG; public static int[] cps1_scrollxG, cps1_scrollyG;
public delegate Bitmap gettileDelegateG();
public static gettileDelegateG[] gettileDelegatesG;
public delegate void gethighDelegateG(); public delegate void gethighDelegateG();
public static gethighDelegateG[] gethighDelegatesG; public static gethighDelegateG[] gethighDelegatesG;
public static void GDIInit() public static void GDIInit()
@ -45,11 +43,6 @@ namespace mame
rowscroll1G = new int[1024]; rowscroll1G = new int[1024];
cps1_scrollxG = new int[3]; cps1_scrollxG = new int[3];
cps1_scrollyG = new int[3]; cps1_scrollyG = new int[3];
gettileDelegatesG = new gettileDelegateG[]{
};
gethighDelegatesG = new gethighDelegateG[]{
null,
};
flagsmap0G = new byte[0x200, 0x200]; flagsmap0G = new byte[0x200, 0x200];
flagsmap1G = new byte[0x400, 0x400]; flagsmap1G = new byte[0x400, 0x400];
flagsmap2G = new byte[0x800, 0x800]; flagsmap2G = new byte[0x800, 0x800];

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ namespace mame
public static List<fr1> lfr = new List<fr1>(); public static List<fr1> lfr = new List<fr1>();
public static void loop_inputports_dataeast_pcktgal() public static void loop_inputports_dataeast_pcktgal()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -27,7 +27,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }
@ -35,7 +35,7 @@ namespace mame
{ {
byte2 |= 0x20; byte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
@ -43,7 +43,7 @@ namespace mame
{ {
byte1 |= 0x10; byte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte1 &= unchecked((byte)~0x20); byte1 &= unchecked((byte)~0x20);
} }
@ -51,7 +51,7 @@ namespace mame
{ {
byte1 |= 0x20; byte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
@ -59,7 +59,7 @@ namespace mame
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte1 &= unchecked((byte)~0x02); byte1 &= unchecked((byte)~0x02);
} }
@ -67,7 +67,7 @@ namespace mame
{ {
byte1 |= 0x02; byte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte1 &= unchecked((byte)~0x04); byte1 &= unchecked((byte)~0x04);
} }
@ -75,7 +75,7 @@ namespace mame
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
@ -83,7 +83,7 @@ namespace mame
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte1 &= unchecked((byte)~0x80); byte1 &= unchecked((byte)~0x80);
} }
@ -91,7 +91,7 @@ namespace mame
{ {
byte1 |= 0x80; byte1 |= 0x80;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte1 &= unchecked((byte)~0x40); byte1 &= unchecked((byte)~0x40);
} }
@ -99,7 +99,7 @@ namespace mame
{ {
byte1 |= 0x40; byte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte2 &= unchecked((byte)~0x01); byte2 &= unchecked((byte)~0x01);
} }
@ -107,7 +107,7 @@ namespace mame
{ {
byte2 |= 0x01; byte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte2 &= unchecked((byte)~0x02); byte2 &= unchecked((byte)~0x02);
} }
@ -115,7 +115,7 @@ namespace mame
{ {
byte2 |= 0x02; byte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte2 &= unchecked((byte)~0x04); byte2 &= unchecked((byte)~0x04);
} }
@ -123,7 +123,7 @@ namespace mame
{ {
byte2 |= 0x04; byte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -131,7 +131,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte2 &= unchecked((byte)~0x80); byte2 &= unchecked((byte)~0x80);
} }
@ -139,7 +139,7 @@ namespace mame
{ {
byte2 |= 0x80; byte2 |= 0x80;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte2 &= unchecked((byte)~0x40); byte2 &= unchecked((byte)~0x40);
} }
@ -147,7 +147,7 @@ namespace mame
{ {
byte2 |= 0x40; byte2 |= 0x40;
} }
if (Keyboard.IsTriggered(Key.N)) if (Keyboard.IsTriggered(Corekey.N))
{ {
lfr = new List<fr1>(); lfr = new List<fr1>();
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0x7f)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0x7f));
@ -155,25 +155,25 @@ namespace mame
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2 + i3), 0x7f)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2 + i3), 0x7f));
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2 + i3 + 1), 0xff)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2 + i3 + 1), 0xff));
} }
if (Keyboard.IsTriggered(Key.U)) if (Keyboard.IsTriggered(Corekey.U))
{ {
lfr = new List<fr1>(); lfr = new List<fr1>();
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xf7)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xf7));
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff));
} }
if (Keyboard.IsTriggered(Key.I)) if (Keyboard.IsTriggered(Corekey.I))
{ {
lfr = new List<fr1>(); lfr = new List<fr1>();
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfb)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfb));
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff));
} }
if (Keyboard.IsTriggered(Key.V)) if (Keyboard.IsTriggered(Corekey.V))
{ {
lfr = new List<fr1>(); lfr = new List<fr1>();
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfd)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfd));
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 2), 0xff));
} }
if (Keyboard.IsTriggered(Key.B)) if (Keyboard.IsTriggered(Corekey.B))
{ {
lfr = new List<fr1>(); lfr = new List<fr1>();
lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfe)); lfr.Add(new fr1((int)(Video.screenstate.frame_number + 1), 0xfe));

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_igs011_drgnwrld() public static void loop_inputports_igs011_drgnwrld()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbytec &= ~0x01; sbytec &= ~0x01;
} }
@ -14,7 +14,7 @@ namespace mame
{ {
sbytec |= 0x01; sbytec |= 0x01;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbytec &= ~0x02; sbytec &= ~0x02;
} }
@ -22,7 +22,7 @@ namespace mame
{ {
sbytec |= 0x02; sbytec |= 0x02;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte0 &= ~0x01; sbyte0 &= ~0x01;
} }
@ -30,7 +30,7 @@ namespace mame
{ {
sbyte0 |= 0x01; sbyte0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
sbyte2 &= ~0x10; sbyte2 &= ~0x10;
} }
@ -38,7 +38,7 @@ namespace mame
{ {
sbyte2 |= 0x10; sbyte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D))// || Mouse.deltaX > 0) if (Keyboard.IsPressed(Corekey.D))// || Mouse.deltaX > 0)
{ {
sbyte0 &= ~0x10; sbyte0 &= ~0x10;
} }
@ -46,7 +46,7 @@ namespace mame
{ {
sbyte0 |= 0x10; sbyte0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.A))// || Mouse.deltaX < 0) if (Keyboard.IsPressed(Corekey.A))// || Mouse.deltaX < 0)
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
@ -54,7 +54,7 @@ namespace mame
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S))// || Mouse.deltaY > 0) if (Keyboard.IsPressed(Corekey.S))// || Mouse.deltaY > 0)
{ {
sbyte0 &= ~0x04; sbyte0 &= ~0x04;
} }
@ -62,7 +62,7 @@ namespace mame
{ {
sbyte0 |= 0x04; sbyte0 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W))// || Mouse.deltaY < 0) if (Keyboard.IsPressed(Corekey.W))// || Mouse.deltaY < 0)
{ {
sbyte2 &= ~0x01; sbyte2 &= ~0x01;
} }
@ -70,7 +70,7 @@ namespace mame
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.J))// || Mouse.buttons[0] != 0) if (Keyboard.IsPressed(Corekey.J))// || Mouse.buttons[0] != 0)
{ {
sbyte2 &= ~0x04; sbyte2 &= ~0x04;
} }
@ -78,7 +78,7 @@ namespace mame
{ {
sbyte2 |= 0x04; sbyte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.K))// || Mouse.buttons[1] != 0) if (Keyboard.IsPressed(Corekey.K))// || Mouse.buttons[1] != 0)
{ {
sbyte0 &= ~0x40; sbyte0 &= ~0x40;
} }
@ -86,7 +86,7 @@ namespace mame
{ {
sbyte0 |= 0x40; sbyte0 |= 0x40;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
sbyte2 &= ~0x08; sbyte2 &= ~0x08;
} }
@ -94,7 +94,7 @@ namespace mame
{ {
sbyte2 |= 0x08; sbyte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
} }
@ -102,7 +102,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
} }
@ -110,7 +110,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
} }
@ -118,7 +118,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
sbyte2 &= ~0x40; sbyte2 &= ~0x40;
} }
@ -126,7 +126,7 @@ namespace mame
{ {
sbyte2 |= 0x40; sbyte2 |= 0x40;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
sbyte1 &= ~0x08; sbyte1 &= ~0x08;
} }
@ -134,7 +134,7 @@ namespace mame
{ {
sbyte1 |= 0x08; sbyte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
sbyte2 &= ~0x20; sbyte2 &= ~0x20;
} }
@ -142,7 +142,7 @@ namespace mame
{ {
sbyte2 |= 0x20; sbyte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
@ -150,7 +150,7 @@ namespace mame
{ {
sbyte1 |= 0x02; sbyte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte1 &= ~0x20; sbyte1 &= ~0x20;
} }
@ -158,7 +158,7 @@ namespace mame
{ {
sbyte1 |= 0x20; sbyte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte2 &= unchecked((sbyte)~0x80); sbyte2 &= unchecked((sbyte)~0x80);
} }
@ -166,7 +166,7 @@ namespace mame
{ {
sbyte2 |= unchecked((sbyte)0x80); sbyte2 |= unchecked((sbyte)0x80);
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
sbyte1 &= unchecked((sbyte)~0x80); sbyte1 &= unchecked((sbyte)~0x80);
} }
@ -174,7 +174,7 @@ namespace mame
{ {
sbyte1 |= unchecked((sbyte)0x80); sbyte1 |= unchecked((sbyte)0x80);
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
} }
@ -182,7 +182,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
} }
@ -190,7 +190,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
} }
@ -198,7 +198,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbytec &= ~0x08; sbytec &= ~0x08;
} }
@ -206,7 +206,7 @@ namespace mame
{ {
sbytec |= 0x08; sbytec |= 0x08;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
sbytec &= ~0x10; sbytec &= ~0x10;
} }
@ -217,7 +217,7 @@ namespace mame
} }
public static void loop_inputports_igs011_lhb() public static void loop_inputports_igs011_lhb()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbytec &= ~0x10; sbytec &= ~0x10;
} }
@ -225,7 +225,7 @@ namespace mame
{ {
sbytec |= 0x10; sbytec |= 0x10;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
bkey0 &= unchecked((byte)~0x20); bkey0 &= unchecked((byte)~0x20);
} }
@ -233,7 +233,7 @@ namespace mame
{ {
bkey0 |= 0x20; bkey0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
bkey1 &= unchecked((byte)~0x20); bkey1 &= unchecked((byte)~0x20);
} }
@ -241,7 +241,7 @@ namespace mame
{ {
bkey1 |= 0x20; bkey1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D3)) if (Keyboard.IsPressed(Corekey.D3))
{ {
bkey4 &= unchecked((byte)~0x10); bkey4 &= unchecked((byte)~0x10);
} }
@ -249,7 +249,7 @@ namespace mame
{ {
bkey4 |= 0x10; bkey4 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D4)) if (Keyboard.IsPressed(Corekey.D4))
{ {
bkey4 &= unchecked((byte)~0x20); bkey4 &= unchecked((byte)~0x20);
} }
@ -257,7 +257,7 @@ namespace mame
{ {
bkey4 |= 0x20; bkey4 |= 0x20;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
bkey0 &= unchecked((byte)~0x01); bkey0 &= unchecked((byte)~0x01);
} }
@ -265,7 +265,7 @@ namespace mame
{ {
bkey0 |= 0x01; bkey0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.B)) if (Keyboard.IsPressed(Corekey.B))
{ {
bkey1 &= unchecked((byte)~0x01); bkey1 &= unchecked((byte)~0x01);
} }
@ -273,7 +273,7 @@ namespace mame
{ {
bkey1 |= 0x01; bkey1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.C)) if (Keyboard.IsPressed(Corekey.C))
{ {
bkey2 &= unchecked((byte)~0x01); bkey2 &= unchecked((byte)~0x01);
} }
@ -281,7 +281,7 @@ namespace mame
{ {
bkey2 |= 0x01; bkey2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
bkey3 &= unchecked((byte)~0x01); bkey3 &= unchecked((byte)~0x01);
} }
@ -289,7 +289,7 @@ namespace mame
{ {
bkey3 |= 0x01; bkey3 |= 0x01;
} }
if (Keyboard.IsPressed(Key.E)) if (Keyboard.IsPressed(Corekey.E))
{ {
bkey0 &= unchecked((byte)~0x02); bkey0 &= unchecked((byte)~0x02);
} }
@ -297,7 +297,7 @@ namespace mame
{ {
bkey0 |= 0x02; bkey0 |= 0x02;
} }
if (Keyboard.IsPressed(Key.F)) if (Keyboard.IsPressed(Corekey.F))
{ {
bkey1 &= unchecked((byte)~0x02); bkey1 &= unchecked((byte)~0x02);
} }
@ -305,7 +305,7 @@ namespace mame
{ {
bkey1 |= 0x02; bkey1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.G)) if (Keyboard.IsPressed(Corekey.G))
{ {
bkey2 &= unchecked((byte)~0x02); bkey2 &= unchecked((byte)~0x02);
} }
@ -313,7 +313,7 @@ namespace mame
{ {
bkey2 |= 0x02; bkey2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.H)) if (Keyboard.IsPressed(Corekey.H))
{ {
bkey3 &= unchecked((byte)~0x02); bkey3 &= unchecked((byte)~0x02);
} }
@ -321,7 +321,7 @@ namespace mame
{ {
bkey3 |= 0x02; bkey3 |= 0x02;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
bkey0 &= unchecked((byte)~0x04); bkey0 &= unchecked((byte)~0x04);
} }
@ -329,7 +329,7 @@ namespace mame
{ {
bkey0 |= 0x04; bkey0 |= 0x04;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
bkey1 &= unchecked((byte)~0x04); bkey1 &= unchecked((byte)~0x04);
} }
@ -337,7 +337,7 @@ namespace mame
{ {
bkey1 |= 0x04; bkey1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
bkey2 &= unchecked((byte)~0x04); bkey2 &= unchecked((byte)~0x04);
} }
@ -345,7 +345,7 @@ namespace mame
{ {
bkey2 |= 0x04; bkey2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
bkey3 &= unchecked((byte)~0x04); bkey3 &= unchecked((byte)~0x04);
} }
@ -353,7 +353,7 @@ namespace mame
{ {
bkey3 |= 0x04; bkey3 |= 0x04;
} }
if (Keyboard.IsPressed(Key.M)) if (Keyboard.IsPressed(Corekey.M))
{ {
bkey0 &= unchecked((byte)~0x08); bkey0 &= unchecked((byte)~0x08);
} }
@ -361,7 +361,7 @@ namespace mame
{ {
bkey0 |= 0x08; bkey0 |= 0x08;
} }
if (Keyboard.IsPressed(Key.N)) if (Keyboard.IsPressed(Corekey.N))
{ {
bkey1 &= unchecked((byte)~0x08); bkey1 &= unchecked((byte)~0x08);
} }
@ -369,7 +369,7 @@ namespace mame
{ {
bkey1 |= 0x08; bkey1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
bkey4 &= unchecked((byte)~0x04); bkey4 &= unchecked((byte)~0x04);
} }
@ -377,7 +377,7 @@ namespace mame
{ {
bkey4 |= 0x04; bkey4 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Q)) if (Keyboard.IsPressed(Corekey.Q))
{ {
bkey0 &= unchecked((byte)~0x10); bkey0 &= unchecked((byte)~0x10);
} }
@ -385,7 +385,7 @@ namespace mame
{ {
bkey0 |= 0x10; bkey0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
bkey1 &= unchecked((byte)~0x10); bkey1 &= unchecked((byte)~0x10);
} }
@ -393,7 +393,7 @@ namespace mame
{ {
bkey1 |= 0x10; bkey1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
bkey2 &= unchecked((byte)~0x08); bkey2 &= unchecked((byte)~0x08);
} }
@ -401,7 +401,7 @@ namespace mame
{ {
bkey2 |= 0x08; bkey2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
bkey4 &= unchecked((byte)~0x02); bkey4 &= unchecked((byte)~0x02);
} }
@ -409,7 +409,7 @@ namespace mame
{ {
bkey4 |= 0x02; bkey4 |= 0x02;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
bkey3 &= unchecked((byte)~0x08); bkey3 &= unchecked((byte)~0x08);
} }
@ -417,7 +417,7 @@ namespace mame
{ {
bkey3 |= 0x08; bkey3 |= 0x08;
} }
if (Keyboard.IsPressed(Key.Y)) if (Keyboard.IsPressed(Corekey.Y))
{ {
bkey4 &= unchecked((byte)~0x01); bkey4 &= unchecked((byte)~0x01);
} }
@ -425,7 +425,7 @@ namespace mame
{ {
bkey4 |= 0x01; bkey4 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Z)) if (Keyboard.IsPressed(Corekey.Z))
{ {
bkey2 &= unchecked((byte)~0x10); bkey2 &= unchecked((byte)~0x10);
} }
@ -436,7 +436,7 @@ namespace mame
} }
public static void loop_inputports_igs011_lhb2() public static void loop_inputports_igs011_lhb2()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbytec &= ~0x10; sbytec &= ~0x10;
} }
@ -444,7 +444,7 @@ namespace mame
{ {
sbytec |= 0x10; sbytec |= 0x10;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
bkey0 &= unchecked((byte)~0x20); bkey0 &= unchecked((byte)~0x20);
} }
@ -452,7 +452,7 @@ namespace mame
{ {
bkey0 |= 0x20; bkey0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
bkey1 &= unchecked((byte)~0x20); bkey1 &= unchecked((byte)~0x20);
} }
@ -460,7 +460,7 @@ namespace mame
{ {
bkey1 |= 0x20; bkey1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
bkey0 &= unchecked((byte)~0x01); bkey0 &= unchecked((byte)~0x01);
} }
@ -468,7 +468,7 @@ namespace mame
{ {
bkey0 |= 0x01; bkey0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.B)) if (Keyboard.IsPressed(Corekey.B))
{ {
bkey1 &= unchecked((byte)~0x01); bkey1 &= unchecked((byte)~0x01);
} }
@ -476,7 +476,7 @@ namespace mame
{ {
bkey1 |= 0x01; bkey1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.C)) if (Keyboard.IsPressed(Corekey.C))
{ {
bkey2 &= unchecked((byte)~0x01); bkey2 &= unchecked((byte)~0x01);
} }
@ -484,7 +484,7 @@ namespace mame
{ {
bkey2 |= 0x01; bkey2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
bkey3 &= unchecked((byte)~0x01); bkey3 &= unchecked((byte)~0x01);
} }
@ -492,7 +492,7 @@ namespace mame
{ {
bkey3 |= 0x01; bkey3 |= 0x01;
} }
if (Keyboard.IsPressed(Key.E)) if (Keyboard.IsPressed(Corekey.E))
{ {
bkey0 &= unchecked((byte)~0x02); bkey0 &= unchecked((byte)~0x02);
} }
@ -500,7 +500,7 @@ namespace mame
{ {
bkey0 |= 0x02; bkey0 |= 0x02;
} }
if (Keyboard.IsPressed(Key.F)) if (Keyboard.IsPressed(Corekey.F))
{ {
bkey1 &= unchecked((byte)~0x02); bkey1 &= unchecked((byte)~0x02);
} }
@ -508,7 +508,7 @@ namespace mame
{ {
bkey1 |= 0x02; bkey1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.G)) if (Keyboard.IsPressed(Corekey.G))
{ {
bkey2 &= unchecked((byte)~0x02); bkey2 &= unchecked((byte)~0x02);
} }
@ -516,7 +516,7 @@ namespace mame
{ {
bkey2 |= 0x02; bkey2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.H)) if (Keyboard.IsPressed(Corekey.H))
{ {
bkey3 &= unchecked((byte)~0x02); bkey3 &= unchecked((byte)~0x02);
} }
@ -524,7 +524,7 @@ namespace mame
{ {
bkey3 |= 0x02; bkey3 |= 0x02;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
bkey0 &= unchecked((byte)~0x04); bkey0 &= unchecked((byte)~0x04);
} }
@ -532,7 +532,7 @@ namespace mame
{ {
bkey0 |= 0x04; bkey0 |= 0x04;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
bkey1 &= unchecked((byte)~0x04); bkey1 &= unchecked((byte)~0x04);
} }
@ -540,7 +540,7 @@ namespace mame
{ {
bkey1 |= 0x04; bkey1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
bkey2 &= unchecked((byte)~0x04); bkey2 &= unchecked((byte)~0x04);
} }
@ -548,7 +548,7 @@ namespace mame
{ {
bkey2 |= 0x04; bkey2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
bkey3 &= unchecked((byte)~0x04); bkey3 &= unchecked((byte)~0x04);
} }
@ -556,7 +556,7 @@ namespace mame
{ {
bkey3 |= 0x04; bkey3 |= 0x04;
} }
if (Keyboard.IsPressed(Key.M)) if (Keyboard.IsPressed(Corekey.M))
{ {
bkey0 &= unchecked((byte)~0x08); bkey0 &= unchecked((byte)~0x08);
} }
@ -564,7 +564,7 @@ namespace mame
{ {
bkey0 |= 0x08; bkey0 |= 0x08;
} }
if (Keyboard.IsPressed(Key.N)) if (Keyboard.IsPressed(Corekey.N))
{ {
bkey1 &= unchecked((byte)~0x08); bkey1 &= unchecked((byte)~0x08);
} }
@ -572,7 +572,7 @@ namespace mame
{ {
bkey1 |= 0x08; bkey1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.Q)) if (Keyboard.IsPressed(Corekey.Q))
{ {
bkey0 &= unchecked((byte)~0x10); bkey0 &= unchecked((byte)~0x10);
} }
@ -580,7 +580,7 @@ namespace mame
{ {
bkey0 |= 0x10; bkey0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
bkey1 &= unchecked((byte)~0x10); bkey1 &= unchecked((byte)~0x10);
} }
@ -588,7 +588,7 @@ namespace mame
{ {
bkey1 |= 0x10; bkey1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
bkey2 &= unchecked((byte)~0x08); bkey2 &= unchecked((byte)~0x08);
} }
@ -596,7 +596,7 @@ namespace mame
{ {
bkey2 |= 0x08; bkey2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
bkey3 &= unchecked((byte)~0x08); bkey3 &= unchecked((byte)~0x08);
} }
@ -604,7 +604,7 @@ namespace mame
{ {
bkey3 |= 0x08; bkey3 |= 0x08;
} }
if (Keyboard.IsPressed(Key.Z)) if (Keyboard.IsPressed(Corekey.Z))
{ {
bkey2 &= unchecked((byte)~0x10); bkey2 &= unchecked((byte)~0x10);
} }

View File

@ -1,5 +1,4 @@
using System.Collections.Generic; using System.Collections.Generic;
using Bitmap = MAME.Core.AxiBitmap.AxiBitmap;
namespace mame namespace mame
{ {
@ -7,9 +6,6 @@ namespace mame
{ {
private static string[] sde2 = new string[] { "," }, sde6 = new string[] { "-" }; private static string[] sde2 = new string[] { "," }, sde6 = new string[] { "-" };
public static bool bTile0, bTile1, bTile2, bSprite; public static bool bTile0, bTile1, bTile2, bSprite;
public delegate Bitmap GetBitmap();
public static GetBitmap[] GetTilemaps;
public static GetBitmap GetSprite;
private static List<int> lSprite; private static List<int> lSprite;
public static int min_priority, max_priority; public static int min_priority, max_priority;
public static void GDIInit() public static void GDIInit()

File diff suppressed because it is too large Load Diff

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_m72_common() public static void loop_inputports_m72_common()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
ushort1 &= unchecked((ushort)~0x0004); ushort1 &= unchecked((ushort)~0x0004);
} }
@ -14,7 +14,7 @@ namespace mame
{ {
ushort1 |= 0x0004; ushort1 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
ushort1 &= unchecked((ushort)~0x0008); ushort1 &= unchecked((ushort)~0x0008);
} }
@ -22,7 +22,7 @@ namespace mame
{ {
ushort1 |= 0x0008; ushort1 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
ushort1 &= unchecked((ushort)~0x0001); ushort1 &= unchecked((ushort)~0x0001);
} }
@ -30,7 +30,7 @@ namespace mame
{ {
ushort1 |= 0x0001; ushort1 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
ushort1 &= unchecked((ushort)~0x0002); ushort1 &= unchecked((ushort)~0x0002);
} }
@ -38,7 +38,7 @@ namespace mame
{ {
ushort1 |= 0x0002; ushort1 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
ushort0 &= unchecked((ushort)~0x0001); ushort0 &= unchecked((ushort)~0x0001);
} }
@ -46,7 +46,7 @@ namespace mame
{ {
ushort0 |= 0x0001; ushort0 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
ushort0 &= unchecked((ushort)~0x0002); ushort0 &= unchecked((ushort)~0x0002);
} }
@ -54,7 +54,7 @@ namespace mame
{ {
ushort0 |= 0x0002; ushort0 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
ushort0 &= unchecked((ushort)~0x0004); ushort0 &= unchecked((ushort)~0x0004);
} }
@ -62,7 +62,7 @@ namespace mame
{ {
ushort0 |= 0x0004; ushort0 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
ushort0 &= unchecked((ushort)~0x0008); ushort0 &= unchecked((ushort)~0x0008);
} }
@ -70,7 +70,7 @@ namespace mame
{ {
ushort0 |= 0x0008; ushort0 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
ushort0 &= unchecked((ushort)~0x0080); ushort0 &= unchecked((ushort)~0x0080);
} }
@ -78,7 +78,7 @@ namespace mame
{ {
ushort0 |= 0x0080; ushort0 |= 0x0080;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
ushort0 &= unchecked((ushort)~0x0040); ushort0 &= unchecked((ushort)~0x0040);
} }
@ -86,7 +86,7 @@ namespace mame
{ {
ushort0 |= 0x0040; ushort0 |= 0x0040;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
ushort0 &= unchecked((ushort)~0x0020); ushort0 &= unchecked((ushort)~0x0020);
} }
@ -94,7 +94,7 @@ namespace mame
{ {
ushort0 |= 0x0020; ushort0 |= 0x0020;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
ushort0 &= unchecked((ushort)~0x0010); ushort0 &= unchecked((ushort)~0x0010);
} }
@ -102,7 +102,7 @@ namespace mame
{ {
ushort0 |= 0x0010; ushort0 |= 0x0010;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
ushort0 &= unchecked((ushort)~0x0100); ushort0 &= unchecked((ushort)~0x0100);
} }
@ -110,7 +110,7 @@ namespace mame
{ {
ushort0 |= 0x0100; ushort0 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
ushort0 &= unchecked((ushort)~0x0200); ushort0 &= unchecked((ushort)~0x0200);
} }
@ -118,7 +118,7 @@ namespace mame
{ {
ushort0 |= 0x0200; ushort0 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
ushort0 &= unchecked((ushort)~0x0400); ushort0 &= unchecked((ushort)~0x0400);
} }
@ -126,7 +126,7 @@ namespace mame
{ {
ushort0 |= 0x0400; ushort0 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
ushort0 &= unchecked((ushort)~0x0800); ushort0 &= unchecked((ushort)~0x0800);
} }
@ -134,7 +134,7 @@ namespace mame
{ {
ushort0 |= 0x0800; ushort0 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
ushort0 &= unchecked((ushort)~0x8000); ushort0 &= unchecked((ushort)~0x8000);
} }
@ -142,7 +142,7 @@ namespace mame
{ {
ushort0 |= 0x8000; ushort0 |= 0x8000;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
ushort0 &= unchecked((ushort)~0x4000); ushort0 &= unchecked((ushort)~0x4000);
} }
@ -150,7 +150,7 @@ namespace mame
{ {
ushort0 |= 0x4000; ushort0 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
ushort0 &= unchecked((ushort)~0x2000); ushort0 &= unchecked((ushort)~0x2000);
} }
@ -158,7 +158,7 @@ namespace mame
{ {
ushort0 |= 0x2000; ushort0 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
ushort0 &= unchecked((ushort)~0x1000); ushort0 &= unchecked((ushort)~0x1000);
} }
@ -166,7 +166,7 @@ namespace mame
{ {
ushort0 |= 0x1000; ushort0 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
ushort1 &= unchecked((ushort)~0x0010); ushort1 &= unchecked((ushort)~0x0010);
} }
@ -174,7 +174,7 @@ namespace mame
{ {
ushort1 |= 0x0010; ushort1 |= 0x0010;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
ushort1 &= unchecked((ushort)~0x0020); ushort1 &= unchecked((ushort)~0x0020);
} }

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_m92_common() public static void loop_inputports_m92_common()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
ushort1 &= unchecked((ushort)~0x0004); ushort1 &= unchecked((ushort)~0x0004);
} }
@ -14,7 +14,7 @@ namespace mame
{ {
ushort1 |= 0x0004; ushort1 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
ushort1 &= unchecked((ushort)~0x0008); ushort1 &= unchecked((ushort)~0x0008);
} }
@ -22,7 +22,7 @@ namespace mame
{ {
ushort1 |= 0x0008; ushort1 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
ushort1 &= unchecked((ushort)~0x0001); ushort1 &= unchecked((ushort)~0x0001);
} }
@ -30,7 +30,7 @@ namespace mame
{ {
ushort1 |= 0x0001; ushort1 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
ushort1 &= unchecked((ushort)~0x0002); ushort1 &= unchecked((ushort)~0x0002);
} }
@ -38,7 +38,7 @@ namespace mame
{ {
ushort1 |= 0x0002; ushort1 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
ushort0 &= unchecked((ushort)~0x0001); ushort0 &= unchecked((ushort)~0x0001);
} }
@ -46,7 +46,7 @@ namespace mame
{ {
ushort0 |= 0x0001; ushort0 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
ushort0 &= unchecked((ushort)~0x0002); ushort0 &= unchecked((ushort)~0x0002);
} }
@ -54,7 +54,7 @@ namespace mame
{ {
ushort0 |= 0x0002; ushort0 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
ushort0 &= unchecked((ushort)~0x0004); ushort0 &= unchecked((ushort)~0x0004);
} }
@ -62,7 +62,7 @@ namespace mame
{ {
ushort0 |= 0x0004; ushort0 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
ushort0 &= unchecked((ushort)~0x0008); ushort0 &= unchecked((ushort)~0x0008);
} }
@ -70,7 +70,7 @@ namespace mame
{ {
ushort0 |= 0x0008; ushort0 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
ushort0 &= unchecked((ushort)~0x0080); ushort0 &= unchecked((ushort)~0x0080);
} }
@ -78,7 +78,7 @@ namespace mame
{ {
ushort0 |= 0x0080; ushort0 |= 0x0080;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
ushort0 &= unchecked((ushort)~0x0040); ushort0 &= unchecked((ushort)~0x0040);
} }
@ -86,7 +86,7 @@ namespace mame
{ {
ushort0 |= 0x0040; ushort0 |= 0x0040;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
ushort0 &= unchecked((ushort)~0x0020); ushort0 &= unchecked((ushort)~0x0020);
} }
@ -94,7 +94,7 @@ namespace mame
{ {
ushort0 |= 0x0020; ushort0 |= 0x0020;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
ushort0 &= unchecked((ushort)~0x0010); ushort0 &= unchecked((ushort)~0x0010);
} }
@ -102,7 +102,7 @@ namespace mame
{ {
ushort0 |= 0x0010; ushort0 |= 0x0010;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
ushort0 &= unchecked((ushort)~0x0100); ushort0 &= unchecked((ushort)~0x0100);
} }
@ -110,7 +110,7 @@ namespace mame
{ {
ushort0 |= 0x0100; ushort0 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
ushort0 &= unchecked((ushort)~0x0200); ushort0 &= unchecked((ushort)~0x0200);
} }
@ -118,7 +118,7 @@ namespace mame
{ {
ushort0 |= 0x0200; ushort0 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
ushort0 &= unchecked((ushort)~0x0400); ushort0 &= unchecked((ushort)~0x0400);
} }
@ -126,7 +126,7 @@ namespace mame
{ {
ushort0 |= 0x0400; ushort0 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
ushort0 &= unchecked((ushort)~0x0800); ushort0 &= unchecked((ushort)~0x0800);
} }
@ -134,7 +134,7 @@ namespace mame
{ {
ushort0 |= 0x0800; ushort0 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
ushort0 &= unchecked((ushort)~0x8000); ushort0 &= unchecked((ushort)~0x8000);
} }
@ -142,7 +142,7 @@ namespace mame
{ {
ushort0 |= 0x8000; ushort0 |= 0x8000;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
ushort0 &= unchecked((ushort)~0x4000); ushort0 &= unchecked((ushort)~0x4000);
} }
@ -150,7 +150,7 @@ namespace mame
{ {
ushort0 |= 0x4000; ushort0 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
ushort0 &= unchecked((ushort)~0x2000); ushort0 &= unchecked((ushort)~0x2000);
} }
@ -158,7 +158,7 @@ namespace mame
{ {
ushort0 |= 0x2000; ushort0 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
ushort0 &= unchecked((ushort)~0x1000); ushort0 &= unchecked((ushort)~0x1000);
} }
@ -166,7 +166,7 @@ namespace mame
{ {
ushort0 |= 0x1000; ushort0 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
ushort1 &= unchecked((ushort)~0x0010); ushort1 &= unchecked((ushort)~0x0010);
} }
@ -174,7 +174,7 @@ namespace mame
{ {
ushort1 |= 0x0010; ushort1 |= 0x0010;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
ushort1 &= unchecked((ushort)~0x0020); ushort1 &= unchecked((ushort)~0x0020);
} }

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_ns1_3b() public static void loop_inputports_ns1_3b()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -14,7 +14,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -22,7 +22,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte0 &= unchecked((byte)~0x80); byte0 &= unchecked((byte)~0x80);
} }
@ -30,7 +30,7 @@ namespace mame
{ {
byte0 |= 0x80; byte0 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte1 &= unchecked((byte)~0x80); byte1 &= unchecked((byte)~0x80);
} }
@ -38,7 +38,7 @@ namespace mame
{ {
byte1 |= 0x80; byte1 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte0 &= unchecked((byte)~0x01); byte0 &= unchecked((byte)~0x01);
} }
@ -46,7 +46,7 @@ namespace mame
{ {
byte0 |= 0x01; byte0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte0 &= unchecked((byte)~0x02); byte0 &= unchecked((byte)~0x02);
} }
@ -54,7 +54,7 @@ namespace mame
{ {
byte0 |= 0x02; byte0 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte0 &= unchecked((byte)~0x04); byte0 &= unchecked((byte)~0x04);
} }
@ -62,7 +62,7 @@ namespace mame
{ {
byte0 |= 0x04; byte0 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte0 &= unchecked((byte)~0x08); byte0 &= unchecked((byte)~0x08);
} }
@ -70,7 +70,7 @@ namespace mame
{ {
byte0 |= 0x08; byte0 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte0 &= unchecked((byte)~0x10); byte0 &= unchecked((byte)~0x10);
} }
@ -78,7 +78,7 @@ namespace mame
{ {
byte0 |= 0x10; byte0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte0 &= unchecked((byte)~0x20); byte0 &= unchecked((byte)~0x20);
} }
@ -86,7 +86,7 @@ namespace mame
{ {
byte0 |= 0x20; byte0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
byte0 &= unchecked((byte)~0x40); byte0 &= unchecked((byte)~0x40);
} }
@ -94,7 +94,7 @@ namespace mame
{ {
byte0 |= 0x40; byte0 |= 0x40;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
@ -102,7 +102,7 @@ namespace mame
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte1 &= unchecked((byte)~0x02); byte1 &= unchecked((byte)~0x02);
} }
@ -110,7 +110,7 @@ namespace mame
{ {
byte1 |= 0x02; byte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte1 &= unchecked((byte)~0x04); byte1 &= unchecked((byte)~0x04);
} }
@ -118,7 +118,7 @@ namespace mame
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
@ -126,7 +126,7 @@ namespace mame
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
@ -134,7 +134,7 @@ namespace mame
{ {
byte1 |= 0x10; byte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte1 &= unchecked((byte)~0x20); byte1 &= unchecked((byte)~0x20);
} }
@ -142,7 +142,7 @@ namespace mame
{ {
byte1 |= 0x20; byte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
byte1 &= unchecked((byte)~0x40); byte1 &= unchecked((byte)~0x40);
} }
@ -150,7 +150,7 @@ namespace mame
{ {
byte1 |= 0x40; byte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }
@ -158,7 +158,7 @@ namespace mame
{ {
byte2 |= 0x20; byte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
byte2 &= unchecked((byte)~0x40); byte2 &= unchecked((byte)~0x40);
} }
@ -169,7 +169,7 @@ namespace mame
} }
public static void loop_inputports_ns1_quester() public static void loop_inputports_ns1_quester()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -177,7 +177,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -185,7 +185,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte0 &= unchecked((byte)~0x80); byte0 &= unchecked((byte)~0x80);
} }
@ -193,7 +193,7 @@ namespace mame
{ {
byte0 |= 0x80; byte0 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte1 &= unchecked((byte)~0x80); byte1 &= unchecked((byte)~0x80);
} }
@ -201,7 +201,7 @@ namespace mame
{ {
byte1 |= 0x80; byte1 |= 0x80;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte0 &= unchecked((byte)~0x10); byte0 &= unchecked((byte)~0x10);
} }
@ -209,7 +209,7 @@ namespace mame
{ {
byte0 |= 0x10; byte0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte0 &= unchecked((byte)~0x20); byte0 &= unchecked((byte)~0x20);
} }
@ -217,7 +217,7 @@ namespace mame
{ {
byte0 |= 0x20; byte0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
byte0 &= unchecked((byte)~0x40); byte0 &= unchecked((byte)~0x40);
} }
@ -225,7 +225,7 @@ namespace mame
{ {
byte0 |= 0x40; byte0 |= 0x40;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
@ -233,7 +233,7 @@ namespace mame
{ {
byte1 |= 0x10; byte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte1 &= unchecked((byte)~0x20); byte1 &= unchecked((byte)~0x20);
} }
@ -241,7 +241,7 @@ namespace mame
{ {
byte1 |= 0x20; byte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
byte1 &= unchecked((byte)~0x40); byte1 &= unchecked((byte)~0x40);
} }
@ -249,7 +249,7 @@ namespace mame
{ {
byte1 |= 0x40; byte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }
@ -257,7 +257,7 @@ namespace mame
{ {
byte2 |= 0x20; byte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
byte2 &= unchecked((byte)~0x40); byte2 &= unchecked((byte)~0x40);
} }
@ -270,7 +270,7 @@ namespace mame
} }
public static void loop_inputports_ns1_berabohm() public static void loop_inputports_ns1_berabohm()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -278,7 +278,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -286,7 +286,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte0 &= unchecked((byte)~0x80); byte0 &= unchecked((byte)~0x80);
} }
@ -294,7 +294,7 @@ namespace mame
{ {
byte0 |= 0x80; byte0 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte1 &= unchecked((byte)~0x80); byte1 &= unchecked((byte)~0x80);
} }
@ -302,7 +302,7 @@ namespace mame
{ {
byte1 |= 0x80; byte1 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte0 &= unchecked((byte)~0x01); byte0 &= unchecked((byte)~0x01);
} }
@ -310,7 +310,7 @@ namespace mame
{ {
byte0 |= 0x01; byte0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte0 &= unchecked((byte)~0x02); byte0 &= unchecked((byte)~0x02);
} }
@ -318,7 +318,7 @@ namespace mame
{ {
byte0 |= 0x02; byte0 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte0 &= unchecked((byte)~0x04); byte0 &= unchecked((byte)~0x04);
} }
@ -326,7 +326,7 @@ namespace mame
{ {
byte0 |= 0x04; byte0 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte0 &= unchecked((byte)~0x08); byte0 &= unchecked((byte)~0x08);
} }
@ -334,7 +334,7 @@ namespace mame
{ {
byte0 |= 0x08; byte0 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte01 |= 0x01; byte01 |= 0x01;
} }
@ -342,7 +342,7 @@ namespace mame
{ {
byte01 &= unchecked((byte)~0x01); byte01 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte01 |= 0x02; byte01 |= 0x02;
} }
@ -350,7 +350,7 @@ namespace mame
{ {
byte01 &= unchecked((byte)~0x02); byte01 &= unchecked((byte)~0x02);
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
byte01 |= 0x04; byte01 |= 0x04;
} }
@ -358,7 +358,7 @@ namespace mame
{ {
byte01 &= unchecked((byte)~0x04); byte01 &= unchecked((byte)~0x04);
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
byte00 |= 0x01; byte00 |= 0x01;
} }
@ -366,7 +366,7 @@ namespace mame
{ {
byte00 &= unchecked((byte)~0x01); byte00 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
byte00 |= 0x02; byte00 |= 0x02;
} }
@ -374,7 +374,7 @@ namespace mame
{ {
byte00 &= unchecked((byte)~0x02); byte00 &= unchecked((byte)~0x02);
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
byte00 |= 0x04; byte00 |= 0x04;
} }
@ -382,7 +382,7 @@ namespace mame
{ {
byte00 &= unchecked((byte)~0x04); byte00 &= unchecked((byte)~0x04);
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
@ -390,7 +390,7 @@ namespace mame
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte1 &= unchecked((byte)~0x02); byte1 &= unchecked((byte)~0x02);
} }
@ -398,7 +398,7 @@ namespace mame
{ {
byte1 |= 0x02; byte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte1 &= unchecked((byte)~0x04); byte1 &= unchecked((byte)~0x04);
} }
@ -406,7 +406,7 @@ namespace mame
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
@ -414,7 +414,7 @@ namespace mame
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte03 |= 0x01; byte03 |= 0x01;
} }
@ -422,7 +422,7 @@ namespace mame
{ {
byte03 &= unchecked((byte)~0x01); byte03 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte03 |= 0x02; byte03 |= 0x02;
} }
@ -430,7 +430,7 @@ namespace mame
{ {
byte03 &= unchecked((byte)~0x02); byte03 &= unchecked((byte)~0x02);
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
byte03 |= 0x04; byte03 |= 0x04;
} }
@ -438,7 +438,7 @@ namespace mame
{ {
byte03 &= unchecked((byte)~0x04); byte03 &= unchecked((byte)~0x04);
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
byte02 |= 0x01; byte02 |= 0x01;
} }
@ -446,7 +446,7 @@ namespace mame
{ {
byte02 &= unchecked((byte)~0x01); byte02 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
byte02 |= 0x02; byte02 |= 0x02;
} }
@ -454,7 +454,7 @@ namespace mame
{ {
byte02 &= unchecked((byte)~0x02); byte02 &= unchecked((byte)~0x02);
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
byte02 |= 0x04; byte02 |= 0x04;
} }
@ -462,7 +462,7 @@ namespace mame
{ {
byte02 &= unchecked((byte)~0x04); byte02 &= unchecked((byte)~0x04);
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }
@ -470,7 +470,7 @@ namespace mame
{ {
byte2 |= 0x20; byte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
byte2 &= unchecked((byte)~0x40); byte2 &= unchecked((byte)~0x40);
} }
@ -481,7 +481,7 @@ namespace mame
} }
public static void loop_inputports_ns1_faceoff() public static void loop_inputports_ns1_faceoff()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -489,7 +489,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -497,7 +497,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte0 &= unchecked((byte)~0x80); byte0 &= unchecked((byte)~0x80);
} }
@ -505,7 +505,7 @@ namespace mame
{ {
byte0 |= 0x80; byte0 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte1 &= unchecked((byte)~0x80); byte1 &= unchecked((byte)~0x80);
} }
@ -513,7 +513,7 @@ namespace mame
{ {
byte1 |= 0x80; byte1 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte00 &= unchecked((byte)~0x01); byte00 &= unchecked((byte)~0x01);
} }
@ -521,7 +521,7 @@ namespace mame
{ {
byte00 |= 0x01; byte00 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte00 &= unchecked((byte)~0x02); byte00 &= unchecked((byte)~0x02);
} }
@ -529,7 +529,7 @@ namespace mame
{ {
byte00 |= 0x02; byte00 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte00 &= unchecked((byte)~0x04); byte00 &= unchecked((byte)~0x04);
} }
@ -537,7 +537,7 @@ namespace mame
{ {
byte00 |= 0x04; byte00 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte00 &= unchecked((byte)~0x08); byte00 &= unchecked((byte)~0x08);
} }
@ -545,7 +545,7 @@ namespace mame
{ {
byte00 |= 0x08; byte00 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte00 &= unchecked((byte)~0x10); byte00 &= unchecked((byte)~0x10);
} }
@ -553,7 +553,7 @@ namespace mame
{ {
byte00 |= 0x10; byte00 |= 0x10;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte01 &= unchecked((byte)~0x10); byte01 &= unchecked((byte)~0x10);
} }
@ -561,7 +561,7 @@ namespace mame
{ {
byte01 |= 0x10; byte01 |= 0x10;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte01 &= unchecked((byte)~0x01); byte01 &= unchecked((byte)~0x01);
} }
@ -569,7 +569,7 @@ namespace mame
{ {
byte01 |= 0x01; byte01 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte01 &= unchecked((byte)~0x02); byte01 &= unchecked((byte)~0x02);
} }
@ -577,7 +577,7 @@ namespace mame
{ {
byte01 |= 0x02; byte01 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte01 &= unchecked((byte)~0x04); byte01 &= unchecked((byte)~0x04);
} }
@ -585,7 +585,7 @@ namespace mame
{ {
byte01 |= 0x04; byte01 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte01 &= unchecked((byte)~0x08); byte01 &= unchecked((byte)~0x08);
} }
@ -593,7 +593,7 @@ namespace mame
{ {
byte01 |= 0x08; byte01 |= 0x08;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }
@ -601,7 +601,7 @@ namespace mame
{ {
byte2 |= 0x20; byte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
byte2 &= unchecked((byte)~0x40); byte2 &= unchecked((byte)~0x40);
} }
@ -612,7 +612,7 @@ namespace mame
} }
public static void loop_inputports_ns1_tankfrce4() public static void loop_inputports_ns1_tankfrce4()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -620,7 +620,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -628,7 +628,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte00 &= unchecked((byte)~0x01); byte00 &= unchecked((byte)~0x01);
} }
@ -636,7 +636,7 @@ namespace mame
{ {
byte00 |= 0x01; byte00 |= 0x01;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte00 &= unchecked((byte)~0x02); byte00 &= unchecked((byte)~0x02);
} }
@ -644,7 +644,7 @@ namespace mame
{ {
byte00 |= 0x02; byte00 |= 0x02;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte00 &= unchecked((byte)~0x04); byte00 &= unchecked((byte)~0x04);
} }
@ -652,7 +652,7 @@ namespace mame
{ {
byte00 |= 0x04; byte00 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte00 &= unchecked((byte)~0x08); byte00 &= unchecked((byte)~0x08);
} }
@ -660,7 +660,7 @@ namespace mame
{ {
byte00 |= 0x08; byte00 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte00 &= unchecked((byte)~0x10); byte00 &= unchecked((byte)~0x10);
} }
@ -668,7 +668,7 @@ namespace mame
{ {
byte00 |= 0x10; byte00 |= 0x10;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte02 &= unchecked((byte)~0x01); byte02 &= unchecked((byte)~0x01);
} }
@ -676,7 +676,7 @@ namespace mame
{ {
byte02 |= 0x01; byte02 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte02 &= unchecked((byte)~0x02); byte02 &= unchecked((byte)~0x02);
} }
@ -684,7 +684,7 @@ namespace mame
{ {
byte02 |= 0x02; byte02 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte02 &= unchecked((byte)~0x04); byte02 &= unchecked((byte)~0x04);
} }
@ -692,7 +692,7 @@ namespace mame
{ {
byte02 |= 0x04; byte02 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte02 &= unchecked((byte)~0x08); byte02 &= unchecked((byte)~0x08);
} }
@ -700,7 +700,7 @@ namespace mame
{ {
byte02 |= 0x08; byte02 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte02 &= unchecked((byte)~0x10); byte02 &= unchecked((byte)~0x10);
} }

View File

@ -121,25 +121,5 @@ namespace mame
dac1_value = data - 0x80; dac1_value = data - 0x80;
namcos1_update_DACs(); namcos1_update_DACs();
} }
public static void nvram_handler_load_namcos1()
{
if (File.Exists("nvram\\" + Machine.sName + ".nv"))
{
FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Open);
int n = (int)fs1.Length;
fs1.Read(Generic.generic_nvram, 0, n);
fs1.Close();
}
else
{
Array.Clear(Generic.generic_nvram, 0, 0x800);
}
}
public static void nvram_handler_save_namcos1()
{
FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Create);
fs1.Write(Generic.generic_nvram, 0, 0x800);
fs1.Close();
}
} }
} }

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_neogeo_standard() public static void loop_inputports_neogeo_standard()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
short3 &= ~0x0001; short3 &= ~0x0001;
} }
@ -14,7 +14,7 @@ namespace mame
{ {
short3 |= 0x0001; short3 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
short3 &= ~0x0002; short3 &= ~0x0002;
} }
@ -22,7 +22,7 @@ namespace mame
{ {
short3 |= 0x0002; short3 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
short2 &= ~0x0100; short2 &= ~0x0100;
} }
@ -30,7 +30,7 @@ namespace mame
{ {
short2 |= 0x0100; short2 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
short2 &= ~0x0400; short2 &= ~0x0400;
} }
@ -38,7 +38,7 @@ namespace mame
{ {
short2 |= 0x0400; short2 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
short0 &= ~0x0800; short0 &= ~0x0800;
} }
@ -46,7 +46,7 @@ namespace mame
{ {
short0 |= 0x0800; short0 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
short0 &= ~0x0400; short0 &= ~0x0400;
} }
@ -54,7 +54,7 @@ namespace mame
{ {
short0 |= 0x0400; short0 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
short0 &= ~0x0200; short0 &= ~0x0200;
} }
@ -62,7 +62,7 @@ namespace mame
{ {
short0 |= 0x0200; short0 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
short0 &= ~0x0100; short0 &= ~0x0100;
} }
@ -70,7 +70,7 @@ namespace mame
{ {
short0 |= 0x0100; short0 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
short0 &= ~0x1000; short0 &= ~0x1000;
} }
@ -78,7 +78,7 @@ namespace mame
{ {
short0 |= 0x1000; short0 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
short0 &= ~0x2000; short0 &= ~0x2000;
} }
@ -86,7 +86,7 @@ namespace mame
{ {
short0 |= 0x2000; short0 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
} }
@ -94,7 +94,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
short0 &= ~0x4000; short0 &= ~0x4000;
} }
@ -102,7 +102,7 @@ namespace mame
{ {
short0 |= 0x4000; short0 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
short0 &= unchecked((short)~0x8000); short0 &= unchecked((short)~0x8000);
} }
@ -110,7 +110,7 @@ namespace mame
{ {
short0 |= unchecked((short)0x8000); short0 |= unchecked((short)0x8000);
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
} }
@ -118,7 +118,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
short1 &= ~0x0800; short1 &= ~0x0800;
} }
@ -126,7 +126,7 @@ namespace mame
{ {
short1 |= 0x0800; short1 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
short1 &= ~0x0400; short1 &= ~0x0400;
} }
@ -134,7 +134,7 @@ namespace mame
{ {
short1 |= 0x0400; short1 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
short1 &= ~0x0200; short1 &= ~0x0200;
} }
@ -142,7 +142,7 @@ namespace mame
{ {
short1 |= 0x0200; short1 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
short1 &= ~0x0100; short1 &= ~0x0100;
} }
@ -150,7 +150,7 @@ namespace mame
{ {
short1 |= 0x0100; short1 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
short1 &= ~0x1000; short1 &= ~0x1000;
} }
@ -158,7 +158,7 @@ namespace mame
{ {
short1 |= 0x1000; short1 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
short1 &= ~0x2000; short1 &= ~0x2000;
} }
@ -166,7 +166,7 @@ namespace mame
{ {
short1 |= 0x2000; short1 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
} }
@ -174,7 +174,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
short1 &= ~0x4000; short1 &= ~0x4000;
} }
@ -182,7 +182,7 @@ namespace mame
{ {
short1 |= 0x4000; short1 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
short1 &= unchecked((short)~0x8000); short1 &= unchecked((short)~0x8000);
} }
@ -190,7 +190,7 @@ namespace mame
{ {
short1 |= unchecked((short)0x8000); short1 |= unchecked((short)0x8000);
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
} }
@ -198,7 +198,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
short3 &= ~0x0004; short3 &= ~0x0004;
} }
@ -206,7 +206,7 @@ namespace mame
{ {
short3 |= 0x0004; short3 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
short4 &= ~0x0080; short4 &= ~0x0080;
} }
@ -217,7 +217,7 @@ namespace mame
} }
public static void loop_inputports_neogeo_irrmaze() public static void loop_inputports_neogeo_irrmaze()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
short3 &= ~0x0001; short3 &= ~0x0001;
} }
@ -225,7 +225,7 @@ namespace mame
{ {
short3 |= 0x0001; short3 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
short3 &= ~0x0002; short3 &= ~0x0002;
} }
@ -233,7 +233,7 @@ namespace mame
{ {
short3 |= 0x0002; short3 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
short2 &= ~0x0100; short2 &= ~0x0100;
} }
@ -241,7 +241,7 @@ namespace mame
{ {
short2 |= 0x0100; short2 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
short2 &= ~0x0400; short2 &= ~0x0400;
} }
@ -249,7 +249,7 @@ namespace mame
{ {
short2 |= 0x0400; short2 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
short1 &= ~0x1000; short1 &= ~0x1000;
} }
@ -257,7 +257,7 @@ namespace mame
{ {
short1 |= 0x1000; short1 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
short1 &= ~0x2000; short1 &= ~0x2000;
} }
@ -265,7 +265,7 @@ namespace mame
{ {
short1 |= 0x2000; short1 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
short1 &= ~0x4000; short1 &= ~0x4000;
} }
@ -273,7 +273,7 @@ namespace mame
{ {
short1 |= 0x4000; short1 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
short1 &= unchecked((short)~0x8000); short1 &= unchecked((short)~0x8000);
} }

View File

@ -333,6 +333,7 @@ namespace mame
calendar_init(); calendar_init();
irq3_pending = 1; irq3_pending = 1;
} }
public static void nvram_handler_load_neogeo() public static void nvram_handler_load_neogeo()
{ {
if (File.Exists("nvram\\" + Machine.sName + ".nv")) if (File.Exists("nvram\\" + Machine.sName + ".nv"))

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_pgm_standard() public static void loop_inputports_pgm_standard()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
short2 &= ~0x0001; short2 &= ~0x0001;
} }
@ -14,7 +14,7 @@ namespace mame
{ {
short2 |= 0x0001; short2 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
short2 &= ~0x0002; short2 &= ~0x0002;
} }
@ -22,7 +22,7 @@ namespace mame
{ {
short2 |= 0x0002; short2 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
short0 &= ~0x0001; short0 &= ~0x0001;
} }
@ -30,7 +30,7 @@ namespace mame
{ {
short0 |= 0x0001; short0 |= 0x0001;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
short0 &= ~0x0100; short0 &= ~0x0100;
} }
@ -38,7 +38,7 @@ namespace mame
{ {
short0 |= 0x0100; short0 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
short0 &= ~0x0010; short0 &= ~0x0010;
} }
@ -46,7 +46,7 @@ namespace mame
{ {
short0 |= 0x0010; short0 |= 0x0010;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
short0 &= ~0x0008; short0 &= ~0x0008;
} }
@ -54,7 +54,7 @@ namespace mame
{ {
short0 |= 0x0008; short0 |= 0x0008;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
short0 &= ~0x0004; short0 &= ~0x0004;
} }
@ -62,7 +62,7 @@ namespace mame
{ {
short0 |= 0x0004; short0 |= 0x0004;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
short0 &= ~0x0002; short0 &= ~0x0002;
} }
@ -70,7 +70,7 @@ namespace mame
{ {
short0 |= 0x0002; short0 |= 0x0002;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
short0 &= ~0x0020; short0 &= ~0x0020;
} }
@ -78,7 +78,7 @@ namespace mame
{ {
short0 |= 0x0020; short0 |= 0x0020;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
short0 &= ~0x0040; short0 &= ~0x0040;
} }
@ -86,7 +86,7 @@ namespace mame
{ {
short0 |= 0x0040; short0 |= 0x0040;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
short0 &= ~0x0080; short0 &= ~0x0080;
} }
@ -94,7 +94,7 @@ namespace mame
{ {
short0 |= 0x0080; short0 |= 0x0080;
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
short2 &= ~0x0100; short2 &= ~0x0100;
} }
@ -102,7 +102,7 @@ namespace mame
{ {
short2 |= 0x0100; short2 |= 0x0100;
} }
if (Keyboard.IsPressed(Key.I)) if (Keyboard.IsPressed(Corekey.I))
{ {
} }
@ -110,7 +110,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.O)) if (Keyboard.IsPressed(Corekey.O))
{ {
} }
@ -118,7 +118,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
short0 &= ~0x1000; short0 &= ~0x1000;
} }
@ -126,7 +126,7 @@ namespace mame
{ {
short0 |= 0x1000; short0 |= 0x1000;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
short0 &= ~0x0800; short0 &= ~0x0800;
} }
@ -134,7 +134,7 @@ namespace mame
{ {
short0 |= 0x0800; short0 |= 0x0800;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
short0 &= ~0x0400; short0 &= ~0x0400;
} }
@ -142,7 +142,7 @@ namespace mame
{ {
short0 |= 0x0400; short0 |= 0x0400;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
short0 &= ~0x0200; short0 &= ~0x0200;
} }
@ -150,7 +150,7 @@ namespace mame
{ {
short0 |= 0x0200; short0 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
short0 &= ~0x2000; short0 &= ~0x2000;
} }
@ -158,7 +158,7 @@ namespace mame
{ {
short0 |= 0x2000; short0 |= 0x2000;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
short0 &= ~0x4000; short0 &= ~0x4000;
} }
@ -166,7 +166,7 @@ namespace mame
{ {
short0 |= 0x4000; short0 |= 0x4000;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
short0 &= unchecked((short)~0x8000); short0 &= unchecked((short)~0x8000);
} }
@ -174,7 +174,7 @@ namespace mame
{ {
short0 |= unchecked((short)0x8000); short0 |= unchecked((short)0x8000);
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
short2 &= ~0x0200; short2 &= ~0x0200;
} }
@ -182,7 +182,7 @@ namespace mame
{ {
short2 |= 0x0200; short2 |= 0x0200;
} }
if (Keyboard.IsPressed(Key.NumPad5)) if (Keyboard.IsPressed(Corekey.NumPad5))
{ {
} }
@ -190,7 +190,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.NumPad6)) if (Keyboard.IsPressed(Corekey.NumPad6))
{ {
} }
@ -198,7 +198,7 @@ namespace mame
{ {
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
short2 &= ~0x0020; short2 &= ~0x0020;
} }
@ -206,7 +206,7 @@ namespace mame
{ {
short2 |= 0x0020; short2 |= 0x0020;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
short2 &= ~0x0080; short2 &= ~0x0080;
} }

View File

@ -216,22 +216,6 @@ namespace mame
} }
} }
} }
public static void nvram_handler_load_pgm()
{
if (File.Exists("nvram\\" + Machine.sName + ".nv"))
{
FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Open);
int n = 0x20000;
fs1.Read(Memory.mainram, 0, n);
fs1.Close();
}
}
public static void nvram_handler_save_pgm()
{
FileStream fs1 = new FileStream("nvram\\" + Machine.sName + ".nv", FileMode.Create);
fs1.Write(Memory.mainram, 0, 0x20000);
fs1.Close();
}
} }
} }

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_suna8_starfigh() public static void loop_inputports_suna8_starfigh()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte1 &= unchecked((byte)~0x80); byte1 &= unchecked((byte)~0x80);
} }
@ -14,7 +14,7 @@ namespace mame
{ {
byte1 |= 0x80; byte1 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 &= unchecked((byte)~0x80); byte2 &= unchecked((byte)~0x80);
} }
@ -22,7 +22,7 @@ namespace mame
{ {
byte2 |= 0x80; byte2 |= 0x80;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte1 &= unchecked((byte)~0x40); byte1 &= unchecked((byte)~0x40);
} }
@ -30,7 +30,7 @@ namespace mame
{ {
byte1 |= 0x40; byte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte2 &= unchecked((byte)~0x40); byte2 &= unchecked((byte)~0x40);
} }
@ -38,7 +38,7 @@ namespace mame
{ {
byte2 |= 0x40; byte2 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
@ -46,7 +46,7 @@ namespace mame
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
byte1 &= unchecked((byte)~0x04); byte1 &= unchecked((byte)~0x04);
} }
@ -54,7 +54,7 @@ namespace mame
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
byte1 &= unchecked((byte)~0x02); byte1 &= unchecked((byte)~0x02);
} }
@ -62,7 +62,7 @@ namespace mame
{ {
byte1 |= 0x02; byte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
@ -70,7 +70,7 @@ namespace mame
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
@ -78,7 +78,7 @@ namespace mame
{ {
byte1 |= 0x10; byte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte1 &= unchecked((byte)~0x20); byte1 &= unchecked((byte)~0x20);
} }
@ -86,7 +86,7 @@ namespace mame
{ {
byte1 |= 0x20; byte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
@ -94,7 +94,7 @@ namespace mame
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
byte2 &= unchecked((byte)~0x04); byte2 &= unchecked((byte)~0x04);
} }
@ -102,7 +102,7 @@ namespace mame
{ {
byte2 |= 0x04; byte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
byte2 &= unchecked((byte)~0x02); byte2 &= unchecked((byte)~0x02);
} }
@ -110,7 +110,7 @@ namespace mame
{ {
byte2 |= 0x02; byte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
byte2 &= unchecked((byte)~0x01); byte2 &= unchecked((byte)~0x01);
} }
@ -118,7 +118,7 @@ namespace mame
{ {
byte2 |= 0x01; byte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte2 &= unchecked((byte)~0x10); byte2 &= unchecked((byte)~0x10);
} }
@ -126,7 +126,7 @@ namespace mame
{ {
byte2 |= 0x10; byte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte2 &= unchecked((byte)~0x20); byte2 &= unchecked((byte)~0x20);
} }

View File

@ -154,12 +154,6 @@ namespace mame
{ {
samplebuf[i] = (short)((sbyte)(samplesrom[i] ^ 0x80) * 256); samplebuf[i] = (short)((sbyte)(samplesrom[i] ^ 0x80) * 256);
} }
/*BinaryWriter bw1 = new BinaryWriter(new FileStream(@"\VS2008\compare1\compare1\bin\Debug\sample.dat", FileMode.Append));
for (i = 0; i < len; i++)
{
bw1.Write((byte)(samplebuf[i] >> 8));
}
bw1.Close();*/
} }
public static void machine_reset_suna8() public static void machine_reset_suna8()
{ {

View File

@ -10,7 +10,7 @@ namespace mame
} }
public static void loop_inputports_taito_bublbobl() public static void loop_inputports_taito_bublbobl()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbyte0 |= 0x04; sbyte0 |= 0x04;
} }
@ -18,7 +18,7 @@ namespace mame
{ {
sbyte0 &= ~0x04; sbyte0 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbyte0 |= 0x08; sbyte0 |= 0x08;
} }
@ -26,7 +26,7 @@ namespace mame
{ {
sbyte0 &= ~0x08; sbyte0 &= ~0x08;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte1 &= ~0x40; sbyte1 &= ~0x40;
} }
@ -34,7 +34,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
sbyte2 &= ~0x40; sbyte2 &= ~0x40;
} }
@ -42,7 +42,7 @@ namespace mame
{ {
sbyte2 |= 0x40; sbyte2 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
@ -50,7 +50,7 @@ namespace mame
{ {
sbyte1 |= 0x02; sbyte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
@ -74,7 +74,7 @@ namespace mame
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
}*/ }*/
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
sbyte1 &= ~0x20; sbyte1 &= ~0x20;
} }
@ -82,7 +82,7 @@ namespace mame
{ {
sbyte1 |= 0x20; sbyte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
sbyte1 &= ~0x10; sbyte1 &= ~0x10;
} }
@ -98,7 +98,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
}*/ }*/
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
@ -106,7 +106,7 @@ namespace mame
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
sbyte2 &= ~0x01; sbyte2 &= ~0x01;
} }
@ -130,7 +130,7 @@ namespace mame
{ {
sbyte2 |= 0x10; sbyte2 |= 0x10;
}*/ }*/
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte2 &= ~0x20; sbyte2 &= ~0x20;
} }
@ -138,7 +138,7 @@ namespace mame
{ {
sbyte2 |= 0x20; sbyte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte2 &= ~0x10; sbyte2 &= ~0x10;
} }
@ -154,7 +154,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
}*/ }*/
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte0 &= ~0x02; sbyte0 &= ~0x02;
} }
@ -173,7 +173,7 @@ namespace mame
} }
public static void loop_inputports_taito_tokio() public static void loop_inputports_taito_tokio()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbyte0 |= 0x04; sbyte0 |= 0x04;
} }
@ -181,7 +181,7 @@ namespace mame
{ {
sbyte0 &= ~0x04; sbyte0 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbyte0 |= 0x08; sbyte0 |= 0x08;
} }
@ -189,7 +189,7 @@ namespace mame
{ {
sbyte0 &= ~0x08; sbyte0 &= ~0x08;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte1 &= ~0x40; sbyte1 &= ~0x40;
} }
@ -197,7 +197,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
sbyte2 &= ~0x40; sbyte2 &= ~0x40;
} }
@ -205,7 +205,7 @@ namespace mame
{ {
sbyte2 |= 0x40; sbyte2 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
@ -213,7 +213,7 @@ namespace mame
{ {
sbyte1 |= 0x02; sbyte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
@ -221,7 +221,7 @@ namespace mame
{ {
sbyte1 |= 0x01; sbyte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
sbyte1 &= ~0x04; sbyte1 &= ~0x04;
} }
@ -229,7 +229,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
sbyte1 &= ~0x08; sbyte1 &= ~0x08;
} }
@ -237,7 +237,7 @@ namespace mame
{ {
sbyte1 |= 0x08; sbyte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
sbyte1 &= ~0x20; sbyte1 &= ~0x20;
} }
@ -245,7 +245,7 @@ namespace mame
{ {
sbyte1 |= 0x20; sbyte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
sbyte1 &= ~0x10; sbyte1 &= ~0x10;
} }
@ -261,7 +261,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
}*/ }*/
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
@ -269,7 +269,7 @@ namespace mame
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
sbyte2 &= ~0x01; sbyte2 &= ~0x01;
} }
@ -277,7 +277,7 @@ namespace mame
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
sbyte2 &= ~0x04; sbyte2 &= ~0x04;
} }
@ -285,7 +285,7 @@ namespace mame
{ {
sbyte2 |= 0x04; sbyte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
sbyte2 &= ~0x08; sbyte2 &= ~0x08;
} }
@ -293,7 +293,7 @@ namespace mame
{ {
sbyte2 |= 0x08; sbyte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte2 &= ~0x20; sbyte2 &= ~0x20;
} }
@ -301,7 +301,7 @@ namespace mame
{ {
sbyte2 |= 0x20; sbyte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte2 &= ~0x10; sbyte2 &= ~0x10;
} }
@ -317,7 +317,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
}*/ }*/
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte0 &= ~0x02; sbyte0 &= ~0x02;
} }
@ -336,7 +336,7 @@ namespace mame
} }
public static void loop_inputports_taito_boblbobl() public static void loop_inputports_taito_boblbobl()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbyte0 |= 0x08; sbyte0 |= 0x08;
} }
@ -344,7 +344,7 @@ namespace mame
{ {
sbyte0 &= ~0x08; sbyte0 &= ~0x08;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbyte0 |= 0x04; sbyte0 |= 0x04;
} }
@ -352,7 +352,7 @@ namespace mame
{ {
sbyte0 &= ~0x04; sbyte0 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte0 &= ~0x40; sbyte0 &= ~0x40;
} }
@ -360,7 +360,7 @@ namespace mame
{ {
sbyte0 |= 0x40; sbyte0 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
sbyte1 &= ~0x40; sbyte1 &= ~0x40;
} }
@ -368,7 +368,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
sbyte0 &= ~0x02; sbyte0 &= ~0x02;
} }
@ -376,7 +376,7 @@ namespace mame
{ {
sbyte0 |= 0x02; sbyte0 |= 0x02;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
sbyte0 &= ~0x01; sbyte0 &= ~0x01;
} }
@ -400,7 +400,7 @@ namespace mame
{ {
sbyte1 |= 0x08; sbyte1 |= 0x08;
}*/ }*/
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
sbyte0 &= ~0x20; sbyte0 &= ~0x20;
} }
@ -408,7 +408,7 @@ namespace mame
{ {
sbyte0 |= 0x20; sbyte0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
sbyte0 &= ~0x10; sbyte0 &= ~0x10;
} }
@ -424,7 +424,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
}*/ }*/
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
@ -432,7 +432,7 @@ namespace mame
{ {
sbyte1 |= 0x02; sbyte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
@ -456,7 +456,7 @@ namespace mame
{ {
sbyte2 |= 0x08; sbyte2 |= 0x08;
}*/ }*/
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte1 &= ~0x20; sbyte1 &= ~0x20;
} }
@ -464,7 +464,7 @@ namespace mame
{ {
sbyte1 |= 0x20; sbyte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte1 &= ~0x10; sbyte1 &= ~0x10;
} }
@ -480,7 +480,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
}*/ }*/
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte1 &= ~0x08; sbyte1 &= ~0x08;
} }
@ -499,7 +499,7 @@ namespace mame
} }
public static void loop_inputports_taito_opwolf() public static void loop_inputports_taito_opwolf()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbyte0 |= 0x01; sbyte0 |= 0x01;
} }
@ -507,7 +507,7 @@ namespace mame
{ {
sbyte0 &= ~0x01; sbyte0 &= ~0x01;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbyte0 |= 0x02; sbyte0 |= 0x02;
} }
@ -515,7 +515,7 @@ namespace mame
{ {
sbyte0 &= ~0x02; sbyte0 &= ~0x02;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte1 &= ~0x10; sbyte1 &= ~0x10;
} }
@ -563,7 +563,7 @@ namespace mame
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
}*/ }*/
if (Keyboard.IsPressed(Key.J) || Mouse.buttons[0] != 0) if (Keyboard.IsPressed(Corekey.J) || Mouse.buttons[0] != 0)
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
@ -571,7 +571,7 @@ namespace mame
{ {
sbyte1 |= 0x01; sbyte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.K) || Mouse.buttons[1] != 0) if (Keyboard.IsPressed(Corekey.K) || Mouse.buttons[1] != 0)
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
@ -643,7 +643,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
}*/ }*/
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte1 &= ~0x04; sbyte1 &= ~0x04;
} }
@ -651,7 +651,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
sbyte1 &= ~0x08; sbyte1 &= ~0x08;
} }
@ -666,7 +666,7 @@ namespace mame
} }
public static void loop_inputports_taito_opwolfp() public static void loop_inputports_taito_opwolfp()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbyte3 |= 0x02; sbyte3 |= 0x02;
} }
@ -674,7 +674,7 @@ namespace mame
{ {
sbyte3 &= ~0x02; sbyte3 &= ~0x02;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbyte3 |= 0x04; sbyte3 |= 0x04;
} }
@ -682,7 +682,7 @@ namespace mame
{ {
sbyte3 &= ~0x04; sbyte3 &= ~0x04;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte2 &= ~0x20; sbyte2 &= ~0x20;
} }
@ -690,7 +690,7 @@ namespace mame
{ {
sbyte2 |= 0x20; sbyte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.J) || Mouse.buttons[0] != 0) if (Keyboard.IsPressed(Corekey.J) || Mouse.buttons[0] != 0)
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
@ -698,7 +698,7 @@ namespace mame
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.K) || Mouse.buttons[1] != 0) if (Keyboard.IsPressed(Corekey.K) || Mouse.buttons[1] != 0)
{ {
sbyte2 &= ~0x04; sbyte2 &= ~0x04;
} }
@ -706,7 +706,7 @@ namespace mame
{ {
sbyte2 |= 0x04; sbyte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte2 &= ~0x08; sbyte2 &= ~0x08;
} }
@ -714,7 +714,7 @@ namespace mame
{ {
sbyte2 |= 0x08; sbyte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
sbyte2 &= ~0x10; sbyte2 &= ~0x10;
} }

View File

@ -10,7 +10,7 @@ namespace mame
} }
public static void loop_inputports_taitob_pbobble() public static void loop_inputports_taitob_pbobble()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
dswb &= unchecked((byte)~0x10); dswb &= unchecked((byte)~0x10);
} }
@ -18,7 +18,7 @@ namespace mame
{ {
dswb |= 0x10; dswb |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
dswb &= unchecked((byte)~0x20); dswb &= unchecked((byte)~0x20);
} }
@ -26,7 +26,7 @@ namespace mame
{ {
dswb |= 0x20; dswb |= 0x20;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte0 &= ~0x10; sbyte0 &= ~0x10;
} }
@ -34,7 +34,7 @@ namespace mame
{ {
sbyte0 |= 0x10; sbyte0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
sbyte0 &= ~0x20; sbyte0 &= ~0x20;
} }
@ -42,7 +42,7 @@ namespace mame
{ {
sbyte0 |= 0x20; sbyte0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
sbyte2 &= ~0x08; sbyte2 &= ~0x08;
} }
@ -50,7 +50,7 @@ namespace mame
{ {
sbyte2 |= 0x08; sbyte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
sbyte2 &= ~0x04; sbyte2 &= ~0x04;
} }
@ -58,7 +58,7 @@ namespace mame
{ {
sbyte2 |= 0x04; sbyte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
@ -66,7 +66,7 @@ namespace mame
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
sbyte2 &= ~0x01; sbyte2 &= ~0x01;
} }
@ -74,7 +74,7 @@ namespace mame
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
@ -82,7 +82,7 @@ namespace mame
{ {
sbyte1 |= 0x01; sbyte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }
@ -90,7 +90,7 @@ namespace mame
{ {
sbyte1 |= 0x02; sbyte1 |= 0x02;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
sbyte1 &= ~0x04; sbyte1 &= ~0x04;
} }
@ -98,7 +98,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
sbyte2 &= unchecked((sbyte)~0x80); sbyte2 &= unchecked((sbyte)~0x80);
} }
@ -106,7 +106,7 @@ namespace mame
{ {
sbyte2 |= unchecked((sbyte)0x80); sbyte2 |= unchecked((sbyte)0x80);
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
sbyte2 &= ~0x40; sbyte2 &= ~0x40;
} }
@ -114,7 +114,7 @@ namespace mame
{ {
sbyte2 |= 0x40; sbyte2 |= 0x40;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
sbyte2 &= ~0x20; sbyte2 &= ~0x20;
} }
@ -122,7 +122,7 @@ namespace mame
{ {
sbyte2 |= 0x20; sbyte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
sbyte2 &= ~0x10; sbyte2 &= ~0x10;
} }
@ -130,7 +130,7 @@ namespace mame
{ {
sbyte2 |= 0x10; sbyte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte1 &= ~0x10; sbyte1 &= ~0x10;
} }
@ -138,7 +138,7 @@ namespace mame
{ {
sbyte1 |= 0x10; sbyte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte1 &= ~0x20; sbyte1 &= ~0x20;
} }
@ -146,7 +146,7 @@ namespace mame
{ {
sbyte1 |= 0x20; sbyte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
sbyte1 &= ~0x40; sbyte1 &= ~0x40;
} }
@ -154,7 +154,7 @@ namespace mame
{ {
sbyte1 |= 0x40; sbyte1 |= 0x40;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte0 &= ~0x01; sbyte0 &= ~0x01;
} }
@ -162,7 +162,7 @@ namespace mame
{ {
sbyte0 |= 0x01; sbyte0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
sbyte0 &= ~0x02; sbyte0 &= ~0x02;
} }
@ -173,7 +173,7 @@ namespace mame
} }
public static void loop_inputports_taitob_silentd() public static void loop_inputports_taitob_silentd()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
sbyte1 &= ~0x10; sbyte1 &= ~0x10;
} }
@ -181,7 +181,7 @@ namespace mame
{ {
sbyte1 |= 0x10; sbyte1 |= 0x10;
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
sbyte1 &= ~0x20; sbyte1 &= ~0x20;
} }
@ -189,7 +189,7 @@ namespace mame
{ {
sbyte1 |= 0x20; sbyte1 |= 0x20;
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
sbyte1 &= ~0x04; sbyte1 &= ~0x04;
} }
@ -197,7 +197,7 @@ namespace mame
{ {
sbyte1 |= 0x04; sbyte1 |= 0x04;
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
sbyte1 &= ~0x08; sbyte1 &= ~0x08;
} }
@ -205,7 +205,7 @@ namespace mame
{ {
sbyte1 |= 0x08; sbyte1 |= 0x08;
} }
if (Keyboard.IsPressed(Key.D)) if (Keyboard.IsPressed(Corekey.D))
{ {
sbyte2 &= ~0x08; sbyte2 &= ~0x08;
} }
@ -213,7 +213,7 @@ namespace mame
{ {
sbyte2 |= 0x08; sbyte2 |= 0x08;
} }
if (Keyboard.IsPressed(Key.A)) if (Keyboard.IsPressed(Corekey.A))
{ {
sbyte2 &= ~0x04; sbyte2 &= ~0x04;
} }
@ -221,7 +221,7 @@ namespace mame
{ {
sbyte2 |= 0x04; sbyte2 |= 0x04;
} }
if (Keyboard.IsPressed(Key.S)) if (Keyboard.IsPressed(Corekey.S))
{ {
sbyte2 &= ~0x02; sbyte2 &= ~0x02;
} }
@ -229,7 +229,7 @@ namespace mame
{ {
sbyte2 |= 0x02; sbyte2 |= 0x02;
} }
if (Keyboard.IsPressed(Key.W)) if (Keyboard.IsPressed(Corekey.W))
{ {
sbyte2 &= ~0x01; sbyte2 &= ~0x01;
} }
@ -237,7 +237,7 @@ namespace mame
{ {
sbyte2 |= 0x01; sbyte2 |= 0x01;
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
sbyte0 &= ~0x01; sbyte0 &= ~0x01;
} }
@ -245,7 +245,7 @@ namespace mame
{ {
sbyte0 |= 0x01; sbyte0 |= 0x01;
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
sbyte0 &= ~0x02; sbyte0 &= ~0x02;
} }
@ -253,7 +253,7 @@ namespace mame
{ {
sbyte0 |= 0x02; sbyte0 |= 0x02;
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
sbyte0 &= ~0x04; sbyte0 &= ~0x04;
} }
@ -261,7 +261,7 @@ namespace mame
{ {
sbyte0 |= 0x04; sbyte0 |= 0x04;
} }
if (Keyboard.IsPressed(Key.Right)) if (Keyboard.IsPressed(Corekey.Right))
{ {
sbyte2 &= unchecked((sbyte)~0x80); sbyte2 &= unchecked((sbyte)~0x80);
} }
@ -269,7 +269,7 @@ namespace mame
{ {
sbyte2 |= unchecked((sbyte)0x80); sbyte2 |= unchecked((sbyte)0x80);
} }
if (Keyboard.IsPressed(Key.Left)) if (Keyboard.IsPressed(Corekey.Left))
{ {
sbyte2 &= ~0x40; sbyte2 &= ~0x40;
} }
@ -277,7 +277,7 @@ namespace mame
{ {
sbyte2 |= 0x40; sbyte2 |= 0x40;
} }
if (Keyboard.IsPressed(Key.Down)) if (Keyboard.IsPressed(Corekey.Down))
{ {
sbyte2 &= ~0x20; sbyte2 &= ~0x20;
} }
@ -285,7 +285,7 @@ namespace mame
{ {
sbyte2 |= 0x20; sbyte2 |= 0x20;
} }
if (Keyboard.IsPressed(Key.Up)) if (Keyboard.IsPressed(Corekey.Up))
{ {
sbyte2 &= ~0x10; sbyte2 &= ~0x10;
} }
@ -293,7 +293,7 @@ namespace mame
{ {
sbyte2 |= 0x10; sbyte2 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
sbyte0 &= ~0x08; sbyte0 &= ~0x08;
} }
@ -301,7 +301,7 @@ namespace mame
{ {
sbyte0 |= 0x08; sbyte0 |= 0x08;
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
sbyte0 &= ~0x10; sbyte0 &= ~0x10;
} }
@ -309,7 +309,7 @@ namespace mame
{ {
sbyte0 |= 0x10; sbyte0 |= 0x10;
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
sbyte0 &= ~0x20; sbyte0 &= ~0x20;
} }
@ -317,7 +317,7 @@ namespace mame
{ {
sbyte0 |= 0x20; sbyte0 |= 0x20;
} }
if (Keyboard.IsPressed(Key.R)) if (Keyboard.IsPressed(Corekey.R))
{ {
sbyte1 &= ~0x01; sbyte1 &= ~0x01;
} }
@ -325,7 +325,7 @@ namespace mame
{ {
sbyte1 |= 0x01; sbyte1 |= 0x01;
} }
if (Keyboard.IsPressed(Key.T)) if (Keyboard.IsPressed(Corekey.T))
{ {
sbyte1 &= ~0x02; sbyte1 &= ~0x02;
} }

View File

@ -6,7 +6,7 @@ namespace mame
{ {
public static void loop_inputports_tehkan_pbaction() public static void loop_inputports_tehkan_pbaction()
{ {
if (Keyboard.IsPressed(Key.D5)) if (Keyboard.IsPressed(Corekey.D5))
{ {
byte2 |= 0x01; byte2 |= 0x01;
} }
@ -14,7 +14,7 @@ namespace mame
{ {
byte2 &= unchecked((byte)~0x01); byte2 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.D6)) if (Keyboard.IsPressed(Corekey.D6))
{ {
byte2 |= 0x02; byte2 |= 0x02;
} }
@ -22,7 +22,7 @@ namespace mame
{ {
byte2 &= unchecked((byte)~0x02); byte2 &= unchecked((byte)~0x02);
} }
if (Keyboard.IsPressed(Key.D1)) if (Keyboard.IsPressed(Corekey.D1))
{ {
byte2 |= 0x04; byte2 |= 0x04;
} }
@ -30,7 +30,7 @@ namespace mame
{ {
byte2 &= unchecked((byte)~0x04); byte2 &= unchecked((byte)~0x04);
} }
if (Keyboard.IsPressed(Key.D2)) if (Keyboard.IsPressed(Corekey.D2))
{ {
byte2 |= 0x08; byte2 |= 0x08;
} }
@ -38,7 +38,7 @@ namespace mame
{ {
byte2 &= unchecked((byte)~0x08); byte2 &= unchecked((byte)~0x08);
} }
if (Keyboard.IsPressed(Key.J)) if (Keyboard.IsPressed(Corekey.J))
{ {
byte0 |= 0x08; byte0 |= 0x08;
} }
@ -46,7 +46,7 @@ namespace mame
{ {
byte0 &= unchecked((byte)~0x08); byte0 &= unchecked((byte)~0x08);
} }
if (Keyboard.IsPressed(Key.K)) if (Keyboard.IsPressed(Corekey.K))
{ {
byte0 |= 0x10; byte0 |= 0x10;
} }
@ -54,7 +54,7 @@ namespace mame
{ {
byte0 &= unchecked((byte)~0x10); byte0 &= unchecked((byte)~0x10);
} }
if (Keyboard.IsPressed(Key.L)) if (Keyboard.IsPressed(Corekey.L))
{ {
byte0 |= 0x01; byte0 |= 0x01;
} }
@ -62,7 +62,7 @@ namespace mame
{ {
byte0 &= unchecked((byte)~0x01); byte0 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.U)) if (Keyboard.IsPressed(Corekey.U))
{ {
byte0 |= 0x04; byte0 |= 0x04;
} }
@ -70,7 +70,7 @@ namespace mame
{ {
byte0 &= unchecked((byte)~0x04); byte0 &= unchecked((byte)~0x04);
} }
if (Keyboard.IsPressed(Key.NumPad1)) if (Keyboard.IsPressed(Corekey.NumPad1))
{ {
byte1 |= 0x08; byte1 |= 0x08;
} }
@ -78,7 +78,7 @@ namespace mame
{ {
byte1 &= unchecked((byte)~0x08); byte1 &= unchecked((byte)~0x08);
} }
if (Keyboard.IsPressed(Key.NumPad2)) if (Keyboard.IsPressed(Corekey.NumPad2))
{ {
byte1 |= 0x10; byte1 |= 0x10;
} }
@ -86,7 +86,7 @@ namespace mame
{ {
byte1 &= unchecked((byte)~0x10); byte1 &= unchecked((byte)~0x10);
} }
if (Keyboard.IsPressed(Key.NumPad3)) if (Keyboard.IsPressed(Corekey.NumPad3))
{ {
byte1 |= 0x01; byte1 |= 0x01;
} }
@ -94,7 +94,7 @@ namespace mame
{ {
byte1 &= unchecked((byte)~0x01); byte1 &= unchecked((byte)~0x01);
} }
if (Keyboard.IsPressed(Key.NumPad4)) if (Keyboard.IsPressed(Corekey.NumPad4))
{ {
byte1 |= 0x04; byte1 |= 0x04;
} }

View File

@ -1,7 +1,7 @@
namespace MAME.Core.run_interface namespace MAME.Core.run_interface
{ {
public enum Key public enum Corekey
{ {
Next = 209, Next = 209,
Right = 205, Right = 205,

View File

@ -2,7 +2,7 @@
{ {
public interface IKeyboard public interface IKeyboard
{ {
bool IsPressed(Key key); bool IsPressed(Corekey key);
bool IsTriggered(Key key); bool IsTriggered(Corekey key);
} }
} }

View File

@ -0,0 +1,32 @@
namespace MAME.Core.run_interface
{
public enum MotionKey
{
P1_INSERT_COIN,
P1_GAMESTART,
P1_UP,
P1_DOWN,
P1_LEFT,
P1_RIGHT,
P1_BTN_1,
P1_BTN_2,
P1_BTN_3,
P1_BTN_4,
P1_BTN_5,
P1_BTN_6,
P2_INSERT_COIN,
P2_GAMESTART,
P2_UP,
P2_DOWN,
P2_LEFT,
P2_RIGHT,
P2_BTN_1,
P2_BTN_2,
P2_BTN_3,
P2_BTN_4,
P2_BTN_5,
P2_BTN_6,
}
}