This commit is contained in:
sin365 2025-01-17 11:07:16 +08:00
parent 5c4d90bf01
commit 665aadea85
5 changed files with 65 additions and 17 deletions

View File

@ -149,7 +149,7 @@ namespace cpu.m68000
X = (value & 0x0010) != 0; X = (value & 0x0010) != 0;
} }
} }
public int Interrupt { get; set; } public int Interrupt;// { get; set; }
// Memory Access // Memory Access
public Func<int, sbyte> ReadOpByte, ReadByte; public Func<int, sbyte> ReadOpByte, ReadByte;

View File

@ -330,7 +330,8 @@ namespace MAME.Core
callback_timer_modified = false; callback_timer_modified = false;
callback_timer = timer; callback_timer = timer;
callback_timer_expire_time = timer.expire; callback_timer_expire_time = timer.expire;
if (was_enabled && (timer.action != null && timer.action != Cpuexec.null_callback)) //if (was_enabled && (timer.action != null && timer.action != Cpuexec.null_callback))
if (was_enabled && (timer.action != null && timer.func != "boost_callback"))
{ {
timer.action(); timer.action();
} }

View File

@ -1,4 +1,5 @@
using MAME.Core; using MAME.Core;
using System;
namespace MAME.Core namespace MAME.Core
{ {
@ -58,9 +59,11 @@ namespace MAME.Core
byte bright = 0xa7; byte bright = 0xa7;
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = (y * Video.fullwidth) + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff);
green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff);
blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff); blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff);
@ -73,9 +76,11 @@ namespace MAME.Core
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = (y * Video.fullwidth) + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]]; Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]];
} }
} }
@ -138,9 +143,11 @@ namespace MAME.Core
byte bright = 0xa7; byte bright = 0xa7;
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
if (Video.bitmapbase[Video.curbitmap][i] < 0x100) if (Video.bitmapbase[Video.curbitmap][i] < 0x100)
{ {
red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff);
@ -159,9 +166,11 @@ namespace MAME.Core
{ {
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
if (Video.bitmapbase[Video.curbitmap][i] < 0x100) if (Video.bitmapbase[Video.curbitmap][i] < 0x100)
{ {
Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]]; Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]];
@ -216,9 +225,11 @@ namespace MAME.Core
byte bright = 0xa7; byte bright = 0xa7;
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
red = ((Video.bitmapbaseN[Video.curbitmap][i] & 0xff0000) >> 16) * bright / 0xff; red = ((Video.bitmapbaseN[Video.curbitmap][i] & 0xff0000) >> 16) * bright / 0xff;
green = ((Video.bitmapbaseN[Video.curbitmap][i] & 0xff00) >> 8) * bright / 0xff; green = ((Video.bitmapbaseN[Video.curbitmap][i] & 0xff00) >> 8) * bright / 0xff;
blue = (Video.bitmapbaseN[Video.curbitmap][i] & 0xff) * bright / 0xff; blue = (Video.bitmapbaseN[Video.curbitmap][i] & 0xff) * bright / 0xff;
@ -230,9 +241,11 @@ namespace MAME.Core
{ {
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
Video.bitmapcolorRect[target_i] = (int)(0xff000000 | (uint)Video.bitmapbaseN[Video.curbitmap][i]); Video.bitmapcolorRect[target_i] = (int)(0xff000000 | (uint)Video.bitmapbaseN[Video.curbitmap][i]);
} }
} }
@ -280,9 +293,11 @@ namespace MAME.Core
byte bright = 0xa7; byte bright = 0xa7;
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff);
green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff);
blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff); blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff);
@ -294,9 +309,11 @@ namespace MAME.Core
{ {
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]]; Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]];
} }
} }
@ -345,9 +362,11 @@ namespace MAME.Core
byte bright = 0xa7; byte bright = 0xa7;
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff);
green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff);
blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff); blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff);
@ -359,9 +378,11 @@ namespace MAME.Core
{ {
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]]; Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]];
} }
} }
@ -410,9 +431,11 @@ namespace MAME.Core
byte bright = 0xa7; byte bright = 0xa7;
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff); red = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff0000) >> 16) * bright / 0xff);
green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff); green = (int)(((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff00) >> 8) * bright / 0xff);
blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff); blue = (int)((Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]] & 0xff) * bright / 0xff);
@ -424,9 +447,11 @@ namespace MAME.Core
{ {
for (y = startY; y < endY; y++) for (y = startY; y < endY; y++)
{ {
int stepIndex = y * Video.fullwidth;
for (x = startX; x < endX; x++, target_i++) for (x = startX; x < endX; x++, target_i++)
{ {
i = y * Video.fullwidth + x; //i = y * Video.fullwidth + x;
i = stepIndex + x;
Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]]; Video.bitmapcolorRect[target_i] = (int)Palette.entry_color[Video.bitmapbase[Video.curbitmap][i]];
} }
} }

View File

@ -370,11 +370,13 @@ namespace MAME.Core
neogeo_scanline_param = 0; neogeo_scanline_param = 0;
EmuTimer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER); EmuTimer.timer_adjust_periodic(sprite_line_timer, Video.video_screen_get_time_until_pos(0, 0), Attotime.ATTOTIME_NEVER);
} }
readonly static int[] pix_offsets = new int[] { 0x10, 0x18, 0x00, 0x08 };
static int[] garouoffsets = new int[32];
private static void draw_fixed_layer(int iBitmap, int scanline) private static void draw_fixed_layer(int iBitmap, int scanline)
{ {
int i, j, x, y; int i, j, x, y;
int[] garouoffsets = new int[32], pix_offsets = new int[] { 0x10, 0x18, 0x00, 0x08 };
byte[] gfx_base; byte[] gfx_base;
//int[] garouoffsets = new int[32], pix_offsets = new int[] { 0x10, 0x18, 0x00, 0x08 };
int addr_mask; int addr_mask;
int gfx_offset, char_pens_offset; int gfx_offset, char_pens_offset;
byte data; byte data;

View File

@ -70,14 +70,34 @@ namespace MAME.Core
{ {
return ay8910info.regs[6] & 0x1f; return ay8910info.regs[6] & 0x1f;
} }
//private int TONE_VOLUME(int chan)
//{
// return ay8910info.regs[8 + chan] & 0x0f;
//}
//private int TONE_ENVELOPE(int chan)
//{
// return (ay8910info.regs[8 + chan] >> 4) & 1;
//}
//用常量优化海量访问
private const int TONE_VOLUME_REG_OFFSET = 8;
private const int TONE_VOLUME_VOLUME_MASK = 0x0f;
private int TONE_VOLUME(int chan) private int TONE_VOLUME(int chan)
{ {
return ay8910info.regs[8 + chan] & 0x0f; return ay8910info.regs[TONE_VOLUME_REG_OFFSET + chan] & TONE_VOLUME_VOLUME_MASK;
} }
private const int TONE_ENVELOPE_REG_OFFSET = 8;
private const int TONE_ENVELOPE_MOVE = 4;
private const int TONE_ENVELOPE_VOLUME_MASK = 0x01;
private int TONE_ENVELOPE(int chan) private int TONE_ENVELOPE(int chan)
{ {
return (ay8910info.regs[8 + chan] >> 4) & 1; return (ay8910info.regs[TONE_ENVELOPE_REG_OFFSET + chan] >> TONE_ENVELOPE_MOVE) & TONE_ENVELOPE_VOLUME_MASK;
} }
private int ENVELOPE_PERIOD() private int ENVELOPE_PERIOD()
{ {
return ay8910info.regs[11] | (ay8910info.regs[12] << 8); return ay8910info.regs[11] | (ay8910info.regs[12] << 8);