Compare commits

...

3 Commits

Author SHA1 Message Date
502a4e20b5 Switch Essgee 按键调整 2025-12-09 21:28:31 +08:00
d701377278 MAME:main_rom unsafe 指针化读取 2025-12-09 21:27:43 +08:00
b4261139ad Essgee:指针化优化 DMG音频处理效率 2025-12-09 21:25:09 +08:00
34 changed files with 996 additions and 467 deletions

View File

@ -20,6 +20,12 @@ namespace Essgee.Utilities
GetObjectPtr(srcObj, ref handle, out intptr);
ptr = (uint*)intptr;
}
public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref bool* ptr)
{
IntPtr intptr;
GetObjectPtr(srcObj, ref handle, out intptr);
ptr = (bool*)intptr;
}
public static void GetObjectPtr(this object srcObj, ref GCHandle handle, ref short* ptr)
{

View File

@ -5,14 +5,19 @@
//本身wave就继承了IDMGAudioChannel
public class CGBWave : Wave//, IDMGAudioChannel
{
public override void Reset()
public unsafe override void Reset()
{
base.Reset();
for (var i = 0; i < sampleBuffer.Length; i += 2)
//for (var i = 0; i < sampleBuffer.Length; i += 2)
//{
// sampleBuffer[i + 0] = 0x00;
// sampleBuffer[i + 1] = 0xFF;
//}
for (var i = 0; i < sampleBufferLength; i += 2)
{
sampleBuffer[i + 0] = 0x00;
sampleBuffer[i + 1] = 0xFF;
*(sampleBuffer + i) = 0x00;
*(sampleBuffer + i + 1) = 0xFF;
}
}
}

View File

@ -1,15 +1,36 @@
using System;
using Essgee.Utilities;
using System;
using System.Runtime.InteropServices;
namespace Essgee.Emulation.Audio
{
public partial class DMGAudio
{
public class Noise : IDMGAudioChannel
public unsafe class Noise : IDMGAudioChannel
{
static readonly int[] divisors = new int[]
//static readonly int[] divisors = new int[]
//{
// 8, 16, 32, 48, 64, 80, 96, 112
//};
#region //指针化 divisors
int[] divisors_src;
static GCHandle divisors_handle;
public int* divisors;
public int divisorsLength;
public bool divisors_IsNull => divisors == null;
public int[] divisors_set
{
8, 16, 32, 48, 64, 80, 96, 112
};
set
{
divisors_handle.ReleaseGCHandle();
divisors_src = value;
divisorsLength = value.Length;
divisors_src.GetObjectPtr(ref divisors_handle, ref divisors);
}
}
#endregion
// NR41
byte lengthLoad;
@ -23,7 +44,7 @@ namespace Essgee.Emulation.Audio
bool lfsrWidthMode;
// NR44
bool trigger, lengthEnable;
public bool trigger, lengthEnable;
//
@ -36,8 +57,8 @@ namespace Essgee.Emulation.Audio
bool isEnvelopeUpdateEnabled;
// Misc
bool isChannelEnabled, isDacEnabled;
int lengthCounter;
public bool isChannelEnabled, isDacEnabled;
public int lengthCounter;
//public int OutputVolume { get; private set; }
@ -46,6 +67,12 @@ namespace Essgee.Emulation.Audio
public Noise()
{
//
//初始化一下
divisors_set = new int[]
{
8, 16, 32, 48, 64, 80, 96, 112
};
}
public override void Reset()
@ -106,7 +133,8 @@ namespace Essgee.Emulation.Audio
noiseCounter--;
if (noiseCounter == 0)
{
noiseCounter = divisors[divisorCode] << clockShift;
//noiseCounter = divisors[divisorCode] << clockShift;
noiseCounter = *(divisors + divisorCode) << clockShift;
var result = (lfsr & 0b1) ^ ((lfsr >> 1) & 0b1);
lfsr = (ushort)((lfsr >> 1) | (result << 14));
@ -124,7 +152,8 @@ namespace Essgee.Emulation.Audio
if (lengthCounter == 0) lengthCounter = 64;
noiseCounter = divisors[divisorCode] << clockShift;
//noiseCounter = divisors[divisorCode] << clockShift;
noiseCounter = *(divisors + divisorCode) << clockShift;
volume = envelopeStartingVolume;
envelopeCounter = envelopePeriodReload;
isEnvelopeUpdateEnabled = true;

View File

@ -1,10 +1,12 @@
using System;
using Essgee.Utilities;
using System;
using System.Runtime.InteropServices;
namespace Essgee.Emulation.Audio
{
public partial class DMGAudio
{
public class Square : IDMGAudioChannel
public unsafe class Square : IDMGAudioChannel
{
//static readonly bool[,] dutyCycleTable = new bool[,]
// {
@ -15,45 +17,56 @@ namespace Essgee.Emulation.Audio
//};
// 1. 初始化 - 假设原始数组是 4行 x 8列
private const int Rows = 4;
private const int Cols = 8;
private readonly bool[] _dutyCycleTable1D = new bool[Rows * Cols]
{
// 第一行 (索引 0-7)
false, false, false, false, false, false, false, true,
// 第二行 (索引 8-15)
true, false, false, false, false, false, false, true,
// 第三行 (索引 16-23)
true, false, false, false, false, true, true, true,
// 第四行 (索引 24-31)
false, true, true, true, true, true, true, false
};
public const int Rows = 4;
public const int Cols = 8;
//private readonly bool[] _dutyCycleTable1D = new bool[Rows * Cols]
//{
// // 第一行 (索引 0-7)
// false, false, false, false, false, false, false, true,
// // 第二行 (索引 8-15)
// true, false, false, false, false, false, false, true,
// // 第三行 (索引 16-23)
// true, false, false, false, false, true, true, true,
// // 第四行 (索引 24-31)
// false, true, true, true, true, true, true, false
//};
// 2. 访问方法 - 替代原来的 dutyCycleTable[row, col]
public bool GetValue(int row, int col)
#region //指针化 _dutyCycleTable1D
bool[] _dutyCycleTable1D_src;
GCHandle _dutyCycleTable1D_handle;
public bool* _dutyCycleTable1D;
public int _dutyCycleTable1DLength;
public bool _dutyCycleTable1D_IsNull => _dutyCycleTable1D == null;
public bool[] _dutyCycleTable1D_set
{
// 重要的边界检查(在稳定后可通过条件编译移除以极致优化)
// if (row < 0 || row >= Rows || col < 0 || col >= Cols) return false;
return _dutyCycleTable1D[row * Cols + col];
set
{
_dutyCycleTable1D_handle.ReleaseGCHandle();
_dutyCycleTable1D_src = value;
_dutyCycleTable1DLength = value.Length;
_dutyCycleTable1D_src.GetObjectPtr(ref _dutyCycleTable1D_handle, ref _dutyCycleTable1D);
}
}
#endregion
// NR10/20
byte sweepPeriodReload, sweepShift;
bool sweepNegate;
// NR11/21
byte dutyCycle, lengthLoad;
public byte dutyCycle, lengthLoad;
// NR12/22
byte envelopeStartingVolume, envelopePeriodReload;
bool envelopeAddMode;
// NR13/23
byte frequencyLSB;
public byte frequencyLSB;
// NR14/24
bool trigger, lengthEnable;
byte frequencyMSB;
public bool trigger, lengthEnable;
public byte frequencyMSB;
//
@ -64,15 +77,15 @@ namespace Essgee.Emulation.Audio
int sweepCounter, sweepFreqShadow;
// Frequency
int frequencyCounter;
public int frequencyCounter;
// Envelope
int volume, envelopeCounter;
public int volume, envelopeCounter;
bool isEnvelopeUpdateEnabled;
// Misc
bool isChannelEnabled, isDacEnabled;
int lengthCounter, dutyCounter;
public bool isChannelEnabled, isDacEnabled;
public int lengthCounter, dutyCounter;
//public int OutputVolume { get; private set; }
@ -81,6 +94,19 @@ namespace Essgee.Emulation.Audio
public Square(bool hasSweep)
{
channelSupportsSweep = hasSweep;
//初始化一下
_dutyCycleTable1D_set = new bool[Rows * Cols]
{
// 第一行 (索引 0-7)
false, false, false, false, false, false, false, true,
// 第二行 (索引 8-15)
true, false, false, false, false, false, false, true,
// 第三行 (索引 16-23)
true, false, false, false, false, true, true, true,
// 第四行 (索引 24-31)
false, true, true, true, true, true, true, false
};
}
public override void Reset()
@ -169,7 +195,8 @@ namespace Essgee.Emulation.Audio
//OutputVolume = isDacEnabled && dutyCycleTable[dutyCycle, dutyCounter] ? volume : 0;
//改为一维数组访问
OutputVolume = isDacEnabled && _dutyCycleTable1D[dutyCycle * Cols + dutyCounter] ? volume : 0;
//OutputVolume = isDacEnabled && _dutyCycleTable1D[dutyCycle * Cols + dutyCounter] ? volume : 0;
OutputVolume = isDacEnabled && *(_dutyCycleTable1D+(dutyCycle * Cols + dutyCounter)) ? volume : 0;
}
private void Trigger()

View File

@ -1,8 +1,10 @@
using System;
using Essgee.Utilities;
using System;
using System.Runtime.InteropServices;
namespace Essgee.Emulation.Audio
{
public partial class DMGAudio
public unsafe partial class DMGAudio
{
public class Wave : IDMGAudioChannel
{
@ -19,16 +21,35 @@ namespace Essgee.Emulation.Audio
byte frequencyLSB;
// NR34
bool trigger, lengthEnable;
public bool trigger, lengthEnable;
byte frequencyMSB;
// Wave
protected byte[] sampleBuffer;
//protected byte[] sampleBuffer;
#region //指针化 sampleBuffer
byte[] sampleBuffer_src;
GCHandle sampleBuffer_handle;
public byte* sampleBuffer;
public int sampleBufferLength;
public bool sampleBuffer_IsNull => sampleBuffer == null;
public byte[] sampleBuffer_set
{
set
{
sampleBuffer_handle.ReleaseGCHandle();
sampleBuffer_src = value;
sampleBufferLength = value.Length;
sampleBuffer_src.GetObjectPtr(ref sampleBuffer_handle, ref sampleBuffer);
}
}
#endregion
int frequencyCounter, positionCounter, volume;
// Misc
bool isChannelEnabled;
int lengthCounter;
public bool isChannelEnabled;
public int lengthCounter;
//public int OutputVolume { get; private set; }
@ -36,12 +57,15 @@ namespace Essgee.Emulation.Audio
public Wave()
{
sampleBuffer = new byte[16];
//sampleBuffer = new byte[16];
sampleBuffer_set = new byte[16];
}
public override void Reset()
{
for (var i = 0; i < sampleBuffer.Length; i++) sampleBuffer[i] = (byte)EmuStandInfo.Random.Next(255);
//for (var i = 0; i < sampleBuffer.Length; i++) sampleBuffer[i] = (byte)EmuStandInfo.Random.Next(255);
byte* ptr = sampleBuffer;
for (var i = 0; i < sampleBufferLength; i++, ptr++) *ptr = 0;// (byte)EmuStandInfo.Random.Next(255);
frequencyCounter = positionCounter = 0;
volume = 15;
@ -82,7 +106,8 @@ namespace Essgee.Emulation.Audio
positionCounter++;
positionCounter %= 32;
var value = sampleBuffer[positionCounter / 2];
//var value = sampleBuffer[positionCounter / 2];
var value = *(sampleBuffer + (positionCounter / 2));
if ((positionCounter & 0b1) == 0) value >>= 4;
value &= 0b1111;
@ -168,16 +193,23 @@ namespace Essgee.Emulation.Audio
public override void WriteWaveRam(byte offset, byte value)
{
//if (!isDacEnabled)
// sampleBuffer[offset & (sampleBuffer.Length - 1)] = value;
//else
// sampleBuffer[positionCounter & (sampleBuffer.Length - 1)] = value;
if (!isDacEnabled)
sampleBuffer[offset & (sampleBuffer.Length - 1)] = value;
*(sampleBuffer + (offset & (sampleBufferLength - 1))) = value;
else
sampleBuffer[positionCounter & (sampleBuffer.Length - 1)] = value;
*(sampleBuffer+(positionCounter & (sampleBufferLength - 1))) = value;
}
public override byte ReadWaveRam(byte offset)
{
if (!isDacEnabled)
return sampleBuffer[offset & (sampleBuffer.Length - 1)];
{
//return sampleBuffer[offset & (sampleBufferLength - 1)];
return *(sampleBuffer + (offset & (sampleBufferLength - 1)));
}
else
return 0xFF;
}

View File

@ -19,7 +19,10 @@ namespace Essgee.Emulation.Audio
protected const string channel3OptionName = "AudioEnableCh3Wave";
protected const string channel4OptionName = "AudioEnableCh4Noise";
protected IDMGAudioChannel channel1, channel2, channel3, channel4;
//protected IDMGAudioChannel channel1, channel2, channel3, channel4;
protected Square channel1, channel2;
protected Wave channel3;
protected Noise channel4;
// FF24 - NR50
byte[] volumeRightLeft;
@ -298,6 +301,161 @@ namespace Essgee.Emulation.Audio
//独立声明,不在函数内部
private bool[] channelEnableFlags = new bool[4];
//public void Step(int clockCyclesInStep)
//{
// if (!isSoundHwEnabled) return;
// sampleCycleCount += clockCyclesInStep;
// frameCycleCount += clockCyclesInStep;
// for (int i = 0; i < clockCyclesInStep; i++)
// {
// frameSequencerCounter--;
// if (frameSequencerCounter == 0)
// {
// frameSequencerCounter = frameSequencerReload;
// switch (frameSequencer)
// {
// case 0:
// channel1.LengthCounterClock();
// channel2.LengthCounterClock();
// channel3.LengthCounterClock();
// channel4.LengthCounterClock();
// break;
// case 1:
// break;
// case 2:
// channel1.SweepClock();
// channel1.LengthCounterClock();
// channel2.LengthCounterClock();
// channel3.LengthCounterClock();
// channel4.LengthCounterClock();
// break;
// case 3:
// break;
// case 4:
// channel1.LengthCounterClock();
// channel2.LengthCounterClock();
// channel3.LengthCounterClock();
// channel4.LengthCounterClock();
// break;
// case 5:
// break;
// case 6:
// channel1.SweepClock();
// channel1.LengthCounterClock();
// channel2.LengthCounterClock();
// channel3.LengthCounterClock();
// channel4.LengthCounterClock();
// break;
// case 7:
// channel1.VolumeEnvelopeClock();
// channel2.VolumeEnvelopeClock();
// channel4.VolumeEnvelopeClock();
// break;
// }
// frameSequencer++;
// if (frameSequencer >= 8)
// frameSequencer = 0;
// }
// //channel1.Step();
// //channel2.Step();
// //channel3.Step();
// //channel4.Step();
// //手动内联
// //channel1.Step();
// if (channel1.isChannelEnabled)
// {
// channel1.frequencyCounter--;
// if (channel1.frequencyCounter == 0)
// {
// channel1.frequencyCounter = (2048 - ((channel1.frequencyMSB << 8) | channel1.frequencyLSB)) * 4;
// channel1.dutyCounter++;
// channel1.dutyCounter %= 8;
// }
// channel1.OutputVolume = channel1.isDacEnabled && *(channel1._dutyCycleTable1D + (channel1.dutyCycle * Square.Cols + channel1.dutyCounter)) ? channel1.volume : 0;
// }
// //channel2.Step();
// if (channel2.isChannelEnabled)
// {
// channel2.frequencyCounter--;
// if (channel2.frequencyCounter == 0)
// {
// channel2.frequencyCounter = (2048 - ((channel2.frequencyMSB << 8) | channel2.frequencyLSB)) * 4;
// channel2.dutyCounter++;
// channel2.dutyCounter %= 8;
// }
// channel2.OutputVolume = channel2.isDacEnabled && *(channel2._dutyCycleTable1D + (channel2.dutyCycle * Square.Cols + channel2.dutyCounter)) ? channel2.volume : 0;
// }
// channel3.Step();
// channel4.Step();
// }
// if (sampleCycleCount >= cyclesPerSample)
// {
// GenerateSample();
// sampleCycleCount -= cyclesPerSample;
// }
// //if (mixedSampleBuffer.Count >= (samplesPerFrame * numOutputChannels))
// if (mixedSampleBuffer_writePos >= (samplesPerFrame * numOutputChannels))
// {
// //EnqueueSamplesEventArgs eventArgs = EnqueueSamplesEventArgs.Create(
// // numChannels,
// // channelSampleBuffer.Select(x => x.ToArray()).ToArray(),
// // new bool[] { !channel1ForceEnable, !channel2ForceEnable, !channel3ForceEnable, !channel4ForceEnable },
// // mixedSampleBuffer.ToArray());
// //有GC
// //EnqueueSamplesEventArgs eventArgs = EnqueueSamplesEventArgs.Create(
// // numChannels,
// // channelSampleBuffer,
// // new bool[] { !channel1ForceEnable, !channel2ForceEnable, !channel3ForceEnable, !channel4ForceEnable },
// // mixedSampleBuffer,
// // mixedSampleBuffer_writePos);
// // 在函数中使用
// channelEnableFlags[0] = !channel1ForceEnable;
// channelEnableFlags[1] = !channel2ForceEnable;
// channelEnableFlags[2] = !channel3ForceEnable;
// channelEnableFlags[3] = !channel4ForceEnable;
// EnqueueSamplesEventArgs eventArgs = EnqueueSamplesEventArgs.Create(
// numChannels,
// channelSampleBuffer,
// channelEnableFlags,
// mixedSampleBuffer,
// mixedSampleBuffer_writePos);
// OnEnqueueSamples(eventArgs);
// FlushSamples();
// eventArgs.Release();
// }
// if (frameCycleCount >= cyclesPerFrame)
// {
// frameCycleCount -= cyclesPerFrame;
// sampleCycleCount = frameCycleCount;
// }
//}
//手动内联
public void Step(int clockCyclesInStep)
{
if (!isSoundHwEnabled) return;
@ -315,10 +473,34 @@ namespace Essgee.Emulation.Audio
switch (frameSequencer)
{
case 0:
channel1.LengthCounterClock();
channel2.LengthCounterClock();
channel3.LengthCounterClock();
channel4.LengthCounterClock();
//channel1.LengthCounterClock();
if (channel1.lengthCounter > 0 && channel1.lengthEnable)
{
channel1.lengthCounter--;
if (channel1.lengthCounter == 0)
channel1.isChannelEnabled = false;
}
//channel2.LengthCounterClock();
if (channel2.lengthCounter > 0 && channel2.lengthEnable)
{
channel2.lengthCounter--;
if (channel2.lengthCounter == 0)
channel2.isChannelEnabled = false;
}
//channel3.LengthCounterClock();
if (channel3.lengthCounter > 0 && channel3.lengthEnable)
{
channel3.lengthCounter--;
if (channel3.lengthCounter == 0)
channel3.isChannelEnabled = false;
}
//channel4.LengthCounterClock();
if (channel4.lengthCounter > 0 && channel4.lengthEnable)
{
channel4.lengthCounter--;
if (channel4.lengthCounter == 0)
channel4.isChannelEnabled = false;
}
break;
case 1:
@ -326,20 +508,68 @@ namespace Essgee.Emulation.Audio
case 2:
channel1.SweepClock();
channel1.LengthCounterClock();
channel2.LengthCounterClock();
channel3.LengthCounterClock();
channel4.LengthCounterClock();
//channel1.LengthCounterClock();
if (channel1.lengthCounter > 0 && channel1.lengthEnable)
{
channel1.lengthCounter--;
if (channel1.lengthCounter == 0)
channel1.isChannelEnabled = false;
}
//channel2.LengthCounterClock();
if (channel2.lengthCounter > 0 && channel2.lengthEnable)
{
channel2.lengthCounter--;
if (channel2.lengthCounter == 0)
channel2.isChannelEnabled = false;
}
//channel3.LengthCounterClock();
if (channel3.lengthCounter > 0 && channel3.lengthEnable)
{
channel3.lengthCounter--;
if (channel3.lengthCounter == 0)
channel3.isChannelEnabled = false;
}
//channel4.LengthCounterClock();
if (channel4.lengthCounter > 0 && channel4.lengthEnable)
{
channel4.lengthCounter--;
if (channel4.lengthCounter == 0)
channel4.isChannelEnabled = false;
}
break;
case 3:
break;
case 4:
channel1.LengthCounterClock();
channel2.LengthCounterClock();
channel3.LengthCounterClock();
channel4.LengthCounterClock();
//channel1.LengthCounterClock();
if (channel1.lengthCounter > 0 && channel1.lengthEnable)
{
channel1.lengthCounter--;
if (channel1.lengthCounter == 0)
channel1.isChannelEnabled = false;
}
//channel2.LengthCounterClock();
if (channel2.lengthCounter > 0 && channel2.lengthEnable)
{
channel2.lengthCounter--;
if (channel2.lengthCounter == 0)
channel2.isChannelEnabled = false;
}
//channel3.LengthCounterClock();
if (channel3.lengthCounter > 0 && channel3.lengthEnable)
{
channel3.lengthCounter--;
if (channel3.lengthCounter == 0)
channel3.isChannelEnabled = false;
}
//channel4.LengthCounterClock();
if (channel4.lengthCounter > 0 && channel4.lengthEnable)
{
channel4.lengthCounter--;
if (channel4.lengthCounter == 0)
channel4.isChannelEnabled = false;
}
break;
case 5:
@ -347,10 +577,34 @@ namespace Essgee.Emulation.Audio
case 6:
channel1.SweepClock();
channel1.LengthCounterClock();
channel2.LengthCounterClock();
channel3.LengthCounterClock();
channel4.LengthCounterClock();
//channel1.LengthCounterClock();
if (channel1.lengthCounter > 0 && channel1.lengthEnable)
{
channel1.lengthCounter--;
if (channel1.lengthCounter == 0)
channel1.isChannelEnabled = false;
}
//channel2.LengthCounterClock();
if (channel2.lengthCounter > 0 && channel2.lengthEnable)
{
channel2.lengthCounter--;
if (channel2.lengthCounter == 0)
channel2.isChannelEnabled = false;
}
//channel3.LengthCounterClock();
if (channel3.lengthCounter > 0 && channel3.lengthEnable)
{
channel3.lengthCounter--;
if (channel3.lengthCounter == 0)
channel3.isChannelEnabled = false;
}
//channel4.LengthCounterClock();
if (channel4.lengthCounter > 0 && channel4.lengthEnable)
{
channel4.lengthCounter--;
if (channel4.lengthCounter == 0)
channel4.isChannelEnabled = false;
}
break;
case 7:
@ -365,8 +619,36 @@ namespace Essgee.Emulation.Audio
frameSequencer = 0;
}
channel1.Step();
channel2.Step();
//channel1.Step();
//channel2.Step();
//channel3.Step();
//channel4.Step();
//手动内联
//channel1.Step();
if (channel1.isChannelEnabled)
{
channel1.frequencyCounter--;
if (channel1.frequencyCounter == 0)
{
channel1.frequencyCounter = (2048 - ((channel1.frequencyMSB << 8) | channel1.frequencyLSB)) * 4;
channel1.dutyCounter++;
channel1.dutyCounter %= 8;
}
channel1.OutputVolume = channel1.isDacEnabled && *(channel1._dutyCycleTable1D + (channel1.dutyCycle * Square.Cols + channel1.dutyCounter)) ? channel1.volume : 0;
}
//channel2.Step();
if (channel2.isChannelEnabled)
{
channel2.frequencyCounter--;
if (channel2.frequencyCounter == 0)
{
channel2.frequencyCounter = (2048 - ((channel2.frequencyMSB << 8) | channel2.frequencyLSB)) * 4;
channel2.dutyCounter++;
channel2.dutyCounter %= 8;
}
channel2.OutputVolume = channel2.isDacEnabled && *(channel2._dutyCycleTable1D + (channel2.dutyCycle * Square.Cols + channel2.dutyCounter)) ? channel2.volume : 0;
}
channel3.Step();
channel4.Step();
}

View File

@ -106,13 +106,33 @@ namespace Essgee.Emulation.Video.Nintendo
//取值范例 colorValuesBgr[colorIndex * 3 + channelIndex];
const byte colorValuesBgr_singleLen = 3;
// 转换后的一维数组
readonly byte[] colorValuesBgr = new byte[]
//readonly byte[] colorValuesBgr = new byte[]
//{
///* White */ 0xF8, 0xF8, 0xF8,
///* Light gray */0x9B, 0x9B, 0x9B,
///* Dark gray */ 0x3E, 0x3E, 0x3E,
///* Black */ 0x1F, 0x1F, 0x1F
//};
#region //指针化 colorValuesBgr
byte[] colorValuesBgr_src;
GCHandle colorValuesBgr_handle;
public byte* colorValuesBgr;
public int colorValuesBgrLength;
public bool colorValuesBgr_IsNull => colorValuesBgr == null;
public byte[] colorValuesBgr_set
{
/* White */ 0xF8, 0xF8, 0xF8,
/* Light gray */0x9B, 0x9B, 0x9B,
/* Dark gray */ 0x3E, 0x3E, 0x3E,
/* Black */ 0x1F, 0x1F, 0x1F
};
set
{
colorValuesBgr_handle.ReleaseGCHandle();
colorValuesBgr_src = value;
colorValuesBgrLength = value.Length;
colorValuesBgr_src.GetObjectPtr(ref colorValuesBgr_handle, ref colorValuesBgr);
}
}
#endregion
protected const byte screenUsageEmpty = 0;
protected const byte screenUsageBackground = 1 << 0;
@ -305,6 +325,15 @@ namespace Essgee.Emulation.Video.Nintendo
outputFramebufferCopy_set = new byte[numDisplayPixels * 4];
//初始化一下
colorValuesBgr_set = new byte[]
{
/* White */ 0xF8, 0xF8, 0xF8,
/* Light gray */0x9B, 0x9B, 0x9B,
/* Dark gray */ 0x3E, 0x3E, 0x3E,
/* Black */ 0x1F, 0x1F, 0x1F
};
for (var y = 0; y < displayActiveHeight; y++)
SetLine(y, 0xFF, 0xFF, 0xFF);
}
@ -734,18 +763,24 @@ namespace Essgee.Emulation.Video.Nintendo
//outputFramebuffer[address + 0] = colorValuesBgr[c & 0x03][0];
//outputFramebuffer[address + 1] = colorValuesBgr[c & 0x03][1];
//outputFramebuffer[address + 2] = colorValuesBgr[c & 0x03][2];
outputFramebuffer[address + 0] = colorValuesBgr[(c & 0x03) * 3 + 0];
outputFramebuffer[address + 1] = colorValuesBgr[(c & 0x03) * 3 + 1];
outputFramebuffer[address + 2] = colorValuesBgr[(c & 0x03) * 3 + 2];
outputFramebuffer[address + 3] = 0xFF;
//outputFramebuffer[address + 0] = colorValuesBgr[(c & 0x03) * 3 + 0];
//outputFramebuffer[address + 1] = colorValuesBgr[(c & 0x03) * 3 + 1];
//outputFramebuffer[address + 2] = colorValuesBgr[(c & 0x03) * 3 + 2];
//outputFramebuffer[address + 3] = 0xFF;
*(outputFramebuffer + address) = colorValuesBgr[(c & 0x03) * 3 + 0];
*(outputFramebuffer + address + 1) = colorValuesBgr[(c & 0x03) * 3 + 1];
*(outputFramebuffer + address + 2) = colorValuesBgr[(c & 0x03) * 3 + 2];
*(outputFramebuffer + address + 3) = 0xFF;
}
protected virtual void WriteColorToFramebuffer(byte b, byte g, byte r, int address)
{
outputFramebuffer[address + 0] = b;
outputFramebuffer[address + 1] = g;
outputFramebuffer[address + 2] = r;
outputFramebuffer[address + 3] = 0xFF;
*(outputFramebuffer + address) = b;
*(outputFramebuffer + address + 1) = g;
*(outputFramebuffer + address + 2) = r;
*(outputFramebuffer + address + 3) = 0xFF;
}
protected virtual void ClearScreenUsage()

View File

@ -20,11 +20,11 @@ namespace MAME.Core
else if (address >= 0x4000 && address <= 0x5fff)
{
int offset = address - 0x4000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address >= 0x6000 && address <= 0xffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else
{
@ -85,11 +85,11 @@ namespace MAME.Core
else if (address >= 0x4000 && address <= 0x5fff)
{
int offset = address - 0x4000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address >= 0x6000 && address <= 0xffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -146,7 +146,7 @@ namespace MAME.Core
else if (address >= 0x4000 && address <= 0x5fff)
{
int offset = address - 0x4000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address == 0x6000)
{
@ -154,7 +154,7 @@ namespace MAME.Core
}
else if (address >= 0x6001 && address <= 0xffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -222,7 +222,7 @@ namespace MAME.Core
}
else if (address >= 0x4000 && address <= 0xffff)
{
Memory.mainrom[address] = value;
*(Memory.mainrom + (address)) = value;
}
}
public static byte ZReadOp_gng(ushort address)
@ -301,7 +301,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -318,7 +318,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -452,7 +452,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -586,7 +586,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -720,7 +720,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -737,7 +737,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -801,7 +801,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -865,7 +865,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -929,7 +929,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -946,7 +946,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -977,7 +977,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)value;
*(Memory.mainrom + (address)) = (byte)value;
}
}
else if (address >= 0x800000 && address <= 0x800fff)
@ -1095,8 +1095,8 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 8);
Memory.mainrom[address + 1] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 1)) = (byte)value;
}
}
else if (address >= 0x800000 && address + 1 <= 0x800fff)
@ -1152,10 +1152,10 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 24);
Memory.mainrom[address + 1] = (byte)(value >> 16);
Memory.mainrom[address + 2] = (byte)(value >> 8);
Memory.mainrom[address + 3] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 24);
*(Memory.mainrom + (address + 1)) = (byte)(value >> 16);
*(Memory.mainrom + (address + 2)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 3)) = (byte)value;
}
}
else if (address >= 0x800000 && address + 3 <= 0x800fff)

View File

@ -16,7 +16,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -33,7 +33,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -94,7 +94,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -119,7 +119,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -162,7 +162,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -187,7 +187,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -440,7 +440,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -461,7 +461,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -545,7 +545,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -570,7 +570,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -636,7 +636,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -661,7 +661,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -947,7 +947,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -1111,7 +1111,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1254,7 +1254,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{

View File

@ -195,7 +195,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -245,7 +245,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -288,7 +288,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -484,7 +484,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -550,7 +550,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -605,7 +605,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -960,7 +960,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -977,7 +977,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -1112,7 +1112,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1129,7 +1129,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1243,7 +1243,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1260,7 +1260,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{

View File

@ -14,16 +14,16 @@
else if (address >= 0x4000 && address <= 0x5fff)
{
int offset = address - 0x4000;
result = Memory.mainrom[basebankmain1 + offset];
result = *(Memory.mainrom + (basebankmain1 + offset));
}
else if (address >= 0x6000 && address <= 0x7fff)
{
int offset = address - 0x6000;
result = Memory.mainrom[basebankmain2 + offset];
result = *(Memory.mainrom + (basebankmain2 + offset));
}
else if (address >= 0x8000 && address <= 0xffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -37,16 +37,16 @@
else if (address >= 0x4000 && address <= 0x5fff)
{
int offset = address - 0x4000;
result = Memory.mainrom[basebankmain1 + offset];
result = *(Memory.mainrom + (basebankmain1 + offset));
}
else if (address >= 0x6000 && address <= 0x7fff)
{
int offset = address - 0x6000;
result = Memory.mainrom[basebankmain2 + offset];
result = *(Memory.mainrom + (basebankmain2 + offset));
}
else if (address >= 0x8000 && address <= 0xffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -72,16 +72,16 @@
else if (address >= 0x4000 && address <= 0x5fff)
{
int offset = address - 0x4000;
result = Memory.mainrom[basebankmain1 + offset];
result = *(Memory.mainrom + (basebankmain1 + offset));
}
else if (address >= 0x6000 && address <= 0x7fff)
{
int offset = address - 0x6000;
result = Memory.mainrom[basebankmain2 + offset];
result = *(Memory.mainrom + (basebankmain2 + offset));
}
else if (address >= 0x8000 && address <= 0xffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -115,7 +115,7 @@
}
else if (address >= 0x4000 && address <= 0xffff)
{
Memory.mainrom[address] = data;
*(Memory.mainrom + (address)) = data;
}
}
public static byte D1ReadOp(ushort address)

View File

@ -23,7 +23,7 @@
}
else if (address >= 0 && address <= 0x7ffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
return result;
}
@ -44,7 +44,7 @@
}
else if (address >= 0 && address <= 0x7ffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else if (address >= 0x100000 && address <= 0x103fff)
{
@ -117,7 +117,7 @@
}
else if (address >= 0 && address + 1 <= 0x7ffff)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
return result;
}
@ -131,7 +131,7 @@
}
else if (address >= 0 && address + 1 <= 0x7ffff)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else if (address >= 0x100000 && address + 1 <= 0x103fff)
{
@ -179,7 +179,7 @@
int result = 0;
if (address >= 0 && address + 3 <= 0x7ffff)
{
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
return result;
}
@ -189,7 +189,7 @@
int result = 0;
if (address >= 0 && address + 3 <= 0x7ffff)
{
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
else if (address >= 0x100000 && address + 3 <= 0x103fff)
{

View File

@ -352,7 +352,7 @@
}
else if (address >= 0x000000 && address <= 0x07ffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else if (address >= 0x100000 && address <= 0x103fff)
{
@ -436,7 +436,7 @@
}
else if (address >= 0 && address + 1 <= 0x7ffff)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
return result;
}
@ -454,7 +454,7 @@
}
else if (address >= 0x000000 && address + 1 <= 0x07ffff)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else if (address >= 0x100000 && address + 1 <= 0x103fff)
{
@ -496,7 +496,7 @@
int result = 0;
if (address >= 0x000000 && address + 3 <= 0x07ffff)
{
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
else if (address >= 0x100000 && address + 3 <= 0x103fff)
{
@ -790,7 +790,7 @@
}
else if (address >= 0x000000 && address + 1 <= 0x07ffff)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else if (address >= 0x100000 && address + 1 <= 0x103fff)
{
@ -840,7 +840,7 @@
}
else if (address >= 0x000000 && address + 1 <= 0x07ffff)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else if (address >= 0x100000 && address + 1 <= 0x103fff)
{
@ -902,7 +902,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -937,7 +937,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1025,7 +1025,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1050,7 +1050,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1103,7 +1103,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1120,7 +1120,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1437,7 +1437,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1476,7 +1476,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1555,7 +1555,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1580,7 +1580,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1634,7 +1634,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1657,7 +1657,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x010000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1980,7 +1980,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2023,7 +2023,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2107,7 +2107,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2132,7 +2132,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2189,7 +2189,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2207,7 +2207,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2503,7 +2503,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2564,7 +2564,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2684,7 +2684,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2725,7 +2725,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2801,7 +2801,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2819,7 +2819,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -3267,7 +3267,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -3299,7 +3299,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -3383,7 +3383,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -3408,7 +3408,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -3461,7 +3461,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -3479,7 +3479,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x023000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{

View File

@ -1136,7 +1136,7 @@ namespace MAME.Core
byte result = 0;
if (addr <= 0x07ffff)
{
result = Memory.mainrom[addr];
result = *(Memory.mainrom + (addr));
}
else if (addr >= 0x104000 && addr <= 0x107fff)
{
@ -1163,7 +1163,7 @@ namespace MAME.Core
addr *= 2;
if (addr <= 0x07ffff)
{
result = (ushort)(Memory.mainrom[addr] * 0x100 + Memory.mainrom[addr + 1]);
result = (ushort)(*(Memory.mainrom + (addr)) * 0x100 + *(Memory.mainrom + (addr + 1)));
}
else if (addr >= 0x104000 && addr <= 0x107fff)
{

View File

@ -15,7 +15,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -42,7 +42,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -192,7 +192,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -219,7 +219,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -299,7 +299,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -326,7 +326,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -617,7 +617,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -644,7 +644,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -771,7 +771,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -798,7 +798,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -869,7 +869,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -897,7 +897,7 @@ namespace MAME.Core
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1116,7 +1116,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1138,7 +1138,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1282,7 +1282,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1304,7 +1304,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1378,7 +1378,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1400,7 +1400,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1603,7 +1603,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1625,7 +1625,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1741,7 +1741,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1763,7 +1763,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1830,7 +1830,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1853,7 +1853,7 @@ namespace MAME.Core
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2080,7 +2080,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2102,7 +2102,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2250,7 +2250,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2272,7 +2272,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2349,7 +2349,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2372,7 +2372,7 @@ namespace MAME.Core
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2601,7 +2601,7 @@ namespace MAME.Core
sbyte result = 0;
if (address <= 0x0bffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else if (address >= 0x104000 && address <= 0x107fff)
{
@ -2615,7 +2615,7 @@ namespace MAME.Core
sbyte result = 0;
if (address <= 0x0bffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else if (address >= 0x104000 && address <= 0x107fff)
{
@ -2776,7 +2776,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2797,7 +2797,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2879,7 +2879,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2900,7 +2900,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{

View File

@ -10,7 +10,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -32,7 +32,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -172,7 +172,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -194,7 +194,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -266,7 +266,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -289,7 +289,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -578,7 +578,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -600,7 +600,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -762,7 +762,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -784,7 +784,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -866,7 +866,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -889,7 +889,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1209,7 +1209,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1231,7 +1231,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1388,7 +1388,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1410,7 +1410,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1496,7 +1496,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1519,7 +1519,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1826,7 +1826,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1848,7 +1848,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1950,7 +1950,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1972,7 +1972,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2032,7 +2032,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2055,7 +2055,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2309,7 +2309,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2331,7 +2331,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2458,7 +2458,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2480,7 +2480,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2547,7 +2547,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2570,7 +2570,7 @@
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{

View File

@ -10,7 +10,7 @@
byte result = 0;
if (address >= 0 && address <= 0xfffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -20,7 +20,7 @@
byte result = 0;
if (address >= 0 && address <= 0x7ffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0xa0000 && address <= 0xa3fff)
{
@ -58,7 +58,7 @@
}
else if (address >= 0xffff0 && address <= 0xfffff)
{
result = Memory.mainrom[address & 0xfffff];
result = *(Memory.mainrom + (address & 0xfffff));
}
return result;
}
@ -68,7 +68,7 @@
ushort result = 0;
if (address >= 0 && address + 1 <= 0x7ffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
else if (address >= 0xa0000 && address + 1 <= 0xa3fff)
{
@ -106,7 +106,7 @@
}
else if (address >= 0xffff0 && address + 1 <= 0xfffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
return result;
}
@ -305,7 +305,7 @@
byte result = 0;
if (address >= 0 && address <= 0x7ffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x80000 && address <= 0x83fff)
{
@ -338,7 +338,7 @@
}
else if (address >= 0xffff0 && address <= 0xfffff)
{
result = Memory.mainrom[address & 0xfffff];
result = *(Memory.mainrom + (address & 0xfffff));
}
return result;
}
@ -348,7 +348,7 @@
ushort result = 0;
if (address >= 0 && address + 1 <= 0x7ffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
else if (address >= 0x80000 && address + 1 <= 0x83fff)
{
@ -381,7 +381,7 @@
}
else if (address >= 0xffff0 && address + 1 <= 0xfffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
return result;
}

View File

@ -15,7 +15,7 @@ namespace MAME.Core
}
else
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}

View File

@ -10,7 +10,7 @@
byte result = 0;
if (address >= 0 && address <= 0xfffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -20,16 +20,16 @@
byte result = 0;
if (address >= 0 && address <= 0x9ffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0xa0000 && address <= 0xbffff)
{
int offset = address - 0xa0000;
result = Memory.mainrom[bankaddress + offset];
result = *(Memory.mainrom + (bankaddress + offset));
}
else if (address >= 0xc0000 && address <= 0xcffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0xd0000 && address <= 0xdffff)
{
@ -60,7 +60,7 @@
}
else if (address >= 0xffff0 && address <= 0xfffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -70,16 +70,16 @@
ushort result = 0;
if (address >= 0 && address + 1 <= 0x9ffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
else if (address >= 0xa0000 && address + 1 <= 0xbffff)
{
int offset = address - 0xa0000;
result = (ushort)(Memory.mainrom[bankaddress + offset] + Memory.mainrom[bankaddress + offset + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (bankaddress + offset)) + *(Memory.mainrom + (bankaddress + offset + 1)) * 0x100);
}
else if (address >= 0xc0000 && address + 1 <= 0xcffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
else if (address >= 0xd0000 && address + 1 <= 0xdffff)
{
@ -103,7 +103,7 @@
}
else if (address >= 0xffff0 && address + 1 <= 0xfffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
return result;
}
@ -401,7 +401,7 @@
else if (address >= 0xffff0 && address <= 0xfffff)
{
int offset = address - 0xe0000;
result = Memory.mainrom[offset];
result = *(Memory.mainrom + offset);
}
return result;
}
@ -434,7 +434,7 @@
else if (address >= 0xffff0 && address + 1 <= 0xfffff)
{
int offset = address - 0xe0000;
result = (ushort)(Memory.mainrom[offset] + Memory.mainrom[offset + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + offset) + *(Memory.mainrom + offset + 1) * 0x100);
}
return result;
}

View File

@ -8,7 +8,7 @@
byte result = 0;
if (address >= 0 && address <= 0x7ffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x80000 && address <= 0x8ffff)
{
@ -39,7 +39,7 @@
}
else if (address >= 0xffff0 && address <= 0xfffff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -49,7 +49,7 @@
ushort result = 0;
if (address >= 0 && address + 1 <= 0x7ffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
else if (address >= 0x80000 && address + 1 <= 0x8ffff)
{
@ -73,7 +73,7 @@
}
else if (address >= 0xffff0 && address + 1 <= 0xfffff)
{
result = (ushort)(Memory.mainrom[address] + Memory.mainrom[address + 1] * 0x100);
result = (ushort)(*(Memory.mainrom + (address)) + *(Memory.mainrom + (address + 1)) * 0x100);
}
return result;
}

View File

@ -18,12 +18,12 @@ namespace MAME.Core
}
else if (main_cpu_vector_table_source == 1)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
}
else if (address >= 0x000080 && address <= 0x0fffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else if (address >= 0x100000 && address <= 0x1fffff)
{
@ -31,7 +31,7 @@ namespace MAME.Core
}
else if (address >= 0x200000 && address <= 0x2fffff)
{
result = (sbyte)Memory.mainrom[main_cpu_bank_address + (address - 0x200000)];
result = (sbyte)*(Memory.mainrom + (main_cpu_bank_address + (address - 0x200000)));
}
else if (address >= 0xc00000 && address <= 0xcfffff)
{
@ -55,12 +55,12 @@ namespace MAME.Core
}
else if (main_cpu_vector_table_source == 1)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
}
else if (address >= 0x000080 && address <= 0x0fffff)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else if (address >= 0x100000 && address <= 0x1fffff)
{
@ -68,7 +68,7 @@ namespace MAME.Core
}
else if (address >= 0x200000 && address <= 0x2fffff)
{
result = (sbyte)Memory.mainrom[main_cpu_bank_address + (address - 0x200000)];
result = (sbyte)*(Memory.mainrom + (main_cpu_bank_address + (address - 0x200000)));
}
/*else if (address >= 0x300000 && address <= 0x300001)
{
@ -187,7 +187,7 @@ namespace MAME.Core
// }
// else if (main_cpu_vector_table_source == 1)
// {
// result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
// result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
// }
// }
// else if (address >= 0x000080 && address + 1 <= 0x0fffff)
@ -196,7 +196,7 @@ namespace MAME.Core
// {
// //m68000Form.iStatus = 1;
// }
// result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
// result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
// }
// else if (address >= 0x100000 && address + 1 <= 0x1fffff)
// {
@ -204,7 +204,7 @@ namespace MAME.Core
// }
// else if (address >= 0x200000 && address + 1 <= 0x2fffff)
// {
// result = (short)(Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1]);
// result = (short)(*(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff))) * 0x100 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 1)));
// }
// else if (address >= 0xc00000 && address + 1 <= 0xcfffff)
// {
@ -223,7 +223,7 @@ namespace MAME.Core
address &= 0xffffff;
if (address >= 0x000000 && address + 1 <= 0x00007f)
{
byte* ptr_0 = &Memory.mainrom[0];
byte* ptr_0 = Memory.mainrom;
byte* ptr = ptr_0 + (address);
if (main_cpu_vector_table_source == 0)
{
@ -237,7 +237,7 @@ namespace MAME.Core
}
else if (address >= 0x000080 && address + 1 <= 0x0fffff)
{
byte* ptr_0 = &Memory.mainrom[0];
byte* ptr_0 = Memory.mainrom;
byte* ptr = ptr_0 + (address);
//if (address >= 0x142B9 && address <= 0x142C9)
//{
@ -254,9 +254,9 @@ namespace MAME.Core
}
else if (address >= 0x200000 && address + 1 <= 0x2fffff)
{
byte* ptr_0 = &Memory.mainrom[0];
byte* ptr_0 = Memory.mainrom;
byte* ptr = ptr_0 + (main_cpu_bank_address + (address & 0xfffff));
//result = (short)(Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1]);
//result = (short)(*(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff))) * 0x100 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 1)));
return (short)(*ptr * 0x100 + *(ptr + 1));
}
else if (address >= 0xc00000 && address + 1 <= 0xcfffff)
@ -282,7 +282,7 @@ namespace MAME.Core
// }
// else if (main_cpu_vector_table_source == 1)
// {
// result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
// result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
// }
// }
// else if (address >= 0x000080 && address + 1 <= 0x0fffff)
@ -291,7 +291,7 @@ namespace MAME.Core
// {
// //m68000Form.iStatus = 1;
// }
// result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
// result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
// }
// else if (address >= 0x100000 && address + 1 <= 0x1fffff)
// {
@ -303,7 +303,7 @@ namespace MAME.Core
// }
// else if (address >= 0x200000 && address <= 0x2fffff)
// {
// result = (short)(Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1]);
// result = (short)(*(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff))) * 0x100 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 1)));
// }
// /*else if (address >= 0x300000 && address <= 0x300001)
// {
@ -376,9 +376,9 @@ namespace MAME.Core
}
else if (main_cpu_vector_table_source == 1)
{
byte* ptr_0 = &Memory.mainrom[0];
byte* ptr_0 = Memory.mainrom;
byte* ptr = ptr_0 + address;
//result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
//result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
result = (short)(*ptr * 0x100 + *(ptr + 1));
}
}
@ -389,9 +389,9 @@ namespace MAME.Core
// //m68000Form.iStatus = 1;
//}
byte* ptr_0 = &Memory.mainrom[0];
byte* ptr_0 = Memory.mainrom;
byte* ptr = ptr_0 + address;
//result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
//result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
result = (short)(*ptr * 0x100 + *(ptr + 1));
}
else if (address >= 0x100000 && address + 1 <= 0x1fffff)
@ -408,9 +408,9 @@ namespace MAME.Core
}
else if (address >= 0x200000 && address <= 0x2fffff)
{
byte* ptr_0 = &Memory.mainrom[0];
byte* ptr_0 = Memory.mainrom;
byte* ptr = ptr_0 + (main_cpu_bank_address + (address & 0xfffff));
//result = (short)(Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1]);
//result = (short)(*(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff))) * 0x100 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 1)));
result = (short)(*ptr * 0x100 + *(ptr + 1));
}
/*else if (address >= 0x300000 && address <= 0x300001)
@ -485,7 +485,7 @@ namespace MAME.Core
}
else if (main_cpu_vector_table_source == 1)
{
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
}
else if (address >= 0x000080 && address + 3 <= 0x0fffff)
@ -494,7 +494,7 @@ namespace MAME.Core
{
//m68000Form.iStatus = 1;
}
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
else if (address >= 0x100000 && address + 3 <= 0x1fffff)
{
@ -502,7 +502,7 @@ namespace MAME.Core
}
else if (address >= 0x200000 && address + 3 <= 0x2fffff)
{
result = Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x1000000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1] * 0x10000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 2] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 3];
result = *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff))) * 0x1000000 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 1)) * 0x10000 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 2)) * 0x100 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 3));
}
else if (address >= 0xc00000 && address + 3 <= 0xcfffff)
{
@ -526,7 +526,7 @@ namespace MAME.Core
}
else if (main_cpu_vector_table_source == 1)
{
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
}
else if (address >= 0x000080 && address + 3 <= 0x0fffff)
@ -535,7 +535,7 @@ namespace MAME.Core
{
//m68000Form.iStatus = 1;
}
result = Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3];
result = *(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3));
}
else if (address >= 0x100000 && address + 3 <= 0x1fffff)
{
@ -543,7 +543,7 @@ namespace MAME.Core
}
else if (address >= 0x200000 && address + 3 <= 0x2fffff)
{
result = Memory.mainrom[main_cpu_bank_address + (address & 0xfffff)] * 0x1000000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 1] * 0x10000 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 2] * 0x100 + Memory.mainrom[main_cpu_bank_address + (address & 0xfffff) + 3];
result = *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff))) * 0x1000000 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 1)) * 0x10000 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 2)) * 0x100 + *(Memory.mainrom + (main_cpu_bank_address + (address & 0xfffff) + 3));
}
else if (address >= 0x300000 && address <= 0x31ffff)
{

View File

@ -63,16 +63,16 @@ namespace MAME.Core
switch (value)
{
case 0x0090:
Memory.mainrom[0x100] = 0x00;
Memory.mainrom[0x101] = 0xc2;
Memory.mainrom[0x102] = 0x00;
Memory.mainrom[0x103] = 0xfd;
*(Memory.mainrom + 0x100) = 0x00;
*(Memory.mainrom + 0x101) = 0xc2;
*(Memory.mainrom + 0x102) = 0x00;
*(Memory.mainrom + 0x103) = 0xfd;
break;
case 0x00f0:
Memory.mainrom[0x100] = 0x4e;
Memory.mainrom[0x101] = 0x45;
Memory.mainrom[0x102] = 0x4f;
Memory.mainrom[0x103] = 0x2d;
*(Memory.mainrom + 0x100) = 0x4e;
*(Memory.mainrom + 0x101) = 0x45;
*(Memory.mainrom + 0x102) = 0x4f;
*(Memory.mainrom + 0x103) = 0x2d;
break;
default:
break;
@ -113,7 +113,7 @@ namespace MAME.Core
public static void kof99_bankswitch_w(int data)
{
int bankaddress;
data =
(((data >> 14) & 1) << 0) +
(((data >> 6) & 1) << 1) +
@ -144,7 +144,7 @@ namespace MAME.Core
public static void garou_bankswitch_w(int data)
{
int bankaddress;
data =
(((data >> 5) & 1) << 0) +
(((data >> 9) & 1) << 1) +
@ -311,7 +311,7 @@ namespace MAME.Core
extra_ram[0x1ff1] = 0xa0;
extra_ram[0x1ff2] &= 0x7f;
main_cpu_bank_address = address + 0x100000;
Memory.mainrom[0x58197] = prt;
*(Memory.mainrom + 0x58197) = prt;
}
}
public static void kof2003p_w(int offset)
@ -323,12 +323,12 @@ namespace MAME.Core
extra_ram[0x1ff1] &= 0xfe;
extra_ram[0x1ff2] &= 0x7f;
main_cpu_bank_address = address + 0x100000;
Memory.mainrom[0x58197] = prt;
*(Memory.mainrom + 0x58197) = prt;
}
}
public static byte sbp_protection_r(int offset)
{
byte origdata = Memory.mainrom[offset + 0x200];
byte origdata = *(Memory.mainrom + offset + 0x200);
byte data = (byte)BITSWAP8(origdata, 3, 2, 1, 0, 7, 6, 5, 4);
int realoffset = 0x200 + offset;
if (realoffset == 0xd5e || realoffset == 0xd5f)
@ -354,7 +354,7 @@ namespace MAME.Core
{
if (extra_ram[0x1ffc] == 0 && extra_ram[0x1ffd] == 0)
{
Memory.mainrom[0xe0000 + offset] = (byte)data;
*(Memory.mainrom + 0xe0000 + offset) = (byte)data;
}
else
{
@ -365,8 +365,8 @@ namespace MAME.Core
{
if (extra_ram[0x1ffc] == 0 && extra_ram[0x1ffd] == 0)
{
Memory.mainrom[0xe0000 + offset] = (byte)(data >> 8);
Memory.mainrom[0xe0000 + offset + 1] = (byte)data;
*(Memory.mainrom + 0xe0000 + offset) = (byte)(data >> 8);
*(Memory.mainrom + 0xe0000 + offset + 1) = (byte)data;
}
else
{

View File

@ -16,7 +16,7 @@
{
if (address < 0x100000 + Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address - 0x100000]);
result = (sbyte)(*(Memory.mainrom + (address - 0x100000)));
}
else
{
@ -41,7 +41,7 @@
{
if (address < 0x100000 + Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address - 0x100000]);
result = (sbyte)(*(Memory.mainrom + (address - 0x100000)));
}
else
{
@ -130,7 +130,7 @@
{
if (address + 1 < 0x100000 + Memory.mainromLength)
{
result = (short)(Memory.mainrom[address - 0x100000] * 0x100 + Memory.mainrom[address - 0x100000 + 1]);
result = (short)(*(Memory.mainrom + (address - 0x100000)) * 0x100 + *(Memory.mainrom + (address - 0x100000 + 1)));
}
else
{
@ -155,7 +155,7 @@
{
if (address + 1 < 0x100000 + Memory.mainromLength)
{
result = (short)(Memory.mainrom[address - 0x100000] * 0x100 + Memory.mainrom[address - 0x100000 + 1]);
result = (short)(*(Memory.mainrom + (address - 0x100000)) * 0x100 + *(Memory.mainrom + (address - 0x100000 + 1)));
}
else
{
@ -237,7 +237,7 @@
{
if (address + 3 < 0x100000 + Memory.mainromLength)
{
result = Memory.mainrom[address - 0x100000] * 0x1000000 + Memory.mainrom[address - 0x100000 + 1] * 0x10000 + Memory.mainrom[address - 0x100000 + 2] * 0x100 + Memory.mainrom[address - 0x100000 + 3];
result = *(Memory.mainrom + (address - 0x100000)) * 0x1000000 + *(Memory.mainrom + (address - 0x100000 + 1)) * 0x10000 + *(Memory.mainrom + (address - 0x100000 + 2)) * 0x100 + *(Memory.mainrom + (address - 0x100000 + 3));
}
else
{
@ -262,7 +262,7 @@
{
if (address + 3 < 0x100000 + Memory.mainromLength)
{
result = Memory.mainrom[address - 0x100000] * 0x1000000 + Memory.mainrom[address - 0x100000 + 1] * 0x10000 + Memory.mainrom[address - 0x100000 + 2] * 0x100 + Memory.mainrom[address - 0x100000 + 3];
result = *(Memory.mainrom + (address - 0x100000)) * 0x1000000 + *(Memory.mainrom + (address - 0x100000 + 1)) * 0x10000 + *(Memory.mainrom + (address - 0x100000 + 2)) * 0x100 + *(Memory.mainrom + (address - 0x100000 + 3));
}
else
{

View File

@ -16,7 +16,7 @@ namespace MAME.Core
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else
{
@ -29,12 +29,12 @@ namespace MAME.Core
byte result = 0;
if (address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address == 0xc000)
{
@ -77,12 +77,12 @@ namespace MAME.Core
{
if (address <= 0x7fff)
{
Memory.mainrom[address] = value;
*(Memory.mainrom + (address)) = value;
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
Memory.mainrom[basebankmain + offset] = value;
*(Memory.mainrom + (basebankmain + offset)) = value;
}
else if (address == 0xc200)
{

View File

@ -12,12 +12,12 @@ namespace MAME.Core
byte result = 0;
if (address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -73,12 +73,12 @@ namespace MAME.Core
byte result = 0;
if (address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -134,12 +134,12 @@ namespace MAME.Core
byte result = 0;
if (address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -207,7 +207,7 @@ namespace MAME.Core
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
Memory.mainrom[basebankmain + offset] = value;
*(Memory.mainrom + (basebankmain + offset)) = value;
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -263,7 +263,7 @@ namespace MAME.Core
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
Memory.mainrom[basebankmain + offset] = value;
*(Memory.mainrom + (basebankmain + offset)) = value;
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -445,12 +445,12 @@ namespace MAME.Core
byte result = 0;
if (address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else
{
@ -463,12 +463,12 @@ namespace MAME.Core
byte result = 0;
if (address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
result = Memory.mainrom[basebankmain + offset];
result = *(Memory.mainrom + (basebankmain + offset));
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -505,7 +505,7 @@ namespace MAME.Core
else if (address >= 0x8000 && address <= 0xbfff)
{
int offset = address - 0x8000;
Memory.mainrom[basebankmain + offset] = value;
*(Memory.mainrom + (basebankmain + offset)) = value;
}
else if (address >= 0xc000 && address <= 0xdcff)
{
@ -898,7 +898,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -916,7 +916,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1040,7 +1040,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1058,7 +1058,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1126,7 +1126,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1145,7 +1145,7 @@ namespace MAME.Core
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1200,7 +1200,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)value;
*(Memory.mainrom + (address)) = (byte)value;
}
}
else if (address >= 0x0ff000 && address <= 0x0ff7ff)
@ -1342,8 +1342,8 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 8);
Memory.mainrom[address + 1] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 1)) = (byte)value;
}
}
else if (address >= 0x0ff000 && address + 1 <= 0x0ff7ff)
@ -1426,10 +1426,10 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 24);
Memory.mainrom[address + 1] = (byte)(value >> 16);
Memory.mainrom[address + 2] = (byte)(value >> 8);
Memory.mainrom[address + 3] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 24);
*(Memory.mainrom + (address + 1)) = (byte)(value >> 16);
*(Memory.mainrom + (address + 2)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 3)) = (byte)value;
}
}
else if (address >= 0x0ff000 && address + 3 <= 0x0ff7ff)
@ -1485,7 +1485,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -1606,7 +1606,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1623,7 +1623,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -1688,7 +1688,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1706,7 +1706,7 @@ namespace MAME.Core
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -1762,7 +1762,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)value;
*(Memory.mainrom + (address)) = (byte)value;
}
}
else if (address >= 0x0ff000 && address <= 0x0fffff)
@ -1893,8 +1893,8 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 8);
Memory.mainrom[address + 1] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 1)) = (byte)value;
}
}
else if (address >= 0x0ff000 && address + 1 <= 0x0fffff)
@ -1969,10 +1969,10 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 24);
Memory.mainrom[address + 1] = (byte)(value >> 16);
Memory.mainrom[address + 2] = (byte)(value >> 8);
Memory.mainrom[address + 3] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 24);
*(Memory.mainrom + (address + 1)) = (byte)(value >> 16);
*(Memory.mainrom + (address + 2)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 3)) = (byte)value;
}
}
else if (address >= 0x0ff000 && address + 3 <= 0x0fffff)
@ -2028,7 +2028,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else
{
@ -2125,7 +2125,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -2181,7 +2181,7 @@ namespace MAME.Core
if (address + 3 < Memory.mainromLength)
{
int offset = (address - 0x000000) / 2;
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -2227,7 +2227,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)value;
*(Memory.mainrom + (address)) = (byte)value;
}
}
else if (address >= 0x100000 && address <= 0x107fff)
@ -2346,8 +2346,8 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 8);
Memory.mainrom[address + 1] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 1)) = (byte)value;
}
}
else if (address >= 0x100000 && address + 1 <= 0x107fff)
@ -2417,10 +2417,10 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 24);
Memory.mainrom[address + 1] = (byte)(value >> 16);
Memory.mainrom[address + 2] = (byte)(value >> 8);
Memory.mainrom[address + 3] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 24);
*(Memory.mainrom + (address + 1)) = (byte)(value >> 16);
*(Memory.mainrom + (address + 2)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 3)) = (byte)value;
}
}
else if (address >= 0x100000 && address + 3 <= 0x107fff)

View File

@ -345,22 +345,22 @@ namespace MAME.Core
}
public unsafe static void driver_init_opwolf()
{
opwolf_region = Memory.mainrom[0x03ffff];
opwolf_region = *(Memory.mainrom + 0x03ffff);
opwolf_cchip_init();
opwolf_gun_xoffs = 0xec - Memory.mainrom[0x03ffb1];
opwolf_gun_yoffs = 0x1c - Memory.mainrom[0x03ffaf];
opwolf_gun_xoffs = 0xec - *(Memory.mainrom + 0x03ffb1);
opwolf_gun_yoffs = 0x1c - *(Memory.mainrom + 0x03ffaf);
basebanksnd = 0x10000;
}
public unsafe static void driver_init_opwolfb()
{
opwolf_region = Memory.mainrom[0x03ffff];
opwolf_region = *(Memory.mainrom + 0x03ffff);
opwolf_gun_xoffs = -2;
opwolf_gun_yoffs = 17;
basebanksnd = 0x10000;
}
public unsafe static void driver_init_opwolfp()
{
opwolf_region = Memory.mainrom[0x03ffff];
opwolf_region = *(Memory.mainrom + 0x03ffff);
opwolf_gun_xoffs = 5;
opwolf_gun_yoffs = 30;
basebanksnd = 0x10000;

View File

@ -12,7 +12,7 @@ namespace MAME.Core
sbyte result = 0;
if (address <= 0x07ffff)
{
result = (sbyte)(Memory.mainrom[address]);
result = (sbyte)(*(Memory.mainrom + (address)));
}
else if (address >= 0x800000 && address <= 0x801fff)
{
@ -40,7 +40,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -197,7 +197,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -223,7 +223,7 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -304,7 +304,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -330,7 +330,7 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -390,7 +390,7 @@ namespace MAME.Core
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)value;
*(Memory.mainrom + (address)) = (byte)value;
}
}
else if (address >= 0x400000 && address <= 0x40ffff)
@ -525,8 +525,8 @@ namespace MAME.Core
{
if (address + 1 < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 8);
Memory.mainrom[address + 1] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 1)) = (byte)value;
}
}
else if (address >= 0x400000 && address + 1 <= 0x40ffff)
@ -605,10 +605,10 @@ namespace MAME.Core
{
if (address + 3 < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 24);
Memory.mainrom[address + 1] = (byte)(value >> 16);
Memory.mainrom[address + 2] = (byte)(value >> 8);
Memory.mainrom[address + 3] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 24);
*(Memory.mainrom + (address + 1)) = (byte)(value >> 16);
*(Memory.mainrom + (address + 2)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 3)) = (byte)value;
}
}
else if (address >= 0x400000 && address + 3 <= 0x40ffff)

View File

@ -10,7 +10,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -43,7 +43,7 @@
{
if (address < Memory.mainromLength)
{
result = (sbyte)Memory.mainrom[address];
result = (sbyte)*(Memory.mainrom + (address));
}
else
{
@ -200,7 +200,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -226,7 +226,7 @@
{
if (address + 1 < Memory.mainromLength)
{
result = (short)(Memory.mainrom[address] * 0x100 + Memory.mainrom[address + 1]);
result = (short)(*(Memory.mainrom + (address)) * 0x100 + *(Memory.mainrom + (address + 1)));
}
else
{
@ -306,7 +306,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -332,7 +332,7 @@
{
if (address + 3 < Memory.mainromLength)
{
result = (int)(Memory.mainrom[address] * 0x1000000 + Memory.mainrom[address + 1] * 0x10000 + Memory.mainrom[address + 2] * 0x100 + Memory.mainrom[address + 3]);
result = (int)(*(Memory.mainrom + (address)) * 0x1000000 + *(Memory.mainrom + (address + 1)) * 0x10000 + *(Memory.mainrom + (address + 2)) * 0x100 + *(Memory.mainrom + (address + 3)));
}
else
{
@ -391,7 +391,7 @@
{
if (address < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)value;
*(Memory.mainrom + (address)) = (byte)value;
}
}
else if (address >= 0x100000 && address <= 0x100001)
@ -507,8 +507,8 @@
{
if (address + 1 < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 8);
Memory.mainrom[address + 1] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 1)) = (byte)value;
}
}
else if (address >= 0x100000 && address + 1 <= 0x100001)
@ -578,10 +578,10 @@
{
if (address + 1 < Memory.mainromLength)
{
Memory.mainrom[address] = (byte)(value >> 24);
Memory.mainrom[address + 1] = (byte)(value >> 16);
Memory.mainrom[address + 2] = (byte)(value >> 8);
Memory.mainrom[address + 3] = (byte)value;
*(Memory.mainrom + (address)) = (byte)(value >> 24);
*(Memory.mainrom + (address + 1)) = (byte)(value >> 16);
*(Memory.mainrom + (address + 2)) = (byte)(value >> 8);
*(Memory.mainrom + (address + 3)) = (byte)value;
}
}
else if (address >= 0x200000 && address + 3 <= 0x20000f)

View File

@ -11,11 +11,11 @@ namespace MAME.Core
byte result = 0;
if (address >= 0 && address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -28,7 +28,7 @@ namespace MAME.Core
}
else if (address >= 0x8000 && address <= 0xbfff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
return result;
}
@ -37,11 +37,11 @@ namespace MAME.Core
byte result = 0;
if (address >= 0 && address <= 0x7fff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0x8000 && address <= 0xbfff)
{
result = Memory.mainrom[address];
result = *(Memory.mainrom + (address));
}
else if (address >= 0xc000 && address <= 0xcfff)
{
@ -121,11 +121,11 @@ namespace MAME.Core
{
if (address >= 0x0000 && address <= 0x7fff)
{
Memory.mainrom[address] = value;
*(Memory.mainrom + (address)) = value;
}
else if (address >= 0x8000 && address <= 0xbfff)
{
Memory.mainrom[address] = value;
*(Memory.mainrom + (address)) = value;
}
else if (address >= 0xc000 && address <= 0xcfff)
{

View File

@ -1,8 +1,9 @@
using System;
using System.Runtime.InteropServices;
namespace MAME.Core
{
public class FM
public unsafe class FM
{
public class FM_OPN
{
@ -10,7 +11,26 @@ namespace MAME.Core
public FM_ST ST;
public FM_3SLOT SL3;
public FM_CH[] CH;
public uint[] pan;
//public uint[] pan;
#region //指针化 pan
uint[] pan_src;
GCHandle pan_handle;
public uint* pan;
public int panLength;
public bool pan_IsNull => pan == null;
public uint[] pan_set
{
set
{
pan_handle.ReleaseGCHandle();
pan_src = value;
panLength = value.Length;
pan_src.GetObjectPtr(ref pan_handle, ref pan);
}
}
#endregion
public uint eg_cnt;
public uint eg_timer;
public uint eg_timer_add;
@ -36,7 +56,8 @@ namespace MAME.Core
SL3.fc = new uint[3];
SL3.kcode = new byte[3];
SL3.block_fnum = new uint[3];
pan = new uint[12];
//pan = new uint[12];
pan_set = new uint[12];
fn_table = new uint[4096];
lfo_freq = new int[8];
ST.timer_handler = null;
@ -624,20 +645,21 @@ namespace MAME.Core
uint eg_out;
//减少寻址
int imem_ToIndex_c = imem[c];
int* out_fm_ptr = out_fm;
fixed (FM_SLOT* CH_c_SLOT = &CH[c].SLOT[0])//因为是引用类型,所以敢这么玩
fixed (int* out_fm_ptr = &out_fm[0])
//fixed (int* out_fm_ptr = &out_fm[0])
{
FM_SLOT* cslot_0 = &CH_c_SLOT[0];
FM_SLOT* cslot_1 = &CH_c_SLOT[1];
FM_SLOT* cslot_2 = &CH_c_SLOT[2];
FM_SLOT* cslot_3 = &CH_c_SLOT[3];
FM_SLOT* cslot_0 = CH_c_SLOT;
FM_SLOT* cslot_1 = CH_c_SLOT + 1;
FM_SLOT* cslot_2 = CH_c_SLOT + 2;
FM_SLOT* cslot_3 = CH_c_SLOT + 3;
//out_fm[8] = out_fm[9] = out_fm[10] = out_fm[11] = 0; //本来就是注释->m2 = c1 = c2 = mem = 0;
out_fm_ptr[8] = out_fm_ptr[9] = out_fm_ptr[10] = out_fm_ptr[11] = 0;
*(out_fm_ptr + 8) = *(out_fm_ptr + 9) = *(out_fm_ptr + 10) = *(out_fm_ptr + 11) = 0;
//set_mem(c);
if (imem_ToIndex_c == 8 || imem_ToIndex_c == 10 || imem_ToIndex_c == 11)
out_fm_ptr[imem_ToIndex_c] = CH[c].mem_value;
*(out_fm_ptr + imem_ToIndex_c) = CH[c].mem_value;
//eg_out = volume_calc(c, 0);
eg_out = (uint)(cslot_0->vol_out + ((LFO_AM >> CH[c].ams) & cslot_0->AMmask));
@ -648,7 +670,8 @@ namespace MAME.Core
//set_value1(c);
if (iconnect1[c] == 12)
{
out_fm_ptr[11] = out_fm_ptr[9] = out_fm_ptr[10] = CH[c].op1_out0;
//out_fm_ptr[11] = out_fm_ptr[9] = out_fm_ptr[10] = CH[c].op1_out0;
*(out_fm_ptr + 11) = *(out_fm_ptr + 9) = *(out_fm_ptr + 10) = CH[c].op1_out0;
}
else
{
@ -1358,15 +1381,76 @@ namespace MAME.Core
public delegate void reset_handler();
private static int[] lfo_pm_table = new int[128 * 8 * 32];
private static int[] iconnect1 = new int[8], iconnect2 = new int[8], iconnect3 = new int[8], iconnect4 = new int[6], imem = new int[13];
public static int[] out_fm = new int[13];
public static int[] out_adpcm = new int[4];
public static int[] out_delta = new int[4];
//public static int[] out_fm = new int[13];
#region //指针化 out_fm
static int[] out_fm_src;
static GCHandle out_fm_handle;
public static int* out_fm;
public static int out_fmLength;
public static bool out_fm_IsNull => out_fm == null;
public static int[] out_fm_set
{
set
{
out_fm_handle.ReleaseGCHandle();
out_fm_src = value;
out_fmLength = value.Length;
out_fm_src.GetObjectPtr(ref out_fm_handle, ref out_fm);
}
}
#endregion
//public static int[] out_adpcm = new int[4];
#region //指针化 out_adpcm
static int[] out_adpcm_src;
static GCHandle out_adpcm_handle;
public static int* out_adpcm;
public static int out_adpcmLength;
public static bool out_adpcm_IsNull => out_adpcm == null;
public static int[] out_adpcm_set
{
set
{
out_adpcm_handle.ReleaseGCHandle();
out_adpcm_src = value;
out_adpcmLength = value.Length;
out_adpcm_src.GetObjectPtr(ref out_adpcm_handle, ref out_adpcm);
}
}
#endregion
//public static int[] out_delta = new int[4];
#region //指针化 out_delta
static int[] out_delta_src;
static GCHandle out_delta_handle;
public static int* out_delta;
public static int out_deltaLength;
public static bool out_delta_IsNull => out_delta == null;
public static int[] out_delta_set
{
set
{
out_delta_handle.ReleaseGCHandle();
out_delta_src = value;
out_deltaLength = value.Length;
out_delta_src.GetObjectPtr(ref out_delta_handle, ref out_delta);
}
}
#endregion
public static byte[] ymsndrom;
public static int LFO_AM;
public static int LFO_PM;
private static int fn_max;
public static void FM_init()
{
//初始化一下
out_fm_set = new int[13];
out_adpcm_set = new int[4];
out_delta_set = new int[4];
init_tables();
}
public static int Limit(int val, int max, int min)

View File

@ -547,15 +547,29 @@ namespace MAME.Core
int* streamoutput_0_offset_ptr = &Sound.ym2610stream.streamoutput_Ptrs[0][offset];
int* streamoutput_1_offset_ptr = &Sound.ym2610stream.streamoutput_Ptrs[1][offset];
int* out_adpcm_ptr_0 = FM.out_adpcm;
int* out_adpcm_ptr_1 = FM.out_adpcm + 1;
int* out_adpcm_ptr_2 = FM.out_adpcm + 2;
int* out_adpcm_ptr_3 = FM.out_adpcm + 3;
int* out_delta_ptr_0 = FM.out_delta;
int* out_delta_ptr_1 = FM.out_delta + 1;
int* out_delta_ptr_2 = FM.out_delta + 2;
int* out_delta_ptr_3 = FM.out_delta + 3;
for (i = 0; i < length; i++)
{
OPN.advance_lfo();
FM.out_adpcm[2] = FM.out_adpcm[1] = FM.out_adpcm[3] = 0;
FM.out_delta[2] = FM.out_delta[1] = FM.out_delta[3] = 0;
FM.out_fm[1] = 0;
FM.out_fm[2] = 0;
FM.out_fm[4] = 0;
FM.out_fm[5] = 0;
//FM.out_adpcm[2] = FM.out_adpcm[1] = FM.out_adpcm[3] = 0;
*out_adpcm_ptr_2 = *out_adpcm_ptr_1 = *out_adpcm_ptr_3 = 0;
//FM.out_delta[2] = FM.out_delta[1] = FM.out_delta[3] = 0;
*out_delta_ptr_2 = *out_delta_ptr_1 = *out_delta_ptr_3 = 0;
//FM.out_fm[1] = 0;
//FM.out_fm[2] = 0;
//FM.out_fm[4] = 0;
//FM.out_fm[5] = 0;
*(FM.out_fm + 1) = 0;
*(FM.out_fm + 2) = 0;
*(FM.out_fm + 4) = 0;
*(FM.out_fm + 5) = 0;
OPN.eg_timer += OPN.eg_timer_add;
while (OPN.eg_timer >= OPN.eg_timer_overflow)
{
@ -570,10 +584,10 @@ namespace MAME.Core
//OPN.chan_calc(2, 2);
//OPN.chan_calc(4, 4);
//OPN.chan_calc(5, 5);
OPN.chan_calc(1,false);
OPN.chan_calc(2,true);
OPN.chan_calc(4,false);
OPN.chan_calc(5,false);
OPN.chan_calc(1, false);
OPN.chan_calc(2, true);
OPN.chan_calc(4, false);
OPN.chan_calc(5, false);
if ((YMDeltat.DELTAT.portstate & 0x80) != 0)
{
YMDeltat.YM_DELTAT_ADPCM_CALC();
@ -586,18 +600,30 @@ namespace MAME.Core
}
}
int lt, rt;
lt = FM.out_adpcm[2] + FM.out_adpcm[3];
rt = FM.out_adpcm[1] + FM.out_adpcm[3];
lt += (FM.out_delta[2] + FM.out_delta[3]) >> 9;
rt += (FM.out_delta[1] + FM.out_delta[3]) >> 9;
lt += (int)((FM.out_fm[1] >> 1) & OPN.pan[2]);
rt += (int)((FM.out_fm[1] >> 1) & OPN.pan[3]);
lt += (int)((FM.out_fm[2] >> 1) & OPN.pan[4]);
rt += (int)((FM.out_fm[2] >> 1) & OPN.pan[5]);
lt += (int)((FM.out_fm[4] >> 1) & OPN.pan[8]);
rt += (int)((FM.out_fm[4] >> 1) & OPN.pan[9]);
lt += (int)((FM.out_fm[5] >> 1) & OPN.pan[10]);
rt += (int)((FM.out_fm[5] >> 1) & OPN.pan[11]);
//lt = FM.out_adpcm[2] + FM.out_adpcm[3];
lt = *out_adpcm_ptr_2 + *out_adpcm_ptr_3;
//rt = FM.out_adpcm[1] + FM.out_adpcm[3];
rt = *out_adpcm_ptr_1 + *out_adpcm_ptr_3;
//lt += (FM.out_delta[2] + FM.out_delta[3]) >> 9;
lt += (*out_delta_ptr_2 + *out_delta_ptr_3) >> 9;
//rt += (FM.out_delta[1] + FM.out_delta[3]) >> 9;
rt += (*out_delta_ptr_1 + *out_delta_ptr_3) >> 9;
//lt += (int)((FM.out_fm[1] >> 1) & OPN.pan[2]);
//rt += (int)((FM.out_fm[1] >> 1) & OPN.pan[3]);
//lt += (int)((FM.out_fm[2] >> 1) & OPN.pan[4]);
//rt += (int)((FM.out_fm[2] >> 1) & OPN.pan[5]);
//lt += (int)((FM.out_fm[4] >> 1) & OPN.pan[8]);
//rt += (int)((FM.out_fm[4] >> 1) & OPN.pan[9]);
//lt += (int)((FM.out_fm[5] >> 1) & OPN.pan[10]);
//rt += (int)((FM.out_fm[5] >> 1) & OPN.pan[11]);
lt += (int)((*(FM.out_fm + 1) >> 1) & *(OPN.pan + 2));
rt += (int)((*(FM.out_fm + 1) >> 1) & *(OPN.pan + 3));
lt += (int)((*(FM.out_fm + 2) >> 1) & *(OPN.pan + 4));
rt += (int)((*(FM.out_fm + 2) >> 1) & *(OPN.pan + 5));
lt += (int)((*(FM.out_fm + 4) >> 1) & *(OPN.pan + 8));
rt += (int)((*(FM.out_fm + 4) >> 1) & *(OPN.pan + 9));
lt += (int)((*(FM.out_fm + 5) >> 1) & *(OPN.pan + 10));
rt += (int)((*(FM.out_fm + 5) >> 1) & *(OPN.pan + 11));
//lt = FM.Limit(lt, 32767, -32768);
//rt = FM.Limit(rt, 32767, -32768);
lt = Math.Min(lt, 32767);

View File

@ -279,7 +279,7 @@
return val;
}
}
private static void YM_DELTAT_synthesis_from_external_memory()
private unsafe static void YM_DELTAT_synthesis_from_external_memory()
{
int step;
int data;
@ -340,9 +340,10 @@
DELTAT.adpcml = DELTAT.prev_acc * (int)((1 << 16) - DELTAT.now_step);
DELTAT.adpcml += (DELTAT.acc * (int)DELTAT.now_step);
DELTAT.adpcml = (DELTAT.adpcml >> 16) * (int)DELTAT.volume;
FM.out_delta[DELTAT.pan_offset] += DELTAT.adpcml;
//FM.out_delta[DELTAT.pan_offset] += DELTAT.adpcml;
*(FM.out_delta + DELTAT.pan_offset) += DELTAT.adpcml;
}
private static void YM_DELTAT_synthesis_from_CPU_memory()
private unsafe static void YM_DELTAT_synthesis_from_CPU_memory()
{
int step;
int data;
@ -376,7 +377,8 @@
DELTAT.adpcml = DELTAT.prev_acc * (int)((1 << 16) - DELTAT.now_step);
DELTAT.adpcml += (DELTAT.acc * (int)DELTAT.now_step);
DELTAT.adpcml = (DELTAT.adpcml >> 16) * (int)DELTAT.volume;
FM.out_delta[DELTAT.pan_offset] += DELTAT.adpcml;
//FM.out_delta[DELTAT.pan_offset] += DELTAT.adpcml;
*(FM.out_delta + DELTAT.pan_offset) += DELTAT.adpcml;
}
public static void YM_DELTAT_ADPCM_CALC()
{

View File

@ -175,8 +175,8 @@ namespace AxibugEmuOnline.Client.Settings
controller.SetBinding(EssgeeSingleKey.DOWN, device.Down, 0);
controller.SetBinding(EssgeeSingleKey.LEFT, device.Left, 0);
controller.SetBinding(EssgeeSingleKey.RIGHT, device.Right, 0);
controller.SetBinding(EssgeeSingleKey.BTN_1, device.A, 0);
controller.SetBinding(EssgeeSingleKey.BTN_2, device.B, 0);
controller.SetBinding(EssgeeSingleKey.BTN_1, device.B, 0);
controller.SetBinding(EssgeeSingleKey.BTN_2, device.A, 0);
controller.SetBinding(EssgeeSingleKey.BTN_3, device.X, 0);
controller.SetBinding(EssgeeSingleKey.BTN_4, device.Y, 0);

View File

@ -186,6 +186,7 @@ namespace AxibugEmuOnline.Client
}
App.log.Error(request.downloadHandler.errInfo);
//TODO callback 下游需要处理请求失败
callback.Invoke(null);
/*