MAME: NEC Cpu 大量手动内联CLKM,CLKS指令 并将必然位运算固定结果常量化,减少计算

This commit is contained in:
sin365 2025-11-10 16:59:30 +08:00
parent 6dbad1414f
commit 9292175e37
2 changed files with 790 additions and 178 deletions

View File

@ -428,9 +428,25 @@ namespace cpu.nec
}
static byte[] JMP_table = new byte[] { 3, 10, 10 };
//public void JMP(bool flag)
//{
// int tmp = (int)((sbyte)FETCH());
// if (flag)
// {
// //使用外部定义减少GC压力
// //byte[] table = new byte[] { 3, 10, 10 };
// I.ip = (ushort)(I.ip + tmp);
// pendingCycles -= JMP_table[chip_type / 8];
// //PC = (I.sregs[1] << 4) + I.ip;
// return;
// }
//}
//手动内联
public void JMP(bool flag)
{
int tmp = (int)((sbyte)FETCH());
//int tmp = (int)((sbyte)FETCH());
int tmp = (sbyte)(ReadOpArg(((I.sregs[1] << 4) + I.ip++) ^ 0));
if (flag)
{
//使用外部定义减少GC压力