127 lines
6.1 KiB
C#
127 lines
6.1 KiB
C#
|
namespace MAME.Core
|
|||
|
{
|
|||
|
public class Crosshair
|
|||
|
{
|
|||
|
public struct crosshair_global
|
|||
|
{
|
|||
|
public bool[] used;
|
|||
|
public bool[] visible;
|
|||
|
/*bitmap_t * bitmap[MAX_PLAYERS];
|
|||
|
render_texture * texture[MAX_PLAYERS];
|
|||
|
const device_config *screen[MAX_PLAYERS];*/
|
|||
|
public int[] x;
|
|||
|
public int[] y;
|
|||
|
public byte fade;
|
|||
|
public byte animation_counter;
|
|||
|
}
|
|||
|
public static crosshair_global global;
|
|||
|
public static byte[] crosshair_raw_top = new byte[]
|
|||
|
{
|
|||
|
0x00,0x20,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,
|
|||
|
0x00,0x70,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x00,
|
|||
|
0x00,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf0,0x00,
|
|||
|
0x01,0xf8,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xf8,0x00,
|
|||
|
0x03,0xfc,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x03,0xfc,0x00,
|
|||
|
0x07,0xfe,0x00,0x00,0x00,0x0f,0xfe,0x00,0x00,0x00,0x07,0xfe,0x00,
|
|||
|
0x0f,0xff,0x00,0x00,0x01,0xff,0xff,0xf0,0x00,0x00,0x0f,0xff,0x00,
|
|||
|
0x1f,0xff,0x80,0x00,0x1f,0xff,0xff,0xff,0x00,0x00,0x1f,0xff,0x80,
|
|||
|
0x3f,0xff,0x80,0x00,0xff,0xff,0xff,0xff,0xe0,0x00,0x1f,0xff,0xc0,
|
|||
|
0x7f,0xff,0xc0,0x03,0xff,0xff,0xff,0xff,0xf8,0x00,0x3f,0xff,0xe0,
|
|||
|
0xff,0xff,0xe0,0x07,0xff,0xff,0xff,0xff,0xfc,0x00,0x7f,0xff,0xf0,
|
|||
|
0x7f,0xff,0xf0,0x1f,0xff,0xff,0xff,0xff,0xff,0x00,0xff,0xff,0xe0,
|
|||
|
0x3f,0xff,0xf8,0x7f,0xff,0xff,0xff,0xff,0xff,0xc1,0xff,0xff,0xc0,
|
|||
|
0x0f,0xff,0xf8,0xff,0xff,0xff,0xff,0xff,0xff,0xe1,0xff,0xff,0x00,
|
|||
|
0x07,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfb,0xff,0xfe,0x00,
|
|||
|
0x03,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xfc,0x00,
|
|||
|
0x01,0xff,0xff,0xff,0xff,0xf0,0x01,0xff,0xff,0xff,0xff,0xf8,0x00,
|
|||
|
0x00,0x7f,0xff,0xff,0xff,0x00,0x00,0x1f,0xff,0xff,0xff,0xe0,0x00,
|
|||
|
0x00,0x3f,0xff,0xff,0xf8,0x00,0x00,0x03,0xff,0xff,0xff,0xc0,0x00,
|
|||
|
0x00,0x1f,0xff,0xff,0xe0,0x00,0x00,0x00,0xff,0xff,0xff,0x80,0x00,
|
|||
|
0x00,0x0f,0xff,0xff,0x80,0x00,0x00,0x00,0x3f,0xff,0xff,0x00,0x00,
|
|||
|
0x00,0x03,0xff,0xfe,0x00,0x00,0x00,0x00,0x0f,0xff,0xfc,0x00,0x00,
|
|||
|
0x00,0x01,0xff,0xfc,0x00,0x00,0x00,0x00,0x07,0xff,0xf8,0x00,0x00,
|
|||
|
0x00,0x03,0xff,0xf8,0x00,0x00,0x00,0x00,0x01,0xff,0xf8,0x00,0x00,
|
|||
|
0x00,0x07,0xff,0xfc,0x00,0x00,0x00,0x00,0x03,0xff,0xfc,0x00,0x00,
|
|||
|
0x00,0x0f,0xff,0xfe,0x00,0x00,0x00,0x00,0x07,0xff,0xfe,0x00,0x00,
|
|||
|
0x00,0x0f,0xff,0xff,0x00,0x00,0x00,0x00,0x0f,0xff,0xfe,0x00,0x00,
|
|||
|
0x00,0x1f,0xff,0xff,0x80,0x00,0x00,0x00,0x1f,0xff,0xff,0x00,0x00,
|
|||
|
0x00,0x1f,0xff,0xff,0x80,0x00,0x00,0x00,0x1f,0xff,0xff,0x00,0x00,
|
|||
|
0x00,0x3f,0xfe,0xff,0xc0,0x00,0x00,0x00,0x3f,0xff,0xff,0x80,0x00,
|
|||
|
0x00,0x7f,0xfc,0x7f,0xe0,0x00,0x00,0x00,0x7f,0xe7,0xff,0xc0,0x00,
|
|||
|
0x00,0x7f,0xf8,0x3f,0xf0,0x00,0x00,0x00,0xff,0xc3,0xff,0xc0,0x00,
|
|||
|
0x00,0xff,0xf8,0x1f,0xf8,0x00,0x00,0x01,0xff,0x83,0xff,0xe0,0x00,
|
|||
|
0x00,0xff,0xf0,0x07,0xf8,0x00,0x00,0x01,0xfe,0x01,0xff,0xe0,0x00,
|
|||
|
0x00,0xff,0xf0,0x03,0xfc,0x00,0x00,0x03,0xfc,0x01,0xff,0xe0,0x00,
|
|||
|
0x01,0xff,0xe0,0x01,0xfe,0x00,0x00,0x07,0xf8,0x00,0xff,0xf0,0x00,
|
|||
|
0x01,0xff,0xe0,0x00,0xff,0x00,0x00,0x0f,0xf0,0x00,0xff,0xf0,0x00,
|
|||
|
0x01,0xff,0xc0,0x00,0x3f,0x80,0x00,0x1f,0xc0,0x00,0x7f,0xf0,0x00,
|
|||
|
0x01,0xff,0xc0,0x00,0x1f,0x80,0x00,0x1f,0x80,0x00,0x7f,0xf0,0x00,
|
|||
|
0x03,0xff,0xc0,0x00,0x0f,0xc0,0x00,0x3f,0x00,0x00,0x7f,0xf8,0x00,
|
|||
|
0x03,0xff,0x80,0x00,0x07,0xe0,0x00,0x7e,0x00,0x00,0x3f,0xf8,0x00,
|
|||
|
0x03,0xff,0x80,0x00,0x01,0xf0,0x00,0xf8,0x00,0x00,0x3f,0xf8,0x00,
|
|||
|
0x03,0xff,0x80,0x00,0x00,0xf8,0x01,0xf0,0x00,0x00,0x3f,0xf8,0x00,
|
|||
|
0x03,0xff,0x80,0x00,0x00,0x78,0x01,0xe0,0x00,0x00,0x3f,0xf8,0x00,
|
|||
|
0x07,0xff,0x00,0x00,0x00,0x3c,0x03,0xc0,0x00,0x00,0x3f,0xfc,0x00,
|
|||
|
0x07,0xff,0x00,0x00,0x00,0x0e,0x07,0x00,0x00,0x00,0x1f,0xfc,0x00,
|
|||
|
0x07,0xff,0x00,0x00,0x00,0x07,0x0e,0x00,0x00,0x00,0x1f,0xfc,0x00,
|
|||
|
0x07,0xff,0x00,0x00,0x00,0x03,0x9c,0x00,0x00,0x00,0x1f,0xfc,0x00,
|
|||
|
0x07,0xff,0x00,0x00,0x00,0x01,0x98,0x00,0x00,0x00,0x1f,0xfc,0x00,
|
|||
|
0x07,0xff,0x00,0x00,0x00,0x00,0x60,0x00,0x00,0x00,0x1f,0xfc,0x00
|
|||
|
};
|
|||
|
public static uint[] crosshair_colors = new uint[]
|
|||
|
{
|
|||
|
0x4040ff,
|
|||
|
0xff4040,
|
|||
|
0x40ff40,
|
|||
|
0xffff40,
|
|||
|
0xff40ff,
|
|||
|
0x40ffff,
|
|||
|
0xffffff
|
|||
|
};
|
|||
|
public static void crosshair_init()
|
|||
|
{
|
|||
|
global.used = new bool[8];
|
|||
|
global.visible = new bool[8];
|
|||
|
global.x = new int[8];
|
|||
|
global.y = new int[8];
|
|||
|
switch (Machine.sName)
|
|||
|
{
|
|||
|
case "opwolf":
|
|||
|
case "opwolfa":
|
|||
|
case "opwolfj":
|
|||
|
case "opwolfu":
|
|||
|
case "opwolfb":
|
|||
|
case "opwolfp":
|
|||
|
global.used[0] = true;
|
|||
|
global.visible[0] = true;
|
|||
|
Video.drawcrosshair = Video.drawcrosshair_opwolf;
|
|||
|
break;
|
|||
|
default:
|
|||
|
Video.drawcrosshair = Video.drawcrosshair_null;
|
|||
|
break;
|
|||
|
}
|
|||
|
}
|
|||
|
public static void animate_opwolf()
|
|||
|
{
|
|||
|
int player;
|
|||
|
global.animation_counter += 0x04;
|
|||
|
if (global.animation_counter < 0x80)
|
|||
|
{
|
|||
|
global.fade = (byte)(0xa0 + (0x60 * (global.animation_counter & 0x7f) / 0x80));
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
global.fade = (byte)(0xa0 + (0x60 * (~global.animation_counter & 0x7f) / 0x80));
|
|||
|
}
|
|||
|
for (player = 0; player < 8; player++)
|
|||
|
{
|
|||
|
if (global.used[player])
|
|||
|
{
|
|||
|
global.x[player] = ((Taito.p1x * 320) / 256) - 0;
|
|||
|
global.y[player] = Taito.p1y - 10;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|